[calligra] segfault when opening a new doc / new from template (#819371)

Rex Dieter rdieter at fedoraproject.org
Mon May 7 12:18:20 UTC 2012


commit bd616766242cd8dd231c94782f3e7068b6e9b104
Author: Rex Dieter <rdieter at fedoraproject.org>
Date:   Mon May 7 07:20:45 2012 -0500

    segfault when opening a new doc / new from template (#819371)

 calligra-2.4.1-kocolorset.patch |   78 +++++++++++++++++++++++++++++++++++++++
 calligra.spec                   |   17 ++++++--
 2 files changed, 90 insertions(+), 5 deletions(-)
---
diff --git a/calligra-2.4.1-kocolorset.patch b/calligra-2.4.1-kocolorset.patch
new file mode 100644
index 0000000..953951c
--- /dev/null
+++ b/calligra-2.4.1-kocolorset.patch
@@ -0,0 +1,78 @@
+From: Boudewijn Rempt <boud at valdyas.org>
+Date: Thu, 19 Apr 2012 13:09:01 +0000
+Subject: Guard KoColorSet with QPointer
+X-Git-Url: http://quickgit.kde.org/?p=calligra.git&amp;a=commitdiff&amp;h=36a4964b13cb1e7087e4d5ca5f576ca13e58bb45
+---
+Guard KoColorSet with QPointer
+
+This makes sure that if the colorset the popup action refers to is
+deleted or invalid, we don't get crashes
+
+BUG:298412
+---
+
+
+--- a/libs/widgets/KoColorPopupAction.cpp
++++ b/libs/widgets/KoColorPopupAction.cpp
+@@ -45,7 +45,7 @@
+ class KoColorPopupAction::KoColorPopupActionPrivate
+ {
+ public:
+-    KoColorPopupActionPrivate() 
++    KoColorPopupActionPrivate()
+         : colorSetWidget(0), colorChooser(0), opacitySlider(0), menu(0), checkerPainter(4)
+         , showFilter(true), applyMode(true)
+     {}
+@@ -81,7 +81,9 @@ KoColorPopupAction::KoColorPopupAction(Q
+ 
+     KoResourceServer<KoColorSet>* srv = KoResourceServerProvider::instance()->paletteServer();
+     QList<KoColorSet*> palettes = srv->resources();
+-    d->colorSetWidget->setColorSet(palettes.first());
++    if (palettes.size() > 0) {
++        d->colorSetWidget->setColorSet(palettes.first());
++    }
+ 
+     d->colorChooser = new KoTriangleColorSelector( widget );
+     // prevent mouse release on color selector from closing popup
+@@ -109,9 +111,9 @@ KoColorPopupAction::KoColorPopupAction(Q
+ 
+     connect(d->colorSetWidget, SIGNAL(colorChanged(const KoColor &, bool)), this, SLOT(colorWasSelected(const KoColor &, bool)));
+ 
+-    connect( d->colorChooser, SIGNAL( colorChanged( const QColor &) ), 
++    connect( d->colorChooser, SIGNAL( colorChanged( const QColor &) ),
+              this, SLOT( colorWasEdited( const QColor &) ) );
+-    connect( d->opacitySlider, SIGNAL(valueChanged(int)), 
++    connect( d->opacitySlider, SIGNAL(valueChanged(int)),
+              this, SLOT(opacityWasChanged(int)));
+ }
+ 
+@@ -169,7 +171,7 @@ void KoColorPopupAction::updateIcon( )
+     {
+         pm = QImage(iconSize, QImage::Format_ARGB32_Premultiplied);
+         pm.fill(Qt::transparent);
+-        // there was no icon set so we assume 
++        // there was no icon set so we assume
+         // that we create an icon from the current color
+         d->applyMode = false;
+     }
+
+--- a/libs/widgets/KoColorSetWidget.cpp
++++ b/libs/widgets/KoColorSetWidget.cpp
+@@ -31,6 +31,7 @@
+ #include <QMenu>
+ #include <QWidgetAction>
+ #include <QDir>
++#include <QPointer>
+ #include <QScrollArea>
+ 
+ #include <kglobal.h>
+@@ -49,7 +50,7 @@
+ class KoColorSetWidget::KoColorSetWidgetPrivate {
+ public:
+     KoColorSetWidget *thePublic;
+-    KoColorSet *colorSet;
++    QPointer<KoColorSet> colorSet;
+     QTimer m_timer;
+     QVBoxLayout *mainLayout;
+     bool firstShowOfContainer;
+
diff --git a/calligra.spec b/calligra.spec
index a4ab05f..7fb6922 100644
--- a/calligra.spec
+++ b/calligra.spec
@@ -8,7 +8,7 @@
 
 Name:    calligra 
 Version: 2.4.1
-Release: 2%{?dist}
+Release: 3%{?dist}
 Summary: An integrated office suite
 
 License: GPLv2+ and LGPLv2+
@@ -16,11 +16,14 @@ URL:     http://www.calligra-suite.org/
 Source0: http://download.kde.org/stable/calligra-%{version}/calligra-%{version}.tar.bz2
 
 ## upstreamable patches
-# scripts missed tables->sheets rename
-# upstreamed http://quickgit.kde.org/?p=calligra.git&a=commit&h=c19ebfe046ebfad35f1fec54a3e75e9986db2643
-Patch51: calligra-2.3.92-tables_to_sheets.patch
 
 ## upstream patches
+# scripts missed tables->sheets rename
+# upstreamed http://quickgit.kde.org/?p=calligra.git&a=commit&h=c19ebfe046ebfad35f1fec54a3e75e9986db2643
+Patch101: calligra-2.3.92-tables_to_sheets.patch
+# Calligra Products segfault when opening a new doc / new from template, http://bugzilla.redhat.com/819371
+# Crash when opening a new document with custom settings, http://bugs.kde.org/298412
+Patch102: calligra-2.4.1-kocolorset.patch
 
 BuildRequires: boost-devel
 BuildRequires: bzip2-devel bzip2
@@ -418,7 +421,8 @@ Requires: okular%{?_kde4_version: >= %{_kde4_version}}
 %prep
 %setup -q
 
-%patch51 -p1 -b .tables_to_sheets
+%patch101 -p1 -b .tables_to_sheets
+%patch102 -p1 -b .kocolorset
 
 ## kdchart munging begin
 pushd plugins/chartshape/kdchart
@@ -1111,6 +1115,9 @@ fi
 
 
 %changelog
+* Mon May 07 2012 Rex Dieter <rdieter at fedoraproject.org> 2.4.1-3
+- segfault when opening a new doc / new from template (#819371)
+
 * Wed May 02 2012 Rex Dieter <rdieter at fedoraproject.org> - 2.4.1-2
 - rebuild (exiv2)
 


More information about the scm-commits mailing list