diff options
author | Laurent Balland-Poirier <laurent.balland-poirier@laposte.net> | 2015-01-31 16:47:28 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-02-03 09:46:31 +0000 |
commit | 343a23058e080c28088a97bf22e444160aa2030e (patch) | |
tree | dea698997a0f2a501c9ac978d9510406080899ec /svl | |
parent | 07cf8750cd094269513c5cec7bee518bbc0e5d81 (diff) |
tdf#88960 Scientific format: add/remove digits with buttons
Use buttons "Add Decimal Place" or "Delete Decimal Place" to change the
number of significant digits with scientific format (also works for
"General" format)
Improve format management for "red for negative"
to be compatible with tdf#88999
Change-Id: Id681afc4fc73674c9823172c6cd71925e63b867f
Reviewed-on: https://gerrit.libreoffice.org/14264
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/numbers/zforlist.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 2a3ed223a032..8a9b17a6b423 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -2652,6 +2652,19 @@ OUString SvNumberFormatter::GenerateFormat(sal_uInt32 nIndex, { sString.append('%'); } + else if (eType == NUMBERFORMAT_SCIENTIFIC) + { + OUStringBuffer sOldFormatString = pFormat->GetFormatstring(); + sal_Int32 nIndexE = sOldFormatString.indexOf('E'); + if (nIndexE > -1) + { + sal_Int32 nIndexSep = sOldFormatString.indexOf(';'); + if (nIndexSep > -1) + sString.append( sOldFormatString.copy(nIndexE, nIndexSep - nIndexE) ); + else + sString.append( sOldFormatString.copy(nIndexE) ); + } + } else if (eType == NUMBERFORMAT_CURRENCY) { OUStringBuffer sNegStr(sString); |