[Libreoffice-commits] core.git: framework/inc framework/source

Stephan Bergmann sbergman at redhat.com
Mon Apr 18 15:33:26 UTC 2016


 framework/inc/dispatchcommands.h                    |   32 -------------------
 framework/source/dispatch/dispatchprovider.cxx      |    9 +----
 framework/source/dispatch/isstartmoduledispatch.hxx |   33 ++++++++++++++++++++
 framework/source/dispatch/startmoduledispatcher.cxx |    4 +-
 4 files changed, 37 insertions(+), 41 deletions(-)

New commits:
commit 7d8bdf84623334dabfacc795a8a82ff5184319c5
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Apr 18 17:32:45 2016 +0200

    Clean up framework/inc/dispatchcommands.h
    
    Change-Id: I6a9a8ae34c2f5abafd4192287fb12d4289a761ff

diff --git a/framework/source/dispatch/dispatchprovider.cxx b/framework/source/dispatch/dispatchprovider.cxx
index 846b121..397855f 100644
--- a/framework/source/dispatch/dispatchprovider.cxx
+++ b/framework/source/dispatch/dispatchprovider.cxx
@@ -26,11 +26,11 @@
 
 #include <pattern/window.hxx>
 #include <threadhelp/transactionguard.hxx>
-#include <dispatchcommands.h>
 #include <protocols.h>
 #include <services.h>
 #include <targets.h>
 #include <general.h>
+#include <isstartmoduledispatch.hxx>
 
 #include <com/sun/star/frame/XDesktop.hpp>
 #include <com/sun/star/frame/FrameSearchFlag.hpp>
@@ -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/inc/dispatchcommands.h b/framework/source/dispatch/isstartmoduledispatch.hxx
similarity index 76%
rename from framework/inc/dispatchcommands.h
rename to framework/source/dispatch/isstartmoduledispatch.hxx
index c1d6e67..491d0af 100644
--- a/framework/inc/dispatchcommands.h
+++ b/framework/source/dispatch/isstartmoduledispatch.hxx
@@ -17,16 +17,17 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_FRAMEWORK_INC_DISPATCHCOMMANDS_H
-#define INCLUDED_FRAMEWORK_INC_DISPATCHCOMMANDS_H
+#ifndef INCLUDED_FRAMEWORK_SOURCE_DISPATCH_ISSTARTMODULEDISPATCH_HXX
+#define INCLUDED_FRAMEWORK_SOURCE_DISPATCH_ISSTARTMODULEDISPATCH_HXX
 
+namespace framework {
 
-namespace framework{
+inline bool isStartModuleDispatch(css::util::URL const & url) {
+    return url.Complete == ".uno:ShowStartModule";
+}
 
-#define CMD_UNO_SHOWSTARTMODULE ".uno:ShowStartModule"
+}
 
-}       //  namespace framework
-
-#endif // INCLUDED_FRAMEWORK_INC_DISPATCHCOMMANDS_H
+#endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/dispatch/startmoduledispatcher.cxx b/framework/source/dispatch/startmoduledispatcher.cxx
index e9f37e9..96d40fd 100644
--- a/framework/source/dispatch/startmoduledispatcher.cxx
+++ b/framework/source/dispatch/startmoduledispatcher.cxx
@@ -21,10 +21,10 @@
 
 #include <pattern/frame.hxx>
 #include <framework/framelistanalyzer.hxx>
-#include <dispatchcommands.h>
 #include <targets.h>
 #include <services.h>
 #include <general.h>
+#include <isstartmoduledispatch.hxx>
 
 #include <com/sun/star/frame/Desktop.hpp>
 #include <com/sun/star/frame/XController.hpp>
@@ -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 ())


More information about the Libreoffice-commits mailing list