summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_editpage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/fpdf_editpage.cpp')
-rw-r--r--fpdfsdk/fpdf_editpage.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/fpdfsdk/fpdf_editpage.cpp b/fpdfsdk/fpdf_editpage.cpp
index 02c07d1724..dbf9124030 100644
--- a/fpdfsdk/fpdf_editpage.cpp
+++ b/fpdfsdk/fpdf_editpage.cpp
@@ -306,13 +306,16 @@ FPDFPageObj_GetMark(FPDF_PAGEOBJECT page_object, unsigned long index) {
FPDF_EXPORT FPDF_PAGEOBJECTMARK FPDF_CALLCONV
FPDFPageObj_AddMark(FPDF_PAGEOBJECT page_object, FPDF_BYTESTRING name) {
- if (!page_object)
+ CPDF_PageObject* pPageObj = CPDFPageObjectFromFPDFPageObject(page_object);
+ if (!pPageObj)
return nullptr;
- auto* mark = &CPDFPageObjectFromFPDFPageObject(page_object)->m_ContentMark;
+ auto* mark = &pPageObj->m_ContentMark;
mark->AddMark(name);
unsigned long index = mark->CountItems() - 1;
+ pPageObj->SetDirty(true);
+
return FPDFPageObjectMarkFromCPDFContentMarkItem(mark->GetItem(index));
}