summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_flatten.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-04-04 16:41:35 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-04 16:41:35 -0700
commit28f97ff783c16f3391384ce97b765ce4eb310ac7 (patch)
tree69c4c8bc9dd39d5336c96f28b633d197dd207c81 /fpdfsdk/fpdf_flatten.cpp
parented9c4386713084f37548b46ab36f618021f716f5 (diff)
downloadpdfium-28f97ff783c16f3391384ce97b765ce4eb310ac7.tar.xz
Make down-conversion explicit from CFX_ByteString to CFX_ByteStringC.
Having this happen implicitly can be dangerous because the lifetime has to be considered; we should have caught the "red bots" in https://codereview.chromium.org/1847333004/#ps60001 at compile time. Review URL: https://codereview.chromium.org/1853233002
Diffstat (limited to 'fpdfsdk/fpdf_flatten.cpp')
-rw-r--r--fpdfsdk/fpdf_flatten.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/fpdfsdk/fpdf_flatten.cpp b/fpdfsdk/fpdf_flatten.cpp
index 46501865e5..bbd5ad3dd3 100644
--- a/fpdfsdk/fpdf_flatten.cpp
+++ b/fpdfsdk/fpdf_flatten.cpp
@@ -395,8 +395,7 @@ DLLEXPORT int STDCALL FPDFPage_Flatten(FPDF_PAGE page, int nFlag) {
char sExtend[5] = {};
FXSYS_itoa(iKey, sExtend, 10);
key = CFX_ByteString("FFT") + CFX_ByteString(sExtend);
-
- if (!pPageXObject->KeyExist(key))
+ if (!pPageXObject->KeyExist(key.AsByteStringC()))
break;
}
}
@@ -406,7 +405,7 @@ DLLEXPORT int STDCALL FPDFPage_Flatten(FPDF_PAGE page, int nFlag) {
CPDF_Dictionary* pNewXORes = NULL;
if (!key.IsEmpty()) {
- pPageXObject->SetAtReference(key, pDocument, dwObjNum);
+ pPageXObject->SetAtReference(key.AsByteStringC(), pDocument, dwObjNum);
CPDF_Dictionary* pNewOXbjectDic = pNewXObject->GetDict();
pNewXORes = new CPDF_Dictionary;
pNewOXbjectDic->SetAt("Resources", pNewXORes);
@@ -438,7 +437,7 @@ DLLEXPORT int STDCALL FPDFPage_Flatten(FPDF_PAGE page, int nFlag) {
continue;
if (!sAnnotState.IsEmpty()) {
- pAPStream = pAPDic->GetStreamBy(sAnnotState);
+ pAPStream = pAPDic->GetStreamBy(sAnnotState.AsByteStringC());
} else {
auto it = pAPDic->begin();
if (it != pAPDic->end()) {
@@ -487,7 +486,7 @@ DLLEXPORT int STDCALL FPDFPage_Flatten(FPDF_PAGE page, int nFlag) {
CFX_ByteString sFormName;
sFormName.Format("F%d", i);
uint32_t dwObjNum = pDocument->AddIndirectObject(pObj);
- pXObject->SetAtReference(sFormName, pDocument, dwObjNum);
+ pXObject->SetAtReference(sFormName.AsByteStringC(), pDocument, dwObjNum);
CPDF_StreamAcc acc;
acc.LoadAllData(pNewXObject);