diff options
author | Tomaž Vajngerl <quikee@gmail.com> | 2013-12-01 15:29:50 +0100 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2013-12-01 15:31:20 +0100 |
commit | 07c287d01e02e97df76a02a9a35238915d26c01b (patch) | |
tree | 223000e2a90f925bca8d2b90cf2ee88d5b9cc502 /vcl | |
parent | f28aaca9295e73e9afe9a591cdee6e0b49ca0927 (diff) |
Remove useless comments from field.cxx field2.cxx
Change-Id: I39dc5793a06f76af5f804846b1771664704369c3
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/control/field.cxx | 304 | ||||
-rw-r--r-- | vcl/source/control/field2.cxx | 264 |
2 files changed, 0 insertions, 568 deletions
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index 2dd3fc863c4c..058b15872cbf 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -43,14 +43,10 @@ using namespace ::com::sun::star; using namespace ::comphelper; -// ----------------------------------------------------------------------- - #define FORMAT_NUMERIC 1 #define FORMAT_METRIC 2 #define FORMAT_CURRENCY 3 -// ----------------------------------------------------------------------- - static sal_Int64 ImplPower10( sal_uInt16 n ) { sal_uInt16 i; @@ -62,8 +58,6 @@ static sal_Int64 ImplPower10( sal_uInt16 n ) return nValue; } -// ----------------------------------------------------------------------- - static bool ImplNumericProcessKeyInput( Edit*, const KeyEvent& rKEvt, bool bStrictFormat, bool bThousandSep, const LocaleDataWrapper& rLocaleDataWrappper ) @@ -87,8 +81,6 @@ static bool ImplNumericProcessKeyInput( Edit*, const KeyEvent& rKEvt, } } -// ----------------------------------------------------------------------- - static bool ImplNumericGetValue( const OUString& rStr, sal_Int64& rValue, sal_uInt16 nDecDigits, const LocaleDataWrapper& rLocaleDataWrappper, bool bCurrency = false ) @@ -293,8 +285,6 @@ static void ImplUpdateSeparators( const OUString& rOldDecSep, const OUString& rN } } -// ----------------------------------------------------------------------- - FormatterBase::FormatterBase( Edit* pField ) { mpField = pField; @@ -306,15 +296,11 @@ FormatterBase::FormatterBase( Edit* pField ) mbDefaultLocale = sal_True; } -// ----------------------------------------------------------------------- - FormatterBase::~FormatterBase() { delete mpLocaleDataWrapper; } -// ----------------------------------------------------------------------- - LocaleDataWrapper& FormatterBase::ImplGetLocaleDataWrapper() const { if ( !mpLocaleDataWrapper ) @@ -329,21 +315,15 @@ const LocaleDataWrapper& FormatterBase::GetLocaleDataWrapper() const return ImplGetLocaleDataWrapper(); } -// ----------------------------------------------------------------------- - void FormatterBase::Reformat() { } -// ----------------------------------------------------------------------- - void FormatterBase::ReformatAll() { Reformat(); }; -// ----------------------------------------------------------------------- - void FormatterBase::SetStrictFormat( sal_Bool bStrict ) { if ( bStrict != mbStrictFormat ) @@ -354,8 +334,6 @@ void FormatterBase::SetStrictFormat( sal_Bool bStrict ) } } -// ----------------------------------------------------------------------- - void FormatterBase::SetLocale( const lang::Locale& rLocale ) { ImplGetLocaleDataWrapper().setLanguageTag( LanguageTag( rLocale) ); @@ -363,8 +341,6 @@ void FormatterBase::SetLocale( const lang::Locale& rLocale ) ReformatAll(); } -// ----------------------------------------------------------------------- - const lang::Locale& FormatterBase::GetLocale() const { if ( !mpLocaleDataWrapper || mbDefaultLocale ) @@ -378,8 +354,6 @@ const lang::Locale& FormatterBase::GetLocale() const return mpLocaleDataWrapper->getLanguageTag().getLocale(); } -// ----------------------------------------------------------------------- - const LanguageTag& FormatterBase::GetLanguageTag() const { if ( !mpLocaleDataWrapper || mbDefaultLocale ) @@ -393,8 +367,6 @@ const LanguageTag& FormatterBase::GetLanguageTag() const return mpLocaleDataWrapper->getLanguageTag(); } -// ----------------------------------------------------------------------- - const AllSettings& FormatterBase::GetFieldSettings() const { if ( mpField ) @@ -403,8 +375,6 @@ const AllSettings& FormatterBase::GetFieldSettings() const return Application::GetSettings(); } -// ----------------------------------------------------------------------- - void FormatterBase::ImplSetText( const OUString& rText, Selection* pNewSelection ) { if ( mpField ) @@ -422,8 +392,6 @@ void FormatterBase::ImplSetText( const OUString& rText, Selection* pNewSelection } } -// ----------------------------------------------------------------------- - void FormatterBase::SetEmptyFieldValue() { if ( mpField ) @@ -431,15 +399,11 @@ void FormatterBase::SetEmptyFieldValue() mbEmptyFieldValue = sal_True; } -// ----------------------------------------------------------------------- - sal_Bool FormatterBase::IsEmptyFieldValue() const { return (!mpField || mpField->GetText().isEmpty()); } -// ----------------------------------------------------------------------- - sal_Bool NumericFormatter::ImplNumericReformat( const OUString& rStr, sal_Int64& rValue, OUString& rOutStr ) { @@ -470,8 +434,6 @@ sal_Bool NumericFormatter::ImplNumericReformat( const OUString& rStr, sal_Int64& } } -// ----------------------------------------------------------------------- - void NumericFormatter::ImplInit() { mnFieldValue = 0; @@ -492,15 +454,11 @@ void NumericFormatter::ImplInit() SetDecimalDigits( 0 ); } -// ----------------------------------------------------------------------- - NumericFormatter::NumericFormatter() { ImplInit(); } -// ----------------------------------------------------------------------- - void NumericFormatter::ImplLoadRes( const ResId& rResId ) { ResMgr* pMgr = rResId.GetResMgr(); @@ -536,14 +494,10 @@ void NumericFormatter::ImplLoadRes( const ResId& rResId ) } } -// ----------------------------------------------------------------------- - NumericFormatter::~NumericFormatter() { } -// ----------------------------------------------------------------------- - void NumericFormatter::SetMin( sal_Int64 nNewMin ) { mnMin = nNewMin; @@ -551,8 +505,6 @@ void NumericFormatter::SetMin( sal_Int64 nNewMin ) ReformatAll(); } -// ----------------------------------------------------------------------- - void NumericFormatter::SetMax( sal_Int64 nNewMax ) { mnMax = nNewMax; @@ -560,24 +512,18 @@ void NumericFormatter::SetMax( sal_Int64 nNewMax ) ReformatAll(); } -// ----------------------------------------------------------------------- - void NumericFormatter::SetUseThousandSep( sal_Bool bValue ) { mbThousandSep = bValue; ReformatAll(); } -// ----------------------------------------------------------------------- - void NumericFormatter::SetDecimalDigits( sal_uInt16 nDigits ) { mnDecimalDigits = nDigits; ReformatAll(); } -// ----------------------------------------------------------------------- - void NumericFormatter::SetShowTrailingZeros( sal_Bool bShowTrailingZeros ) { if ( mbShowTrailingZeros != bShowTrailingZeros ) @@ -587,15 +533,11 @@ void NumericFormatter::SetShowTrailingZeros( sal_Bool bShowTrailingZeros ) } } -// ----------------------------------------------------------------------- - sal_uInt16 NumericFormatter::GetDecimalDigits() const { return mnDecimalDigits; } -// ----------------------------------------------------------------------- - void NumericFormatter::SetValue( sal_Int64 nNewValue ) { SetUserValue( nNewValue ); @@ -603,15 +545,11 @@ void NumericFormatter::SetValue( sal_Int64 nNewValue ) SetEmptyFieldValueData( sal_False ); } -// ----------------------------------------------------------------------- - OUString NumericFormatter::CreateFieldText( sal_Int64 nValue ) const { return OUString(ImplGetLocaleDataWrapper().getNum( nValue, GetDecimalDigits(), IsUseThousandSep(), IsShowTrailingZeros() )); } -// ----------------------------------------------------------------------- - void NumericFormatter::ImplSetUserValue( sal_Int64 nNewValue, Selection* pNewSelection ) { if ( nNewValue > mnMax ) @@ -624,15 +562,11 @@ void NumericFormatter::ImplSetUserValue( sal_Int64 nNewValue, Selection* pNewSel ImplSetText( CreateFieldText( nNewValue ), pNewSelection ); } -// ----------------------------------------------------------------------- - void NumericFormatter::SetUserValue( sal_Int64 nNewValue ) { ImplSetUserValue( nNewValue ); } -// ----------------------------------------------------------------------- - sal_Int64 NumericFormatter::GetValue() const { if ( !GetField() ) @@ -653,8 +587,6 @@ sal_Int64 NumericFormatter::GetValue() const return mnLastValue; } -// ----------------------------------------------------------------------- - sal_Bool NumericFormatter::IsValueModified() const { if ( ImplGetEmptyFieldValue() ) @@ -665,15 +597,11 @@ sal_Bool NumericFormatter::IsValueModified() const return sal_False; } -// ----------------------------------------------------------------------- - sal_Int64 NumericFormatter::Normalize( sal_Int64 nValue ) const { return (nValue * ImplPower10( GetDecimalDigits() ) ); } -// ----------------------------------------------------------------------- - sal_Int64 NumericFormatter::Denormalize( sal_Int64 nValue ) const { sal_Int64 nFactor = ImplPower10( GetDecimalDigits() ); @@ -696,8 +624,6 @@ sal_Int64 NumericFormatter::Denormalize( sal_Int64 nValue ) const } } -// ----------------------------------------------------------------------- - void NumericFormatter::Reformat() { if ( !GetField() ) @@ -719,8 +645,6 @@ void NumericFormatter::Reformat() SetValue( mnLastValue ); } -// ----------------------------------------------------------------------- - void NumericFormatter::FieldUp() { sal_Int64 nValue = GetValue(); @@ -736,8 +660,6 @@ void NumericFormatter::FieldUp() ImplNewFieldValue( nValue ); } -// ----------------------------------------------------------------------- - void NumericFormatter::FieldDown() { sal_Int64 nValue = GetValue(); @@ -753,22 +675,16 @@ void NumericFormatter::FieldDown() ImplNewFieldValue( nValue ); } -// ----------------------------------------------------------------------- - void NumericFormatter::FieldFirst() { ImplNewFieldValue( mnFirst ); } -// ----------------------------------------------------------------------- - void NumericFormatter::FieldLast() { ImplNewFieldValue( mnLast ); } -// ----------------------------------------------------------------------- - void NumericFormatter::ImplNewFieldValue( sal_Int64 nNewValue ) { if ( GetField() ) @@ -802,8 +718,6 @@ void NumericFormatter::ImplNewFieldValue( sal_Int64 nNewValue ) } } -// ----------------------------------------------------------------------- - NumericField::NumericField( Window* pParent, WinBits nWinStyle ) : SpinField( pParent, nWinStyle ) { @@ -811,8 +725,6 @@ NumericField::NumericField( Window* pParent, WinBits nWinStyle ) : Reformat(); } -// ----------------------------------------------------------------------- - NumericField::NumericField( Window* pParent, const ResId& rResId ) : SpinField( WINDOW_NUMERICFIELD ) { @@ -836,8 +748,6 @@ bool NumericField::set_property(const OString &rKey, const OString &rValue) return true; } -// ----------------------------------------------------------------------- - void NumericField::ImplLoadRes( const ResId& rResId ) { SpinField::ImplLoadRes( rResId ); @@ -855,14 +765,10 @@ void NumericField::ImplLoadRes( const ResId& rResId ) mnSpinSize = ReadLongRes(); } -// ----------------------------------------------------------------------- - NumericField::~NumericField() { } -// ----------------------------------------------------------------------- - long NumericField::PreNotify( NotifyEvent& rNEvt ) { if ( (rNEvt.GetType() == EVENT_KEYINPUT) && !rNEvt.GetKeyEvent()->GetKeyCode().IsMod2() ) @@ -874,8 +780,6 @@ long NumericField::PreNotify( NotifyEvent& rNEvt ) return SpinField::PreNotify( rNEvt ); } -// ----------------------------------------------------------------------- - long NumericField::Notify( NotifyEvent& rNEvt ) { if ( rNEvt.GetType() == EVENT_GETFOCUS ) @@ -889,8 +793,6 @@ long NumericField::Notify( NotifyEvent& rNEvt ) return SpinField::Notify( rNEvt ); } -// ----------------------------------------------------------------------- - void NumericField::DataChanged( const DataChangedEvent& rDCEvt ) { SpinField::DataChanged( rDCEvt ); @@ -908,40 +810,30 @@ void NumericField::DataChanged( const DataChangedEvent& rDCEvt ) } } -// ----------------------------------------------------------------------- - void NumericField::Modify() { MarkToBeReformatted( sal_True ); SpinField::Modify(); } -// ----------------------------------------------------------------------- - void NumericField::Up() { FieldUp(); SpinField::Up(); } -// ----------------------------------------------------------------------- - void NumericField::Down() { FieldDown(); SpinField::Down(); } -// ----------------------------------------------------------------------- - void NumericField::First() { FieldFirst(); SpinField::First(); } -// ----------------------------------------------------------------------- - void NumericField::Last() { FieldLast(); @@ -987,8 +879,6 @@ Size NumericField::CalcMinimumSize() const return calcMinimumSize(*this, *this); } -// ----------------------------------------------------------------------- - NumericBox::NumericBox( Window* pParent, WinBits nWinStyle ) : ComboBox( pParent, nWinStyle ) { @@ -996,8 +886,6 @@ NumericBox::NumericBox( Window* pParent, WinBits nWinStyle ) : Reformat(); } -// ----------------------------------------------------------------------- - NumericBox::NumericBox( Window* pParent, const ResId& rResId ) : ComboBox( WINDOW_NUMERICBOX ) { @@ -1027,14 +915,10 @@ Size NumericBox::CalcMinimumSize() const return aRet; } -// ----------------------------------------------------------------------- - NumericBox::~NumericBox() { } -// ----------------------------------------------------------------------- - long NumericBox::PreNotify( NotifyEvent& rNEvt ) { if ( (rNEvt.GetType() == EVENT_KEYINPUT) && !rNEvt.GetKeyEvent()->GetKeyCode().IsMod2() ) @@ -1046,8 +930,6 @@ long NumericBox::PreNotify( NotifyEvent& rNEvt ) return ComboBox::PreNotify( rNEvt ); } -// ----------------------------------------------------------------------- - long NumericBox::Notify( NotifyEvent& rNEvt ) { if ( rNEvt.GetType() == EVENT_GETFOCUS ) @@ -1061,8 +943,6 @@ long NumericBox::Notify( NotifyEvent& rNEvt ) return ComboBox::Notify( rNEvt ); } -// ----------------------------------------------------------------------- - void NumericBox::DataChanged( const DataChangedEvent& rDCEvt ) { ComboBox::DataChanged( rDCEvt ); @@ -1080,16 +960,12 @@ void NumericBox::DataChanged( const DataChangedEvent& rDCEvt ) } } -// ----------------------------------------------------------------------- - void NumericBox::Modify() { MarkToBeReformatted( sal_True ); ComboBox::Modify(); } -// ----------------------------------------------------------------------- - void NumericBox::ReformatAll() { sal_Int64 nValue; @@ -1106,15 +982,11 @@ void NumericBox::ReformatAll() SetUpdateMode( sal_True ); } -// ----------------------------------------------------------------------- - void NumericBox::InsertValue( sal_Int64 nValue, sal_uInt16 nPos ) { ComboBox::InsertEntry( CreateFieldText( nValue ), nPos ); } -// ----------------------------------------------------------------------- - static bool ImplMetricProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, bool, bool bUseThousandSep, const LocaleDataWrapper& rWrapper ) { @@ -1122,8 +994,6 @@ static bool ImplMetricProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, return ImplNumericProcessKeyInput( pEdit, rKEvt, false, bUseThousandSep, rWrapper ); } -// ----------------------------------------------------------------------- - static OUString ImplMetricGetUnitText(const OUString& rStr) { // fetch unit text @@ -1142,8 +1012,6 @@ static OUString ImplMetricGetUnitText(const OUString& rStr) return aStr.makeStringAndClear(); } -// ----------------------------------------------------------------------- - // #104355# support localized mesaurements static const OUString ImplMetricToString( FieldUnit rUnit ) @@ -1180,8 +1048,6 @@ static FieldUnit ImplStringToMetric(const OUString &rMetricString) return FUNIT_NONE; } -// ----------------------------------------------------------------------- - static FieldUnit ImplMetricGetUnit(const OUString& rStr) { OUString aStr = ImplMetricGetUnitText( rStr ); @@ -1257,8 +1123,6 @@ static FieldUnit ImplMap2FieldUnit( MapUnit meUnit, long& nDecDigits ) return FUNIT_NONE; } -// ----------------------------------------------------------------------- - static double nonValueDoubleToValueDouble( double nValue ) { return rtl::math::isFinite( nValue ) ? nValue : 0.0; @@ -1282,8 +1146,6 @@ sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, sal_Int64 mnBaseValue, sa return nLong; } -// ----------------------------------------------------------------------- - sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, sal_uInt16 nDigits, MapUnit eInUnit, FieldUnit eOutUnit ) { @@ -1292,8 +1154,6 @@ sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, sal_uInt16 nDigits, ConvertDoubleValue( nValue, nDigits, eInUnit, eOutUnit ) ) ); } -// ----------------------------------------------------------------------- - double MetricField::ConvertDoubleValue( double nValue, sal_Int64 mnBaseValue, sal_uInt16 nDecDigits, FieldUnit eInUnit, FieldUnit eOutUnit ) { @@ -1348,8 +1208,6 @@ double MetricField::ConvertDoubleValue( double nValue, sal_Int64 mnBaseValue, sa return nValue; } -// ----------------------------------------------------------------------- - double MetricField::ConvertDoubleValue( double nValue, sal_uInt16 nDigits, MapUnit eInUnit, FieldUnit eOutUnit ) { @@ -1401,8 +1259,6 @@ double MetricField::ConvertDoubleValue( double nValue, sal_uInt16 nDigits, return nValue; } -// ----------------------------------------------------------------------- - double MetricField::ConvertDoubleValue( double nValue, sal_uInt16 nDigits, FieldUnit eInUnit, MapUnit eOutUnit ) { @@ -1453,8 +1309,6 @@ double MetricField::ConvertDoubleValue( double nValue, sal_uInt16 nDigits, return nValue; } -// ----------------------------------------------------------------------- - static bool ImplMetricGetValue( const OUString& rStr, double& rValue, sal_Int64 nBaseValue, sal_uInt16 nDecDigits, const LocaleDataWrapper& rLocaleDataWrapper, FieldUnit eUnit ) { @@ -1473,8 +1327,6 @@ static bool ImplMetricGetValue( const OUString& rStr, double& rValue, sal_Int64 return true; } -// ----------------------------------------------------------------------- - sal_Bool MetricFormatter::ImplMetricReformat( const OUString& rStr, double& rValue, OUString& rOutStr ) { if ( !ImplMetricGetValue( rStr, rValue, mnBaseValue, GetDecimalDigits(), ImplGetLocaleDataWrapper(), meUnit ) ) @@ -1505,8 +1357,6 @@ sal_Bool MetricFormatter::ImplMetricReformat( const OUString& rStr, double& rVal } } -// ----------------------------------------------------------------------- - inline void MetricFormatter::ImplInit() { mnBaseValue = 0; @@ -1514,15 +1364,11 @@ inline void MetricFormatter::ImplInit() mnType = FORMAT_METRIC; } -// ----------------------------------------------------------------------- - MetricFormatter::MetricFormatter() { ImplInit(); } -// ----------------------------------------------------------------------- - void MetricFormatter::ImplLoadRes( const ResId& rResId ) { NumericFormatter::ImplLoadRes( rResId ); @@ -1540,14 +1386,10 @@ void MetricFormatter::ImplLoadRes( const ResId& rResId ) } } -// ----------------------------------------------------------------------- - MetricFormatter::~MetricFormatter() { } -// ----------------------------------------------------------------------- - void MetricFormatter::SetUnit( FieldUnit eNewUnit ) { if ( eNewUnit == FUNIT_100TH_MM ) @@ -1560,24 +1402,18 @@ void MetricFormatter::SetUnit( FieldUnit eNewUnit ) ReformatAll(); } -// ----------------------------------------------------------------------- - void MetricFormatter::SetCustomUnitText( const OUString& rStr ) { maCustomUnitText = rStr; ReformatAll(); } -// ----------------------------------------------------------------------- - void MetricFormatter::SetValue( sal_Int64 nNewValue, FieldUnit eInUnit ) { SetUserValue( nNewValue, eInUnit ); mnFieldValue = mnLastValue; } -// ----------------------------------------------------------------------- - OUString MetricFormatter::CreateFieldText( sal_Int64 nValue ) const { OUString aStr = NumericFormatter::CreateFieldText( nValue ); @@ -1590,8 +1426,6 @@ OUString MetricFormatter::CreateFieldText( sal_Int64 nValue ) const return aStr; } -// ----------------------------------------------------------------------- - void MetricFormatter::SetUserValue( sal_Int64 nNewValue, FieldUnit eInUnit ) { // convert to previously configured units @@ -1599,8 +1433,6 @@ void MetricFormatter::SetUserValue( sal_Int64 nNewValue, FieldUnit eInUnit ) NumericFormatter::SetUserValue( nNewValue ); } -// ----------------------------------------------------------------------- - sal_Int64 MetricFormatter::GetValue( FieldUnit eOutUnit ) const { if ( !GetField() ) @@ -1621,24 +1453,18 @@ sal_Int64 MetricFormatter::GetValue( FieldUnit eOutUnit ) const return MetricField::ConvertValue( (sal_Int64)nTempValue, mnBaseValue, GetDecimalDigits(), meUnit, eOutUnit ); } -// ----------------------------------------------------------------------- - void MetricFormatter::SetValue( sal_Int64 nValue ) { // Implementation not inline, because it is a virtual Function SetValue( nValue, FUNIT_NONE ); } -// ----------------------------------------------------------------------- - sal_Int64 MetricFormatter::GetValue() const { // Implementation not inline, because it is a virtual Function return GetValue( FUNIT_NONE ); } -// ----------------------------------------------------------------------- - void MetricFormatter::SetMin( sal_Int64 nNewMin, FieldUnit eInUnit ) { // convert to requested units @@ -1646,8 +1472,6 @@ void MetricFormatter::SetMin( sal_Int64 nNewMin, FieldUnit eInUnit ) eInUnit, meUnit ) ); } -// ----------------------------------------------------------------------- - sal_Int64 MetricFormatter::GetMin( FieldUnit eOutUnit ) const { // convert to requested units @@ -1655,8 +1479,6 @@ sal_Int64 MetricFormatter::GetMin( FieldUnit eOutUnit ) const GetDecimalDigits(), meUnit, eOutUnit ); } -// ----------------------------------------------------------------------- - void MetricFormatter::SetMax( sal_Int64 nNewMax, FieldUnit eInUnit ) { // convert to requested units @@ -1664,8 +1486,6 @@ void MetricFormatter::SetMax( sal_Int64 nNewMax, FieldUnit eInUnit ) eInUnit, meUnit ) ); } -// ----------------------------------------------------------------------- - sal_Int64 MetricFormatter::GetMax( FieldUnit eOutUnit ) const { // convert to requested units @@ -1673,16 +1493,12 @@ sal_Int64 MetricFormatter::GetMax( FieldUnit eOutUnit ) const GetDecimalDigits(), meUnit, eOutUnit ); } -// ----------------------------------------------------------------------- - void MetricFormatter::SetBaseValue( sal_Int64 nNewBase, FieldUnit eInUnit ) { mnBaseValue = MetricField::ConvertValue( nNewBase, mnBaseValue, GetDecimalDigits(), eInUnit, meUnit ); } -// ----------------------------------------------------------------------- - sal_Int64 MetricFormatter::GetBaseValue( FieldUnit eOutUnit ) const { // convert to requested units @@ -1690,8 +1506,6 @@ sal_Int64 MetricFormatter::GetBaseValue( FieldUnit eOutUnit ) const meUnit, eOutUnit ); } -// ----------------------------------------------------------------------- - void MetricFormatter::Reformat() { if ( !GetField() ) @@ -1721,8 +1535,6 @@ void MetricFormatter::Reformat() maCurUnitText = OUString(); } -// ----------------------------------------------------------------------- - sal_Int64 MetricFormatter::GetCorrectedValue( FieldUnit eOutUnit ) const { // convert to requested units @@ -1730,8 +1542,6 @@ sal_Int64 MetricFormatter::GetCorrectedValue( FieldUnit eOutUnit ) const meUnit, eOutUnit ); } -// ----------------------------------------------------------------------- - MetricField::MetricField( Window* pParent, WinBits nWinStyle ) : SpinField( pParent, nWinStyle ) { @@ -1790,8 +1600,6 @@ void MetricField::ImplLoadRes( const ResId& rResId ) Reformat(); } -// ----------------------------------------------------------------------- - MetricField::~MetricField() { } @@ -1812,8 +1620,6 @@ void MetricField::SetUnit( FieldUnit nNewUnit ) SetLast( Normalize( nLast ), nNewUnit ); } -// ----------------------------------------------------------------------- - void MetricField::SetFirst( sal_Int64 nNewFirst, FieldUnit eInUnit ) { // convert @@ -1822,8 +1628,6 @@ void MetricField::SetFirst( sal_Int64 nNewFirst, FieldUnit eInUnit ) mnFirst = nNewFirst; } -// ----------------------------------------------------------------------- - sal_Int64 MetricField::GetFirst( FieldUnit eOutUnit ) const { // convert @@ -1831,8 +1635,6 @@ sal_Int64 MetricField::GetFirst( FieldUnit eOutUnit ) const meUnit, eOutUnit ); } -// ----------------------------------------------------------------------- - void MetricField::SetLast( sal_Int64 nNewLast, FieldUnit eInUnit ) { // convert @@ -1841,8 +1643,6 @@ void MetricField::SetLast( sal_Int64 nNewLast, FieldUnit eInUnit ) mnLast = nNewLast; } -// ----------------------------------------------------------------------- - sal_Int64 MetricField::GetLast( FieldUnit eOutUnit ) const { // conver @@ -1850,8 +1650,6 @@ sal_Int64 MetricField::GetLast( FieldUnit eOutUnit ) const meUnit, eOutUnit ); } -// ----------------------------------------------------------------------- - long MetricField::PreNotify( NotifyEvent& rNEvt ) { if ( (rNEvt.GetType() == EVENT_KEYINPUT) && !rNEvt.GetKeyEvent()->GetKeyCode().IsMod2() ) @@ -1863,8 +1661,6 @@ long MetricField::PreNotify( NotifyEvent& rNEvt ) return SpinField::PreNotify( rNEvt ); } -// ----------------------------------------------------------------------- - long MetricField::Notify( NotifyEvent& rNEvt ) { if ( rNEvt.GetType() == EVENT_GETFOCUS ) @@ -1878,8 +1674,6 @@ long MetricField::Notify( NotifyEvent& rNEvt ) return SpinField::Notify( rNEvt ); } -// ----------------------------------------------------------------------- - void MetricField::DataChanged( const DataChangedEvent& rDCEvt ) { SpinField::DataChanged( rDCEvt ); @@ -1897,55 +1691,41 @@ void MetricField::DataChanged( const DataChangedEvent& rDCEvt ) } } -// ----------------------------------------------------------------------- - void MetricField::Modify() { MarkToBeReformatted( sal_True ); SpinField::Modify(); } -// ----------------------------------------------------------------------- - void MetricField::Up() { FieldUp(); SpinField::Up(); } -// ----------------------------------------------------------------------- - void MetricField::Down() { FieldDown(); SpinField::Down(); } -// ----------------------------------------------------------------------- - void MetricField::First() { FieldFirst(); SpinField::First(); } -// ----------------------------------------------------------------------- - void MetricField::Last() { FieldLast(); SpinField::Last(); } -// ----------------------------------------------------------------------- - void MetricField::CustomConvert() { maCustomConvertLink.Call( this ); } -// ----------------------------------------------------------------------- - MetricBox::MetricBox( Window* pParent, WinBits nWinStyle ) : ComboBox( pParent, nWinStyle ) { @@ -1953,8 +1733,6 @@ MetricBox::MetricBox( Window* pParent, WinBits nWinStyle ) : Reformat(); } -// ----------------------------------------------------------------------- - Size MetricBox::CalcMinimumSize() const { Size aRet(calcMinimumSize(*this, *this)); @@ -1969,14 +1747,10 @@ Size MetricBox::CalcMinimumSize() const return aRet; } -// ----------------------------------------------------------------------- - MetricBox::~MetricBox() { } -// ----------------------------------------------------------------------- - long MetricBox::PreNotify( NotifyEvent& rNEvt ) { if ( (rNEvt.GetType() == EVENT_KEYINPUT) && !rNEvt.GetKeyEvent()->GetKeyCode().IsMod2() ) @@ -1988,8 +1762,6 @@ long MetricBox::PreNotify( NotifyEvent& rNEvt ) return ComboBox::PreNotify( rNEvt ); } -// ----------------------------------------------------------------------- - long MetricBox::Notify( NotifyEvent& rNEvt ) { if ( rNEvt.GetType() == EVENT_GETFOCUS ) @@ -2003,8 +1775,6 @@ long MetricBox::Notify( NotifyEvent& rNEvt ) return ComboBox::Notify( rNEvt ); } -// ----------------------------------------------------------------------- - void MetricBox::DataChanged( const DataChangedEvent& rDCEvt ) { ComboBox::DataChanged( rDCEvt ); @@ -2022,16 +1792,12 @@ void MetricBox::DataChanged( const DataChangedEvent& rDCEvt ) } } -// ----------------------------------------------------------------------- - void MetricBox::Modify() { MarkToBeReformatted( sal_True ); ComboBox::Modify(); } -// ----------------------------------------------------------------------- - void MetricBox::ReformatAll() { double nValue; @@ -2048,15 +1814,11 @@ void MetricBox::ReformatAll() SetUpdateMode( sal_True ); } -// ----------------------------------------------------------------------- - void MetricBox::CustomConvert() { maCustomConvertLink.Call( this ); } -// ----------------------------------------------------------------------- - void MetricBox::InsertValue( sal_Int64 nValue, FieldUnit eInUnit, sal_uInt16 nPos ) { // convert to previously configured units @@ -2065,8 +1827,6 @@ void MetricBox::InsertValue( sal_Int64 nValue, FieldUnit eInUnit, sal_uInt16 nPo ComboBox::InsertEntry( CreateFieldText( nValue ), nPos ); } -// ----------------------------------------------------------------------- - sal_Int64 MetricBox::GetValue( sal_uInt16 nPos, FieldUnit eOutUnit ) const { double nValue = 0; @@ -2080,8 +1840,6 @@ sal_Int64 MetricBox::GetValue( sal_uInt16 nPos, FieldUnit eOutUnit ) const return nRetValue; } -// ----------------------------------------------------------------------- - sal_uInt16 MetricBox::GetValuePos( sal_Int64 nValue, FieldUnit eInUnit ) const { // convert to previously configured units @@ -2090,24 +1848,18 @@ sal_uInt16 MetricBox::GetValuePos( sal_Int64 nValue, FieldUnit eInUnit ) const return ComboBox::GetEntryPos( CreateFieldText( nValue ) ); } -// ----------------------------------------------------------------------- - sal_Int64 MetricBox::GetValue( FieldUnit eOutUnit ) const { // Implementation not inline, because it is a virtual Function return MetricFormatter::GetValue( eOutUnit ); } -// ----------------------------------------------------------------------- - sal_Int64 MetricBox::GetValue() const { // Implementation not inline, because it is a virtual Function return GetValue( FUNIT_NONE ); } -// ----------------------------------------------------------------------- - static bool ImplCurrencyProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, bool, bool bUseThousandSep, const LocaleDataWrapper& rWrapper ) { @@ -2115,8 +1867,6 @@ static bool ImplCurrencyProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, return ImplNumericProcessKeyInput( pEdit, rKEvt, false, bUseThousandSep, rWrapper ); } -// ----------------------------------------------------------------------- - inline bool ImplCurrencyGetValue( const OUString& rStr, sal_Int64& rValue, sal_uInt16 nDecDigits, const LocaleDataWrapper& rWrapper ) { @@ -2124,8 +1874,6 @@ inline bool ImplCurrencyGetValue( const OUString& rStr, sal_Int64& rValue, return ImplNumericGetValue( rStr, rValue, nDecDigits, rWrapper, true ); } -// ----------------------------------------------------------------------- - sal_Bool CurrencyFormatter::ImplCurrencyReformat( const OUString& rStr, OUString& rOutStr ) { sal_Int64 nValue; @@ -2156,35 +1904,25 @@ sal_Bool CurrencyFormatter::ImplCurrencyReformat( const OUString& rStr, OUString } } -// ----------------------------------------------------------------------- - inline void CurrencyFormatter::ImplInit() { mnType = FORMAT_CURRENCY; } -// ----------------------------------------------------------------------- - CurrencyFormatter::CurrencyFormatter() { ImplInit(); } -// ----------------------------------------------------------------------- - CurrencyFormatter::~CurrencyFormatter() { } -// ----------------------------------------------------------------------- - OUString CurrencyFormatter::GetCurrencySymbol() const { return ImplGetLocaleDataWrapper().getCurrSymbol(); } -// ----------------------------------------------------------------------- - void CurrencyFormatter::SetValue( sal_Int64 nNewValue ) { SetUserValue( nNewValue ); @@ -2192,15 +1930,11 @@ void CurrencyFormatter::SetValue( sal_Int64 nNewValue ) SetEmptyFieldValueData( sal_False ); } -// ----------------------------------------------------------------------- - OUString CurrencyFormatter::CreateFieldText( sal_Int64 nValue ) const { return ImplGetLocaleDataWrapper().getCurr( nValue, GetDecimalDigits(), GetCurrencySymbol(), IsUseThousandSep() ); } -// ----------------------------------------------------------------------- - sal_Int64 CurrencyFormatter::GetValue() const { if ( !GetField() ) @@ -2219,8 +1953,6 @@ sal_Int64 CurrencyFormatter::GetValue() const return mnLastValue; } -// ----------------------------------------------------------------------- - void CurrencyFormatter::Reformat() { if ( !GetField() ) @@ -2242,8 +1974,6 @@ void CurrencyFormatter::Reformat() SetValue( mnLastValue ); } -// ----------------------------------------------------------------------- - CurrencyField::CurrencyField( Window* pParent, WinBits nWinStyle ) : SpinField( pParent, nWinStyle ) { @@ -2251,14 +1981,10 @@ CurrencyField::CurrencyField( Window* pParent, WinBits nWinStyle ) : Reformat(); } -// ----------------------------------------------------------------------- - CurrencyField::~CurrencyField() { } -// ----------------------------------------------------------------------- - long CurrencyField::PreNotify( NotifyEvent& rNEvt ) { if ( (rNEvt.GetType() == EVENT_KEYINPUT) && !rNEvt.GetKeyEvent()->GetKeyCode().IsMod2() ) @@ -2270,8 +1996,6 @@ long CurrencyField::PreNotify( NotifyEvent& rNEvt ) return SpinField::PreNotify( rNEvt ); } -// ----------------------------------------------------------------------- - long CurrencyField::Notify( NotifyEvent& rNEvt ) { if ( rNEvt.GetType() == EVENT_GETFOCUS ) @@ -2285,8 +2009,6 @@ long CurrencyField::Notify( NotifyEvent& rNEvt ) return SpinField::Notify( rNEvt ); } -// ----------------------------------------------------------------------- - void CurrencyField::DataChanged( const DataChangedEvent& rDCEvt ) { SpinField::DataChanged( rDCEvt ); @@ -2304,48 +2026,36 @@ void CurrencyField::DataChanged( const DataChangedEvent& rDCEvt ) } } -// ----------------------------------------------------------------------- - void CurrencyField::Modify() { MarkToBeReformatted( sal_True ); SpinField::Modify(); } -// ----------------------------------------------------------------------- - void CurrencyField::Up() { FieldUp(); SpinField::Up(); } -// ----------------------------------------------------------------------- - void CurrencyField::Down() { FieldDown(); SpinField::Down(); } -// ----------------------------------------------------------------------- - void CurrencyField::First() { FieldFirst(); SpinField::First(); } -// ----------------------------------------------------------------------- - void CurrencyField::Last() { FieldLast(); SpinField::Last(); } -// ----------------------------------------------------------------------- - CurrencyBox::CurrencyBox( Window* pParent, WinBits nWinStyle ) : ComboBox( pParent, nWinStyle ) { @@ -2353,14 +2063,10 @@ CurrencyBox::CurrencyBox( Window* pParent, WinBits nWinStyle ) : Reformat(); } -// ----------------------------------------------------------------------- - CurrencyBox::~CurrencyBox() { } -// ----------------------------------------------------------------------- - long CurrencyBox::PreNotify( NotifyEvent& rNEvt ) { if ( (rNEvt.GetType() == EVENT_KEYINPUT) && !rNEvt.GetKeyEvent()->GetKeyCode().IsMod2() ) @@ -2372,8 +2078,6 @@ long CurrencyBox::PreNotify( NotifyEvent& rNEvt ) return ComboBox::PreNotify( rNEvt ); } -// ----------------------------------------------------------------------- - long CurrencyBox::Notify( NotifyEvent& rNEvt ) { if ( rNEvt.GetType() == EVENT_GETFOCUS ) @@ -2387,8 +2091,6 @@ long CurrencyBox::Notify( NotifyEvent& rNEvt ) return ComboBox::Notify( rNEvt ); } -// ----------------------------------------------------------------------- - void CurrencyBox::DataChanged( const DataChangedEvent& rDCEvt ) { ComboBox::DataChanged( rDCEvt ); @@ -2406,16 +2108,12 @@ void CurrencyBox::DataChanged( const DataChangedEvent& rDCEvt ) } } -// ----------------------------------------------------------------------- - void CurrencyBox::Modify() { MarkToBeReformatted( sal_True ); ComboBox::Modify(); } -// ----------------------------------------------------------------------- - void CurrencyBox::ReformatAll() { OUString aStr; @@ -2431,8 +2129,6 @@ void CurrencyBox::ReformatAll() SetUpdateMode( sal_True ); } -// ----------------------------------------------------------------------- - sal_Int64 CurrencyBox::GetValue() const { // Implementation not inline, because it is a virtual Function diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx index f328d0ac504c..2107bd9d6f66 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -47,8 +47,6 @@ using namespace ::com::sun::star; using namespace ::comphelper; -// ======================================================================= - #define EDITMASK_LITERAL 'L' #define EDITMASK_ALPHA 'a' #define EDITMASK_UPPERALPHA 'A' @@ -68,8 +66,6 @@ uno::Reference< i18n::XCharacterClassification > ImplGetCharClass() return xCharClass; } -// ----------------------------------------------------------------------- - static sal_Unicode* ImplAddString( sal_Unicode* pBuf, const OUString& rStr ) { if ( rStr.getLength() == 1 ) @@ -84,8 +80,6 @@ static sal_Unicode* ImplAddString( sal_Unicode* pBuf, const OUString& rStr ) return pBuf; } -// ----------------------------------------------------------------------- - static sal_Unicode* ImplAddNum( sal_Unicode* pBuf, sal_uLong nNumber, int nMinLen ) { // fill temp buffer with digits @@ -121,8 +115,6 @@ static sal_Unicode* ImplAddNum( sal_Unicode* pBuf, sal_uLong nNumber, int nMinLe return pBuf; } -// ----------------------------------------------------------------------- - static sal_uInt16 ImplGetNum( const sal_Unicode*& rpBuf, bool& rbError ) { if ( !*rpBuf ) @@ -142,8 +134,6 @@ static sal_uInt16 ImplGetNum( const sal_Unicode*& rpBuf, bool& rbError ) return nNumber; } -// ----------------------------------------------------------------------- - static void ImplSkipDelimiters( const sal_Unicode*& rpBuf ) { while( ( *rpBuf == ',' ) || ( *rpBuf == '.' ) || ( *rpBuf == ';' ) || @@ -153,8 +143,6 @@ static void ImplSkipDelimiters( const sal_Unicode*& rpBuf ) } } -// ----------------------------------------------------------------------- - static int ImplIsPatternChar( sal_Unicode cChar, sal_Char cEditMask ) { sal_Int32 nType = 0; @@ -203,8 +191,6 @@ static int ImplIsPatternChar( sal_Unicode cChar, sal_Char cEditMask ) return sal_True; } -// ----------------------------------------------------------------------- - static sal_Unicode ImplPatternChar( sal_Unicode cChar, sal_Char cEditMask ) { if ( ImplIsPatternChar( cChar, cEditMask ) ) @@ -222,8 +208,6 @@ static sal_Unicode ImplPatternChar( sal_Unicode cChar, sal_Char cEditMask ) return 0; } -// ----------------------------------------------------------------------- - static int ImplCommaPointCharEqual( sal_Unicode c1, sal_Unicode c2 ) { if ( c1 == c2 ) @@ -235,8 +219,6 @@ static int ImplCommaPointCharEqual( sal_Unicode c1, sal_Unicode c2 ) return sal_False; } -// ----------------------------------------------------------------------- - static OUString ImplPatternReformat( const OUString& rStr, const OString& rEditMask, const OUString& rLiteralMask, @@ -337,8 +319,6 @@ static OUString ImplPatternReformat( const OUString& rStr, return aOutStr.makeStringAndClear(); } -// ----------------------------------------------------------------------- - static void ImplPatternMaxPos( const OUString& rStr, const OString& rEditMask, sal_uInt16 nFormatFlags, bool bSameMask, sal_uInt16 nCursorPos, sal_Int32& rPos ) @@ -379,8 +359,6 @@ static void ImplPatternMaxPos( const OUString& rStr, const OString& rEditMask, rPos = nCursorPos; } -// ----------------------------------------------------------------------- - static void ImplPatternProcessStrictModify( Edit* pEdit, const OString& rEditMask, const OUString& rLiteralMask, @@ -431,8 +409,6 @@ static void ImplPatternProcessStrictModify( Edit* pEdit, } } -// ----------------------------------------------------------------------- - static xub_StrLen ImplPatternLeftPos(const OString& rEditMask, sal_Int32 nCursorPos) { // search non-literal predecessor @@ -450,8 +426,6 @@ static xub_StrLen ImplPatternLeftPos(const OString& rEditMask, sal_Int32 nCursor return nNewPos; } -// ----------------------------------------------------------------------- - static xub_StrLen ImplPatternRightPos( const OUString& rStr, const OString& rEditMask, sal_uInt16 nFormatFlags, bool bSameMask, sal_Int32 nCursorPos ) @@ -472,8 +446,6 @@ static xub_StrLen ImplPatternRightPos( const OUString& rStr, const OString& rEdi return nNewPos; } -// ----------------------------------------------------------------------- - static bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, const OString& rEditMask, const OUString& rLiteralMask, @@ -743,8 +715,6 @@ static bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, return true; } -// ----------------------------------------------------------------------- - void PatternFormatter::ImplSetMask(const OString& rEditMask, const OUString& rLiteralMask) { m_aEditMask = rEditMask; @@ -797,8 +767,6 @@ void PatternFormatter::ImplSetMask(const OString& rEditMask, const OUString& rLi } } -// ----------------------------------------------------------------------- - PatternFormatter::PatternFormatter() { mnFormatFlags = 0; @@ -806,14 +774,10 @@ PatternFormatter::PatternFormatter() mbInPattKeyInput = sal_False; } -// ----------------------------------------------------------------------- - PatternFormatter::~PatternFormatter() { } -// ----------------------------------------------------------------------- - void PatternFormatter::SetMask( const OString& rEditMask, const OUString& rLiteralMask ) { @@ -821,8 +785,6 @@ void PatternFormatter::SetMask( const OString& rEditMask, ReformatAll(); } -// ----------------------------------------------------------------------- - void PatternFormatter::SetString( const OUString& rStr ) { maFieldString = rStr; @@ -833,8 +795,6 @@ void PatternFormatter::SetString( const OUString& rStr ) } } -// ----------------------------------------------------------------------- - OUString PatternFormatter::GetString() const { if ( !GetField() ) @@ -843,8 +803,6 @@ OUString PatternFormatter::GetString() const return ImplPatternReformat( GetField()->GetText(), m_aEditMask, maLiteralMask, mnFormatFlags ); } -// ----------------------------------------------------------------------- - void PatternFormatter::Reformat() { if ( GetField() ) @@ -855,8 +813,6 @@ void PatternFormatter::Reformat() } } -// ----------------------------------------------------------------------- - PatternField::PatternField( Window* pParent, WinBits nWinStyle ) : SpinField( pParent, nWinStyle ) { @@ -864,14 +820,10 @@ PatternField::PatternField( Window* pParent, WinBits nWinStyle ) : Reformat(); } -// ----------------------------------------------------------------------- - PatternField::~PatternField() { } -// ----------------------------------------------------------------------- - long PatternField::PreNotify( NotifyEvent& rNEvt ) { if ( (rNEvt.GetType() == EVENT_KEYINPUT) && !rNEvt.GetKeyEvent()->GetKeyCode().IsMod2() ) @@ -885,8 +837,6 @@ long PatternField::PreNotify( NotifyEvent& rNEvt ) return SpinField::PreNotify( rNEvt ); } -// ----------------------------------------------------------------------- - long PatternField::Notify( NotifyEvent& rNEvt ) { if ( rNEvt.GetType() == EVENT_GETFOCUS ) @@ -900,8 +850,6 @@ long PatternField::Notify( NotifyEvent& rNEvt ) return SpinField::Notify( rNEvt ); } -// ----------------------------------------------------------------------- - void PatternField::Modify() { if ( !ImplGetInPattKeyInput() ) @@ -915,8 +863,6 @@ void PatternField::Modify() SpinField::Modify(); } -// ----------------------------------------------------------------------- - PatternBox::PatternBox( Window* pParent, WinBits nWinStyle ) : ComboBox( pParent, nWinStyle ) { @@ -924,14 +870,10 @@ PatternBox::PatternBox( Window* pParent, WinBits nWinStyle ) : Reformat(); } -// ----------------------------------------------------------------------- - PatternBox::~PatternBox() { } -// ----------------------------------------------------------------------- - long PatternBox::PreNotify( NotifyEvent& rNEvt ) { if ( (rNEvt.GetType() == EVENT_KEYINPUT) && !rNEvt.GetKeyEvent()->GetKeyCode().IsMod2() ) @@ -945,8 +887,6 @@ long PatternBox::PreNotify( NotifyEvent& rNEvt ) return ComboBox::PreNotify( rNEvt ); } -// ----------------------------------------------------------------------- - long PatternBox::Notify( NotifyEvent& rNEvt ) { if ( rNEvt.GetType() == EVENT_GETFOCUS ) @@ -960,8 +900,6 @@ long PatternBox::Notify( NotifyEvent& rNEvt ) return ComboBox::Notify( rNEvt ); } -// ----------------------------------------------------------------------- - void PatternBox::Modify() { if ( !ImplGetInPattKeyInput() ) @@ -975,8 +913,6 @@ void PatternBox::Modify() ComboBox::Modify(); } -// ----------------------------------------------------------------------- - void PatternBox::ReformatAll() { OUString aStr; @@ -992,8 +928,6 @@ void PatternBox::ReformatAll() SetUpdateMode( sal_True ); } -// ======================================================================= - static ExtDateFieldFormat ImplGetExtFormat( DateFormat eOld ) { switch( eOld ) @@ -1004,8 +938,6 @@ static ExtDateFieldFormat ImplGetExtFormat( DateFormat eOld ) } } -// ----------------------------------------------------------------------- - static sal_uInt16 ImplCutNumberFromString( OUString& rStr ) { sal_Int32 i1 = 0; @@ -1021,8 +953,6 @@ static sal_uInt16 ImplCutNumberFromString( OUString& rStr ) return nValue; } -// ----------------------------------------------------------------------- - static bool ImplCutMonthName( OUString& rStr, const OUString& _rLookupMonthName ) { sal_Int32 index = 0; @@ -1030,8 +960,6 @@ static bool ImplCutMonthName( OUString& rStr, const OUString& _rLookupMonthName return index >= 0; } -// ----------------------------------------------------------------------- - static sal_uInt16 ImplCutMonthFromString( OUString& rStr, const CalendarWrapper& rCalendarWrapper ) { // search for a month' name @@ -1051,8 +979,6 @@ static sal_uInt16 ImplCutMonthFromString( OUString& rStr, const CalendarWrapper& return ImplCutNumberFromString( rStr ); } -// ----------------------------------------------------------------------- - static OUString ImplGetDateSep( const LocaleDataWrapper& rLocaleDataWrapper, ExtDateFieldFormat eFormat ) { if ( ( eFormat == XTDATEF_SHORT_YYMMDD_DIN5008 ) || ( eFormat == XTDATEF_SHORT_YYYYMMDD_DIN5008 ) ) @@ -1075,8 +1001,6 @@ static bool ImplDateProcessKeyInput( Edit*, const KeyEvent& rKEvt, ExtDateFieldF return true; } -// ----------------------------------------------------------------------- - static bool ImplDateGetValue( const OUString& rStr, Date& rDate, ExtDateFieldFormat eDateFormat, const LocaleDataWrapper& rLocaleDataWrapper, const CalendarWrapper& rCalendarWrapper, const AllSettings& ) @@ -1186,8 +1110,6 @@ static bool ImplDateGetValue( const OUString& rStr, Date& rDate, ExtDateFieldFor return false; } -// ----------------------------------------------------------------------- - sal_Bool DateFormatter::ImplDateReformat( const OUString& rStr, OUString& rOutStr, const AllSettings& rSettings ) { Date aDate( 0, 0, 0 ); @@ -1217,8 +1139,6 @@ sal_Bool DateFormatter::ImplDateReformat( const OUString& rStr, OUString& rOutSt return sal_True; } -// ----------------------------------------------------------------------- - OUString DateFormatter::ImplGetDateAsText( const Date& rDate, const AllSettings& ) const { @@ -1311,8 +1231,6 @@ OUString DateFormatter::ImplGetDateAsText( const Date& rDate, return OUString(aBuf, pBuf-aBuf); } -// ----------------------------------------------------------------------- - static void ImplDateIncrementDay( Date& rDate, sal_Bool bUp ) { DateFormatter::ExpandCentury( rDate ); @@ -1329,8 +1247,6 @@ static void ImplDateIncrementDay( Date& rDate, sal_Bool bUp ) } } -// ----------------------------------------------------------------------- - static void ImplDateIncrementMonth( Date& rDate, sal_Bool bUp ) { DateFormatter::ExpandCentury( rDate ); @@ -1369,8 +1285,6 @@ static void ImplDateIncrementMonth( Date& rDate, sal_Bool bUp ) rDate.SetDay( nDaysInMonth ); } -// ----------------------------------------------------------------------- - static void ImplDateIncrementYear( Date& rDate, sal_Bool bUp ) { DateFormatter::ExpandCentury( rDate ); @@ -1403,14 +1317,11 @@ static void ImplDateIncrementYear( Date& rDate, sal_Bool bUp ) } } -// ----------------------------------------------------------------------- sal_Bool DateFormatter::ImplAllowMalformedInput() const { return !IsEnforceValidValue(); } -// ----------------------------------------------------------------------- - void DateField::ImplDateSpinArea( sal_Bool bUp ) { // increment days if all is selected @@ -1501,8 +1412,6 @@ void DateField::ImplDateSpinArea( sal_Bool bUp ) } } -// ----------------------------------------------------------------------- - void DateFormatter::ImplInit() { mbLongFormat = sal_False; @@ -1512,8 +1421,6 @@ void DateFormatter::ImplInit() mnExtDateFormat = XTDATEF_SYSTEM_SHORT; } -// ----------------------------------------------------------------------- - DateFormatter::DateFormatter() : maFieldDate( 0 ), maLastDate( 0 ), @@ -1525,8 +1432,6 @@ DateFormatter::DateFormatter() : ImplInit(); } -// ----------------------------------------------------------------------- - void DateFormatter::ImplLoadRes( const ResId& rResId ) { ResMgr* pMgr = rResId.GetResMgr(); @@ -1563,16 +1468,12 @@ void DateFormatter::ImplLoadRes( const ResId& rResId ) } } -// ----------------------------------------------------------------------- - DateFormatter::~DateFormatter() { delete mpCalendarWrapper; mpCalendarWrapper = NULL; } -// ----------------------------------------------------------------------- - void DateFormatter::SetLocale( const ::com::sun::star::lang::Locale& rLocale ) { delete mpCalendarWrapper; @@ -1580,9 +1481,6 @@ void DateFormatter::SetLocale( const ::com::sun::star::lang::Locale& rLocale ) FormatterBase::SetLocale( rLocale ); } - -// ----------------------------------------------------------------------- - CalendarWrapper& DateFormatter::GetCalendarWrapper() const { if ( !mpCalendarWrapper ) @@ -1594,16 +1492,12 @@ CalendarWrapper& DateFormatter::GetCalendarWrapper() const return *mpCalendarWrapper; } -// ----------------------------------------------------------------------- - void DateFormatter::SetExtDateFormat( ExtDateFieldFormat eFormat ) { mnExtDateFormat = eFormat; ReformatAll(); } -// ----------------------------------------------------------------------- - ExtDateFieldFormat DateFormatter::GetExtDateFormat( sal_Bool bResolveSystemFormat ) const { ExtDateFieldFormat eDateFormat = (ExtDateFieldFormat)mnExtDateFormat; @@ -1625,15 +1519,11 @@ ExtDateFieldFormat DateFormatter::GetExtDateFormat( sal_Bool bResolveSystemForma return eDateFormat; } -// ----------------------------------------------------------------------- - void DateFormatter::ReformatAll() { Reformat(); } -// ----------------------------------------------------------------------- - void DateFormatter::SetMin( const Date& rNewMin ) { maMin = rNewMin; @@ -1641,8 +1531,6 @@ void DateFormatter::SetMin( const Date& rNewMin ) ReformatAll(); } -// ----------------------------------------------------------------------- - void DateFormatter::SetMax( const Date& rNewMax ) { maMax = rNewMax; @@ -1650,8 +1538,6 @@ void DateFormatter::SetMax( const Date& rNewMax ) ReformatAll(); } -// ----------------------------------------------------------------------- - void DateFormatter::SetLongFormat( sal_Bool bLong ) { mbLongFormat = bLong; @@ -1670,8 +1556,6 @@ void DateFormatter::SetLongFormat( sal_Bool bLong ) ReformatAll(); } -// ----------------------------------------------------------------------- - void DateFormatter::SetShowDateCentury( sal_Bool bShowDateCentury ) { mbShowDateCentury = bShowDateCentury; @@ -1719,8 +1603,6 @@ void DateFormatter::SetShowDateCentury( sal_Bool bShowDateCentury ) ReformatAll(); } -// ----------------------------------------------------------------------- - void DateFormatter::SetDate( const Date& rNewDate ) { SetUserDate( rNewDate ); @@ -1728,15 +1610,11 @@ void DateFormatter::SetDate( const Date& rNewDate ) maLastDate = GetDate(); } -// ----------------------------------------------------------------------- - void DateFormatter::SetUserDate( const Date& rNewDate ) { ImplSetUserDate( rNewDate ); } -// ----------------------------------------------------------------------- - void DateFormatter::ImplSetUserDate( const Date& rNewDate, Selection* pNewSelection ) { Date aNewDate = rNewDate; @@ -1750,8 +1628,6 @@ void DateFormatter::ImplSetUserDate( const Date& rNewDate, Selection* pNewSelect ImplSetText( ImplGetDateAsText( aNewDate, GetFieldSettings() ), pNewSelection ); } -// ----------------------------------------------------------------------- - void DateFormatter::ImplNewFieldValue( const Date& rDate ) { if ( GetField() ) @@ -1781,8 +1657,6 @@ void DateFormatter::ImplNewFieldValue( const Date& rDate ) } } -// ----------------------------------------------------------------------- - Date DateFormatter::GetDate() const { Date aDate( 0, 0, 0 ); @@ -1816,15 +1690,11 @@ Date DateFormatter::GetDate() const return aDate; } -// ----------------------------------------------------------------------- - void DateFormatter::SetEmptyDate() { FormatterBase::SetEmptyFieldValue(); } -// ----------------------------------------------------------------------- - sal_Bool DateFormatter::IsEmptyDate() const { sal_Bool bEmpty = FormatterBase::IsEmptyFieldValue(); @@ -1844,8 +1714,6 @@ sal_Bool DateFormatter::IsEmptyDate() const return bEmpty; } -// ----------------------------------------------------------------------- - void DateFormatter::Reformat() { if ( !GetField() ) @@ -1878,15 +1746,11 @@ void DateFormatter::Reformat() } } -// ----------------------------------------------------------------------- - void DateFormatter::ExpandCentury( Date& rDate ) { ExpandCentury( rDate, utl::MiscCfg().GetYear2000() ); } -// ----------------------------------------------------------------------- - void DateFormatter::ExpandCentury( Date& rDate, sal_uInt16 nTwoDigitYearStart ) { sal_uInt16 nDateYear = rDate.GetYear(); @@ -1899,8 +1763,6 @@ void DateFormatter::ExpandCentury( Date& rDate, sal_uInt16 nTwoDigitYearStart ) } } -// ----------------------------------------------------------------------- - DateField::DateField( Window* pParent, WinBits nWinStyle ) : SpinField( pParent, nWinStyle ), maFirst( GetMin() ), @@ -1912,8 +1774,6 @@ DateField::DateField( Window* pParent, WinBits nWinStyle ) : ResetLastDate(); } -// ----------------------------------------------------------------------- - DateField::DateField( Window* pParent, const ResId& rResId ) : SpinField( WINDOW_DATEFIELD ), maFirst( GetMin() ), @@ -1932,8 +1792,6 @@ DateField::DateField( Window* pParent, const ResId& rResId ) : ResetLastDate(); } -// ----------------------------------------------------------------------- - void DateField::ImplLoadRes( const ResId& rResId ) { SpinField::ImplLoadRes( rResId ); @@ -1959,14 +1817,10 @@ void DateField::ImplLoadRes( const ResId& rResId ) Reformat(); } -// ----------------------------------------------------------------------- - DateField::~DateField() { } -// ----------------------------------------------------------------------- - long DateField::PreNotify( NotifyEvent& rNEvt ) { if ( (rNEvt.GetType() == EVENT_KEYINPUT) && IsStrictFormat() && @@ -1980,8 +1834,6 @@ long DateField::PreNotify( NotifyEvent& rNEvt ) return SpinField::PreNotify( rNEvt ); } -// ----------------------------------------------------------------------- - long DateField::Notify( NotifyEvent& rNEvt ) { if ( rNEvt.GetType() == EVENT_GETFOCUS ) @@ -2018,8 +1870,6 @@ long DateField::Notify( NotifyEvent& rNEvt ) return SpinField::Notify( rNEvt ); } -// ----------------------------------------------------------------------- - void DateField::DataChanged( const DataChangedEvent& rDCEvt ) { SpinField::DataChanged( rDCEvt ); @@ -2032,48 +1882,36 @@ void DateField::DataChanged( const DataChangedEvent& rDCEvt ) } } -// ----------------------------------------------------------------------- - void DateField::Modify() { MarkToBeReformatted( sal_True ); SpinField::Modify(); } -// ----------------------------------------------------------------------- - void DateField::Up() { ImplDateSpinArea( sal_True ); SpinField::Up(); } -// ----------------------------------------------------------------------- - void DateField::Down() { ImplDateSpinArea( sal_False ); SpinField::Down(); } -// ----------------------------------------------------------------------- - void DateField::First() { ImplNewFieldValue( maFirst ); SpinField::First(); } -// ----------------------------------------------------------------------- - void DateField::Last() { ImplNewFieldValue( maLast ); SpinField::Last(); } -// ----------------------------------------------------------------------- - DateBox::DateBox( Window* pParent, WinBits nWinStyle ) : ComboBox( pParent, nWinStyle ) { @@ -2082,14 +1920,10 @@ DateBox::DateBox( Window* pParent, WinBits nWinStyle ) : Reformat(); } -// ----------------------------------------------------------------------- - DateBox::~DateBox() { } -// ----------------------------------------------------------------------- - long DateBox::PreNotify( NotifyEvent& rNEvt ) { if ( (rNEvt.GetType() == EVENT_KEYINPUT) && IsStrictFormat() && @@ -2103,8 +1937,6 @@ long DateBox::PreNotify( NotifyEvent& rNEvt ) return ComboBox::PreNotify( rNEvt ); } -// ----------------------------------------------------------------------- - void DateBox::DataChanged( const DataChangedEvent& rDCEvt ) { ComboBox::DataChanged( rDCEvt ); @@ -2117,8 +1949,6 @@ void DateBox::DataChanged( const DataChangedEvent& rDCEvt ) } } -// ----------------------------------------------------------------------- - long DateBox::Notify( NotifyEvent& rNEvt ) { if ( rNEvt.GetType() == EVENT_GETFOCUS ) @@ -2141,16 +1971,12 @@ long DateBox::Notify( NotifyEvent& rNEvt ) return ComboBox::Notify( rNEvt ); } -// ----------------------------------------------------------------------- - void DateBox::Modify() { MarkToBeReformatted( sal_True ); ComboBox::Modify(); } -// ----------------------------------------------------------------------- - void DateBox::ReformatAll() { OUString aStr; @@ -2166,8 +1992,6 @@ void DateBox::ReformatAll() SetUpdateMode( sal_True ); } -// ----------------------------------------------------------------------- - static bool ImplTimeProcessKeyInput( Edit*, const KeyEvent& rKEvt, sal_Bool bStrictFormat, sal_Bool bDuration, TimeFieldFormat eFormat, @@ -2197,8 +2021,6 @@ static bool ImplTimeProcessKeyInput( Edit*, const KeyEvent& rKEvt, } } -// ----------------------------------------------------------------------- - static bool ImplIsOnlyDigits( const OUStringBuffer& _rStr ) { const sal_Unicode* _pChr = _rStr.getStr(); @@ -2210,8 +2032,6 @@ static bool ImplIsOnlyDigits( const OUStringBuffer& _rStr ) return true; } -// ----------------------------------------------------------------------- - static bool ImplIsValidTimePortion( sal_Bool _bSkipInvalidCharacters, const OUStringBuffer& _rStr ) { if ( !_bSkipInvalidCharacters ) @@ -2222,8 +2042,6 @@ static bool ImplIsValidTimePortion( sal_Bool _bSkipInvalidCharacters, const OUSt return true; } -// ----------------------------------------------------------------------- - static bool ImplCutTimePortion( OUStringBuffer& _rStr, sal_Int32 _nSepPos, sal_Bool _bSkipInvalidCharacters, short* _pPortion ) { OUString sPortion(_rStr.getStr(), _nSepPos ); @@ -2236,8 +2054,6 @@ static bool ImplCutTimePortion( OUStringBuffer& _rStr, sal_Int32 _nSepPos, sal_B return true; } -// ----------------------------------------------------------------------- - static bool ImplTimeGetValue( const OUString& rStr, Time& rTime, TimeFieldFormat eFormat, sal_Bool bDuration, const LocaleDataWrapper& rLocaleDataWrapper, sal_Bool _bSkipInvalidCharacters = sal_True ) @@ -2434,8 +2250,6 @@ static bool ImplTimeGetValue( const OUString& rStr, Time& rTime, return true; } -// ----------------------------------------------------------------------- - sal_Bool TimeFormatter::ImplTimeReformat( const OUString& rStr, OUString& rOutStr ) { Time aTime( 0, 0, 0 ); @@ -2503,15 +2317,11 @@ sal_Bool TimeFormatter::ImplTimeReformat( const OUString& rStr, OUString& rOutSt return sal_True; } - -// ----------------------------------------------------------------------- sal_Bool TimeFormatter::ImplAllowMalformedInput() const { return !IsEnforceValidValue(); } -// ----------------------------------------------------------------------- - void TimeField::ImplTimeSpinArea( sal_Bool bUp ) { if ( GetField() ) @@ -2585,8 +2395,6 @@ void TimeField::ImplTimeSpinArea( sal_Bool bUp ) } } -// ----------------------------------------------------------------------- - void TimeFormatter::ImplInit() { meFormat = TIMEF_NONE; @@ -2594,8 +2402,6 @@ void TimeFormatter::ImplInit() mnTimeFormat = HOUR_24; // Should become a ExtTimeFieldFormat in next implementation, merge with mbDuration and meFormat } -// ----------------------------------------------------------------------- - TimeFormatter::TimeFormatter() : maLastTime( 0, 0 ), maMin( 0, 0 ), @@ -2607,8 +2413,6 @@ TimeFormatter::TimeFormatter() : ImplInit(); } -// ----------------------------------------------------------------------- - void TimeFormatter::ImplLoadRes( const ResId& rResId ) { ResMgr* pMgr = rResId.GetResMgr(); @@ -2651,21 +2455,15 @@ void TimeFormatter::ImplLoadRes( const ResId& rResId ) } } -// ----------------------------------------------------------------------- - TimeFormatter::~TimeFormatter() { } -// ----------------------------------------------------------------------- - void TimeFormatter::ReformatAll() { Reformat(); } -// ----------------------------------------------------------------------- - void TimeFormatter::SetMin( const Time& rNewMin ) { maMin = rNewMin; @@ -2673,8 +2471,6 @@ void TimeFormatter::SetMin( const Time& rNewMin ) ReformatAll(); } -// ----------------------------------------------------------------------- - void TimeFormatter::SetMax( const Time& rNewMax ) { maMax = rNewMax; @@ -2682,38 +2478,28 @@ void TimeFormatter::SetMax( const Time& rNewMax ) ReformatAll(); } -// ----------------------------------------------------------------------- - void TimeFormatter::SetTimeFormat( TimeFormatter::TimeFormat eNewFormat ) { mnTimeFormat = sal::static_int_cast<sal_uInt16>(eNewFormat); } -// ----------------------------------------------------------------------- - TimeFormatter::TimeFormat TimeFormatter::GetTimeFormat() const { return (TimeFormat)mnTimeFormat; } -// ----------------------------------------------------------------------- - void TimeFormatter::SetFormat( TimeFieldFormat eNewFormat ) { meFormat = eNewFormat; ReformatAll(); } -// ----------------------------------------------------------------------- - void TimeFormatter::SetDuration( sal_Bool bNewDuration ) { mbDuration = bNewDuration; ReformatAll(); } -// ----------------------------------------------------------------------- - void TimeFormatter::SetTime( const Time& rNewTime ) { SetUserTime( rNewTime ); @@ -2721,8 +2507,6 @@ void TimeFormatter::SetTime( const Time& rNewTime ) SetEmptyFieldValueData( sal_False ); } -// ----------------------------------------------------------------------- - void TimeFormatter::ImplNewFieldValue( const Time& rTime ) { if ( GetField() ) @@ -2752,8 +2536,6 @@ void TimeFormatter::ImplNewFieldValue( const Time& rTime ) } } -// ----------------------------------------------------------------------- - void TimeFormatter::ImplSetUserTime( const Time& rNewTime, Selection* pNewSelection ) { Time aNewTime = rNewTime; @@ -2812,15 +2594,11 @@ void TimeFormatter::ImplSetUserTime( const Time& rNewTime, Selection* pNewSelect } } -// ----------------------------------------------------------------------- - void TimeFormatter::SetUserTime( const Time& rNewTime ) { ImplSetUserTime( rNewTime ); } -// ----------------------------------------------------------------------- - Time TimeFormatter::GetTime() const { Time aTime( 0, 0, 0 ); @@ -2847,8 +2625,6 @@ Time TimeFormatter::GetTime() const return aTime; } -// ----------------------------------------------------------------------- - void TimeFormatter::Reformat() { if ( !GetField() ) @@ -2871,8 +2647,6 @@ void TimeFormatter::Reformat() SetTime( maLastTime ); } -// ----------------------------------------------------------------------- - TimeField::TimeField( Window* pParent, WinBits nWinStyle ) : SpinField( pParent, nWinStyle ), maFirst( GetMin() ), @@ -2883,8 +2657,6 @@ TimeField::TimeField( Window* pParent, WinBits nWinStyle ) : Reformat(); } -// ----------------------------------------------------------------------- - TimeField::TimeField( Window* pParent, const ResId& rResId ) : SpinField( WINDOW_TIMEFIELD ), maFirst( GetMin() ), @@ -2901,8 +2673,6 @@ TimeField::TimeField( Window* pParent, const ResId& rResId ) : Show(); } -// ----------------------------------------------------------------------- - void TimeField::ImplLoadRes( const ResId& rResId ) { SpinField::ImplLoadRes( rResId ); @@ -2928,14 +2698,10 @@ void TimeField::ImplLoadRes( const ResId& rResId ) Reformat(); } -// ----------------------------------------------------------------------- - TimeField::~TimeField() { } -// ----------------------------------------------------------------------- - long TimeField::PreNotify( NotifyEvent& rNEvt ) { if ( (rNEvt.GetType() == EVENT_KEYINPUT) && !rNEvt.GetKeyEvent()->GetKeyCode().IsMod2() ) @@ -2947,8 +2713,6 @@ long TimeField::PreNotify( NotifyEvent& rNEvt ) return SpinField::PreNotify( rNEvt ); } -// ----------------------------------------------------------------------- - long TimeField::Notify( NotifyEvent& rNEvt ) { if ( rNEvt.GetType() == EVENT_GETFOCUS ) @@ -2973,8 +2737,6 @@ long TimeField::Notify( NotifyEvent& rNEvt ) return SpinField::Notify( rNEvt ); } -// ----------------------------------------------------------------------- - void TimeField::DataChanged( const DataChangedEvent& rDCEvt ) { SpinField::DataChanged( rDCEvt ); @@ -2987,48 +2749,36 @@ void TimeField::DataChanged( const DataChangedEvent& rDCEvt ) } } -// ----------------------------------------------------------------------- - void TimeField::Modify() { MarkToBeReformatted( sal_True ); SpinField::Modify(); } -// ----------------------------------------------------------------------- - void TimeField::Up() { ImplTimeSpinArea( sal_True ); SpinField::Up(); } -// ----------------------------------------------------------------------- - void TimeField::Down() { ImplTimeSpinArea( sal_False ); SpinField::Down(); } -// ----------------------------------------------------------------------- - void TimeField::First() { ImplNewFieldValue( maFirst ); SpinField::First(); } -// ----------------------------------------------------------------------- - void TimeField::Last() { ImplNewFieldValue( maLast ); SpinField::Last(); } -// ----------------------------------------------------------------------- - void TimeField::SetExtFormat( ExtTimeFieldFormat eFormat ) { switch ( eFormat ) @@ -3081,8 +2831,6 @@ void TimeField::SetExtFormat( ExtTimeFieldFormat eFormat ) ReformatAll(); } -// ----------------------------------------------------------------------- - TimeBox::TimeBox( Window* pParent, WinBits nWinStyle ) : ComboBox( pParent, nWinStyle ) { @@ -3091,14 +2839,10 @@ TimeBox::TimeBox( Window* pParent, WinBits nWinStyle ) : Reformat(); } -// ----------------------------------------------------------------------- - TimeBox::~TimeBox() { } -// ----------------------------------------------------------------------- - long TimeBox::PreNotify( NotifyEvent& rNEvt ) { if ( (rNEvt.GetType() == EVENT_KEYINPUT) && !rNEvt.GetKeyEvent()->GetKeyCode().IsMod2() ) @@ -3110,8 +2854,6 @@ long TimeBox::PreNotify( NotifyEvent& rNEvt ) return ComboBox::PreNotify( rNEvt ); } -// ----------------------------------------------------------------------- - long TimeBox::Notify( NotifyEvent& rNEvt ) { if ( rNEvt.GetType() == EVENT_GETFOCUS ) @@ -3125,8 +2867,6 @@ long TimeBox::Notify( NotifyEvent& rNEvt ) return ComboBox::Notify( rNEvt ); } -// ----------------------------------------------------------------------- - void TimeBox::DataChanged( const DataChangedEvent& rDCEvt ) { ComboBox::DataChanged( rDCEvt ); @@ -3139,16 +2879,12 @@ void TimeBox::DataChanged( const DataChangedEvent& rDCEvt ) } } -// ----------------------------------------------------------------------- - void TimeBox::Modify() { MarkToBeReformatted( sal_True ); ComboBox::Modify(); } -// ----------------------------------------------------------------------- - void TimeBox::ReformatAll() { OUString aStr; |