From f0a7da7ec654a8a33b5f347074de69a5a8b769e2 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Thu, 26 Oct 2017 14:17:08 -0400 Subject: [Merge M63] Fix cpdf_textpage so it doesn't omit spaces. TBR=thestig@chromium.org Bug: pdfium:921,chromium:777024 Change-Id: I8864fd2ebdccc5f94aaf70cd8295068bf4db8b68 Reviewed-on: https://pdfium-review.googlesource.com/16492 Reviewed-by: Lei Zhang Reviewed-by: Ryan Harrison Commit-Queue: Ryan Harrison (cherry picked from commit 25e763e99932a4d12cbd51b3c36411b44163c5d8) Reviewed-on: https://pdfium-review.googlesource.com/16932 --- core/fpdftext/cpdf_textpage.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/fpdftext/cpdf_textpage.cpp b/core/fpdftext/cpdf_textpage.cpp index fd33fb2f2f..82778b1658 100644 --- a/core/fpdftext/cpdf_textpage.cpp +++ b/core/fpdftext/cpdf_textpage.cpp @@ -1355,9 +1355,7 @@ CPDF_TextPage::GenerateCharacter CPDF_TextPage::ProcessInsertObject( } WideString PrevStr = m_pPreTextObj->GetFont()->UnicodeFromCharCode(PrevItem.m_CharCode); - if (PrevStr.IsEmpty()) - return GenerateCharacter::None; - wchar_t preChar = PrevStr[PrevStr.GetLength() - 1]; + wchar_t preChar = PrevStr.Last(); CFX_Matrix matrix = pObj->GetTextMatrix(); matrix.Concat(formMatrix); -- cgit v1.2.3