Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37046656
en ru br
Репозитории ALT

Группа :: Офис
Пакет: calligra

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: 0010-ChartTool-KoFormulaTool-Guard-against-crash-if-activ.patch
Скачать


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
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin