Cleanup: Remove dead formfiller code.
authorLei Zhang <thestig@chromium.org>
Mon, 22 Jun 2015 22:09:03 +0000 (15:09 -0700)
committerLei Zhang <thestig@chromium.org>
Mon, 22 Jun 2015 22:09:03 +0000 (15:09 -0700)
R=jam@chromium.org

Review URL: https://codereview.chromium.org/1196853002.

fpdfsdk/include/formfiller/FFL_ComboBox.h
fpdfsdk/include/formfiller/FFL_FormFiller.h
fpdfsdk/include/formfiller/FFL_IFormFiller.h
fpdfsdk/include/formfiller/FFL_TextField.h
fpdfsdk/include/pdfwindow/PWL_Wnd.h
fpdfsdk/src/formfiller/FFL_ComboBox.cpp
fpdfsdk/src/formfiller/FFL_FormFiller.cpp
fpdfsdk/src/formfiller/FFL_IFormFiller.cpp
fpdfsdk/src/formfiller/FFL_TextField.cpp
fpdfsdk/src/pdfwindow/PWL_Wnd.cpp

index e2eb52c..e5c65c2 100644 (file)
@@ -57,10 +57,6 @@ public:
        virtual FX_BOOL                         CanCut(CPDFSDK_Document* pDocument);
        virtual FX_BOOL                         CanPaste(CPDFSDK_Document* pDocument);
 
-       virtual void                            DoCopy(CPDFSDK_Document* pDocument);
-       virtual void                            DoCut(CPDFSDK_Document* pDocument);
-       virtual void                            DoPaste(CPDFSDK_Document* pDocument);
-
 private:
        CFX_WideString                          GetSelectExportText();
 
index 52e1193..f308c20 100644 (file)
@@ -57,14 +57,10 @@ public:
        virtual FX_BOOL                         OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, short zDelta, const CPDF_Point& point);
        virtual FX_BOOL                         OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
        virtual FX_BOOL                         OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
-       virtual FX_BOOL                         OnRButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
 
        virtual FX_BOOL                         OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags);
        virtual FX_BOOL                         OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
 
-       virtual void                            OnDeSelected(CPDFSDK_Annot* pAnnot);
-       virtual void                            OnSelected(CPDFSDK_Annot* pAnnot);
-
        virtual FX_BOOL                         OnSetFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag);
        virtual FX_BOOL                         OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag);
 
index b27d1e6..e553723 100644 (file)
@@ -41,14 +41,10 @@ public:
        virtual FX_BOOL                         OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, short zDelta, const CPDF_Point& point);
        virtual FX_BOOL                         OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
        virtual FX_BOOL                         OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
-       virtual FX_BOOL                         OnRButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point);
 
        virtual FX_BOOL                         OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags);
        virtual FX_BOOL                         OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
 
-       virtual void                            OnDeSelected(CPDFSDK_Annot* pAnnot);
-       virtual void                            OnSelected(CPDFSDK_Annot* pAnnot);
-
        virtual FX_BOOL                         OnSetFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag);
        virtual FX_BOOL                         OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag);
 
@@ -59,23 +55,6 @@ public:
                                                                                FX_BOOL bKeyDown, FX_BOOL & bRC, FX_BOOL & bExit, FX_DWORD nFlag);
        virtual void                            OnAfterKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_BOOL & bExit, FX_DWORD nFlag) ;
 
-       virtual void                            OnSetWindowRect(void* pPrivateData, const CPDF_Rect & rcWindow);
-       virtual void                            OnKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, int32_t nKeyCode, CFX_WideString & strChange,
-                                                                       const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, FX_BOOL & bRC, FX_BOOL & bExit);
-
-       virtual void                            BeforeUndo(CPDFSDK_Document* pDocument);
-       virtual void                            BeforeRedo(CPDFSDK_Document* pDocument);
-       virtual void                            AfterUndo(CPDFSDK_Document* pDocument);
-       virtual void                            AfterRedo(CPDFSDK_Document* pDocument);
-
-       virtual FX_BOOL                         CanCopy(CPDFSDK_Document* pDocument);
-       virtual FX_BOOL                         CanCut(CPDFSDK_Document* pDocument);
-       virtual FX_BOOL                         CanPaste(CPDFSDK_Document* pDocument);
-
-       virtual void                            DoCopy(CPDFSDK_Document* pDocument);
-       virtual void                            DoCut(CPDFSDK_Document* pDocument);
-       virtual void                            DoPaste(CPDFSDK_Document* pDocument);
-
        CFFL_FormFiller*                        GetFormFiller(CPDFSDK_Annot* pAnnot, FX_BOOL bRegister);
        void                                            RemoveFormFiller(CPDFSDK_Annot* pAnnot);
 
@@ -95,8 +74,6 @@ private:
     using CFFL_Widget2Filler = std::map<CPDFSDK_Annot*, CFFL_FormFiller*>;
 
     void UnRegisterFormFiller(CPDFSDK_Annot* pAnnot);
-    void SetFocusAnnotTab(CPDFSDK_Annot* pWidget, FX_BOOL bSameField,
-                          FX_BOOL bNext);
 
     CPDFDoc_Environment* m_pApp;
     CFFL_Widget2Filler m_Maps;
index 0329a9d..10bd5c0 100644 (file)
@@ -60,10 +60,6 @@ public:
        virtual FX_BOOL                         CanCut(CPDFSDK_Document* pDocument);
        virtual FX_BOOL                         CanPaste(CPDFSDK_Document* pDocument);
 
-       virtual void                            DoCopy(CPDFSDK_Document* pDocument);
-       virtual void                            DoCut(CPDFSDK_Document* pDocument);
-       virtual void                            DoPaste(CPDFSDK_Document* pDocument);
-
 private:
        CBA_FontMap*                            m_pFontMap;
        FFL_TextFieldState                      m_State;
index 3ef4e67..c5b6ca4 100644 (file)
@@ -313,7 +313,6 @@ public:
        virtual FX_BOOL                                 OnMButtonDblClk(const CPDF_Point & point, FX_DWORD nFlag);
        virtual FX_BOOL                                 OnMButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
        virtual FX_BOOL                                 OnMButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
-       virtual FX_BOOL                                 OnRButtonDblClk(const CPDF_Point & point, FX_DWORD nFlag);
        virtual FX_BOOL                                 OnRButtonDown(const CPDF_Point & point, FX_DWORD nFlag);
        virtual FX_BOOL                                 OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag);
        virtual FX_BOOL                                 OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag);
index ed38144..5618e8a 100644 (file)
@@ -376,21 +376,6 @@ FX_BOOL    CFFL_ComboBox::CanPaste(CPDFSDK_Document* pDocument)
        return FALSE;
 }
 
-void CFFL_ComboBox::DoCopy(CPDFSDK_Document* pDocument)
-{
-       ASSERT(pDocument != NULL);
-}
-
-void CFFL_ComboBox::DoCut(CPDFSDK_Document* pDocument)
-{
-       ASSERT(pDocument != NULL);
-}
-
-void CFFL_ComboBox::DoPaste(CPDFSDK_Document* pDocument)
-{
-       ASSERT(pDocument != NULL);
-}
-
 void CFFL_ComboBox::OnAddUndo(CPWL_Edit* pEdit)
 {
        ASSERT(pEdit != NULL);
index 6b211f3..1b152d7 100644 (file)
@@ -225,17 +225,6 @@ FX_BOOL    CFFL_FormFiller::OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot*
        return FALSE;
 }
 
-FX_BOOL        CFFL_FormFiller::OnRButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
-{
-       if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE))
-       {
-               pWnd->OnRButtonDblClk(WndtoPWL(pPageView, point),nFlags);
-               return TRUE;
-       }
-
-       return FALSE;
-}
-
 FX_BOOL CFFL_FormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags)
 {
        if (IsValid())
@@ -268,16 +257,6 @@ FX_BOOL    CFFL_FormFiller::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nF
        return FALSE;
 }
 
-void CFFL_FormFiller::OnDeSelected(CPDFSDK_Annot* pAnnot)
-{
-       ASSERT(FALSE);
-}
-
-void CFFL_FormFiller::OnSelected(CPDFSDK_Annot* pAnnot)
-{
-       ASSERT(FALSE);
-}
-
 FX_BOOL        CFFL_FormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag)
 {
        CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
@@ -287,8 +266,6 @@ FX_BOOL     CFFL_FormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag)
        CPDFSDK_PageView* pPageView = pDoc->GetPageView(pPage);
        ASSERT(pPageView != NULL);
 
-
-
        CPWL_Wnd * pWnd = NULL;
        if ( (pWnd = GetPDFWindow(pPageView, TRUE)))
        {
@@ -296,11 +273,6 @@ FX_BOOL    CFFL_FormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag)
        }
 
        m_bValid = TRUE;
-
-
-
-
-       m_bValid = TRUE;
        FX_RECT rcRect = GetViewBBox(pPageView,pAnnot);
        InvalidateRect(rcRect.left, rcRect.top, rcRect.right, rcRect.bottom);
 
index 62090a5..078dd13 100644 (file)
@@ -443,19 +443,6 @@ FX_BOOL    CFFL_IFormFiller::OnRButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot
        return FALSE;
 }
 
-FX_BOOL        CFFL_IFormFiller::OnRButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
-{
-       ASSERT(pAnnot != NULL);
-       ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
-
-       if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
-       {
-               return pFormFiller->OnRButtonDblClk(pPageView, pAnnot, nFlags, point);
-       }
-
-       return FALSE;
-}
-
 FX_BOOL        CFFL_IFormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags)
 {
        ASSERT(pAnnot != NULL);
@@ -484,28 +471,6 @@ FX_BOOL    CFFL_IFormFiller::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT n
        return FALSE;
 }
 
-void CFFL_IFormFiller::OnDeSelected(CPDFSDK_Annot* pAnnot)
-{
-       ASSERT(pAnnot != NULL);
-       ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
-
-       if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
-       {
-               pFormFiller->OnDeSelected(pAnnot);
-       }
-}
-
-void CFFL_IFormFiller::OnSelected(CPDFSDK_Annot* pAnnot)
-{
-       ASSERT(pAnnot != NULL);
-       ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
-
-       if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE))
-       {
-               pFormFiller->OnSelected(pAnnot);
-       }
-}
-
 FX_BOOL CFFL_IFormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag)
 {
        if(!pAnnot) return FALSE;
@@ -699,11 +664,6 @@ void CFFL_IFormFiller::UnRegisterFormFiller(CPDFSDK_Annot* pAnnot)
     m_Maps.erase(it);
 }
 
-void CFFL_IFormFiller::SetFocusAnnotTab(CPDFSDK_Annot* pWidget, FX_BOOL bSameField, FX_BOOL bNext)
-{
-
-}
-
 void CFFL_IFormFiller::QueryWherePopup(void* pPrivateData, FX_FLOAT fPopupMin,FX_FLOAT fPopupMax, int32_t & nRet, FX_FLOAT & fPopupRet)
 {
        ASSERT(pPrivateData != NULL);
@@ -795,44 +755,6 @@ void CFFL_IFormFiller::QueryWherePopup(void* pPrivateData, FX_FLOAT fPopupMin,FX
        fPopupRet = fFactHeight;
 }
 
-void CFFL_IFormFiller::OnSetWindowRect(void* pPrivateData, const CPDF_Rect & rcWindow)
-{
-       ASSERT(pPrivateData != NULL);
-
-       CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
-
-       if (CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, TRUE))
-       {
-
-               CPDF_Rect rcOld = pFormFiller->PWLtoFFL(pFormFiller->GetWindowRect(pData->pPageView));
-               CPDF_Rect rcNew = pFormFiller->PWLtoFFL(rcWindow);
-               pFormFiller->SetWindowRect(pData->pPageView, rcWindow);
-
-               CPDF_Rect unRect = rcOld;
-               unRect.Union(rcNew);
-               //FX_RECT rcRect = unRect.GetOutterRect();
-               unRect.left = (FX_FLOAT)(unRect.left - 0.5);
-               unRect.right = (FX_FLOAT)(unRect.right + 0.5);
-               unRect.top = (FX_FLOAT)(unRect.top + 0.5);
-               unRect.bottom = (FX_FLOAT)(unRect.bottom -0.5);
-               m_pApp->FFI_Invalidate(pData->pWidget->GetPDFPage(), unRect.left, unRect.top, unRect.right, unRect.bottom);
-       }
-}
-
-void CFFL_IFormFiller::OnKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, int32_t nKeyCode, CFX_WideString& strChange,
-                                                                  const CFX_WideString& strChangeEx, FX_BOOL bKeyDown,
-                                                                  FX_BOOL & bRC, FX_BOOL & bExit)
-{
-       ASSERT(pPrivateData != NULL);
-       CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
-       ASSERT(pData->pWidget != NULL);
-
-       CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, FALSE);
-       ASSERT(pFormFiller != NULL);
-
-       pFormFiller->OnKeyStroke(bKeyDown);
-}
-
 void CFFL_IFormFiller::OnKeyStrokeCommit(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bRC, FX_BOOL& bExit, FX_DWORD nFlag)
 {
        if (!m_bNotifying)
@@ -844,10 +766,6 @@ void CFFL_IFormFiller::OnKeyStrokeCommit(CPDFSDK_Widget* pWidget, CPDFSDK_PageVi
                        pWidget->ClearAppModified();
 
                        ASSERT(pPageView != NULL);
-//                     CReader_DocView* pDocView = pPageView->GetDocView();
-//                     ASSERT(pDocView != NULL);
-
-
 
                        PDFSDK_FieldAction fa;
                        fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
@@ -977,54 +895,6 @@ FX_BOOL    CFFL_IFormFiller::IsValidAnnot(CPDFSDK_PageView* pPageView, CPDFSDK_Anno
                return FALSE;
 }
 
-void CFFL_IFormFiller::BeforeUndo(CPDFSDK_Document* pDocument)
-{
-
-}
-
-void CFFL_IFormFiller::BeforeRedo(CPDFSDK_Document* pDocument)
-{
-       BeforeUndo(pDocument);
-}
-
-void CFFL_IFormFiller::AfterUndo(CPDFSDK_Document* pDocument)
-{
-}
-
-void CFFL_IFormFiller::AfterRedo(CPDFSDK_Document* pDocument)
-{
-}
-
-FX_BOOL        CFFL_IFormFiller::CanCopy(CPDFSDK_Document* pDocument)
-{
-
-       return FALSE;
-}
-
-FX_BOOL        CFFL_IFormFiller::CanCut(CPDFSDK_Document* pDocument)
-{
-
-       return FALSE;
-}
-
-FX_BOOL        CFFL_IFormFiller::CanPaste(CPDFSDK_Document* pDocument)
-{
-
-       return FALSE;
-}
-
-void CFFL_IFormFiller::DoCopy(CPDFSDK_Document* pDocument)
-{
-}
-
-void CFFL_IFormFiller::DoCut(CPDFSDK_Document* pDocument)
-{
-}
-
-void CFFL_IFormFiller::DoPaste(CPDFSDK_Document* pDocument)
-{
-
-}
 void CFFL_IFormFiller::OnBeforeKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, int32_t nKeyCode,
                                                                                          CFX_WideString & strChange, const CFX_WideString& strChangeEx,
                                                                                          int nSelStart, int nSelEnd,
index ff3bcaf..ed155fb 100644 (file)
@@ -361,20 +361,6 @@ FX_BOOL    CFFL_TextField::CanPaste(CPDFSDK_Document* pDocument)
        return FALSE;
 }
 
-void CFFL_TextField::DoCopy(CPDFSDK_Document* pDocument)
-{
-
-}
-
-void CFFL_TextField::DoCut(CPDFSDK_Document* pDocument)
-{
-}
-
-void CFFL_TextField::DoPaste(CPDFSDK_Document* pDocument)
-{
-
-}
-
 void CFFL_TextField::OnAddUndo(CPWL_Edit* pEdit)
 {
 }
index 89d4bab..cf6e6a1 100644 (file)
@@ -563,7 +563,6 @@ PWL_IMPLEMENT_MOUSE_METHOD(OnLButtonUp)
 PWL_IMPLEMENT_MOUSE_METHOD(OnMButtonDblClk)
 PWL_IMPLEMENT_MOUSE_METHOD(OnMButtonDown)
 PWL_IMPLEMENT_MOUSE_METHOD(OnMButtonUp)
-PWL_IMPLEMENT_MOUSE_METHOD(OnRButtonDblClk)
 PWL_IMPLEMENT_MOUSE_METHOD(OnRButtonDown)
 PWL_IMPLEMENT_MOUSE_METHOD(OnRButtonUp)
 PWL_IMPLEMENT_MOUSE_METHOD(OnMouseMove)