diff options
author | tsepez <tsepez@chromium.org> | 2016-04-08 12:20:38 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-08 12:20:39 -0700 |
commit | 4c3debb3c91f5842784be30a911b52cdabcab7df (patch) | |
tree | e0534dcb43a71376be8da0b376a97de37080ecc5 /core/fpdfdoc | |
parent | f172290a8dc527cd8bc73b0d0ad59e78797968c1 (diff) | |
download | pdfium-4c3debb3c91f5842784be30a911b52cdabcab7df.tar.xz |
Rename both As{Byte,Wide}StringC() helpers to AsStringC().
The naming is redundant given the base type, and will stand
in the way of consolidating Byte and Wide code.
BUG=
Review URL: https://codereview.chromium.org/1862123003
Diffstat (limited to 'core/fpdfdoc')
-rw-r--r-- | core/fpdfdoc/cpvt_color.cpp | 2 | ||||
-rw-r--r-- | core/fpdfdoc/cpvt_fontmap.cpp | 4 | ||||
-rw-r--r-- | core/fpdfdoc/cpvt_generateap.cpp | 17 | ||||
-rw-r--r-- | core/fpdfdoc/doc_action.cpp | 4 | ||||
-rw-r--r-- | core/fpdfdoc/doc_annot.cpp | 4 | ||||
-rw-r--r-- | core/fpdfdoc/doc_basic.cpp | 29 | ||||
-rw-r--r-- | core/fpdfdoc/doc_bookmark.cpp | 4 | ||||
-rw-r--r-- | core/fpdfdoc/doc_form.cpp | 6 | ||||
-rw-r--r-- | core/fpdfdoc/doc_formcontrol.cpp | 20 | ||||
-rw-r--r-- | core/fpdfdoc/doc_formfield.cpp | 4 | ||||
-rw-r--r-- | core/fpdfdoc/doc_link.cpp | 2 | ||||
-rw-r--r-- | core/fpdfdoc/doc_ocg.cpp | 10 | ||||
-rw-r--r-- | core/fpdfdoc/doc_tagged.cpp | 8 | ||||
-rw-r--r-- | core/fpdfdoc/doc_utils.cpp | 28 |
14 files changed, 68 insertions, 74 deletions
diff --git a/core/fpdfdoc/cpvt_color.cpp b/core/fpdfdoc/cpvt_color.cpp index 7ddb9df0d0..72b8140b7b 100644 --- a/core/fpdfdoc/cpvt_color.cpp +++ b/core/fpdfdoc/cpvt_color.cpp @@ -10,7 +10,7 @@ // Static. CPVT_Color CPVT_Color::ParseColor(const CFX_ByteString& str) { - CPDF_SimpleParser syntax(str.AsByteStringC()); + CPDF_SimpleParser syntax(str.AsStringC()); if (syntax.FindTagParamFromStart("g", 1)) return CPVT_Color(CPVT_Color::kGray, FX_atof(syntax.GetWord())); diff --git a/core/fpdfdoc/cpvt_fontmap.cpp b/core/fpdfdoc/cpvt_fontmap.cpp index eb8869df2b..a0919ed084 100644 --- a/core/fpdfdoc/cpvt_fontmap.cpp +++ b/core/fpdfdoc/cpvt_fontmap.cpp @@ -38,8 +38,8 @@ void CPVT_FontMap::GetAnnotSysPDFFont(CPDF_Document* pDoc, return; if (CPDF_Dictionary* pFontList = pResDict->GetDictBy("Font")) { - if (!pFontList->KeyExist(sSysFontAlias.AsByteStringC())) - pFontList->SetAtReference(sSysFontAlias.AsByteStringC(), pDoc, + if (!pFontList->KeyExist(sSysFontAlias.AsStringC())) + pFontList->SetAtReference(sSysFontAlias.AsStringC(), pDoc, pPDFFont->GetFontDict()); } pSysFont = pPDFFont; diff --git a/core/fpdfdoc/cpvt_generateap.cpp b/core/fpdfdoc/cpvt_generateap.cpp index ee99becaee..19b171a896 100644 --- a/core/fpdfdoc/cpvt_generateap.cpp +++ b/core/fpdfdoc/cpvt_generateap.cpp @@ -36,7 +36,7 @@ FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, if (DA.IsEmpty()) return FALSE; - CPDF_SimpleParser syntax(DA.AsByteStringC()); + CPDF_SimpleParser syntax(DA.AsStringC()); syntax.FindTagParamFromStart("Tf", 2); CFX_ByteString sFontName = syntax.GetWord(); sFontName = PDF_NameDecode(sFontName); @@ -54,12 +54,12 @@ FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, } CPDF_Dictionary* pDRFontDict = pDRDict ? pDRDict->GetDictBy("Font") : nullptr; if (pDRFontDict) { - pFontDict = pDRFontDict->GetDictBy(sFontName.Mid(1).AsByteStringC()); + pFontDict = pDRFontDict->GetDictBy(sFontName.Mid(1).AsStringC()); if (!pFontDict && !bUseFormRes) { pDRDict = pFormDict->GetDictBy("DR"); pDRFontDict = pDRDict->GetDictBy("Font"); if (pDRFontDict) - pFontDict = pDRFontDict->GetDictBy(sFontName.Mid(1).AsByteStringC()); + pFontDict = pDRFontDict->GetDictBy(sFontName.Mid(1).AsStringC()); } } if (!pDRFontDict) @@ -72,8 +72,7 @@ FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, pFontDict->SetAtName("BaseFont", "Helvetica"); pFontDict->SetAtName("Encoding", "WinAnsiEncoding"); pDoc->AddIndirectObject(pFontDict); - pDRFontDict->SetAtReference(sFontName.Mid(1).AsByteStringC(), pDoc, - pFontDict); + pDRFontDict->SetAtReference(sFontName.Mid(1).AsStringC(), pDoc, pFontDict); } CPDF_Font* pDefFont = pDoc->LoadFont(pFontDict); if (!pDefFont) @@ -190,8 +189,8 @@ FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, pStreamResFontList = new CPDF_Dictionary; pStreamResList->SetAt("Font", pStreamResFontList); } - if (!pStreamResFontList->KeyExist(sFontName.AsByteStringC())) - pStreamResFontList->SetAtReference(sFontName.AsByteStringC(), pDoc, + if (!pStreamResFontList->KeyExist(sFontName.AsStringC())) + pStreamResFontList->SetAtReference(sFontName.AsStringC(), pDoc, pFontDict); } else { pStreamDict->SetAt("Resources", pFormDict->GetDictBy("DR")->Clone()); @@ -437,8 +436,8 @@ FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, pStreamResFontList = new CPDF_Dictionary; pStreamResList->SetAt("Font", pStreamResFontList); } - if (!pStreamResFontList->KeyExist(sFontName.AsByteStringC())) - pStreamResFontList->SetAtReference(sFontName.AsByteStringC(), pDoc, + if (!pStreamResFontList->KeyExist(sFontName.AsStringC())) + pStreamResFontList->SetAtReference(sFontName.AsStringC(), pDoc, pFontDict); } else { pStreamDict->SetAt("Resources", pFormDict->GetDictBy("DR")->Clone()); diff --git a/core/fpdfdoc/doc_action.cpp b/core/fpdfdoc/doc_action.cpp index 075849482c..3036d61ab0 100644 --- a/core/fpdfdoc/doc_action.cpp +++ b/core/fpdfdoc/doc_action.cpp @@ -39,7 +39,7 @@ CPDF_Dest CPDF_Action::GetDest(CPDF_Document* pDoc) const { if (pDest->IsString() || pDest->IsName()) { CPDF_NameTree name_tree(pDoc, "Dests"); return CPDF_Dest( - name_tree.LookupNamedDest(pDoc, pDest->GetString().AsByteStringC())); + name_tree.LookupNamedDest(pDoc, pDest->GetString().AsStringC())); } if (CPDF_Array* pArray = pDest->AsArray()) return CPDF_Dest(pArray); @@ -74,7 +74,7 @@ CFX_WideString CPDF_Action::GetFilePath() const { CPDF_Dictionary* pWinDict = m_pDict->GetDictBy("Win"); if (pWinDict) { return CFX_WideString::FromLocal( - pWinDict->GetStringBy("F").AsByteStringC()); + pWinDict->GetStringBy("F").AsStringC()); } } return path; diff --git a/core/fpdfdoc/doc_annot.cpp b/core/fpdfdoc/doc_annot.cpp index d1942eccd0..1db37ccdb3 100644 --- a/core/fpdfdoc/doc_annot.cpp +++ b/core/fpdfdoc/doc_annot.cpp @@ -181,12 +181,12 @@ CPDF_Stream* FPDFDOC_GetAnnotAP(CPDF_Dictionary* pAnnotDict, CPDF_Dictionary* pDict = pAnnotDict->GetDictBy("Parent"); value = pDict ? pDict->GetStringBy("V") : CFX_ByteString(); } - if (value.IsEmpty() || !pDict->KeyExist(value.AsByteStringC())) + if (value.IsEmpty() || !pDict->KeyExist(value.AsStringC())) as = "Off"; else as = value; } - return pDict->GetStreamBy(as.AsByteStringC()); + return pDict->GetStreamBy(as.AsStringC()); } return nullptr; } diff --git a/core/fpdfdoc/doc_basic.cpp b/core/fpdfdoc/doc_basic.cpp index 308bf04287..bdb3f8cb0a 100644 --- a/core/fpdfdoc/doc_basic.cpp +++ b/core/fpdfdoc/doc_basic.cpp @@ -90,13 +90,13 @@ static CPDF_Object* SearchNameNode(CPDF_Dictionary* pNode, if (pLimits) { CFX_ByteString csLeft = pLimits->GetStringAt(0); CFX_ByteString csRight = pLimits->GetStringAt(1); - if (csLeft.Compare(csRight.AsByteStringC()) > 0) { + if (csLeft.Compare(csRight.AsStringC()) > 0) { CFX_ByteString csTmp = csRight; csRight = csLeft; csLeft = csTmp; } - if (csName.Compare(csLeft.AsByteStringC()) < 0 || - csName.Compare(csRight.AsByteStringC()) > 0) { + if (csName.Compare(csLeft.AsStringC()) < 0 || + csName.Compare(csRight.AsStringC()) > 0) { return NULL; } } @@ -105,7 +105,7 @@ static CPDF_Object* SearchNameNode(CPDF_Dictionary* pNode, uint32_t dwCount = pNames->GetCount() / 2; for (uint32_t i = 0; i < dwCount; i++) { CFX_ByteString csValue = pNames->GetStringAt(i * 2); - int32_t iCompare = csValue.Compare(csName.AsByteStringC()); + int32_t iCompare = csValue.Compare(csName.AsStringC()); if (iCompare <= 0) { if (ppFind) { *ppFind = pNames; @@ -321,25 +321,24 @@ bool CPDF_FileSpec::GetFileName(CFX_WideString* csFileName) const { return true; if (csFileName->IsEmpty()) { if (pDict->KeyExist("DOS")) { - *csFileName = CFX_WideString::FromLocal( - pDict->GetStringBy("DOS").AsByteStringC()); + *csFileName = + CFX_WideString::FromLocal(pDict->GetStringBy("DOS").AsStringC()); } else if (pDict->KeyExist("Mac")) { - *csFileName = CFX_WideString::FromLocal( - pDict->GetStringBy("Mac").AsByteStringC()); + *csFileName = + CFX_WideString::FromLocal(pDict->GetStringBy("Mac").AsStringC()); } else if (pDict->KeyExist("Unix")) { - *csFileName = CFX_WideString::FromLocal( - pDict->GetStringBy("Unix").AsByteStringC()); + *csFileName = + CFX_WideString::FromLocal(pDict->GetStringBy("Unix").AsStringC()); } else { return false; } } } else if (m_pObj->IsString()) { - *csFileName = - CFX_WideString::FromLocal(m_pObj->GetString().AsByteStringC()); + *csFileName = CFX_WideString::FromLocal(m_pObj->GetString().AsStringC()); } else { return false; } - *csFileName = DecodeFileName(csFileName->AsWideStringC()); + *csFileName = DecodeFileName(csFileName->AsStringC()); return true; } @@ -505,7 +504,7 @@ int32_t CPDF_PageLabel::GetPageByLabel(const CFX_ByteStringC& bsLabel) const { CFX_ByteString bsOrig = bsLabel; for (int i = 0; i < nPages; i++) { bsLbl = PDF_EncodeText(GetLabel(i)); - if (!bsLbl.Compare(bsOrig.AsByteStringC())) { + if (!bsLbl.Compare(bsOrig.AsStringC())) { return i; } } @@ -517,5 +516,5 @@ int32_t CPDF_PageLabel::GetPageByLabel(const CFX_ByteStringC& bsLabel) const { return -1; } int32_t CPDF_PageLabel::GetPageByLabel(const CFX_WideStringC& wsLabel) const { - return GetPageByLabel(PDF_EncodeText(wsLabel.c_str()).AsByteStringC()); + return GetPageByLabel(PDF_EncodeText(wsLabel.c_str()).AsStringC()); } diff --git a/core/fpdfdoc/doc_bookmark.cpp b/core/fpdfdoc/doc_bookmark.cpp index 18e6174621..aee9fb7b14 100644 --- a/core/fpdfdoc/doc_bookmark.cpp +++ b/core/fpdfdoc/doc_bookmark.cpp @@ -80,8 +80,8 @@ CPDF_Dest CPDF_Bookmark::GetDest(CPDF_Document* pDocument) const { return CPDF_Dest(); if (pDest->IsString() || pDest->IsName()) { CPDF_NameTree name_tree(pDocument, "Dests"); - return CPDF_Dest(name_tree.LookupNamedDest( - pDocument, pDest->GetString().AsByteStringC())); + return CPDF_Dest( + name_tree.LookupNamedDest(pDocument, pDest->GetString().AsStringC())); } if (CPDF_Array* pArray = pDest->AsArray()) return CPDF_Dest(pArray); diff --git a/core/fpdfdoc/doc_form.cpp b/core/fpdfdoc/doc_form.cpp index 384bcaa435..e1f5f30856 100644 --- a/core/fpdfdoc/doc_form.cpp +++ b/core/fpdfdoc/doc_form.cpp @@ -35,13 +35,13 @@ CFX_WideString FPDFDOC_FDF_GetFieldValue(const CPDF_Dictionary& pFieldDict, const CFX_ByteString csBValue = pFieldDict.GetStringBy("V"); for (const auto& encoding : g_fieldEncoding) { if (bsEncoding == encoding.m_name) - return CFX_WideString::FromCodePage(csBValue.AsByteStringC(), + return CFX_WideString::FromCodePage(csBValue.AsStringC(), encoding.m_codePage); } CFX_ByteString csTemp = csBValue.Left(2); if (csTemp == "\xFF\xFE" || csTemp == "\xFE\xFF") return PDF_DecodeText(csBValue); - return CFX_WideString::FromLocal(csBValue.AsByteStringC()); + return CFX_WideString::FromLocal(csBValue.AsStringC()); } } // namespace @@ -345,7 +345,7 @@ CFX_ByteString CPDF_InterForm::GenerateNewResourceName( CFX_ByteString bsNum; while (TRUE) { CFX_ByteString csKey = csTmp + bsNum; - if (!pDict->KeyExist(csKey.AsByteStringC())) { + if (!pDict->KeyExist(csKey.AsStringC())) { return csKey; } if (m < iCount) { diff --git a/core/fpdfdoc/doc_formcontrol.cpp b/core/fpdfdoc/doc_formcontrol.cpp index 6435cfd76c..1fef183d80 100644 --- a/core/fpdfdoc/doc_formcontrol.cpp +++ b/core/fpdfdoc/doc_formcontrol.cpp @@ -78,7 +78,7 @@ void CPDF_FormControl::SetOnStateName(const CFX_ByteString& csOn) { continue; } if (csKey2 != "Off") { - pSubDict->ReplaceKey(csKey2.AsByteStringC(), csValue.AsByteStringC()); + pSubDict->ReplaceKey(csKey2.AsStringC(), csValue.AsStringC()); break; } } @@ -202,7 +202,7 @@ CPDF_ApSettings CPDF_FormControl::GetMK() const { } bool CPDF_FormControl::HasMKEntry(CFX_ByteString csEntry) const { - return GetMK().HasMKEntry(csEntry.AsByteStringC()); + return GetMK().HasMKEntry(csEntry.AsStringC()); } int CPDF_FormControl::GetRotation() { @@ -210,24 +210,24 @@ int CPDF_FormControl::GetRotation() { } FX_ARGB CPDF_FormControl::GetColor(int& iColorType, CFX_ByteString csEntry) { - return GetMK().GetColor(iColorType, csEntry.AsByteStringC()); + return GetMK().GetColor(iColorType, csEntry.AsStringC()); } FX_FLOAT CPDF_FormControl::GetOriginalColor(int index, CFX_ByteString csEntry) { - return GetMK().GetOriginalColor(index, csEntry.AsByteStringC()); + return GetMK().GetOriginalColor(index, csEntry.AsStringC()); } void CPDF_FormControl::GetOriginalColor(int& iColorType, FX_FLOAT fc[4], CFX_ByteString csEntry) { - GetMK().GetOriginalColor(iColorType, fc, csEntry.AsByteStringC()); + GetMK().GetOriginalColor(iColorType, fc, csEntry.AsStringC()); } CFX_WideString CPDF_FormControl::GetCaption(CFX_ByteString csEntry) { - return GetMK().GetCaption(csEntry.AsByteStringC()); + return GetMK().GetCaption(csEntry.AsStringC()); } CPDF_Stream* CPDF_FormControl::GetIcon(CFX_ByteString csEntry) { - return GetMK().GetIcon(csEntry.AsByteStringC()); + return GetMK().GetIcon(csEntry.AsStringC()); } CPDF_IconFit CPDF_FormControl::GetIconFit() { @@ -286,8 +286,7 @@ CPDF_Font* CPDF_FormControl::GetDefaultControlFont() { if (CPDF_Dictionary* pDict = ToDictionary(pObj)) { CPDF_Dictionary* pFonts = pDict->GetDictBy("Font"); if (pFonts) { - CPDF_Dictionary* pElement = - pFonts->GetDictBy(csFontNameTag.AsByteStringC()); + CPDF_Dictionary* pElement = pFonts->GetDictBy(csFontNameTag.AsStringC()); if (pElement) { CPDF_Font* pFont = m_pField->m_pForm->m_pDocument->LoadFont(pElement); if (pFont) { @@ -304,8 +303,7 @@ CPDF_Font* CPDF_FormControl::GetDefaultControlFont() { if (CPDF_Dictionary* pDict = ToDictionary(pObj)) { CPDF_Dictionary* pFonts = pDict->GetDictBy("Font"); if (pFonts) { - CPDF_Dictionary* pElement = - pFonts->GetDictBy(csFontNameTag.AsByteStringC()); + CPDF_Dictionary* pElement = pFonts->GetDictBy(csFontNameTag.AsStringC()); if (pElement) { CPDF_Font* pFont = m_pField->m_pForm->m_pDocument->LoadFont(pElement); if (pFont) { diff --git a/core/fpdfdoc/doc_formfield.cpp b/core/fpdfdoc/doc_formfield.cpp index 1adc92ae4f..103465a8e5 100644 --- a/core/fpdfdoc/doc_formfield.cpp +++ b/core/fpdfdoc/doc_formfield.cpp @@ -1054,7 +1054,7 @@ void CPDF_FormField::LoadDA() { if (DA.IsEmpty()) { return; } - CPDF_SimpleParser syntax(DA.AsByteStringC()); + CPDF_SimpleParser syntax(DA.AsStringC()); syntax.FindTagParamFromStart("Tf", 2); CFX_ByteString font_name = syntax.GetWord(); CPDF_Dictionary* pFontDict = NULL; @@ -1062,7 +1062,7 @@ void CPDF_FormField::LoadDA() { m_pForm->m_pFormDict->GetDictBy("DR")->GetDictBy("Font")) pFontDict = m_pForm->m_pFormDict->GetDictBy("DR") ->GetDictBy("Font") - ->GetDictBy(font_name.AsByteStringC()); + ->GetDictBy(font_name.AsStringC()); if (!pFontDict) { return; diff --git a/core/fpdfdoc/doc_link.cpp b/core/fpdfdoc/doc_link.cpp index 8f8d0d158c..07cc9f26ff 100644 --- a/core/fpdfdoc/doc_link.cpp +++ b/core/fpdfdoc/doc_link.cpp @@ -82,7 +82,7 @@ CPDF_Dest CPDF_Link::GetDest(CPDF_Document* pDoc) { if (pDest->IsString() || pDest->IsName()) { CPDF_NameTree name_tree(pDoc, "Dests"); return CPDF_Dest( - name_tree.LookupNamedDest(pDoc, pDest->GetString().AsByteStringC())); + name_tree.LookupNamedDest(pDoc, pDest->GetString().AsStringC())); } if (CPDF_Array* pArray = pDest->AsArray()) return CPDF_Dest(pArray); diff --git a/core/fpdfdoc/doc_ocg.cpp b/core/fpdfdoc/doc_ocg.cpp index 02b6eb115e..9b57509e56 100644 --- a/core/fpdfdoc/doc_ocg.cpp +++ b/core/fpdfdoc/doc_ocg.cpp @@ -142,7 +142,7 @@ FX_BOOL CPDF_OCContext::LoadOCGStateFromConfig(const CFX_ByteStringC& csConfig, if (!pState) { continue; } - bState = pState->GetStringBy(csFind.AsByteStringC()) != "OFF"; + bState = pState->GetStringBy(csFind.AsStringC()) != "OFF"; } } return bState; @@ -154,11 +154,11 @@ FX_BOOL CPDF_OCContext::LoadOCGState(const CPDF_Dictionary* pOCGDict) const { CFX_ByteString csState = FPDFDOC_OCG_GetUsageTypeString(m_eUsageType); CPDF_Dictionary* pUsage = pOCGDict->GetDictBy("Usage"); if (pUsage) { - CPDF_Dictionary* pState = pUsage->GetDictBy(csState.AsByteStringC()); + CPDF_Dictionary* pState = pUsage->GetDictBy(csState.AsStringC()); if (pState) { CFX_ByteString csFind = csState + "State"; - if (pState->KeyExist(csFind.AsByteStringC())) { - return pState->GetStringBy(csFind.AsByteStringC()) != "OFF"; + if (pState->KeyExist(csFind.AsStringC())) { + return pState->GetStringBy(csFind.AsStringC()) != "OFF"; } } if (csState != "View") { @@ -169,7 +169,7 @@ FX_BOOL CPDF_OCContext::LoadOCGState(const CPDF_Dictionary* pOCGDict) const { } } FX_BOOL bDefValid = FALSE; - return LoadOCGStateFromConfig(csState.AsByteStringC(), pOCGDict, bDefValid); + return LoadOCGStateFromConfig(csState.AsStringC(), pOCGDict, bDefValid); } FX_BOOL CPDF_OCContext::GetOCGVisible(const CPDF_Dictionary* pOCGDict) { diff --git a/core/fpdfdoc/doc_tagged.cpp b/core/fpdfdoc/doc_tagged.cpp index 94c143d51c..a86514059c 100644 --- a/core/fpdfdoc/doc_tagged.cpp +++ b/core/fpdfdoc/doc_tagged.cpp @@ -205,8 +205,7 @@ CPDF_StructElementImpl::CPDF_StructElementImpl(CPDF_StructTreeImpl* pTree, m_pDict = pDict; m_Type = pDict->GetStringBy("S"); if (pTree->m_pRoleMap) { - CFX_ByteString mapped = - pTree->m_pRoleMap->GetStringBy(m_Type.AsByteStringC()); + CFX_ByteString mapped = pTree->m_pRoleMap->GetStringBy(m_Type.AsStringC()); if (!mapped.IsEmpty()) { m_Type = mapped; } @@ -375,15 +374,14 @@ CPDF_Object* CPDF_StructElementImpl::GetAttr(const CFX_ByteStringC& owner, for (uint32_t i = 0; i < pArray->GetCount(); i++) { CFX_ByteString class_name = pArray->GetStringAt(i); CPDF_Dictionary* pClassDict = - pClassMap->GetDictBy(class_name.AsByteStringC()); + pClassMap->GetDictBy(class_name.AsStringC()); if (pClassDict && pClassDict->GetStringBy("O") == owner) return pClassDict->GetDirectObjectBy(name); } return nullptr; } CFX_ByteString class_name = pC->GetString(); - CPDF_Dictionary* pClassDict = - pClassMap->GetDictBy(class_name.AsByteStringC()); + CPDF_Dictionary* pClassDict = pClassMap->GetDictBy(class_name.AsStringC()); if (pClassDict && pClassDict->GetStringBy("O") == owner) return pClassDict->GetDirectObjectBy(name); return nullptr; diff --git a/core/fpdfdoc/doc_utils.cpp b/core/fpdfdoc/doc_utils.cpp index 7e7fa8110f..7c66b879cb 100644 --- a/core/fpdfdoc/doc_utils.cpp +++ b/core/fpdfdoc/doc_utils.cpp @@ -82,7 +82,7 @@ FX_BOOL CPDF_DefaultAppearance::HasFont() { if (m_csDA.IsEmpty()) { return FALSE; } - CPDF_SimpleParser syntax(m_csDA.AsByteStringC()); + CPDF_SimpleParser syntax(m_csDA.AsStringC()); return syntax.FindTagParamFromStart("Tf", 2); } CFX_ByteString CPDF_DefaultAppearance::GetFontString() { @@ -90,7 +90,7 @@ CFX_ByteString CPDF_DefaultAppearance::GetFontString() { if (m_csDA.IsEmpty()) { return csFont; } - CPDF_SimpleParser syntax(m_csDA.AsByteStringC()); + CPDF_SimpleParser syntax(m_csDA.AsStringC()); if (syntax.FindTagParamFromStart("Tf", 2)) { csFont += (CFX_ByteString)syntax.GetWord(); csFont += " "; @@ -107,7 +107,7 @@ void CPDF_DefaultAppearance::GetFont(CFX_ByteString& csFontNameTag, if (m_csDA.IsEmpty()) { return; } - CPDF_SimpleParser syntax(m_csDA.AsByteStringC()); + CPDF_SimpleParser syntax(m_csDA.AsStringC()); if (syntax.FindTagParamFromStart("Tf", 2)) { csFontNameTag = CFX_ByteString(syntax.GetWord()); csFontNameTag.Delete(0, 1); @@ -119,7 +119,7 @@ FX_BOOL CPDF_DefaultAppearance::HasColor(FX_BOOL bStrokingOperation) { if (m_csDA.IsEmpty()) { return FALSE; } - CPDF_SimpleParser syntax(m_csDA.AsByteStringC()); + CPDF_SimpleParser syntax(m_csDA.AsStringC()); if (syntax.FindTagParamFromStart(bStrokingOperation ? "G" : "g", 1)) { return TRUE; } @@ -134,7 +134,7 @@ CFX_ByteString CPDF_DefaultAppearance::GetColorString( if (m_csDA.IsEmpty()) { return csColor; } - CPDF_SimpleParser syntax(m_csDA.AsByteStringC()); + CPDF_SimpleParser syntax(m_csDA.AsStringC()); if (syntax.FindTagParamFromStart(bStrokingOperation ? "G" : "g", 1)) { csColor += (CFX_ByteString)syntax.GetWord(); csColor += " "; @@ -174,7 +174,7 @@ void CPDF_DefaultAppearance::GetColor(int& iColorType, if (m_csDA.IsEmpty()) { return; } - CPDF_SimpleParser syntax(m_csDA.AsByteStringC()); + CPDF_SimpleParser syntax(m_csDA.AsStringC()); if (syntax.FindTagParamFromStart(bStrokingOperation ? "G" : "g", 1)) { iColorType = COLORTYPE_GRAY; fc[0] = FX_atof(syntax.GetWord()); @@ -203,7 +203,7 @@ void CPDF_DefaultAppearance::GetColor(FX_ARGB& color, if (m_csDA.IsEmpty()) { return; } - CPDF_SimpleParser syntax(m_csDA.AsByteStringC()); + CPDF_SimpleParser syntax(m_csDA.AsStringC()); if (syntax.FindTagParamFromStart(bStrokingOperation ? "G" : "g", 1)) { iColorType = COLORTYPE_GRAY; FX_FLOAT g = FX_atof(syntax.GetWord()) * 255 + 0.5f; @@ -235,7 +235,7 @@ FX_BOOL CPDF_DefaultAppearance::HasTextMatrix() { if (m_csDA.IsEmpty()) { return FALSE; } - CPDF_SimpleParser syntax(m_csDA.AsByteStringC()); + CPDF_SimpleParser syntax(m_csDA.AsStringC()); return syntax.FindTagParamFromStart("Tm", 6); } CFX_ByteString CPDF_DefaultAppearance::GetTextMatrixString() { @@ -243,7 +243,7 @@ CFX_ByteString CPDF_DefaultAppearance::GetTextMatrixString() { if (m_csDA.IsEmpty()) { return csTM; } - CPDF_SimpleParser syntax(m_csDA.AsByteStringC()); + CPDF_SimpleParser syntax(m_csDA.AsStringC()); if (syntax.FindTagParamFromStart("Tm", 6)) { for (int i = 0; i < 6; i++) { csTM += (CFX_ByteString)syntax.GetWord(); @@ -258,7 +258,7 @@ CFX_Matrix CPDF_DefaultAppearance::GetTextMatrix() { if (m_csDA.IsEmpty()) { return tm; } - CPDF_SimpleParser syntax(m_csDA.AsByteStringC()); + CPDF_SimpleParser syntax(m_csDA.AsStringC()); if (syntax.FindTagParamFromStart("Tm", 6)) { FX_FLOAT f[6]; for (int i = 0; i < 6; i++) { @@ -387,7 +387,7 @@ CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict, if (!pFonts) { return NULL; } - CPDF_Dictionary* pElement = pFonts->GetDictBy(csAlias.AsByteStringC()); + CPDF_Dictionary* pElement = pFonts->GetDictBy(csAlias.AsStringC()); if (!pElement) { return NULL; } @@ -606,7 +606,7 @@ void AddInterFormFont(CPDF_Dictionary*& pFormDict, csNameTag.Remove(' '); csNameTag = CPDF_InterForm::GenerateNewResourceName(pDR, "Font", 4, csNameTag); - pFonts->SetAtReference(csNameTag.AsByteStringC(), pDocument, + pFonts->SetAtReference(csNameTag.AsStringC(), pDocument, pFont->GetFontDict()); } CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict, @@ -651,7 +651,7 @@ void RemoveInterFormFont(CPDF_Dictionary* pFormDict, const CPDF_Font* pFont) { } CPDF_Dictionary* pDR = pFormDict->GetDictBy("DR"); CPDF_Dictionary* pFonts = pDR->GetDictBy("Font"); - pFonts->RemoveAt(csTag.AsByteStringC()); + pFonts->RemoveAt(csTag.AsStringC()); } void RemoveInterFormFont(CPDF_Dictionary* pFormDict, CFX_ByteString csNameTag) { if (!pFormDict || csNameTag.IsEmpty()) { @@ -665,7 +665,7 @@ void RemoveInterFormFont(CPDF_Dictionary* pFormDict, CFX_ByteString csNameTag) { if (!pFonts) { return; } - pFonts->RemoveAt(csNameTag.AsByteStringC()); + pFonts->RemoveAt(csNameTag.AsStringC()); } CPDF_Font* GetDefaultInterFormFont(CPDF_Dictionary* pFormDict, |