From 53d3ab125ef583be8cfac907b308a6551b93067a Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Wed, 21 Oct 2015 13:08:24 -0400 Subject: Add type cast definitions for CPDF_String. This Cl adds ToString, CPDF_Object::AsString and CPDF_Object::IsString and updates the src to use them as needed. BUG=pdfium:201 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1417933002 . --- core/src/fpdftext/fpdf_text_int.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'core/src/fpdftext/fpdf_text_int.cpp') diff --git a/core/src/fpdftext/fpdf_text_int.cpp b/core/src/fpdftext/fpdf_text_int.cpp index 99f36a0858..9ab09e19e4 100644 --- a/core/src/fpdftext/fpdf_text_int.cpp +++ b/core/src/fpdftext/fpdf_text_int.cpp @@ -1288,8 +1288,7 @@ int32_t CPDF_TextPage::PreMarkedContent(PDFTEXT_Obj Obj) { CFX_ByteString tagStr = (CFX_ByteString)item.GetName(); pDict = ToDictionary(static_cast(item.GetParam())); CPDF_String* temp = - (CPDF_String*)(pDict ? pDict->GetElement(FX_BSTRC("ActualText")) - : NULL); + ToString(pDict ? pDict->GetElement(FX_BSTRC("ActualText")) : nullptr); if (temp) { bExist = TRUE; actText = temp->GetUnicodeText(); @@ -1359,8 +1358,7 @@ void CPDF_TextPage::ProcessMarkedContent(PDFTEXT_Obj Obj) { CFX_ByteString tagStr = (CFX_ByteString)item.GetName(); pDict = ToDictionary(static_cast(item.GetParam())); CPDF_String* temp = - (CPDF_String*)(pDict ? pDict->GetElement(FX_BSTRC("ActualText")) - : NULL); + ToString(pDict ? pDict->GetElement(FX_BSTRC("ActualText")) : nullptr); if (temp) { actText = temp->GetUnicodeText(); } -- cgit v1.2.3