Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3374)

Unified Diff: core/src/fpdftext/fpdf_text_int.cpp

Issue 1410343003: [Merge to XFA] Revert "Revert "Add type cast definitions for CPDF_Dictionary."" (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: 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 e427a1d2a8c74b64a5fe2463d3058b4a6fb4a310..152bb4448fc2c2ef8a97f4f3bbf55b35be280b84 100644
--- a/core/src/fpdftext/fpdf_text_int.cpp
+++ b/core/src/fpdftext/fpdf_text_int.cpp
@@ -1339,7 +1339,7 @@ int32_t CPDF_TextPage::PreMarkedContent(PDFTEXT_Obj Obj) {
for (n = 0; n < nContentMark; n++) {
CPDF_ContentMarkItem& item = pMarkData->GetItem(n);
CFX_ByteString tagStr = (CFX_ByteString)item.GetName();
- pDict = (CPDF_Dictionary*)item.GetParam();
+ pDict = ToDictionary(static_cast<CPDF_Object*>(item.GetParam()));
CPDF_String* temp =
(CPDF_String*)(pDict ? pDict->GetElement(FX_BSTRC("ActualText"))
: NULL);
@@ -1410,8 +1410,12 @@ void CPDF_TextPage::ProcessMarkedContent(PDFTEXT_Obj Obj) {
for (n = 0; n < nContentMark; n++) {
CPDF_ContentMarkItem& item = pMarkData->GetItem(n);
CFX_ByteString tagStr = (CFX_ByteString)item.GetName();
- pDict = (CPDF_Dictionary*)item.GetParam();
- CPDF_String* temp = (CPDF_String*)pDict->GetElement(FX_BSTRC("ActualText"));
+
+ pDict = ToDictionary(static_cast<CPDF_Object*>(item.GetParam()));
+ CPDF_String* temp =
+ (CPDF_String*)(pDict ? pDict->GetElement(FX_BSTRC("ActualText"))
dsinclair 2015/10/20 19:18:31 On XFA the ternary is missing and it was just: (C
Tom Sepez 2015/10/20 19:49:28 Acknowledged.
+ : NULL);
+
if (temp) {
actText = temp->GetUnicodeText();
}

Powered by Google App Engine
This is Rietveld 408576698