summaryrefslogtreecommitdiff
path: root/fpdfsdk/pdfwindow/PWL_Utils.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-07-13 11:26:20 -0700
committerCommit bot <commit-bot@chromium.org>2016-07-13 11:26:20 -0700
commite35af1e3c93e5e1f374799da115eb4b99820831c (patch)
tree1adebcd0961e7e331ff6d4172401296676967970 /fpdfsdk/pdfwindow/PWL_Utils.cpp
parenta2919b31197737d35e4e1df53b02f7ee7cb4cf5e (diff)
downloadpdfium-e35af1e3c93e5e1f374799da115eb4b99820831c.tar.xz
Remove some IFX_* wrappers.
This CL removes the IFX_* wrappers between fpdfsdk/fxedit and fpdfsdk/pdfwindow which only have a single implementation. Review-Url: https://codereview.chromium.org/2142213002
Diffstat (limited to 'fpdfsdk/pdfwindow/PWL_Utils.cpp')
-rw-r--r--fpdfsdk/pdfwindow/PWL_Utils.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/fpdfsdk/pdfwindow/PWL_Utils.cpp b/fpdfsdk/pdfwindow/PWL_Utils.cpp
index f5d30b2d14..c8b2239a36 100644
--- a/fpdfsdk/pdfwindow/PWL_Utils.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Utils.cpp
@@ -10,7 +10,7 @@
#include "core/fpdfdoc/include/cpvt_word.h"
#include "core/fxge/include/fx_ge.h"
-#include "fpdfsdk/fxedit/include/fx_edit.h"
+#include "fpdfsdk/fxedit/include/fxet_edit.h"
#include "fpdfsdk/pdfwindow/PWL_Icon.h"
#include "fpdfsdk/pdfwindow/PWL_Wnd.h"
@@ -412,19 +412,19 @@ CFX_FloatRect CPWL_Utils::GetCenterSquare(const CFX_FloatRect& rect) {
fCenterX + fRadius, fCenterY + fRadius);
}
-CFX_ByteString CPWL_Utils::GetEditAppStream(IFX_Edit* pEdit,
+CFX_ByteString CPWL_Utils::GetEditAppStream(CFX_Edit* pEdit,
const CFX_FloatPoint& ptOffset,
const CPVT_WordRange* pRange,
FX_BOOL bContinuous,
uint16_t SubWord) {
- return IFX_Edit::GetEditAppearanceStream(pEdit, ptOffset, pRange, bContinuous,
+ return CFX_Edit::GetEditAppearanceStream(pEdit, ptOffset, pRange, bContinuous,
SubWord);
}
-CFX_ByteString CPWL_Utils::GetEditSelAppStream(IFX_Edit* pEdit,
+CFX_ByteString CPWL_Utils::GetEditSelAppStream(CFX_Edit* pEdit,
const CFX_FloatPoint& ptOffset,
const CPVT_WordRange* pRange) {
- return IFX_Edit::GetSelectAppearanceStream(pEdit, ptOffset, pRange);
+ return CFX_Edit::GetSelectAppearanceStream(pEdit, ptOffset, pRange);
}
CFX_ByteString CPWL_Utils::GetTextAppStream(const CFX_FloatRect& rcBBox,
@@ -438,7 +438,7 @@ CFX_ByteString CPWL_Utils::GetTextAppStream(const CFX_FloatRect& rcBBox,
const CPWL_Color& crText) {
CFX_ByteTextBuf sRet;
- IFX_Edit* pEdit = IFX_Edit::NewEdit();
+ std::unique_ptr<CFX_Edit> pEdit(new CFX_Edit);
pEdit->SetFontMap(pFontMap);
pEdit->SetPlateRect(rcBBox);
pEdit->SetAlignmentH(nAlignmentH);
@@ -454,10 +454,9 @@ CFX_ByteString CPWL_Utils::GetTextAppStream(const CFX_FloatRect& rcBBox,
pEdit->SetText(sText.c_str());
CFX_ByteString sEdit =
- CPWL_Utils::GetEditAppStream(pEdit, CFX_FloatPoint(0.0f, 0.0f));
+ CPWL_Utils::GetEditAppStream(pEdit.get(), CFX_FloatPoint(0.0f, 0.0f));
if (sEdit.GetLength() > 0)
sRet << "BT\n" << CPWL_Utils::GetColorAppStream(crText) << sEdit << "ET\n";
- IFX_Edit::DelEdit(pEdit);
return sRet.MakeString();
}
@@ -472,7 +471,7 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CFX_FloatRect& rcBBox,
int32_t nLayOut) {
const FX_FLOAT fAutoFontScale = 1.0f / 3.0f;
- IFX_Edit* pEdit = IFX_Edit::NewEdit();
+ std::unique_ptr<CFX_Edit> pEdit(new CFX_Edit);
pEdit->SetFontMap(pFontMap);
pEdit->SetAlignmentH(1);
pEdit->SetAlignmentV(1);
@@ -667,14 +666,13 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CFX_FloatRect& rcBBox,
if (!rcLabel.IsEmpty()) {
pEdit->SetPlateRect(rcLabel);
CFX_ByteString sEdit =
- CPWL_Utils::GetEditAppStream(pEdit, CFX_FloatPoint(0.0f, 0.0f));
+ CPWL_Utils::GetEditAppStream(pEdit.get(), CFX_FloatPoint(0.0f, 0.0f));
if (sEdit.GetLength() > 0) {
sTemp << "BT\n"
<< CPWL_Utils::GetColorAppStream(crText) << sEdit << "ET\n";
}
}
- IFX_Edit::DelEdit(pEdit);
if (sTemp.GetSize() > 0) {
sAppStream << "q\n"
<< rcBBox.left << " " << rcBBox.bottom << " "