Skip to content

Commit aaab995

Browse files
committed
Fixed couple of bugs in AcceleratorTo code
1 parent 9657606 commit aaab995

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

scripting/methods/methods_accelerators.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ WORD key;
134134
m_CommandToSendToMap [command] = SendTo;
135135

136136
// remember which plugin did it
137-
m_CommandToPluginMap [command].empty ();
137+
m_CommandToPluginMap [command].erase ();
138138

139139
if (m_CurrentPlugin)
140140
m_CommandToPluginMap [command] = m_CurrentPlugin->m_strID;

sendvw.cpp

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2540,15 +2540,19 @@ void CSendView::OnAcceleratorCommand (UINT nID)
25402540
// which plugin wanted it
25412541
pDoc->m_CurrentPlugin = pDoc->GetPlugin (pDoc->m_CommandToPluginMap [nID].c_str ());
25422542

2543-
// ok let's do it now
2544-
pDoc->SendTo (pDoc->m_CommandToSendToMap [nID],
2545-
sCommand.c_str (),
2546-
TRUE, // omit from output
2547-
TRUE, // omit from log
2548-
TFormat ("Accelerator: %s", (LPCTSTR) key),
2549-
"", // Variable name
2550-
strExtraOutput // if we sent to output, it goes here
2551-
);
2543+
if (pDoc->m_CurrentPlugin != NULL ||
2544+
pDoc->m_CommandToPluginMap [nID].empty ())
2545+
{
2546+
// ok let's do it now
2547+
pDoc->SendTo (pDoc->m_CommandToSendToMap [nID],
2548+
sCommand.c_str (),
2549+
TRUE, // omit from output
2550+
TRUE, // omit from log
2551+
TFormat ("Accelerator: %s", (LPCTSTR) key),
2552+
"", // Variable name
2553+
strExtraOutput // if we sent to output, it goes here
2554+
);
2555+
}
25522556

25532557
pDoc->m_CurrentPlugin = pSavedPlugin;
25542558

0 commit comments

Comments
 (0)