summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/page')
-rw-r--r--core/fpdfapi/page/cpdf_imageobject.cpp1
-rw-r--r--core/fpdfapi/page/cpdf_pageobject.cpp5
-rw-r--r--core/fpdfapi/page/cpdf_pageobject.h4
-rw-r--r--core/fpdfapi/page/cpdf_pathobject.cpp1
-rw-r--r--core/fpdfapi/page/cpdf_textobject.cpp2
5 files changed, 12 insertions, 1 deletions
diff --git a/core/fpdfapi/page/cpdf_imageobject.cpp b/core/fpdfapi/page/cpdf_imageobject.cpp
index 8732c00954..a74ac4802c 100644
--- a/core/fpdfapi/page/cpdf_imageobject.cpp
+++ b/core/fpdfapi/page/cpdf_imageobject.cpp
@@ -25,6 +25,7 @@ CPDF_PageObject::Type CPDF_ImageObject::GetType() const {
void CPDF_ImageObject::Transform(const CFX_Matrix& matrix) {
m_Matrix.Concat(matrix);
CalcBoundingBox();
+ SetDirty(true);
}
bool CPDF_ImageObject::IsImage() const {
diff --git a/core/fpdfapi/page/cpdf_pageobject.cpp b/core/fpdfapi/page/cpdf_pageobject.cpp
index 09a98eee7d..79d9bbc540 100644
--- a/core/fpdfapi/page/cpdf_pageobject.cpp
+++ b/core/fpdfapi/page/cpdf_pageobject.cpp
@@ -6,7 +6,7 @@
#include "core/fpdfapi/page/cpdf_pageobject.h"
-CPDF_PageObject::CPDF_PageObject() {}
+CPDF_PageObject::CPDF_PageObject() : m_bDirty(false) {}
CPDF_PageObject::~CPDF_PageObject() {}
@@ -76,18 +76,21 @@ void CPDF_PageObject::CopyData(const CPDF_PageObject* pSrc) {
m_Right = pSrc->m_Right;
m_Top = pSrc->m_Top;
m_Bottom = pSrc->m_Bottom;
+ m_bDirty = true;
}
void CPDF_PageObject::TransformClipPath(CFX_Matrix& matrix) {
if (!m_ClipPath.HasRef())
return;
m_ClipPath.Transform(matrix);
+ SetDirty(true);
}
void CPDF_PageObject::TransformGeneralState(CFX_Matrix& matrix) {
if (!m_GeneralState.HasRef())
return;
m_GeneralState.GetMutableMatrix()->Concat(matrix);
+ SetDirty(true);
}
FX_RECT CPDF_PageObject::GetBBox(const CFX_Matrix* pMatrix) const {
diff --git a/core/fpdfapi/page/cpdf_pageobject.h b/core/fpdfapi/page/cpdf_pageobject.h
index 668621ff51..d23cd971f8 100644
--- a/core/fpdfapi/page/cpdf_pageobject.h
+++ b/core/fpdfapi/page/cpdf_pageobject.h
@@ -49,6 +49,8 @@ class CPDF_PageObject : public CPDF_GraphicStates {
virtual CPDF_FormObject* AsForm();
virtual const CPDF_FormObject* AsForm() const;
+ void SetDirty(bool value) { m_bDirty = value; }
+ bool IsDirty() const { return m_bDirty; }
void TransformClipPath(CFX_Matrix& matrix);
void TransformGeneralState(CFX_Matrix& matrix);
@@ -69,6 +71,8 @@ class CPDF_PageObject : public CPDF_GraphicStates {
private:
CPDF_PageObject(const CPDF_PageObject& src) = delete;
void operator=(const CPDF_PageObject& src) = delete;
+
+ bool m_bDirty;
};
#endif // CORE_FPDFAPI_PAGE_CPDF_PAGEOBJECT_H_
diff --git a/core/fpdfapi/page/cpdf_pathobject.cpp b/core/fpdfapi/page/cpdf_pathobject.cpp
index c4d55bc20f..b54ad6e151 100644
--- a/core/fpdfapi/page/cpdf_pathobject.cpp
+++ b/core/fpdfapi/page/cpdf_pathobject.cpp
@@ -17,6 +17,7 @@ CPDF_PageObject::Type CPDF_PathObject::GetType() const {
void CPDF_PathObject::Transform(const CFX_Matrix& matrix) {
m_Matrix.Concat(matrix);
CalcBoundingBox();
+ SetDirty(true);
}
bool CPDF_PathObject::IsPath() const {
diff --git a/core/fpdfapi/page/cpdf_textobject.cpp b/core/fpdfapi/page/cpdf_textobject.cpp
index b8f3f61073..7a70101789 100644
--- a/core/fpdfapi/page/cpdf_textobject.cpp
+++ b/core/fpdfapi/page/cpdf_textobject.cpp
@@ -115,6 +115,7 @@ void CPDF_TextObject::Transform(const CFX_Matrix& matrix) {
pTextMatrix[3] = text_matrix.d;
m_Pos = CFX_PointF(text_matrix.e, text_matrix.f);
CalcPositionData(0);
+ SetDirty(true);
}
bool CPDF_TextObject::IsText() const {
@@ -164,6 +165,7 @@ void CPDF_TextObject::SetSegments(const CFX_ByteString* pStrs,
void CPDF_TextObject::SetText(const CFX_ByteString& str) {
SetSegments(&str, nullptr, 1);
RecalcPositionData();
+ SetDirty(true);
}
float CPDF_TextObject::GetCharWidth(uint32_t charcode) const {