Unnecessary:
#if wxCHECK_VERSION(2, 9, 0)
Manager::Get()->GetLogManager()->DebugLog(F(_T("workspace config: '%s'"), s.wx_str()));
#else
Manager::Get()->GetLogManager()->DebugLog(F(_T("workspace config: '%s'"), s.c_str()));
#endif
Only:
Manager::Get()->GetLogManager()->DebugLog(F(_T("workspace config: '%s'"), s.wx_str()));
Unnecessary:
#if wxCHECK_VERSION(2, 9, 0)
switch (str[pos].GetValue())
#else
switch (str[pos])
#endif
Only:
switch ((wxChar)str[pos])
Or:
switch ((wxChar)str.GetChar(pos))
Unnecessary:
#if wxCHECK_VERSION(2, 9, 0)
str.Append(m_Buffer[startIndex], writeLen);
#else
str.Append(&m_Buffer[startIndex], writeLen);
#endif
Only:
str.Append((const wxChar*)m_Buffer + startIndex, writeLen);
Unnecessary:
#if wxCHECK_VERSION(2, 9, 0)
txtParent->SetLabel(wxString::Format(_T("%s (%d)"), _("<Global namespace>").wx_str(), m_Token->m_ParentIndex));
#else
txtParent->SetLabel(wxString::Format(_T("%s (%d)"), _("<Global namespace>"), m_Token->m_ParentIndex));
#endif
Only:
txtParent->SetLabel(wxString::Format(_T("%s (%d)"), (const wxChar*)_("<Global namespace>"), m_Token->m_ParentIndex));
...
Any comments?
It's not a matter of personal choice. Rather it's to provide a guaranteed compatibility upto wx 2.8.0. For example the following code may not work with wx-2.8.0 as wxString::wx_str() function was not available. At least it is missing in doc. IIRC it was added in the midst of wx 2.8 series.
Manager::Get()->GetLogManager()->DebugLog(F(_T("workspace config: '%s'"), s.wx_str()));
As long as the modified code works both with wx-2.8.x and wx-2.9.x I'm ok with such change.
Means that the problem is in CC not in the wx version:)
No! It's wx problem, not CC.
If you apply this patch, then CC works well in wx-2.9.
Index: src/plugins/codecompletion/nativeparser.cpp
===================================================================
--- src/plugins/codecompletion/nativeparser.cpp (revision 6895)
+++ src/plugins/codecompletion/nativeparser.cpp (working copy)
@@ -480,6 +480,7 @@
void NativeParser::CreateClassBrowser()
{
+ return; // avoid cc crash when use wx-2.9
ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("code_completion"));
if (!m_ClassBrowser && cfg->ReadBool(_T("/use_symbols_browser"), true))
{