Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => CodeCompletion redesign => Topic started by: oBFusCATed on February 03, 2013, 11:46:39 pm

Title: Strange editor checks
Post by: oBFusCATed on February 03, 2013, 11:46:39 pm
I've just found some strange code in the CC plugin.

There is a variable which holds the name of the start page.
And instead of checking for IsBuiltinEditor it does string compares to the filename.
Can someone familiar with the code check it and verify that it is correct (I highly doubt it is)?

To find it search globally for "g_StartHereTitle".
Title: Re: Strange editor checks
Post by: ollydbg on February 04, 2013, 04:15:25 am
Hi, OBF, good catch, by reading the source code, I see that using "IsBuiltinEditor()" check is better. Currently, only cbEditor class have this bool member variable set "m_IsBuiltinEditor = true;". Will fix it.
Title: Re: Strange editor checks
Post by: ollydbg on February 04, 2013, 08:11:34 am
A testing patch.

I see that the logic of updating the Toolbar was not good, so maybe, it still need refactoring.

A related discussion: Time to refresh the CC Toolbar (http://forums.codeblocks.org/index.php/topic,17276.0.html)
Title: Re: Strange editor checks
Post by: ollydbg on February 16, 2013, 03:03:41 pm
Done.

Quote
Revision: 8844
Author: ollydbg
Date: 2013-2-16 17:20:48
Message:
*CC: Checking a valid builtin editor by using Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor() instead of comparing the global g_StartHereTitle wxString.
-CC: Tweak some comments.
-------------------------------
M : /trunk/src/plugins/codecompletion/codecompletion.cpp

M : /trunk/src/plugins/codecompletion/nativeparser.cpp

M : /trunk/src/plugins/codecompletion/nativeparser.h