summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-07-01 13:29:03 +0100
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2014-07-01 19:48:09 +0000
commit4b19f9ced958fc732ad591768d7625ea69996dfd (patch)
tree888fb229fddd6e8a5da7010e60da9b8fcab23588
parent1e87982fa1ecd53ee08ce15f626a50fd959592ca (diff)
Resolves: fdo#42747 limits need to multiplied by num of decimal places
NumericFormatter limits need to multiplied by num of decimal places because the arg is a long so to retain decimal places its got to be raised up by the num of places Change-Id: Idbc49a9b1dde5fe176e5170d3be605a998050da5 (cherry picked from commit 63885c86f866411f01f1b6fceaa07f054a5a3550) Reviewed-on: https://gerrit.libreoffice.org/10014 Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
-rw-r--r--svx/source/fmcomp/gridcell.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index 158d460aeeac..cf24b3518553 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -2089,6 +2089,13 @@ void DbCurrencyField::implAdjustGenericFieldSetting( const Reference< XPropertyS
bool bThousand = getBOOL( _rxModel->getPropertyValue( FM_PROP_SHOWTHOUSANDSEP ) );
OUString aStr( getString( _rxModel->getPropertyValue(FM_PROP_CURRENCYSYMBOL ) ) );
+ //fdo#42747 the min/max/first/last of vcl NumericFormatters needs to be
+ //multiplied by the no of decimal places. See also
+ //VclBuilder::mungeAdjustment
+ int nMul = rtl_math_pow10Exp(1, m_nScale);
+ nMin *= nMul;
+ nMax *= nMul;
+
static_cast< LongCurrencyField* >( m_pWindow )->SetUseThousandSep( bThousand );
static_cast< LongCurrencyField* >( m_pWindow )->SetDecimalDigits( m_nScale );
static_cast< LongCurrencyField* >( m_pWindow )->SetCurrencySymbol( aStr );