summaryrefslogtreecommitdiff
path: root/sw/source/core/txtnode/fntcache.cxx
diff options
context:
space:
mode:
authorKhaled Hosny <khaled@libreoffice.org>2023-06-08 16:41:18 +0300
committerخالد حسني <khaled@libreoffice.org>2023-06-10 19:05:13 +0200
commit74b6c5ea3c333de7c5e7ef8636732edadd9083f2 (patch)
treec3977eb3e89449dc30c6bfa5f2b68e9eaf6db274 /sw/source/core/txtnode/fntcache.cxx
parent30662ae380e3d31cc8904fcb1ceeb2592504834d (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/+/152743 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
Diffstat (limited to 'sw/source/core/txtnode/fntcache.cxx')
-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 e125906767f6..bc5dd603a433 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 )