From 2ecf17f0823a2042d3cd3514d09fee53aa90ef96 Mon Sep 17 00:00:00 2001 From: YWX Date: Wed, 17 Jan 2018 22:52:35 +0800 Subject: [PATCH] Update for Code::Blocks Release 17.12 fix type assert error in CFortranIndentConfigDlg --- .gitignore | 1 + CFortranIndentConfigDlg.cpp | 6 ++-- FormatFortranIndentPlugin-unix.cbp | 26 +++++++------- FormatFortranIndentPlugin.cbp | 55 +++++++++++++++++++----------- FormatFortranIndentPlugin.xrc | 4 +-- 5 files changed, 52 insertions(+), 40 deletions(-) diff --git a/.gitignore b/.gitignore index 3464c87..3d28f47 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ *.[oa] *.obj # Ignore build +cbplugin *.dll *.so *.zip diff --git a/CFortranIndentConfigDlg.cpp b/CFortranIndentConfigDlg.cpp index b199799..390859b 100644 --- a/CFortranIndentConfigDlg.cpp +++ b/CFortranIndentConfigDlg.cpp @@ -52,7 +52,7 @@ void CFortranIndentConfigDlg::LoadSettings() XRCCTRL(*this, "cb_UseTab", wxCheckBox)->SetValue( myFortranIndentConfig.isUseTab ); XRCCTRL(*this, "cb_UseTab", wxCheckBox)->Enable( ! myFortranIndentConfig.isSameAsEditor ); XRCCTRL(*this, "sp_TabWidth", wxSpinCtrl)->SetValue( myFortranIndentConfig.iTabWidth ); - XRCCTRL(*this, "sp_TabWidth", wxCheckBox)->Enable( ! ( myFortranIndentConfig.isSameAsEditor || myFortranIndentConfig.isUseTab ) ); + XRCCTRL(*this, "sp_TabWidth", wxSpinCtrl)->Enable( ! ( myFortranIndentConfig.isSameAsEditor || myFortranIndentConfig.isUseTab ) ); XRCCTRL(*this, "cb_KeepBlankLineOnly", wxCheckBox)->SetValue( myFortranIndentConfig.isKeepBlankLineOnly ); XRCCTRL(*this, "cb_TrimLineFromRight", wxCheckBox)->SetValue( myFortranIndentConfig.isTrimLineFromRight ); XRCCTRL(*this, "rb_PreprocessorType", wxRadioBox)->SetSelection( myFortranIndentConfig.iPreprocessorType ); @@ -75,11 +75,11 @@ void CFortranIndentConfigDlg::OnIsSameAsEditorClick(wxCommandEvent& event) bool isSameAsEditor = XRCCTRL(*this, "cb_SameAsEditor", wxCheckBox)->GetValue(); XRCCTRL(*this, "cb_UseTab", wxCheckBox)->Enable( ! ( isSameAsEditor ) ); bool isUseTab = XRCCTRL(*this, "cb_UseTab", wxCheckBox)->GetValue(); - XRCCTRL(*this, "sp_TabWidth", wxCheckBox)->Enable( ! ( isSameAsEditor || isUseTab ) ); + XRCCTRL(*this, "sp_TabWidth", wxSpinCtrl)->Enable( ! ( isSameAsEditor || isUseTab ) ); } void CFortranIndentConfigDlg::OnIsUseTabClick(wxCommandEvent& event) { /// - XRCCTRL(*this, "sp_TabWidth", wxCheckBox)->Enable( ! ( XRCCTRL(*this, "cb_UseTab", wxCheckBox)->GetValue() ) ); + XRCCTRL(*this, "sp_TabWidth", wxSpinCtrl)->Enable( ! ( XRCCTRL(*this, "cb_UseTab", wxCheckBox)->GetValue() ) ); // event.IsChecked() } diff --git a/FormatFortranIndentPlugin-unix.cbp b/FormatFortranIndentPlugin-unix.cbp index 1448cc3..2d30501 100644 --- a/FormatFortranIndentPlugin-unix.cbp +++ b/FormatFortranIndentPlugin-unix.cbp @@ -7,19 +7,16 @@