summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorJohann Messner <johann.messner@jku.at>2012-08-28 10:51:15 +0100
committerNoel Power <noel.power@suse.com>2012-08-28 11:12:44 +0100
commitf727644ad18838a78525256623a33f864fe13fb2 (patch)
tree93523dc27d562b757a8ce81c9fea1c7a9fa65f9a /svl
parent1efa576ef88141c4deb5da9818537e053dc6517b (diff)
tweaking the "fill in character" support in Calc Number Format Strings
a) changed ordering of repeat code marker ( 0x1b ) and repeat code to more sensible ( and correct imo ) order b) prevent some possible div/0 errors c) added some missing formatter 'GetOutputString' calls
Diffstat (limited to 'svl')
-rw-r--r--svl/inc/svl/zforlist.hxx4
-rw-r--r--svl/source/numbers/zforlist.cxx14
-rw-r--r--svl/source/numbers/zformat.cxx6
3 files changed, 17 insertions, 7 deletions
diff --git a/svl/inc/svl/zforlist.hxx b/svl/inc/svl/zforlist.hxx
index 983cf83089f9..1cace08d22bf 100644
--- a/svl/inc/svl/zforlist.hxx
+++ b/svl/inc/svl/zforlist.hxx
@@ -489,14 +489,14 @@ public:
Formats only if the format code is of type text or the 4th subcode
of a format code is specified, otherwise sOutString will be == "" */
void GetOutputString( String& sString, sal_uInt32 nFIndex,
- String& sOutString, Color** ppColor );
+ String& sOutString, Color** ppColor, bool bUseStarFormat = false );
/** Format a string according to a format index, return string and color.
Formats only if the format code is of type text or the 4th subcode
of a format code is specified, otherwise sOutString will be == "" */
void GetOutputString( rtl::OUString& sString, sal_uInt32 nFIndex,
- rtl::OUString& sOutString, Color** ppColor );
+ rtl::OUString& sOutString, Color** ppColor, bool bUseStarFormat = false );
/** Format a number according to the standard default format matching
the given format index */
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 2dbed7993c03..c5172a2972b9 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -1441,7 +1441,8 @@ void SvNumberFormatter::GetOutputString(const double& fOutNumber,
void SvNumberFormatter::GetOutputString(String& sString,
sal_uInt32 nFIndex,
String& sOutString,
- Color** ppColor )
+ Color** ppColor,
+ bool bUseStarFormat )
{
SvNumberformat* pFormat = GetFormatEntry( nFIndex );
if (!pFormat)
@@ -1454,7 +1455,11 @@ void SvNumberFormatter::GetOutputString(String& sString,
else
{
ChangeIntl(pFormat->GetLanguage());
+ if ( bUseStarFormat )
+ pFormat->SetStarFormatSupport( true );
pFormat->GetOutputString(sString, sOutString, ppColor);
+ if ( bUseStarFormat )
+ pFormat->SetStarFormatSupport( false );
}
}
@@ -1485,7 +1490,8 @@ void SvNumberFormatter::GetOutputString(const double& fOutNumber,
void SvNumberFormatter::GetOutputString(rtl::OUString& sString,
sal_uInt32 nFIndex,
rtl::OUString& sOutString,
- Color** ppColor)
+ Color** ppColor,
+ bool bUseStarFormat )
{
SvNumberformat* pFormat = GetFormatEntry( nFIndex );
if (!pFormat)
@@ -1500,7 +1506,11 @@ void SvNumberFormatter::GetOutputString(rtl::OUString& sString,
ChangeIntl(pFormat->GetLanguage());
String aString = sString;
String aOutString = sOutString;
+ if ( bUseStarFormat )
+ pFormat->SetStarFormatSupport( true );
pFormat->GetOutputString(aString, aOutString, ppColor);
+ if ( bUseStarFormat )
+ pFormat->SetStarFormatSupport( false );
sString = aString;
sOutString = aOutString;
}
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 729ea17c6171..8c30d2442390 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -3881,8 +3881,8 @@ bool SvNumberformat::ImpGetNumberOutput(double fNumber,
case NF_SYMBOLTYPE_STAR:
if( bStarFlag )
{
- sStr.Insert( (sal_Unicode) 0x1B, k /*++*/ );
sStr.Insert(rInfo.sStrArray[j].GetChar(1),k);
+ sStr.Insert( (sal_Unicode) 0x1B, k );
bRes = true;
}
break;
@@ -4001,8 +4001,8 @@ bool SvNumberformat::ImpNumberFillWithThousands(
case NF_SYMBOLTYPE_STAR:
if( bStarFlag )
{
- sStr.Insert( (sal_Unicode) 0x1B, k/*++*/ );
sStr.Insert(rInfo.sStrArray[j].GetChar(1),k);
+ sStr.Insert( (sal_Unicode) 0x1B, k );
bRes = true;
}
break;
@@ -4165,8 +4165,8 @@ bool SvNumberformat::ImpNumberFill( String& sStr, // number string
case NF_SYMBOLTYPE_STAR:
if( bStarFlag )
{
- sStr.Insert( sal_Unicode(0x1B), k++ );
sStr.Insert(rInfo.sStrArray[j].GetChar(1),k);
+ sStr.Insert( sal_Unicode(0x1B), k );
bRes = true;
}
break;