summaryrefslogtreecommitdiff
path: root/vbahelper/source/vbahelper/vbadialogbase.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vbahelper/source/vbahelper/vbadialogbase.cxx')
-rw-r--r--vbahelper/source/vbahelper/vbadialogbase.cxx28
1 files changed, 23 insertions, 5 deletions
diff --git a/vbahelper/source/vbahelper/vbadialogbase.cxx b/vbahelper/source/vbahelper/vbadialogbase.cxx
index e093e32c7443..d39fb273c7db 100644
--- a/vbahelper/source/vbahelper/vbadialogbase.cxx
+++ b/vbahelper/source/vbahelper/vbadialogbase.cxx
@@ -30,11 +30,10 @@
using namespace ::ooo::vba;
using namespace ::com::sun::star;
-// fails silently
-void
-VbaDialogBase::Show() throw(uno::RuntimeException)
+sal_Bool SAL_CALL VbaDialogBase::Show() throw ( uno::RuntimeException )
{
rtl::OUString aURL;
+ sal_Bool bSuccess = sal_False;
if ( m_xModel.is() )
{
aURL = mapIndexToName( mnIndex );
@@ -42,7 +41,26 @@ VbaDialogBase::Show() throw(uno::RuntimeException)
throw uno::RuntimeException(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " Unable to open the specified dialog " ) ),
uno::Reference< XInterface > () );
- dispatchRequests( m_xModel, aURL );
+
+ uno::Sequence< beans::PropertyValue > dispatchProps(0);
+ if ( aURL.equalsAscii(".uno:PrinterSetup") )
+ {
+ dispatchProps.realloc(1);
+ dispatchProps[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "VBADialogResultRequest" ) );
+ dispatchProps[0].Value <<= (sal_Bool) sal_True;
+ }
+
+ 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;
}
-