summaryrefslogtreecommitdiffstats
path: root/sc
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 /sc
parentfdo#52052 fix RTF import of page breaks on landscape pages (diff)
downloadcore-f727644ad18838a78525256623a33f864fe13fb2.tar.gz
core-f727644ad18838a78525256623a33f864fe13fb2.zip
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 'sc')
-rw-r--r--sc/source/core/tool/cellform.cxx6
-rw-r--r--sc/source/ui/view/output2.cxx6
2 files changed, 6 insertions, 6 deletions
diff --git a/sc/source/core/tool/cellform.cxx b/sc/source/core/tool/cellform.cxx
index 5fdd0d2f1035..93f71fbcb090 100644
--- a/sc/source/core/tool/cellform.cxx
+++ b/sc/source/core/tool/cellform.cxx
@@ -63,7 +63,7 @@ void ScCellFormat::GetString( ScBaseCell* pCell, sal_uLong nFormat, rtl::OUStrin
case CELLTYPE_STRING:
{
rtl::OUString aCellString = ((ScStringCell*)pCell)->GetString();
- rFormatter.GetOutputString( aCellString, nFormat, rString, ppColor );
+ rFormatter.GetOutputString( aCellString, nFormat, rString, ppColor, bUseStarFormat );
}
break;
case CELLTYPE_EDIT:
@@ -135,12 +135,12 @@ void ScCellFormat::GetString( ScBaseCell* pCell, sal_uLong nFormat, rtl::OUStrin
if ( !bNullVals && fValue == 0.0 )
rString = rtl::OUString();
else
- rFormatter.GetOutputString( fValue, nFormat, rString, ppColor );
+ rFormatter.GetOutputString( fValue, nFormat, rString, ppColor, bUseStarFormat );
}
else
{
rtl::OUString aCellString = pFCell->GetString();
- rFormatter.GetOutputString( aCellString, nFormat, rString, ppColor );
+ rFormatter.GetOutputString( aCellString, nFormat, rString, ppColor, bUseStarFormat );
}
}
}
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index d4f2f7e28e14..956bf686336a 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -508,8 +508,7 @@ sal_Bool ScDrawStringsVars::SetText( ScBaseCell* pCell )
nPos = aString.Search( 0x1B );
if ( nPos != STRING_NOTFOUND )
{
- nPos = nPos - 1;
- nChar = aString.GetChar( nPos );
+ nChar = aString.GetChar( nPos + 1 );
// delete placeholder and char to repeat
aString.Erase( nPos, 2 );
}
@@ -553,10 +552,11 @@ void ScDrawStringsVars::SetHashText()
void ScDrawStringsVars::RepeatToFill( long colWidth )
{
- if ( nPos == STRING_NOTFOUND || nPos >= aString.Len() )
+ if ( nPos == STRING_NOTFOUND || nPos > aString.Len() )
return;
long charWidth = pOutput->pFmtDevice->GetTextWidth(rtl::OUString(nChar));
+ if ( charWidth < 1) return;
if (bPixelToLogic)
colWidth = pOutput->mpRefDevice->PixelToLogic(Size(colWidth,0)).Width();
// Are there restrictions on the cell type we should filter out here ?