From 25e763e99932a4d12cbd51b3c36411b44163c5d8 Mon Sep 17 00:00:00 2001 From: Andrew Weintraub Date: Mon, 23 Oct 2017 14:38:01 -0400 Subject: Fix cpdf_textpage so it doesn't omit spaces. Bug: pdfium:921 Change-Id: I8864fd2ebdccc5f94aaf70cd8295068bf4db8b68 Reviewed-on: https://pdfium-review.googlesource.com/16492 Reviewed-by: Lei Zhang Reviewed-by: Ryan Harrison Commit-Queue: Ryan Harrison --- core/fpdftext/cpdf_textpage.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'core') 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