diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-11-27 22:12:05 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-11-27 22:12:05 +0000 |
commit | 721b1aca38a851c390f8e00ea96b761198db8bd5 (patch) | |
tree | f3fda9c48f4e0867bcb27c3e863bc02c36f22f0b /sw | |
parent | 96248beb79e299203ae6aafea9798a0668707294 (diff) |
String::Fill -> OUStringBuffer::padToLength
Change-Id: I1a2bba922d583b9f38bb6617d46c4fc0874f4844
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/text/txttab.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx index 6342731f25f4..1fe1f9476d70 100644 --- a/sw/source/core/text/txttab.cxx +++ b/sw/source/core/text/txttab.cxx @@ -28,8 +28,10 @@ #include "hintids.hxx" +#include <comphelper/string.hxx> #include <editeng/lrspitem.hxx> #include <editeng/tstpitem.hxx> +#include <rtl/ustrbuf.hxx> #include <IDocumentSettingAccess.hxx> #include <frmatr.hxx> #include <SwPortionHandler.hxx> @@ -617,14 +619,15 @@ void SwTabPortion::Paint( const SwTxtPaintInfo &rInf ) const if( rInf.GetFont()->IsPaintBlank() ) { // tabs with filling / filled tabs - UniString aTxt = OUString(' '); - const KSHORT nCharWidth = rInf.GetTxtSize( aTxt ).Width(); + const KSHORT nCharWidth = rInf.GetTxtSize(OUString(' ')).Width(); // robust: if( nCharWidth ) { // 6864: always with kerning, also on printer! KSHORT nChar = Width() / nCharWidth; - rInf.DrawText( aTxt.Fill( nChar, ' ' ), *this, 0, nChar, sal_True ); + rtl::OUStringBuffer aBuf; + comphelper::string::padToLength(aBuf, nChar, ' '); + rInf.DrawText(aBuf.makeStringAndClear(), *this, 0, nChar, sal_True); } } @@ -632,8 +635,7 @@ void SwTabPortion::Paint( const SwTxtPaintInfo &rInf ) const if( IsFilled() ) { // tabs with filling / filled tabs - UniString aTxt = OUString(cFill); - const KSHORT nCharWidth = rInf.GetTxtSize( aTxt ).Width(); + const KSHORT nCharWidth = rInf.GetTxtSize(OUString(cFill)).Width(); OSL_ENSURE( nCharWidth, "!SwTabPortion::Paint: sophisticated tabchar" ); // robust: if( nCharWidth ) @@ -642,7 +644,9 @@ void SwTabPortion::Paint( const SwTxtPaintInfo &rInf ) const KSHORT nChar = Width() / nCharWidth; if ( cFill == '_' ) ++nChar; // to avoid gaps (Bug 13430) - rInf.DrawText( aTxt.Fill( nChar, cFill ), *this, 0, nChar, sal_True ); + rtl::OUStringBuffer aBuf; + comphelper::string::padToLength(aBuf, nChar, cFill); + rInf.DrawText(aBuf.makeStringAndClear(), *this, 0, nChar, sal_True); } } } |