From 12ab881353067924f5f0c52541db4e2f744646be Mon Sep 17 00:00:00 2001 From: jules Date: Fri, 26 Dec 2014 13:42:17 +0000 Subject: [PATCH] Minor clean-up. --- modules/juce_events/native/juce_mac_MessageManager.mm | 8 ++++---- modules/juce_gui_basics/components/juce_Component.cpp | 7 +++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/modules/juce_events/native/juce_mac_MessageManager.mm b/modules/juce_events/native/juce_mac_MessageManager.mm index 0d00c91cd8..0090d0bd46 100644 --- a/modules/juce_events/native/juce_mac_MessageManager.mm +++ b/modules/juce_events/native/juce_mac_MessageManager.mm @@ -53,7 +53,7 @@ public: [[NSDistributedNotificationCenter defaultCenter] addObserver: delegate selector: @selector (broadcastMessageCallback:) - name: getBroacastEventName() + name: getBroadcastEventName() object: nil]; } else @@ -79,14 +79,14 @@ public: [NSApp setDelegate: nil]; [[NSDistributedNotificationCenter defaultCenter] removeObserver: delegate - name: getBroacastEventName() + name: getBroadcastEventName() object: nil]; } [delegate release]; } - static NSString* getBroacastEventName() + static NSString* getBroadcastEventName() { return juceStringToNS ("juce_" + String::toHexString (File::getSpecialLocation (File::currentExecutableFile).hashCode64())); } @@ -356,7 +356,7 @@ void MessageManager::broadcastMessage (const String& message) NSDictionary* info = [NSDictionary dictionaryWithObject: juceStringToNS (message) forKey: nsStringLiteral ("message")]; - [[NSDistributedNotificationCenter defaultCenter] postNotificationName: AppDelegate::getBroacastEventName() + [[NSDistributedNotificationCenter defaultCenter] postNotificationName: AppDelegate::getBroadcastEventName() object: nil userInfo: info]; } diff --git a/modules/juce_gui_basics/components/juce_Component.cpp b/modules/juce_gui_basics/components/juce_Component.cpp index 00e8476ed7..d1a93182db 100644 --- a/modules/juce_gui_basics/components/juce_Component.cpp +++ b/modules/juce_gui_basics/components/juce_Component.cpp @@ -2309,16 +2309,15 @@ void Component::internalModalInputAttempt() //============================================================================== void Component::postCommandMessage (const int commandId) { - class CustomCommandMessage : public CallbackMessage + struct CustomCommandMessage : public CallbackMessage { - public: CustomCommandMessage (Component* const c, const int command) : target (c), commandId (command) {} void messageCallback() override { - if (target.get() != nullptr) // (get() required for VS2003 bug) - target->handleCommandMessage (commandId); + if (Component* c = target.get()) + c->handleCommandMessage (commandId); } private: