summaryrefslogtreecommitdiff
path: root/vbahelper/source
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2021-06-11 13:00:59 +0200
committerJulien Nabet <serval2412@yahoo.fr>2021-06-11 16:02:57 +0200
commit92889bc98f4e822715874cb80346d8370e9da8e6 (patch)
tree446c83c97c2e80e45dc9d2b560e174441933fadc /vbahelper/source
parent771c8282aadb45373fc6348cc70f4cd75a43a396 (diff)
Simplify Sequences initializations (vbahelper)
Change-Id: I9bbcf97acd59e7430758e05ae949f7e494afc704 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117051 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'vbahelper/source')
-rw-r--r--vbahelper/source/msforms/vbalistbox.cxx3
-rw-r--r--vbahelper/source/vbahelper/vbadialogbase.cxx3
-rw-r--r--vbahelper/source/vbahelper/vbashape.cxx10
-rw-r--r--vbahelper/source/vbahelper/vbashapes.cxx3
4 files changed, 5 insertions, 14 deletions
diff --git a/vbahelper/source/msforms/vbalistbox.cxx b/vbahelper/source/msforms/vbalistbox.cxx
index 8c2ea52332db..9dcef8a77225 100644
--- a/vbahelper/source/msforms/vbalistbox.cxx
+++ b/vbahelper/source/msforms/vbalistbox.cxx
@@ -81,10 +81,9 @@ ScVbaListBox::setValue( const uno::Any& _value )
if( nValue == -1 )
throw uno::RuntimeException( "Attribute use invalid." );
- uno::Sequence< sal_Int16 > nSelectedIndices(1);
+ uno::Sequence< sal_Int16 > nSelectedIndices { nValue };
uno::Sequence< sal_Int16 > nOldSelectedIndices;
m_xProps->getPropertyValue( "SelectedItems" ) >>= nOldSelectedIndices;
- nSelectedIndices[ 0 ] = nValue;
m_xProps->setPropertyValue( "SelectedItems", uno::makeAny( nSelectedIndices ) );
if ( nSelectedIndices != nOldSelectedIndices )
fireClickEvent();
diff --git a/vbahelper/source/vbahelper/vbadialogbase.cxx b/vbahelper/source/vbahelper/vbadialogbase.cxx
index a1aa0b053436..9b9087bd264d 100644
--- a/vbahelper/source/vbahelper/vbadialogbase.cxx
+++ b/vbahelper/source/vbahelper/vbadialogbase.cxx
@@ -31,8 +31,7 @@ void SAL_CALL VbaDialogBase::Show()
if (aURL.isEmpty())
throw uno::RuntimeException("Unable to open the specified dialog");
- uno::Sequence<beans::PropertyValue> dispatchProps(0);
- dispatchRequests(m_xModel, aURL, dispatchProps);
+ dispatchRequests(m_xModel, aURL, {});
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vbahelper/source/vbahelper/vbashape.cxx b/vbahelper/source/vbahelper/vbashape.cxx
index 8f16865eff8c..67998de7f6f3 100644
--- a/vbahelper/source/vbahelper/vbashape.cxx
+++ b/vbahelper/source/vbahelper/vbashape.cxx
@@ -389,10 +389,7 @@ ScVbaShape::TextFrame()
if( xServiceInfo->supportsService( "com.sun.star.sheet.SpreadsheetDocument" ) )
{
uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
- uno::Sequence< uno::Any > aArgs(2);
- aArgs[0] <<= getParent();
- aArgs[1] <<= m_xShape;
- uno::Reference< uno::XInterface > xTextFrame = xContext->getServiceManager()->createInstanceWithArgumentsAndContext( "ooo.vba.excel.TextFrame" , aArgs, xContext );
+ uno::Reference< uno::XInterface > xTextFrame = xContext->getServiceManager()->createInstanceWithArgumentsAndContext( "ooo.vba.excel.TextFrame" , { uno::Any(getParent()), uno::Any(m_xShape) }, xContext );
return uno::makeAny( xTextFrame );
}
@@ -726,10 +723,7 @@ ScVbaShape::WrapFormat()
if( xServiceInfo->supportsService( "com.sun.star.text.TextDocument" ))
{
uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
- uno::Sequence< uno::Any > aArgs(2);
- aArgs[0] <<= getParent();
- aArgs[1] <<= m_xShape;
- uno::Reference< uno::XInterface > xWrapFormat = xContext->getServiceManager()->createInstanceWithArgumentsAndContext( "ooo.vba.word.WrapFormat" , aArgs, xContext );
+ uno::Reference< uno::XInterface > xWrapFormat = xContext->getServiceManager()->createInstanceWithArgumentsAndContext( "ooo.vba.word.WrapFormat" ,{ uno::Any(getParent()), uno::Any(m_xShape) }, xContext );
return uno::makeAny( xWrapFormat );
}
throw uno::RuntimeException( "Not implemented" );
diff --git a/vbahelper/source/vbahelper/vbashapes.cxx b/vbahelper/source/vbahelper/vbashapes.cxx
index c14f81791f95..552365da3861 100644
--- a/vbahelper/source/vbahelper/vbashapes.cxx
+++ b/vbahelper/source/vbahelper/vbashapes.cxx
@@ -180,8 +180,7 @@ ScVbaShapes::Range( const uno::Any& shapes )
else
{
// wrap single index into a sequence
- uno::Sequence< uno::Any > sIndices(1);
- sIndices[ 0 ] = shapes;
+ uno::Sequence< uno::Any > sIndices { shapes };
uno::Any aIndex;
aIndex <<= sIndices;
xShapes = getShapesByArrayIndices( aIndex );