diff options
-rw-r--r-- | starmath/source/ElementsDockingWindow.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx index 5c43b4f7f8bb..aef1d2598d60 100644 --- a/starmath/source/ElementsDockingWindow.cxx +++ b/starmath/source/ElementsDockingWindow.cxx @@ -285,7 +285,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) , m_nSmSyntaxVersion(SM_MOD()->GetConfig()->GetDefaultSmSyntaxVersion()) , mbVerticalMode(true) , mxScroll(std::move(xScrolledWindow)) @@ -1014,7 +1014,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 @@ -1029,9 +1029,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; switch(m_nSmSyntaxVersion) { |