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>
This commit is contained in:
Julien Nabet 2021-06-11 13:00:59 +02:00
parent 771c8282aa
commit 92889bc98f
4 changed files with 5 additions and 14 deletions

View file

@ -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();

View file

@ -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: */

View file

@ -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" );

View file

@ -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 );