summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_streamcontentparser.cpp
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2018-07-11 18:58:42 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-07-11 18:58:42 +0000
commit8ac090c4a57bc27044adc7abe8143ce45388b021 (patch)
tree1e7edcced6de44e83e11b63578bc1f8b00399f34 /core/fpdfapi/page/cpdf_streamcontentparser.cpp
parentb165ffb64e59998ec6d5f76c82bd2fe53734b3cd (diff)
downloadpdfium-8ac090c4a57bc27044adc7abe8143ce45388b021.tar.xz
Split CPDF_ContentMark::AddMark() into three versions.
One version is for a mark without a dictionary. The second is for a mark with a direct dictionary. The third is for a mark with indirect properties. Bug: pdfium:1118 Change-Id: Ice0ff11d5ba4eaf2ccdf57be49b9140ba5c9b159 Reviewed-on: https://pdfium-review.googlesource.com/37550 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_streamcontentparser.cpp')
-rw-r--r--core/fpdfapi/page/cpdf_streamcontentparser.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.cpp b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
index 01fb347a9a..ae55390eb2 100644
--- a/core/fpdfapi/page/cpdf_streamcontentparser.cpp
+++ b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
@@ -607,17 +607,19 @@ void CPDF_StreamContentParser::Handle_BeginMarkedContent_Dictionary() {
if (!pProperty)
return;
- bool bDirect = true;
- if (pProperty->IsName()) {
+ bool bIndirect = pProperty->IsName();
+ if (bIndirect) {
pProperty = FindResourceObj("Properties", pProperty->GetString());
if (!pProperty)
return;
- bDirect = false;
}
if (CPDF_Dictionary* pDict = pProperty->AsDictionary()) {
std::unique_ptr<CPDF_ContentMark> new_marks =
m_ContentMarksStack.top()->Clone();
- new_marks->AddMark(std::move(tag), pDict, bDirect);
+ if (bIndirect)
+ new_marks->AddMarkWithPropertiesDict(std::move(tag), pDict);
+ else
+ new_marks->AddMarkWithDirectDict(std::move(tag), pDict);
m_ContentMarksStack.push(std::move(new_marks));
}
}
@@ -685,7 +687,7 @@ void CPDF_StreamContentParser::Handle_BeginImage() {
void CPDF_StreamContentParser::Handle_BeginMarkedContent() {
std::unique_ptr<CPDF_ContentMark> new_marks =
m_ContentMarksStack.top()->Clone();
- new_marks->AddMark(GetString(0), nullptr, false);
+ new_marks->AddMark(GetString(0));
m_ContentMarksStack.push(std::move(new_marks));
}