[Libreoffice-commits] .: Branch 'integration/dev300_m98' - vbahelper/inc vbahelper/source
Michael Meeks
michael at kemper.freedesktop.org
Mon Mar 7 02:16:11 PST 2011
vbahelper/inc/vbahelper/vbadialogbase.hxx | 2 -
vbahelper/inc/vbahelper/vbaeventshelperbase.hxx | 11 ------
vbahelper/source/msforms/vbauserform.cxx | 2 -
vbahelper/source/vbahelper/makefile.mk | 10 ++++++
vbahelper/source/vbahelper/vbaapplicationbase.cxx | 6 +--
vbahelper/source/vbahelper/vbacommandbarcontrol.cxx | 6 +--
vbahelper/source/vbahelper/vbadialogbase.cxx | 32 ++++++++++++++++----
vbahelper/source/vbahelper/vbadocumentbase.cxx | 29 ++++++++----------
8 files changed, 57 insertions(+), 41 deletions(-)
New commits:
commit 25b3be376dd6731e1838840e5a928b82d7bc98b6
Author: Michael Meeks <michael.meeks at novell.com>
Date: Mon Mar 7 10:15:12 2011 +0000
build / merge cleanup
diff --git a/vbahelper/inc/vbahelper/vbadialogbase.hxx b/vbahelper/inc/vbahelper/vbadialogbase.hxx
index 70bd565..32e2f37 100644
--- a/vbahelper/inc/vbahelper/vbadialogbase.hxx
+++ b/vbahelper/inc/vbahelper/vbadialogbase.hxx
@@ -44,7 +44,7 @@ public:
virtual ~VbaDialogBase() {}
// Methods
- virtual void SAL_CALL Show() throw (css::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL Show() throw (css::uno::RuntimeException);
virtual rtl::OUString mapIndexToName( sal_Int32 nIndex ) = 0;
};
diff --git a/vbahelper/inc/vbahelper/vbaeventshelperbase.hxx b/vbahelper/inc/vbahelper/vbaeventshelperbase.hxx
index f5ccb61..6335392 100644
--- a/vbahelper/inc/vbahelper/vbaeventshelperbase.hxx
+++ b/vbahelper/inc/vbahelper/vbaeventshelperbase.hxx
@@ -59,17 +59,6 @@ public:
// XEventListener
virtual void SAL_CALL disposing( const css::lang::EventObject& aSource ) throw (css::uno::RuntimeException);
- // little helpers ---------------------------------------------------------
-
- /** Throws, if the passed sequence does not contain a value at the specified index. */
- static inline void checkArgument( const css::uno::Sequence< css::uno::Any >& rArgs, sal_Int32 nIndex ) throw (css::lang::IllegalArgumentException)
- { if( (nIndex < 0) || (nIndex >= rArgs.getLength()) ) throw css::lang::IllegalArgumentException(); }
-
- /** Throws, if the passed sequence does not contain a value of a specific at the specified index. */
- template< typename Type >
- static inline void checkArgumentType( const css::uno::Sequence< css::uno::Any >& rArgs, sal_Int32 nIndex ) throw (css::lang::IllegalArgumentException)
- { checkArgument( rArgs, nIndex ); if( !rArgs[ nIndex ].has< Type >() ) throw css::lang::IllegalArgumentException(); }
-
protected:
// ------------------------------------------------------------------------
diff --git a/vbahelper/source/msforms/vbauserform.cxx b/vbahelper/source/msforms/vbauserform.cxx
index 81db4d4..74f45a4 100644
--- a/vbahelper/source/msforms/vbauserform.cxx
+++ b/vbahelper/source/msforms/vbauserform.cxx
@@ -27,6 +27,7 @@
************************************************************************/
#include <vbahelper/helperdecl.hxx>
#include "vbauserform.hxx"
+#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/awt/XControl.hpp>
#include <com/sun/star/awt/XControlContainer.hpp>
#include <com/sun/star/awt/XWindow2.hpp>
@@ -255,7 +256,6 @@ ScVbaUserForm::getValue( const ::rtl::OUString& aPropertyName ) throw (beans::Un
pControl->setLibraryAndCodeName( m_sLibName.concat( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "." ) ) ).concat( getName() ) );
aResult = uno::makeAny( xVBAControl );
}
- }
return aResult;
}
diff --git a/vbahelper/source/vbahelper/makefile.mk b/vbahelper/source/vbahelper/makefile.mk
index 22e8d90..52f6f2b 100644
--- a/vbahelper/source/vbahelper/makefile.mk
+++ b/vbahelper/source/vbahelper/makefile.mk
@@ -77,4 +77,14 @@ SLOFILES=\
.INCLUDE : target.mk
+ALLTAR : \
+ $(MISC)$/$(TARGET).don \
+
+$(SLOFILES) : $(MISC)$/$(TARGET).don
+
+$(MISC)$/$(TARGET).don : $(SOLARBINDIR)$/oovbaapi.rdb
+ +$(CPPUMAKER) -O$(INCCOM)$/$(TARGET) -BUCR $(SOLARBINDIR)$/oovbaapi.rdb -X$(SOLARBINDIR)$/types.rdb && echo > $@
+ echo $@
+
+
diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
index 927054a..6c53357 100644
--- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx
+++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx
@@ -347,8 +347,8 @@ uno::Any SAL_CALL VbaApplicationBase::Run( const ::rtl::OUString& MacroName, con
// search the global tempalte
- VBAMacroResolvedInfo aMacroInfo = resolveVBAMacro( getSfxObjShell( aMacroDocumentModel ), sMacro_only_Name, sal_True );
- if( aMacroInfo.IsResolved() )
+ MacroResolvedInfo aMacroInfo = resolveVBAMacro( getSfxObjShell( aMacroDocumentModel ), sMacro_only_Name, sal_True );
+ if( aMacroInfo.mbFound )
{
// handle the arguments
const uno::Any* aArgsPtrArray[] = { &varg1, &varg2, &varg3, &varg4, &varg5, &varg6, &varg7, &varg8, &varg9, &varg10, &varg11, &varg12, &varg13, &varg14, &varg15, &varg16, &varg17, &varg18, &varg19, &varg20, &varg21, &varg22, &varg23, &varg24, &varg25, &varg26, &varg27, &varg28, &varg29, &varg30 };
@@ -374,7 +374,7 @@ uno::Any SAL_CALL VbaApplicationBase::Run( const ::rtl::OUString& MacroName, con
uno::Any aRet;
uno::Any aDummyCaller;
- executeMacro( aMacroInfo.MacroDocContext(), aMacroInfo.ResolvedMacro(), aArgs, aRet, aDummyCaller );
+ executeMacro( aMacroInfo.mpDocContext, aMacroInfo.msResolvedMacro, aArgs, aRet, aDummyCaller );
return aRet;
}
diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx b/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx
index a8ebcdf..e93b237 100644
--- a/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx
@@ -79,10 +79,10 @@ ScVbaCommandBarControl::setOnAction( const ::rtl::OUString& _onaction ) throw (u
{
// get the current model
uno::Reference< frame::XModel > xModel( pCBarHelper->getModel() );
- VBAMacroResolvedInfo aResolvedMacro = ooo::vba::resolveVBAMacro( getSfxObjShell( xModel ), _onaction, true );
- if ( aResolvedMacro.IsResolved() )
+ MacroResolvedInfo aResolvedMacro = ooo::vba::resolveVBAMacro( getSfxObjShell( xModel ), _onaction, true );
+ if ( aResolvedMacro.mbFound )
{
- rtl::OUString aCommandURL = ooo::vba::makeMacroURL( aResolvedMacro.ResolvedMacro() );
+ rtl::OUString aCommandURL = ooo::vba::makeMacroURL( aResolvedMacro.msResolvedMacro );
OSL_TRACE(" ScVbaCommandBarControl::setOnAction: %s", rtl::OUStringToOString( aCommandURL, RTL_TEXTENCODING_UTF8 ).getStr() );
setPropertyValue( m_aPropertyValues, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CommandURL")), uno::makeAny( aCommandURL ) );
ApplyChange();
diff --git a/vbahelper/source/vbahelper/vbadialogbase.cxx b/vbahelper/source/vbahelper/vbadialogbase.cxx
index ec7ecae..302a565 100644
--- a/vbahelper/source/vbahelper/vbadialogbase.cxx
+++ b/vbahelper/source/vbahelper/vbadialogbase.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.
@@ -30,11 +31,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 +42,27 @@ 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.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(".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;
+}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbadocumentbase.cxx b/vbahelper/source/vbahelper/vbadocumentbase.cxx
index 4195199..6514be8 100644
--- a/vbahelper/source/vbahelper/vbadocumentbase.cxx
+++ b/vbahelper/source/vbahelper/vbadocumentbase.cxx
@@ -173,29 +173,26 @@ VbaDocumentBase::Close( const uno::Any &rSaveArg, const uno::Any &rFileArg,
// The boolean parameter DeliverOwnership tells objects vetoing the close process that they may
// assume ownership if they object the closure by throwing a CloseVetoException
// Here we give up ownership. To be on the safe side, catch possible veto exception anyway.
- try{
- xCloseable->close(sal_True);
- }
- catch( util::CloseVetoException )
- {
- //close is cancelled, nothing to do
+ try {
+ xCloseable->close(sal_True);
+ }
+ catch( util::CloseVetoException ) {
+ //close is cancelled, nothing to do
+ }
}
- }
// If close is not supported by this model - try to dispose it.
// But if the model disagree with a reset request for the modify state
// we shouldn't do so. Otherwhise some strange things can happen.
- else
- {
+ else
+ {
uno::Reference< lang::XComponent > xDisposable ( getModel(), uno::UNO_QUERY );
if ( xDisposable.is() )
- {
- // To be on the safe side, catch possible veto exception anyway.
- try
- {
- xDisposable->dispose();
- }
- catch( uno::Exception& )
{
+ // To be on the safe side, catch possible veto exception anyway.
+ try {
+ xDisposable->dispose();
+ }
+ catch( uno::Exception& ) {}
}
}
}
More information about the Libreoffice-commits
mailing list