]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/stockitem.cpp
The Great wxRegion Refactoring:
[wxWidgets.git] / src / common / stockitem.cpp
index 6bf9ac60e32cb862419f147ef4cc988f48bcc8ef..dadb60618262802f2632e1f39e18f90b57c3895e 100644 (file)
@@ -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;