Sisyphus repositório
Última atualização: 1 outubro 2023 | SRPMs: 18631 | Visitas: 37749091
en ru br
ALT Linux repositórios
S:3.2.1-alt6

Group :: Escritórios
RPM: calligra

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

Patch: 0010-ChartTool-KoFormulaTool-Guard-against-crash-if-activ.patch
Download


From 3bedba886436fb6cee2d92f446d4674ae431cab0 Mon Sep 17 00:00:00 2001
From: Dag Andersen <dag.andersen@kdemail.net>
Date: Tue, 30 Jun 2020 09:08:42 +0200
Subject: [PATCH 10/54] ChartTool, KoFormulaTool: Guard against crash if
 activated without shape
---
 plugins/chartshape/ChartTool.cpp       | 5 ++++-
 plugins/formulashape/KoFormulaTool.cpp | 4 ++++
 2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/plugins/chartshape/ChartTool.cpp b/plugins/chartshape/ChartTool.cpp
index 33d9bb6d876..3fbf8c49f11 100644
--- a/plugins/chartshape/ChartTool.cpp
+++ b/plugins/chartshape/ChartTool.cpp
@@ -267,7 +267,10 @@ void ChartTool::activate(ToolActivation, const QSet<KoShape*> &shapes)
 void ChartTool::deactivate()
 {
     debugChartTool<<d->shape;
-
+    if (!d->shape) {
+        // activated without shape
+        return;
+    }
     foreach (QWidget *w, optionWidgets()) {
         ConfigWidgetBase *configWidget = dynamic_cast<ConfigWidgetBase*>(w);
         if (configWidget)
diff --git a/plugins/formulashape/KoFormulaTool.cpp b/plugins/formulashape/KoFormulaTool.cpp
index 6db24cad001..070633348ce 100644
--- a/plugins/formulashape/KoFormulaTool.cpp
+++ b/plugins/formulashape/KoFormulaTool.cpp
@@ -128,6 +128,10 @@ void KoFormulaTool::deactivate()
     for (const TemplateAction &templateAction : koAsConst(m_templateActions)) {
         disconnect(templateAction.action, &QAction::triggered, this, nullptr);
     }
+    if (!m_formulaShape) {
+        // activated without shape
+        return;
+    }
     disconnect(m_formulaShape->formulaData(),0,this,0);
     if (canvas()) {
         m_cursorList.append(m_formulaEditor);
-- 
2.31.1
 
projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009