summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-04-21 16:57:32 +0100
committerAndras Timar <andras.timar@collabora.com>2021-04-27 21:54:57 +0200
commit423a628743139becce8ab86ee2c87b5a95f20001 (patch)
tree8c36ca8db54e9e362f4784b3bf824ea66f056344 /starmath
parentbfa8913c7ab45281452d48f340cd64f429680aa9 (diff)
Related: tdf#140659 off by one indexes because scrollbar is now outside
and not inside the control so it doesn't need to be accounted for as a child Change-Id: I77b55ec8d9b515850817417664df8944b4e44204 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114451 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/ElementsDockingWindow.cxx8
1 files changed, 3 insertions, 5 deletions
diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx
index 0ee85b49eab8..e8365df87f01 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -288,7 +288,7 @@ SmElementsControl::SmElementsControl(std::unique_ptr<weld::ScrolledWindow> xScro
: mpDocShell(new SmDocShell(SfxModelFlags::EMBEDDED_OBJECT))
, m_nCurrentElement(SAL_MAX_UINT16)
, m_nCurrentRolloverElement(SAL_MAX_UINT16)
- , m_nCurrentOffset(1) // Default offset of 1 due to the ScrollBar child
+ , m_nCurrentOffset(0)
, mbVerticalMode(true)
, mxScroll(std::move(xScrolledWindow))
, m_bFirstPaintAfterLayout(false)
@@ -1018,7 +1018,7 @@ void SmElementsControl::addElements(const SmElementDescr aElementsArray[], sal_u
void SmElementsControl::build()
{
// The order is important!
- // 1. Ensure there are no items left, including the default scrollbar!
+ // 1. Ensure there are no items left
// 2. Release all the current accessible items.
// This will check for new items after releasing them!
// 3. Set the cursor element
@@ -1033,9 +1033,7 @@ void SmElementsControl::build()
setCurrentElement(SAL_MAX_UINT16);
- // The first element is the scrollbar. We can't change its indexInParent
- // value, as this is set by being a child of the SmElementsControl.
- m_nCurrentOffset = 1;
+ m_nCurrentOffset = 0;
for (sal_uInt16 n = 0; n < SAL_N_ELEMENTS(m_aCategories); ++n)
{
if (msCurrentSetId == std::get<0>(m_aCategories[n]))