From: Paul Cornett Date: Wed, 11 Jun 2008 05:23:53 +0000 (+0000) Subject: move 8 copies of the same function to common code X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/cabb286d303c74eab6bce88675007eaaa8049b80 move 8 copies of the same function to common code git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54092 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/cocoa/menuitem.mm b/src/cocoa/menuitem.mm index d6f542e13c..1ddcbb4b61 100644 --- a/src/cocoa/menuitem.mm +++ b/src/cocoa/menuitem.mm @@ -101,12 +101,6 @@ wxMenuItem *wxMenuItemBase::New(wxMenu *parentMenu, return new wxMenuItem(parentMenu, itemid, name, help, kind, subMenu); } -/* static */ -wxString wxMenuItemBase::GetLabelText(const wxString& text) -{ - return wxStripMenuCodes(text); -} - void wxMenuItemCocoa::CocoaSetKeyEquivalent() { wxAcceleratorEntry *accel = GetAccel(); diff --git a/src/common/menucmn.cpp b/src/common/menucmn.cpp index 49f2b2d20f..db83047580 100644 --- a/src/common/menucmn.cpp +++ b/src/common/menucmn.cpp @@ -125,6 +125,13 @@ void wxMenuItemBase::SetHelp(const wxString& str) } } +#ifndef __WXPM__ +wxString wxMenuItemBase::GetLabelText(const wxString& text) +{ + return wxStripMenuCodes(text); +} +#endif + #if WXWIN_COMPATIBILITY_2_8 wxString wxMenuItemBase::GetLabelFromText(const wxString& text) { diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp index ee1c5e4d5b..8d5b2098ec 100644 --- a/src/gtk/menu.cpp +++ b/src/gtk/menu.cpp @@ -625,17 +625,6 @@ wxMenuItem::~wxMenuItem() // don't delete menu items, the menus take care of that } -// return the menu item text without any menu accels -/* static */ - -wxString wxMenuItemBase::GetLabelText(const wxString& text) -{ - // The argument to this function will now always be in wxWidgets standard label - // format, not GTK+ format, so we do what the other ports do. - - return wxStripMenuCodes(text); -} - void wxMenuItem::SetItemLabel( const wxString& str ) { #if wxUSE_ACCEL diff --git a/src/gtk1/menu.cpp b/src/gtk1/menu.cpp index 62906a4709..beeab89cd9 100644 --- a/src/gtk1/menu.cpp +++ b/src/gtk1/menu.cpp @@ -751,47 +751,6 @@ wxMenuItem::~wxMenuItem() // don't delete menu items, the menus take care of that } -// return the menu item text without any menu accels -/* static */ -wxString wxMenuItemBase::GetLabelText(const wxString& text) -{ - // The argument to this function will now always be in wxWidgets standard label - // format, not GTK+ format, so we do what the other ports do. - - return wxStripMenuCodes(text); - -#if 0 - wxString label; - - for ( const wxChar *pc = text.c_str(); *pc; pc++ ) - { - if ( *pc == wxT('\t')) - break; - - if ( *pc == wxT('_') ) - { - // GTK 1.2 escapes "xxx_xxx" to "xxx__xxx" - pc++; - label += *pc; - continue; - } - - if ( (*pc == wxT('&')) && (*(pc+1) != wxT('&')) ) - { - // wxMSW escapes "&" - // "&" is doubled to indicate "&" instead of accelerator - continue; - } - - label += *pc; - } - - // wxPrintf( wxT("GetLabelText(): text %s label %s\n"), text.c_str(), label.c_str() ); - - return label; -#endif -} - wxString wxMenuItem::GetItemLabel() const { wxString label = wxConvertFromGTKToWXLabel(m_text); diff --git a/src/mac/carbon/menuitem.cpp b/src/mac/carbon/menuitem.cpp index 172c5b0ab1..efe921ff74 100644 --- a/src/mac/carbon/menuitem.cpp +++ b/src/mac/carbon/menuitem.cpp @@ -278,12 +278,6 @@ void wxMenuItem::SetRadioGroupEnd(int end) // wxMenuItemBase // ---------------------------------------------------------------------------- -/* static */ -wxString wxMenuItemBase::GetLabelText(const wxString& text) -{ - return wxStripMenuCodes(text); -} - wxMenuItem *wxMenuItemBase::New(wxMenu *parentMenu, int id, const wxString& name, diff --git a/src/motif/menuitem.cpp b/src/motif/menuitem.cpp index e830c00c13..fb12bf8e2e 100644 --- a/src/motif/menuitem.cpp +++ b/src/motif/menuitem.cpp @@ -136,12 +136,6 @@ void wxMenuItem::Check(bool bDoCheck) } } -/* static */ -wxString wxMenuItemBase::GetLabelText(const wxString& text) -{ - return wxStripMenuCodes(text); -} - // ---------------------------------------------------------------------------- // wxMenuItemBase // ---------------------------------------------------------------------------- diff --git a/src/msw/menuitem.cpp b/src/msw/menuitem.cpp index d1ecba4332..e2d5bcbfbb 100644 --- a/src/msw/menuitem.cpp +++ b/src/msw/menuitem.cpp @@ -213,12 +213,6 @@ bool wxMenuItem::IsChecked() const return (flag & MF_CHECKED) != 0; } -/* static */ -wxString wxMenuItemBase::GetLabelText(const wxString& text) -{ - return wxStripMenuCodes(text); -} - // radio group stuff // ----------------- diff --git a/src/palmos/menuitem.cpp b/src/palmos/menuitem.cpp index a491c36a86..bf3d419497 100644 --- a/src/palmos/menuitem.cpp +++ b/src/palmos/menuitem.cpp @@ -158,12 +158,6 @@ bool wxMenuItem::IsChecked() const return false; } -/* static */ -wxString wxMenuItemBase::GetLabelText(const wxString& text) -{ - return wxStripMenuCodes(text); -} - // radio group stuff // ----------------- diff --git a/src/univ/menu.cpp b/src/univ/menu.cpp index ac4d815131..558f6205e2 100644 --- a/src/univ/menu.cpp +++ b/src/univ/menu.cpp @@ -1519,12 +1519,6 @@ wxMenuItem *wxMenuItemBase::New(wxMenu *parentMenu, return new wxMenuItem(parentMenu, id, name, help, kind, subMenu); } -/* static */ -wxString wxMenuItemBase::GetLabelText(const wxString& text) -{ - return wxStripMenuCodes(text); -} - // ---------------------------------------------------------------------------- // wxMenuItem operations // ----------------------------------------------------------------------------