]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/mnemonics.cpp
simplify code to return from the end of the function
[wxWidgets.git] / src / gtk / mnemonics.cpp
index e78bd5dd6d396a815fc71d4f86a79d1d08c72559..12891c4b9dbc24d159d25e631f1e38ab8f383cce 100644 (file)
     #pragma hdrstop
 #endif
 
-#include "wx/private/stattext.h"        // for wxMarkupEntities
-
+#include "wx/log.h"
 #include "wx/gtk/private/mnemonics.h"
 
+namespace
+{
+
+// ----------------------------------------------------------------------------
+// constants
+// ----------------------------------------------------------------------------
+
+// Names of the standard XML entities.
+const char *const entitiesNames[] =
+{
+    "&", "<", ">", "'", """
+};
+
+} // anonymous namespace
+
 // ============================================================================
 // implementation
 // ============================================================================
@@ -66,9 +80,9 @@ static wxString GTKProcessMnemonics(const wxString& label, MnemonicsFlag flag)
                     size_t distanceFromEnd = label.end() - i;
 
                     // is this ampersand introducing a mnemonic or rather an entity?
-                    for (size_t j=0; j < wxMARKUP_ENTITY_MAX; j++)
+                    for (size_t j=0; j < WXSIZEOF(entitiesNames); j++)
                     {
-                        const wxChar *entity = wxMarkupEntities[wxMARKUP_ELEMENT_NAME][j];
+                        const char *entity = entitiesNames[j];
                         size_t entityLen = wxStrlen(entity);
 
                         if (distanceFromEnd >= entityLen &&