From 1152d1908692b3e1ea3408563528830950ed6611 Mon Sep 17 00:00:00 2001 From: Dan Horák Date: Jun 12 2019 21:23:14 +0000 Subject: - use upstream fix for #1650875 --- diff --git a/codeblocks-17.12-scripting.patch b/codeblocks-17.12-scripting.patch index b592e1c..6b52d2c 100644 --- a/codeblocks-17.12-scripting.patch +++ b/codeblocks-17.12-scripting.patch @@ -1,13 +1,51 @@ -diff -up codeblocks-17.12/src/src/scriptingsettingsdlg.cpp.orig codeblocks-17.12/src/src/scriptingsettingsdlg.cpp ---- codeblocks-17.12/src/src/scriptingsettingsdlg.cpp.orig 2019-06-07 12:40:43.015517665 +0200 -+++ codeblocks-17.12/src/src/scriptingsettingsdlg.cpp 2019-06-07 12:41:28.369846067 +0200 -@@ -93,7 +93,8 @@ void ScriptingSettingsDlg::FillScripts() - } - } +From 22a4af265c78c2d0000c7f234d15b8bf5ff8b2c4 Mon Sep 17 00:00:00 2001 +From: fuscated +Date: Wed, 12 Jun 2019 19:11:23 +0000 +Subject: [PATCH] * UI: Fix crash if the list in Settings->Scripting is empty + (ticket 842) + +git-svn-id: https://svn.code.sf.net/p/codeblocks/code/trunk@11739 2a5c6006-c6dd-42ca-98ab-0921f2732cef +--- + src/src/scriptingsettingsdlg.cpp | 25 ++++++++++++++++--------- + 1 file changed, 16 insertions(+), 9 deletions(-) + +diff --git a/src/src/scriptingsettingsdlg.cpp b/src/src/scriptingsettingsdlg.cpp +index 5cb23aaf4..a7f58f0cb 100644 +--- a/src/src/scriptingsettingsdlg.cpp ++++ b/src/src/scriptingsettingsdlg.cpp +@@ -101,16 +101,23 @@ void ScriptingSettingsDlg::UpdateState() + wxListCtrl* list = XRCCTRL(*this, "chkStartupScripts", wxListCtrl); + long sel = list->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); -- UpdateState(); -+ if (keys.GetCount() > 0) -+ UpdateState(); +- bool en = sel != -1; +- +- const ScriptEntry& se = m_ScriptsVector[sel]; ++ bool hasSelection = false; ++ bool enabled = false; ++ bool registered = false; ++ if (sel >= 0 && sel < long(m_ScriptsVector.size())) ++ { ++ const ScriptEntry& se = m_ScriptsVector[sel]; ++ enabled = se.enabled; ++ registered = se.registered; ++ hasSelection = true; ++ } + +- XRCCTRL(*this, "btnDelete", wxButton)->Enable(en); +- XRCCTRL(*this, "chkEnableScript", wxCheckBox)->Enable(en); +- XRCCTRL(*this, "txtScript", wxTextCtrl)->Enable(en && se.enabled); +- XRCCTRL(*this, "btnBrowseScript", wxButton)->Enable(en && se.enabled); +- XRCCTRL(*this, "chkRegisterScript", wxCheckBox)->Enable(en && se.enabled); +- XRCCTRL(*this, "txtScriptMenu", wxTextCtrl)->Enable(en && se.enabled && se.registered); ++ XRCCTRL(*this, "btnDelete", wxButton)->Enable(hasSelection); ++ XRCCTRL(*this, "chkEnableScript", wxCheckBox)->Enable(hasSelection); ++ XRCCTRL(*this, "txtScript", wxTextCtrl)->Enable(hasSelection && enabled); ++ XRCCTRL(*this, "btnBrowseScript", wxButton)->Enable(hasSelection && enabled); ++ XRCCTRL(*this, "chkRegisterScript", wxCheckBox)->Enable(hasSelection && enabled); ++ XRCCTRL(*this, "txtScriptMenu", wxTextCtrl)->Enable(hasSelection && enabled && registered); } - void ScriptingSettingsDlg::UpdateState() + void ScriptingSettingsDlg::FillTrusts() +-- +2.21.0 + diff --git a/codeblocks.spec b/codeblocks.spec index 91b50b9..86b8a04 100644 --- a/codeblocks.spec +++ b/codeblocks.spec @@ -7,7 +7,7 @@ Name: codeblocks Version: 17.12 -Release: 12%{?svnrelease}%{?dist} +Release: 13%{?svnrelease}%{?dist} Summary: An open source, cross platform, free C++ IDE License: GPLv3+ URL: http://www.codeblocks.org/ @@ -20,6 +20,7 @@ Source0: https://sourceforge.net/projects/%{name}/files/Sources/%{version}/%{nam Patch0: codeblocks-autorev.patch Patch1: astyle-3.1.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1650875 +# https://sourceforge.net/p/codeblocks/code/11739/ Patch2: codeblocks-17.12-scripting.patch BuildRequires: gcc @@ -349,6 +350,9 @@ echo "%{_libdir}/%{name}/wxContribItems" > %{buildroot}/%{_sysconfdir}/ld.so.con %changelog +* Wed Jun 12 2019 Dan Horák - 17.12-13 +- use upstream fix for #1650875 + * Fri Jun 07 2019 Dan Horák - 17.12-12 - fix crash in Settings->Scripting (#1650875)