Use wxMarkupParser in wxStaticText for dealing with markup.

No real changes, just remove markup parsing code from wxStaticText
implementation and reuse wxMarkupParser methods there instead.

This makes include/wx/private/stattext.h file unnecessary as it is used only
in a single place now so remove it and move its remaining contents to
src/gtk/mnemonics.cpp.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67050 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2011-02-27 12:46:55 +00:00
parent 5eb051a73b
commit 0d0fdaacf8
4 changed files with 38 additions and 156 deletions

View File

@@ -24,10 +24,23 @@
#endif
#include "wx/log.h"
#include "wx/private/stattext.h" // for wxMarkupEntities
#include "wx/gtk/private/mnemonics.h"
namespace
{
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
// Names of the standard XML entities.
const char *const entitiesNames[] =
{
"&", "<", ">", "'", """
};
} // anonymous namespace
// ============================================================================
// implementation
// ============================================================================
@@ -67,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 &&