sw/source/core/text/txttab.cxx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
New commits: commit 721b1aca38a851c390f8e00ea96b761198db8bd5 Author: Caolán McNamara <caol...@redhat.com> Date: Tue Nov 27 22:12:05 2012 +0000 String::Fill -> OUStringBuffer::padToLength Change-Id: I1a2bba922d583b9f38bb6617d46c4fc0874f4844 diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx index 6342731..1fe1f94 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); } } }
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits