diff options
author | Henrique Nakashima <hnakashima@chromium.org> | 2018-07-18 18:35:09 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-07-18 18:35:09 +0000 |
commit | f22b4e2f6682fe26113c591a01139a8b5fa4e3bf (patch) | |
tree | 99aded5bc675c274429ae0d7dfae4cf6c519a021 /core/fpdfapi/page/cpdf_contentmarkitem.cpp | |
parent | 44592dfa1e34ce606197238c32b2a453ed899aa0 (diff) | |
download | pdfium-f22b4e2f6682fe26113c591a01139a8b5fa4e3bf.tar.xz |
Use casts to deduplicate implementation of const/non-const methods.
Change-Id: Ia5a4e89bff8a1dbc46246f5a734170765b7ee74e
Reviewed-on: https://pdfium-review.googlesource.com/38250
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_contentmarkitem.cpp')
-rw-r--r-- | core/fpdfapi/page/cpdf_contentmarkitem.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/core/fpdfapi/page/cpdf_contentmarkitem.cpp b/core/fpdfapi/page/cpdf_contentmarkitem.cpp index 90a2930b23..8eba4aa15f 100644 --- a/core/fpdfapi/page/cpdf_contentmarkitem.cpp +++ b/core/fpdfapi/page/cpdf_contentmarkitem.cpp @@ -28,15 +28,8 @@ 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; - } + return const_cast<CPDF_Dictionary*>( + static_cast<const CPDF_ContentMarkItem*>(this)->GetParam()); } bool CPDF_ContentMarkItem::HasMCID() const { |