summaryrefslogtreecommitdiff
path: root/core/fpdfapi
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi')
-rw-r--r--core/fpdfapi/page/cpdf_contentmark.cpp3
-rw-r--r--core/fpdfapi/page/cpdf_contentmark.h2
-rw-r--r--core/fpdfapi/page/cpdf_streamcontentparser.cpp6
-rw-r--r--core/fpdfapi/render/cpdf_renderstatus.cpp9
4 files changed, 9 insertions, 11 deletions
diff --git a/core/fpdfapi/page/cpdf_contentmark.cpp b/core/fpdfapi/page/cpdf_contentmark.cpp
index 77c29a53d7..a4bb15ed9a 100644
--- a/core/fpdfapi/page/cpdf_contentmark.cpp
+++ b/core/fpdfapi/page/cpdf_contentmark.cpp
@@ -23,6 +23,9 @@ std::unique_ptr<CPDF_ContentMark> CPDF_ContentMark::Clone() {
}
size_t CPDF_ContentMark::CountItems() const {
+ if (!m_Ref)
+ return 0;
+
return m_Ref->CountItems();
}
diff --git a/core/fpdfapi/page/cpdf_contentmark.h b/core/fpdfapi/page/cpdf_contentmark.h
index 241a0ffbf3..6012350398 100644
--- a/core/fpdfapi/page/cpdf_contentmark.h
+++ b/core/fpdfapi/page/cpdf_contentmark.h
@@ -29,8 +29,6 @@ class CPDF_ContentMark {
void AddMark(ByteString name, const CPDF_Dictionary* pDict, bool bDirect);
void DeleteLastMark();
- bool HasRef() const { return !!m_Ref; }
-
private:
class MarkData : public Retainable {
public:
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.cpp b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
index b2ac553191..c698c52370 100644
--- a/core/fpdfapi/page/cpdf_streamcontentparser.cpp
+++ b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
@@ -868,10 +868,8 @@ void CPDF_StreamContentParser::Handle_MarkPlace_Dictionary() {}
void CPDF_StreamContentParser::Handle_EndImage() {}
void CPDF_StreamContentParser::Handle_EndMarkedContent() {
- if (m_pCurContentMark->HasRef()) {
- m_pCurContentMark = m_pCurContentMark->Clone();
- m_pCurContentMark->DeleteLastMark();
- }
+ m_pCurContentMark = m_pCurContentMark->Clone();
+ m_pCurContentMark->DeleteLastMark();
}
void CPDF_StreamContentParser::Handle_EndText() {
diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp
index 29a30157df..433d32b886 100644
--- a/core/fpdfapi/render/cpdf_renderstatus.cpp
+++ b/core/fpdfapi/render/cpdf_renderstatus.cpp
@@ -1100,10 +1100,9 @@ void CPDF_RenderStatus::RenderSingleObject(CPDF_PageObject* pObj,
return;
}
m_pCurObj = pObj;
- if (m_Options.GetOCContext() && pObj->m_ContentMark.HasRef()) {
- if (!m_Options.GetOCContext()->CheckObjectVisible(pObj)) {
- return;
- }
+ if (m_Options.GetOCContext() &&
+ !m_Options.GetOCContext()->CheckObjectVisible(pObj)) {
+ return;
}
ProcessClipPath(pObj->m_ClipPath, pObj2Device);
if (ProcessTransparency(pObj, pObj2Device)) {
@@ -1129,7 +1128,7 @@ bool CPDF_RenderStatus::ContinueSingleObject(CPDF_PageObject* pObj,
}
m_pCurObj = pObj;
- if (m_Options.GetOCContext() && pObj->m_ContentMark.HasRef() &&
+ if (m_Options.GetOCContext() &&
!m_Options.GetOCContext()->CheckObjectVisible(pObj)) {
return false;
}