Kaydet (Commit) d8acdc5f authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Some cleanups & removed lazy macros.

üst a74bb447
...@@ -690,7 +690,7 @@ IMPL_LINK( ScDbNameDlg, NameModifyHdl, void *, EMPTYARG ) ...@@ -690,7 +690,7 @@ IMPL_LINK( ScDbNameDlg, NameModifyHdl, void *, EMPTYARG )
//@BugID 54702 Enablen/Disablen nur noch in Basisklasse //@BugID 54702 Enablen/Disablen nur noch in Basisklasse
//SFX_APPWINDOW->Enable(); //SFX_APPWINDOW->Enable();
bRefInputMode = sal_True; bRefInputMode = true;
} }
return 0; return 0;
} }
......
...@@ -103,7 +103,20 @@ ScFilterDlg::ScFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, ...@@ -103,7 +103,20 @@ ScFilterDlg::ScFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
aBtnHelp ( this, ScResId( BTN_HELP ) ), aBtnHelp ( this, ScResId( BTN_HELP ) ),
aBtnOk ( this, ScResId( BTN_OK ) ), aBtnOk ( this, ScResId( BTN_OK ) ),
aBtnCancel ( this, ScResId( BTN_CANCEL ) ), aBtnCancel ( this, ScResId( BTN_CANCEL ) ),
_INIT_COMMON_FILTER_RSCOBJS aBtnCase ( this, ScResId( BTN_CASE ) ),
aBtnRegExp ( this, ScResId( BTN_REGEXP ) ),
aBtnHeader ( this, ScResId( BTN_HEADER ) ),
aBtnUnique ( this, ScResId( BTN_UNIQUE ) ),
aBtnCopyResult ( this, ScResId( BTN_COPY_RESULT ) ),
aLbCopyArea ( this, ScResId( LB_COPY_AREA ) ),
aEdCopyArea ( this, this, ScResId( ED_COPY_AREA ) ),
aRbCopyArea ( this, ScResId( RB_COPY_AREA ) ),
aBtnDestPers ( this, ScResId( BTN_DEST_PERS ) ),
aFtDbAreaLabel ( this, ScResId( FT_DBAREA_LABEL ) ),
aFtDbArea ( this, ScResId( FT_DBAREA ) ),
aStrUndefined ( ScResId( SCSTR_UNDEFINED ) ),
aStrNoName ( ScGlobal::GetRscString(STR_DB_NONAME) ),
aStrNone ( ScResId( SCSTR_NONE ) ),
aStrEmpty ( ScResId( SCSTR_EMPTY ) ), aStrEmpty ( ScResId( SCSTR_EMPTY ) ),
aStrNotEmpty ( ScResId( SCSTR_NOTEMPTY ) ), aStrNotEmpty ( ScResId( SCSTR_NOTEMPTY ) ),
aStrRow ( ScResId( SCSTR_ROW ) ), aStrRow ( ScResId( SCSTR_ROW ) ),
......
...@@ -77,7 +77,20 @@ ScSpecialFilterDlg::ScSpecialFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, Wi ...@@ -77,7 +77,20 @@ ScSpecialFilterDlg::ScSpecialFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, Wi
aRbFilterArea ( this, ScResId( RB_CRITERIA_AREA ), &aEdFilterArea, this ), aRbFilterArea ( this, ScResId( RB_CRITERIA_AREA ), &aEdFilterArea, this ),
// //
aFlOptions ( this, ScResId( FL_OPTIONS ) ), aFlOptions ( this, ScResId( FL_OPTIONS ) ),
_INIT_COMMON_FILTER_RSCOBJS aBtnCase ( this, ScResId( BTN_CASE ) ),
aBtnRegExp ( this, ScResId( BTN_REGEXP ) ),
aBtnHeader ( this, ScResId( BTN_HEADER ) ),
aBtnUnique ( this, ScResId( BTN_UNIQUE ) ),
aBtnCopyResult ( this, ScResId( BTN_COPY_RESULT ) ),
aLbCopyArea ( this, ScResId( LB_COPY_AREA ) ),
aEdCopyArea ( this, this, ScResId( ED_COPY_AREA ) ),
aRbCopyArea ( this, ScResId( RB_COPY_AREA ) ),
aBtnDestPers ( this, ScResId( BTN_DEST_PERS ) ),
aFtDbAreaLabel ( this, ScResId( FT_DBAREA_LABEL ) ),
aFtDbArea ( this, ScResId( FT_DBAREA ) ),
aStrUndefined ( ScResId( SCSTR_UNDEFINED ) ),
aStrNoName ( ScGlobal::GetRscString(STR_DB_NONAME) ),
aStrNone ( ScResId( SCSTR_NONE ) ),
aBtnOk ( this, ScResId( BTN_OK ) ), aBtnOk ( this, ScResId( BTN_OK ) ),
aBtnCancel ( this, ScResId( BTN_CANCEL ) ), aBtnCancel ( this, ScResId( BTN_CANCEL ) ),
aBtnHelp ( this, ScResId( BTN_HELP ) ), aBtnHelp ( this, ScResId( BTN_HELP ) ),
...@@ -214,9 +227,9 @@ void ScSpecialFilterDlg::Init( const SfxItemSet& rArgSet ) ...@@ -214,9 +227,9 @@ void ScSpecialFilterDlg::Init( const SfxItemSet& rArgSet )
aBtnHeader.Disable(); aBtnHeader.Disable();
// Modal-Modus einschalten // Modal-Modus einschalten
// SetDispatcherLock( sal_True ); // SetDispatcherLock( true );
//@BugID 54702 Enablen/Disablen nur noch in Basisklasse //@BugID 54702 Enablen/Disablen nur noch in Basisklasse
//SFX_APPWINDOW->Disable(sal_False); //! allgemeine Methode im ScAnyRefDlg //SFX_APPWINDOW->Disable(false); //! allgemeine Methode im ScAnyRefDlg
} }
...@@ -315,7 +328,7 @@ IMPL_LINK( ScSpecialFilterDlg, EndDlgHdl, Button*, pBtn ) ...@@ -315,7 +328,7 @@ IMPL_LINK( ScSpecialFilterDlg, EndDlgHdl, Button*, pBtn )
String theAreaStr( aEdFilterArea.GetText() ); String theAreaStr( aEdFilterArea.GetText() );
ScQueryParam theOutParam( theQueryData ); ScQueryParam theOutParam( theQueryData );
ScAddress theAdrCopy; ScAddress theAdrCopy;
sal_Bool bEditInputOk = sal_True; sal_Bool bEditInputOk = true;
sal_Bool bQueryOk = false; sal_Bool bQueryOk = false;
ScRange theFilterArea; ScRange theFilterArea;
const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention(); const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
...@@ -332,7 +345,7 @@ IMPL_LINK( ScSpecialFilterDlg, EndDlgHdl, Button*, pBtn ) ...@@ -332,7 +345,7 @@ IMPL_LINK( ScSpecialFilterDlg, EndDlgHdl, Button*, pBtn )
if ( SCA_VALID != (nResult & SCA_VALID) ) if ( SCA_VALID != (nResult & SCA_VALID) )
{ {
if ( !aBtnMore.GetState() ) if ( !aBtnMore.GetState() )
aBtnMore.SetState( sal_True ); aBtnMore.SetState( true );
ERRORBOX( STR_INVALID_TABREF ); ERRORBOX( STR_INVALID_TABREF );
aEdCopyArea.GrabFocus(); aEdCopyArea.GrabFocus();
...@@ -376,14 +389,14 @@ IMPL_LINK( ScSpecialFilterDlg, EndDlgHdl, Button*, pBtn ) ...@@ -376,14 +389,14 @@ IMPL_LINK( ScSpecialFilterDlg, EndDlgHdl, Button*, pBtn )
} }
else else
{ {
theOutParam.bInplace = sal_True; theOutParam.bInplace = true;
theOutParam.nDestTab = 0; theOutParam.nDestTab = 0;
theOutParam.nDestCol = 0; theOutParam.nDestCol = 0;
theOutParam.nDestRow = 0; theOutParam.nDestRow = 0;
} }
theOutParam.bHasHeader = aBtnHeader.IsChecked(); theOutParam.bHasHeader = aBtnHeader.IsChecked();
theOutParam.bByRow = sal_True; theOutParam.bByRow = true;
theOutParam.bCaseSens = aBtnCase.IsChecked(); theOutParam.bCaseSens = aBtnCase.IsChecked();
theOutParam.bRegExp = aBtnRegExp.IsChecked(); theOutParam.bRegExp = aBtnRegExp.IsChecked();
theOutParam.bDuplicate = !aBtnUnique.IsChecked(); theOutParam.bDuplicate = !aBtnUnique.IsChecked();
...@@ -443,12 +456,12 @@ IMPL_LINK( ScSpecialFilterDlg, TimeOutHdl, Timer*, _pTimer ) ...@@ -443,12 +456,12 @@ IMPL_LINK( ScSpecialFilterDlg, TimeOutHdl, Timer*, _pTimer )
if( aEdCopyArea.HasFocus() || aRbCopyArea.HasFocus() ) if( aEdCopyArea.HasFocus() || aRbCopyArea.HasFocus() )
{ {
pRefInputEdit = &aEdCopyArea; pRefInputEdit = &aEdCopyArea;
bRefInputMode = sal_True; bRefInputMode = true;
} }
else if( aEdFilterArea.HasFocus() || aRbFilterArea.HasFocus() ) else if( aEdFilterArea.HasFocus() || aRbFilterArea.HasFocus() )
{ {
pRefInputEdit = &aEdFilterArea; pRefInputEdit = &aEdFilterArea;
bRefInputMode = sal_True; bRefInputMode = true;
} }
else if( bRefInputMode ) else if( bRefInputMode )
{ {
......
...@@ -47,44 +47,6 @@ class ScDocument; ...@@ -47,44 +47,6 @@ class ScDocument;
class ScQueryItem; class ScQueryItem;
class TypedScStrCollection; class TypedScStrCollection;
//==================================================================
// Shared resource objects:
#define _COMMON_FILTER_RSCOBJS \
CheckBox aBtnCase; \
CheckBox aBtnRegExp; \
CheckBox aBtnHeader; \
CheckBox aBtnUnique; \
CheckBox aBtnCopyResult; \
ListBox aLbCopyArea; \
formula::RefEdit aEdCopyArea; \
formula::RefButton aRbCopyArea; \
CheckBox aBtnDestPers; \
FixedText aFtDbAreaLabel; \
FixedInfo aFtDbArea; \
const String aStrUndefined; \
const String aStrNoName; \
const String aStrNone;
#define _INIT_COMMON_FILTER_RSCOBJS \
aBtnCase ( this, ScResId( BTN_CASE ) ), \
aBtnRegExp ( this, ScResId( BTN_REGEXP ) ), \
aBtnHeader ( this, ScResId( BTN_HEADER ) ), \
aBtnUnique ( this, ScResId( BTN_UNIQUE ) ), \
aBtnCopyResult ( this, ScResId( BTN_COPY_RESULT ) ), \
aLbCopyArea ( this, ScResId( LB_COPY_AREA ) ), \
aEdCopyArea ( this, this, ScResId( ED_COPY_AREA ) ), \
aRbCopyArea ( this, ScResId( RB_COPY_AREA ), &aEdCopyArea, this ), \
aBtnDestPers ( this, ScResId( BTN_DEST_PERS ) ), \
aFtDbAreaLabel ( this, ScResId( FT_DBAREA_LABEL ) ), \
aFtDbArea ( this, ScResId( FT_DBAREA ) ), \
aStrUndefined ( ScResId( SCSTR_UNDEFINED ) ), \
aStrNoName ( ScGlobal::GetRscString(STR_DB_NONAME) ), \
aStrNone ( ScResId( SCSTR_NONE ) ),
//============================================================================
class ScFilterDlg : public ScAnyRefDlg class ScFilterDlg : public ScAnyRefDlg
{ {
public: public:
...@@ -139,7 +101,20 @@ private: ...@@ -139,7 +101,20 @@ private:
OKButton aBtnOk; OKButton aBtnOk;
CancelButton aBtnCancel; CancelButton aBtnCancel;
_COMMON_FILTER_RSCOBJS CheckBox aBtnCase;
CheckBox aBtnRegExp;
CheckBox aBtnHeader;
CheckBox aBtnUnique;
CheckBox aBtnCopyResult;
ListBox aLbCopyArea;
formula::RefEdit aEdCopyArea;
formula::RefButton aRbCopyArea;
CheckBox aBtnDestPers;
FixedText aFtDbAreaLabel;
FixedInfo aFtDbArea;
const String aStrUndefined;
const String aStrNoName;
const String aStrNone;
const String aStrEmpty; const String aStrEmpty;
const String aStrNotEmpty; const String aStrNotEmpty;
...@@ -213,12 +188,25 @@ public: ...@@ -213,12 +188,25 @@ public:
private: private:
FixedText aFtFilterArea; FixedText aFtFilterArea;
ListBox aLbFilterArea; ListBox aLbFilterArea;
formula::RefEdit aEdFilterArea; formula::RefEdit aEdFilterArea;
formula::RefButton aRbFilterArea; formula::RefButton aRbFilterArea;
FixedLine aFlOptions; FixedLine aFlOptions;
_COMMON_FILTER_RSCOBJS CheckBox aBtnCase;
CheckBox aBtnRegExp;
CheckBox aBtnHeader;
CheckBox aBtnUnique;
CheckBox aBtnCopyResult;
ListBox aLbCopyArea;
formula::RefEdit aEdCopyArea;
formula::RefButton aRbCopyArea;
CheckBox aBtnDestPers;
FixedText aFtDbAreaLabel;
FixedInfo aFtDbArea;
const String aStrUndefined;
const String aStrNoName;
const String aStrNone;
OKButton aBtnOk; OKButton aBtnOk;
CancelButton aBtnCancel; CancelButton aBtnCancel;
...@@ -227,14 +215,14 @@ private: ...@@ -227,14 +215,14 @@ private:
ScFilterOptionsMgr* pOptionsMgr; ScFilterOptionsMgr* pOptionsMgr;
const sal_uInt16 nWhichQuery; const sal_uInt16 nWhichQuery;
const ScQueryParam theQueryData; const ScQueryParam theQueryData;
ScQueryItem* pOutItem; ScQueryItem* pOutItem;
ScViewData* pViewData; ScViewData* pViewData;
ScDocument* pDoc; ScDocument* pDoc;
formula::RefEdit* pRefInputEdit; formula::RefEdit* pRefInputEdit;
sal_Bool bRefInputMode; bool bRefInputMode;
// Hack: RefInput control // Hack: RefInput control
Timer* pTimer; Timer* pTimer;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment