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

Unified Diff: core/fpdfdoc/cpdf_annotlist.cpp

Issue 2293403003: Check whether the annotation content is empty using CFX_WideString. (Closed)
Patch Set: Check whether the annotation content is empty using CFX_WideString. Created 4 years, 3 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
« no previous file with comments | « DEPS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfdoc/cpdf_annotlist.cpp
diff --git a/core/fpdfdoc/cpdf_annotlist.cpp b/core/fpdfdoc/cpdf_annotlist.cpp
index 631978175c5d8b5662fcc2fe7e1f96a89ce2b0fe..31c8542daaf34f8fc9639694f4be3572762a3616 100644
--- a/core/fpdfdoc/cpdf_annotlist.cpp
+++ b/core/fpdfdoc/cpdf_annotlist.cpp
@@ -24,7 +24,9 @@ std::unique_ptr<CPDF_Annot> CreatePopupAnnot(CPDF_Annot* pAnnot,
if (!pParentDict)
return std::unique_ptr<CPDF_Annot>();
- CFX_ByteString sContents = pParentDict->GetStringBy("Contents");
+ // TODO(jaepark): We shouldn't strip BOM for some strings and not for others.
+ // See pdfium:593.
+ CFX_WideString sContents = pParentDict->GetUnicodeTextBy("Contents");
if (sContents.IsEmpty())
return std::unique_ptr<CPDF_Annot>();
@@ -32,7 +34,7 @@ std::unique_ptr<CPDF_Annot> CreatePopupAnnot(CPDF_Annot* pAnnot,
pAnnotDict->SetAtName("Type", "Annot");
pAnnotDict->SetAtName("Subtype", "Popup");
pAnnotDict->SetAtString("T", pParentDict->GetStringBy("T"));
- pAnnotDict->SetAtString("Contents", sContents);
+ pAnnotDict->SetAtString("Contents", sContents.UTF8Encode());
CFX_FloatRect rect = pParentDict->GetRectBy("Rect");
rect.Normalize();
« no previous file with comments | « DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698