Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: fpdfsdk/src/fpdf_transformpage.cpp

Issue 1420583003: Revert "Revert "Add type cast definitions for CPDF_Dictionary."" (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fpdfsdk/src/fpdf_flatten.cpp ('k') | fpdfsdk/src/fpdfdoc.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/fpdf_flatten.cpp ('k') | fpdfsdk/src/fpdfdoc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698