sbergmann pushed to libreoffice (f21). "Resolves: rhbz#1197614 crash when updating extension"

notifications at fedoraproject.org notifications at fedoraproject.org
Fri Apr 10 13:37:29 UTC 2015


>From b9280c6099e71b99698b89f0ee63e026c23f69ac Mon Sep 17 00:00:00 2001
From: Stephan Bergmann <sbergman at redhat.com>
Date: Fri, 10 Apr 2015 15:37:12 +0200
Subject: Resolves: rhbz#1197614 crash when updating extension


diff --git a/0001-rhbz-1197614-Fix-calculation-of-m_bHasActive-when-re.patch b/0001-rhbz-1197614-Fix-calculation-of-m_bHasActive-when-re.patch
new file mode 100644
index 0000000..bcff6ae
--- /dev/null
+++ b/0001-rhbz-1197614-Fix-calculation-of-m_bHasActive-when-re.patch
@@ -0,0 +1,77 @@
+From 97d4c1a8100c63091401736c93d6bbbb371d5b37 Mon Sep 17 00:00:00 2001
+From: Stephan Bergmann <sbergman at redhat.com>
+Date: Fri, 10 Apr 2015 15:06:53 +0200
+Subject: [PATCH] rhbz#1197614: Fix calculation of m_bHasActive when removing
+ active element
+
+Assume m_vEntries.size() == 2; assume first element (nPos == 0) is m_bActive,
+gets removed, so m_nActive would have stayed at 0 and m_bHasActive at true; then
+assume second element (again nPos == 0, due to the removed element) is m_bNew,
+so nPos <= m_nActive is true and m_nActive gets updated to 1 (and m_bHasActive
+remains true); then selectEntry(nNewPos) (nNewPos == 0) would have tried to
+reset m_vEntries[1]->m_bActive but now m_vEntries.size() == 1.
+
+Change-Id: I31d3bbe97ca99f880aa99bdea015f7c0457f8331
+---
+ desktop/source/deployment/gui/dp_gui_extlistbox.cxx | 21 ++++++++++++++-------
+ 1 file changed, 14 insertions(+), 7 deletions(-)
+
+diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
+index 260100f..b9500a1 100644
+--- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
++++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
+@@ -1035,7 +1035,6 @@ long ExtensionBox_Impl::addEntry( const uno::Reference< deployment::XPackage > &
+     //access to m_nActive must be guarded
+     if ( !m_bInCheckMode && m_bHasActive && ( m_nActive >= nPos ) )
+         m_nActive += 1;
+-
+     guard.clear();
+ 
+     if ( IsReallyVisible() )
+@@ -1172,6 +1171,7 @@ void ExtensionBox_Impl::prepareChecking()
+ void ExtensionBox_Impl::checkEntries()
+ {
+     long nNewPos = -1;
++    long nChangedActivePos = -1;
+     long nPos = 0;
+     bool bNeedsUpdate = false;
+ 
+@@ -1195,15 +1195,19 @@ void ExtensionBox_Impl::checkEntries()
+             }
+             else
+             {   // remove entry from list
++                if (nPos < nNewPos) {
++                    --nNewPos;
++                }
++                if (nPos < nChangedActivePos) {
++                    --nChangedActivePos;
++                }
+                 if ( nPos < m_nActive )
+                     m_nActive -= 1;
+-                else if ( ( nPos == m_nActive ) && ( nPos == (long) m_vEntries.size() - 1 ) )
++                else if ( nPos == m_nActive )
+                 {
+-                    m_nActive -= 1;
+-                    if (m_nActive == -1)
+-                    {
+-                        m_bHasActive = false;
+-                    }
++                    nChangedActivePos = nPos;
++                    m_nActive = -1;
++                    m_bHasActive = false;
+                 }
+                 m_vRemovedEntries.push_back( *iIndex );
+                 m_vEntries.erase( iIndex );
+@@ -1219,6 +1223,9 @@ void ExtensionBox_Impl::checkEntries()
+ 
+     if ( nNewPos != - 1)
+         selectEntry( nNewPos );
++    else if (nChangedActivePos != -1) {
++        selectEntry(nChangedActivePos);
++    }
+ 
+     if ( bNeedsUpdate )
+     {
+-- 
+2.1.0
+
diff --git a/libreoffice.spec b/libreoffice.spec
index 34fe995..a7cb8e3 100644
--- a/libreoffice.spec
+++ b/libreoffice.spec
@@ -48,7 +48,7 @@ Summary:        Free Software Productivity Suite
 Name:           libreoffice
 Epoch:          1
 Version:        %{libo_version}.2
-Release:        8%{?libo_prerelease}%{?dist}
+Release:        9%{?libo_prerelease}%{?dist}
 License:        (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and Artistic and MPLv2.0 and CC0
 Group:          Applications/Productivity
 URL:            http://www.libreoffice.org/
@@ -379,6 +379,7 @@ Patch79: 0001-Resolves-rhbz-1204244-group-sdb-windows-together-as-.patch
 Patch80: 0001-Resolves-tdf-90256-repair-invalid-docking-positions.patch
 Patch81: 0001-Related-fdo-88455-crash-using-delete-in-available-fi.patch
 Patch82: 0001-negative-after-text-indents-ignored-by-msword-for-ap.patch
+Patch83: 0001-rhbz-1197614-Fix-calculation-of-m_bHasActive-when-re.patch
 
 %define instdir %{_libdir}
 %define baseinstdir %{instdir}/libreoffice
@@ -2359,6 +2360,9 @@ update-desktop-database %{_datadir}/applications &> /dev/null || :
 %endif
 
 %changelog
+* Fri Apr 10 2015 Stephan Bergmann <sbergman at redhat.com> - 1:4.3.6.2-9-UNBUILT
+- Resolves: rhbz#1197614 crash when updating extension
+
 * Tue Apr 07 2015 Caolán McNamara <caolanm at redhat.com> - 1:4.3.6.2-8
 - negative after-text indents ignored by msword for apos
 
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/libreoffice.git/commit/?h=f21&id=b9280c6099e71b99698b89f0ee63e026c23f69ac


More information about the scm-commits mailing list