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

Unified Diff: core/fpdftext/cpdf_textpage.cpp

Issue 2358043003: Make ownership explicit in CPDF_ContentMarkItem (Closed)
Patch Set: Not owned 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 | « core/fpdfapi/fpdf_page/cpdf_contentmarkitem.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdftext/cpdf_textpage.cpp
diff --git a/core/fpdftext/cpdf_textpage.cpp b/core/fpdftext/cpdf_textpage.cpp
index 105694329221539426e00d15e1be6c98e48f9f0c..d88464bfc45278f197a612f56bd7320f10cf840a 100644
--- a/core/fpdftext/cpdf_textpage.cpp
+++ b/core/fpdftext/cpdf_textpage.cpp
@@ -818,11 +818,10 @@ FPDFText_MarkedContent CPDF_TextPage::PreMarkedContent(PDFTEXT_Obj Obj) {
int n = 0;
for (n = 0; n < nContentMark; n++) {
const CPDF_ContentMarkItem& item = pTextObj->m_ContentMark.GetItem(n);
- if (item.GetParamType() == CPDF_ContentMarkItem::ParamType::None)
- continue;
pDict = item.GetParam();
- CPDF_String* temp =
- ToString(pDict ? pDict->GetObjectFor("ActualText") : nullptr);
+ if (!pDict)
+ continue;
+ CPDF_String* temp = ToString(pDict->GetObjectFor("ActualText"));
if (temp) {
bExist = true;
actText = temp->GetUnicodeText();
@@ -877,12 +876,9 @@ void CPDF_TextPage::ProcessMarkedContent(PDFTEXT_Obj Obj) {
return;
CFX_WideString actText;
- CPDF_Dictionary* pDict = nullptr;
for (int n = 0; n < nContentMark; n++) {
const CPDF_ContentMarkItem& item = pTextObj->m_ContentMark.GetItem(n);
- if (item.GetParamType() == CPDF_ContentMarkItem::ParamType::None)
- continue;
- pDict = item.GetParam();
+ CPDF_Dictionary* pDict = item.GetParam();
if (pDict)
actText = pDict->GetUnicodeTextFor("ActualText");
}
« no previous file with comments | « core/fpdfapi/fpdf_page/cpdf_contentmarkitem.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698