diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 05:03:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 05:03:13 +0000 |
commit | 26f6ae4122fcce6bafa71c064f5e645c39022082 (patch) | |
tree | b0e0916f682785b3a983b71950c4623988ca6eef /sc/source/ui/view/tabview.cxx | |
parent | Adding upstream version 4:24.2.2. (diff) | |
download | libreoffice-upstream/4%24.2.3.tar.xz libreoffice-upstream/4%24.2.3.zip |
Adding upstream version 4:24.2.3.upstream/4%24.2.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sc/source/ui/view/tabview.cxx')
-rw-r--r-- | sc/source/ui/view/tabview.cxx | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 9eff50195e..a69ab1447f 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -1091,7 +1091,7 @@ void ScTabView::ScrollHdl(ScrollAdaptor* pScroll) nViewPos = aViewData.GetPosY( (pScroll == aVScrollTop.get()) ? SC_SPLIT_TOP : SC_SPLIT_BOTTOM ); - bool bLayoutRTL = aViewData.GetDocument().IsLayoutRTL( aViewData.GetTabNo() ); + bool bLayoutRTL = bHoriz && aViewData.GetDocument().IsLayoutRTL( aViewData.GetTabNo() ); ScrollType eType = pScroll->GetScrollType(); if ( eType == ScrollType::Drag ) @@ -1129,7 +1129,7 @@ void ScTabView::ScrollHdl(ScrollAdaptor* pScroll) nScrollMin = aViewData.GetFixPosX(); if ( aViewData.GetVSplitMode()==SC_SPLIT_FIX && pScroll == aVScrollBottom.get() ) nScrollMin = aViewData.GetFixPosY(); - tools::Long nScrollPos = GetScrollBarPos( *pScroll ) + nScrollMin; + tools::Long nScrollPos = GetScrollBarPos( *pScroll, bLayoutRTL ) + nScrollMin; OUString aHelpStr; tools::Rectangle aRect; @@ -1162,6 +1162,22 @@ void ScTabView::ScrollHdl(ScrollAdaptor* pScroll) else bDragging = false; + if ( bHoriz && bLayoutRTL ) + { + // change scroll type so visible/previous cells calculation below remains the same + switch ( eType ) + { + case ScrollType::LineUp: eType = ScrollType::LineDown; break; + case ScrollType::LineDown: eType = ScrollType::LineUp; break; + case ScrollType::PageUp: eType = ScrollType::PageDown; break; + case ScrollType::PageDown: eType = ScrollType::PageUp; break; + default: + { + // added to avoid warnings + } + } + } + tools::Long nDelta(0); switch ( eType ) { @@ -1194,7 +1210,7 @@ void ScTabView::ScrollHdl(ScrollAdaptor* pScroll) if ( aViewData.GetVSplitMode()==SC_SPLIT_FIX && pScroll == aVScrollBottom.get() ) nScrollMin = aViewData.GetFixPosY(); - tools::Long nScrollPos = GetScrollBarPos( *pScroll ) + nScrollMin; + tools::Long nScrollPos = GetScrollBarPos( *pScroll, bLayoutRTL ) + nScrollMin; nDelta = nScrollPos - nViewPos; // tdf#152406 Disable anti-jitter code for scroll wheel events |