summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/cpdf_viewerpreferences.h
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-05-08 19:26:37 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-08 19:26:37 +0000
commit55bbb0a2e7a95bf2c08cbd1d7f1563aec7e5b97d (patch)
tree547f7890311e47df663676299d587fef7236aecb /core/fpdfdoc/cpdf_viewerpreferences.h
parent9c6204fc6c23ab35ec234781df182da570f6faef (diff)
downloadpdfium-55bbb0a2e7a95bf2c08cbd1d7f1563aec7e5b97d.tar.xz
Mark CPDF_Object pointers as const in CPDF_ViewerPreferences.
Work up the short call stack and mark FPDF_PAGERANGE as an opaque const pointer. Also fix CPDF_ViewerPreferences::GenericName() to return an optional string. Change-Id: I2356d38888fcff8d4da37dd3efc17b284ff90485 Reviewed-on: https://pdfium-review.googlesource.com/32174 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfdoc/cpdf_viewerpreferences.h')
-rw-r--r--core/fpdfdoc/cpdf_viewerpreferences.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/core/fpdfdoc/cpdf_viewerpreferences.h b/core/fpdfdoc/cpdf_viewerpreferences.h
index a1884748e4..45e4390065 100644
--- a/core/fpdfdoc/cpdf_viewerpreferences.h
+++ b/core/fpdfdoc/cpdf_viewerpreferences.h
@@ -10,6 +10,7 @@
#include "core/fxcrt/fx_string.h"
#include "core/fxcrt/fx_system.h"
#include "core/fxcrt/unowned_ptr.h"
+#include "third_party/base/optional.h"
class CPDF_Array;
class CPDF_Dictionary;
@@ -17,24 +18,22 @@ class CPDF_Document;
class CPDF_ViewerPreferences {
public:
- explicit CPDF_ViewerPreferences(CPDF_Document* pDoc);
+ explicit CPDF_ViewerPreferences(const CPDF_Document* pDoc);
~CPDF_ViewerPreferences();
bool IsDirectionR2L() const;
bool PrintScaling() const;
int32_t NumCopies() const;
- CPDF_Array* PrintPageRange() const;
+ const CPDF_Array* PrintPageRange() const;
ByteString Duplex() const;
- // Gets the entry for |bsKey|. If the entry exists and it is of type name,
- // then this method writes the value into |bsVal| and returns true. Otherwise
- // returns false and |bsVal| is untouched. |bsVal| must not be NULL.
- bool GenericName(const ByteString& bsKey, ByteString* bsVal) const;
+ // Gets the entry for |bsKey|.
+ Optional<ByteString> GenericName(const ByteString& bsKey) const;
private:
- CPDF_Dictionary* GetViewerPreferences() const;
+ const CPDF_Dictionary* GetViewerPreferences() const;
- UnownedPtr<CPDF_Document> const m_pDoc;
+ UnownedPtr<const CPDF_Document> const m_pDoc;
};
#endif // CORE_FPDFDOC_CPDF_VIEWERPREFERENCES_H_