summaryrefslogtreecommitdiff
path: root/framework/source/dispatch
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2009-09-25 21:47:16 +0200
committerMathias Bauer <mba@openoffice.org>2009-09-25 21:47:16 +0200
commit4c8fba36e0b8955ecb49293e6218829ad7cd40a9 (patch)
treed24e9d1b546873c85d4f5aaef4b719a315692ca3 /framework/source/dispatch
parente3441919174583045e0b7c8110b2a2d4119b66d1 (diff)
parent5228b9163b7c889a62b553e543fea51800099f7a (diff)
merge commit
Diffstat (limited to 'framework/source/dispatch')
-rw-r--r--framework/source/dispatch/closedispatcher.cxx27
-rw-r--r--framework/source/dispatch/dispatchprovider.cxx37
-rw-r--r--framework/source/dispatch/interceptionhelper.cxx4
-rw-r--r--framework/source/dispatch/menudispatcher.cxx26
-rw-r--r--framework/source/dispatch/popupmenudispatcher.cxx8
-rwxr-xr-xframework/source/dispatch/windowcommanddispatch.cxx1
6 files changed, 44 insertions, 59 deletions
diff --git a/framework/source/dispatch/closedispatcher.cxx b/framework/source/dispatch/closedispatcher.cxx
index a35e3d2512..b49c29e2c8 100644
--- a/framework/source/dispatch/closedispatcher.cxx
+++ b/framework/source/dispatch/closedispatcher.cxx
@@ -46,11 +46,9 @@
#include <com/sun/star/frame/XDesktop.hpp>
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/frame/CommandGroup.hpp>
-
-#ifndef __COM_SUN_STAR_AWT_XTOPWINDOW_HPP_
+#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
-#endif
-
+#include <com/sun/star/document/XActionLockable.hpp>
#include "com/sun/star/beans/XFastPropertySet.hpp"
#include <toolkit/helper/vclunohelper.hxx>
@@ -174,7 +172,7 @@ void SAL_CALL CloseDispatcher::removeStatusListener(const css::uno::Reference< c
//-----------------------------------------------
void SAL_CALL CloseDispatcher::dispatchWithNotification(const css::util::URL& aURL ,
- const css::uno::Sequence< css::beans::PropertyValue >& /*lArguments*/,
+ const css::uno::Sequence< css::beans::PropertyValue >& lArguments,
const css::uno::Reference< css::frame::XDispatchResultListener >& xListener )
throw(css::uno::RuntimeException)
{
@@ -239,7 +237,20 @@ void SAL_CALL CloseDispatcher::dispatchWithNotification(const css::util::URL&
aWriteLock.unlock();
// <- SAFE ----------------------------------
- m_aAsyncCallback.Post(0);
+ sal_Bool bIsSynchron = sal_False;
+ for (sal_Int32 nArgs=0; nArgs<lArguments.getLength(); nArgs++ )
+ {
+ if ( lArguments[nArgs].Name.equalsAscii("SynchronMode") )
+ {
+ lArguments[nArgs].Value >>= bIsSynchron;
+ break;
+ }
+ }
+
+ if ( bIsSynchron )
+ impl_asyncCallback(0);
+ else
+ m_aAsyncCallback.Post(0);
}
//-----------------------------------------------
@@ -543,6 +554,10 @@ sal_Bool CloseDispatcher::implts_establishBackingMode()
if (!xFrame.is())
return sal_False;
+ css::uno::Reference < css::document::XActionLockable > xLock( xFrame, css::uno::UNO_QUERY );
+ if ( xLock.is() && xLock->isActionLocked() )
+ return sal_False;
+
css::uno::Reference< css::awt::XWindow > xContainerWindow = xFrame->getContainerWindow();
css::uno::Sequence< css::uno::Any > lArgs(1);
lArgs[0] <<= xContainerWindow;
diff --git a/framework/source/dispatch/dispatchprovider.cxx b/framework/source/dispatch/dispatchprovider.cxx
index 4c98599484..1dfee32e85 100644
--- a/framework/source/dispatch/dispatchprovider.cxx
+++ b/framework/source/dispatch/dispatchprovider.cxx
@@ -47,7 +47,7 @@
#include <pattern/window.hxx>
#include <threadhelp/transactionguard.hxx>
#include <threadhelp/readguard.hxx>
-#include <threadhelp/writeguard.hxx>
+#include <threadhelp/writeguard.hxx>
#include <dispatchcommands.h>
#include <protocols.h>
#include <services.h>
@@ -224,24 +224,13 @@ css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL Disp
return lDispatcher;
}
-//_________________________________________________________________________________________________________________
-
-::sal_Bool lcl_isCloseDispatch (const css::util::URL& aURL)
-{
- return (
- (aURL.Complete.equals(CMD_UNO_CLOSEDOC )) ||
- (aURL.Complete.equals(CMD_UNO_CLOSEWIN )) ||
- (aURL.Complete.equals(CMD_UNO_CLOSEFRAME))
- );
-}
-
-//_________________________________________________________________________________________________________________
-
-::sal_Bool lcl_isStartModuleDispatch (const css::util::URL& aURL)
-{
- return (aURL.Complete.equals(CMD_UNO_SHOWSTARTMODULE));
-}
-
+//_________________________________________________________________________________________________________________
+
+::sal_Bool lcl_isStartModuleDispatch (const css::util::URL& aURL)
+{
+ return (aURL.Complete.equals(CMD_UNO_SHOWSTARTMODULE));
+}
+
//_________________________________________________________________________________________________________________
/**
@@ -296,10 +285,10 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_queryDeskt
if (sTargetFrameName==SPECIALTARGET_DEFAULT)
{
if (implts_isLoadableContent(aURL))
- xDispatcher = implts_getOrCreateDispatchHelper( E_DEFAULTDISPATCHER, xDesktop );
-
- if (lcl_isStartModuleDispatch(aURL))
- xDispatcher = implts_getOrCreateDispatchHelper( E_STARTMODULEDISPATCHER, xDesktop );
+ xDispatcher = implts_getOrCreateDispatchHelper( E_DEFAULTDISPATCHER, xDesktop );
+
+ if (lcl_isStartModuleDispatch(aURL))
+ xDispatcher = implts_getOrCreateDispatchHelper( E_STARTMODULEDISPATCHER, xDesktop );
}
//-----------------------------------------------------------------------------------------------------
@@ -772,7 +761,7 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_getOrCreat
CloseDispatcher* pDispatcher = new CloseDispatcher( xFactory, xOwner, sTarget );
xDispatchHelper = css::uno::Reference< css::frame::XDispatch >( static_cast< ::cppu::OWeakObject* >(pDispatcher), css::uno::UNO_QUERY );
}
- break;
+ break;
case E_STARTMODULEDISPATCHER :
{
diff --git a/framework/source/dispatch/interceptionhelper.cxx b/framework/source/dispatch/interceptionhelper.cxx
index b48a6568db..1bb33a3350 100644
--- a/framework/source/dispatch/interceptionhelper.cxx
+++ b/framework/source/dispatch/interceptionhelper.cxx
@@ -185,7 +185,7 @@ void SAL_CALL InterceptionHelper::registerDispatchProviderInterceptor(const css:
// a) no interceptor at all - set this instance as master for given interceptor
// and set our slave as it's slave - and put this interceptor to the list.
// It's place there doesn matter. Because this list is currently empty.
- if (m_lInterceptionRegs.size()<1)
+ if (m_lInterceptionRegs.empty())
{
xInterceptor->setMasterDispatchProvider(xThis );
xInterceptor->setSlaveDispatchProvider (m_xSlave);
@@ -333,7 +333,7 @@ void SAL_CALL InterceptionHelper::disposing(const css::lang::EventObject& aEvent
#if OSL_DEBUG_LEVEL > 0
// SAFE ->
aReadLock.lock();
- if (m_lInterceptionRegs.size() > 0)
+ if (!m_lInterceptionRegs.empty() )
OSL_ENSURE(sal_False, "There are some pending interceptor objects, which seams to be registered during (!) the destruction of a frame.");
aReadLock.unlock();
// <- SAFE
diff --git a/framework/source/dispatch/menudispatcher.cxx b/framework/source/dispatch/menudispatcher.cxx
index 43c0da312d..c7282fbcc9 100644
--- a/framework/source/dispatch/menudispatcher.cxx
+++ b/framework/source/dispatch/menudispatcher.cxx
@@ -36,8 +36,9 @@
//_________________________________________________________________________________________________________________
#include <dispatch/menudispatcher.hxx>
#include <general.h>
-#include <classes/menuconfiguration.hxx>
+#include <xml/menuconfiguration.hxx>
#include <classes/addonmenu.hxx>
+#include <services.h>
//_________________________________________________________________________________________________________________
// interface includes
@@ -62,6 +63,7 @@
#include <tools/rcid.h>
#include <vos/mutex.hxx>
#include <toolkit/helper/vclunohelper.hxx>
+#include <rtl/logfile.hxx>
//_________________________________________________________________________________________________________________
// includes of other projects
@@ -388,7 +390,7 @@ IMPL_LINK( MenuDispatcher, Close_Impl, void*, EMPTYARG )
css::util::URL aURL;
aURL.Complete = ::rtl::OUString::createFromAscii(".uno:CloseWin");
css::uno::Reference< css::util::XURLTransformer > xTrans ( m_xFactory->createInstance(
- ::rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer") ), css::uno::UNO_QUERY );
+ SERVICENAME_URLTRANSFORMER ), css::uno::UNO_QUERY );
if( xTrans.is() )
{
// Datei laden
@@ -443,26 +445,6 @@ sal_Bool MenuDispatcher::impldbg_checkParameter_MenuDispatcher( const uno::R
}
//*****************************************************************************************************************
-// We don't know anything about right values of aURL and seqArguments!
-// Check valid references only.
-sal_Bool MenuDispatcher::impldbg_checkParameter_dispatch( const URL& aURL ,
- const Sequence< PropertyValue >& seqArguments)
-{
- // Set default return value.
- sal_Bool bOK = sal_True;
- // Check parameter.
- if (
- ( &aURL == NULL ) ||
- ( &seqArguments == NULL )
- )
- {
- bOK = sal_False ;
- }
- // Return result of check.
- return bOK ;
-}
-
-//*****************************************************************************************************************
// We need a valid URL. What is meaning with "register for nothing"?!
// xControl must correct to - nobody can advised otherwise!
sal_Bool MenuDispatcher::impldbg_checkParameter_addStatusListener( const uno::Reference< XStatusListener >& xControl,
diff --git a/framework/source/dispatch/popupmenudispatcher.cxx b/framework/source/dispatch/popupmenudispatcher.cxx
index 73b94f43bb..507f6a998f 100644
--- a/framework/source/dispatch/popupmenudispatcher.cxx
+++ b/framework/source/dispatch/popupmenudispatcher.cxx
@@ -37,7 +37,7 @@
#include <dispatch/popupmenudispatcher.hxx>
#include <general.h>
-#include <classes/menuconfiguration.hxx>
+#include <xml/menuconfiguration.hxx>
#include <classes/addonmenu.hxx>
#include <services.h>
#include <properties.h>
@@ -241,8 +241,7 @@ throw( css::uno::RuntimeException )
css::uno::Reference< css::frame::XDispatchProvider > xDispatchProvider;
// Find popup menu controller using the base URL
- Any a = xPopupCtrlQuery->getByName( aBaseURL );
- a >>= xDispatchProvider;
+ xPopupCtrlQuery->getByName( aBaseURL ) >>= xDispatchProvider;
aGuard.unlock();
// Ask popup menu dispatch provider for dispatch object
@@ -384,8 +383,7 @@ void PopupMenuDispatcher::impl_RetrievePopupControllerQuery()
{
try
{
- Any a = xPropSet->getPropertyValue( FRAME_PROPNAME_LAYOUTMANAGER );
- a >>= xLayoutManager;
+ xPropSet->getPropertyValue( FRAME_PROPNAME_LAYOUTMANAGER ) >>= xLayoutManager;
if ( xLayoutManager.is() )
{
diff --git a/framework/source/dispatch/windowcommanddispatch.cxx b/framework/source/dispatch/windowcommanddispatch.cxx
index 6eb340ccb2..531d6807ee 100755
--- a/framework/source/dispatch/windowcommanddispatch.cxx
+++ b/framework/source/dispatch/windowcommanddispatch.cxx
@@ -55,6 +55,7 @@
#include <vcl/cmdevt.hxx>
#include <vos/mutex.hxx>
#include <toolkit/helper/vclunohelper.hxx>
+#include <rtl/logfile.hxx>
//_______________________________________________
// namespace