summaryrefslogtreecommitdiff
path: root/fpdfsdk/pdfwindow/PWL_Edit.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2017-02-14 14:58:49 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-02-14 14:59:09 +0000
commit92a32db931c1303388158f8a9e045e922d0b8dfa (patch)
tree5c6c05ffb40c1bb2653b415842537f7043bd6407 /fpdfsdk/pdfwindow/PWL_Edit.cpp
parent4797c4240cb9e2d8cd36c583d46cd52ff94af95d (diff)
downloadpdfium-92a32db931c1303388158f8a9e045e922d0b8dfa.tar.xz
Revert "Convert CFX_FloatPoint to CFX_PointF"
This reverts commit 4797c4240cb9e2d8cd36c583d46cd52ff94af95d. Reason for revert: Reverting chain to see if fixes Chrome roll. Original change's description: > Convert CFX_FloatPoint to CFX_PointF > > The two classes store the same information, remove the CFX_FloatPoint variant. > > Change-Id: Ie598c2ba5af04fb2bb3347dd48c30fd5e4845e62 > Reviewed-on: https://pdfium-review.googlesource.com/2612 > Commit-Queue: dsinclair <dsinclair@chromium.org> > Reviewed-by: Tom Sepez <tsepez@chromium.org> > TBR=tsepez@chromium.org,dsinclair@chromium.org,pdfium-reviews@googlegroups.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Ia42074e706983c62d2e57497c3079b3c338343a3 Reviewed-on: https://pdfium-review.googlesource.com/2694 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/pdfwindow/PWL_Edit.cpp')
-rw-r--r--fpdfsdk/pdfwindow/PWL_Edit.cpp37
1 files changed, 20 insertions, 17 deletions
diff --git a/fpdfsdk/pdfwindow/PWL_Edit.cpp b/fpdfsdk/pdfwindow/PWL_Edit.cpp
index 8b46d22f13..b9958a3128 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_PointF ptOffset;
+ CFX_FloatPoint ptOffset = CFX_FloatPoint();
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_PointF(), pRange, pSysHandler, m_pFormFiller);
+ rcClip, CFX_FloatPoint(), pRange, pSysHandler, m_pFormFiller);
}
-bool CPWL_Edit::OnLButtonDown(const CFX_PointF& point, uint32_t nFlag) {
+bool CPWL_Edit::OnLButtonDown(const CFX_FloatPoint& 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_PointF& point, uint32_t nFlag) {
return true;
}
-bool CPWL_Edit::OnLButtonDblClk(const CFX_PointF& point, uint32_t nFlag) {
+bool CPWL_Edit::OnLButtonDblClk(const CFX_FloatPoint& 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_PointF& point, uint32_t nFlag) {
return true;
}
-bool CPWL_Edit::OnRButtonUp(const CFX_PointF& point, uint32_t nFlag) {
+bool CPWL_Edit::OnRButtonUp(const CFX_FloatPoint& 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_PointF(), CFX_PointF());
+ SetCaret(false, CFX_FloatPoint(), CFX_FloatPoint());
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_PointF& ptOffset) const {
+ const CFX_FloatPoint& 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_PointF& ptOffset) const {
+ const CFX_FloatPoint& ptOffset) const {
CFX_ByteTextBuf sRet;
CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(m_pEdit.get(), ptOffset);
if (sEdit.GetLength() > 0) {
@@ -497,22 +497,24 @@ CFX_ByteString CPWL_Edit::GetTextAppearanceStream(
}
CFX_ByteString CPWL_Edit::GetCaretAppearanceStream(
- const CFX_PointF& ptOffset) const {
+ const CFX_FloatPoint& ptOffset) const {
if (m_pEditCaret)
return m_pEditCaret->GetCaretAppearanceStream(ptOffset);
return CFX_ByteString();
}
-CFX_PointF CPWL_Edit::GetWordRightBottomPoint(const CPVT_WordPlace& wpWord) {
+CFX_FloatPoint CPWL_Edit::GetWordRightBottomPoint(
+ const CPVT_WordPlace& wpWord) {
CFX_Edit_Iterator* pIterator = m_pEdit->GetIterator();
CPVT_WordPlace wpOld = pIterator->GetAt();
pIterator->SetAt(wpWord);
- CFX_PointF pt;
+ CFX_FloatPoint pt;
CPVT_Word word;
if (pIterator->GetWord(word)) {
- pt = CFX_PointF(word.ptWord.x + word.fWidth, word.ptWord.y + word.fDescent);
+ pt = CFX_FloatPoint(word.ptWord.x + word.fWidth,
+ word.ptWord.y + word.fDescent);
}
pIterator->SetAt(wpOld);
return pt;
@@ -718,10 +720,10 @@ bool CPWL_Edit::OnChar(uint16_t nChar, uint32_t nFlag) {
}
bool CPWL_Edit::OnMouseWheel(short zDelta,
- const CFX_PointF& point,
+ const CFX_FloatPoint& point,
uint32_t nFlag) {
if (HasFlag(PES_MULTILINE)) {
- CFX_PointF ptScroll = GetScrollPos();
+ CFX_FloatPoint ptScroll = GetScrollPos();
if (zDelta > 0) {
ptScroll.y += GetFontSize();
@@ -803,7 +805,8 @@ CPVT_WordRange CPWL_Edit::CombineWordRange(const CPVT_WordRange& wr1,
return wrRet;
}
-CPVT_WordRange CPWL_Edit::GetLatinWordsRange(const CFX_PointF& point) const {
+CPVT_WordRange CPWL_Edit::GetLatinWordsRange(
+ const CFX_FloatPoint& point) const {
return GetSameWordsRange(m_pEdit->SearchWordPlace(point), true, false);
}
@@ -873,7 +876,7 @@ CPVT_WordRange CPWL_Edit::GetSameWordsRange(const CPVT_WordPlace& place,
}
void CPWL_Edit::GeneratePageObjects(CPDF_PageObjectHolder* pObjectHolder,
- const CFX_PointF& ptOffset,
+ const CFX_FloatPoint& ptOffset,
std::vector<CPDF_TextObject*>* ObjArray) {
CFX_Edit::GeneratePageObjects(
pObjectHolder, m_pEdit.get(), ptOffset, nullptr,
@@ -882,7 +885,7 @@ void CPWL_Edit::GeneratePageObjects(CPDF_PageObjectHolder* pObjectHolder,
}
void CPWL_Edit::GeneratePageObjects(CPDF_PageObjectHolder* pObjectHolder,
- const CFX_PointF& ptOffset) {
+ const CFX_FloatPoint& ptOffset) {
std::vector<CPDF_TextObject*> ObjArray;
CFX_Edit::GeneratePageObjects(
pObjectHolder, m_pEdit.get(), ptOffset, nullptr,