[Libreoffice-commits] .: sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Wed Jan 12 10:32:04 PST 2011


 sc/source/ui/dbgui/validate.cxx |    4 +-
 sc/source/ui/inc/anyrefdg.hxx   |   32 ++++++++---------------
 sc/source/ui/inc/validate.hxx   |   55 ++++++++++------------------------------
 3 files changed, 28 insertions(+), 63 deletions(-)

New commits:
commit f794593f0426e4d43eb22ed9702a8fe1eae02c73
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Jan 12 13:29:17 2011 -0500

    De-contaminated code base a bit.
    
    What's up with these useless comments anyway?  Also, don't be lazy
    and replace all ScRef* with formula::Ref* *when* the classes get
    relocated, not after.

diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx
index be4cca0..e2b3341 100644
--- a/sc/source/ui/dbgui/validate.cxx
+++ b/sc/source/ui/dbgui/validate.cxx
@@ -112,7 +112,7 @@ void ScTPValidationValue:: SetActiveHdl()
         }
 }
 
-void			ScTPValidationValue::RefInputStartPreHdl( ScRefEdit* pEdit, ScRefButton* pButton )
+void			ScTPValidationValue::RefInputStartPreHdl( formula::RefEdit* pEdit, formula::RefButton* pButton )
 {
     if ( ScValidationDlg *pValidationDlg = GetValidationDlg() )
     {
@@ -970,7 +970,7 @@ void ScTPValidationValue::ScRefButtonEx::Click()
     if( ScTPValidationValue *pParent = dynamic_cast< ScTPValidationValue*>( GetParent() ) )
         pParent->OnClick( this );
         
-    ScRefButton::Click();
+    formula::RefButton::Click();
 }
 
 void ScTPValidationValue::OnClick( Button *pBtn )
diff --git a/sc/source/ui/inc/anyrefdg.hxx b/sc/source/ui/inc/anyrefdg.hxx
index 9695abb..7e57f2b 100644
--- a/sc/source/ui/inc/anyrefdg.hxx
+++ b/sc/source/ui/inc/anyrefdg.hxx
@@ -33,29 +33,25 @@
 #include <vcl/edit.hxx>
 #include <vcl/accel.hxx>
 #include <sfx2/basedlgs.hxx>
+#include <sfx2/tabdlg.hxx>
 #include "address.hxx"
 #include "cell.hxx"
 #include "compiler.hxx"
 #include "formula/funcutl.hxx"
 #include "IAnyRefDialog.hxx"
 #include "scresid.hxx"
+#include "scmod.hxx"
+
 #include <memory>
 
 class SfxObjectShell;
 class ScRange;
 class ScDocument;
 class ScTabViewShell;
-//The class of ScAnyRefDlg is rewritten by PengYunQuan for Validity Cell Range Picker
-//class ScAnyRefDlg;
 class ScRefHandler;
 class ScRangeList;
-//<!--Added by PengYunQuan for Validity Cell Range Picker
 class SfxShell;
-#include "scmod.hxx"
 
-typedef    formula::RefButton	ScRefButton;
-typedef        formula::RefEdit	ScRefEdit;
-//-->Added by PengYunQuan for Validity Cell Range Picker
 class ScFormulaReferenceHelper
 {
     IAnyRefDialog*      m_pDlg;
@@ -105,28 +101,27 @@ public:
     void                ViewShellChanged( ScTabViewShell* pScViewShell );
 
     static              void enableInput(BOOL _bInput);
-//<!--Added by PengYunQuan for Validity Cell Range Picker
+
 protected:
     Window		*		GetWindow(){ return m_pWindow; }
+
 public:
-    bool				CanInputStart( const ScRefEdit *pEdit ){ return !!pEdit; }
+    bool				CanInputStart( const formula::RefEdit *pEdit ){ return !!pEdit; }
     bool				CanInputDone( BOOL bForced ){	return pRefEdit && (bForced || !pRefBtn);	}
-//<!--Added by PengYunQuan for Validity Cell Range Picker
 };
+
 //============================================================================
 
-//The class of ScAnyRefDlg is rewritten by PengYunQuan for Validity Cell Range Picker
 class SC_DLLPUBLIC ScRefHandler : //public SfxModelessDialog,
                     public IAnyRefDialog
 {
-//<!--Added by PengYunQuan for Validity Cell Range Picker
     Window &	m_rWindow;
     bool		m_bInRefMode;
+
 public:
     operator Window	*(){ return &m_rWindow; }
     Window	* operator ->() { return static_cast<Window	*>(*this); }
     template<class,bool> friend class ScRefHdlrImplBase;
-//-->Added by PengYunQuan for Validity Cell Range Picker
     friend class        formula::RefButton;
     friend class        formula::RefEdit;
 
@@ -184,18 +179,15 @@ public:
     //Overwrite TWindow will implemented by ScRefHdlrImplBase
     //virtual void        StateChanged( StateChangedType nStateChange );
 
-//<!--Added by PengYunQuan for Validity Cell Range Picker
 public:
     bool                EnterRefMode();
     bool                LeaveRefMode();
-    inline	bool		CanInputStart( const ScRefEdit *pEdit );
+    inline	bool		CanInputStart( const formula::RefEdit *pEdit );
     inline	bool		CanInputDone( BOOL bForced );
-//-->Added by PengYunQuan for Validity Cell Range Picker
 };
 
-
 //============================================================================
-//<!--Added by PengYunQuan for Validity Cell Range Picker
+
 template<  class TWindow, bool bBindRef = true >
 class ScRefHdlrImplBase:public TWindow, public ScRefHandler
 {
@@ -255,7 +247,7 @@ struct ScAnyRefDlg : ::ScRefHdlrImpl< ScAnyRefDlg, SfxModelessDialog>
 };
 //============================================================================
 
-inline bool ScRefHandler::CanInputStart( const ScRefEdit *pEdit )
+inline bool ScRefHandler::CanInputStart( const formula::RefEdit *pEdit )
 {
     return m_aHelper.CanInputStart( pEdit );
 }
@@ -267,11 +259,9 @@ inline	bool ScRefHandler::CanInputDone( BOOL bForced )
 
 template <> SC_DLLPUBLIC void ScRefHdlrImplBase<SfxModelessDialog,true>::StateChanged( StateChangedType nStateChange );
 template <> SC_DLLPUBLIC long ScRefHdlrImplBase<SfxModelessDialog,true>::PreNotify( NotifyEvent& rNEvt );
-#include <sfx2/tabdlg.hxx>
 template <> SC_DLLPUBLIC void ScRefHdlrImplBase<SfxTabDialog,false>::StateChanged( StateChangedType nStateChange );
 template <> SC_DLLPUBLIC long ScRefHdlrImplBase<SfxTabDialog,false>::PreNotify( NotifyEvent& rNEvt );
 
-//<!--Added by PengYunQuan for Validity Cell Range Picker
 #endif // SC_ANYREFDG_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/validate.hxx b/sc/source/ui/inc/validate.hxx
index 19dd63b..538b3de 100644
--- a/sc/source/ui/inc/validate.hxx
+++ b/sc/source/ui/inc/validate.hxx
@@ -34,13 +34,11 @@
 #include <vcl/fixed.hxx>
 #include <vcl/lstbox.hxx>
 #include <svtools/svmedit.hxx>
-//<!--Added by PengYunQuan for Validity Cell Range Picker
+
 #include "anyrefdg.hxx"
-//-->Added by PengYunQuan for Validity Cell Range Picker
 
 // ============================================================================
 
-//<!--Added by PengYunQuan for Validity Cell Range Picker
 struct	ScRefHandlerCaller{
     virtual ~ScRefHandlerCaller(){}
 };
@@ -50,15 +48,15 @@ protected:
     ScRefHandlerCaller	*m_pHandler;
     void            (ScRefHandlerCaller::*m_pSetReferenceHdl)( const ScRange& , ScDocument* );
     void            (ScRefHandlerCaller::*m_pSetActiveHdl)();
-    void            (ScRefHandlerCaller::*m_pRefInputStartPreHdl)( ScRefEdit* pEdit, ScRefButton* pButton );
-    void            (ScRefHandlerCaller::*m_pRefInputStartPostHdl)( ScRefEdit* pEdit, ScRefButton* pButton );
+    void            (ScRefHandlerCaller::*m_pRefInputStartPreHdl)( formula::RefEdit* pEdit, formula::RefButton* pButton );
+    void            (ScRefHandlerCaller::*m_pRefInputStartPostHdl)( formula::RefEdit* pEdit, formula::RefButton* pButton );
     void            (ScRefHandlerCaller::*m_pRefInputDonePreHdl)();
     void            (ScRefHandlerCaller::*m_pRefInputDonePostHdl)();
     
 public:
     typedef void            (ScRefHandlerCaller::*PFUNCSETREFHDLTYPE)( const ScRange& , ScDocument* );
     typedef void			(ScRefHandlerCaller::*PCOMMONHDLTYPE)();
-    typedef void			(ScRefHandlerCaller::*PINPUTSTARTDLTYPE)(  ScRefEdit* pEdit, ScRefButton* pButton );
+    typedef void			(ScRefHandlerCaller::*PINPUTSTARTDLTYPE)(  formula::RefEdit* pEdit, formula::RefButton* pButton );
 
     PFUNCSETREFHDLTYPE	SetSetRefHdl(  PFUNCSETREFHDLTYPE pNewHdl )
     {
@@ -87,33 +85,23 @@ public:
 
     ScRefHandlerHelper():m_pHandler(NULL), m_pSetReferenceHdl( NULL ), m_pSetActiveHdl(NULL),  m_pRefInputStartPreHdl( NULL ), m_pRefInputStartPostHdl( NULL ), m_pRefInputDonePreHdl( NULL ),	m_pRefInputDonePostHdl( NULL ){}
 };
-//-->Added by PengYunQuan for Validity Cell Range Picker
 
 /** The "Validity" tab dialog. */
-//<!--Modified by PengYunQuan for Validity Cell Range Picker
-//class ScValidationDlg : public SfxTabDialog
 class ScValidationDlg :public ScRefHdlrImpl<ScValidationDlg, SfxTabDialog, false>, public ScRefHandlerHelper
-//-->Modified by PengYunQuan for Validity Cell Range Picker
 {
-    //<!--Added by PengYunQuan for Validity Cell Range Picker
     typedef ScRefHdlrImpl<ScValidationDlg, SfxTabDialog, false>	ScValidationDlgBase;
 
-    //Start_Moddify by liliang 03/26/2008 SODC_13677_2
     DECL_LINK( OkHdl, Button * );
-    //End_Moddify by liliang 03/26/2008 SODC_13677_2
+
     bool	m_bOwnRefHdlr:1;
 
     ScTabViewShell *m_pTabVwSh;
     bool	m_bRefInputting:1;
     bool	EnterRefStatus();
     bool	LeaveRefStatus();
-    //-->Added by PengYunQuan for Validity Cell Range Picker
+
 public:
-    //<!--Modified by PengYunQuan for Validity Cell Range Picker
-    //explicit                    ScValidationDlg( Window* pParent, const SfxItemSet* pArgSet );
     explicit ScValidationDlg( Window* pParent, const SfxItemSet* pArgSet, ScTabViewShell * pTabViewSh, SfxBindings *pB = NULL );
-    //-->Modified by PengYunQuan for Validity Cell Range Picker
-    //<!--Added by PengYunQuan for Validity Cell Range Picker
     virtual                     ~ScValidationDlg();
     inline static ScValidationDlg * Find1AliveObject( Window *pAncestor );
     bool	IsAlive();
@@ -148,7 +136,7 @@ public:
 
     bool IsRefInputting(){	return m_bRefInputting;	}
 
-    virtual void        RefInputStart( ScRefEdit* pEdit, ScRefButton* pButton = NULL )
+    virtual void        RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL )
     {
         if( !CanInputStart( pEdit ) )
             return;
@@ -181,17 +169,13 @@ public:
     enum { SLOTID = SID_VALIDITY_REFERENCE };
 
     BOOL Close();
-    //-->Added by PengYunQuan for Validity Cell Range Picker
 };
 
 
 // ============================================================================
 
 /** The tab page "Criteria" from the Validation dialog. */
-//<!--Modified by PengYunQuan for Validity Cell Range Picker
-//class ScTPValidationValue : public SfxTabPage
 class ScTPValidationValue : public ScRefHandlerCaller, public SfxTabPage
-//-->Modified by PengYunQuan for Validity Cell Range Picker
 {
 public:
     explicit                    ScTPValidationValue( Window* pParent, const SfxItemSet& rArgSet );
@@ -223,16 +207,10 @@ private:
     FixedText                   maFtValue;
     ListBox                     maLbValue;
     FixedText                   maFtMin;
-    //<!--Modified by PengYunQuan for Validity Cell Range Picker
-    //Edit                        maEdMin;
-    ScRefEdit                        maEdMin;
-    //-->Modified by PengYunQuan for Validity Cell Range Picker
+    formula::RefEdit            maEdMin;
     MultiLineEdit               maEdList;       /// Entries for explicit list
     FixedText                   maFtMax;
-    //<!--Modified by PengYunQuan for Validity Cell Range Picker
-    //Edit                        maEdMax;
-    ScRefEdit                        maEdMax;
-    //-->Modified by PengYunQuan for Validity Cell Range Picker
+    formula::RefEdit            maEdMax;
     FixedText                   maFtHint;       /// Hint text for cell range validity.
 
     String                      maStrMin;
@@ -241,33 +219,31 @@ private:
     String                      maStrRange;
     String                      maStrList;
     sal_Unicode                 mcFmlaSep;      /// List separator in formulas.
-    //<!--Added by PengYunQuan for Validity Cell Range Picker
+
     DECL_LINK( EditSetFocusHdl, Edit *);
     DECL_LINK( KillFocusHdl, Window *);
     void	OnClick( Button *pBtn );
-    ScRefEdit	*m_pRefEdit;
-    class ScRefButtonEx:public ::ScRefButton
+    formula::RefEdit*           m_pRefEdit;
+    class ScRefButtonEx:public ::formula::RefButton
     {
         void Click();
     public:
-        ScRefButtonEx( Window* pParent, const ResId& rResId, ScRefEdit* pEdit = NULL, ScRefHandler *pRefHdlr = NULL ): ::ScRefButton( pParent, rResId, pEdit, pRefHdlr ){}
+        ScRefButtonEx( Window* pParent, const ResId& rResId, formula::RefEdit* pEdit = NULL, ScRefHandler *pRefHdlr = NULL ): ::formula::RefButton( pParent, rResId, pEdit, pRefHdlr ){}
     }m_btnRef;
     friend class ScRefButtonEx;
     void            SetReferenceHdl( const ScRange& , ScDocument* );
     void            SetActiveHdl();
-    void			RefInputStartPreHdl( ScRefEdit* pEdit, ScRefButton* pButton );
+    void			RefInputStartPreHdl( formula::RefEdit* pEdit, formula::RefButton* pButton );
     void			RefInputDonePreHdl();
     void			RefInputDonePostHdl();
     ScValidationDlg * GetValidationDlg();
 
-    //TYPEINFO();
     void			TidyListBoxes();
 public:
     USHORT			GetAllowEntryPos();
     String			GetMinText();
     void	SetupRefDlg();
     void	RemoveRefDlg();
-    //-->Added by PengYunQuan for Validity Cell Range Picker
 };
 
 
@@ -333,7 +309,6 @@ public:
     virtual	void		Reset		( const SfxItemSet& rArgSet );
 };
 
-//<!--Added by PengYunQuan for Validity Cell Range Picker
 inline ScTabViewShell *ScValidationDlg::GetTabViewShell()
 {
     return m_pTabVwSh;
@@ -343,7 +318,7 @@ inline ScValidationDlg * ScValidationDlg::Find1AliveObject( Window *pAncestor )
 {
     return static_cast<ScValidationDlg *>( SC_MOD()->Find1RefWindow( SLOTID, pAncestor ) );
 }
-//-->Added by PengYunQuan for Validity Cell Range Picker
+
 #endif // SC_VALIDATE_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list