diff options
author | tsepez <tsepez@chromium.org> | 2016-09-01 07:11:15 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-09-01 07:11:15 -0700 |
commit | 22b64c361bf4630cdfe2b783d5b1e582f4842711 (patch) | |
tree | f2791406df5b4cc0225ab44508d9eb6dfef585ff /core/fpdfapi/fpdf_page/cpdf_contentmark.h | |
parent | 380f53ec1d0a46648473e407934c9adede6cc1bd (diff) | |
download | pdfium-22b64c361bf4630cdfe2b783d5b1e582f4842711.tar.xz |
Make CPDF_ContentMark have a CPDF_ContentMarkData.
This one doesn't require an explict Emplace(), as the object
seems to get constructed only as a side-effect of making a
private copy.
Review-Url: https://codereview.chromium.org/2298953002
Diffstat (limited to 'core/fpdfapi/fpdf_page/cpdf_contentmark.h')
-rw-r--r-- | core/fpdfapi/fpdf_page/cpdf_contentmark.h | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/core/fpdfapi/fpdf_page/cpdf_contentmark.h b/core/fpdfapi/fpdf_page/cpdf_contentmark.h index 2f8c5cdbc7..2941c61ba9 100644 --- a/core/fpdfapi/fpdf_page/cpdf_contentmark.h +++ b/core/fpdfapi/fpdf_page/cpdf_contentmark.h @@ -11,15 +11,29 @@ #include "core/fxcrt/include/cfx_count_ref.h" #include "core/fxcrt/include/fx_basic.h" -class CPDF_ContentMark : public CFX_CountRef<CPDF_ContentMarkData> { +class CPDF_ContentMark { public: - int GetMCID() const { - const CPDF_ContentMarkData* pData = GetObject(); - return pData ? pData->GetMCID() : -1; - } + CPDF_ContentMark(); + CPDF_ContentMark(const CPDF_ContentMark& that); + ~CPDF_ContentMark(); + + void SetNull(); + + int GetMCID() const; + int CountItems() const; + const CPDF_ContentMarkItem& GetItem(int i) const; bool HasMark(const CFX_ByteStringC& mark) const; bool LookupMark(const CFX_ByteStringC& mark, CPDF_Dictionary*& pDict) const; + void AddMark(const CFX_ByteString& name, + CPDF_Dictionary* pDict, + FX_BOOL bDirect); + void DeleteLastMark(); + + operator bool() const { return !!m_Ref; } + + private: + CFX_CountRef<CPDF_ContentMarkData> m_Ref; }; #endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_CONTENTMARK_H_ |