X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/345319d60c69cac3f5e9e74ee570d20370fc532f..80a779275ae04443c568dca919adb26cf6f5002c:/src/common/stockitem.cpp diff --git a/src/common/stockitem.cpp b/src/common/stockitem.cpp index 6bf9ac60e3..ee38d92f20 100644 --- a/src/common/stockitem.cpp +++ b/src/common/stockitem.cpp @@ -169,22 +169,18 @@ wxString wxGetStockLabel(wxWindowID id, long flags) #undef STOCKITEM - if(flags & wxSTOCK_WITH_MNEMONIC) + if ( !(flags & wxSTOCK_WITH_MNEMONIC) ) { - stockLabel = wxStripMenuCodes( stockLabel ); + stockLabel = wxStripMenuCodes(stockLabel); } #if wxUSE_ACCEL - - if (!stockLabel.empty() && (flags & wxSTOCK_WITH_ACCELERATOR)) + if ( !stockLabel.empty() && (flags & wxSTOCK_WITH_ACCELERATOR) ) { - stockLabel += _T("\t"); - wxAcceleratorEntry accel = wxGetStockAccelerator(id); if (accel.IsOk()) - stockLabel += accel.ToString(); + stockLabel << _T('\t') << accel.ToString(); } - #endif // wxUSE_ACCEL return stockLabel; @@ -384,6 +380,9 @@ const char *wxGetStockGtkID(wxWindowID id) bool wxGetStockGtkAccelerator(const char *id, GdkModifierType *mod, guint *key) { + if (!id) + return false; + GtkStockItem stock_item; if (gtk_stock_lookup (id, &stock_item)) {