XFA: merge patch from CL 810223003

Cleanup: Refactor some code into its own function in fpdf_text_int.cpp.

Also use stdlib algorithms in a few places.

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/810223003

Conflicts:
	core/src/fpdftext/fpdf_text_int.cpp
1 file changed