summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2023-10-11 08:59:59 -0400
committerHenry Castro <hcastro@collabora.com>2023-10-18 18:17:51 +0200
commitc9319cdfa269ff3e043f012731406bf3fd4e1810 (patch)
tree587f1c7ad7a1d73a6e57d1f363f361fa340e82ee
parent0121412b57b0be847474547f00686aa335dcd2a5 (diff)
sc: ui: fix cell bidi layout strings
The default constructor OutputDevice set the layout text to "vcl::text::ComplexTextLayoutFlags::BiDiRtl" for all strings, however the each cell string can be mixed LTR and RTL. Set the defaults to auto detect the correct text layout mode. . Signed-off-by: Henry Castro <hcastro@collabora.com> Change-Id: I0c451e8014fd13490db4213adca3d83ea4572819 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157831 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> (cherry picked from commit f63e02b99691a0d8c8addba2518ecdf6b4319c52) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157952
-rw-r--r--sc/source/ui/view/output2.cxx14
1 files changed, 11 insertions, 3 deletions
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 302f2db07a01..e944eb0e0a08 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -1521,14 +1521,22 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co
{
bool bOrigIsInLayoutStrings = mpDoc->IsInLayoutStrings();
mpDoc->SetLayoutStrings(true);
- comphelper::ScopeGuard g([this, bOrigIsInLayoutStrings] {
- mpDoc->SetLayoutStrings(bOrigIsInLayoutStrings);
- });
OSL_ENSURE( mpDev == mpRefDevice ||
mpDev->GetMapMode().GetMapUnit() == mpRefDevice->GetMapMode().GetMapUnit(),
"LayoutStrings: different MapUnits ?!?!" );
+ vcl::text::ComplexTextLayoutFlags eTextLayout = mpDev->GetLayoutMode();
+ comphelper::ScopeGuard g([this, bOrigIsInLayoutStrings, eTextLayout] {
+ mpDoc->SetLayoutStrings(bOrigIsInLayoutStrings);
+
+ if (mpDev->GetLayoutMode() != eTextLayout)
+ mpDev->SetLayoutMode(eTextLayout);
+ });
+
+ if (mpDev->GetLayoutMode() != vcl::text::ComplexTextLayoutFlags::Default)
+ mpDev->SetLayoutMode(vcl::text::ComplexTextLayoutFlags::Default);
+
sc::IdleSwitch aIdleSwitch(*mpDoc, false);
// Try to limit interpreting to only visible cells. Calling e.g. IsValue()