[Libreoffice-commits] core.git: 3 commits - include/vcl vcl/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Thu Dec 5 09:42:48 UTC 2019
include/vcl/field.hxx | 5 ----
vcl/source/control/field.cxx | 50 +++++++++++++++----------------------------
2 files changed, 18 insertions(+), 37 deletions(-)
New commits:
commit cda2b94f6deec442c37ebd80dbf865890893a03c
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Dec 4 20:21:54 2019 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Dec 5 10:41:49 2019 +0100
turn NumericFormatter::ImplInit into initializer list
Change-Id: I5f936ea61a3e17bb534282e4649b21c0ae2565c8
Reviewed-on: https://gerrit.libreoffice.org/84462
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/include/vcl/field.hxx b/include/vcl/field.hxx
index ae94f80199dc..e7c193dad617 100644
--- a/include/vcl/field.hxx
+++ b/include/vcl/field.hxx
@@ -183,8 +183,6 @@ protected:
virtual sal_Int64 GetValueFromString(const OUString& rStr) const;
private:
- SAL_DLLPRIVATE void ImplInit();
-
sal_uInt16 mnDecimalDigits;
bool mbThousandSep;
bool mbShowTrailingZeros;
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index 85abf1b3f0b7..2cd63600a5df 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -535,32 +535,25 @@ void NumericFormatter::ImplNumericReformat()
FormatValue();
}
-void NumericFormatter::ImplInit()
-{
- mnFieldValue = 0;
- mnLastValue = 0;
- mnMin = 0;
- mnMax = SAL_MAX_INT32;
- // a "large" value substantially smaller than SAL_MAX_INT64, to avoid
- // overflow in computations using this "dummy" value
- mnDecimalDigits = 2;
- mbThousandSep = true;
- mbShowTrailingZeros = true;
- mbWrapOnLimits = false;
- mbFormatting = false;
-
- // for fields
- mnSpinSize = 1;
- mnFirst = mnMin;
- mnLast = mnMax;
-
- SetDecimalDigits( 0 );
-}
-
NumericFormatter::NumericFormatter(Edit* pEdit)
: FormatterBase(pEdit)
+ , mnFieldValue(0)
+ , mnLastValue(0)
+ , mnMin(0)
+ // a "large" value substantially smaller than SAL_MAX_INT64, to avoid
+ // overflow in computations using this "dummy" value
+ , mnMax(SAL_MAX_INT32)
+ , mbWrapOnLimits(false)
+ , mbFormatting(false)
+ , mnSpinSize(1)
+ // for fields
+ , mnFirst(mnMin)
+ , mnLast(mnMax)
+ , mnDecimalDigits(2)
+ , mbThousandSep(true)
+ , mbShowTrailingZeros(true)
{
- ImplInit();
+ SetDecimalDigits( 0 );
}
NumericFormatter::~NumericFormatter()
commit 2e838e80d4519319c3d26fa0128a2f6bcaf09040
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Dec 4 20:16:12 2019 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Dec 5 10:41:26 2019 +0100
turn MetricFormatter::ImplInit into initializer list
Change-Id: Iccb732517d7827eda1d8962d4dccdb3a01ebce78
Reviewed-on: https://gerrit.libreoffice.org/84461
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/include/vcl/field.hxx b/include/vcl/field.hxx
index fa3cc9af0bbd..ae94f80199dc 100644
--- a/include/vcl/field.hxx
+++ b/include/vcl/field.hxx
@@ -244,8 +244,6 @@ protected:
virtual sal_Int64 GetValueFromStringUnit(const OUString& rStr, FieldUnit eOutUnit) const;
private:
- SAL_DLLPRIVATE void ImplInit();
-
OUString maCustomUnitText;
OUString maCurUnitText;
};
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index c64746e5ce17..85abf1b3f0b7 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -1401,16 +1401,11 @@ void MetricFormatter::ImplMetricReformat( const OUString& rStr, double& rValue,
rOutStr = CreateFieldText( static_cast<sal_Int64>(nTempVal) );
}
-inline void MetricFormatter::ImplInit()
-{
- mnBaseValue = 0;
- meUnit = FieldUnit::NONE;
-}
-
MetricFormatter::MetricFormatter(Edit* pEdit)
: NumericFormatter(pEdit)
+ , mnBaseValue(0)
+ , meUnit(FieldUnit::NONE)
{
- ImplInit();
}
MetricFormatter::~MetricFormatter()
commit 35f234ec898af275daabb5c0c72eb89f12fa82a0
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Dec 4 20:01:24 2019 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Dec 5 10:40:59 2019 +0100
replace only use of GetDefaultUnit() with FieldUnit::NONE
Change-Id: Idf3cf6d0a361c67d4005d627f661ac49e0e3e9de
Reviewed-on: https://gerrit.libreoffice.org/84459
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/include/vcl/field.hxx b/include/vcl/field.hxx
index db71ee3ebb4b..fa3cc9af0bbd 100644
--- a/include/vcl/field.hxx
+++ b/include/vcl/field.hxx
@@ -486,7 +486,6 @@ public:
void SetLast(sal_Int64 last) { SetLast(last, FieldUnit::NONE); }
sal_Int64 GetLast( FieldUnit eOutUnit ) const;
- static FieldUnit GetDefaultUnit();
static sal_Int64 ConvertValue( sal_Int64 nValue, sal_Int64 mnBaseValue, sal_uInt16 nDecDigits,
FieldUnit eInUnit, FieldUnit eOutUnit );
static sal_Int64 ConvertValue( sal_Int64 nValue, sal_uInt16 nDecDigits,
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index 814093ff5818..c64746e5ce17 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -1118,8 +1118,6 @@ mm/100 mm cm m km twip point pica inch foot mile
#undef M
#undef K
-FieldUnit MetricField::GetDefaultUnit() { return FieldUnit::NONE; }
-
static FieldUnit ImplMap2FieldUnit( MapUnit meUnit, long& nDecDigits )
{
switch( meUnit )
@@ -1406,7 +1404,7 @@ void MetricFormatter::ImplMetricReformat( const OUString& rStr, double& rValue,
inline void MetricFormatter::ImplInit()
{
mnBaseValue = 0;
- meUnit = MetricField::GetDefaultUnit();
+ meUnit = FieldUnit::NONE;
}
MetricFormatter::MetricFormatter(Edit* pEdit)
More information about the Libreoffice-commits
mailing list