summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp45
-rw-r--r--fpdfsdk/src/fpdf_ext.cpp12
-rw-r--r--fpdfsdk/src/fpdf_flatten.cpp50
-rw-r--r--fpdfsdk/src/fpdf_transformpage.cpp20
-rw-r--r--fpdfsdk/src/fpdfdoc.cpp28
-rw-r--r--fpdfsdk/src/fpdfeditpage.cpp2
-rw-r--r--fpdfsdk/src/fpdfformfill.cpp4
-rw-r--r--fpdfsdk/src/fpdfppo.cpp10
-rw-r--r--fpdfsdk/src/fpdfsave.cpp4
-rw-r--r--fpdfsdk/src/fpdfview.cpp14
-rw-r--r--fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp6
-rw-r--r--fpdfsdk/src/fsdk_actionhandler.cpp2
-rw-r--r--fpdfsdk/src/fsdk_baseannot.cpp84
-rw-r--r--fpdfsdk/src/fsdk_baseform.cpp36
-rw-r--r--fpdfsdk/src/fsdk_mgr.cpp6
-rw-r--r--fpdfsdk/src/javascript/Document.cpp34
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Icon.cpp12
17 files changed, 185 insertions, 184 deletions
diff --git a/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp b/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp
index 9253563c38..7f5fd9430d 100644
--- a/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp
+++ b/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp
@@ -77,7 +77,7 @@ CPDF_Font* CBA_FontMap::FindFontSameCharset(CFX_ByteString& sFontAlias,
int32_t nCharset) {
ASSERT(m_pAnnotDict != NULL);
- if (m_pAnnotDict->GetString("Subtype") == "Widget") {
+ if (m_pAnnotDict->GetStringBy("Subtype") == "Widget") {
CPDF_Document* pDocument = GetDocument();
ASSERT(pDocument != NULL);
@@ -85,11 +85,11 @@ CPDF_Font* CBA_FontMap::FindFontSameCharset(CFX_ByteString& sFontAlias,
if (!pRootDict)
return NULL;
- CPDF_Dictionary* pAcroFormDict = pRootDict->GetDict("AcroForm");
+ CPDF_Dictionary* pAcroFormDict = pRootDict->GetDictBy("AcroForm");
if (!pAcroFormDict)
return NULL;
- CPDF_Dictionary* pDRDict = pAcroFormDict->GetDict("DR");
+ CPDF_Dictionary* pDRDict = pAcroFormDict->GetDictBy("DR");
if (!pDRDict)
return NULL;
@@ -112,7 +112,7 @@ CPDF_Font* CBA_FontMap::FindResFontSameCharset(CPDF_Dictionary* pResDict,
CPDF_Document* pDocument = GetDocument();
ASSERT(pDocument != NULL);
- CPDF_Dictionary* pFonts = pResDict->GetDict("Font");
+ CPDF_Dictionary* pFonts = pResDict->GetDictBy("Font");
if (!pFonts)
return NULL;
@@ -127,7 +127,7 @@ CPDF_Font* CBA_FontMap::FindResFontSameCharset(CPDF_Dictionary* pResDict,
CPDF_Dictionary* pElement = ToDictionary(pObj->GetDirect());
if (!pElement)
continue;
- if (pElement->GetString("Type") != "Font")
+ if (pElement->GetStringBy("Type") != "Font")
continue;
CPDF_Font* pFont = pDocument->LoadFont(pElement);
@@ -157,7 +157,7 @@ void CBA_FontMap::AddFontToAnnotDict(CPDF_Font* pFont,
ASSERT(m_pAnnotDict != NULL);
ASSERT(m_pDocument != NULL);
- CPDF_Dictionary* pAPDict = m_pAnnotDict->GetDict("AP");
+ CPDF_Dictionary* pAPDict = m_pAnnotDict->GetDictBy("AP");
if (!pAPDict) {
pAPDict = new CPDF_Dictionary;
@@ -169,7 +169,7 @@ void CBA_FontMap::AddFontToAnnotDict(CPDF_Font* pFont,
if (ToDictionary(pObject))
return;
- CPDF_Stream* pStream = pAPDict->GetStream(m_sAPType);
+ CPDF_Stream* pStream = pAPDict->GetStreamBy(m_sAPType);
if (!pStream) {
pStream = new CPDF_Stream(NULL, 0, NULL);
int32_t objnum = m_pDocument->AddIndirectObject(pStream);
@@ -184,14 +184,14 @@ void CBA_FontMap::AddFontToAnnotDict(CPDF_Font* pFont,
}
if (pStreamDict) {
- CPDF_Dictionary* pStreamResList = pStreamDict->GetDict("Resources");
+ CPDF_Dictionary* pStreamResList = pStreamDict->GetDictBy("Resources");
if (!pStreamResList) {
pStreamResList = new CPDF_Dictionary();
pStreamDict->SetAt("Resources", pStreamResList);
}
if (pStreamResList) {
- CPDF_Dictionary* pStreamResFontList = pStreamResList->GetDict("Font");
+ CPDF_Dictionary* pStreamResFontList = pStreamResList->GetDictBy("Font");
if (!pStreamResFontList) {
pStreamResFontList = new CPDF_Dictionary;
int32_t objnum = m_pDocument->AddIndirectObject(pStreamResFontList);
@@ -210,11 +210,11 @@ CPDF_Font* CBA_FontMap::GetAnnotDefaultFont(CFX_ByteString& sAlias) {
CPDF_Dictionary* pAcroFormDict = NULL;
- FX_BOOL bWidget = (m_pAnnotDict->GetString("Subtype") == "Widget");
+ FX_BOOL bWidget = (m_pAnnotDict->GetStringBy("Subtype") == "Widget");
if (bWidget) {
if (CPDF_Dictionary* pRootDict = m_pDocument->GetRoot())
- pAcroFormDict = pRootDict->GetDict("AcroForm");
+ pAcroFormDict = pRootDict->GetDictBy("AcroForm");
}
CFX_ByteString sDA;
@@ -237,24 +237,25 @@ CPDF_Font* CBA_FontMap::GetAnnotDefaultFont(CFX_ByteString& sAlias) {
CFX_ByteString sFontName = syntax.GetWord();
sAlias = PDF_NameDecode(sFontName).Mid(1);
- if (CPDF_Dictionary* pDRDict = m_pAnnotDict->GetDict("DR"))
- if (CPDF_Dictionary* pDRFontDict = pDRDict->GetDict("Font"))
- pFontDict = pDRFontDict->GetDict(sAlias);
+ if (CPDF_Dictionary* pDRDict = m_pAnnotDict->GetDictBy("DR"))
+ if (CPDF_Dictionary* pDRFontDict = pDRDict->GetDictBy("Font"))
+ pFontDict = pDRFontDict->GetDictBy(sAlias);
if (!pFontDict)
- if (CPDF_Dictionary* pAPDict = m_pAnnotDict->GetDict("AP"))
- if (CPDF_Dictionary* pNormalDict = pAPDict->GetDict("N"))
+ if (CPDF_Dictionary* pAPDict = m_pAnnotDict->GetDictBy("AP"))
+ if (CPDF_Dictionary* pNormalDict = pAPDict->GetDictBy("N"))
if (CPDF_Dictionary* pNormalResDict =
- pNormalDict->GetDict("Resources"))
- if (CPDF_Dictionary* pResFontDict = pNormalResDict->GetDict("Font"))
- pFontDict = pResFontDict->GetDict(sAlias);
+ pNormalDict->GetDictBy("Resources"))
+ if (CPDF_Dictionary* pResFontDict =
+ pNormalResDict->GetDictBy("Font"))
+ pFontDict = pResFontDict->GetDictBy(sAlias);
if (bWidget) {
if (!pFontDict) {
if (pAcroFormDict) {
- if (CPDF_Dictionary* pDRDict = pAcroFormDict->GetDict("DR"))
- if (CPDF_Dictionary* pDRFontDict = pDRDict->GetDict("Font"))
- pFontDict = pDRFontDict->GetDict(sAlias);
+ if (CPDF_Dictionary* pDRDict = pAcroFormDict->GetDictBy("DR"))
+ if (CPDF_Dictionary* pDRFontDict = pDRDict->GetDictBy("Font"))
+ pFontDict = pDRFontDict->GetDictBy(sAlias);
}
}
}
diff --git a/fpdfsdk/src/fpdf_ext.cpp b/fpdfsdk/src/fpdf_ext.cpp
index c83464e722..aa6725b288 100644
--- a/fpdfsdk/src/fpdf_ext.cpp
+++ b/fpdfsdk/src/fpdf_ext.cpp
@@ -69,7 +69,7 @@ void CheckUnSupportAnnot(CPDF_Document* pDoc, const CPDF_Annot* pPDFAnnot) {
const CPDF_Dictionary* pAnnotDict = pPDFAnnot->GetAnnotDict();
CFX_ByteString cbString;
if (pAnnotDict->KeyExist("IT"))
- cbString = pAnnotDict->GetString("IT");
+ cbString = pAnnotDict->GetStringBy("IT");
if (cbString.Compare("Img") != 0)
FPDF_UnSupportError(FPDF_UNSP_ANNOT_SCREEN_MEDIA);
} else if (cbSubType.Compare("Movie") == 0) {
@@ -84,7 +84,7 @@ void CheckUnSupportAnnot(CPDF_Document* pDoc, const CPDF_Annot* pPDFAnnot) {
const CPDF_Dictionary* pAnnotDict = pPDFAnnot->GetAnnotDict();
CFX_ByteString cbString;
if (pAnnotDict->KeyExist("FT")) {
- cbString = pAnnotDict->GetString("FT");
+ cbString = pAnnotDict->GetStringBy("FT");
}
if (cbString.Compare("Sig") == 0) {
FPDF_UnSupportError(FPDF_UNSP_ANNOT_SIG);
@@ -150,18 +150,18 @@ void CheckUnSupportError(CPDF_Document* pDoc, FX_DWORD err_code) {
return;
}
if (pRootDict->KeyExist("Names")) {
- CPDF_Dictionary* pNameDict = pRootDict->GetDict("Names");
+ CPDF_Dictionary* pNameDict = pRootDict->GetDictBy("Names");
if (pNameDict && pNameDict->KeyExist("EmbeddedFiles")) {
FPDF_UnSupportError(FPDF_UNSP_DOC_ATTACHMENT);
return;
}
if (pNameDict && pNameDict->KeyExist("JavaScript")) {
- CPDF_Dictionary* pJSDict = pNameDict->GetDict("JavaScript");
- CPDF_Array* pArray = pJSDict ? pJSDict->GetArray("Names") : NULL;
+ CPDF_Dictionary* pJSDict = pNameDict->GetDictBy("JavaScript");
+ CPDF_Array* pArray = pJSDict ? pJSDict->GetArrayBy("Names") : NULL;
if (pArray) {
int nCount = pArray->GetCount();
for (int i = 0; i < nCount; i++) {
- CFX_ByteString cbStr = pArray->GetString(i);
+ CFX_ByteString cbStr = pArray->GetStringAt(i);
if (cbStr.Compare("com.adobe.acrobat.SharedReview.Register") == 0) {
FPDF_UnSupportError(FPDF_UNSP_DOC_SHAREDREVIEW);
return;
diff --git a/fpdfsdk/src/fpdf_flatten.cpp b/fpdfsdk/src/fpdf_flatten.cpp
index c59b6edc4d..413b391eee 100644
--- a/fpdfsdk/src/fpdf_flatten.cpp
+++ b/fpdfsdk/src/fpdf_flatten.cpp
@@ -54,7 +54,7 @@ FX_BOOL GetContentsRect(CPDF_Document* pDoc,
rc.bottom = pPageObject->m_Bottom;
rc.top = pPageObject->m_Top;
- if (IsValiableRect(rc, pDict->GetRect("MediaBox"))) {
+ if (IsValiableRect(rc, pDict->GetRectBy("MediaBox"))) {
pRectArray->Add(rc);
}
}
@@ -71,11 +71,11 @@ void ParserStream(CPDF_Dictionary* pPageDic,
return;
CPDF_Rect rect;
if (pStream->KeyExist("Rect"))
- rect = pStream->GetRect("Rect");
+ rect = pStream->GetRectBy("Rect");
else if (pStream->KeyExist("BBox"))
- rect = pStream->GetRect("BBox");
+ rect = pStream->GetRectBy("BBox");
- if (IsValiableRect(rect, pPageDic->GetRect("MediaBox")))
+ if (IsValiableRect(rect, pPageDic->GetRectBy("MediaBox")))
pRectArray->Add(rect);
pObjectArray->Add(pStream);
@@ -90,7 +90,7 @@ int ParserAnnots(CPDF_Document* pSourceDoc,
return FLATTEN_FAIL;
GetContentsRect(pSourceDoc, pPageDic, pRectArray);
- CPDF_Array* pAnnots = pPageDic->GetArray("Annots");
+ CPDF_Array* pAnnots = pPageDic->GetArrayBy("Annots");
if (!pAnnots)
return FLATTEN_NOTHINGTODO;
@@ -100,11 +100,11 @@ int ParserAnnots(CPDF_Document* pSourceDoc,
if (!pAnnotDic)
continue;
- CFX_ByteString sSubtype = pAnnotDic->GetString("Subtype");
+ CFX_ByteString sSubtype = pAnnotDic->GetStringBy("Subtype");
if (sSubtype == "Popup")
continue;
- int nAnnotFlag = pAnnotDic->GetInteger("F");
+ int nAnnotFlag = pAnnotDic->GetIntegerBy("F");
if (nAnnotFlag & ANNOTFLAG_HIDDEN)
continue;
@@ -187,9 +187,9 @@ CPDF_Rect CalculateRect(CPDF_RectArray* pRectArray) {
void SetPageContents(CFX_ByteString key,
CPDF_Dictionary* pPage,
CPDF_Document* pDocument) {
- CPDF_Object* pContentsObj = pPage->GetStream("Contents");
+ CPDF_Object* pContentsObj = pPage->GetStreamBy("Contents");
if (!pContentsObj) {
- pContentsObj = pPage->GetArray("Contents");
+ pContentsObj = pPage->GetArrayBy("Contents");
}
if (!pContentsObj) {
@@ -332,10 +332,10 @@ DLLEXPORT int STDCALL FPDFPage_Flatten(FPDF_PAGE page, int nFlag) {
CPDF_Rect rcOriginalCB;
CPDF_Rect rcMerger = CalculateRect(&RectArray);
- CPDF_Rect rcOriginalMB = pPageDict->GetRect("MediaBox");
+ CPDF_Rect rcOriginalMB = pPageDict->GetRectBy("MediaBox");
if (pPageDict->KeyExist("CropBox"))
- rcOriginalMB = pPageDict->GetRect("CropBox");
+ rcOriginalMB = pPageDict->GetRectBy("CropBox");
if (rcOriginalMB.IsEmpty()) {
rcOriginalMB = CPDF_Rect(0.0f, 0.0f, 612.0f, 792.0f);
@@ -351,7 +351,7 @@ DLLEXPORT int STDCALL FPDFPage_Flatten(FPDF_PAGE page, int nFlag) {
: rcMerger.bottom;
if (pPageDict->KeyExist("ArtBox"))
- rcOriginalCB = pPageDict->GetRect("ArtBox");
+ rcOriginalCB = pPageDict->GetRectBy("ArtBox");
else
rcOriginalCB = rcOriginalMB;
@@ -373,7 +373,7 @@ DLLEXPORT int STDCALL FPDFPage_Flatten(FPDF_PAGE page, int nFlag) {
pPageDict->SetAt("ArtBox", pCropBox);
}
- CPDF_Dictionary* pRes = pPageDict->GetDict("Resources");
+ CPDF_Dictionary* pRes = pPageDict->GetDictBy("Resources");
if (!pRes) {
pRes = new CPDF_Dictionary;
pPageDict->SetAt("Resources", pRes);
@@ -381,7 +381,7 @@ DLLEXPORT int STDCALL FPDFPage_Flatten(FPDF_PAGE page, int nFlag) {
CPDF_Stream* pNewXObject = new CPDF_Stream(NULL, 0, new CPDF_Dictionary);
FX_DWORD dwObjNum = pDocument->AddIndirectObject(pNewXObject);
- CPDF_Dictionary* pPageXObject = pRes->GetDict("XObject");
+ CPDF_Dictionary* pPageXObject = pRes->GetDictBy("XObject");
if (!pPageXObject) {
pPageXObject = new CPDF_Dictionary;
pRes->SetAt("XObject", pPageXObject);
@@ -414,7 +414,7 @@ DLLEXPORT int STDCALL FPDFPage_Flatten(FPDF_PAGE page, int nFlag) {
pNewOXbjectDic->SetAtName("Subtype", "Form");
pNewOXbjectDic->SetAtInteger("FormType", 1);
pNewOXbjectDic->SetAtName("Name", "FRM");
- CPDF_Rect rcBBox = pPageDict->GetRect("ArtBox");
+ CPDF_Rect rcBBox = pPageDict->GetRectBy("ArtBox");
pNewOXbjectDic->SetAtRect("BBox", rcBBox);
}
@@ -423,22 +423,22 @@ DLLEXPORT int STDCALL FPDFPage_Flatten(FPDF_PAGE page, int nFlag) {
if (!pAnnotDic)
continue;
- CPDF_Rect rcAnnot = pAnnotDic->GetRect("Rect");
+ CPDF_Rect rcAnnot = pAnnotDic->GetRectBy("Rect");
rcAnnot.Normalize();
- CFX_ByteString sAnnotState = pAnnotDic->GetString("AS");
- CPDF_Dictionary* pAnnotAP = pAnnotDic->GetDict("AP");
+ CFX_ByteString sAnnotState = pAnnotDic->GetStringBy("AS");
+ CPDF_Dictionary* pAnnotAP = pAnnotDic->GetDictBy("AP");
if (!pAnnotAP)
continue;
- CPDF_Stream* pAPStream = pAnnotAP->GetStream("N");
+ CPDF_Stream* pAPStream = pAnnotAP->GetStreamBy("N");
if (!pAPStream) {
- CPDF_Dictionary* pAPDic = pAnnotAP->GetDict("N");
+ CPDF_Dictionary* pAPDic = pAnnotAP->GetDictBy("N");
if (!pAPDic)
continue;
if (!sAnnotState.IsEmpty()) {
- pAPStream = pAPDic->GetStream(sAnnotState);
+ pAPStream = pAPDic->GetStreamBy(sAnnotState);
} else {
auto it = pAPDic->begin();
if (it != pAPDic->end()) {
@@ -457,13 +457,13 @@ DLLEXPORT int STDCALL FPDFPage_Flatten(FPDF_PAGE page, int nFlag) {
continue;
CPDF_Dictionary* pAPDic = pAPStream->GetDict();
- CFX_Matrix matrix = pAPDic->GetMatrix("Matrix");
+ CFX_Matrix matrix = pAPDic->GetMatrixBy("Matrix");
CPDF_Rect rcStream;
if (pAPDic->KeyExist("Rect"))
- rcStream = pAPDic->GetRect("Rect");
+ rcStream = pAPDic->GetRectBy("Rect");
else if (pAPDic->KeyExist("BBox"))
- rcStream = pAPDic->GetRect("BBox");
+ rcStream = pAPDic->GetRectBy("BBox");
if (rcStream.IsEmpty())
continue;
@@ -478,7 +478,7 @@ DLLEXPORT int STDCALL FPDFPage_Flatten(FPDF_PAGE page, int nFlag) {
}
}
- CPDF_Dictionary* pXObject = pNewXORes->GetDict("XObject");
+ CPDF_Dictionary* pXObject = pNewXORes->GetDictBy("XObject");
if (!pXObject) {
pXObject = new CPDF_Dictionary;
pNewXORes->SetAt("XObject", pXObject);
diff --git a/fpdfsdk/src/fpdf_transformpage.cpp b/fpdfsdk/src/fpdf_transformpage.cpp
index a3074954a0..4664037087 100644
--- a/fpdfsdk/src/fpdf_transformpage.cpp
+++ b/fpdfsdk/src/fpdf_transformpage.cpp
@@ -32,14 +32,14 @@ FPDF_BOOL GetBoundingBox(CPDF_Page* page,
float* right,
float* top) {
CPDF_Dictionary* pPageDict = page->m_pFormDict;
- CPDF_Array* pArray = pPageDict->GetArray(key);
+ CPDF_Array* pArray = pPageDict->GetArrayBy(key);
if (!pArray)
return FALSE;
- *left = pArray->GetFloat(0);
- *bottom = pArray->GetFloat(1);
- *right = pArray->GetFloat(2);
- *top = pArray->GetFloat(3);
+ *left = pArray->GetFloatAt(0);
+ *bottom = pArray->GetFloatAt(1);
+ *right = pArray->GetFloatAt(2);
+ *top = pArray->GetFloatAt(3);
return TRUE;
}
@@ -113,7 +113,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page,
CPDF_Object* pContentObj =
pPageDic ? pPageDic->GetElement("Contents") : nullptr;
if (!pContentObj)
- pContentObj = pPageDic ? pPageDic->GetArray("Contents") : nullptr;
+ pContentObj = pPageDic ? pPageDic->GetArrayBy("Contents") : nullptr;
if (!pContentObj)
return FALSE;
@@ -156,9 +156,9 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page,
}
// Need to transform the patterns as well.
- CPDF_Dictionary* pRes = pPageDic->GetDict("Resources");
+ CPDF_Dictionary* pRes = pPageDic->GetDictBy("Resources");
if (pRes) {
- CPDF_Dictionary* pPattenDict = pRes->GetDict("Pattern");
+ CPDF_Dictionary* pPattenDict = pRes->GetDictBy("Pattern");
if (pPattenDict) {
for (const auto& it : *pPattenDict) {
CPDF_Object* pObj = it.second;
@@ -173,7 +173,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page,
else
continue;
- CFX_Matrix m = pDict->GetMatrix("Matrix");
+ CFX_Matrix m = pDict->GetMatrixBy("Matrix");
CFX_Matrix t = *(CFX_Matrix*)matrix;
m.Concat(t);
pDict->SetAtMatrix("Matrix", m);
@@ -270,7 +270,7 @@ DLLEXPORT void STDCALL FPDFPage_InsertClipPath(FPDF_PAGE page,
CPDF_Object* pContentObj =
pPageDic ? pPageDic->GetElement("Contents") : nullptr;
if (!pContentObj)
- pContentObj = pPageDic ? pPageDic->GetArray("Contents") : nullptr;
+ pContentObj = pPageDic ? pPageDic->GetArrayBy("Contents") : nullptr;
if (!pContentObj)
return;
diff --git a/fpdfsdk/src/fpdfdoc.cpp b/fpdfsdk/src/fpdfdoc.cpp
index 4bd37a731a..4a4e1de0fe 100644
--- a/fpdfsdk/src/fpdfdoc.cpp
+++ b/fpdfsdk/src/fpdfdoc.cpp
@@ -265,7 +265,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFLink_Enumerate(FPDF_PAGE page,
CPDF_Page* pPage = CPDFPageFromFPDFPage(page);
if (!pPage || !pPage->m_pFormDict)
return FALSE;
- CPDF_Array* pAnnots = pPage->m_pFormDict->GetArray("Annots");
+ CPDF_Array* pAnnots = pPage->m_pFormDict->GetArrayBy("Annots");
if (!pAnnots)
return FALSE;
for (int i = *startPos; i < (int)pAnnots->GetCount(); i++) {
@@ -273,7 +273,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFLink_Enumerate(FPDF_PAGE page,
ToDictionary(static_cast<CPDF_Object*>(pAnnots->GetElementValue(i)));
if (!pDict)
continue;
- if (pDict->GetString("Subtype").Equal("Link")) {
+ if (pDict->GetStringBy("Subtype").Equal("Link")) {
*startPos = i + 1;
*linkAnnot = (FPDF_LINK)pDict;
return TRUE;
@@ -288,7 +288,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetAnnotRect(FPDF_LINK linkAnnot,
return FALSE;
CPDF_Dictionary* pAnnotDict =
ToDictionary(static_cast<CPDF_Object*>(linkAnnot));
- CPDF_Rect rt = pAnnotDict->GetRect("Rect");
+ CPDF_Rect rt = pAnnotDict->GetRectBy("Rect");
rect->left = rt.left;
rect->bottom = rt.bottom;
rect->right = rt.right;
@@ -301,7 +301,7 @@ DLLEXPORT int STDCALL FPDFLink_CountQuadPoints(FPDF_LINK linkAnnot) {
return 0;
CPDF_Dictionary* pAnnotDict =
ToDictionary(static_cast<CPDF_Object*>(linkAnnot));
- CPDF_Array* pArray = pAnnotDict->GetArray("QuadPoints");
+ CPDF_Array* pArray = pAnnotDict->GetArrayBy("QuadPoints");
if (!pArray)
return 0;
return pArray->GetCount() / 8;
@@ -314,19 +314,19 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetQuadPoints(FPDF_LINK linkAnnot,
return FALSE;
CPDF_Dictionary* pAnnotDict =
ToDictionary(static_cast<CPDF_Object*>(linkAnnot));
- CPDF_Array* pArray = pAnnotDict->GetArray("QuadPoints");
+ CPDF_Array* pArray = pAnnotDict->GetArrayBy("QuadPoints");
if (pArray) {
if (quadIndex < 0 || quadIndex >= (int)pArray->GetCount() / 8 ||
((quadIndex * 8 + 7) >= (int)pArray->GetCount()))
return FALSE;
- quadPoints->x1 = pArray->GetNumber(quadIndex * 8);
- quadPoints->y1 = pArray->GetNumber(quadIndex * 8 + 1);
- quadPoints->x2 = pArray->GetNumber(quadIndex * 8 + 2);
- quadPoints->y2 = pArray->GetNumber(quadIndex * 8 + 3);
- quadPoints->x3 = pArray->GetNumber(quadIndex * 8 + 4);
- quadPoints->y3 = pArray->GetNumber(quadIndex * 8 + 5);
- quadPoints->x4 = pArray->GetNumber(quadIndex * 8 + 6);
- quadPoints->y4 = pArray->GetNumber(quadIndex * 8 + 7);
+ quadPoints->x1 = pArray->GetNumberAt(quadIndex * 8);
+ quadPoints->y1 = pArray->GetNumberAt(quadIndex * 8 + 1);
+ quadPoints->x2 = pArray->GetNumberAt(quadIndex * 8 + 2);
+ quadPoints->y2 = pArray->GetNumberAt(quadIndex * 8 + 3);
+ quadPoints->x3 = pArray->GetNumberAt(quadIndex * 8 + 4);
+ quadPoints->y3 = pArray->GetNumberAt(quadIndex * 8 + 5);
+ quadPoints->x4 = pArray->GetNumberAt(quadIndex * 8 + 6);
+ quadPoints->y4 = pArray->GetNumberAt(quadIndex * 8 + 7);
return TRUE;
}
return FALSE;
@@ -344,7 +344,7 @@ DLLEXPORT unsigned long STDCALL FPDF_GetMetaText(FPDF_DOCUMENT doc,
CPDF_Dictionary* pInfo = pDoc->GetInfo();
if (!pInfo)
return 0;
- CFX_WideString text = pInfo->GetUnicodeText(tag);
+ CFX_WideString text = pInfo->GetUnicodeTextBy(tag);
// Use UTF-16LE encoding
CFX_ByteString encodedText = text.UTF16LE_Encode();
unsigned long len = encodedText.GetLength();
diff --git a/fpdfsdk/src/fpdfeditpage.cpp b/fpdfsdk/src/fpdfeditpage.cpp
index 521cc9fc83..f964172d10 100644
--- a/fpdfsdk/src/fpdfeditpage.cpp
+++ b/fpdfsdk/src/fpdfeditpage.cpp
@@ -283,7 +283,7 @@ DLLEXPORT void STDCALL FPDFPage_TransformAnnots(FPDF_PAGE page,
(FX_FLOAT)e, (FX_FLOAT)f);
rect.Transform(&matrix);
CPDF_Array* pRectArray = NULL;
- pRectArray = pAnnot->GetAnnotDict()->GetArray("Rect");
+ pRectArray = pAnnot->GetAnnotDict()->GetArrayBy("Rect");
if (!pRectArray)
pRectArray = new CPDF_Array;
pRectArray->SetAt(0, new CPDF_Number(rect.left));
diff --git a/fpdfsdk/src/fpdfformfill.cpp b/fpdfsdk/src/fpdfformfill.cpp
index b870d38939..49dfd6c113 100644
--- a/fpdfsdk/src/fpdfformfill.cpp
+++ b/fpdfsdk/src/fpdfformfill.cpp
@@ -703,7 +703,7 @@ DLLEXPORT void STDCALL FORM_DoDocumentAAction(FPDF_FORMHANDLE hHandle,
if (!pDic)
return;
- CPDF_AAction aa = pDic->GetDict("AA");
+ CPDF_AAction aa = pDic->GetDictBy("AA");
if (aa.ActionExist((CPDF_AAction::AActionType)aaType)) {
CPDF_Action action = aa.GetAction((CPDF_AAction::AActionType)aaType);
CPDFSDK_ActionHandler* pActionHandler =
@@ -727,7 +727,7 @@ DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page,
CPDFDoc_Environment* pEnv = pSDKDoc->GetEnv();
CPDFSDK_ActionHandler* pActionHandler = pEnv->GetActionHander();
CPDF_Dictionary* pPageDict = pPDFPage->m_pFormDict;
- CPDF_AAction aa = pPageDict->GetDict("AA");
+ CPDF_AAction aa = pPageDict->GetDictBy("AA");
if (FPDFPAGE_AACTION_OPEN == aaType) {
if (aa.ActionExist(CPDF_AAction::OpenPage)) {
CPDF_Action action = aa.GetAction(CPDF_AAction::OpenPage);
diff --git a/fpdfsdk/src/fpdfppo.cpp b/fpdfsdk/src/fpdfppo.cpp
index 895e360e8e..c05c7f35f0 100644
--- a/fpdfsdk/src/fpdfppo.cpp
+++ b/fpdfsdk/src/fpdfppo.cpp
@@ -54,7 +54,7 @@ FX_BOOL CPDF_PageOrganizer::PDFDocInit(CPDF_Document* pDestPDFDoc,
DInfoDict->SetAt("Producer", new CPDF_String(producerstr, FALSE));
// Set type
- CFX_ByteString cbRootType = pNewRoot->GetString("Type", "");
+ CFX_ByteString cbRootType = pNewRoot->GetStringBy("Type", "");
if (cbRootType.Equal("")) {
pNewRoot->SetAt("Type", new CPDF_Name("Catalog"));
}
@@ -68,12 +68,12 @@ FX_BOOL CPDF_PageOrganizer::PDFDocInit(CPDF_Document* pDestPDFDoc,
pNewRoot->SetAt("Pages", new CPDF_Reference(pDestPDFDoc, NewPagesON));
}
- CFX_ByteString cbPageType = pNewPages->GetString("Type", "");
+ CFX_ByteString cbPageType = pNewPages->GetStringBy("Type", "");
if (cbPageType.Equal("")) {
pNewPages->SetAt("Type", new CPDF_Name("Pages"));
}
- CPDF_Array* pKeysArray = pNewPages->GetArray("Kids");
+ CPDF_Array* pKeysArray = pNewPages->GetArrayBy("Kids");
if (!pKeysArray) {
CPDF_Array* pNewKids = new CPDF_Array;
FX_DWORD Kidsobjnum = -1;
@@ -285,7 +285,7 @@ FX_DWORD CPDF_PageOrganizer::GetNewObjId(CPDF_Document* pDoc,
if (CPDF_Dictionary* pDictClone = pClone->AsDictionary()) {
if (pDictClone->KeyExist("Type")) {
- CFX_ByteString strType = pDictClone->GetString("Type");
+ CFX_ByteString strType = pDictClone->GetStringBy("Type");
if (!FXSYS_stricmp(strType, "Pages")) {
pDictClone->Release();
return 4;
@@ -394,7 +394,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDF_CopyViewerPreferences(FPDF_DOCUMENT dest_doc,
return FALSE;
CPDF_Dictionary* pSrcDict = pSrcDoc->GetRoot();
- pSrcDict = pSrcDict->GetDict("ViewerPreferences");
+ pSrcDict = pSrcDict->GetDictBy("ViewerPreferences");
if (!pSrcDict)
return FALSE;
diff --git a/fpdfsdk/src/fpdfsave.cpp b/fpdfsdk/src/fpdfsave.cpp
index 598d93676c..b8e9c6e25c 100644
--- a/fpdfsdk/src/fpdfsave.cpp
+++ b/fpdfsdk/src/fpdfsave.cpp
@@ -84,7 +84,7 @@ FX_BOOL _SaveXFADocumentData(CPDFXFA_Document* pDocument,
CPDF_Dictionary* pRoot = pPDFDocument->GetRoot();
if (pRoot == NULL)
return FALSE;
- CPDF_Dictionary* pAcroForm = pRoot->GetDict("AcroForm");
+ CPDF_Dictionary* pAcroForm = pRoot->GetDictBy("AcroForm");
if (NULL == pAcroForm)
return FALSE;
CPDF_Object* pXFA = pAcroForm->GetElement("XFA");
@@ -119,7 +119,7 @@ FX_BOOL _SaveXFADocumentData(CPDFXFA_Document* pDocument,
// template
if (iTemplate > -1) {
- CPDF_Stream* pTemplateStream = pArray->GetStream(iTemplate);
+ CPDF_Stream* pTemplateStream = pArray->GetStreamAt(iTemplate);
CPDF_StreamAcc streamAcc;
streamAcc.LoadAllData(pTemplateStream);
uint8_t* pData = (uint8_t*)streamAcc.GetData();
diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp
index 6e9ee05ea0..ba647093eb 100644
--- a/fpdfsdk/src/fpdfview.cpp
+++ b/fpdfsdk/src/fpdfview.cpp
@@ -347,7 +347,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDF_HasXFAField(FPDF_DOCUMENT document,
if (!pRoot)
return FALSE;
- CPDF_Dictionary* pAcroForm = pRoot->GetDict("AcroForm");
+ CPDF_Dictionary* pAcroForm = pRoot->GetDictBy("AcroForm");
if (!pAcroForm)
return FALSE;
@@ -355,7 +355,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDF_HasXFAField(FPDF_DOCUMENT document,
if (!pXFA)
return FALSE;
- FX_BOOL bDynamicXFA = pRoot->GetBoolean("NeedsRendering", FALSE);
+ FX_BOOL bDynamicXFA = pRoot->GetBooleanBy("NeedsRendering", FALSE);
if (bDynamicXFA)
*docType = DOCTYPE_DYNAMIC_XFA;
@@ -463,7 +463,7 @@ DLLEXPORT unsigned long STDCALL FPDF_GetDocPermissions(FPDF_DOCUMENT document) {
#endif // PDF_ENABLE_XFA
CPDF_Dictionary* pDict = pDoc->GetParser()->GetEncryptDict();
- return pDict ? pDict->GetInteger("P") : (FX_DWORD)-1;
+ return pDict ? pDict->GetIntegerBy("P") : (FX_DWORD)-1;
}
DLLEXPORT int STDCALL FPDF_GetSecurityHandlerRevision(FPDF_DOCUMENT document) {
@@ -472,7 +472,7 @@ DLLEXPORT int STDCALL FPDF_GetSecurityHandlerRevision(FPDF_DOCUMENT document) {
return -1;
CPDF_Dictionary* pDict = pDoc->GetParser()->GetEncryptDict();
- return pDict ? pDict->GetInteger("R") : -1;
+ return pDict ? pDict->GetIntegerBy("R") : -1;
}
DLLEXPORT int STDCALL FPDF_GetPageCount(FPDF_DOCUMENT document) {
@@ -1054,7 +1054,7 @@ DLLEXPORT FPDF_DWORD STDCALL FPDF_CountNamedDests(FPDF_DOCUMENT document) {
CPDF_NameTree nameTree(pDoc, "Dests");
pdfium::base::CheckedNumeric<FPDF_DWORD> count = nameTree.GetCount();
- CPDF_Dictionary* pDest = pRoot->GetDict("Dests");
+ CPDF_Dictionary* pDest = pRoot->GetDictBy("Dests");
if (pDest)
count += pDest->GetCount();
@@ -1154,7 +1154,7 @@ DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDest(FPDF_DOCUMENT document,
CPDF_NameTree nameTree(pDoc, "Dests");
int count = nameTree.GetCount();
if (index >= count) {
- CPDF_Dictionary* pDest = pRoot->GetDict("Dests");
+ CPDF_Dictionary* pDest = pRoot->GetDictBy("Dests");
if (!pDest)
return nullptr;
@@ -1180,7 +1180,7 @@ DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDest(FPDF_DOCUMENT document,
if (!pDestObj)
return nullptr;
if (CPDF_Dictionary* pDict = pDestObj->AsDictionary()) {
- pDestObj = pDict->GetArray("D");
+ pDestObj = pDict->GetArrayBy("D");
if (!pDestObj)
return nullptr;
}
diff --git a/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp b/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp
index 254dc7df74..d37038d2af 100644
--- a/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp
+++ b/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp
@@ -579,7 +579,7 @@ void CPDFXFA_Document::GetTitle(IXFA_Doc* hDoc, CFX_WideString& wsTitle) {
if (pInfoDict == NULL)
return;
- CFX_ByteString csTitle = pInfoDict->GetString("Title");
+ CFX_ByteString csTitle = pInfoDict->GetStringBy("Title");
wsTitle = wsTitle.FromLocal(csTitle.GetBuffer(csTitle.GetLength()));
csTitle.ReleaseBuffer(csTitle.GetLength());
}
@@ -642,7 +642,7 @@ void CPDFXFA_Document::ExportData(IXFA_Doc* hDoc,
CPDF_Dictionary* pRoot = m_pPDFDoc->GetRoot();
if (pRoot == NULL)
return;
- CPDF_Dictionary* pAcroForm = pRoot->GetDict("AcroForm");
+ CPDF_Dictionary* pAcroForm = pRoot->GetDictBy("AcroForm");
if (NULL == pAcroForm)
return;
CPDF_Object* pXFA = pAcroForm->GetElement("XFA");
@@ -947,7 +947,7 @@ FX_BOOL CPDFXFA_Document::_ExportSubmitFile(FPDF_FILEHANDLER* pFileHandler,
fileStream.Flush();
return FALSE;
}
- CPDF_Dictionary* pAcroForm = pRoot->GetDict("AcroForm");
+ CPDF_Dictionary* pAcroForm = pRoot->GetDictBy("AcroForm");
if (NULL == pAcroForm) {
fileStream.Flush();
return FALSE;
diff --git a/fpdfsdk/src/fsdk_actionhandler.cpp b/fpdfsdk/src/fsdk_actionhandler.cpp
index a1ab632a4e..c429373f08 100644
--- a/fpdfsdk/src/fsdk_actionhandler.cpp
+++ b/fpdfsdk/src/fsdk_actionhandler.cpp
@@ -436,7 +436,7 @@ void CPDFSDK_ActionHandler::DoAction_GoTo(CPDFSDK_Document* pDocument,
pPosAry = new float[pMyArray->GetCount()];
int j = 0;
for (int i = 2; i < (int)pMyArray->GetCount(); i++) {
- pPosAry[j++] = pMyArray->GetFloat(i);
+ pPosAry[j++] = pMyArray->GetFloatAt(i);
}
sizeOfAry = j;
}
diff --git a/fpdfsdk/src/fsdk_baseannot.cpp b/fpdfsdk/src/fsdk_baseannot.cpp
index 0d65e06b38..2495897408 100644
--- a/fpdfsdk/src/fsdk_baseannot.cpp
+++ b/fpdfsdk/src/fsdk_baseannot.cpp
@@ -567,11 +567,11 @@ void CPDFSDK_BAAnnot::DrawAppearance(CFX_RenderDevice* pDevice,
}
FX_BOOL CPDFSDK_BAAnnot::IsAppearanceValid() {
- return m_pAnnot->GetAnnotDict()->GetDict("AP") != NULL;
+ return m_pAnnot->GetAnnotDict()->GetDictBy("AP") != NULL;
}
FX_BOOL CPDFSDK_BAAnnot::IsAppearanceValid(CPDF_Annot::AppearanceMode mode) {
- CPDF_Dictionary* pAP = m_pAnnot->GetAnnotDict()->GetDict("AP");
+ CPDF_Dictionary* pAP = m_pAnnot->GetAnnotDict()->GetDictBy("AP");
if (!pAP)
return FALSE;
@@ -608,7 +608,7 @@ void CPDFSDK_BAAnnot::SetContents(const CFX_WideString& sContents) {
}
CFX_WideString CPDFSDK_BAAnnot::GetContents() const {
- return m_pAnnot->GetAnnotDict()->GetUnicodeText("Contents");
+ return m_pAnnot->GetAnnotDict()->GetUnicodeTextBy("Contents");
}
void CPDFSDK_BAAnnot::SetAnnotName(const CFX_WideString& sName) {
@@ -619,7 +619,7 @@ void CPDFSDK_BAAnnot::SetAnnotName(const CFX_WideString& sName) {
}
CFX_WideString CPDFSDK_BAAnnot::GetAnnotName() const {
- return m_pAnnot->GetAnnotDict()->GetUnicodeText("NM");
+ return m_pAnnot->GetAnnotDict()->GetUnicodeTextBy("NM");
}
void CPDFSDK_BAAnnot::SetModifiedDate(const FX_SYSTEMTIME& st) {
@@ -634,7 +634,7 @@ void CPDFSDK_BAAnnot::SetModifiedDate(const FX_SYSTEMTIME& st) {
FX_SYSTEMTIME CPDFSDK_BAAnnot::GetModifiedDate() const {
FX_SYSTEMTIME systime;
- CFX_ByteString str = m_pAnnot->GetAnnotDict()->GetString("M");
+ CFX_ByteString str = m_pAnnot->GetAnnotDict()->GetStringBy("M");
CPDFSDK_DateTime dt(str);
dt.ToSystemTime(systime);
@@ -647,7 +647,7 @@ void CPDFSDK_BAAnnot::SetFlags(int nFlags) {
}
int CPDFSDK_BAAnnot::GetFlags() const {
- return m_pAnnot->GetAnnotDict()->GetInteger("F");
+ return m_pAnnot->GetAnnotDict()->GetIntegerBy("F");
}
void CPDFSDK_BAAnnot::SetAppState(const CFX_ByteString& str) {
@@ -658,7 +658,7 @@ void CPDFSDK_BAAnnot::SetAppState(const CFX_ByteString& str) {
}
CFX_ByteString CPDFSDK_BAAnnot::GetAppState() const {
- return m_pAnnot->GetAnnotDict()->GetString("AS");
+ return m_pAnnot->GetAnnotDict()->GetStringBy("AS");
}
void CPDFSDK_BAAnnot::SetStructParent(int key) {
@@ -666,17 +666,17 @@ void CPDFSDK_BAAnnot::SetStructParent(int key) {
}
int CPDFSDK_BAAnnot::GetStructParent() const {
- return m_pAnnot->GetAnnotDict()->GetInteger("StructParent");
+ return m_pAnnot->GetAnnotDict()->GetIntegerBy("StructParent");
}
// border
void CPDFSDK_BAAnnot::SetBorderWidth(int nWidth) {
- CPDF_Array* pBorder = m_pAnnot->GetAnnotDict()->GetArray("Border");
+ CPDF_Array* pBorder = m_pAnnot->GetAnnotDict()->GetArrayBy("Border");
if (pBorder) {
pBorder->SetAt(2, new CPDF_Number(nWidth));
} else {
- CPDF_Dictionary* pBSDict = m_pAnnot->GetAnnotDict()->GetDict("BS");
+ CPDF_Dictionary* pBSDict = m_pAnnot->GetAnnotDict()->GetDictBy("BS");
if (!pBSDict) {
pBSDict = new CPDF_Dictionary;
@@ -688,17 +688,17 @@ void CPDFSDK_BAAnnot::SetBorderWidth(int nWidth) {
}
int CPDFSDK_BAAnnot::GetBorderWidth() const {
- if (CPDF_Array* pBorder = m_pAnnot->GetAnnotDict()->GetArray("Border")) {
- return pBorder->GetInteger(2);
+ if (CPDF_Array* pBorder = m_pAnnot->GetAnnotDict()->GetArrayBy("Border")) {
+ return pBorder->GetIntegerAt(2);
}
- if (CPDF_Dictionary* pBSDict = m_pAnnot->GetAnnotDict()->GetDict("BS")) {
- return pBSDict->GetInteger("W", 1);
+ if (CPDF_Dictionary* pBSDict = m_pAnnot->GetAnnotDict()->GetDictBy("BS")) {
+ return pBSDict->GetIntegerBy("W", 1);
}
return 1;
}
void CPDFSDK_BAAnnot::SetBorderStyle(int nStyle) {
- CPDF_Dictionary* pBSDict = m_pAnnot->GetAnnotDict()->GetDict("BS");
+ CPDF_Dictionary* pBSDict = m_pAnnot->GetAnnotDict()->GetDictBy("BS");
if (!pBSDict) {
pBSDict = new CPDF_Dictionary;
m_pAnnot->GetAnnotDict()->SetAt("BS", pBSDict);
@@ -724,9 +724,9 @@ void CPDFSDK_BAAnnot::SetBorderStyle(int nStyle) {
}
int CPDFSDK_BAAnnot::GetBorderStyle() const {
- CPDF_Dictionary* pBSDict = m_pAnnot->GetAnnotDict()->GetDict("BS");
+ CPDF_Dictionary* pBSDict = m_pAnnot->GetAnnotDict()->GetDictBy("BS");
if (pBSDict) {
- CFX_ByteString sBorderStyle = pBSDict->GetString("S", "S");
+ CFX_ByteString sBorderStyle = pBSDict->GetStringBy("S", "S");
if (sBorderStyle == "S")
return BBS_SOLID;
if (sBorderStyle == "D")
@@ -739,10 +739,10 @@ int CPDFSDK_BAAnnot::GetBorderStyle() const {
return BBS_UNDERLINE;
}
- CPDF_Array* pBorder = m_pAnnot->GetAnnotDict()->GetArray("Border");
+ CPDF_Array* pBorder = m_pAnnot->GetAnnotDict()->GetArrayBy("Border");
if (pBorder) {
if (pBorder->GetCount() >= 4) {
- CPDF_Array* pDP = pBorder->GetArray(3);
+ CPDF_Array* pDP = pBorder->GetArrayAt(3);
if (pDP && pDP->GetCount() > 0)
return BBS_DASH;
}
@@ -752,7 +752,7 @@ int CPDFSDK_BAAnnot::GetBorderStyle() const {
}
void CPDFSDK_BAAnnot::SetBorderDash(const CFX_IntArray& array) {
- CPDF_Dictionary* pBSDict = m_pAnnot->GetAnnotDict()->GetDict("BS");
+ CPDF_Dictionary* pBSDict = m_pAnnot->GetAnnotDict()->GetDictBy("BS");
if (!pBSDict) {
pBSDict = new CPDF_Dictionary;
m_pAnnot->GetAnnotDict()->SetAt("BS", pBSDict);
@@ -769,19 +769,19 @@ void CPDFSDK_BAAnnot::SetBorderDash(const CFX_IntArray& array) {
void CPDFSDK_BAAnnot::GetBorderDash(CFX_IntArray& array) const {
CPDF_Array* pDash = NULL;
- CPDF_Array* pBorder = m_pAnnot->GetAnnotDict()->GetArray("Border");
+ CPDF_Array* pBorder = m_pAnnot->GetAnnotDict()->GetArrayBy("Border");
if (pBorder) {
- pDash = pBorder->GetArray(3);
+ pDash = pBorder->GetArrayAt(3);
} else {
- CPDF_Dictionary* pBSDict = m_pAnnot->GetAnnotDict()->GetDict("BS");
+ CPDF_Dictionary* pBSDict = m_pAnnot->GetAnnotDict()->GetDictBy("BS");
if (pBSDict) {
- pDash = pBSDict->GetArray("D");
+ pDash = pBSDict->GetArrayBy("D");
}
}
if (pDash) {
for (int i = 0, sz = pDash->GetCount(); i < sz; i++) {
- array.Add(pDash->GetInteger(i));
+ array.Add(pDash->GetIntegerAt(i));
}
}
}
@@ -799,27 +799,27 @@ void CPDFSDK_BAAnnot::RemoveColor() {
}
FX_BOOL CPDFSDK_BAAnnot::GetColor(FX_COLORREF& color) const {
- if (CPDF_Array* pEntry = m_pAnnot->GetAnnotDict()->GetArray("C")) {
+ if (CPDF_Array* pEntry = m_pAnnot->GetAnnotDict()->GetArrayBy("C")) {
int nCount = pEntry->GetCount();
if (nCount == 1) {
- FX_FLOAT g = pEntry->GetNumber(0) * 255;
+ FX_FLOAT g = pEntry->GetNumberAt(0) * 255;
color = FXSYS_RGB((int)g, (int)g, (int)g);
return TRUE;
} else if (nCount == 3) {
- FX_FLOAT r = pEntry->GetNumber(0) * 255;
- FX_FLOAT g = pEntry->GetNumber(1) * 255;
- FX_FLOAT b = pEntry->GetNumber(2) * 255;
+ FX_FLOAT r = pEntry->GetNumberAt(0) * 255;
+ FX_FLOAT g = pEntry->GetNumberAt(1) * 255;
+ FX_FLOAT b = pEntry->GetNumberAt(2) * 255;
color = FXSYS_RGB((int)r, (int)g, (int)b);
return TRUE;
} else if (nCount == 4) {
- FX_FLOAT c = pEntry->GetNumber(0);
- FX_FLOAT m = pEntry->GetNumber(1);
- FX_FLOAT y = pEntry->GetNumber(2);
- FX_FLOAT k = pEntry->GetNumber(3);
+ FX_FLOAT c = pEntry->GetNumberAt(0);
+ FX_FLOAT m = pEntry->GetNumberAt(1);
+ FX_FLOAT y = pEntry->GetNumberAt(2);
+ FX_FLOAT k = pEntry->GetNumberAt(3);
FX_FLOAT r = 1.0f - std::min(1.0f, c + k);
FX_FLOAT g = 1.0f - std::min(1.0f, m + k);
@@ -839,7 +839,7 @@ void CPDFSDK_BAAnnot::WriteAppearance(const CFX_ByteString& sAPType,
const CFX_Matrix& matrix,
const CFX_ByteString& sContents,
const CFX_ByteString& sAPState) {
- CPDF_Dictionary* pAPDict = m_pAnnot->GetAnnotDict()->GetDict("AP");
+ CPDF_Dictionary* pAPDict = m_pAnnot->GetAnnotDict()->GetDictBy("AP");
if (!pAPDict) {
pAPDict = new CPDF_Dictionary;
@@ -851,16 +851,16 @@ void CPDFSDK_BAAnnot::WriteAppearance(const CFX_ByteString& sAPType,
if (sAPState.IsEmpty()) {
pParentDict = pAPDict;
- pStream = pAPDict->GetStream(sAPType);
+ pStream = pAPDict->GetStreamBy(sAPType);
} else {
- CPDF_Dictionary* pAPTypeDict = pAPDict->GetDict(sAPType);
+ CPDF_Dictionary* pAPTypeDict = pAPDict->GetDictBy(sAPType);
if (!pAPTypeDict) {
pAPTypeDict = new CPDF_Dictionary;
pAPDict->SetAt(sAPType, pAPTypeDict);
}
pParentDict = pAPTypeDict;
- pStream = pAPTypeDict->GetStream(sAPState);
+ pStream = pAPTypeDict->GetStreamBy(sAPState);
}
if (!pStream) {
@@ -910,13 +910,13 @@ FX_BOOL CPDFSDK_BAAnnot::IsVisible() const {
}
CPDF_Action CPDFSDK_BAAnnot::GetAction() const {
- return CPDF_Action(m_pAnnot->GetAnnotDict()->GetDict("A"));
+ return CPDF_Action(m_pAnnot->GetAnnotDict()->GetDictBy("A"));
}
void CPDFSDK_BAAnnot::SetAction(const CPDF_Action& action) {
ASSERT(action);
if ((CPDF_Action&)action !=
- CPDF_Action(m_pAnnot->GetAnnotDict()->GetDict("A"))) {
+ CPDF_Action(m_pAnnot->GetAnnotDict()->GetDictBy("A"))) {
CPDF_Document* pDoc = m_pPageView->GetPDFDocument();
CPDF_Dictionary* pDict = action.GetDict();
if (pDict && pDict->GetObjNum() == 0) {
@@ -931,11 +931,11 @@ void CPDFSDK_BAAnnot::RemoveAction() {
}
CPDF_AAction CPDFSDK_BAAnnot::GetAAction() const {
- return m_pAnnot->GetAnnotDict()->GetDict("AA");
+ return m_pAnnot->GetAnnotDict()->GetDictBy("AA");
}
void CPDFSDK_BAAnnot::SetAAction(const CPDF_AAction& aa) {
- if ((CPDF_AAction&)aa != m_pAnnot->GetAnnotDict()->GetDict("AA"))
+ if ((CPDF_AAction&)aa != m_pAnnot->GetAnnotDict()->GetDictBy("AA"))
m_pAnnot->GetAnnotDict()->SetAt("AA", (CPDF_AAction&)aa);
}
diff --git a/fpdfsdk/src/fsdk_baseform.cpp b/fpdfsdk/src/fsdk_baseform.cpp
index 66e843473d..b2480941bc 100644
--- a/fpdfsdk/src/fsdk_baseform.cpp
+++ b/fpdfsdk/src/fsdk_baseform.cpp
@@ -459,7 +459,7 @@ void CPDFSDK_Widget::SynchronizeXFAItems(IXFA_DocView* pXFADocView,
FX_BOOL CPDFSDK_Widget::IsWidgetAppearanceValid(
CPDF_Annot::AppearanceMode mode) {
- CPDF_Dictionary* pAP = m_pAnnot->GetAnnotDict()->GetDict("AP");
+ CPDF_Dictionary* pAP = m_pAnnot->GetAnnotDict()->GetDictBy("AP");
if (!pAP)
return FALSE;
@@ -488,7 +488,7 @@ FX_BOOL CPDFSDK_Widget::IsWidgetAppearanceValid(
case FIELDTYPE_CHECKBOX:
case FIELDTYPE_RADIOBUTTON:
if (CPDF_Dictionary* pSubDict = psub->AsDictionary()) {
- return pSubDict->GetStream(GetAppState()) != NULL;
+ return pSubDict->GetStreamBy(GetAppState()) != NULL;
}
return FALSE;
}
@@ -993,21 +993,21 @@ void CPDFSDK_Widget::ResetAppearance_PushButton() {
if (pNormalIcon) {
if (CPDF_Dictionary* pImageDict = pNormalIcon->GetDict()) {
- if (pImageDict->GetString("Name").IsEmpty())
+ if (pImageDict->GetStringBy("Name").IsEmpty())
pImageDict->SetAtString("Name", "ImgA");
}
}
if (pRolloverIcon) {
if (CPDF_Dictionary* pImageDict = pRolloverIcon->GetDict()) {
- if (pImageDict->GetString("Name").IsEmpty())
+ if (pImageDict->GetStringBy("Name").IsEmpty())
pImageDict->SetAtString("Name", "ImgB");
}
}
if (pDownIcon) {
if (CPDF_Dictionary* pImageDict = pDownIcon->GetDict()) {
- if (pImageDict->GetString("Name").IsEmpty())
+ if (pImageDict->GetStringBy("Name").IsEmpty())
pImageDict->SetAtString("Name", "ImgC");
}
}
@@ -1846,18 +1846,18 @@ void CPDFSDK_Widget::AddImageToAppearance(const CFX_ByteString& sAPType,
CPDF_Document* pDoc = m_pPageView->GetPDFDocument();
ASSERT(pDoc);
- CPDF_Dictionary* pAPDict = m_pAnnot->GetAnnotDict()->GetDict("AP");
- CPDF_Stream* pStream = pAPDict->GetStream(sAPType);
+ CPDF_Dictionary* pAPDict = m_pAnnot->GetAnnotDict()->GetDictBy("AP");
+ CPDF_Stream* pStream = pAPDict->GetStreamBy(sAPType);
CPDF_Dictionary* pStreamDict = pStream->GetDict();
CFX_ByteString sImageAlias = "IMG";
if (CPDF_Dictionary* pImageDict = pImage->GetDict()) {
- sImageAlias = pImageDict->GetString("Name");
+ sImageAlias = pImageDict->GetStringBy("Name");
if (sImageAlias.IsEmpty())
sImageAlias = "IMG";
}
- CPDF_Dictionary* pStreamResList = pStreamDict->GetDict("Resources");
+ CPDF_Dictionary* pStreamResList = pStreamDict->GetDictBy("Resources");
if (!pStreamResList) {
pStreamResList = new CPDF_Dictionary();
pStreamDict->SetAt("Resources", pStreamResList);
@@ -1871,7 +1871,7 @@ void CPDFSDK_Widget::AddImageToAppearance(const CFX_ByteString& sAPType,
}
void CPDFSDK_Widget::RemoveAppearance(const CFX_ByteString& sAPType) {
- if (CPDF_Dictionary* pAPDict = m_pAnnot->GetAnnotDict()->GetDict("AP")) {
+ if (CPDF_Dictionary* pAPDict = m_pAnnot->GetAnnotDict()->GetDictBy("AP")) {
pAPDict->RemoveAt(sAPType);
}
}
@@ -2078,7 +2078,7 @@ CPDFSDK_Widget* CPDFSDK_InterForm::GetWidget(CPDF_FormControl* pControl) const {
CPDF_Document* pDocument = m_pDocument->GetPDFDocument();
CPDFSDK_PageView* pPage = nullptr;
- if (CPDF_Dictionary* pPageDict = pControlDict->GetDict("P")) {
+ if (CPDF_Dictionary* pPageDict = pControlDict->GetDictBy("P")) {
int nPageIndex = pDocument->GetPageIndex(pPageDict->GetObjNum());
if (nPageIndex >= 0) {
pPage = m_pDocument->GetPageView(nPageIndex);
@@ -2126,7 +2126,7 @@ int CPDFSDK_InterForm::GetPageIndexByAnnotDict(
for (int i = 0, sz = pDocument->GetPageCount(); i < sz; i++) {
if (CPDF_Dictionary* pPageDict = pDocument->GetPage(i)) {
- if (CPDF_Array* pAnnots = pPageDict->GetArray("Annots")) {
+ if (CPDF_Array* pAnnots = pPageDict->GetArrayBy("Annots")) {
for (int j = 0, jsz = pAnnots->GetCount(); j < jsz; j++) {
CPDF_Object* pDict = pAnnots->GetElementValue(j);
if (pAnnotDict == pDict) {
@@ -2450,25 +2450,25 @@ FX_BOOL CPDFSDK_InterForm::FDFToURLEncodedData(uint8_t*& pBuf,
FX_STRSIZE& nBufSize) {
CFDF_Document* pFDF = CFDF_Document::ParseMemory(pBuf, nBufSize);
if (pFDF) {
- CPDF_Dictionary* pMainDict = pFDF->GetRoot()->GetDict("FDF");
+ CPDF_Dictionary* pMainDict = pFDF->GetRoot()->GetDictBy("FDF");
if (!pMainDict)
return FALSE;
// Get fields
- CPDF_Array* pFields = pMainDict->GetArray("Fields");
+ CPDF_Array* pFields = pMainDict->GetArrayBy("Fields");
if (!pFields)
return FALSE;
CFX_ByteTextBuf fdfEncodedData;
for (FX_DWORD i = 0; i < pFields->GetCount(); i++) {
- CPDF_Dictionary* pField = pFields->GetDict(i);
+ CPDF_Dictionary* pField = pFields->GetDictAt(i);
if (!pField)
continue;
CFX_WideString name;
- name = pField->GetUnicodeText("T");
+ name = pField->GetUnicodeTextBy("T");
CFX_ByteString name_b = CFX_ByteString::FromUnicode(name);
- CFX_ByteString csBValue = pField->GetString("V");
+ CFX_ByteString csBValue = pField->GetStringBy("V");
CFX_WideString csWValue = PDF_DecodeText(csBValue);
CFX_ByteString csValue_b = CFX_ByteString::FromUnicode(csWValue);
@@ -2746,7 +2746,7 @@ CBA_AnnotIterator::CBA_AnnotIterator(CPDFSDK_PageView* pPageView,
m_sSubType(sSubType),
m_nTabs(BAI_STRUCTURE) {
CPDF_Page* pPDFPage = m_pPageView->GetPDFPage();
- CFX_ByteString sTabs = pPDFPage->m_pFormDict->GetString("Tabs");
+ CFX_ByteString sTabs = pPDFPage->m_pFormDict->GetStringBy("Tabs");
if (sTabs == "R") {
m_nTabs = BAI_ROW;
diff --git a/fpdfsdk/src/fsdk_mgr.cpp b/fpdfsdk/src/fsdk_mgr.cpp
index 56f8204ce9..e9de9e4000 100644
--- a/fpdfsdk/src/fsdk_mgr.cpp
+++ b/fpdfsdk/src/fsdk_mgr.cpp
@@ -465,9 +465,9 @@ FX_BOOL CPDFSDK_Document::ProcOpenAction() {
if (!pRoot)
return FALSE;
- CPDF_Object* pOpenAction = pRoot->GetDict("OpenAction");
+ CPDF_Object* pOpenAction = pRoot->GetDictBy("OpenAction");
if (!pOpenAction)
- pOpenAction = pRoot->GetArray("OpenAction");
+ pOpenAction = pRoot->GetArrayBy("OpenAction");
if (!pOpenAction)
return FALSE;
@@ -819,7 +819,7 @@ CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(IXFA_Widget* pPDFAnnot) {
#endif // PDF_ENABLE_XFA
CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(CPDF_Dictionary* pDict) {
- return pDict ? AddAnnot(pDict->GetString("Subtype"), pDict) : nullptr;
+ return pDict ? AddAnnot(pDict->GetStringBy("Subtype"), pDict) : nullptr;
}
CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(const FX_CHAR* lpSubType,
diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp
index 270330e5c0..0bd754af76 100644
--- a/fpdfsdk/src/javascript/Document.cpp
+++ b/fpdfsdk/src/javascript/Document.cpp
@@ -741,7 +741,7 @@ FX_BOOL Document::author(IJS_Context* cc,
return FALSE;
if (vp.IsGetting()) {
- vp << pDictionary->GetUnicodeText("Author");
+ vp << pDictionary->GetUnicodeTextBy("Author");
return TRUE;
} else {
if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY))
@@ -762,15 +762,15 @@ FX_BOOL Document::info(IJS_Context* cc,
if (!pDictionary)
return FALSE;
- CFX_WideString cwAuthor = pDictionary->GetUnicodeText("Author");
- CFX_WideString cwTitle = pDictionary->GetUnicodeText("Title");
- CFX_WideString cwSubject = pDictionary->GetUnicodeText("Subject");
- CFX_WideString cwKeywords = pDictionary->GetUnicodeText("Keywords");
- CFX_WideString cwCreator = pDictionary->GetUnicodeText("Creator");
- CFX_WideString cwProducer = pDictionary->GetUnicodeText("Producer");
- CFX_WideString cwCreationDate = pDictionary->GetUnicodeText("CreationDate");
- CFX_WideString cwModDate = pDictionary->GetUnicodeText("ModDate");
- CFX_WideString cwTrapped = pDictionary->GetUnicodeText("Trapped");
+ CFX_WideString cwAuthor = pDictionary->GetUnicodeTextBy("Author");
+ CFX_WideString cwTitle = pDictionary->GetUnicodeTextBy("Title");
+ CFX_WideString cwSubject = pDictionary->GetUnicodeTextBy("Subject");
+ CFX_WideString cwKeywords = pDictionary->GetUnicodeTextBy("Keywords");
+ CFX_WideString cwCreator = pDictionary->GetUnicodeTextBy("Creator");
+ CFX_WideString cwProducer = pDictionary->GetUnicodeTextBy("Producer");
+ CFX_WideString cwCreationDate = pDictionary->GetUnicodeTextBy("CreationDate");
+ CFX_WideString cwModDate = pDictionary->GetUnicodeTextBy("ModDate");
+ CFX_WideString cwTrapped = pDictionary->GetUnicodeTextBy("Trapped");
v8::Isolate* isolate = GetIsolate(cc);
if (vp.IsGetting()) {
@@ -819,7 +819,7 @@ FX_BOOL Document::creationDate(IJS_Context* cc,
return FALSE;
if (vp.IsGetting()) {
- vp << pDictionary->GetUnicodeText("CreationDate");
+ vp << pDictionary->GetUnicodeTextBy("CreationDate");
} else {
if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY))
return FALSE;
@@ -840,7 +840,7 @@ FX_BOOL Document::creator(IJS_Context* cc,
return FALSE;
if (vp.IsGetting()) {
- vp << pDictionary->GetUnicodeText("Creator");
+ vp << pDictionary->GetUnicodeTextBy("Creator");
} else {
if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY))
return FALSE;
@@ -896,7 +896,7 @@ FX_BOOL Document::keywords(IJS_Context* cc,
return FALSE;
if (vp.IsGetting()) {
- vp << pDictionary->GetUnicodeText("Keywords");
+ vp << pDictionary->GetUnicodeTextBy("Keywords");
} else {
if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY))
return FALSE;
@@ -917,7 +917,7 @@ FX_BOOL Document::modDate(IJS_Context* cc,
return FALSE;
if (vp.IsGetting()) {
- vp << pDictionary->GetUnicodeText("ModDate");
+ vp << pDictionary->GetUnicodeTextBy("ModDate");
} else {
if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY))
return FALSE;
@@ -938,7 +938,7 @@ FX_BOOL Document::producer(IJS_Context* cc,
return FALSE;
if (vp.IsGetting()) {
- vp << pDictionary->GetUnicodeText("Producer");
+ vp << pDictionary->GetUnicodeTextBy("Producer");
} else {
if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY))
return FALSE;
@@ -959,7 +959,7 @@ FX_BOOL Document::subject(IJS_Context* cc,
return FALSE;
if (vp.IsGetting()) {
- vp << pDictionary->GetUnicodeText("Subject");
+ vp << pDictionary->GetUnicodeTextBy("Subject");
} else {
if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY))
return FALSE;
@@ -983,7 +983,7 @@ FX_BOOL Document::title(IJS_Context* cc,
return FALSE;
if (vp.IsGetting()) {
- vp << pDictionary->GetUnicodeText("Title");
+ vp << pDictionary->GetUnicodeTextBy("Title");
} else {
if (!m_pDocument->GetPermissions(FPDFPERM_MODIFY))
return FALSE;
diff --git a/fpdfsdk/src/pdfwindow/PWL_Icon.cpp b/fpdfsdk/src/pdfwindow/PWL_Icon.cpp
index 6afd76c5c6..56c22d1bbd 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Icon.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Icon.cpp
@@ -60,7 +60,7 @@ void CPWL_Image::GetImageSize(FX_FLOAT& fWidth, FX_FLOAT& fHeight) {
if (m_pPDFStream) {
if (CPDF_Dictionary* pDict = m_pPDFStream->GetDict()) {
- CPDF_Rect rect = pDict->GetRect("BBox");
+ CPDF_Rect rect = pDict->GetRectBy("BBox");
fWidth = rect.right - rect.left;
fHeight = rect.top - rect.bottom;
@@ -71,7 +71,7 @@ void CPWL_Image::GetImageSize(FX_FLOAT& fWidth, FX_FLOAT& fHeight) {
CFX_Matrix CPWL_Image::GetImageMatrix() {
if (m_pPDFStream) {
if (CPDF_Dictionary* pDict = m_pPDFStream->GetDict()) {
- return pDict->GetMatrix("Matrix");
+ return pDict->GetMatrixBy("Matrix");
}
}
@@ -84,7 +84,7 @@ CFX_ByteString CPWL_Image::GetImageAlias() {
if (m_pPDFStream) {
if (CPDF_Dictionary* pDict = m_pPDFStream->GetDict()) {
- return pDict->GetString("Name");
+ return pDict->GetStringBy("Name");
}
}
@@ -128,13 +128,13 @@ void CPWL_Icon::GetIconPosition(FX_FLOAT& fLeft, FX_FLOAT& fBottom) {
fLeft = 0.0f;
fBottom = 0.0f;
CPDF_Array* pA =
- m_pIconFit->m_pDict ? m_pIconFit->m_pDict->GetArray("A") : NULL;
+ m_pIconFit->m_pDict ? m_pIconFit->m_pDict->GetArrayBy("A") : NULL;
if (pA) {
FX_DWORD dwCount = pA->GetCount();
if (dwCount > 0)
- fLeft = pA->GetNumber(0);
+ fLeft = pA->GetNumberAt(0);
if (dwCount > 1)
- fBottom = pA->GetNumber(1);
+ fBottom = pA->GetNumberAt(1);
}
} else {
fLeft = 0.0f;