include/vcl/outdev.hxx | 3 ++- vcl/source/outdev/text.cxx | 11 ++++++----- 2 files changed, 8 insertions(+), 6 deletions(-)
New commits: commit 3d27b1148b7ac54c39632baef16e9695c5e92d85 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Thu Jan 13 10:45:01 2022 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Thu Jan 13 13:50:48 2022 +0100 split up ImplPrepareLayoutArgs a little no logic change intended Change-Id: Id24fb2647e2e6c00a485165edd7fc265ad090c23 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128373 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index 13c8c49064b7..02faeb1477fb 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -1230,8 +1230,9 @@ public: o3tl::span<const sal_Int32> pLogicDXArray={}, SalLayoutFlags flags = SalLayoutFlags::NONE, vcl::text::TextLayoutCache const* = nullptr, const SalLayoutGlyphs* pGlyphs = nullptr) const; + SAL_DLLPRIVATE vcl::text::ImplLayoutArgs ImplPrepareLayoutArgs( OUString&, const sal_Int32 nIndex, const sal_Int32 nLen, - DeviceCoordinate nPixelWidth, const DeviceCoordinate* pPixelDXArray, + DeviceCoordinate nPixelWidth, SalLayoutFlags flags = SalLayoutFlags::NONE, vcl::text::TextLayoutCache const* = nullptr) const; SAL_DLLPRIVATE std::unique_ptr<SalLayout> diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index 0e9cf85492e3..916bff7cab2d 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -1149,7 +1149,7 @@ void OutputDevice::DrawStretchText( const Point& rStartPt, sal_uLong nWidth, vcl::text::ImplLayoutArgs OutputDevice::ImplPrepareLayoutArgs( OUString& rStr, const sal_Int32 nMinIndex, const sal_Int32 nLen, - DeviceCoordinate nPixelWidth, const DeviceCoordinate* pDXArray, + DeviceCoordinate nPixelWidth, SalLayoutFlags nLayoutFlags, vcl::text::TextLayoutCache const*const pLayoutCache) const { @@ -1242,7 +1242,6 @@ vcl::text::ImplLayoutArgs OutputDevice::ImplPrepareLayoutArgs( OUString& rStr, aLayoutArgs.SetOrientation( nOrientation ); aLayoutArgs.SetLayoutWidth( nPixelWidth ); - aLayoutArgs.SetDXArray( pDXArray ); return aLayoutArgs; } @@ -1339,6 +1338,9 @@ std::unique_ptr<SalLayout> OutputDevice::ImplLayout(const OUString& rOrigStr, nPixelWidth = LogicWidthToDeviceCoordinate( nLogicalWidth ); } + vcl::text::ImplLayoutArgs aLayoutArgs = ImplPrepareLayoutArgs( aStr, nMinIndex, nLen, + nPixelWidth, flags, pLayoutCache); + std::unique_ptr<DeviceCoordinate[]> xDXPixelArray; DeviceCoordinate* pDXPixelArray(nullptr); if( !pDXArray.empty() ) @@ -1370,8 +1372,7 @@ std::unique_ptr<SalLayout> OutputDevice::ImplLayout(const OUString& rOrigStr, } } - vcl::text::ImplLayoutArgs aLayoutArgs = ImplPrepareLayoutArgs( aStr, nMinIndex, nLen, - nPixelWidth, pDXPixelArray, flags, pLayoutCache); + aLayoutArgs.SetDXArray(pDXPixelArray); // get matching layout object for base font std::unique_ptr<SalLayout> pSalLayout = mpGraphics->GetTextLayout(0); @@ -1426,7 +1427,7 @@ std::shared_ptr<vcl::text::TextLayoutCache> OutputDevice::CreateTextLayoutCache( bool OutputDevice::GetTextIsRTL( const OUString& rString, sal_Int32 nIndex, sal_Int32 nLen ) const { OUString aStr( rString ); - vcl::text::ImplLayoutArgs aArgs = ImplPrepareLayoutArgs( aStr, nIndex, nLen, 0, nullptr ); + vcl::text::ImplLayoutArgs aArgs = ImplPrepareLayoutArgs(aStr, nIndex, nLen, 0); bool bRTL = false; int nCharPos = -1; if (!aArgs.GetNextPos(&nCharPos, &bRTL))