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

Side by Side Diff: fpdfsdk/fsdk_baseannot.cpp

Issue 1862123003: Rename both As{Byte,Wide}StringC() helpers to AsStringC(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase, fix new usage. 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/fpdfxfa/fpdfxfa_doc.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 813 matching lines...) Expand 10 before | Expand all | Expand 10 after
824 if (!pAPDict) { 824 if (!pAPDict) {
825 pAPDict = new CPDF_Dictionary; 825 pAPDict = new CPDF_Dictionary;
826 m_pAnnot->GetAnnotDict()->SetAt("AP", pAPDict); 826 m_pAnnot->GetAnnotDict()->SetAt("AP", pAPDict);
827 } 827 }
828 828
829 CPDF_Stream* pStream = nullptr; 829 CPDF_Stream* pStream = nullptr;
830 CPDF_Dictionary* pParentDict = nullptr; 830 CPDF_Dictionary* pParentDict = nullptr;
831 831
832 if (sAPState.IsEmpty()) { 832 if (sAPState.IsEmpty()) {
833 pParentDict = pAPDict; 833 pParentDict = pAPDict;
834 pStream = pAPDict->GetStreamBy(sAPType.AsByteStringC()); 834 pStream = pAPDict->GetStreamBy(sAPType.AsStringC());
835 } else { 835 } else {
836 CPDF_Dictionary* pAPTypeDict = pAPDict->GetDictBy(sAPType.AsByteStringC()); 836 CPDF_Dictionary* pAPTypeDict = pAPDict->GetDictBy(sAPType.AsStringC());
837 if (!pAPTypeDict) { 837 if (!pAPTypeDict) {
838 pAPTypeDict = new CPDF_Dictionary; 838 pAPTypeDict = new CPDF_Dictionary;
839 pAPDict->SetAt(sAPType.AsByteStringC(), pAPTypeDict); 839 pAPDict->SetAt(sAPType.AsStringC(), pAPTypeDict);
840 } 840 }
841 pParentDict = pAPTypeDict; 841 pParentDict = pAPTypeDict;
842 pStream = pAPTypeDict->GetStreamBy(sAPState.AsByteStringC()); 842 pStream = pAPTypeDict->GetStreamBy(sAPState.AsStringC());
843 } 843 }
844 844
845 if (!pStream) { 845 if (!pStream) {
846 pStream = new CPDF_Stream(nullptr, 0, nullptr); 846 pStream = new CPDF_Stream(nullptr, 0, nullptr);
847 CPDF_Document* pDoc = m_pPageView->GetPDFDocument(); 847 CPDF_Document* pDoc = m_pPageView->GetPDFDocument();
848 int32_t objnum = pDoc->AddIndirectObject(pStream); 848 int32_t objnum = pDoc->AddIndirectObject(pStream);
849 pParentDict->SetAtReference(sAPType.AsByteStringC(), pDoc, objnum); 849 pParentDict->SetAtReference(sAPType.AsStringC(), pDoc, objnum);
850 } 850 }
851 851
852 CPDF_Dictionary* pStreamDict = pStream->GetDict(); 852 CPDF_Dictionary* pStreamDict = pStream->GetDict();
853 if (!pStreamDict) { 853 if (!pStreamDict) {
854 pStreamDict = new CPDF_Dictionary; 854 pStreamDict = new CPDF_Dictionary;
855 pStreamDict->SetAtName("Type", "XObject"); 855 pStreamDict->SetAtName("Type", "XObject");
856 pStreamDict->SetAtName("Subtype", "Form"); 856 pStreamDict->SetAtName("Subtype", "Form");
857 pStreamDict->SetAtInteger("FormType", 1); 857 pStreamDict->SetAtInteger("FormType", 1);
858 pStream->InitStream(nullptr, 0, pStreamDict); 858 pStream->InitStream(nullptr, 0, pStreamDict);
859 } 859 }
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
956 956
957 CPDF_Page* CPDFSDK_Annot::GetPDFPage() { 957 CPDF_Page* CPDFSDK_Annot::GetPDFPage() {
958 return m_pPageView ? m_pPageView->GetPDFPage() : nullptr; 958 return m_pPageView ? m_pPageView->GetPDFPage() : nullptr;
959 } 959 }
960 960
961 #ifdef PDF_ENABLE_XFA 961 #ifdef PDF_ENABLE_XFA
962 CPDFXFA_Page* CPDFSDK_Annot::GetPDFXFAPage() { 962 CPDFXFA_Page* CPDFSDK_Annot::GetPDFXFAPage() {
963 return m_pPageView ? m_pPageView->GetPDFXFAPage() : nullptr; 963 return m_pPageView ? m_pPageView->GetPDFXFAPage() : nullptr;
964 } 964 }
965 #endif // PDF_ENABLE_XFA 965 #endif // PDF_ENABLE_XFA
OLDNEW
« no previous file with comments | « fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp ('k') | fpdfsdk/fsdk_baseform.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698