summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-04-21 16:57:32 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2021-04-22 10:28:00 +0200
commitb45629418d91c7452245ae4c6894fa3c1becf237 (patch)
tree5d403100e53faa46838ae0e83073e651bd0dda8d
parent613a80b855406d180a663a4aec974c40be195395 (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>
-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]))