From c21025fc365c49314461f1381edf3653ea65e5f6 Mon Sep 17 00:00:00 2001 From: jules Date: Fri, 23 Nov 2012 17:37:30 +0000 Subject: [PATCH] KeyPressMappingSet fix. --- modules/juce_gui_basics/commands/juce_KeyPressMappingSet.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/juce_gui_basics/commands/juce_KeyPressMappingSet.cpp b/modules/juce_gui_basics/commands/juce_KeyPressMappingSet.cpp index cb919ae079..ba87f05f96 100644 --- a/modules/juce_gui_basics/commands/juce_KeyPressMappingSet.cpp +++ b/modules/juce_gui_basics/commands/juce_KeyPressMappingSet.cpp @@ -241,8 +241,9 @@ bool KeyPressMappingSet::restoreFromXml (const XmlElement& xmlVersion) } else if (map->hasTagName ("UNMAPPING")) { - if (containsMapping (commandId, key)) - removeKeyPress (key); + for (int i = mappings.size(); --i >= 0;) + if (mappings.getUnchecked(i)->commandID == commandId) + mappings.getUnchecked(i)->keypresses.removeAllInstancesOf (key); } } }