[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [calligra/calligra/2.6] plugins/textshape/dialogs: Fix crash on opening StyleManager dialog.
From:       Pierre Stirnweiss <pstirnweiss () googlemail ! com>
Date:       2013-01-10 17:51:19
Message-ID: 20130110175119.7D664A6091 () git ! kde ! org
[Download RAW message or body]

Git commit 04b31d9919116670fac973855c0a61d98ef7aed6 by Pierre Stirnweiss.
Committed on 10/01/2013 at 18:43.
Pushed by pstirnweiss into branch 'calligra/2.6'.

Fix crash on opening StyleManager dialog.

If the styleList is empty, return an invalid style.

BUG: 312972

M  +3    -0    plugins/textshape/dialogs/StylesModel.cpp

http://commits.kde.org/calligra/04b31d9919116670fac973855c0a61d98ef7aed6

diff --git a/plugins/textshape/dialogs/StylesModel.cpp b/plugins/textshape/dialogs/StylesModel.cpp
index 7e33775..80ea48d 100644
--- a/plugins/textshape/dialogs/StylesModel.cpp
+++ b/plugins/textshape/dialogs/StylesModel.cpp
@@ -490,6 +490,9 @@ void StylesModel::updateName(int styleId)
 
 QModelIndex StylesModel::firstStyleIndex()
 {
+    if (!m_styleList.count()) {
+        return QModelIndex();
+    }
     return createIndex(m_styleList.indexOf(m_styleList.at(0)), 0, m_styleList.at(0));
 }
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic