sw/source/core/text/itradj.cxx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
New commits: commit b558b96493f3e78445f2071232d59ac1ddbaa78e Author: Jonathan Clark <jonat...@libreoffice.org> AuthorDate: Tue Aug 27 01:31:08 2024 -0600 Commit: Jonathan Clark <jonat...@libreoffice.org> CommitDate: Tue Aug 27 12:06:01 2024 +0200 tdf#162639 sw: Fix kashida justification affected by zoom level Writer kashida justification layout was using the output device to measure the space available for kashida glyphs, rather than the reference device. This caused layout to change depending on zoom. Change-Id: I9b3d400ea7a31503d85cbe71253068f7e8a037aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172454 Tested-by: Jenkins Reviewed-by: Jonathan Clark <jonat...@libreoffice.org> diff --git a/sw/source/core/text/itradj.cxx b/sw/source/core/text/itradj.cxx index e93ece45ce29..7d0011682b39 100644 --- a/sw/source/core/text/itradj.cxx +++ b/sw/source/core/text/itradj.cxx @@ -161,7 +161,7 @@ static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, SwTextSizeInfo& rInf, sal_Int32 nKashidaIdx = 0; while ( rKashidas && nIdx < nEnd ) { - rItr.SeekAndChgAttrIter( nIdx, rInf.GetOut() ); + rItr.SeekAndChgAttrIter(nIdx, rInf.GetRefDev()); TextFrameIndex nNext = rItr.GetNextAttr(); // is there also a script change before? @@ -184,7 +184,7 @@ static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, SwTextSizeInfo& rInf, if (nKashidasInAttr > 0) { // Kashida glyph looks suspicious, skip Kashida justification - if ( rInf.GetOut()->GetMinKashida() <= 0 ) + if (rInf.GetRefDev()->GetMinKashida() <= 0) { return false; } @@ -197,15 +197,16 @@ static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, SwTextSizeInfo& rInf, } else { - vcl::text::ComplexTextLayoutFlags nOldLayout = rInf.GetOut()->GetLayoutMode(); - rInf.GetOut()->SetLayoutMode ( nOldLayout | vcl::text::ComplexTextLayoutFlags::BiDiRtl ); - nKashidasDropped = rInf.GetOut()->ValidateKashidas( + vcl::text::ComplexTextLayoutFlags nOldLayout = rInf.GetRefDev()->GetLayoutMode(); + rInf.GetRefDev()->SetLayoutMode(nOldLayout + | vcl::text::ComplexTextLayoutFlags::BiDiRtl); + nKashidasDropped = rInf.GetRefDev()->ValidateKashidas( rInf.GetText(), /*nIdx=*/sal_Int32{ nIdx }, /*nLen=*/sal_Int32{ nWholeNext - nIdx }, /*nPartIdx=*/sal_Int32{ nIdx }, /*nPartLen=*/sal_Int32{ nNext - nIdx }, std::span(aKashidaPos).subspan(nKashidaIdx, nKashidasInAttr), &aKashidaPosDropped); - rInf.GetOut()->SetLayoutMode ( nOldLayout ); + rInf.GetRefDev()->SetLayoutMode(nOldLayout); if ( nKashidasDropped ) { aCastKashidaPosDropped.clear(); @@ -239,7 +240,7 @@ static bool lcl_CheckKashidaWidth ( SwScriptInfo& rSI, SwTextSizeInfo& rInf, SwT TextFrameIndex nEnd = rItr.GetEnd(); while ( nIdx < nEnd ) { - rItr.SeekAndChgAttrIter( nIdx, rInf.GetOut() ); + rItr.SeekAndChgAttrIter(nIdx, rInf.GetRefDev()); TextFrameIndex nNext = rItr.GetNextAttr(); // is there also a script change before? @@ -252,7 +253,7 @@ static bool lcl_CheckKashidaWidth ( SwScriptInfo& rSI, SwTextSizeInfo& rInf, SwT nNext = nEnd; sal_Int32 nKashidasInAttr = rSI.KashidaJustify(nullptr, nullptr, nIdx, nNext - nIdx); - tools::Long nFontMinKashida = rInf.GetOut()->GetMinKashida(); + tools::Long nFontMinKashida = rInf.GetRefDev()->GetMinKashida(); if ( nFontMinKashida && nKashidasInAttr > 0 && SwScriptInfo::IsArabicText( rInf.GetText(), nIdx, nNext - nIdx ) ) { sal_Int32 nKashidasDropped = 0;