Blob Blame History Raw
From f232b831d439bac53a662c32032c7a0abd430d5e Mon Sep 17 00:00:00 2001
From: Stephan Bergmann <sbergman@redhat.com>
Date: Mon, 16 Dec 2013 13:53:30 +0100
Subject: [PATCH 075/109] m_bHasActive must be false after last visible entry
 is removed
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

...otherwise, ExtensionBox_Impl::RecalcAll would crash in CalcActiveHeight(-1).

Change-Id: If399825951c79b821ed44ebefa19d1032ab4f850
(cherry picked from commit 661f7bdefc8215f742951727b93395d47293cf0e)
Reviewed-on: https://gerrit.libreoffice.org/7097
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
---
 desktop/source/deployment/gui/dp_gui_extlistbox.cxx | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
index 19d2749..0d48d55 100644
--- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
@@ -1224,7 +1224,13 @@ void ExtensionBox_Impl::checkEntries()
                 if ( nPos < m_nActive )
                     m_nActive -= 1;
                 else if ( ( nPos == m_nActive ) && ( nPos == (long) m_vEntries.size() - 1 ) )
+                {
                     m_nActive -= 1;
+                    if (m_nActive == -1)
+                    {
+                        m_bHasActive = false;
+                    }
+                }
                 m_vRemovedEntries.push_back( *iIndex );
                 m_vEntries.erase( iIndex );
                 iIndex = m_vEntries.begin() + nPos;
-- 
1.8.4.2