summaryrefslogtreecommitdiff
path: root/fpdfsdk/pdfwindow/PWL_Edit.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-02-14 11:52:07 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-14 18:12:34 +0000
commitf528eee136a602643a7777d87a2cce52cf83f38a (patch)
tree94643b8f0b26a8cd61437db4b9867b9a60a00ef8 /fpdfsdk/pdfwindow/PWL_Edit.cpp
parent22da8c268d2228203b40a8c73a2d3f6c25fc9acc (diff)
downloadpdfium-f528eee136a602643a7777d87a2cce52cf83f38a.tar.xz
Reland "Convert CFX_FloatPoint to CFX_PointF"
This CL updates the CFX_FloatPoint Cl to accommodate for the Origin CL being reverted. Change-Id: I345fe1117938a49ad9ee5f310fe7b5e21d9f1948 Reviewed-on: https://pdfium-review.googlesource.com/2697 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/pdfwindow/PWL_Edit.cpp')
-rw-r--r--fpdfsdk/pdfwindow/PWL_Edit.cpp33
1 files changed, 15 insertions, 18 deletions
diff --git a/fpdfsdk/pdfwindow/PWL_Edit.cpp b/fpdfsdk/pdfwindow/PWL_Edit.cpp
index bca9397047..5d9c314a56 100644
--- a/fpdfsdk/pdfwindow/PWL_Edit.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Edit.cpp
@@ -243,7 +243,7 @@ void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) {
sAppStream << sLine;
CFX_ByteTextBuf sText;
- CFX_FloatPoint ptOffset = CFX_FloatPoint();
+ CFX_PointF ptOffset;
CPVT_WordRange wrWhole = m_pEdit->GetWholeWordRange();
CPVT_WordRange wrSelect = GetSelectWordRange();
CPVT_WordRange wrVisible =
@@ -395,10 +395,10 @@ void CPWL_Edit::DrawThisAppearance(CFX_RenderDevice* pDevice,
pDevice, pUser2Device, m_pEdit.get(),
CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency()),
CPWL_Utils::PWLColorToFXColor(GetTextStrokeColor(), GetTransparency()),
- rcClip, CFX_FloatPoint(), pRange, pSysHandler, m_pFormFiller);
+ rcClip, CFX_PointF(), pRange, pSysHandler, m_pFormFiller);
}
-bool CPWL_Edit::OnLButtonDown(const CFX_FloatPoint& point, uint32_t nFlag) {
+bool CPWL_Edit::OnLButtonDown(const CFX_PointF& point, uint32_t nFlag) {
CPWL_Wnd::OnLButtonDown(point, nFlag);
if (HasFlag(PES_TEXTOVERFLOW) || ClientHitTest(point)) {
@@ -414,7 +414,7 @@ bool CPWL_Edit::OnLButtonDown(const CFX_FloatPoint& point, uint32_t nFlag) {
return true;
}
-bool CPWL_Edit::OnLButtonDblClk(const CFX_FloatPoint& point, uint32_t nFlag) {
+bool CPWL_Edit::OnLButtonDblClk(const CFX_PointF& point, uint32_t nFlag) {
CPWL_Wnd::OnLButtonDblClk(point, nFlag);
if (HasFlag(PES_TEXTOVERFLOW) || ClientHitTest(point)) {
@@ -424,7 +424,7 @@ bool CPWL_Edit::OnLButtonDblClk(const CFX_FloatPoint& point, uint32_t nFlag) {
return true;
}
-bool CPWL_Edit::OnRButtonUp(const CFX_FloatPoint& point, uint32_t nFlag) {
+bool CPWL_Edit::OnRButtonUp(const CFX_PointF& point, uint32_t nFlag) {
if (m_bMouseDown)
return false;
@@ -454,7 +454,7 @@ void CPWL_Edit::OnSetFocus() {
void CPWL_Edit::OnKillFocus() {
ShowVScrollBar(false);
m_pEdit->SelectNone();
- SetCaret(false, CFX_FloatPoint(), CFX_FloatPoint());
+ SetCaret(false, CFX_PointF(), CFX_PointF());
SetCharSet(FXFONT_ANSI_CHARSET);
m_bFocus = false;
}
@@ -464,7 +464,7 @@ void CPWL_Edit::SetCharSpace(FX_FLOAT fCharSpace) {
}
CFX_ByteString CPWL_Edit::GetSelectAppearanceStream(
- const CFX_FloatPoint& ptOffset) const {
+ const CFX_PointF& ptOffset) const {
CPVT_WordRange wr = GetSelectWordRange();
return CPWL_Utils::GetEditSelAppStream(m_pEdit.get(), ptOffset, &wr);
}
@@ -486,7 +486,7 @@ CPVT_WordRange CPWL_Edit::GetSelectWordRange() const {
}
CFX_ByteString CPWL_Edit::GetTextAppearanceStream(
- const CFX_FloatPoint& ptOffset) const {
+ const CFX_PointF& ptOffset) const {
CFX_ByteTextBuf sRet;
CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(m_pEdit.get(), ptOffset);
if (sEdit.GetLength() > 0) {
@@ -497,24 +497,22 @@ CFX_ByteString CPWL_Edit::GetTextAppearanceStream(
}
CFX_ByteString CPWL_Edit::GetCaretAppearanceStream(
- const CFX_FloatPoint& ptOffset) const {
+ const CFX_PointF& ptOffset) const {
if (m_pEditCaret)
return m_pEditCaret->GetCaretAppearanceStream(ptOffset);
return CFX_ByteString();
}
-CFX_FloatPoint CPWL_Edit::GetWordRightBottomPoint(
- const CPVT_WordPlace& wpWord) {
+CFX_PointF CPWL_Edit::GetWordRightBottomPoint(const CPVT_WordPlace& wpWord) {
CFX_Edit_Iterator* pIterator = m_pEdit->GetIterator();
CPVT_WordPlace wpOld = pIterator->GetAt();
pIterator->SetAt(wpWord);
- CFX_FloatPoint pt;
+ CFX_PointF pt;
CPVT_Word word;
if (pIterator->GetWord(word)) {
- pt = CFX_FloatPoint(word.ptWord.x + word.fWidth,
- word.ptWord.y + word.fDescent);
+ pt = CFX_PointF(word.ptWord.x + word.fWidth, word.ptWord.y + word.fDescent);
}
pIterator->SetAt(wpOld);
return pt;
@@ -720,10 +718,10 @@ bool CPWL_Edit::OnChar(uint16_t nChar, uint32_t nFlag) {
}
bool CPWL_Edit::OnMouseWheel(short zDelta,
- const CFX_FloatPoint& point,
+ const CFX_PointF& point,
uint32_t nFlag) {
if (HasFlag(PES_MULTILINE)) {
- CFX_FloatPoint ptScroll = GetScrollPos();
+ CFX_PointF ptScroll = GetScrollPos();
if (zDelta > 0) {
ptScroll.y += GetFontSize();
@@ -805,8 +803,7 @@ CPVT_WordRange CPWL_Edit::CombineWordRange(const CPVT_WordRange& wr1,
return wrRet;
}
-CPVT_WordRange CPWL_Edit::GetLatinWordsRange(
- const CFX_FloatPoint& point) const {
+CPVT_WordRange CPWL_Edit::GetLatinWordsRange(const CFX_PointF& point) const {
return GetSameWordsRange(m_pEdit->SearchWordPlace(point), true, false);
}