summaryrefslogtreecommitdiff
path: root/sdext/source/presenter/PresenterProtocolHandler.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-09-22 12:53:28 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-09-23 09:02:58 +0200
commita8622c77d26ca7a635afc95bba9a5054dc31eb7c (patch)
treeecb1ce71272291515dec10fc5fe94061f7231b78 /sdext/source/presenter/PresenterProtocolHandler.cxx
parent2684aefcf5d2804351bda01a2d2fe7bbbd351451 (diff)
loplugin:flatten in sdext..stoc
Change-Id: I460e813e20a691c53738373376d3363f553bbab2 Reviewed-on: https://gerrit.libreoffice.org/42636 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sdext/source/presenter/PresenterProtocolHandler.cxx')
-rw-r--r--sdext/source/presenter/PresenterProtocolHandler.cxx54
1 files changed, 24 insertions, 30 deletions
diff --git a/sdext/source/presenter/PresenterProtocolHandler.cxx b/sdext/source/presenter/PresenterProtocolHandler.cxx
index f1aceb54f8d1..b7ca0c08a4b2 100644
--- a/sdext/source/presenter/PresenterProtocolHandler.cxx
+++ b/sdext/source/presenter/PresenterProtocolHandler.cxx
@@ -430,54 +430,48 @@ void SAL_CALL PresenterProtocolHandler::Dispatch::dispatch(
static_cast<uno::XWeak*>(this));
}
- if (rURL.Protocol == "vnd.org.libreoffice.presenterscreen:"
- && rURL.Path == msURLPath)
- {
- if (mpCommand.get() != nullptr)
- mpCommand->Execute();
- }
- else
+ if (rURL.Protocol != "vnd.org.libreoffice.presenterscreen:"
+ || rURL.Path != msURLPath)
{
// We can not throw an IllegalArgumentException
throw RuntimeException();
}
+
+ if (mpCommand.get() != nullptr)
+ mpCommand->Execute();
}
void SAL_CALL PresenterProtocolHandler::Dispatch::addStatusListener(
const css::uno::Reference<css::frame::XStatusListener>& rxListener,
const css::util::URL& rURL)
{
- if (rURL.Path == msURLPath)
- {
- maStatusListenerContainer.push_back(rxListener);
-
- frame::FeatureStateEvent aEvent;
- aEvent.FeatureURL = rURL;
- aEvent.IsEnabled = mpCommand->IsEnabled();
- aEvent.Requery = false;
- aEvent.State = mpCommand->GetState();
- rxListener->statusChanged(aEvent);
- }
- else
+ if (rURL.Path != msURLPath)
throw RuntimeException();
+
+ maStatusListenerContainer.push_back(rxListener);
+
+ frame::FeatureStateEvent aEvent;
+ aEvent.FeatureURL = rURL;
+ aEvent.IsEnabled = mpCommand->IsEnabled();
+ aEvent.Requery = false;
+ aEvent.State = mpCommand->GetState();
+ rxListener->statusChanged(aEvent);
}
void SAL_CALL PresenterProtocolHandler::Dispatch::removeStatusListener (
const css::uno::Reference<css::frame::XStatusListener>& rxListener,
const css::util::URL& rURL)
{
- if (rURL.Path == msURLPath)
- {
- StatusListenerContainer::iterator iListener (
- ::std::find(
- maStatusListenerContainer.begin(),
- maStatusListenerContainer.end(),
- rxListener));
- if (iListener != maStatusListenerContainer.end())
- maStatusListenerContainer.erase(iListener);
- }
- else
+ if (rURL.Path != msURLPath)
throw RuntimeException();
+
+ StatusListenerContainer::iterator iListener (
+ ::std::find(
+ maStatusListenerContainer.begin(),
+ maStatusListenerContainer.end(),
+ rxListener));
+ if (iListener != maStatusListenerContainer.end())
+ maStatusListenerContainer.erase(iListener);
}
//----- document::XEventListener ----------------------------------------------