From 84ad4fe061ebfbbcdc0ffeec329e117250627157 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 29 Apr 2022 16:13:25 +0100 Subject: tdf#148432 in LTR UI override the navigator treeview direction for RTL doc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit based on the first page directionality Change-Id: Ifa1a67dd0db53afb125bcea29df83e776f9e65d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133646 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sw/source/uibase/utlui/content.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'sw') diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 3cb1fd4aede2..12f5d9e9f121 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -18,6 +18,7 @@ */ #include +#include #include #include #include @@ -43,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -2972,6 +2974,16 @@ void SwContentTree::SetActiveShell(SwWrtShell* pSh) m_eState = State::ACTIVE; bClear = true; } + + // tdf#148432 in LTR UI override the navigator treeview direction based on + // the first page directionality + if (m_pActiveShell && !AllSettings::GetLayoutRTL()) + { + const SwPageDesc& rDesc = m_pActiveShell->GetPageDesc(0); + const SvxFrameDirectionItem& rFrameDir = rDesc.GetMaster().GetFrameDir(); + m_xTreeView->set_direction(rFrameDir.GetValue() == SvxFrameDirection::Horizontal_RL_TB); + } + // Only if it is the active view, the array will be deleted and // the screen filled new. if (State::ACTIVE == m_eState && bClear) -- cgit