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

Side by Side Diff: fpdfsdk/fsdk_baseannot.cpp

Issue 1889863002: Make CPDF_Dictionary methods take CFX_ByteString arguments (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: One last caller. 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
« no previous file with comments | « fpdfsdk/fpdfppo.cpp ('k') | fpdfsdk/fsdk_baseform.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 <algorithm> 7 #include <algorithm>
8 8
9 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h"
10 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h"
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 if (!pAPDict) { 822 if (!pAPDict) {
823 pAPDict = new CPDF_Dictionary; 823 pAPDict = new CPDF_Dictionary;
824 m_pAnnot->GetAnnotDict()->SetAt("AP", pAPDict); 824 m_pAnnot->GetAnnotDict()->SetAt("AP", pAPDict);
825 } 825 }
826 826
827 CPDF_Stream* pStream = nullptr; 827 CPDF_Stream* pStream = nullptr;
828 CPDF_Dictionary* pParentDict = nullptr; 828 CPDF_Dictionary* pParentDict = nullptr;
829 829
830 if (sAPState.IsEmpty()) { 830 if (sAPState.IsEmpty()) {
831 pParentDict = pAPDict; 831 pParentDict = pAPDict;
832 pStream = pAPDict->GetStreamBy(sAPType.AsStringC()); 832 pStream = pAPDict->GetStreamBy(sAPType);
833 } else { 833 } else {
834 CPDF_Dictionary* pAPTypeDict = pAPDict->GetDictBy(sAPType.AsStringC()); 834 CPDF_Dictionary* pAPTypeDict = pAPDict->GetDictBy(sAPType);
835 if (!pAPTypeDict) { 835 if (!pAPTypeDict) {
836 pAPTypeDict = new CPDF_Dictionary; 836 pAPTypeDict = new CPDF_Dictionary;
837 pAPDict->SetAt(sAPType.AsStringC(), pAPTypeDict); 837 pAPDict->SetAt(sAPType, pAPTypeDict);
838 } 838 }
839 pParentDict = pAPTypeDict; 839 pParentDict = pAPTypeDict;
840 pStream = pAPTypeDict->GetStreamBy(sAPState.AsStringC()); 840 pStream = pAPTypeDict->GetStreamBy(sAPState);
841 } 841 }
842 842
843 if (!pStream) { 843 if (!pStream) {
844 pStream = new CPDF_Stream(nullptr, 0, nullptr); 844 pStream = new CPDF_Stream(nullptr, 0, nullptr);
845 CPDF_Document* pDoc = m_pPageView->GetPDFDocument(); 845 CPDF_Document* pDoc = m_pPageView->GetPDFDocument();
846 int32_t objnum = pDoc->AddIndirectObject(pStream); 846 int32_t objnum = pDoc->AddIndirectObject(pStream);
847 pParentDict->SetAtReference(sAPType.AsStringC(), pDoc, objnum); 847 pParentDict->SetAtReference(sAPType, pDoc, objnum);
848 } 848 }
849 849
850 CPDF_Dictionary* pStreamDict = pStream->GetDict(); 850 CPDF_Dictionary* pStreamDict = pStream->GetDict();
851 if (!pStreamDict) { 851 if (!pStreamDict) {
852 pStreamDict = new CPDF_Dictionary; 852 pStreamDict = new CPDF_Dictionary;
853 pStreamDict->SetAtName("Type", "XObject"); 853 pStreamDict->SetAtName("Type", "XObject");
854 pStreamDict->SetAtName("Subtype", "Form"); 854 pStreamDict->SetAtName("Subtype", "Form");
855 pStreamDict->SetAtInteger("FormType", 1); 855 pStreamDict->SetAtInteger("FormType", 1);
856 pStream->InitStream(nullptr, 0, pStreamDict); 856 pStream->InitStream(nullptr, 0, pStreamDict);
857 } 857 }
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
954 954
955 CPDF_Page* CPDFSDK_Annot::GetPDFPage() { 955 CPDF_Page* CPDFSDK_Annot::GetPDFPage() {
956 return m_pPageView ? m_pPageView->GetPDFPage() : nullptr; 956 return m_pPageView ? m_pPageView->GetPDFPage() : nullptr;
957 } 957 }
958 958
959 #ifdef PDF_ENABLE_XFA 959 #ifdef PDF_ENABLE_XFA
960 CPDFXFA_Page* CPDFSDK_Annot::GetPDFXFAPage() { 960 CPDFXFA_Page* CPDFSDK_Annot::GetPDFXFAPage() {
961 return m_pPageView ? m_pPageView->GetPDFXFAPage() : nullptr; 961 return m_pPageView ? m_pPageView->GetPDFXFAPage() : nullptr;
962 } 962 }
963 #endif // PDF_ENABLE_XFA 963 #endif // PDF_ENABLE_XFA
OLDNEW
« no previous file with comments | « fpdfsdk/fpdfppo.cpp ('k') | fpdfsdk/fsdk_baseform.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698