summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorLaurent Balland-Poirier <laurent.balland-poirier@laposte.net>2016-07-16 22:39:32 +0200
committerEike Rathke <erack@redhat.com>2016-07-27 13:12:34 +0000
commitf06a3503b69819e1d018ee4f587655173dff503e (patch)
tree77e6c699e349bd518f87c824388c6e3dfecb122d /svl
parent5bd8b05f9b0adb93aec4d6ad7b67c7003092b873 (diff)
tdf#100834 Extend ODF for integer/fraction delimiter
Any string can be used as delimiter between integer and fraction. It is now saved/loaded to/from ODF, as it was from XLS. Change-Id: Ie6364d1cdefc020ea615c18099118135c619f96b Reviewed-on: https://gerrit.libreoffice.org/27262 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'svl')
-rw-r--r--svl/source/numbers/zformat.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 5e37a701ca3c..ce018a1f00a8 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -2020,6 +2020,19 @@ OUString lcl_GetFractionIntegerString(const ImpSvNumberformatInfo &rInfo, sal_uI
return aIntegerString.makeStringAndClear();
}
+OUString lcl_GetIntegerFractionDelimiterString(const ImpSvNumberformatInfo &rInfo, sal_uInt16 nAnz)
+{
+ sal_Int16 i;
+ for( i = 0; i < nAnz; i++ )
+ {
+ if( rInfo.nTypeArray[i] == NF_SYMBOLTYPE_FRACBLANK )
+ {
+ return rInfo.sStrArray[i];
+ }
+ }
+ return OUString();
+}
+
}
OUString SvNumberformat::GetDenominatorString( sal_uInt16 nNumFor ) const
@@ -2036,6 +2049,13 @@ OUString SvNumberformat::GetNumeratorString( sal_uInt16 nNumFor ) const
return lcl_GetNumeratorString( rInfo, nAnz );
}
+OUString SvNumberformat::GetIntegerFractionDelimiterString( sal_uInt16 nNumFor ) const
+{
+ const ImpSvNumberformatInfo& rInfo = NumFor[nNumFor].Info();
+ sal_uInt16 nAnz = NumFor[nNumFor].GetCount();
+ return lcl_GetIntegerFractionDelimiterString( rInfo, nAnz );
+}
+
bool SvNumberformat::GetOutputString(double fNumber, sal_uInt16 nCharCount, OUString& rOutString) const
{
using namespace std;