diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-04-27 11:31:26 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-04-27 11:31:26 -0700 |
commit | f7a7d7e07396c3a0fae617ed8f15f29fd491bc3a (patch) | |
tree | 53e22c58375eb36abe97f5b8f2631b4eba111fbc /fpdfsdk/src/pdfwindow/PWL_Utils.cpp | |
parent | 15a62973b9b89c3e229cc0ab501c45967f91b325 (diff) | |
download | pdfium-f7a7d7e07396c3a0fae617ed8f15f29fd491bc3a.tar.xz |
Revert "Kill operator LPCWSTR from CFX_WideString()."
This reverts commit 15a62973b9b89c3e229cc0ab501c45967f91b325.
Reason for revert: broke build on windows, mac. I must have missed
some platform-specific conversions.
TBR=brucedawson@chromium.org
Review URL: https://codereview.chromium.org/1108883002
Diffstat (limited to 'fpdfsdk/src/pdfwindow/PWL_Utils.cpp')
-rw-r--r-- | fpdfsdk/src/pdfwindow/PWL_Utils.cpp | 15 |
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; |