summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_pattern.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-04-26 15:22:00 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-04-27 23:22:12 +0000
commit66568bcd683dd7b18672cb3aebca4487e9203519 (patch)
tree7297841771a796bafd3d0d17dd47b7b0e394d933 /core/fpdfapi/page/cpdf_pattern.cpp
parentba817506edcb26e0acf497111e7684e39dadaf04 (diff)
downloadpdfium-66568bcd683dd7b18672cb3aebca4487e9203519.tar.xz
Assert CPDF_Pattern always has a valid CPDF_Document pointer.
Same for CPDF_DocPageData. Change-Id: I8f2f559123dbb2f3623d957e4074d5f9d191797f Reviewed-on: https://pdfium-review.googlesource.com/4501 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_pattern.cpp')
-rw-r--r--core/fpdfapi/page/cpdf_pattern.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/core/fpdfapi/page/cpdf_pattern.cpp b/core/fpdfapi/page/cpdf_pattern.cpp
index b0a2d81bca..88e5dee35c 100644
--- a/core/fpdfapi/page/cpdf_pattern.cpp
+++ b/core/fpdfapi/page/cpdf_pattern.cpp
@@ -6,13 +6,17 @@
#include "core/fpdfapi/page/cpdf_pattern.h"
-CPDF_Pattern::CPDF_Pattern(PatternType type,
- CPDF_Document* pDoc,
+#include "core/fpdfapi/parser/cpdf_dictionary.h"
+
+CPDF_Pattern::CPDF_Pattern(CPDF_Document* pDoc,
CPDF_Object* pObj,
const CFX_Matrix& parentMatrix)
- : m_PatternType(type),
- m_pDocument(pDoc),
- m_pPatternObj(pObj),
- m_ParentMatrix(parentMatrix) {}
+ : m_pDocument(pDoc), m_pPatternObj(pObj), m_ParentMatrix(parentMatrix) {}
CPDF_Pattern::~CPDF_Pattern() {}
+
+void CPDF_Pattern::SetPatternToFormMatrix() {
+ CPDF_Dictionary* pDict = pattern_obj()->GetDict();
+ m_Pattern2Form = pDict->GetMatrixFor("Matrix");
+ m_Pattern2Form.Concat(m_ParentMatrix);
+}