summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2023-10-11 08:59:59 -0400
committerCaolán McNamara <caolan.mcnamara@collabora.com>2023-10-13 09:48:29 +0200
commitf63e02b99691a0d8c8addba2518ecdf6b4319c52 (patch)
tree0776615817908b695d0395366bf7adfcff431b9d /sc
parentffa1798661dab15435190972a98e6277ced05f4e (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>
Diffstat (limited to 'sc')
-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 d8dfb064e605..8543f2f517c7 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -1481,14 +1481,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()