diff options
author | Henrique Nakashima <hnakashima@chromium.org> | 2018-07-12 22:15:09 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-07-12 22:15:09 +0000 |
commit | d8df8c35a463073579ca01a838699b037eca7cee (patch) | |
tree | 9c9212ce94fed680d75982415dd3dcf15fbcb5e3 /fpdfsdk/fpdf_editpage.cpp | |
parent | 94919f78e1bcceb7cb9eec1c5a883d3d99b1101e (diff) | |
download | pdfium-d8df8c35a463073579ca01a838699b037eca7cee.tar.xz |
Fix mark not saved if there are no other changes in the same object.
Bug: pdfium:1037
Change-Id: Ifcb0a4330d077895c5f02395588150f29a5466aa
Reviewed-on: https://pdfium-review.googlesource.com/37731
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdf_editpage.cpp')
-rw-r--r-- | fpdfsdk/fpdf_editpage.cpp | 7 |
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)); } |