summaryrefslogtreecommitdiff
path: root/fpdfsdk
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
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')
-rw-r--r--fpdfsdk/formfiller/cba_fontmap.cpp18
-rw-r--r--fpdfsdk/fpdf_ext.cpp5
-rw-r--r--fpdfsdk/fpdf_flatten.cpp9
-rw-r--r--fpdfsdk/fpdfppo.cpp8
-rw-r--r--fpdfsdk/fsdk_baseannot.cpp12
-rw-r--r--fpdfsdk/fsdk_baseform.cpp8
-rw-r--r--fpdfsdk/fsdk_mgr.cpp2
-rw-r--r--fpdfsdk/fxedit/fxet_pageobjs.cpp12
-rw-r--r--fpdfsdk/pdfwindow/PWL_Edit.cpp26
-rw-r--r--fpdfsdk/pdfwindow/PWL_Icon.cpp2
-rw-r--r--fpdfsdk/pdfwindow/PWL_Label.cpp8
-rw-r--r--fpdfsdk/pdfwindow/PWL_ListBox.cpp14
-rw-r--r--fpdfsdk/pdfwindow/PWL_ScrollBar.cpp3
-rw-r--r--fpdfsdk/pdfwindow/PWL_Signature.cpp2
14 files changed, 73 insertions, 56 deletions
diff --git a/fpdfsdk/formfiller/cba_fontmap.cpp b/fpdfsdk/formfiller/cba_fontmap.cpp
index c69dcbebcd..1ecf7d4de4 100644
--- a/fpdfsdk/formfiller/cba_fontmap.cpp
+++ b/fpdfsdk/formfiller/cba_fontmap.cpp
@@ -159,15 +159,15 @@ void CBA_FontMap::AddFontToAnnotDict(CPDF_Font* pFont,
}
// to avoid checkbox and radiobutton
- CPDF_Object* pObject = pAPDict->GetObjectBy(m_sAPType);
+ CPDF_Object* pObject = pAPDict->GetObjectBy(m_sAPType.AsByteStringC());
if (ToDictionary(pObject))
return;
- CPDF_Stream* pStream = pAPDict->GetStreamBy(m_sAPType);
+ CPDF_Stream* pStream = pAPDict->GetStreamBy(m_sAPType.AsByteStringC());
if (!pStream) {
pStream = new CPDF_Stream(NULL, 0, NULL);
int32_t objnum = m_pDocument->AddIndirectObject(pStream);
- pAPDict->SetAtReference(m_sAPType, m_pDocument, objnum);
+ pAPDict->SetAtReference(m_sAPType.AsByteStringC(), m_pDocument, objnum);
}
CPDF_Dictionary* pStreamDict = pStream->GetDict();
@@ -191,8 +191,8 @@ void CBA_FontMap::AddFontToAnnotDict(CPDF_Font* pFont,
int32_t objnum = m_pDocument->AddIndirectObject(pStreamResFontList);
pStreamResList->SetAtReference("Font", m_pDocument, objnum);
}
- if (!pStreamResFontList->KeyExist(sAlias))
- pStreamResFontList->SetAtReference(sAlias, m_pDocument,
+ if (!pStreamResFontList->KeyExist(sAlias.AsByteStringC()))
+ pStreamResFontList->SetAtReference(sAlias.AsByteStringC(), m_pDocument,
pFont->GetFontDict());
}
}
@@ -221,14 +221,14 @@ CPDF_Font* CBA_FontMap::GetAnnotDefaultFont(CFX_ByteString& sAlias) {
CPDF_Dictionary* pFontDict = NULL;
if (!sDA.IsEmpty()) {
- CPDF_SimpleParser syntax(sDA);
+ CPDF_SimpleParser syntax(sDA.AsByteStringC());
syntax.FindTagParamFromStart("Tf", 2);
CFX_ByteString sFontName = syntax.GetWord();
sAlias = PDF_NameDecode(sFontName).Mid(1);
if (CPDF_Dictionary* pDRDict = m_pAnnotDict->GetDictBy("DR"))
if (CPDF_Dictionary* pDRFontDict = pDRDict->GetDictBy("Font"))
- pFontDict = pDRFontDict->GetDictBy(sAlias);
+ pFontDict = pDRFontDict->GetDictBy(sAlias.AsByteStringC());
if (!pFontDict)
if (CPDF_Dictionary* pAPDict = m_pAnnotDict->GetDictBy("AP"))
@@ -237,14 +237,14 @@ CPDF_Font* CBA_FontMap::GetAnnotDefaultFont(CFX_ByteString& sAlias) {
pNormalDict->GetDictBy("Resources"))
if (CPDF_Dictionary* pResFontDict =
pNormalResDict->GetDictBy("Font"))
- pFontDict = pResFontDict->GetDictBy(sAlias);
+ pFontDict = pResFontDict->GetDictBy(sAlias.AsByteStringC());
if (bWidget) {
if (!pFontDict) {
if (pAcroFormDict) {
if (CPDF_Dictionary* pDRDict = pAcroFormDict->GetDictBy("DR"))
if (CPDF_Dictionary* pDRFontDict = pDRDict->GetDictBy("Font"))
- pFontDict = pDRFontDict->GetDictBy(sAlias);
+ pFontDict = pDRFontDict->GetDictBy(sAlias.AsByteStringC());
}
}
}
diff --git a/fpdfsdk/fpdf_ext.cpp b/fpdfsdk/fpdf_ext.cpp
index 484993c6a1..a1009c5cdf 100644
--- a/fpdfsdk/fpdf_ext.cpp
+++ b/fpdfsdk/fpdf_ext.cpp
@@ -104,10 +104,11 @@ FX_BOOL CheckSharedForm(const CXML_Element* pElement, CFX_ByteString cbName) {
pElement->GetAttrByIndex(i, space, name, value);
if (space == "xmlns" && name == "adhocwf" &&
value == L"http://ns.adobe.com/AcrobatAdhocWorkflow/1.0/") {
- CXML_Element* pVersion = pElement->GetElement("adhocwf", cbName);
+ CXML_Element* pVersion =
+ pElement->GetElement("adhocwf", cbName.AsByteStringC());
if (!pVersion)
continue;
- CFX_WideString wsContent = pVersion->GetContent(0); // == 1.1
+ CFX_WideString wsContent = pVersion->GetContent(0);
int nType = wsContent.GetInteger();
switch (nType) {
case 1:
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);
diff --git a/fpdfsdk/fpdfppo.cpp b/fpdfsdk/fpdfppo.cpp
index cab2c6c3e0..21d8c7d9ae 100644
--- a/fpdfsdk/fpdfppo.cpp
+++ b/fpdfsdk/fpdfppo.cpp
@@ -110,9 +110,9 @@ FX_BOOL CPDF_PageOrganizer::ExportPage(CPDF_Document* pSrcPDFDoc,
const CFX_ByteString& cbSrcKeyStr = it.first;
CPDF_Object* pObj = it.second;
if (cbSrcKeyStr.Compare(("Type")) && cbSrcKeyStr.Compare(("Parent"))) {
- if (pCurPageDict->KeyExist(cbSrcKeyStr))
- pCurPageDict->RemoveAt(cbSrcKeyStr);
- pCurPageDict->SetAt(cbSrcKeyStr, pObj->Clone());
+ if (pCurPageDict->KeyExist(cbSrcKeyStr.AsByteStringC()))
+ pCurPageDict->RemoveAt(cbSrcKeyStr.AsByteStringC());
+ pCurPageDict->SetAt(cbSrcKeyStr.AsByteStringC(), pObj->Clone());
}
}
@@ -229,7 +229,7 @@ FX_BOOL CPDF_PageOrganizer::UpdateReference(CPDF_Object* pObj,
}
if (pNextObj) {
if (!UpdateReference(pNextObj, pDoc, pObjNumberMap))
- pDict->RemoveAt(key);
+ pDict->RemoveAt(key.AsByteStringC());
} else {
return FALSE;
}
diff --git a/fpdfsdk/fsdk_baseannot.cpp b/fpdfsdk/fsdk_baseannot.cpp
index 07a47cdff9..249fd83fc8 100644
--- a/fpdfsdk/fsdk_baseannot.cpp
+++ b/fpdfsdk/fsdk_baseannot.cpp
@@ -831,24 +831,22 @@ void CPDFSDK_BAAnnot::WriteAppearance(const CFX_ByteString& sAPType,
if (sAPState.IsEmpty()) {
pParentDict = pAPDict;
- pStream = pAPDict->GetStreamBy(sAPType);
+ pStream = pAPDict->GetStreamBy(sAPType.AsByteStringC());
} else {
- CPDF_Dictionary* pAPTypeDict = pAPDict->GetDictBy(sAPType);
+ CPDF_Dictionary* pAPTypeDict = pAPDict->GetDictBy(sAPType.AsByteStringC());
if (!pAPTypeDict) {
pAPTypeDict = new CPDF_Dictionary;
- pAPDict->SetAt(sAPType, pAPTypeDict);
+ pAPDict->SetAt(sAPType.AsByteStringC(), pAPTypeDict);
}
-
pParentDict = pAPTypeDict;
- pStream = pAPTypeDict->GetStreamBy(sAPState);
+ pStream = pAPTypeDict->GetStreamBy(sAPState.AsByteStringC());
}
if (!pStream) {
pStream = new CPDF_Stream(nullptr, 0, nullptr);
-
CPDF_Document* pDoc = m_pPageView->GetPDFDocument();
int32_t objnum = pDoc->AddIndirectObject(pStream);
- pParentDict->SetAtReference(sAPType, pDoc, objnum);
+ pParentDict->SetAtReference(sAPType.AsByteStringC(), pDoc, objnum);
}
CPDF_Dictionary* pStreamDict = pStream->GetDict();
diff --git a/fpdfsdk/fsdk_baseform.cpp b/fpdfsdk/fsdk_baseform.cpp
index be92b4a7e2..d195d87fc1 100644
--- a/fpdfsdk/fsdk_baseform.cpp
+++ b/fpdfsdk/fsdk_baseform.cpp
@@ -466,7 +466,7 @@ FX_BOOL CPDFSDK_Widget::IsWidgetAppearanceValid(
case FIELDTYPE_CHECKBOX:
case FIELDTYPE_RADIOBUTTON:
if (CPDF_Dictionary* pSubDict = psub->AsDictionary()) {
- return pSubDict->GetStreamBy(GetAppState()) != NULL;
+ return !!pSubDict->GetStreamBy(GetAppState().AsByteStringC());
}
return FALSE;
}
@@ -1813,7 +1813,7 @@ void CPDFSDK_Widget::AddImageToAppearance(const CFX_ByteString& sAPType,
ASSERT(pDoc);
CPDF_Dictionary* pAPDict = m_pAnnot->GetAnnotDict()->GetDictBy("AP");
- CPDF_Stream* pStream = pAPDict->GetStreamBy(sAPType);
+ CPDF_Stream* pStream = pAPDict->GetStreamBy(sAPType.AsByteStringC());
CPDF_Dictionary* pStreamDict = pStream->GetDict();
CFX_ByteString sImageAlias = "IMG";
@@ -1831,14 +1831,14 @@ void CPDFSDK_Widget::AddImageToAppearance(const CFX_ByteString& sAPType,
if (pStreamResList) {
CPDF_Dictionary* pXObject = new CPDF_Dictionary;
- pXObject->SetAtReference(sImageAlias, pDoc, pImage);
+ pXObject->SetAtReference(sImageAlias.AsByteStringC(), pDoc, pImage);
pStreamResList->SetAt("XObject", pXObject);
}
}
void CPDFSDK_Widget::RemoveAppearance(const CFX_ByteString& sAPType) {
if (CPDF_Dictionary* pAPDict = m_pAnnot->GetAnnotDict()->GetDictBy("AP")) {
- pAPDict->RemoveAt(sAPType);
+ pAPDict->RemoveAt(sAPType.AsByteStringC());
}
}
diff --git a/fpdfsdk/fsdk_mgr.cpp b/fpdfsdk/fsdk_mgr.cpp
index 323128c9fe..cc228eb8b9 100644
--- a/fpdfsdk/fsdk_mgr.cpp
+++ b/fpdfsdk/fsdk_mgr.cpp
@@ -186,7 +186,7 @@ FX_BOOL CFX_SystemHandler::FindNativeTrueTypeFont(
pFontMapper->LoadInstalledFonts();
for (const auto& font : pFontMapper->m_InstalledTTFonts) {
- if (font.Compare(sFontFaceName))
+ if (font.Compare(sFontFaceName.AsByteStringC()))
return TRUE;
}
diff --git a/fpdfsdk/fxedit/fxet_pageobjs.cpp b/fpdfsdk/fxedit/fxet_pageobjs.cpp
index 3f32d9d3e1..1133cab796 100644
--- a/fpdfsdk/fxedit/fxet_pageobjs.cpp
+++ b/fpdfsdk/fxedit/fxet_pageobjs.cpp
@@ -246,7 +246,8 @@ void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice,
}
sTextBuf << GetPDFWordString(pFontMap, word.nFontIndex, word.Word,
- SubWord);
+ SubWord)
+ .AsByteStringC();
} else {
DrawTextString(
pDevice, CFX_FloatPoint(word.ptWord.x + ptOffset.x,
@@ -359,7 +360,8 @@ void IFX_Edit::DrawRichEdit(CFX_RenderDevice* pDevice,
}
sTextBuf << GetPDFWordString(pFontMap, word.WordProps.nFontIndex,
- word.Word, 0);
+ word.Word, 0)
+ .AsByteStringC();
if (word.WordProps.nWordStyle & PVTWORD_STYLE_UNDERLINE) {
CFX_PathData pathUnderline;
@@ -502,7 +504,8 @@ void IFX_Edit::GeneratePageObjects(
nOldFontIndex = word.nFontIndex;
}
- sTextBuf << GetPDFWordString(pFontMap, word.nFontIndex, word.Word, 0);
+ sTextBuf << GetPDFWordString(pFontMap, word.nFontIndex, word.Word, 0)
+ .AsByteStringC();
oldplace = place;
}
}
@@ -574,7 +577,8 @@ void IFX_Edit::GenerateRichPageObjects(
}
sTextBuf << GetPDFWordString(pFontMap, word.WordProps.nFontIndex,
- word.Word, 0);
+ word.Word, 0)
+ .AsByteStringC();
if (word.WordProps.nWordStyle & PVTWORD_STYLE_UNDERLINE) {
CFX_FloatRect rcUnderline = GetUnderLineRect(word);
diff --git a/fpdfsdk/pdfwindow/PWL_Edit.cpp b/fpdfsdk/pdfwindow/PWL_Edit.cpp
index f53f263470..64588f2dff 100644
--- a/fpdfsdk/pdfwindow/PWL_Edit.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Edit.cpp
@@ -265,6 +265,7 @@ void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) {
case PBS_SOLID: {
sLine << "q\n" << GetBorderWidth() << " w\n"
<< CPWL_Utils::GetColorAppStream(GetBorderColor(), FALSE)
+ .AsByteStringC()
<< " 2 J 0 j\n";
for (int32_t i = 1; i < nCharArray; i++) {
@@ -281,6 +282,7 @@ void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) {
case PBS_DASH: {
sLine << "q\n" << GetBorderWidth() << " w\n"
<< CPWL_Utils::GetColorAppStream(GetBorderColor(), FALSE)
+ .AsByteStringC()
<< " 2 J 0 j\n"
<< "[" << GetBorderDash().nDash << " " << GetBorderDash().nGap
<< "] " << GetBorderDash().nPhase << " d\n";
@@ -319,7 +321,8 @@ void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) {
if (sEditSel.GetLength() > 0)
sText << CPWL_Utils::GetColorAppStream(PWL_DEFAULT_SELBACKCOLOR)
- << sEditSel;
+ .AsByteStringC()
+ << sEditSel.AsByteStringC();
wrTemp = CPWL_Utils::OverlapWordRange(wrVisible, wrSelBefore);
CFX_ByteString sEditBefore = CPWL_Utils::GetEditAppStream(
@@ -327,8 +330,9 @@ void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) {
m_pEdit->GetPasswordChar());
if (sEditBefore.GetLength() > 0)
- sText << "BT\n" << CPWL_Utils::GetColorAppStream(GetTextColor())
- << sEditBefore << "ET\n";
+ sText << "BT\n"
+ << CPWL_Utils::GetColorAppStream(GetTextColor()).AsByteStringC()
+ << sEditBefore.AsByteStringC() << "ET\n";
wrTemp = CPWL_Utils::OverlapWordRange(wrVisible, wrSelect);
CFX_ByteString sEditMid = CPWL_Utils::GetEditAppStream(
@@ -338,7 +342,8 @@ void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) {
if (sEditMid.GetLength() > 0)
sText << "BT\n"
<< CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_GRAY, 1))
- << sEditMid << "ET\n";
+ .AsByteStringC()
+ << sEditMid.AsByteStringC() << "ET\n";
wrTemp = CPWL_Utils::OverlapWordRange(wrVisible, wrSelAfter);
CFX_ByteString sEditAfter = CPWL_Utils::GetEditAppStream(
@@ -346,8 +351,9 @@ void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) {
m_pEdit->GetPasswordChar());
if (sEditAfter.GetLength() > 0)
- sText << "BT\n" << CPWL_Utils::GetColorAppStream(GetTextColor())
- << sEditAfter << "ET\n";
+ sText << "BT\n"
+ << CPWL_Utils::GetColorAppStream(GetTextColor()).AsByteStringC()
+ << sEditAfter.AsByteStringC() << "ET\n";
if (HasFlag(PES_SPELLCHECK)) {
CFX_ByteString sSpellCheck = CPWL_Utils::GetSpellCheckAppStream(
@@ -355,7 +361,8 @@ void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) {
if (sSpellCheck.GetLength() > 0)
sText << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_RGB, 1, 0, 0),
FALSE)
- << sSpellCheck;
+ .AsByteStringC()
+ << sSpellCheck.AsByteStringC();
}
if (sText.GetLength() > 0) {
@@ -742,8 +749,9 @@ CFX_ByteString CPWL_Edit::GetTextAppearanceStream(
CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(m_pEdit, ptOffset);
if (sEdit.GetLength() > 0) {
- sRet << "BT\n" << CPWL_Utils::GetColorAppStream(GetTextColor()) << sEdit
- << "ET\n";
+ sRet << "BT\n"
+ << CPWL_Utils::GetColorAppStream(GetTextColor()).AsByteStringC()
+ << sEdit.AsByteStringC() << "ET\n";
}
return sRet.GetByteString();
diff --git a/fpdfsdk/pdfwindow/PWL_Icon.cpp b/fpdfsdk/pdfwindow/PWL_Icon.cpp
index 560f8e0e32..69f9e599da 100644
--- a/fpdfsdk/pdfwindow/PWL_Icon.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Icon.cpp
@@ -42,7 +42,7 @@ CFX_ByteString CPWL_Image::GetImageAppStream() {
sAppStream << mt.GetA() << " " << mt.GetB() << " " << mt.GetC() << " "
<< mt.GetD() << " " << mt.GetE() << " " << mt.GetF() << " cm\n";
- sAppStream << "0 g 0 G 1 w /" << sAlias << " Do\n"
+ sAppStream << "0 g 0 G 1 w /" << sAlias.AsByteStringC() << " Do\n"
<< "Q\n";
}
diff --git a/fpdfsdk/pdfwindow/PWL_Label.cpp b/fpdfsdk/pdfwindow/PWL_Label.cpp
index cfbeb4362c..8c5b0676d7 100644
--- a/fpdfsdk/pdfwindow/PWL_Label.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Label.cpp
@@ -118,7 +118,8 @@ CFX_FloatRect CPWL_Label::GetContentRect() const {
void CPWL_Label::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) {
CPWL_Wnd::GetThisAppearanceStream(sAppStream);
- sAppStream << GetTextAppearanceStream(CFX_FloatPoint(0.0f, 0.0f));
+ sAppStream << GetTextAppearanceStream(CFX_FloatPoint(0.0f, 0.0f))
+ .AsByteStringC();
}
CFX_ByteString CPWL_Label::GetTextAppearanceStream(
@@ -127,8 +128,9 @@ CFX_ByteString CPWL_Label::GetTextAppearanceStream(
CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(m_pEdit, ptOffset);
if (sEdit.GetLength() > 0) {
- sRet << "BT\n" << CPWL_Utils::GetColorAppStream(GetTextColor()) << sEdit
- << "ET\n";
+ sRet << "BT\n"
+ << CPWL_Utils::GetColorAppStream(GetTextColor()).AsByteStringC()
+ << sEdit.AsByteStringC() << "ET\n";
}
return sRet.GetByteString();
diff --git a/fpdfsdk/pdfwindow/PWL_ListBox.cpp b/fpdfsdk/pdfwindow/PWL_ListBox.cpp
index d39d8419a6..ccccc77dcd 100644
--- a/fpdfsdk/pdfwindow/PWL_ListBox.cpp
+++ b/fpdfsdk/pdfwindow/PWL_ListBox.cpp
@@ -118,21 +118,25 @@ void CPWL_ListBox::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) {
CFX_FloatPoint ptOffset(rcItem.left, (rcItem.top + rcItem.bottom) * 0.5f);
if (m_pList->IsItemSelected(i)) {
- sListItems << CPWL_Utils::GetRectFillAppStream(
- rcItem, PWL_DEFAULT_SELBACKCOLOR);
+ sListItems << CPWL_Utils::GetRectFillAppStream(rcItem,
+ PWL_DEFAULT_SELBACKCOLOR)
+ .AsByteStringC();
CFX_ByteString sItem =
CPWL_Utils::GetEditAppStream(m_pList->GetItemEdit(i), ptOffset);
if (sItem.GetLength() > 0) {
sListItems << "BT\n"
<< CPWL_Utils::GetColorAppStream(PWL_DEFAULT_SELTEXTCOLOR)
- << sItem << "ET\n";
+ .AsByteStringC()
+ << sItem.AsByteStringC() << "ET\n";
}
} else {
CFX_ByteString sItem =
CPWL_Utils::GetEditAppStream(m_pList->GetItemEdit(i), ptOffset);
if (sItem.GetLength() > 0) {
- sListItems << "BT\n" << CPWL_Utils::GetColorAppStream(GetTextColor())
- << sItem << "ET\n";
+ sListItems << "BT\n"
+ << CPWL_Utils::GetColorAppStream(GetTextColor())
+ .AsByteStringC()
+ << sItem.AsByteStringC() << "ET\n";
}
}
}
diff --git a/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp b/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
index 9db2aea35b..a96cf5f2a5 100644
--- a/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
+++ b/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
@@ -670,7 +670,8 @@ void CPWL_ScrollBar::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) {
sButton << "q\n";
sButton << "0 w\n"
- << CPWL_Utils::GetColorAppStream(GetBackgroundColor(), TRUE);
+ << CPWL_Utils::GetColorAppStream(GetBackgroundColor(), TRUE)
+ .AsByteStringC();
sButton << rectWnd.left << " " << rectWnd.bottom << " "
<< rectWnd.right - rectWnd.left << " "
<< rectWnd.top - rectWnd.bottom << " re b Q\n";
diff --git a/fpdfsdk/pdfwindow/PWL_Signature.cpp b/fpdfsdk/pdfwindow/PWL_Signature.cpp
index 72b6ebe7c3..221922972f 100644
--- a/fpdfsdk/pdfwindow/PWL_Signature.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Signature.cpp
@@ -42,7 +42,7 @@ void CPWL_Signature_Image::DrawThisAppearance(CFX_RenderDevice* pDevice,
void CPWL_Signature_Image::GetThisAppearanceStream(
CFX_ByteTextBuf& sAppStream) {
- sAppStream << CPWL_Image::GetImageAppStream();
+ sAppStream << CPWL_Image::GetImageAppStream().AsByteStringC();
}
void CPWL_Signature_Image::GetScale(FX_FLOAT& fHScale, FX_FLOAT& fVScale) {