vcl/inc/sallayout.hxx | 2 +- vcl/source/gdi/CommonSalLayout.cxx | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-)
New commits: commit 104847ed014e95a915d314de7091c7d572eade67 Author: Noel Grandin <[email protected]> AuthorDate: Fri Sep 3 10:12:01 2021 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Fri Sep 3 13:15:21 2021 +0200 simplify ApplyDXArray method params pass only the required data to it Change-Id: I849780371b71d3620dc36681453f5dbe1527b7bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121577 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx index 93d4b02d7dc8..701be24a5e3e 100644 --- a/vcl/inc/sallayout.hxx +++ b/vcl/inc/sallayout.hxx @@ -200,7 +200,7 @@ private: GenericSalLayout( const GenericSalLayout& ) = delete; GenericSalLayout& operator=( const GenericSalLayout& ) = delete; - void ApplyDXArray(const ImplLayoutArgs&); + void ApplyDXArray(const DeviceCoordinate*, SalLayoutFlags nLayoutFlags); void Justify(DeviceCoordinate nNewWidth); void ApplyAsianKerning(const OUString& rStr); diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx index b2d332c82958..f21c2f572d25 100644 --- a/vcl/source/gdi/CommonSalLayout.cxx +++ b/vcl/source/gdi/CommonSalLayout.cxx @@ -195,7 +195,7 @@ void GenericSalLayout::AdjustLayout(ImplLayoutArgs& rArgs) SalLayout::AdjustLayout(rArgs); if (rArgs.mpDXArray) - ApplyDXArray(rArgs); + ApplyDXArray(rArgs.mpDXArray, rArgs.mnFlags); else if (rArgs.mnLayoutWidth) Justify(rArgs.mnLayoutWidth); // apply asian kerning if the glyphs are not already formatted @@ -633,11 +633,8 @@ void GenericSalLayout::GetCharWidths(DeviceCoordinate* pCharWidths) const // * For any RTL glyph that has DX adjustment, insert enough Kashidas to // fill in the added space. -void GenericSalLayout::ApplyDXArray(const ImplLayoutArgs& rArgs) +void GenericSalLayout::ApplyDXArray(const DeviceCoordinate* pDXArray, SalLayoutFlags nLayoutFlags) { - if (rArgs.mpDXArray == nullptr) - return; - int nCharCount = mnEndCharPos - mnMinCharPos; std::unique_ptr<DeviceCoordinate[]> const pOldCharWidths(new DeviceCoordinate[nCharCount]); std::unique_ptr<DeviceCoordinate[]> const pNewCharWidths(new DeviceCoordinate[nCharCount]); @@ -649,15 +646,15 @@ void GenericSalLayout::ApplyDXArray(const ImplLayoutArgs& rArgs) for (int i = 0; i < nCharCount; ++i) { if (i == 0) - pNewCharWidths[i] = rArgs.mpDXArray[i]; + pNewCharWidths[i] = pDXArray[i]; else - pNewCharWidths[i] = rArgs.mpDXArray[i] - rArgs.mpDXArray[i - 1]; + pNewCharWidths[i] = pDXArray[i] - pDXArray[i - 1]; } bool bKashidaJustify = false; DeviceCoordinate nKashidaWidth = 0; hb_codepoint_t nKashidaIndex = 0; - if (rArgs.mnFlags & SalLayoutFlags::KashidaJustification) + if (nLayoutFlags & SalLayoutFlags::KashidaJustification) { hb_font_t *pHbFont = GetFont().GetHbFont(); // Find Kashida glyph width and index.
