OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "../../public/fpdf_transformpage.h" | 7 #include "../../public/fpdf_transformpage.h" |
8 #include "../include/fsdk_define.h" | 8 #include "../include/fsdk_define.h" |
9 | 9 |
10 namespace { | 10 namespace { |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 if (pRes) { | 159 if (pRes) { |
160 CPDF_Dictionary* pPattenDict = pRes->GetDict(FX_BSTRC("Pattern")); | 160 CPDF_Dictionary* pPattenDict = pRes->GetDict(FX_BSTRC("Pattern")); |
161 if (pPattenDict) { | 161 if (pPattenDict) { |
162 FX_POSITION pos = pPattenDict->GetStartPos(); | 162 FX_POSITION pos = pPattenDict->GetStartPos(); |
163 while (pos) { | 163 while (pos) { |
164 CPDF_Dictionary* pDict = NULL; | 164 CPDF_Dictionary* pDict = NULL; |
165 CFX_ByteString key; | 165 CFX_ByteString key; |
166 CPDF_Object* pObj = pPattenDict->GetNextElement(pos, key); | 166 CPDF_Object* pObj = pPattenDict->GetNextElement(pos, key); |
167 if (pObj->GetType() == PDFOBJ_REFERENCE) | 167 if (pObj->GetType() == PDFOBJ_REFERENCE) |
168 pObj = pObj->GetDirect(); | 168 pObj = pObj->GetDirect(); |
169 if (pObj->GetType() == PDFOBJ_DICTIONARY) { | 169 if (pObj->IsDictionary()) { |
170 pDict = (CPDF_Dictionary*)pObj; | 170 pDict = pObj->AsDictionary(); |
171 } else if (pObj->GetType() == PDFOBJ_STREAM) { | 171 } else if (pObj->GetType() == PDFOBJ_STREAM) { |
172 pDict = ((CPDF_Stream*)pObj)->GetDict(); | 172 pDict = ((CPDF_Stream*)pObj)->GetDict(); |
173 } else | 173 } else |
174 continue; | 174 continue; |
175 | 175 |
176 CFX_AffineMatrix m = pDict->GetMatrix(FX_BSTRC("Matrix")); | 176 CFX_AffineMatrix m = pDict->GetMatrix(FX_BSTRC("Matrix")); |
177 CFX_AffineMatrix t = *(CFX_AffineMatrix*)matrix; | 177 CFX_AffineMatrix t = *(CFX_AffineMatrix*)matrix; |
178 m.Concat(t); | 178 m.Concat(t); |
179 pDict->SetAtMatrix(FX_BSTRC("Matrix"), m); | 179 pDict->SetAtMatrix(FX_BSTRC("Matrix"), m); |
180 } | 180 } |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 } else if (pDirectObj->GetType() == PDFOBJ_STREAM) { | 314 } else if (pDirectObj->GetType() == PDFOBJ_STREAM) { |
315 pContentArray = new CPDF_Array(); | 315 pContentArray = new CPDF_Array(); |
316 pContentArray->AddReference(pDoc, pStream->GetObjNum()); | 316 pContentArray->AddReference(pDoc, pStream->GetObjNum()); |
317 pContentArray->AddReference(pDoc, pDirectObj->GetObjNum()); | 317 pContentArray->AddReference(pDoc, pDirectObj->GetObjNum()); |
318 pPageDic->SetAtReference("Contents", pDoc, | 318 pPageDic->SetAtReference("Contents", pDoc, |
319 pDoc->AddIndirectObject(pContentArray)); | 319 pDoc->AddIndirectObject(pContentArray)); |
320 } | 320 } |
321 } | 321 } |
322 } | 322 } |
323 } | 323 } |
OLD | NEW |