Bug #10881 2007-04-13 22:23
ondra_holub
Advanced Regexes not available on some versions of wx lib
In revision 3853, file src/sdk/editormanager.cpp, method EditorManager::Replace are used advanced regular expressions - flag wxRE_ADVANCED. However this flag is available in wxWidgets library only when builtin regexes are used (configure --with-regex=bultin). Otherwise it is not compilable.
I think that either requrement to have wxWidgets library with builtin regex support should be added somewhere or the whole feature with advanced regexes should be #ifdef'ed with wxHAS_REGEX_ADVANCED.
- Category
- Application::WrongBehaviour
- Group
- Status
- Closed
- Close date
- 2007-06-08 09:48
- Assigned to
- biplab
History
You can turn this feature off in Settings->Editor...->General settings->Other options->Use Advanced RegEx searches
Yes, it can be turned off in settings in compiled application. But non-existence of wxRE_ADVANCED causes compilation error.
I don't see why it shouldn't compile...
In wx/regex.h:
#ifdef wxHAS_REGEX_ADVANCED
wxRE_ADVANCED = 1,
#endif
and this file includes wx/features.h:
#ifndef WX_NO_REGEX_ADVANCED
#define wxHAS_REGEX_ADVANCED
#else
#undef wxHAS_REGEX_ADVANCED
#endif
Since CB is compiled without WX_NO_REGEX_ADVANCED there will be no errors unless someone specifies this manually... I think very unlikely to happen...
OK, I am taking my last words back :)
I am working on the patch...
Possible Quick Fix Index: src/sdk/editormanager.cpp =================================================================== --- src/sdk/editormanager.cpp (revision 3858) +++ src/sdk/editormanager.cpp (working copy) @@ -64,6 +64,9 @@ #include "wx/wxFlatNotebook/wxFlatNotebook.h" +#ifndef wxHAS_REGEX_ADVANCED + #define wxRE_ADVANCED wxRE_EXTENDED +#endif namespace compatibility { typedef TernaryCondTypedef<wxMinimumVersion<2,5>::eval, wxTreeItemIdValue, long int>::eval tree_cookie_t; };
I think someone should apply stahta01 patch... It is the best solution so far...
Slightly simpler patch. Tim S Index: src/sdk/editormanager.cpp =================================================================== --- src/sdk/editormanager.cpp (revision 3858) +++ src/sdk/editormanager.cpp (working copy) @@ -64,6 +64,9 @@ #include "wx/wxFlatNotebook/wxFlatNotebook.h" +#ifndef wxHAS_REGEX_ADVANCED + #define wxRE_ADVANCED 0 +#endif namespace compatibility { typedef TernaryCondTypedef<wxMinimumVersion<2,5>::eval, wxTreeItemIdValue, long int>::eval tree_cookie_t; };
Tim, the patch will avoid compilation error. But it may create a False sense of Advanced Feature.
IMHO, it would not be a good idea to keep that option enabled if wxRE_ADVANCED is not at all available during compilation. If an user tries to use advanced regex function with wxRE_ADVANCED set to 0, the function will not work appropriately and we may see another bug report on that case.
I hope I could explain the problem.
This bug is now fixed in HEAD.
Thank you for reporting it.