diff options
author | Henrique Nakashima <hnakashima@chromium.org> | 2018-07-10 21:04:05 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-07-10 21:04:05 +0000 |
commit | 144107d3ca6ddd2724a460c4da4a20e6e1b7f1b7 (patch) | |
tree | 7fc11c898c7d5397f8b910d447eccfd04680f288 /core/fpdfapi/page/cpdf_contentmarkitem.cpp | |
parent | 416cbeab1d93b1261dfb4584e0c8e47d9cd4720f (diff) | |
download | pdfium-144107d3ca6ddd2724a460c4da4a20e6e1b7f1b7.tar.xz |
Create API for adding content marks and setting their params.chromium/3488
This CL creates the following new functions in the public API:
- FPDFPageObj_AddMark
- FPDFPageObjMark_SetIntParam
- FPDFPageObjMark_SetStringParam
Bug: pdfium:1037
Change-Id: Icabf3fdd8e8153b9156bab807a3708d38a9365d8
Reviewed-on: https://pdfium-review.googlesource.com/37330
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_contentmarkitem.cpp')
-rw-r--r-- | core/fpdfapi/page/cpdf_contentmarkitem.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/core/fpdfapi/page/cpdf_contentmarkitem.cpp b/core/fpdfapi/page/cpdf_contentmarkitem.cpp index 4f56eea919..dd9f7e884c 100644 --- a/core/fpdfapi/page/cpdf_contentmarkitem.cpp +++ b/core/fpdfapi/page/cpdf_contentmarkitem.cpp @@ -26,6 +26,18 @@ const CPDF_Dictionary* CPDF_ContentMarkItem::GetParam() const { } } +CPDF_Dictionary* CPDF_ContentMarkItem::GetParam() { + switch (m_ParamType) { + case PropertiesDict: + return m_pPropertiesDict.Get(); + case DirectDict: + return m_pDirectDict.get(); + case None: + default: + return nullptr; + } +} + bool CPDF_ContentMarkItem::HasMCID() const { const CPDF_Dictionary* pDict = GetParam(); return pDict && pDict->KeyExist("MCID"); @@ -37,7 +49,7 @@ void CPDF_ContentMarkItem::SetDirectDict( m_pDirectDict = std::move(pDict); } -void CPDF_ContentMarkItem::SetPropertiesDict(const CPDF_Dictionary* pDict) { +void CPDF_ContentMarkItem::SetPropertiesDict(CPDF_Dictionary* pDict) { m_ParamType = PropertiesDict; m_pPropertiesDict = pDict; } |