diff options
Diffstat (limited to 'sfx2/source/control/unoctitm.cxx')
-rw-r--r-- | sfx2/source/control/unoctitm.cxx | 59 |
1 files changed, 24 insertions, 35 deletions
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index dc856786da..ef87fb4e81 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -50,7 +51,7 @@ #include <com/sun/star/frame/status/Visibility.hpp> #include <comphelper/processfactory.hxx> #include <comphelper/sequence.hxx> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <uno/current_context.hxx> #include <vcl/svapp.hxx> @@ -108,7 +109,7 @@ SfxUnoControllerItem::SfxUnoControllerItem( SfxControllerItem *pItem, SfxBinding DBG_ASSERT( !pCtrlItem || !pCtrlItem->IsBound(), "ControllerItem fehlerhaft!" ); aCommand.Complete = rCmd; - Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), UNO_QUERY ); + Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), UNO_QUERY ); xTrans->parseStrict( aCommand ); pBindings->RegisterUnoController_Impl( this ); } @@ -130,7 +131,7 @@ void SfxUnoControllerItem::UnBind() void SAL_CALL SfxUnoControllerItem::statusChanged(const ::com::sun::star::frame::FeatureStateEvent& rEvent) throw ( ::com::sun::star::uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; DBG_ASSERT( pCtrlItem, "Dispatch hat den StatusListener nicht entfern!" ); if ( rEvent.Requery ) @@ -339,28 +340,6 @@ sal_Int64 SAL_CALL SfxOfficeDispatch::getSomething( const ::com::sun::star::uno: return 0; } -/* ASDBG -void* SfxOfficeDispatch::getImplementation(Reflection *p) -{ - if( p == ::getCppuType((const SfxOfficeDispatch*)0) ) - return this; - else - return ::cppu::OWeakObject::getImplementation(p); - -} - -Reflection* ::getCppuType((const SfxOfficeDispatch*)0) -{ - static StandardClassReflection aRefl( - 0, - createStandardClass( - "SfxOfficeDispatch", ::cppu::OWeakObject::get::cppu::OWeakObjectIdlClass(), - 1, - ::getCppuType((const ::com::sun::star::frame::XDispatch*)0) ) ); - return &aRefl; -} -*/ - SfxOfficeDispatch::SfxOfficeDispatch( SfxBindings& rBindings, SfxDispatcher* pDispat, const SfxSlot* pSlot, const ::com::sun::star::util::URL& rURL ) { // nOfficeDispatchCount++; @@ -470,7 +449,7 @@ sal_Bool SfxOfficeDispatch::IsMasterUnoCommand() const // Determine if URL contains a master/slave command which must be handled a little bit different sal_Bool SfxOfficeDispatch::IsMasterUnoCommand( const ::com::sun::star::util::URL& aURL ) { - if ( aURL.Protocol.equalsAscii( ".uno:" ) && + if ( aURL.Protocol.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ".uno:" ) ) && ( aURL.Path.indexOf( '.' ) > 0 )) return sal_True; @@ -506,12 +485,12 @@ SfxDispatchController_Impl::SfxDispatchController_Impl( , bVisible( sal_True ) , pUnoName( pSlot->pUnoName ) { - if ( aDispatchURL.Protocol.equalsAscii("slot:") && pUnoName ) + if ( aDispatchURL.Protocol.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("slot:")) && pUnoName ) { ByteString aTmp(".uno:"); aTmp += pUnoName; aDispatchURL.Complete = ::rtl::OUString::createFromAscii( aTmp.GetBuffer() ); - Reference < ::com::sun::star::util::XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), UNO_QUERY ); + Reference < ::com::sun::star::util::XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), UNO_QUERY ); xTrans->parseStrict( aDispatchURL ); } @@ -667,7 +646,7 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchResultListener >& rListener ) throw( ::com::sun::star::uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( pDispatch && ( @@ -702,6 +681,7 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util // Filter arguments which shouldn't be part of the sequence property value sal_Bool bTemp = sal_Bool(); sal_uInt16 nModifier(0); + sal_Bool bVBARequest = sal_False; std::vector< ::com::sun::star::beans::PropertyValue > aAddArgs; for( sal_Int32 n=0; n<nCount; n++ ) { @@ -718,6 +698,10 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util } else if( rProp.Name.equalsAsciiL("KeyModifier",11)) rProp.Value >>= nModifier; + else if( rProp.Name.equalsAsciiL("VBADialogResultRequest",22) ) + { + rProp.Value >>= bVBARequest; + } else aAddArgs.push_back( aArgs[n] ); } @@ -759,7 +743,6 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util aInternalSet.Put( SfxUnoFrameItem( SID_FILLFRAME, xFrameRef ) ); sal_Bool bSuccess = sal_False; - sal_Bool bFailure = sal_False; const SfxPoolItem* pItem = NULL; SfxShell* pShell( 0 ); // #i102619# Retrieve metric from shell before execution - the shell could be destroyed after execution @@ -800,7 +783,14 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util pDispatcher->GetBindings()->Execute_Impl( aReq, pSlot, pShell ); pItem = aReq.GetReturnValue(); bSuccess = aReq.IsDone() || pItem != NULL; - bFailure = aReq.IsCancelled(); + if ( bVBARequest ) + { + SFX_REQUEST_ARG( aReq, pDlgRet, SfxBoolItem, SID_DIALOG_RETURN, FALSE ); + if ( pDlgRet ) + { + bSuccess = pDlgRet->GetValue(); + } + } } } #ifdef DBG_UTIL @@ -842,11 +832,8 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util ::com::sun::star::frame::DispatchResultEvent aEvent; if ( bSuccess ) aEvent.State = com::sun::star::frame::DispatchResultState::SUCCESS; -// else if ( bFailure ) else aEvent.State = com::sun::star::frame::DispatchResultState::FAILURE; -// else -// aEvent.State = com::sun::star::frame::DispatchResultState::DONTKNOW; aEvent.Source = (::com::sun::star::frame::XDispatch*) pDispatch; if ( bSuccess && pItem && !pItem->ISA(SfxVoidItem) ) @@ -871,7 +858,7 @@ SfxDispatcher* SfxDispatchController_Impl::GetDispatcher() void SAL_CALL SfxDispatchController_Impl::addStatusListener(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & aListener, const ::com::sun::star::util::URL& aURL) throw ( ::com::sun::star::uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + SolarMutexGuard aGuard; if ( !pDispatch ) return; @@ -1011,3 +998,5 @@ void SfxDispatchController_Impl::StateChanged( sal_uInt16 nSID, SfxItemState eSt { StateChanged( nSID, eState, pState, 0 ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |