summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/fpdfapi/page/cpdf_pageobjectholder.cpp5
-rw-r--r--core/fpdfapi/page/cpdf_pageobjectholder.h6
2 files changed, 11 insertions, 0 deletions
diff --git a/core/fpdfapi/page/cpdf_pageobjectholder.cpp b/core/fpdfapi/page/cpdf_pageobjectholder.cpp
index cca7565a68..3eb88ec9c0 100644
--- a/core/fpdfapi/page/cpdf_pageobjectholder.cpp
+++ b/core/fpdfapi/page/cpdf_pageobjectholder.cpp
@@ -119,6 +119,11 @@ bool CPDF_PageObjectHolder::RemovePageObject(CPDF_PageObject* pPageObj) {
it->release();
m_PageObjectList.erase(it);
+
+ int32_t content_stream = pPageObj->GetContentStream();
+ if (content_stream >= 0)
+ m_DirtyStreams.insert(content_stream);
+
return true;
}
diff --git a/core/fpdfapi/page/cpdf_pageobjectholder.h b/core/fpdfapi/page/cpdf_pageobjectholder.h
index 1c427913ea..d18f400568 100644
--- a/core/fpdfapi/page/cpdf_pageobjectholder.h
+++ b/core/fpdfapi/page/cpdf_pageobjectholder.h
@@ -9,6 +9,7 @@
#include <map>
#include <memory>
+#include <set>
#include <vector>
#include "core/fpdfapi/page/cpdf_pageobjectlist.h"
@@ -84,6 +85,8 @@ class CPDF_PageObjectHolder {
void AddImageMaskBoundingBox(const CFX_FloatRect& box);
void Transform(const CFX_Matrix& matrix);
CFX_FloatRect CalcBoundingBox() const;
+ const std::set<int32_t>* GetDirtyStreams() const { return &m_DirtyStreams; }
+ void ClearDirtyStreams() { m_DirtyStreams.clear(); }
UnownedPtr<CPDF_Dictionary> m_pPageResources;
UnownedPtr<CPDF_Dictionary> m_pResources;
@@ -105,6 +108,9 @@ class CPDF_PageObjectHolder {
std::unique_ptr<CPDF_ContentParser> m_pParser;
CPDF_PageObjectList m_PageObjectList;
CFX_Matrix m_LastCTM;
+
+ // The indexes of Content streams that are dirty and need to be regenerated.
+ std::set<int32_t> m_DirtyStreams;
};
#endif // CORE_FPDFAPI_PAGE_CPDF_PAGEOBJECTHOLDER_H_