https://bugs.documentfoundation.org/show_bug.cgi?id=101686

خالد حسني <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #10 from خالد حسني <[email protected]> ---
I tried to debug this. My findings so far:

* The default paragraph style has direction set to right to left, setting it to
  left to right or inherit fixes the issue.
* For some reason the frames are sometimes RTL and some times LTR and it
changes
  with zoom level.
* For some other reason, when frame is RTL we force the text to be RTL and skip
BiDi algorithm altogether. This sounds wrong and the following patch fixes the
issue, but it might be breaking something else (though I can’t imagine a
legitimate case to force text to be RTL this way, to be honest):

diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index dd436e0358c6..fe07341dcc57 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -292,8 +292,8 @@ void SwTextSizeInfo::CtorInitTextSizeInfo( OutputDevice*
pRenderContext, SwTextF
     // Set default layout mode ( LTR or RTL ).
     if ( m_pFrame->IsRightToLeft() )
     {
-        m_pOut->SetLayoutMode( vcl::text::ComplexTextLayoutFlags::BiDiStrong |
vcl::text::ComplexTextLayoutFlags::BiDiRtl );
-        m_pRef->SetLayoutMode( vcl::text::ComplexTextLayoutFlags::BiDiStrong |
vcl::text::ComplexTextLayoutFlags::BiDiRtl );
+        m_pOut->SetLayoutMode( vcl::text::ComplexTextLayoutFlags::BiDiStrong
);
+        m_pRef->SetLayoutMode( vcl::text::ComplexTextLayoutFlags::BiDiStrong
);
         m_nDirection = DIR_RIGHT2LEFT;
     }
     else

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to