summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2018-02-01 20:48:10 +0200
committerTor Lillqvist <tml@collabora.com>2018-06-04 20:10:16 +0300
commit0fd6fa15a9fc29874ceaa0c3369787a56486937c (patch)
tree1173108aecaf3eba108d7fada7f59d48495a93e7 /sw/source
parentd219c6e3b21be03945b9bb5f4f69a15584e3f9d4 (diff)
Don't crash if aArgs is empty
Change-Id: Icaa09de92fb25583f35139632fa8453e5fa4dd85 (cherry picked from commit ef3d1bf9e35d4753c52883137e07236ce8617f2f)
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 );
}