summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/pdfwindow/PWL_Utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/src/pdfwindow/PWL_Utils.cpp')
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Utils.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/fpdfsdk/src/pdfwindow/PWL_Utils.cpp b/fpdfsdk/src/pdfwindow/PWL_Utils.cpp
index b57f8e019d..1de6b56d5e 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Utils.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Utils.cpp
@@ -641,8 +641,9 @@ 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);
@@ -652,15 +653,16 @@ 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);
}
@@ -679,8 +681,9 @@ 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);
@@ -689,11 +692,11 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CPDF_Rect & rcBBox,
pEdit->SetAutoFontSize(TRUE);
else
pEdit->SetFontSize(fFontSize);
-
pEdit->Initialize();
- pEdit->SetText(sLabel.c_str());
+ pEdit->SetText(sLabel);
CPDF_Rect rcLabelContent = pEdit->GetContentRect();
+
CPWL_Icon Icon;
PWL_CREATEPARAM cp;
cp.dwFlags = PWS_VISIBLE;