summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/ui/vba/vbaglobals.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/sw/source/ui/vba/vbaglobals.cxx b/sw/source/ui/vba/vbaglobals.cxx
index 9fd6514aaf7c..bfb9ffadcf07 100644
--- a/sw/source/ui/vba/vbaglobals.cxx
+++ b/sw/source/ui/vba/vbaglobals.cxx
@@ -36,12 +36,14 @@ using namespace ::ooo::vba;
SwVbaGlobals::SwVbaGlobals( uno::Sequence< uno::Any > const& aArgs, uno::Reference< uno::XComponentContext >const& rxContext ) : SwVbaGlobals_BASE( uno::Reference< XHelperInterface >(), rxContext, "WordDocumentContext" )
{
SAL_INFO("sw.vba", "SwVbaGlobals::SwVbaGlobals()");
- uno::Sequence< beans::PropertyValue > aInitArgs( 2 );
+ uno::Sequence< beans::PropertyValue > aInitArgs( aArgs.getLength() + 1 );
aInitArgs[ 0 ].Name = "Application";
aInitArgs[ 0 ].Value <<= getApplication();
- aInitArgs[ 1 ].Name = "WordDocumentContext";
- aInitArgs[ 1 ].Value <<= getXSomethingFromArgs< frame::XModel >( aArgs, 0 );
-
+ if ( aArgs.getLength() > 0 )
+ {
+ aInitArgs[ 1 ].Name = "WordDocumentContext";
+ aInitArgs[ 1 ].Value <<= getXSomethingFromArgs< frame::XModel >( aArgs, 0 );
+ }
init( aInitArgs );
}