diff options
-rw-r--r-- | basctl/source/basicide/baside2.cxx | 2 | ||||
-rw-r--r-- | basctl/source/basicide/baside2b.cxx | 2 | ||||
-rw-r--r-- | basctl/source/basicide/linenumberwindow.cxx | 4 | ||||
-rw-r--r-- | vcl/inc/vcl/outdev.hxx | 3 | ||||
-rw-r--r-- | vcl/source/gdi/outdev3.cxx | 12 |
5 files changed, 9 insertions, 14 deletions
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx index f8962c5f7c31..f8690cc77c4f 100644 --- a/basctl/source/basicide/baside2.cxx +++ b/basctl/source/basicide/baside2.cxx @@ -888,7 +888,7 @@ sal_Int32 ModulWindow::FormatAndPrint( Printer* pPrinter, sal_Int32 nPrintPage ) // nLinepPage is not correct if there's a line break sal_uInt16 nLinespPage = (sal_uInt16) (aPaperSz.Height()/nLineHeight); - sal_uInt16 nCharspLine = (sal_uInt16) (aPaperSz.Width() / pPrinter->GetTextWidth( 'X' ) ); + sal_uInt16 nCharspLine = (sal_uInt16) (aPaperSz.Width() / pPrinter->GetTextWidth( "X" ) ); sal_uLong nParas = GetEditEngine()->GetParagraphCount(); sal_uInt16 nPages = (sal_uInt16) (nParas/nLinespPage+1 ); diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index bb81726502f5..bc683f65e23f 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -786,7 +786,7 @@ void EditorWindow::InitScrollBars() { rModulWindow.GetHScrollBar()->SetVisibleSize( aOutSz.Width() ); rModulWindow.GetHScrollBar()->SetPageSize( aOutSz.Width() * 8 / 10 ); - rModulWindow.GetHScrollBar()->SetLineSize( GetTextWidth( OUString('x') ) ); + rModulWindow.GetHScrollBar()->SetLineSize( GetTextWidth( "x" ) ); rModulWindow.GetHScrollBar()->SetThumbPos( pEditView->GetStartDocPos().X() ); rModulWindow.GetHScrollBar()->Show(); } diff --git a/basctl/source/basicide/linenumberwindow.cxx b/basctl/source/basicide/linenumberwindow.cxx index 2bd4dbef1351..56d01cfb8a4b 100644 --- a/basctl/source/basicide/linenumberwindow.cxx +++ b/basctl/source/basicide/linenumberwindow.cxx @@ -41,7 +41,7 @@ LineNumberWindow::LineNumberWindow (Window* pParent, ModulWindow* pModulWindow) m_nCurYOffset(0) { SetBackground(Wallpaper(GetSettings().GetStyleSettings().GetFieldColor())); - m_nBaseWidth = GetTextWidth('8'); + m_nBaseWidth = GetTextWidth("8"); m_nWidth = m_nBaseWidth * 3 + m_nBaseWidth / 2; } @@ -79,7 +79,7 @@ void LineNumberWindow::Paint( const Rectangle& ) // FIXME: it would be best if we could get notified of a font change // rather than doing that re-calculation at each Paint event - m_nBaseWidth = GetTextWidth(OUString('8')); + m_nBaseWidth = GetTextWidth("8"); // reserve enough for 3 sigit minimum, with a bit to spare for confort m_nWidth = m_nBaseWidth * 3 + m_nBaseWidth / 2; 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 ) |