Browse Source

Custom command menu generation corrections

Source commit: 877a5fe60ff3d00211cf7aa974efc0ba9744e65a
Martin Prikryl 9 years ago
parent
commit
8610fcf65d
1 changed files with 3 additions and 6 deletions
  1. 3 6
      source/forms/NonVisual.cpp

+ 3 - 6
source/forms/NonVisual.cpp

@@ -1029,7 +1029,8 @@ UnicodeString __fastcall TNonVisualDataModule::CustomCommandHint(const TCustomCo
 {
   UnicodeString Name = StripHotkey(Command->Name);
   UnicodeString ShortHint = FMTLOAD(CUSTOM_COMMAND_HINT, (Name));
-  UnicodeString LongHint = FMTLOAD(CUSTOM_COMMAND_HINT_LONG, (Name, Command->Command));
+  UnicodeString LongHint =
+    !Command->Description.IsEmpty() ? Command->Description : FMTLOAD(CUSTOM_COMMAND_HINT_LONG, (Name, Command->Command));
   UnicodeString Result = FORMAT(L"%s|%s", (ShortHint, LongHint));
   return Result;
 }
@@ -1070,11 +1071,7 @@ void __fastcall TNonVisualDataModule::CreateCustomCommandsListMenu(
       {
         Item->Tag = Item->Tag | CustomCommandBoth;
       }
-      UnicodeString Name = StripHotkey(Command->Name);
-      UnicodeString ShortHint = FMTLOAD(CUSTOM_COMMAND_HINT, (Name));
-      UnicodeString LongHint =
-        !Command->Description.IsEmpty() ? Command->Description : FMTLOAD(CUSTOM_COMMAND_HINT_LONG, (Name, Command->Command));
-      Item->Hint = FORMAT(L"%s|%s", (ShortHint, LongHint));
+      Item->Hint = CustomCommandHint(Command);
       if (!Both)
       {
         Item->ShortCut = Command->ShortCut;