summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/page')
-rw-r--r--core/fpdfapi/page/cpdf_pattern.h9
-rw-r--r--core/fpdfapi/page/cpdf_textstate.h3
2 files changed, 7 insertions, 5 deletions
diff --git a/core/fpdfapi/page/cpdf_pattern.h b/core/fpdfapi/page/cpdf_pattern.h
index 3b948aedb7..dba301b922 100644
--- a/core/fpdfapi/page/cpdf_pattern.h
+++ b/core/fpdfapi/page/cpdf_pattern.h
@@ -7,6 +7,7 @@
#ifndef CORE_FPDFAPI_PAGE_CPDF_PATTERN_H_
#define CORE_FPDFAPI_PAGE_CPDF_PATTERN_H_
+#include "core/fxcrt/cfx_unowned_ptr.h"
#include "core/fxcrt/fx_coordinates.h"
#include "core/fxcrt/fx_system.h"
@@ -25,8 +26,8 @@ class CPDF_Pattern {
virtual CPDF_ShadingPattern* AsShadingPattern() = 0;
// All the getters that return pointers return non-NULL pointers.
- CPDF_Document* document() { return m_pDocument; }
- CPDF_Object* pattern_obj() { return m_pPatternObj; }
+ CPDF_Document* document() const { return m_pDocument.Get(); }
+ CPDF_Object* pattern_obj() const { return m_pPatternObj.Get(); }
CFX_Matrix* pattern_to_form() { return &m_Pattern2Form; }
const CFX_Matrix& parent_matrix() const { return m_ParentMatrix; }
@@ -38,8 +39,8 @@ class CPDF_Pattern {
void SetPatternToFormMatrix();
private:
- CPDF_Document* const m_pDocument;
- CPDF_Object* const m_pPatternObj;
+ CFX_UnownedPtr<CPDF_Document> const m_pDocument;
+ CFX_UnownedPtr<CPDF_Object> const m_pPatternObj;
CFX_Matrix m_Pattern2Form;
const CFX_Matrix m_ParentMatrix;
};
diff --git a/core/fpdfapi/page/cpdf_textstate.h b/core/fpdfapi/page/cpdf_textstate.h
index 84d2c13a6c..ff3ab8dd6c 100644
--- a/core/fpdfapi/page/cpdf_textstate.h
+++ b/core/fpdfapi/page/cpdf_textstate.h
@@ -8,6 +8,7 @@
#define CORE_FPDFAPI_PAGE_CPDF_TEXTSTATE_H_
#include "core/fxcrt/cfx_shared_copy_on_write.h"
+#include "core/fxcrt/cfx_unowned_ptr.h"
#include "core/fxcrt/fx_basic.h"
class CPDF_Document;
@@ -72,7 +73,7 @@ class CPDF_TextState {
float GetShearAngle() const;
CPDF_Font* m_pFont;
- CPDF_Document* m_pDocument;
+ CFX_UnownedPtr<CPDF_Document> m_pDocument;
float m_FontSize;
float m_CharSpace;
float m_WordSpace;