summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/pdfwindow/PWL_Utils.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-04-27 12:06:58 -0700
committerTom Sepez <tsepez@chromium.org>2015-04-27 12:06:58 -0700
commit4f7bc04ed64edbf72f49b2189f85bb88f0b547c7 (patch)
tree708c0cc04028015e2860f07e8e60780b34137094 /fpdfsdk/src/pdfwindow/PWL_Utils.cpp
parente5350eff5c5cfe4d01686a4c787d764bde5dd23c (diff)
downloadpdfium-4f7bc04ed64edbf72f49b2189f85bb88f0b547c7.tar.xz
Merge to XFA: Reduce usage of operator LPCWSTR from CFX_WideString().
Original Review URL: https://codereview.chromium.org/1101933003 TBR=brucedawson@chromium.org Review URL: https://codereview.chromium.org/1108903002
Diffstat (limited to 'fpdfsdk/src/pdfwindow/PWL_Utils.cpp')
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Utils.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/fpdfsdk/src/pdfwindow/PWL_Utils.cpp b/fpdfsdk/src/pdfwindow/PWL_Utils.cpp
index 1de6b56d5e..b57f8e019d 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Utils.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Utils.cpp
@@ -641,9 +641,8 @@ CFX_ByteString CPWL_Utils::GetTextAppStream(const CPDF_Rect & rcBBox,IFX_Edit_Fo
CFX_ByteTextBuf sRet;
if (IFX_Edit * pEdit = IFX_Edit::NewEdit())
- {
+ {
pEdit->SetFontMap(pFontMap);
-
pEdit->SetPlateRect(rcBBox);
pEdit->SetAlignmentH(nAlignmentH);
pEdit->SetAlignmentV(nAlignmentV);
@@ -653,16 +652,15 @@ CFX_ByteString CPWL_Utils::GetTextAppStream(const CPDF_Rect & rcBBox,IFX_Edit_Fo
pEdit->SetAutoFontSize(TRUE);
else
pEdit->SetFontSize(fFontSize);
+
pEdit->Initialize();
+ pEdit->SetText(sText.c_str());
- pEdit->SetText(sText);
-
CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(pEdit, CPDF_Point(0.0f,0.0f));
if (sEdit.GetLength() > 0)
{
sRet << "BT\n" << CPWL_Utils::GetColorAppStream(crText) << sEdit << "ET\n";
}
-
IFX_Edit::DelEdit(pEdit);
}
@@ -681,9 +679,8 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CPDF_Rect & rcBBox,
const FX_FLOAT fAutoFontScale = 1.0f / 3.0f;
if (IFX_Edit * pEdit = IFX_Edit::NewEdit())
- {
+ {
pEdit->SetFontMap(pFontMap);
-
pEdit->SetAlignmentH(1);
pEdit->SetAlignmentV(1);
pEdit->SetMultiLine(FALSE);
@@ -692,11 +689,11 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CPDF_Rect & rcBBox,
pEdit->SetAutoFontSize(TRUE);
else
pEdit->SetFontSize(fFontSize);
+
pEdit->Initialize();
- pEdit->SetText(sLabel);
+ pEdit->SetText(sLabel.c_str());
CPDF_Rect rcLabelContent = pEdit->GetContentRect();
-
CPWL_Icon Icon;
PWL_CREATEPARAM cp;
cp.dwFlags = PWS_VISIBLE;