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

Unified Diff: core/src/fpdfdoc/doc_ocg.cpp

Issue 1194933003: Make CPDF_Object::GetString() a virtual method. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: core/src/fpdfdoc/doc_ocg.cpp
diff --git a/core/src/fpdfdoc/doc_ocg.cpp b/core/src/fpdfdoc/doc_ocg.cpp
index 8477cb85d02c83fcd733f062b3679a94656f07be..fd1613a409c99d33a9b3e54466e091ca03a8368f 100644
--- a/core/src/fpdfdoc/doc_ocg.cpp
+++ b/core/src/fpdfdoc/doc_ocg.cpp
@@ -36,7 +36,7 @@ static FX_BOOL FPDFDOC_OCG_HasIntent(const CPDF_Dictionary *pDict, const CFX_Byt
if (pIntent->GetType() == PDFOBJ_ARRAY) {
FX_DWORD dwCount = ((CPDF_Array*)pIntent)->GetCount();
for (FX_DWORD i = 0; i < dwCount; i++) {
- bsIntent = ((CPDF_Array*)pIntent)->GetString(i);
+ bsIntent = ((CPDF_Array*)pIntent)->GetStringAt(i);
if (bsIntent == FX_BSTRC("All") || bsIntent == csElement) {
return TRUE;
}
@@ -108,7 +108,7 @@ FX_BOOL CPDF_OCContext::LoadOCGStateFromConfig(const CFX_ByteStringC& csConfig,
return TRUE;
}
bValidConfig = TRUE;
- FX_BOOL bState = pConfig->GetString(FX_BSTRC("BaseState"), FX_BSTRC("ON")) != FX_BSTRC("OFF");
+ FX_BOOL bState = pConfig->GetStringAt("BaseState", "ON") != "OFF";
CPDF_Array *pArray = pConfig->GetArray(FX_BSTRC("ON"));
if (pArray) {
if (FPDFDOC_OCG_FindGroup(pArray, pOCGDict) >= 0) {
@@ -130,7 +130,7 @@ FX_BOOL CPDF_OCContext::LoadOCGStateFromConfig(const CFX_ByteStringC& csConfig,
if (!pUsage) {
continue;
}
- if (pUsage->GetString(FX_BSTRC("Event"), FX_BSTRC("View")) != csConfig) {
+ if (pUsage->GetStringAt("Event", "View") != csConfig) {
continue;
}
CPDF_Array *pOCGs = pUsage->GetArray(FX_BSTRC("OCGs"));
@@ -144,7 +144,7 @@ FX_BOOL CPDF_OCContext::LoadOCGStateFromConfig(const CFX_ByteStringC& csConfig,
if (!pState) {
continue;
}
- bState = pState->GetString(csFind) != FX_BSTRC("OFF");
+ bState = pState->GetStringAt(csFind) != "OFF";
}
}
return bState;
@@ -161,13 +161,13 @@ FX_BOOL CPDF_OCContext::LoadOCGState(const CPDF_Dictionary *pOCGDict) const
if (pState) {
CFX_ByteString csFind = csState + FX_BSTRC("State");
if (pState->KeyExist(csFind)) {
- return pState->GetString(csFind) != FX_BSTRC("OFF");
+ return pState->GetStringAt(csFind) != "OFF";
}
}
if (csState != FX_BSTRC("View")) {
pState = pUsage->GetDict(FX_BSTRC("View"));
if (pState && pState->KeyExist(FX_BSTRC("ViewState"))) {
- return pState->GetString(FX_BSTRC("ViewState")) != FX_BSTRC("OFF");
+ return pState->GetStringAt("ViewState") != "OFF";
}
}
}
@@ -199,7 +199,7 @@ FX_BOOL CPDF_OCContext::GetOCGVE(CPDF_Array *pExpression, FX_BOOL bFromConfig, i
}
int32_t iCount = pExpression->GetCount();
CPDF_Object *pOCGObj;
- CFX_ByteString csOperator = pExpression->GetString(0);
+ CFX_ByteString csOperator = pExpression->GetStringAt(0);
if (csOperator == FX_BSTRC("Not")) {
pOCGObj = pExpression->GetElementValue(1);
if (pOCGObj == NULL) {
@@ -247,7 +247,7 @@ FX_BOOL CPDF_OCContext::LoadOCMDState(const CPDF_Dictionary *pOCMDDict, FX_BOOL
if (pVE != NULL) {
return GetOCGVE(pVE, bFromConfig);
}
- CFX_ByteString csP = pOCMDDict->GetString(FX_BSTRC("P"), FX_BSTRC("AnyOn"));
+ CFX_ByteString csP = pOCMDDict->GetStringAt("P", "AnyOn");
CPDF_Object *pOCGObj = pOCMDDict->GetElementValue(FX_BSTRC("OCGs"));
if (pOCGObj == NULL) {
return TRUE;
@@ -289,7 +289,7 @@ FX_BOOL CPDF_OCContext::CheckOCGVisible(const CPDF_Dictionary *pOCGDict)
if (pOCGDict == NULL) {
return TRUE;
}
- CFX_ByteString csType = pOCGDict->GetString(FX_BSTRC("Type"), FX_BSTRC("OCG"));
+ CFX_ByteString csType = pOCGDict->GetStringAt("Type", "OCG");
if (csType == FX_BSTRC("OCG")) {
return GetOCGVisible(pOCGDict);
} else {

Powered by Google App Engine
This is Rietveld 408576698