summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/formfiller
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-02-26 13:17:56 -0800
committerTom Sepez <tsepez@chromium.org>2016-02-26 13:17:56 -0800
commit566b974287ce0e81a963138152b8898f22480f52 (patch)
treeb85991aee92475549d84e8cb68702960b85d1252 /fpdfsdk/src/formfiller
parent3b8fdd34bdf57ec45291b77008a43249f838efcb (diff)
downloadpdfium-566b974287ce0e81a963138152b8898f22480f52.tar.xz
Revert "Replace CPDF_Rect and CPDF_Point with CFX types."
This reverts commit 3b8fdd34bdf57ec45291b77008a43249f838efcb. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1743753002 .
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 78a689af64..f76613ed3f 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 CFX_FloatPoint& point) {
+ const CPDF_Point& 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 e596ba08ba..ce73f7d4cb 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 CFX_FloatRect& rcWindow) {
+ const CPDF_Rect& rcWindow) {
if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) {
- pWnd->Move(CFX_FloatRect(rcWindow), TRUE, FALSE);
+ pWnd->Move(CPDF_Rect(rcWindow), TRUE, FALSE);
}
}
-CFX_FloatRect CFFL_FormFiller::GetWindowRect(CPDFSDK_PageView* pPageView) {
+CPDF_Rect CFFL_FormFiller::GetWindowRect(CPDFSDK_PageView* pPageView) {
if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) {
return pWnd->GetWindowRect();
}
- return CFX_FloatRect(0, 0, 0, 0);
+ return CPDF_Rect(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);
- CFX_FloatRect rcAnnot = m_pWidget->GetRect();
+ CPDF_Rect rcAnnot = m_pWidget->GetRect();
if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) {
- CFX_FloatRect rcWindow = pWnd->GetWindowRect();
+ CPDF_Rect rcWindow = pWnd->GetWindowRect();
rcAnnot = PWLtoFFL(rcWindow);
}
- CFX_FloatRect rcWin = rcAnnot;
+ CPDF_Rect rcWin = rcAnnot;
- CFX_FloatRect rcFocus = GetFocusBox(pPageView);
+ CPDF_Rect rcFocus = GetFocusBox(pPageView);
if (!rcFocus.IsEmpty())
rcWin.Union(rcFocus);
- CFX_FloatRect rect = CPWL_Utils::InflateRect(rcWin, 1);
+ CPDF_Rect 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 CFX_FloatPoint& point) {
+ const CPDF_Point& 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 CFX_FloatPoint& point) {
+ const CPDF_Point& 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 CFX_FloatPoint& point) {
+ const CPDF_Point& 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 CFX_FloatPoint& point) {
+ const CPDF_Point& 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 CFX_FloatPoint& point) {
+ const CPDF_Point& 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 CFX_FloatPoint& point) {
+ const CPDF_Point& 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 CFX_FloatPoint& point) {
+ const CPDF_Point& 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;
- CFX_FloatRect rcDA;
+ CPDF_Rect rcDA;
m_pWidget->GetPDFAnnot()->GetRect(rcDA);
switch (m_pWidget->GetRotate()) {
@@ -451,16 +451,16 @@ CFX_WideString CFFL_FormFiller::LoadPopupMenuString(int nIndex) {
return L"";
}
-CFX_FloatRect CFFL_FormFiller::GetPDFWindowRect() const {
- CFX_FloatRect rectAnnot;
+CPDF_Rect CFFL_FormFiller::GetPDFWindowRect() const {
+ CPDF_Rect 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 CFX_FloatRect(0, 0, fHeight, fWidth);
+ return CPDF_Rect(0, 0, fHeight, fWidth);
- return CFX_FloatRect(0, 0, fWidth, fHeight);
+ return CPDF_Rect(0, 0, fWidth, fHeight);
}
CPDFSDK_PageView* CFFL_FormFiller::GetCurPageView() {
@@ -469,61 +469,61 @@ CPDFSDK_PageView* CFFL_FormFiller::GetCurPageView() {
return pSDKDoc ? pSDKDoc->GetPageView(pPage) : nullptr;
}
-CFX_FloatRect CFFL_FormFiller::GetFocusBox(CPDFSDK_PageView* pPageView) {
+CPDF_Rect CFFL_FormFiller::GetFocusBox(CPDFSDK_PageView* pPageView) {
if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) {
- CFX_FloatRect rcFocus = FFLtoWnd(pPageView, PWLtoFFL(pWnd->GetFocusRect()));
- CFX_FloatRect rcPage = pPageView->GetPDFPage()->GetPageBBox();
+ CPDF_Rect rcFocus = FFLtoWnd(pPageView, PWLtoFFL(pWnd->GetFocusRect()));
+ CPDF_Rect rcPage = pPageView->GetPDFPage()->GetPageBBox();
if (rcPage.Contains(rcFocus))
return rcFocus;
}
- return CFX_FloatRect(0, 0, 0, 0);
+ return CPDF_Rect(0, 0, 0, 0);
}
-CFX_FloatRect CFFL_FormFiller::FFLtoPWL(const CFX_FloatRect& rect) {
+CPDF_Rect CFFL_FormFiller::FFLtoPWL(const CPDF_Rect& rect) {
CFX_Matrix mt;
mt.SetReverse(GetCurMatrix());
- CFX_FloatRect temp = rect;
+ CPDF_Rect temp = rect;
mt.TransformRect(temp);
return temp;
}
-CFX_FloatRect CFFL_FormFiller::PWLtoFFL(const CFX_FloatRect& rect) {
+CPDF_Rect CFFL_FormFiller::PWLtoFFL(const CPDF_Rect& rect) {
CFX_Matrix mt = GetCurMatrix();
- CFX_FloatRect temp = rect;
+ CPDF_Rect temp = rect;
mt.TransformRect(temp);
return temp;
}
-CFX_FloatPoint CFFL_FormFiller::FFLtoPWL(const CFX_FloatPoint& point) {
+CPDF_Point CFFL_FormFiller::FFLtoPWL(const CPDF_Point& point) {
CFX_Matrix mt;
mt.SetReverse(GetCurMatrix());
- CFX_FloatPoint pt = point;
+ CPDF_Point pt = point;
mt.Transform(pt.x, pt.y);
return pt;
}
-CFX_FloatPoint CFFL_FormFiller::PWLtoFFL(const CFX_FloatPoint& point) {
+CPDF_Point CFFL_FormFiller::PWLtoFFL(const CPDF_Point& point) {
CFX_Matrix mt = GetCurMatrix();
- CFX_FloatPoint pt = point;
+ CPDF_Point pt = point;
mt.Transform(pt.x, pt.y);
return pt;
}
-CFX_FloatPoint CFFL_FormFiller::WndtoPWL(CPDFSDK_PageView* pPageView,
- const CFX_FloatPoint& pt) {
+CPDF_Point CFFL_FormFiller::WndtoPWL(CPDFSDK_PageView* pPageView,
+ const CPDF_Point& pt) {
return FFLtoPWL(pt);
}
-CFX_FloatRect CFFL_FormFiller::FFLtoWnd(CPDFSDK_PageView* pPageView,
- const CFX_FloatRect& rect) {
+CPDF_Rect CFFL_FormFiller::FFLtoWnd(CPDFSDK_PageView* pPageView,
+ const CPDF_Rect& 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 CFX_FloatPoint& point) {
- CFX_FloatRect rcAnnot = pAnnot->GetRect();
+ const CPDF_Point& point) {
+ CPDF_Rect 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 CFX_FloatPoint& point) {
- CFX_FloatRect rcAnnot = pAnnot->GetRect();
+ const CPDF_Point& point) {
+ CPDF_Rect 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 CFX_FloatPoint& point) {
+ const CPDF_Point& point) {
ASSERT(m_pApp);
return TRUE;
diff --git a/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp b/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp
index 21a4bb6ab2..a5100f6904 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,
- CFX_FloatPoint point) {
- CFX_FloatRect rc = pAnnot->GetRect();
+ CPDF_Point point) {
+ CPDF_Rect 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();
- CFX_FloatRect rcAnnot;
+ CPDF_Rect rcAnnot;
pPDFAnnot->GetRect(rcAnnot);
- CFX_FloatRect rcWin = CPWL_Utils::InflateRect(rcAnnot, 1);
+ CPDF_Rect 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) {
- CFX_FloatRect rcFocus = pFormFiller->GetFocusBox(pPageView);
+ CPDF_Rect 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 CFX_FloatPoint& point) {
+ const CPDF_Point& 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 CFX_FloatPoint& point) {
+ const CPDF_Point& 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 CFX_FloatPoint& point) {
+ const CPDF_Point& 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 CFX_FloatPoint& point) {
+ const CPDF_Point& 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 CFX_FloatPoint& point) {
+ const CPDF_Point& 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 CFX_FloatPoint& point) {
+ const CPDF_Point& 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 CFX_FloatPoint& point) {
+ const CPDF_Point& 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;
- CFX_FloatRect rcPageView(0, 0, 0, 0);
+ CPDF_Rect rcPageView(0, 0, 0, 0);
rcPageView.right = pData->pWidget->GetPDFPage()->GetPageWidth();
rcPageView.bottom = pData->pWidget->GetPDFPage()->GetPageHeight();
rcPageView.Normalize();
- CFX_FloatRect rcAnnot = pData->pWidget->GetRect();
+ CPDF_Rect 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 845df115ca..2a742c0a85 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 CFX_FloatPoint& point) {
+ const CPDF_Point& 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 42f2aad48f..ca4e07be4d 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;
- CFX_FloatRect rcAnnot = pAnnot->GetRect();
+ CPDF_Rect rcAnnot = pAnnot->GetRect();
m_pApp->FFI_Invalidate(pAnnot->GetUnderlyingPage(), rcAnnot.left,
rcAnnot.top, rcAnnot.right, rcAnnot.bottom);