From 7d8bdf84623334dabfacc795a8a82ff5184319c5 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 18 Apr 2016 17:32:45 +0200 Subject: Clean up framework/inc/dispatchcommands.h Change-Id: I6a9a8ae34c2f5abafd4192287fb12d4289a761ff --- framework/inc/dispatchcommands.h | 32 --------------------- framework/source/dispatch/dispatchprovider.cxx | 9 ++---- .../source/dispatch/isstartmoduledispatch.hxx | 33 ++++++++++++++++++++++ .../source/dispatch/startmoduledispatcher.cxx | 4 +-- 4 files changed, 37 insertions(+), 41 deletions(-) delete mode 100644 framework/inc/dispatchcommands.h create mode 100644 framework/source/dispatch/isstartmoduledispatch.hxx (limited to 'framework') diff --git a/framework/inc/dispatchcommands.h b/framework/inc/dispatchcommands.h deleted file mode 100644 index c1d6e679e8bb..000000000000 --- a/framework/inc/dispatchcommands.h +++ /dev/null @@ -1,32 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_FRAMEWORK_INC_DISPATCHCOMMANDS_H -#define INCLUDED_FRAMEWORK_INC_DISPATCHCOMMANDS_H - - -namespace framework{ - -#define CMD_UNO_SHOWSTARTMODULE ".uno:ShowStartModule" - -} // namespace framework - -#endif // INCLUDED_FRAMEWORK_INC_DISPATCHCOMMANDS_H - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/dispatch/dispatchprovider.cxx b/framework/source/dispatch/dispatchprovider.cxx index 846b12146dec..397855fbb2c7 100644 --- a/framework/source/dispatch/dispatchprovider.cxx +++ b/framework/source/dispatch/dispatchprovider.cxx @@ -26,11 +26,11 @@ #include #include -#include #include #include #include #include +#include #include #include @@ -146,11 +146,6 @@ css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL Disp return lDispatcher; } -bool lcl_isStartModuleDispatch (const css::util::URL& aURL) -{ - return aURL.Complete == CMD_UNO_SHOWSTARTMODULE; -} - /** @short helper for queryDispatch() @descr Every member of the frame tree (frame, desktop) must handle such request @@ -197,7 +192,7 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_queryDeskt if (implts_isLoadableContent(aURL)) xDispatcher = implts_getOrCreateDispatchHelper( E_DEFAULTDISPATCHER, xDesktop ); - if (lcl_isStartModuleDispatch(aURL)) + if (isStartModuleDispatch(aURL)) xDispatcher = implts_getOrCreateDispatchHelper( E_STARTMODULEDISPATCHER, xDesktop ); } diff --git a/framework/source/dispatch/isstartmoduledispatch.hxx b/framework/source/dispatch/isstartmoduledispatch.hxx new file mode 100644 index 000000000000..491d0affac78 --- /dev/null +++ b/framework/source/dispatch/isstartmoduledispatch.hxx @@ -0,0 +1,33 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_FRAMEWORK_SOURCE_DISPATCH_ISSTARTMODULEDISPATCH_HXX +#define INCLUDED_FRAMEWORK_SOURCE_DISPATCH_ISSTARTMODULEDISPATCH_HXX + +namespace framework { + +inline bool isStartModuleDispatch(css::util::URL const & url) { + return url.Complete == ".uno:ShowStartModule"; +} + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/dispatch/startmoduledispatcher.cxx b/framework/source/dispatch/startmoduledispatcher.cxx index e9f37e9c7875..96d40fdd77e4 100644 --- a/framework/source/dispatch/startmoduledispatcher.cxx +++ b/framework/source/dispatch/startmoduledispatcher.cxx @@ -21,10 +21,10 @@ #include #include -#include #include #include #include +#include #include #include @@ -70,7 +70,7 @@ void SAL_CALL StartModuleDispatcher::dispatchWithNotification(const css::util::U throw(css::uno::RuntimeException, std::exception) { ::sal_Int16 nResult = css::frame::DispatchResultState::DONTKNOW; - if ( aURL.Complete == CMD_UNO_SHOWSTARTMODULE ) + if (isStartModuleDispatch(aURL)) { nResult = css::frame::DispatchResultState::FAILURE; if (implts_isBackingModePossible ()) -- cgit