include/vcl/outdev.hxx | 2 +- vcl/source/outdev/text.cxx | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-)
New commits: commit 47c4d0fbdc681287f2fd9f5240ca1ce7a960ec18 Author: Chris Sherlock <chris.sherloc...@gmail.com> AuthorDate: Sun Sep 24 02:52:32 2023 +1000 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Sep 27 16:55:10 2023 +0200 vcl: remove rTargetDevice from OutputDevice::ImplGetEllipsisString() Change-Id: I886510af06bbfb77e24ea004cc3abfd6ff3a8832 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157194 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index f2fdf7ab7db7..9b9a80af0fc9 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -1201,7 +1201,7 @@ private: SAL_DLLPRIVATE static void ImplUpdateFontDataForAllFrames( FontUpdateHandler_t pHdl, bool bNewFontLists ); static - SAL_DLLPRIVATE OUString ImplGetEllipsisString( const OutputDevice& rTargetDevice, const OUString& rStr, + SAL_DLLPRIVATE OUString ImplGetEllipsisString( const OUString& rStr, tools::Long nMaxWidth, DrawTextFlags nStyle, const vcl::ITextLayout& _rLayout ); SAL_DLLPRIVATE void ImplDrawEmphasisMark( tools::Long nBaseX, tools::Long nX, tools::Long nY, const tools::PolyPolygon& rPolyPoly, bool bPolyLine, const tools::Rectangle& rRect1, const tools::Rectangle& rRect2 ); diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index d5509650900a..6e9aacbb4567 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -1641,7 +1641,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const tools::Recta aLastLineBuffer[ i ] = ' '; } aLastLine = aLastLineBuffer.makeStringAndClear(); - aLastLine = ImplGetEllipsisString( rTargetDevice, aLastLine, nWidth, nStyle, _rLayout ); + aLastLine = ImplGetEllipsisString( aLastLine, nWidth, nStyle, _rLayout ); nStyle &= ~DrawTextFlags(DrawTextFlags::VCenter | DrawTextFlags::Bottom); nStyle |= DrawTextFlags::Top; } @@ -1728,7 +1728,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const tools::Recta { if ( nStyle & TEXT_DRAW_ELLIPSIS ) { - aStr = ImplGetEllipsisString( rTargetDevice, aStr, nWidth, nStyle, _rLayout ); + aStr = ImplGetEllipsisString( aStr, nWidth, nStyle, _rLayout ); nStyle &= ~DrawTextFlags(DrawTextFlags::Center | DrawTextFlags::Right); nStyle |= DrawTextFlags::Left; nTextWidth = _rLayout.GetTextWidth( aStr, 0, aStr.getLength() ); @@ -2018,10 +2018,10 @@ OUString OutputDevice::GetEllipsisString( const OUString& rOrigStr, tools::Long DrawTextFlags nStyle ) const { vcl::DefaultTextLayout aTextLayout( *const_cast< OutputDevice* >( this ) ); - return ImplGetEllipsisString( *this, rOrigStr, nMaxWidth, nStyle, aTextLayout ); + return ImplGetEllipsisString( rOrigStr, nMaxWidth, nStyle, aTextLayout ); } -OUString OutputDevice::ImplGetEllipsisString( const OutputDevice& rTargetDevice, const OUString& rOrigStr, tools::Long nMaxWidth, +OUString OutputDevice::ImplGetEllipsisString( const OUString& rOrigStr, tools::Long nMaxWidth, DrawTextFlags nStyle, const vcl::ITextLayout& _rLayout ) { OUString aStr = rOrigStr; @@ -2085,7 +2085,7 @@ OUString OutputDevice::ImplGetEllipsisString( const OutputDevice& rTargetDevice, OUString aLastStr = aStr.copy(nLastContent); OUString aTempLastStr1 = "..." + aLastStr; if ( _rLayout.GetTextWidth( aTempLastStr1, 0, aTempLastStr1.getLength() ) > nMaxWidth ) - aStr = OutputDevice::ImplGetEllipsisString( rTargetDevice, aStr, nMaxWidth, nStyle | DrawTextFlags::EndEllipsis, _rLayout ); + aStr = OutputDevice::ImplGetEllipsisString( aStr, nMaxWidth, nStyle | DrawTextFlags::EndEllipsis, _rLayout ); else { sal_Int32 nFirstContent = 0; @@ -2100,7 +2100,7 @@ OUString OutputDevice::ImplGetEllipsisString( const OutputDevice& rTargetDevice, nFirstContent++; // MEM continue here if ( nFirstContent >= nLastContent ) - aStr = OutputDevice::ImplGetEllipsisString( rTargetDevice, aStr, nMaxWidth, nStyle | DrawTextFlags::EndEllipsis, _rLayout ); + aStr = OutputDevice::ImplGetEllipsisString( aStr, nMaxWidth, nStyle | DrawTextFlags::EndEllipsis, _rLayout ); else { if ( nFirstContent > 4 ) @@ -2108,7 +2108,7 @@ OUString OutputDevice::ImplGetEllipsisString( const OutputDevice& rTargetDevice, OUString aFirstStr = OUString::Concat(aStr.subView( 0, nFirstContent )) + "..."; OUString aTempStr = aFirstStr + aLastStr; if ( _rLayout.GetTextWidth( aTempStr, 0, aTempStr.getLength() ) > nMaxWidth ) - aStr = OutputDevice::ImplGetEllipsisString( rTargetDevice, aStr, nMaxWidth, nStyle | DrawTextFlags::EndEllipsis, _rLayout ); + aStr = OutputDevice::ImplGetEllipsisString( aStr, nMaxWidth, nStyle | DrawTextFlags::EndEllipsis, _rLayout ); else { do