summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorKhaled Hosny <khaled@libreoffice.org>2023-06-08 16:41:18 +0300
committerAndras Timar <andras.timar@collabora.com>2023-06-26 09:27:04 +0200
commit95a2b31b2245daca3e833628be2d48d9f09995ea (patch)
treec42866c625827f09a3d505b5bbea26a6862efdb0 /sw
parent766e051f5069b925b0ac2e86043b475eda6db24a (diff)
tdf#151968: Fix vertical position of RTL spelling wavy line
Second try. This time making sure start > end even for RTL text. This also now works for horizontal, vertical and rotated Arabic text, in Writer and Edit Engine. Change-Id: I6fe1e9dbb9c071287054200a58d4ddddee073311 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152820 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/txtnode/fntcache.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index e6958ec6cb90..47f7e8eb71de 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -241,10 +241,20 @@ static void lcl_calcLinePos( const CalcLinePosData &rData,
break;
}
+ // tdf#151968
+ // if start < end, OutputDevice::DrawWaveLine() will think it is a rotated
+ // line, so we swap nStart and nEnd to avoid this.
+ if ( rData.bBidiPor )
+ std::swap(rStart, rEnd);
+
if ( rData.bSwitchL2R )
{
rData.rInf.GetFrame()->SwitchLTRtoRTL( rStart );
rData.rInf.GetFrame()->SwitchLTRtoRTL( rEnd );
+
+ // tdf#151968
+ // We need to do this here as well for LTR text in a RTL paragraph.
+ std::swap(rStart, rEnd);
}
if ( rData.bSwitchH2V )