diff options
author | Noel Power <noel.power@suse.com> | 2012-08-24 14:59:01 +0100 |
---|---|---|
committer | Noel Power <noel.power@suse.com> | 2012-08-26 09:49:23 +0100 |
commit | dd91af40e384226e577f5a4b96b48e293cf31fa3 (patch) | |
tree | c8c416a3a5bc5a2d0a99864a978ca1906108cc7d /vbahelper | |
parent | 43b6f77506bdb5ef767ac2211f930bfc911f2046 (diff) |
clean up unnecessary non working implementations
Change-Id: I4cbc0fbf17aa80db4b19df630d6f18f97b9f6982
Diffstat (limited to 'vbahelper')
-rw-r--r-- | vbahelper/inc/vbahelper/vbahelper.hxx | 24 | ||||
-rw-r--r-- | vbahelper/source/vbahelper/vbadialogbase.cxx | 21 | ||||
-rw-r--r-- | vbahelper/source/vbahelper/vbahelper.cxx | 37 |
3 files changed, 5 insertions, 77 deletions
diff --git a/vbahelper/inc/vbahelper/vbahelper.hxx b/vbahelper/inc/vbahelper/vbahelper.hxx index 42f7ea23bd82..d1d15f549b17 100644 --- a/vbahelper/inc/vbahelper/vbahelper.hxx +++ b/vbahelper/inc/vbahelper/vbahelper.hxx @@ -27,10 +27,6 @@ #include <com/sun/star/lang/IllegalArgumentException.hpp> #include <com/sun/star/awt/XControl.hpp> #include <com/sun/star/awt/XDevice.hpp> -#include <com/sun/star/frame/XDispatchResultListener.hpp> -#include <com/sun/star/frame/DispatchResultEvent.hpp> -#include <com/sun/star/frame/DispatchResultState.hpp> -#include <com/sun/star/lang/EventObject.hpp> #include <com/sun/star/awt/XUnitConversion.hpp> #include <basic/basmgr.hxx> #include <basic/sberrors.hxx> @@ -77,7 +73,7 @@ namespace ooo VBAHELPER_DLLPUBLIC css::uno::Reference< css::script::XTypeConverter > getTypeConverter( const css::uno::Reference< css::uno::XComponentContext >& xContext ) throw (css::uno::RuntimeException); VBAHELPER_DLLPUBLIC void dispatchRequests( const css::uno::Reference< css::frame::XModel>& xModel, const rtl::OUString& aUrl ); - VBAHELPER_DLLPUBLIC void dispatchRequests (const css::uno::Reference< css::frame::XModel>& xModel, const rtl::OUString & aUrl, const css::uno::Sequence< css::beans::PropertyValue >& sProps, const css::uno::Reference< css::frame::XDispatchResultListener >& rListener = css::uno::Reference< css::frame::XDispatchResultListener >(), const sal_Bool bSilent = sal_True ); + VBAHELPER_DLLPUBLIC void dispatchRequests (const css::uno::Reference< css::frame::XModel>& xModel, const rtl::OUString & aUrl, const css::uno::Sequence< css::beans::PropertyValue >& sProps ); VBAHELPER_DLLPUBLIC void dispatchExecute(SfxViewShell* pView, sal_uInt16 nSlot, SfxCallMode nCall = SFX_CALLMODE_SYNCHRON ); VBAHELPER_DLLPUBLIC sal_Int32 OORGBToXLRGB( sal_Int32 ); VBAHELPER_DLLPUBLIC sal_Int32 XLRGBToOORGB( sal_Int32 ); @@ -252,24 +248,6 @@ public: static void exception( const css::uno::Exception& ex ) throw( css::script::BasicErrorException ); }; -class VBAHELPER_DLLPUBLIC VBADispatchListener : public cppu::WeakImplHelper1< css::frame::XDispatchResultListener > -{ -private: - css::uno::Any m_Result; - sal_Bool m_State; - -public: - VBADispatchListener(); - ~VBADispatchListener(); - - css::uno::Any getResult() { return m_Result; } - sal_Bool getState() { return m_State; } - - // XDispatchResultListener - virtual void SAL_CALL dispatchFinished( const css::frame::DispatchResultEvent& aEvent ) throw ( css::uno::RuntimeException ); - virtual void SAL_CALL disposing( const css::lang::EventObject& aEvent ) throw ( css::uno::RuntimeException ); -}; - } // vba } // ooo 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<frame::XDispatch> xDispatcher = xDispatchProvider->queryDispatch(url,emptyString,0); - uno::Reference< frame::XNotifyingDispatch > xNotifyingDispatcher( xDispatcher, uno::UNO_QUERY ); uno::Sequence<beans::PropertyValue> 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; |