editeng/source/editeng/impedit.cxx | 5 +++-- sc/source/ui/view/viewdata.cxx | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-)
New commits: commit 148a3603cf15af45840888139690356e18555b08 Author: Henry Castro <hcas...@collabora.com> AuthorDate: Wed Apr 19 09:50:56 2023 -0400 Commit: Henry Castro <hcas...@collabora.com> CommitDate: Tue May 2 21:04:17 2023 +0200 lok: sc: fix layout RTL The function "IsRightToLeft" fails in Hebrew language when Calc has a layout RTL, add additional condition to check the layout. Signed-off-by: Henry Castro <hcas...@collabora.com> Change-Id: If3972b80770a7aa6073881487e411a34cc6871d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150758 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index 461cbcd16faf..3e25d15af1c6 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -524,7 +524,8 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, vcl::Region* pRegion, bool bStartHandleVisible = false; bool bEndHandleVisible = false; - bool bLOKCalcRTL = mpLOKSpecialPositioning && pEditEngine->IsRightToLeft(nStartPara); + bool bLOKCalcRTL = mpLOKSpecialPositioning && + (mpLOKSpecialPositioning->IsLayoutRTL() || pEditEngine->IsRightToLeft(nStartPara)); auto DrawHighlight = [&, nStartLine = sal_Int32(0), nEndLine = sal_Int32(0)]( const ImpEditEngine::LineAreaInfo& rInfo) mutable { @@ -1355,7 +1356,7 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor ) Point aRefPointLogical = GetOutputArea().TopLeft(); // Get the relative coordinates w.r.t refpoint in display hmm. aCursorRectPureLogical.Move(-aRefPointLogical.X(), -aRefPointLogical.Y()); - if (pEditEngine->IsRightToLeft(nPara)) + if (pEditEngine->IsRightToLeft(nPara) || mpLOKSpecialPositioning->IsLayoutRTL()) { tools::Long nMirrorW = GetOutputArea().GetWidth(); tools::Long nLeft = aCursorRectPureLogical.Left(), nRight = aCursorRectPureLogical.Right(); diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 1f2991e23fb3..26a765eaa73a 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -1523,6 +1523,7 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich, bool bLOKActive = comphelper::LibreOfficeKit::isActive(); bool bLOKPrintTwips = bLOKActive && comphelper::LibreOfficeKit::isCompatFlagSet( comphelper::LibreOfficeKit::Compat::scPrintTwipsMsgs); + bool bLOKLayoutRTL = bLOKActive && bLayoutRTL; bool bWasThere = false; if (pEditView[eWhich]) @@ -1621,6 +1622,9 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich, pEditView[eWhich]->SetLOKSpecialOutputArea(aPTwipsRect); } + if (bLOKLayoutRTL) + pEditView[eWhich]->SetLOKSpecialFlags(LOKSpecialFlags::LayoutRTL); + tools::Rectangle aOutputArea = pWin->PixelToLogic( aPixRect, GetLogicMode() ); pEditView[eWhich]->SetOutputArea( aOutputArea );