summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-09-03 10:12:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-09-03 13:15:21 +0200
commit104847ed014e95a915d314de7091c7d572eade67 (patch)
tree64c39309a1af6e0ed3587716010124f9e6a71d24
parent6eee0843d4b354b849a21e6cb0978936d5f4dd01 (diff)
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 <noel.grandin@collabora.co.uk>
-rw-r--r--vcl/inc/sallayout.hxx2
-rw-r--r--vcl/source/gdi/CommonSalLayout.cxx13
2 files changed, 6 insertions, 9 deletions
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.