From dd91af40e384226e577f5a4b96b48e293cf31fa3 Mon Sep 17 00:00:00 2001 From: Noel Power Date: Fri, 24 Aug 2012 14:59:01 +0100 Subject: clean up unnecessary non working implementations Change-Id: I4cbc0fbf17aa80db4b19df630d6f18f97b9f6982 --- vbahelper/source/vbahelper/vbadialogbase.cxx | 21 ++-------------- vbahelper/source/vbahelper/vbahelper.cxx | 37 ++-------------------------- 2 files changed, 4 insertions(+), 54 deletions(-) (limited to 'vbahelper/source') diff --git a/vbahelper/source/vbahelper/vbadialogbase.cxx b/vbahelper/source/vbahelper/vbadialogbase.cxx index 3b5bfe00536d..48dcc037f03f 100644 --- a/vbahelper/source/vbahelper/vbadialogbase.cxx +++ b/vbahelper/source/vbahelper/vbadialogbase.cxx @@ -25,7 +25,6 @@ using namespace ::com::sun::star; sal_Bool SAL_CALL VbaDialogBase::Show() throw ( uno::RuntimeException ) { rtl::OUString aURL; - sal_Bool bSuccess = sal_False; if ( m_xModel.is() ) { aURL = mapIndexToName( mnIndex ); @@ -35,25 +34,9 @@ sal_Bool SAL_CALL VbaDialogBase::Show() throw ( uno::RuntimeException ) uno::Reference< XInterface > () ); uno::Sequence< beans::PropertyValue > dispatchProps(0); - if ( aURL == ".uno:PrinterSetup" ) - { - dispatchProps.realloc(1); - dispatchProps[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "VBADialogResultRequest" ) ); - dispatchProps[0].Value <<= (sal_Bool) sal_True; - } + dispatchRequests( m_xModel, aURL, dispatchProps ); - VBADispatchListener *pNotificationListener = new VBADispatchListener(); - uno::Reference< frame::XDispatchResultListener > rListener = pNotificationListener; - dispatchRequests( m_xModel, aURL, dispatchProps, rListener, sal_False ); - - bSuccess = pNotificationListener->getState(); - uno::Any aResult = pNotificationListener->getResult(); - if ( bSuccess ) - { - if ( aResult.getValueTypeClass() == uno::TypeClass_BOOLEAN ) - aResult >>= bSuccess; - } } - return bSuccess; + return sal_True; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx index 68b8a9b1946d..ff9681d4c721 100644 --- a/vbahelper/source/vbahelper/vbahelper.cxx +++ b/vbahelper/source/vbahelper/vbahelper.cxx @@ -144,7 +144,7 @@ void dispatchExecute(SfxViewShell* pViewShell, sal_uInt16 nSlot, SfxCallMode nCa } void -dispatchRequests (const uno::Reference< frame::XModel>& xModel, const rtl::OUString & aUrl, const uno::Sequence< beans::PropertyValue >& sProps, const uno::Reference< frame::XDispatchResultListener >& rListener, const sal_Bool bSilent ) +dispatchRequests (const uno::Reference< frame::XModel>& xModel, const rtl::OUString & aUrl, const uno::Sequence< beans::PropertyValue >& sProps ) { util::URL url; url.Complete = aUrl; @@ -172,7 +172,6 @@ dispatchRequests (const uno::Reference< frame::XModel>& xModel, const rtl::OUStr } uno::Reference xDispatcher = xDispatchProvider->queryDispatch(url,emptyString,0); - uno::Reference< frame::XNotifyingDispatch > xNotifyingDispatcher( xDispatcher, uno::UNO_QUERY ); uno::Sequence dispatchProps(1); @@ -188,20 +187,10 @@ dispatchRequests (const uno::Reference< frame::XModel>& xModel, const rtl::OUStr *pDest = *pSrc; } - if ( bSilent ) - { - (*pDest).Name = rtl::OUString( "Silent" ); - (*pDest).Value <<= (sal_Bool)sal_True; - } - - if ( !rListener.is() && xDispatcher.is() ) + if ( xDispatcher.is() ) { xDispatcher->dispatch( url, dispatchProps ); } - else if ( rListener.is() && xNotifyingDispatcher.is() ) - { - xNotifyingDispatcher->dispatchWithNotification( url, dispatchProps, rListener ); - } } void @@ -1167,28 +1156,6 @@ double Millimeter::getInPoints(int _hmm) return points; } -// Listener for XNotifyingDispatch -VBADispatchListener::VBADispatchListener() : m_State( sal_False ) -{ -} - -// Listener for XNotifyingDispatch -VBADispatchListener::~VBADispatchListener() -{ -} - -// Listener for XNotifyingDispatch -void SAL_CALL VBADispatchListener::dispatchFinished( const frame::DispatchResultEvent& aEvent ) throw ( uno::RuntimeException ) -{ - m_Result = aEvent.Result; - m_State = ( aEvent.State == frame::DispatchResultState::SUCCESS ) ? sal_True : sal_False; -} - -// Listener for XNotifyingDispatch -void SAL_CALL VBADispatchListener::disposing( const lang::EventObject& /*aEvent*/ ) throw( uno::RuntimeException ) -{ -} - uno::Reference< XHelperInterface > getVBADocument( const uno::Reference< frame::XModel >& xModel ) { uno::Reference< XHelperInterface > xIf; -- cgit