Handle decimalSeparatorAlternative in TakeRepresentation, tdf#81671

Change-Id: I552cb14fcb048d6c7da9043704c9941686a30993
This commit is contained in:
Eike Rathke
2017-10-27 18:18:10 +02:00
parent 7cf453c78c
commit 7c5b9247c4

View File

@@ -130,9 +130,12 @@ OUString SdrMeasureObj::TakeRepresentation(SdrMeasureFieldKind eMeasureFieldKind
aStr = "?";
}
sal_Unicode cDec(SvtSysLocale().GetLocaleData().getNumDecimalSep()[0]);
SvtSysLocale aSysLocale;
const LocaleDataWrapper& rLocaleDataWrapper = aSysLocale.GetLocaleData();
sal_Unicode cDec(rLocaleDataWrapper.getNumDecimalSep()[0]);
sal_Unicode cDecAlt(rLocaleDataWrapper.getNumDecimalSepAlt().toChar());
if(aStr.indexOf(cDec) != -1)
if(aStr.indexOf(cDec) != -1 || (cDecAlt && aStr.indexOf(cDecAlt) != -1))
{
sal_Int32 nLen2(aStr.getLength() - 1);
@@ -142,7 +145,7 @@ OUString SdrMeasureObj::TakeRepresentation(SdrMeasureFieldKind eMeasureFieldKind
nLen2--;
}
if(aStr[nLen2] == cDec)
if(aStr[nLen2] == cDec || (cDecAlt && aStr[nLen2] == cDecAlt))
{
aStr = aStr.copy(0, nLen2);
nLen2--;