X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4322f94f29dd668540ba31a26d08402b7e849b23..4c268e6a10d820b9ea9851924e37014caa9fb5e8:/src/common/stockitem.cpp diff --git a/src/common/stockitem.cpp b/src/common/stockitem.cpp index a559da2155..ee38d92f20 100644 --- a/src/common/stockitem.cpp +++ b/src/common/stockitem.cpp @@ -171,20 +171,16 @@ wxString wxGetStockLabel(wxWindowID id, long flags) 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)) {