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

More string & bool conversion.

üst 70ee109a
...@@ -50,10 +50,10 @@ public: ...@@ -50,10 +50,10 @@ public:
FillDir eFillDir, FillDir eFillDir,
FillCmd eFillCmd, FillCmd eFillCmd,
FillDateCmd eFillDateCmd, FillDateCmd eFillDateCmd,
String aStartStr, const rtl::OUString& aStartStr,
double fStep, double fStep,
double fMax, double fMax,
sal_uInt16 nPossDir ); sal_uInt16 nPossDir );
~ScFillSeriesDlg(); ~ScFillSeriesDlg();
FillDir GetFillDir() const { return theFillDir; } FillDir GetFillDir() const { return theFillDir; }
...@@ -63,14 +63,14 @@ public: ...@@ -63,14 +63,14 @@ public:
double GetStep() const { return fIncrement; } double GetStep() const { return fIncrement; }
double GetMax() const { return fEndVal; } double GetMax() const { return fEndVal; }
String GetStartStr() const { return aEdStartVal.GetText(); } rtl::OUString GetStartStr() const { return aEdStartVal.GetText(); }
void SetEdStartValEnabled(sal_Bool bFlag=false); void SetEdStartValEnabled(bool bFlag = false);
private: private:
FixedText aFtStartVal; FixedText aFtStartVal;
Edit aEdStartVal; Edit aEdStartVal;
String aStartStrVal; const rtl::OUString aStartStrVal;
FixedText aFtEndVal; FixedText aFtEndVal;
Edit aEdEndVal; Edit aEdEndVal;
...@@ -96,13 +96,12 @@ private: ...@@ -96,13 +96,12 @@ private:
RadioButton aBtnDayOfWeek; RadioButton aBtnDayOfWeek;
RadioButton aBtnMonth; RadioButton aBtnMonth;
RadioButton aBtnYear; RadioButton aBtnYear;
sal_Bool bStartValFlag;
OKButton aBtnOk; OKButton aBtnOk;
CancelButton aBtnCancel; CancelButton aBtnCancel;
HelpButton aBtnHelp; HelpButton aBtnHelp;
const String errMsgInvalidVal; const rtl::OUString aErrMsgInvalidVal;
//---------------------------------------------------------- //----------------------------------------------------------
...@@ -114,12 +113,14 @@ private: ...@@ -114,12 +113,14 @@ private:
double fIncrement; double fIncrement;
double fEndVal; double fEndVal;
bool bStartValFlag;
#ifdef _FILLDLG_CXX #ifdef _FILLDLG_CXX
private: private:
void Init( sal_uInt16 nPossDir ); void Init( sal_uInt16 nPossDir );
sal_Bool CheckStartVal(); bool CheckStartVal();
sal_Bool CheckIncrementVal(); bool CheckIncrementVal();
sal_Bool CheckEndVal(); bool CheckEndVal();
DECL_LINK( OKHdl, void * ); DECL_LINK( OKHdl, void * );
DECL_LINK( DisableHdl, Button * ); DECL_LINK( DisableHdl, Button * );
......
...@@ -59,7 +59,7 @@ ScFillSeriesDlg::ScFillSeriesDlg( Window* pParent, ...@@ -59,7 +59,7 @@ ScFillSeriesDlg::ScFillSeriesDlg( Window* pParent,
FillDir eFillDir, FillDir eFillDir,
FillCmd eFillCmd, FillCmd eFillCmd,
FillDateCmd eFillDateCmd, FillDateCmd eFillDateCmd,
String aStartStr, const rtl::OUString& aStartStr,
double fStep, double fStep,
double fMax, double fMax,
sal_uInt16 nPossDir ) sal_uInt16 nPossDir )
...@@ -97,7 +97,7 @@ ScFillSeriesDlg::ScFillSeriesDlg( Window* pParent, ...@@ -97,7 +97,7 @@ ScFillSeriesDlg::ScFillSeriesDlg( Window* pParent,
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 ) ),
errMsgInvalidVal( ScResId( STR_VALERR ) ), aErrMsgInvalidVal( ResId::toString(ScResId(STR_VALERR)) ),
rDoc ( rDocument ), rDoc ( rDocument ),
theFillDir ( eFillDir ), theFillDir ( eFillDir ),
theFillCmd ( eFillCmd ), theFillCmd ( eFillCmd ),
...@@ -118,7 +118,7 @@ ScFillSeriesDlg::~ScFillSeriesDlg() ...@@ -118,7 +118,7 @@ ScFillSeriesDlg::~ScFillSeriesDlg()
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void ScFillSeriesDlg::SetEdStartValEnabled(sal_Bool bFlag) void ScFillSeriesDlg::SetEdStartValEnabled(bool bFlag)
{ {
bStartValFlag=bFlag; bStartValFlag=bFlag;
if(bFlag) if(bFlag)
...@@ -206,12 +206,6 @@ void ScFillSeriesDlg::Init( sal_uInt16 nPossDir ) ...@@ -206,12 +206,6 @@ void ScFillSeriesDlg::Init( sal_uInt16 nPossDir )
} }
fStartVal = MAXDOUBLE; fStartVal = MAXDOUBLE;
/*
String aStartTxt;
if ( fStartVal != MAXDOUBLE )
rDoc.GetFormatTable()->GetInputLineString( fStartVal, 0, aStartTxt );
aEdStartVal.SetText( aStartTxt );
*/
aEdStartVal.SetText( aStartStrVal); aEdStartVal.SetText( aStartStrVal);
...@@ -224,7 +218,7 @@ void ScFillSeriesDlg::Init( sal_uInt16 nPossDir ) ...@@ -224,7 +218,7 @@ void ScFillSeriesDlg::Init( sal_uInt16 nPossDir )
rDoc.GetFormatTable()->GetInputLineString( fEndVal, 0, aEndTxt ); rDoc.GetFormatTable()->GetInputLineString( fEndVal, 0, aEndTxt );
aEdEndVal.SetText( aEndTxt ); aEdEndVal.SetText( aEndTxt );
bStartValFlag=false; bStartValFlag = false;
aFlSep1.SetStyle( aFlSep1.GetStyle() | WB_VERT ); aFlSep1.SetStyle( aFlSep1.GetStyle() | WB_VERT );
aFlSep2.SetStyle( aFlSep2.GetStyle() | WB_VERT ); aFlSep2.SetStyle( aFlSep2.GetStyle() | WB_VERT );
...@@ -233,15 +227,15 @@ void ScFillSeriesDlg::Init( sal_uInt16 nPossDir ) ...@@ -233,15 +227,15 @@ void ScFillSeriesDlg::Init( sal_uInt16 nPossDir )
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
sal_Bool ScFillSeriesDlg::CheckStartVal() bool ScFillSeriesDlg::CheckStartVal()
{ {
sal_Bool bValOk = false; bool bValOk = false;
String aStr( aEdStartVal.GetText() ); rtl::OUString aStr = aEdStartVal.GetText();
if ( aStr.Len() == 0 || aBtnAutoFill.IsChecked()) if ( aStr.isEmpty() || aBtnAutoFill.IsChecked())
{ {
fStartVal = MAXDOUBLE; fStartVal = MAXDOUBLE;
bValOk = sal_True; bValOk = true;
} }
else else
{ {
...@@ -254,10 +248,10 @@ sal_Bool ScFillSeriesDlg::CheckStartVal() ...@@ -254,10 +248,10 @@ sal_Bool ScFillSeriesDlg::CheckStartVal()
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
sal_Bool ScFillSeriesDlg::CheckIncrementVal() bool ScFillSeriesDlg::CheckIncrementVal()
{ {
sal_uInt32 nKey = 0; sal_uInt32 nKey = 0;
String aStr( aEdIncrement.GetText() ); rtl::OUString aStr = aEdIncrement.GetText();
return rDoc.GetFormatTable()->IsNumberFormat( aStr, nKey, fIncrement ); return rDoc.GetFormatTable()->IsNumberFormat( aStr, nKey, fIncrement );
} }
...@@ -265,15 +259,15 @@ sal_Bool ScFillSeriesDlg::CheckIncrementVal() ...@@ -265,15 +259,15 @@ sal_Bool ScFillSeriesDlg::CheckIncrementVal()
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
sal_Bool ScFillSeriesDlg::CheckEndVal() bool ScFillSeriesDlg::CheckEndVal()
{ {
sal_Bool bValOk = false; bool bValOk = false;
String aStr( aEdEndVal.GetText() ); rtl::OUString aStr = aEdEndVal.GetText();
if ( aStr.Len() == 0 ) if (aStr.isEmpty())
{ {
fEndVal = (fIncrement < 0) ? -MAXDOUBLE : MAXDOUBLE; fEndVal = (fIncrement < 0) ? -MAXDOUBLE : MAXDOUBLE;
bValOk = sal_True; bValOk = true;
} }
else else
{ {
...@@ -344,7 +338,7 @@ IMPL_LINK( ScFillSeriesDlg, OKHdl, void *, EMPTYARG ) ...@@ -344,7 +338,7 @@ IMPL_LINK( ScFillSeriesDlg, OKHdl, void *, EMPTYARG )
else if ( aBtnMonth.IsChecked() ) theFillDateCmd = FILL_MONTH; else if ( aBtnMonth.IsChecked() ) theFillDateCmd = FILL_MONTH;
else if ( aBtnYear.IsChecked() ) theFillDateCmd = FILL_YEAR; else if ( aBtnYear.IsChecked() ) theFillDateCmd = FILL_YEAR;
sal_Bool bAllOk = sal_True; sal_Bool bAllOk = true;
Edit* pEdWrong = NULL; Edit* pEdWrong = NULL;
if ( !CheckStartVal() ) if ( !CheckStartVal() )
{ {
...@@ -367,7 +361,7 @@ IMPL_LINK( ScFillSeriesDlg, OKHdl, void *, EMPTYARG ) ...@@ -367,7 +361,7 @@ IMPL_LINK( ScFillSeriesDlg, OKHdl, void *, EMPTYARG )
{ {
ErrorBox( this, ErrorBox( this,
WinBits( WB_OK | WB_DEF_OK ), WinBits( WB_OK | WB_DEF_OK ),
errMsgInvalidVal aErrMsgInvalidVal
).Execute(); ).Execute();
pEdWrong->GrabFocus(); pEdWrong->GrabFocus();
} }
......
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