summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_editpage.cpp
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2018-07-13 19:47:22 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-07-13 19:47:22 +0000
commitfed4adb003db228ac7fbc0510a21c25b50ae0cab (patch)
treef9a73333d86d5abb1cf890e320f0800a2dd875c9 /fpdfsdk/fpdf_editpage.cpp
parenta34067721d6630975c356a621a12753bbdab1cdb (diff)
downloadpdfium-fed4adb003db228ac7fbc0510a21c25b50ae0cab.tar.xz
Create API to remove a content mark from a page object.
- FPDFPageObj_RemoveMark() Bug: pdfium:1037 Change-Id: I7ff320261d64e3ead45375ccc72301e7c64dd6e3 Reviewed-on: https://pdfium-review.googlesource.com/37710 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.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/fpdfsdk/fpdf_editpage.cpp b/fpdfsdk/fpdf_editpage.cpp
index 3abdcdf0fc..808e330225 100644
--- a/fpdfsdk/fpdf_editpage.cpp
+++ b/fpdfsdk/fpdf_editpage.cpp
@@ -326,6 +326,21 @@ FPDFPageObj_AddMark(FPDF_PAGEOBJECT page_object, FPDF_BYTESTRING name) {
return FPDFPageObjectMarkFromCPDFContentMarkItem(mark->GetItem(index));
}
+FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
+FPDFPageObj_RemoveMark(FPDF_PAGEOBJECT page_object, FPDF_PAGEOBJECTMARK mark) {
+ CPDF_PageObject* pPageObj = CPDFPageObjectFromFPDFPageObject(page_object);
+ CPDF_ContentMarkItem* pMarkItem =
+ CPDFContentMarkItemFromFPDFPageObjectMark(mark);
+ if (!pPageObj || !pMarkItem)
+ return false;
+
+ bool result = pPageObj->m_ContentMark.RemoveMark(pMarkItem);
+ if (result)
+ pPageObj->SetDirty(true);
+
+ return result;
+}
+
FPDF_EXPORT unsigned long FPDF_CALLCONV
FPDFPageObjMark_GetName(FPDF_PAGEOBJECTMARK mark,
void* buffer,