summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/formfiller
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-02-26 14:24:28 -0800
committerTom Sepez <tsepez@chromium.org>2016-02-26 14:24:28 -0800
commit281a9eadff15b167e2ee3032e21b83190ad49125 (patch)
treef02f7d0842f59d8e69bda011b3e62547ffb1acde /fpdfsdk/src/formfiller
parent566b974287ce0e81a963138152b8898f22480f52 (diff)
downloadpdfium-281a9eadff15b167e2ee3032e21b83190ad49125.tar.xz
Re-land "Replace CPDF_Rect and CPDF_Point with CFX types."
TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1737593006 .
Diffstat (limited to 'fpdfsdk/src/formfiller')
-rw-r--r--fpdfsdk/src/formfiller/FFL_CheckBox.cpp2
-rw-r--r--fpdfsdk/src/formfiller/FFL_FormFiller.cpp84
-rw-r--r--fpdfsdk/src/formfiller/FFL_IFormFiller.cpp28
-rw-r--r--fpdfsdk/src/formfiller/FFL_RadioButton.cpp2
-rw-r--r--fpdfsdk/src/formfiller/FFL_TextField.cpp2
5 files changed, 59 insertions, 59 deletions
diff --git a/fpdfsdk/src/formfiller/FFL_CheckBox.cpp b/fpdfsdk/src/formfiller/FFL_CheckBox.cpp
index f76613ed3f..78a689af64 100644
--- a/fpdfsdk/src/formfiller/FFL_CheckBox.cpp
+++ b/fpdfsdk/src/formfiller/FFL_CheckBox.cpp
@@ -73,7 +73,7 @@ FX_BOOL CFFL_CheckBox::OnChar(CPDFSDK_Annot* pAnnot,
FX_BOOL CFFL_CheckBox::OnLButtonUp(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
FX_UINT nFlags,
- const CPDF_Point& point) {
+ const CFX_FloatPoint& point) {
CFFL_Button::OnLButtonUp(pPageView, pAnnot, nFlags, point);
if (IsValid()) {
diff --git a/fpdfsdk/src/formfiller/FFL_FormFiller.cpp b/fpdfsdk/src/formfiller/FFL_FormFiller.cpp
index ce73f7d4cb..e596ba08ba 100644
--- a/fpdfsdk/src/formfiller/FFL_FormFiller.cpp
+++ b/fpdfsdk/src/formfiller/FFL_FormFiller.cpp
@@ -36,18 +36,18 @@ CFFL_FormFiller::~CFFL_FormFiller() {
}
void CFFL_FormFiller::SetWindowRect(CPDFSDK_PageView* pPageView,
- const CPDF_Rect& rcWindow) {
+ const CFX_FloatRect& rcWindow) {
if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) {
- pWnd->Move(CPDF_Rect(rcWindow), TRUE, FALSE);
+ pWnd->Move(CFX_FloatRect(rcWindow), TRUE, FALSE);
}
}
-CPDF_Rect CFFL_FormFiller::GetWindowRect(CPDFSDK_PageView* pPageView) {
+CFX_FloatRect CFFL_FormFiller::GetWindowRect(CPDFSDK_PageView* pPageView) {
if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) {
return pWnd->GetWindowRect();
}
- return CPDF_Rect(0, 0, 0, 0);
+ return CFX_FloatRect(0, 0, 0, 0);
}
FX_RECT CFFL_FormFiller::GetViewBBox(CPDFSDK_PageView* pPageView,
@@ -55,20 +55,20 @@ FX_RECT CFFL_FormFiller::GetViewBBox(CPDFSDK_PageView* pPageView,
ASSERT(pPageView);
ASSERT(pAnnot);
- CPDF_Rect rcAnnot = m_pWidget->GetRect();
+ CFX_FloatRect rcAnnot = m_pWidget->GetRect();
if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) {
- CPDF_Rect rcWindow = pWnd->GetWindowRect();
+ CFX_FloatRect rcWindow = pWnd->GetWindowRect();
rcAnnot = PWLtoFFL(rcWindow);
}
- CPDF_Rect rcWin = rcAnnot;
+ CFX_FloatRect rcWin = rcAnnot;
- CPDF_Rect rcFocus = GetFocusBox(pPageView);
+ CFX_FloatRect rcFocus = GetFocusBox(pPageView);
if (!rcFocus.IsEmpty())
rcWin.Union(rcFocus);
- CPDF_Rect rect = CPWL_Utils::InflateRect(rcWin, 1);
+ CFX_FloatRect rect = CPWL_Utils::InflateRect(rcWin, 1);
return rect.GetOutterRect();
}
@@ -118,7 +118,7 @@ void CFFL_FormFiller::OnMouseExit(CPDFSDK_PageView* pPageView,
FX_BOOL CFFL_FormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
FX_UINT nFlags,
- const CPDF_Point& point) {
+ const CFX_FloatPoint& point) {
if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, TRUE)) {
m_bValid = TRUE;
FX_RECT rect = GetViewBBox(pPageView, pAnnot);
@@ -136,7 +136,7 @@ FX_BOOL CFFL_FormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView,
FX_BOOL CFFL_FormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
FX_UINT nFlags,
- const CPDF_Point& point) {
+ const CFX_FloatPoint& point) {
if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) {
FX_RECT rcFFL = GetViewBBox(pPageView, pAnnot);
InvalidateRect(rcFFL.left, rcFFL.top, rcFFL.right, rcFFL.bottom);
@@ -150,7 +150,7 @@ FX_BOOL CFFL_FormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView,
FX_BOOL CFFL_FormFiller::OnLButtonDblClk(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
FX_UINT nFlags,
- const CPDF_Point& point) {
+ const CFX_FloatPoint& point) {
if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) {
pWnd->OnLButtonDblClk(WndtoPWL(pPageView, point), nFlags);
return TRUE;
@@ -162,7 +162,7 @@ FX_BOOL CFFL_FormFiller::OnLButtonDblClk(CPDFSDK_PageView* pPageView,
FX_BOOL CFFL_FormFiller::OnMouseMove(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
FX_UINT nFlags,
- const CPDF_Point& point) {
+ const CFX_FloatPoint& point) {
if ((m_ptOldPos.x != point.x) || (m_ptOldPos.y != point.y)) {
m_ptOldPos = point;
}
@@ -179,7 +179,7 @@ FX_BOOL CFFL_FormFiller::OnMouseWheel(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
FX_UINT nFlags,
short zDelta,
- const CPDF_Point& point) {
+ const CFX_FloatPoint& point) {
if (!IsValid())
return FALSE;
@@ -193,7 +193,7 @@ FX_BOOL CFFL_FormFiller::OnMouseWheel(CPDFSDK_PageView* pPageView,
FX_BOOL CFFL_FormFiller::OnRButtonDown(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
FX_UINT nFlags,
- const CPDF_Point& point) {
+ const CFX_FloatPoint& point) {
if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, TRUE)) {
pWnd->OnRButtonDown(WndtoPWL(pPageView, point), nFlags);
return TRUE;
@@ -205,7 +205,7 @@ FX_BOOL CFFL_FormFiller::OnRButtonDown(CPDFSDK_PageView* pPageView,
FX_BOOL CFFL_FormFiller::OnRButtonUp(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
FX_UINT nFlags,
- const CPDF_Point& point) {
+ const CFX_FloatPoint& point) {
if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) {
pWnd->OnRButtonUp(WndtoPWL(pPageView, point), nFlags);
return TRUE;
@@ -420,7 +420,7 @@ CFX_Matrix CFFL_FormFiller::GetWindowMatrix(void* pAttachedData) {
CFX_Matrix CFFL_FormFiller::GetCurMatrix() {
CFX_Matrix mt;
- CPDF_Rect rcDA;
+ CFX_FloatRect rcDA;
m_pWidget->GetPDFAnnot()->GetRect(rcDA);
switch (m_pWidget->GetRotate()) {
@@ -451,16 +451,16 @@ CFX_WideString CFFL_FormFiller::LoadPopupMenuString(int nIndex) {
return L"";
}
-CPDF_Rect CFFL_FormFiller::GetPDFWindowRect() const {
- CPDF_Rect rectAnnot;
+CFX_FloatRect CFFL_FormFiller::GetPDFWindowRect() const {
+ CFX_FloatRect rectAnnot;
m_pWidget->GetPDFAnnot()->GetRect(rectAnnot);
FX_FLOAT fWidth = rectAnnot.right - rectAnnot.left;
FX_FLOAT fHeight = rectAnnot.top - rectAnnot.bottom;
if ((m_pWidget->GetRotate() / 90) & 0x01)
- return CPDF_Rect(0, 0, fHeight, fWidth);
+ return CFX_FloatRect(0, 0, fHeight, fWidth);
- return CPDF_Rect(0, 0, fWidth, fHeight);
+ return CFX_FloatRect(0, 0, fWidth, fHeight);
}
CPDFSDK_PageView* CFFL_FormFiller::GetCurPageView() {
@@ -469,61 +469,61 @@ CPDFSDK_PageView* CFFL_FormFiller::GetCurPageView() {
return pSDKDoc ? pSDKDoc->GetPageView(pPage) : nullptr;
}
-CPDF_Rect CFFL_FormFiller::GetFocusBox(CPDFSDK_PageView* pPageView) {
+CFX_FloatRect CFFL_FormFiller::GetFocusBox(CPDFSDK_PageView* pPageView) {
if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) {
- CPDF_Rect rcFocus = FFLtoWnd(pPageView, PWLtoFFL(pWnd->GetFocusRect()));
- CPDF_Rect rcPage = pPageView->GetPDFPage()->GetPageBBox();
+ CFX_FloatRect rcFocus = FFLtoWnd(pPageView, PWLtoFFL(pWnd->GetFocusRect()));
+ CFX_FloatRect rcPage = pPageView->GetPDFPage()->GetPageBBox();
if (rcPage.Contains(rcFocus))
return rcFocus;
}
- return CPDF_Rect(0, 0, 0, 0);
+ return CFX_FloatRect(0, 0, 0, 0);
}
-CPDF_Rect CFFL_FormFiller::FFLtoPWL(const CPDF_Rect& rect) {
+CFX_FloatRect CFFL_FormFiller::FFLtoPWL(const CFX_FloatRect& rect) {
CFX_Matrix mt;
mt.SetReverse(GetCurMatrix());
- CPDF_Rect temp = rect;
+ CFX_FloatRect temp = rect;
mt.TransformRect(temp);
return temp;
}
-CPDF_Rect CFFL_FormFiller::PWLtoFFL(const CPDF_Rect& rect) {
+CFX_FloatRect CFFL_FormFiller::PWLtoFFL(const CFX_FloatRect& rect) {
CFX_Matrix mt = GetCurMatrix();
- CPDF_Rect temp = rect;
+ CFX_FloatRect temp = rect;
mt.TransformRect(temp);
return temp;
}
-CPDF_Point CFFL_FormFiller::FFLtoPWL(const CPDF_Point& point) {
+CFX_FloatPoint CFFL_FormFiller::FFLtoPWL(const CFX_FloatPoint& point) {
CFX_Matrix mt;
mt.SetReverse(GetCurMatrix());
- CPDF_Point pt = point;
+ CFX_FloatPoint pt = point;
mt.Transform(pt.x, pt.y);
return pt;
}
-CPDF_Point CFFL_FormFiller::PWLtoFFL(const CPDF_Point& point) {
+CFX_FloatPoint CFFL_FormFiller::PWLtoFFL(const CFX_FloatPoint& point) {
CFX_Matrix mt = GetCurMatrix();
- CPDF_Point pt = point;
+ CFX_FloatPoint pt = point;
mt.Transform(pt.x, pt.y);
return pt;
}
-CPDF_Point CFFL_FormFiller::WndtoPWL(CPDFSDK_PageView* pPageView,
- const CPDF_Point& pt) {
+CFX_FloatPoint CFFL_FormFiller::WndtoPWL(CPDFSDK_PageView* pPageView,
+ const CFX_FloatPoint& pt) {
return FFLtoPWL(pt);
}
-CPDF_Rect CFFL_FormFiller::FFLtoWnd(CPDFSDK_PageView* pPageView,
- const CPDF_Rect& rect) {
+CFX_FloatRect CFFL_FormFiller::FFLtoWnd(CPDFSDK_PageView* pPageView,
+ const CFX_FloatRect& rect) {
return rect;
}
@@ -650,8 +650,8 @@ void CFFL_Button::OnMouseExit(CPDFSDK_PageView* pPageView,
FX_BOOL CFFL_Button::OnLButtonDown(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
FX_UINT nFlags,
- const CPDF_Point& point) {
- CPDF_Rect rcAnnot = pAnnot->GetRect();
+ const CFX_FloatPoint& point) {
+ CFX_FloatRect rcAnnot = pAnnot->GetRect();
if (!rcAnnot.Contains(point.x, point.y))
return FALSE;
@@ -665,8 +665,8 @@ FX_BOOL CFFL_Button::OnLButtonDown(CPDFSDK_PageView* pPageView,
FX_BOOL CFFL_Button::OnLButtonUp(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
FX_UINT nFlags,
- const CPDF_Point& point) {
- CPDF_Rect rcAnnot = pAnnot->GetRect();
+ const CFX_FloatPoint& point) {
+ CFX_FloatRect rcAnnot = pAnnot->GetRect();
if (!rcAnnot.Contains(point.x, point.y))
return FALSE;
@@ -681,7 +681,7 @@ FX_BOOL CFFL_Button::OnLButtonUp(CPDFSDK_PageView* pPageView,
FX_BOOL CFFL_Button::OnMouseMove(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
FX_UINT nFlags,
- const CPDF_Point& point) {
+ const CFX_FloatPoint& point) {
ASSERT(m_pApp);
return TRUE;
diff --git a/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp b/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp
index a5100f6904..21a4bb6ab2 100644
--- a/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp
+++ b/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp
@@ -29,8 +29,8 @@ CFFL_IFormFiller::~CFFL_IFormFiller() {
FX_BOOL CFFL_IFormFiller::Annot_HitTest(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
- CPDF_Point point) {
- CPDF_Rect rc = pAnnot->GetRect();
+ CFX_FloatPoint point) {
+ CFX_FloatRect rc = pAnnot->GetRect();
if (rc.Contains(point.x, point.y))
return TRUE;
return FALSE;
@@ -44,10 +44,10 @@ FX_RECT CFFL_IFormFiller::GetViewBBox(CPDFSDK_PageView* pPageView,
ASSERT(pPageView);
CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot();
- CPDF_Rect rcAnnot;
+ CFX_FloatRect rcAnnot;
pPDFAnnot->GetRect(rcAnnot);
- CPDF_Rect rcWin = CPWL_Utils::InflateRect(rcAnnot, 1);
+ CFX_FloatRect rcWin = CPWL_Utils::InflateRect(rcAnnot, 1);
return rcWin.GetOutterRect();
}
@@ -67,7 +67,7 @@ void CFFL_IFormFiller::OnDraw(CPDFSDK_PageView* pPageView,
CPDFSDK_Document* pDocument = m_pApp->GetSDKDocument();
if (pDocument->GetFocusAnnot() == pAnnot) {
- CPDF_Rect rcFocus = pFormFiller->GetFocusBox(pPageView);
+ CFX_FloatRect rcFocus = pFormFiller->GetFocusBox(pPageView);
if (!rcFocus.IsEmpty()) {
CFX_PathData path;
path.SetPointCount(5);
@@ -196,7 +196,7 @@ void CFFL_IFormFiller::OnMouseExit(CPDFSDK_PageView* pPageView,
FX_BOOL CFFL_IFormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
FX_UINT nFlags,
- const CPDF_Point& point) {
+ const CFX_FloatPoint& point) {
ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
if (!m_bNotifying) {
@@ -238,7 +238,7 @@ FX_BOOL CFFL_IFormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView,
FX_BOOL CFFL_IFormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
FX_UINT nFlags,
- const CPDF_Point& point) {
+ const CFX_FloatPoint& point) {
ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
CPDFSDK_Document* pDocument = m_pApp->GetSDKDocument();
@@ -318,7 +318,7 @@ void CFFL_IFormFiller::OnButtonUp(CPDFSDK_Widget* pWidget,
FX_BOOL CFFL_IFormFiller::OnLButtonDblClk(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
FX_UINT nFlags,
- const CPDF_Point& point) {
+ const CFX_FloatPoint& point) {
ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) {
@@ -331,7 +331,7 @@ FX_BOOL CFFL_IFormFiller::OnLButtonDblClk(CPDFSDK_PageView* pPageView,
FX_BOOL CFFL_IFormFiller::OnMouseMove(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
FX_UINT nFlags,
- const CPDF_Point& point) {
+ const CFX_FloatPoint& point) {
ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
// change cursor
@@ -346,7 +346,7 @@ FX_BOOL CFFL_IFormFiller::OnMouseWheel(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
FX_UINT nFlags,
short zDelta,
- const CPDF_Point& point) {
+ const CFX_FloatPoint& point) {
ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) {
@@ -359,7 +359,7 @@ FX_BOOL CFFL_IFormFiller::OnMouseWheel(CPDFSDK_PageView* pPageView,
FX_BOOL CFFL_IFormFiller::OnRButtonDown(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
FX_UINT nFlags,
- const CPDF_Point& point) {
+ const CFX_FloatPoint& point) {
ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) {
@@ -372,7 +372,7 @@ FX_BOOL CFFL_IFormFiller::OnRButtonDown(CPDFSDK_PageView* pPageView,
FX_BOOL CFFL_IFormFiller::OnRButtonUp(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
FX_UINT nFlags,
- const CPDF_Point& point) {
+ const CFX_FloatPoint& point) {
ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) {
@@ -570,12 +570,12 @@ void CFFL_IFormFiller::QueryWherePopup(void* pPrivateData,
FX_FLOAT& fPopupRet) {
CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
- CPDF_Rect rcPageView(0, 0, 0, 0);
+ CFX_FloatRect rcPageView(0, 0, 0, 0);
rcPageView.right = pData->pWidget->GetPDFPage()->GetPageWidth();
rcPageView.bottom = pData->pWidget->GetPDFPage()->GetPageHeight();
rcPageView.Normalize();
- CPDF_Rect rcAnnot = pData->pWidget->GetRect();
+ CFX_FloatRect rcAnnot = pData->pWidget->GetRect();
FX_FLOAT fTop = 0.0f;
FX_FLOAT fBottom = 0.0f;
diff --git a/fpdfsdk/src/formfiller/FFL_RadioButton.cpp b/fpdfsdk/src/formfiller/FFL_RadioButton.cpp
index 2a742c0a85..845df115ca 100644
--- a/fpdfsdk/src/formfiller/FFL_RadioButton.cpp
+++ b/fpdfsdk/src/formfiller/FFL_RadioButton.cpp
@@ -74,7 +74,7 @@ FX_BOOL CFFL_RadioButton::OnChar(CPDFSDK_Annot* pAnnot,
FX_BOOL CFFL_RadioButton::OnLButtonUp(CPDFSDK_PageView* pPageView,
CPDFSDK_Annot* pAnnot,
FX_UINT nFlags,
- const CPDF_Point& point) {
+ const CFX_FloatPoint& point) {
CFFL_Button::OnLButtonUp(pPageView, pAnnot, nFlags, point);
if (IsValid()) {
diff --git a/fpdfsdk/src/formfiller/FFL_TextField.cpp b/fpdfsdk/src/formfiller/FFL_TextField.cpp
index ca4e07be4d..42f2aad48f 100644
--- a/fpdfsdk/src/formfiller/FFL_TextField.cpp
+++ b/fpdfsdk/src/formfiller/FFL_TextField.cpp
@@ -112,7 +112,7 @@ FX_BOOL CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot,
CPDFSDK_PageView* pPageView = GetCurPageView();
ASSERT(pPageView);
m_bValid = !m_bValid;
- CPDF_Rect rcAnnot = pAnnot->GetRect();
+ CFX_FloatRect rcAnnot = pAnnot->GetRect();
m_pApp->FFI_Invalidate(pAnnot->GetUnderlyingPage(), rcAnnot.left,
rcAnnot.top, rcAnnot.right, rcAnnot.bottom);