[Libreoffice-commits] .: sc/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Mon Aug 29 20:20:53 PDT 2011
sc/source/ui/inc/filldlg.hxx | 21 +++++++++----------
sc/source/ui/miscdlgs/filldlg.cxx | 42 ++++++++++++++++----------------------
2 files changed, 29 insertions(+), 34 deletions(-)
New commits:
commit 9914f6402909edbe5ce461307f4d26bcd864eacc
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date: Mon Aug 29 23:19:46 2011 -0400
More string & bool conversion.
diff --git a/sc/source/ui/inc/filldlg.hxx b/sc/source/ui/inc/filldlg.hxx
index abecfa2..707d5d1 100644
--- a/sc/source/ui/inc/filldlg.hxx
+++ b/sc/source/ui/inc/filldlg.hxx
@@ -50,10 +50,10 @@ public:
FillDir eFillDir,
FillCmd eFillCmd,
FillDateCmd eFillDateCmd,
- String aStartStr,
+ const rtl::OUString& aStartStr,
double fStep,
double fMax,
- sal_uInt16 nPossDir );
+ sal_uInt16 nPossDir );
~ScFillSeriesDlg();
FillDir GetFillDir() const { return theFillDir; }
@@ -63,14 +63,14 @@ public:
double GetStep() const { return fIncrement; }
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:
FixedText aFtStartVal;
Edit aEdStartVal;
- String aStartStrVal;
+ const rtl::OUString aStartStrVal;
FixedText aFtEndVal;
Edit aEdEndVal;
@@ -96,13 +96,12 @@ private:
RadioButton aBtnDayOfWeek;
RadioButton aBtnMonth;
RadioButton aBtnYear;
- sal_Bool bStartValFlag;
OKButton aBtnOk;
CancelButton aBtnCancel;
HelpButton aBtnHelp;
- const String errMsgInvalidVal;
+ const rtl::OUString aErrMsgInvalidVal;
//----------------------------------------------------------
@@ -114,12 +113,14 @@ private:
double fIncrement;
double fEndVal;
+ bool bStartValFlag;
+
#ifdef _FILLDLG_CXX
private:
void Init( sal_uInt16 nPossDir );
- sal_Bool CheckStartVal();
- sal_Bool CheckIncrementVal();
- sal_Bool CheckEndVal();
+ bool CheckStartVal();
+ bool CheckIncrementVal();
+ bool CheckEndVal();
DECL_LINK( OKHdl, void * );
DECL_LINK( DisableHdl, Button * );
diff --git a/sc/source/ui/miscdlgs/filldlg.cxx b/sc/source/ui/miscdlgs/filldlg.cxx
index 67b297c..a662b34 100644
--- a/sc/source/ui/miscdlgs/filldlg.cxx
+++ b/sc/source/ui/miscdlgs/filldlg.cxx
@@ -59,7 +59,7 @@ ScFillSeriesDlg::ScFillSeriesDlg( Window* pParent,
FillDir eFillDir,
FillCmd eFillCmd,
FillDateCmd eFillDateCmd,
- String aStartStr,
+ const rtl::OUString& aStartStr,
double fStep,
double fMax,
sal_uInt16 nPossDir )
@@ -97,7 +97,7 @@ ScFillSeriesDlg::ScFillSeriesDlg( Window* pParent,
aBtnOk ( this, ScResId( BTN_OK ) ),
aBtnCancel ( this, ScResId( BTN_CANCEL ) ),
aBtnHelp ( this, ScResId( BTN_HELP ) ),
- errMsgInvalidVal( ScResId( STR_VALERR ) ),
+ aErrMsgInvalidVal( ResId::toString(ScResId(STR_VALERR)) ),
rDoc ( rDocument ),
theFillDir ( eFillDir ),
theFillCmd ( eFillCmd ),
@@ -118,7 +118,7 @@ ScFillSeriesDlg::~ScFillSeriesDlg()
//----------------------------------------------------------------------------
-void ScFillSeriesDlg::SetEdStartValEnabled(sal_Bool bFlag)
+void ScFillSeriesDlg::SetEdStartValEnabled(bool bFlag)
{
bStartValFlag=bFlag;
if(bFlag)
@@ -206,12 +206,6 @@ void ScFillSeriesDlg::Init( sal_uInt16 nPossDir )
}
fStartVal = MAXDOUBLE;
- /*
- String aStartTxt;
- if ( fStartVal != MAXDOUBLE )
- rDoc.GetFormatTable()->GetInputLineString( fStartVal, 0, aStartTxt );
- aEdStartVal.SetText( aStartTxt );
- */
aEdStartVal.SetText( aStartStrVal);
@@ -224,7 +218,7 @@ void ScFillSeriesDlg::Init( sal_uInt16 nPossDir )
rDoc.GetFormatTable()->GetInputLineString( fEndVal, 0, aEndTxt );
aEdEndVal.SetText( aEndTxt );
- bStartValFlag=false;
+ bStartValFlag = false;
aFlSep1.SetStyle( aFlSep1.GetStyle() | WB_VERT );
aFlSep2.SetStyle( aFlSep2.GetStyle() | WB_VERT );
@@ -233,15 +227,15 @@ void ScFillSeriesDlg::Init( sal_uInt16 nPossDir )
//----------------------------------------------------------------------------
-sal_Bool ScFillSeriesDlg::CheckStartVal()
+bool ScFillSeriesDlg::CheckStartVal()
{
- sal_Bool bValOk = false;
- String aStr( aEdStartVal.GetText() );
+ bool bValOk = false;
+ rtl::OUString aStr = aEdStartVal.GetText();
- if ( aStr.Len() == 0 || aBtnAutoFill.IsChecked())
+ if ( aStr.isEmpty() || aBtnAutoFill.IsChecked())
{
fStartVal = MAXDOUBLE;
- bValOk = sal_True;
+ bValOk = true;
}
else
{
@@ -254,10 +248,10 @@ sal_Bool ScFillSeriesDlg::CheckStartVal()
//----------------------------------------------------------------------------
-sal_Bool ScFillSeriesDlg::CheckIncrementVal()
+bool ScFillSeriesDlg::CheckIncrementVal()
{
sal_uInt32 nKey = 0;
- String aStr( aEdIncrement.GetText() );
+ rtl::OUString aStr = aEdIncrement.GetText();
return rDoc.GetFormatTable()->IsNumberFormat( aStr, nKey, fIncrement );
}
@@ -265,15 +259,15 @@ sal_Bool ScFillSeriesDlg::CheckIncrementVal()
//----------------------------------------------------------------------------
-sal_Bool ScFillSeriesDlg::CheckEndVal()
+bool ScFillSeriesDlg::CheckEndVal()
{
- sal_Bool bValOk = false;
- String aStr( aEdEndVal.GetText() );
+ bool bValOk = false;
+ rtl::OUString aStr = aEdEndVal.GetText();
- if ( aStr.Len() == 0 )
+ if (aStr.isEmpty())
{
fEndVal = (fIncrement < 0) ? -MAXDOUBLE : MAXDOUBLE;
- bValOk = sal_True;
+ bValOk = true;
}
else
{
@@ -344,7 +338,7 @@ IMPL_LINK( ScFillSeriesDlg, OKHdl, void *, EMPTYARG )
else if ( aBtnMonth.IsChecked() ) theFillDateCmd = FILL_MONTH;
else if ( aBtnYear.IsChecked() ) theFillDateCmd = FILL_YEAR;
- sal_Bool bAllOk = sal_True;
+ sal_Bool bAllOk = true;
Edit* pEdWrong = NULL;
if ( !CheckStartVal() )
{
@@ -367,7 +361,7 @@ IMPL_LINK( ScFillSeriesDlg, OKHdl, void *, EMPTYARG )
{
ErrorBox( this,
WinBits( WB_OK | WB_DEF_OK ),
- errMsgInvalidVal
+ aErrMsgInvalidVal
).Execute();
pEdWrong->GrabFocus();
}
More information about the Libreoffice-commits
mailing list