Browse Source

Explicit locals

Source commit: 6b1fb4b05c98938ef68f1cf7b1a1ae2bc960b33e
Martin Prikryl 8 năm trước cách đây
mục cha
commit
009a96698d
1 tập tin đã thay đổi với 6 bổ sung3 xóa
  1. 6 3
      source/forms/NonVisual.cpp

+ 6 - 3
source/forms/NonVisual.cpp

@@ -1030,7 +1030,8 @@ UnicodeString __fastcall TNonVisualDataModule::CustomCommandCaption(const TCusto
   UnicodeString Result = Command->Name;
   if (Toolbar)
   {
-    Result = EscapeHotkey(StripHotkey(Result));
+    Result = StripHotkey(Result);
+    Result = EscapeHotkey(Result);
   }
   return Result;
 }
@@ -1184,9 +1185,11 @@ bool __fastcall TNonVisualDataModule::CheckCustomCommandsToolbarList(TTBXToolbar
     TTBCustomItem * Item = Toolbar->Items->Items[Index];
     const TCustomCommandType * Command = List->Commands[CommandIndex];
 
+    UnicodeString Caption = CustomCommandCaption(Command, true);
+    UnicodeString Hint = CustomCommandHint(Command);
     Changed =
-      (Item->Caption != CustomCommandCaption(Command, true)) ||
-      (Item->Hint != CustomCommandHint(Command));
+      (Item->Caption != Caption) ||
+      (Item->Hint != Hint);
 
     Index++;
     CommandIndex++;