Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
[FIXED] Patch for what I think is an coding bug in compileroptionsdlg.cpp
(1/1)
stahta01:
FYI:
While trying to patch Code::Blocks for wxWidgets 2.9x I found an place where an string is compared to an int.
Tim S
PS: I have been up for over an day; so, take that into consideration.
excerpt from compilerfactory.h
--- Code: ---static const wxString& GetDefaultCompilerID();
--- End code ---
excerpt from compileroptionsdlg.cpp
--- Code: --- int idx = XRCCTRL(*this, "cmbCompiler", wxChoice)->GetSelection();
int count = XRCCTRL(*this, "cmbCompiler", wxChoice)->GetCount(); // compilers count
Compiler* compiler = CompilerFactory::GetCompiler(idx);
XRCCTRL(*this, "btnSetDefaultCompiler", wxButton)->Enable(CompilerFactory::GetDefaultCompilerID() != idx);
--- End code ---
Patch that I think is needed
--- Code: ---Index: src/plugins/compilergcc/compileroptionsdlg.cpp
===================================================================
--- src/plugins/compilergcc/compileroptionsdlg.cpp (revision 5204)
+++ src/plugins/compilergcc/compileroptionsdlg.cpp (working copy)
@@ -2124,7 +2124,7 @@
int count = XRCCTRL(*this, "cmbCompiler", wxChoice)->GetCount(); // compilers count
Compiler* compiler = CompilerFactory::GetCompiler(idx);
- XRCCTRL(*this, "btnSetDefaultCompiler", wxButton)->Enable(CompilerFactory::GetDefaultCompilerID() != idx);
+ XRCCTRL(*this, "btnSetDefaultCompiler", wxButton)->Enable(CompilerFactory::GetCompilerIndex(CompilerFactory::GetDefaultCompiler()) != idx);
XRCCTRL(*this, "btnAddCompiler", wxButton)->Enable(en);
XRCCTRL(*this, "btnRenameCompiler", wxButton)->Enable(en && count);
XRCCTRL(*this, "btnDelCompiler", wxButton)->Enable(en &&
--- End code ---
MortenMacFly:
--- Quote from: stahta01 on September 18, 2008, 04:45:44 pm ---Patch that I think is needed
--- End quote ---
Applied in SVN. Thanks!
Navigation
[0] Message Index
Go to full version