summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorChr. Rossmanith <ChrRossmanith@gmx.de>2013-03-24 20:34:33 +0100
committerPetr Mladek <pmladek@suse.cz>2013-03-28 13:48:02 +0000
commit91c1161dd9e1fc73c91608f1320197daadd5ea2e (patch)
tree4774d79f10a377e1be958deecc69c96abd211613 /vcl
parent9c06d2bd253ad6a50141a5b51409dbdffcfd9e6d (diff)
Use OUString and sal_Int32 in GetTextWidth()
Change-Id: I0b3cdbe8576300d098027cc98d7dff841d148f18 Reviewed-on: https://gerrit.libreoffice.org/3097 Reviewed-by: Petr Mladek <pmladek@suse.cz> Tested-by: Petr Mladek <pmladek@suse.cz>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/vcl/outdev.hxx3
-rw-r--r--vcl/source/gdi/outdev3.cxx12
2 files changed, 5 insertions, 10 deletions
diff --git a/vcl/inc/vcl/outdev.hxx b/vcl/inc/vcl/outdev.hxx
index 44a5979ff21f..3f4fdbd81dce 100644
--- a/vcl/inc/vcl/outdev.hxx
+++ b/vcl/inc/vcl/outdev.hxx
@@ -573,8 +573,7 @@ public:
void DrawText( const Point& rStartPt, const XubString& rStr,
xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN,
MetricVector* pVector = NULL, OUString* pDisplayText = NULL );
- long GetTextWidth( const XubString& rStr, xub_StrLen nIndex = 0,
- xub_StrLen nLen = STRING_LEN ) const;
+ long GetTextWidth( const OUString& rStr, sal_Int32 nIndex = 0, sal_Int32 nLen = -1 ) const;
/// Height where any character of the current font fits; in logic coordinates.
long GetTextHeight() const;
float approximate_char_width() const;
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 4ce3714d1850..b588b08d3ccf 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -5470,15 +5470,11 @@ void OutputDevice::DrawText( const Point& rStartPt, const String& rStr,
mpAlphaVDev->DrawText( rStartPt, rStr, nIndex, nLen, pVector, pDisplayText );
}
-long OutputDevice::GetTextWidth( const String& rStr,
- xub_StrLen nIndex, xub_StrLen nLen ) const
+long OutputDevice::GetTextWidth( const OUString& rStr, sal_Int32 nIndex, sal_Int32 nLen ) const
{
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
- sal_Int32 nLen2 = (nLen == STRING_LEN) ? -1 : nLen; // only needed until nLen is sal_Int32
- sal_Int32 nIndex2 = nIndex; // ditto
- OUString aTmpStr(rStr);
- long nWidth = GetTextArray( aTmpStr, NULL, nIndex2, nLen2 );
+ long nWidth = GetTextArray( rStr, NULL, nIndex, nLen );
return nWidth;
}
@@ -5504,7 +5500,7 @@ long OutputDevice::GetTextHeight() const
float OutputDevice::approximate_char_width() const
{
- return GetTextWidth(rtl::OUString("aemnnxEM")) / 8.0;
+ return GetTextWidth("aemnnxEM") / 8.0;
}
void OutputDevice::DrawTextArray( const Point& rStartPt, const String& rStr,
@@ -6357,7 +6353,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
}
else
{
- long nTextWidth = _rLayout.GetTextWidth( aStr, 0, STRING_LEN );
+ long nTextWidth = _rLayout.GetTextWidth( aStr, 0, -1 );
// Evt. Text kuerzen
if ( nTextWidth > nWidth )