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

Side by Side Diff: core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp

Issue 1889863002: Make CPDF_Dictionary methods take CFX_ByteString arguments (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Avoid more duplication. Created 4 years, 8 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
OLDNEW
1 // Copyright 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 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 "core/fpdfapi/fpdf_edit/include/cpdf_pagecontentgenerator.h" 7 #include "core/fpdfapi/fpdf_edit/include/cpdf_pagecontentgenerator.h"
8 8
9 #include "core/fpdfapi/fpdf_edit/include/cpdf_creator.h" 9 #include "core/fpdfapi/fpdf_edit/include/cpdf_creator.h"
10 #include "core/fpdfapi/fpdf_page/include/cpdf_image.h" 10 #include "core/fpdfapi/fpdf_page/include/cpdf_image.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 CPDF_Dictionary* pResList = m_pPage->m_pResources->GetDictBy(szType); 67 CPDF_Dictionary* pResList = m_pPage->m_pResources->GetDictBy(szType);
68 if (!pResList) { 68 if (!pResList) {
69 pResList = new CPDF_Dictionary; 69 pResList = new CPDF_Dictionary;
70 m_pPage->m_pResources->SetAt(szType, pResList); 70 m_pPage->m_pResources->SetAt(szType, pResList);
71 } 71 }
72 m_pDocument->AddIndirectObject(pResourceObj); 72 m_pDocument->AddIndirectObject(pResourceObj);
73 CFX_ByteString name; 73 CFX_ByteString name;
74 int idnum = 1; 74 int idnum = 1;
75 while (1) { 75 while (1) {
76 name.Format("FX%c%d", szType[0], idnum); 76 name.Format("FX%c%d", szType[0], idnum);
77 if (!pResList->KeyExist(name.AsStringC())) { 77 if (!pResList->KeyExist(name)) {
78 break; 78 break;
79 } 79 }
80 idnum++; 80 idnum++;
81 } 81 }
82 pResList->AddReference(name.AsStringC(), m_pDocument, 82 pResList->AddReference(name.AsStringC(), m_pDocument,
83 pResourceObj->GetObjNum()); 83 pResourceObj->GetObjNum());
84 return name; 84 return name;
85 } 85 }
86 void CPDF_PageContentGenerator::ProcessImage(CFX_ByteTextBuf& buf, 86 void CPDF_PageContentGenerator::ProcessImage(CFX_ByteTextBuf& buf,
87 CPDF_ImageObject* pImageObj) { 87 CPDF_ImageObject* pImageObj) {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 CPDF_StreamAcc contentStream; 159 CPDF_StreamAcc contentStream;
160 contentStream.LoadAllData(pStream); 160 contentStream.LoadAllData(pStream);
161 ProcessForm(buf, contentStream.GetData(), contentStream.GetSize(), matrix); 161 ProcessForm(buf, contentStream.GetData(), contentStream.GetSize(), matrix);
162 } 162 }
163 CPDF_Stream* pStream = new CPDF_Stream(NULL, 0, NULL); 163 CPDF_Stream* pStream = new CPDF_Stream(NULL, 0, NULL);
164 pStream->SetData(buf.GetBuffer(), buf.GetLength(), FALSE, FALSE); 164 pStream->SetData(buf.GetBuffer(), buf.GetLength(), FALSE, FALSE);
165 m_pDocument->AddIndirectObject(pStream); 165 m_pDocument->AddIndirectObject(pStream);
166 m_pPage->m_pFormDict->SetAtReference("Contents", m_pDocument, 166 m_pPage->m_pFormDict->SetAtReference("Contents", m_pDocument,
167 pStream->GetObjNum()); 167 pStream->GetObjNum());
168 } 168 }
OLDNEW
« no previous file with comments | « no previous file | core/fpdfapi/fpdf_page/fpdf_page_doc.cpp » ('j') | core/fpdfapi/fpdf_parser/cpdf_object_unittest.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698