summaryrefslogtreecommitdiff
path: root/sc/source/ui/vba
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-02-24 11:22:18 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-02-28 10:17:47 +0000
commit198c41c4fe8be4ce8a6ddab43ae0c5f17a4889ac (patch)
tree041d55126e9770b81f68fadfaaa69e82313786b3 /sc/source/ui/vba
parentd3981b3e8c021ee03a2ca7103a73e56cca18df81 (diff)
new loplugin unoany
Change-Id: I5d6c4a67cb2a09e7cd5bd620c6b262d188701b89 Reviewed-on: https://gerrit.libreoffice.org/34714 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/vba')
-rw-r--r--sc/source/ui/vba/vbachartobjects.cxx2
-rw-r--r--sc/source/ui/vba/vbaformat.cxx80
-rw-r--r--sc/source/ui/vba/vbaformatconditions.cxx6
-rw-r--r--sc/source/ui/vba/vbaglobals.cxx4
-rw-r--r--sc/source/ui/vba/vbarange.cxx8
-rw-r--r--sc/source/ui/vba/vbaworkbook.cxx20
6 files changed, 60 insertions, 60 deletions
diff --git a/sc/source/ui/vba/vbachartobjects.cxx b/sc/source/ui/vba/vbachartobjects.cxx
index 9e5f5c025714..185e597e257a 100644
--- a/sc/source/ui/vba/vbachartobjects.cxx
+++ b/sc/source/ui/vba/vbachartobjects.cxx
@@ -50,7 +50,7 @@ public:
{
uno::Reference< table::XTableChart > xTableChart( m_xEnumeration->nextElement(), uno::UNO_QUERY_THROW );
// parent Object is sheet
- ret = uno::makeAny( uno::Reference< excel::XChartObject > ( new ScVbaChartObject( m_xParent, m_xContext, xTableChart, xDrawPageSupplier ) ) );
+ ret <<= uno::Reference< excel::XChartObject > ( new ScVbaChartObject( m_xParent, m_xContext, xTableChart, xDrawPageSupplier ) );
}
catch (const lang::WrappedTargetException&)
{
diff --git a/sc/source/ui/vba/vbaformat.cxx b/sc/source/ui/vba/vbaformat.cxx
index f9161b979335..cbd390032938 100644
--- a/sc/source/ui/vba/vbaformat.cxx
+++ b/sc/source/ui/vba/vbaformat.cxx
@@ -89,21 +89,21 @@ ScVbaFormat< Ifc... >::setVerticalAlignment( const uno::Any& _oAlignment)
switch (nAlignment)
{
case excel::XlVAlign::xlVAlignBottom :
- aVal = uno::makeAny( table::CellVertJustify2::BOTTOM );
+ aVal <<= table::CellVertJustify2::BOTTOM;
break;
case excel::XlVAlign::xlVAlignCenter :
- aVal = uno::makeAny( table::CellVertJustify2::CENTER );
+ aVal <<= table::CellVertJustify2::CENTER;
break;
case excel::XlVAlign::xlVAlignDistributed:
case excel::XlVAlign::xlVAlignJustify:
- aVal = uno::makeAny( table::CellVertJustify2::STANDARD );
+ aVal <<= table::CellVertJustify2::STANDARD;
break;
case excel::XlVAlign::xlVAlignTop:
- aVal = uno::makeAny( table::CellVertJustify2::TOP);
+ aVal <<= table::CellVertJustify2::TOP;
break;
default:
- aVal = uno::makeAny( table::CellVertJustify2::STANDARD );
+ aVal <<= table::CellVertJustify2::STANDARD;
break;
}
mxPropertySet->setPropertyValue( SC_UNONAME_CELLVJUS, aVal );
@@ -128,16 +128,16 @@ ScVbaFormat< Ifc... >::getVerticalAlignment( )
switch( aAPIAlignment )
{
case table::CellVertJustify2::BOTTOM:
- aResult = uno::makeAny( excel::XlVAlign::xlVAlignBottom );
+ aResult <<= excel::XlVAlign::xlVAlignBottom;
break;
case table::CellVertJustify2::CENTER:
- aResult = uno::makeAny( excel::XlVAlign::xlVAlignCenter );
+ aResult <<= excel::XlVAlign::xlVAlignCenter;
break;
case table::CellVertJustify2::STANDARD:
- aResult = uno::makeAny( excel::XlVAlign::xlVAlignBottom );
+ aResult <<= excel::XlVAlign::xlVAlignBottom;
break;
case table::CellVertJustify2::TOP:
- aResult = uno::makeAny( excel::XlVAlign::xlVAlignTop );
+ aResult <<= excel::XlVAlign::xlVAlignTop;
break;
default:
break;
@@ -164,19 +164,19 @@ ScVbaFormat< Ifc... >::setHorizontalAlignment( const uno::Any& HorizontalAlignme
switch ( nAlignment )
{
case excel::XlHAlign::xlHAlignJustify:
- aVal = uno::makeAny( table::CellHoriJustify_BLOCK);
+ aVal <<= table::CellHoriJustify_BLOCK;
break;
case excel::XlHAlign::xlHAlignCenter:
- aVal = uno::makeAny( table::CellHoriJustify_CENTER );
+ aVal <<= table::CellHoriJustify_CENTER;
break;
case excel::XlHAlign::xlHAlignDistributed:
- aVal = uno::makeAny( table::CellHoriJustify_BLOCK);
+ aVal <<= table::CellHoriJustify_BLOCK;
break;
case excel::XlHAlign::xlHAlignLeft:
- aVal = uno::makeAny( table::CellHoriJustify_LEFT);
+ aVal <<= table::CellHoriJustify_LEFT;
break;
case excel::XlHAlign::xlHAlignRight:
- aVal = uno::makeAny( table::CellHoriJustify_RIGHT);
+ aVal <<= table::CellHoriJustify_RIGHT;
break;
}
// #FIXME what about the default case above?
@@ -208,16 +208,16 @@ ScVbaFormat< Ifc... >::getHorizontalAlignment( )
switch( aAPIAlignment )
{
case table::CellHoriJustify_BLOCK:
- NRetAlignment = uno::makeAny( excel::XlHAlign::xlHAlignJustify );
+ NRetAlignment <<= excel::XlHAlign::xlHAlignJustify;
break;
case table::CellHoriJustify_CENTER:
- NRetAlignment = uno::makeAny( excel::XlHAlign::xlHAlignCenter );
+ NRetAlignment <<= excel::XlHAlign::xlHAlignCenter;
break;
case table::CellHoriJustify_LEFT:
- NRetAlignment = uno::makeAny( excel::XlHAlign::xlHAlignLeft );
+ NRetAlignment <<= excel::XlHAlign::xlHAlignLeft;
break;
case table::CellHoriJustify_RIGHT:
- NRetAlignment = uno::makeAny( excel::XlHAlign::xlHAlignRight );
+ NRetAlignment <<= excel::XlHAlign::xlHAlignRight;
break;
default: // handle those other cases with a NULL return
break;
@@ -245,17 +245,17 @@ ScVbaFormat< Ifc... >::setOrientation( const uno::Any& _aOrientation )
switch( nOrientation )
{
case excel::XlOrientation::xlDownward:
- aVal = uno::makeAny( table::CellOrientation_TOPBOTTOM);
+ aVal <<= table::CellOrientation_TOPBOTTOM;
break;
case excel::XlOrientation::xlHorizontal:
- aVal = uno::makeAny( table::CellOrientation_STANDARD );
+ aVal <<= table::CellOrientation_STANDARD;
mxPropertySet->setPropertyValue( SC_UNONAME_ROTANG, uno::makeAny( sal_Int32(0) ) );
break;
case excel::XlOrientation::xlUpward:
- aVal = uno::makeAny( table::CellOrientation_BOTTOMTOP);
+ aVal <<= table::CellOrientation_BOTTOMTOP;
break;
case excel::XlOrientation::xlVertical:
- aVal = uno::makeAny( table::CellOrientation_STACKED);
+ aVal <<= table::CellOrientation_STACKED;
break;
}
// #FIXME what about the default case above?
@@ -285,19 +285,19 @@ ScVbaFormat< Ifc... >::getOrientation( )
switch(aOrientation)
{
case table::CellOrientation_STANDARD:
- NRetOrientation = uno::makeAny( excel::XlOrientation::xlHorizontal );
+ NRetOrientation <<= excel::XlOrientation::xlHorizontal;
break;
case table::CellOrientation_BOTTOMTOP:
- NRetOrientation = uno::makeAny( excel::XlOrientation::xlUpward );
+ NRetOrientation <<= excel::XlOrientation::xlUpward;
break;
case table::CellOrientation_TOPBOTTOM:
- NRetOrientation = uno::makeAny( excel::XlOrientation::xlDownward );
+ NRetOrientation <<= excel::XlOrientation::xlDownward;
break;
case table::CellOrientation_STACKED:
- NRetOrientation = uno::makeAny( excel::XlOrientation::xlVertical );
+ NRetOrientation <<= excel::XlOrientation::xlVertical;
break;
default:
- NRetOrientation = uno::makeAny( excel::XlOrientation::xlHorizontal );
+ NRetOrientation <<= excel::XlOrientation::xlHorizontal;
}
}
}
@@ -390,7 +390,7 @@ ScVbaFormat< Ifc... >::getNumberFormatLocal( )
OUString sFormat;
xNumberFormats->getByKey(nFormat)->getPropertyValue( FORMATSTRING ) >>= sFormat;
- aRet = uno::makeAny( sFormat.toAsciiLowerCase() );
+ aRet <<= sFormat.toAsciiLowerCase();
}
}
@@ -498,9 +498,9 @@ ScVbaFormat< Ifc... >::getIndentLevel( )
{
sal_Int16 IndentLevel = 0;
if ( ( mxPropertySet->getPropertyValue(sParaIndent) >>= IndentLevel ) )
- NRetIndentLevel = uno::makeAny( sal_Int32( rtl::math::round(static_cast<double>( IndentLevel ) / 352.8)) );
+ NRetIndentLevel <<= sal_Int32( rtl::math::round(static_cast<double>( IndentLevel ) / 352.8));
else
- NRetIndentLevel = uno::makeAny( sal_Int32(0) );
+ NRetIndentLevel <<= sal_Int32(0);
}
}
catch (const uno::Exception&)
@@ -568,13 +568,13 @@ ScVbaFormat< Ifc... >::getLocked( )
const ScProtectionAttr& rProtAttr = static_cast<const ScProtectionAttr &>( pDataSet->Get(ATTR_PROTECTION) );
SfxItemState eState = pDataSet->GetItemState(ATTR_PROTECTION);
if(eState != SfxItemState::DONTCARE)
- aCellProtection = uno::makeAny(rProtAttr.GetProtection());
+ aCellProtection <<= rProtAttr.GetProtection();
}
else // fallback to propertyset
{
util::CellProtection cellProtection;
mxPropertySet->getPropertyValue(sCellProt) >>= cellProtection;
- aCellProtection = uno::makeAny( cellProtection.IsLocked );
+ aCellProtection <<= cellProtection.IsLocked;
}
}
}
@@ -601,13 +601,13 @@ ScVbaFormat< Ifc... >::getFormulaHidden( )
const ScProtectionAttr& rProtAttr = static_cast<const ScProtectionAttr &>( pDataSet->Get(ATTR_PROTECTION) );
SfxItemState eState = pDataSet->GetItemState(ATTR_PROTECTION);
if(eState != SfxItemState::DONTCARE)
- aBoolRet = uno::makeAny(rProtAttr.GetHideFormula());
+ aBoolRet <<= rProtAttr.GetHideFormula();
}
else
{
util::CellProtection aCellProtection;
mxPropertySet->getPropertyValue(sCellProt) >>= aCellProtection;
- aBoolRet = uno::makeAny( aCellProtection.IsFormulaHidden );
+ aBoolRet <<= aCellProtection.IsFormulaHidden;
}
}
}
@@ -664,10 +664,10 @@ ScVbaFormat< Ifc... >::setReadingOrder( const uno::Any& ReadingOrder )
switch(nReadingOrder)
{
case excel::Constants::xlLTR:
- aVal = uno::makeAny( text::WritingMode_LR_TB );
+ aVal <<= text::WritingMode_LR_TB;
break;
case excel::Constants::xlRTL:
- aVal = uno::makeAny( text::WritingMode_RL_TB );
+ aVal <<= text::WritingMode_RL_TB;
break;
case excel::Constants::xlContext:
DebugHelper::basicexception(ERRCODE_BASIC_NOT_IMPLEMENTED, OUString());
@@ -698,13 +698,13 @@ ScVbaFormat< Ifc... >::getReadingOrder( )
if ( ( mxPropertySet->getPropertyValue(sWritingMode) ) >>= aWritingMode )
switch (aWritingMode){
case text::WritingMode_LR_TB:
- NRetReadingOrder = uno::makeAny(excel::Constants::xlLTR);
+ NRetReadingOrder <<= excel::Constants::xlLTR;
break;
case text::WritingMode_RL_TB:
- NRetReadingOrder = uno::makeAny(excel::Constants::xlRTL);
+ NRetReadingOrder <<= excel::Constants::xlRTL;
break;
default:
- NRetReadingOrder = uno::makeAny(excel::Constants::xlRTL);
+ NRetReadingOrder <<= excel::Constants::xlRTL;
}
}
}
@@ -733,7 +733,7 @@ ScVbaFormat< Ifc... >::getNumberFormat( )
sal_Int32 nNewFormat = xNumberFormatTypes->getFormatForLocale(nFormat, m_aDefaultLocale );
OUString sFormat;
xNumberFormats->getByKey(nNewFormat)->getPropertyValue( FORMATSTRING ) >>= sFormat;
- aFormat = uno::makeAny( sFormat );
+ aFormat <<= sFormat;
}
}
catch (const uno::Exception& )
diff --git a/sc/source/ui/vba/vbaformatconditions.cxx b/sc/source/ui/vba/vbaformatconditions.cxx
index 7514695a553e..3e326f087c1c 100644
--- a/sc/source/ui/vba/vbaformatconditions.cxx
+++ b/sc/source/ui/vba/vbaformatconditions.cxx
@@ -166,9 +166,9 @@ ScVbaFormatConditions::Add( ::sal_Int32 _nType, const uno::Any& _aOperator, cons
uno::Any aValue;
if ( aType == sheet::ConditionOperator_FORMULA)
- aValue = uno::makeAny( sheet::ConditionOperator_FORMULA );
+ aValue <<= sheet::ConditionOperator_FORMULA;
else
- aValue = uno::makeAny( ScVbaFormatCondition::retrieveAPIOperator(_aOperator) );
+ aValue <<= ScVbaFormatCondition::retrieveAPIOperator(_aOperator);
beans::PropertyValue aProperty( "Operator", 0, aValue, beans::PropertyState_DIRECT_VALUE );
aPropertyValueVector.push_back( aProperty );
@@ -184,7 +184,7 @@ ScVbaFormatConditions::Add( ::sal_Int32 _nType, const uno::Any& _aOperator, cons
aPropertyValueVector.push_back( aProp );
}
aProperty.Name = "StyleName";
- aProperty.Value = uno::makeAny( sStyleName );
+ aProperty.Value <<= sStyleName;
mxSheetConditionalEntries->addNew(comphelper::containerToSequence(aPropertyValueVector));
for (sal_Int32 i = mxSheetConditionalEntries->getCount()-1; i >= 0; i--)
diff --git a/sc/source/ui/vba/vbaglobals.cxx b/sc/source/ui/vba/vbaglobals.cxx
index 9799067e26e1..2898cbbd9d4d 100644
--- a/sc/source/ui/vba/vbaglobals.cxx
+++ b/sc/source/ui/vba/vbaglobals.cxx
@@ -42,9 +42,9 @@ ScVbaGlobals::ScVbaGlobals( uno::Sequence< uno::Any > const& aArgs, uno::Referen
{
uno::Sequence< beans::PropertyValue > aInitArgs( 2 );
aInitArgs[ 0 ].Name = "Application";
- aInitArgs[ 0 ].Value = uno::makeAny( getApplication() );
+ aInitArgs[ 0 ].Value <<= getApplication();
aInitArgs[ 1 ].Name = "ExcelDocumentContext";
- aInitArgs[ 1 ].Value = uno::makeAny( getXSomethingFromArgs< frame::XModel >( aArgs, 0 ) );
+ aInitArgs[ 1 ].Value <<= getXSomethingFromArgs< frame::XModel >( aArgs, 0 );
init( aInitArgs );
}
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index e11234142647..2eb8a4588c88 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -849,9 +849,9 @@ void CellValueGetter::visitNode( sal_Int32 x, sal_Int32 y, const uno::Reference<
uno::Reference< table::XCellRange > xRange( xCell, uno::UNO_QUERY_THROW );
NumFormatHelper cellFormat( xRange );
if ( cellFormat.isBooleanType() )
- aValue = uno::makeAny( ( xCell->getValue() != 0.0 ) );
+ aValue <<= ( xCell->getValue() != 0.0 );
else if ( cellFormat.isDateType() )
- aValue = uno::makeAny( bridge::oleautomation::Date( xCell->getValue() ) );
+ aValue <<= bridge::oleautomation::Date( xCell->getValue() );
else
aValue <<= xCell->getValue();
}
@@ -2064,7 +2064,7 @@ ScVbaRange::Address( const uno::Any& RowAbsolute, const uno::Any& ColumnAbsolut
// force external to be false
// only first address should have the
// document and sheet specifications
- aExternalCopy = uno::makeAny(false);
+ aExternalCopy <<= false;
}
sAddress += xRange->Address( RowAbsolute, ColumnAbsolute, ReferenceStyle, aExternalCopy, RelativeTo );
}
@@ -5601,7 +5601,7 @@ ScVbaRange::hasError()
uno::Sequence< uno::Any > Params(1);
uno::Reference< excel::XRange > aRange( this );
- Params[0] = uno::makeAny( aRange );
+ Params[0] <<= aRange;
uno::Sequence< sal_Int16 > OutParamIndex;
uno::Sequence< uno::Any > OutParam;
xInvoc->invoke( "IsError", Params, OutParamIndex, OutParam ) >>= dResult;
diff --git a/sc/source/ui/vba/vbaworkbook.cxx b/sc/source/ui/vba/vbaworkbook.cxx
index 3c2bdda52ccd..fdecac1f9071 100644
--- a/sc/source/ui/vba/vbaworkbook.cxx
+++ b/sc/source/ui/vba/vbaworkbook.cxx
@@ -87,10 +87,10 @@ ScVbaWorkbook::Colors( const ::uno::Any& Index )
{
sal_Int32 nIndex = 0;
Index >>= nIndex;
- aRet = uno::makeAny( XLRGBToOORGB( ColorData[ --nIndex ] ) );
+ aRet <<= XLRGBToOORGB( ColorData[ --nIndex ] );
}
else
- aRet = uno::makeAny( ColorData );
+ aRet <<= ColorData;
return aRet;
}
@@ -104,29 +104,29 @@ bool ScVbaWorkbook::setFilterPropsFromFormat( sal_Int32 nFormat, uno::Sequence<
switch( nFormat )
{
case excel::XlFileFormat::xlCSV:
- rProps[ index ].Value = uno::Any( OUString("Text - txt - csv (StarCalc)") );
+ rProps[ index ].Value <<= OUString("Text - txt - csv (StarCalc)");
break;
case excel::XlFileFormat::xlDBF4:
- rProps[ index ].Value = uno::Any( OUString("DBF") );
+ rProps[ index ].Value <<= OUString("DBF");
break;
case excel::XlFileFormat::xlDIF:
- rProps[ index ].Value = uno::Any( OUString("DIF") );
+ rProps[ index ].Value <<= OUString("DIF");
break;
case excel::XlFileFormat::xlWK3:
- rProps[ index ].Value = uno::Any( OUString("Lotus") );
+ rProps[ index ].Value <<= OUString("Lotus");
break;
case excel::XlFileFormat::xlExcel4Workbook:
- rProps[ index ].Value = uno::Any( OUString("MS Excel 4.0") );
+ rProps[ index ].Value <<= OUString("MS Excel 4.0");
break;
case excel::XlFileFormat::xlExcel5:
- rProps[ index ].Value = uno::Any( OUString("MS Excel 5.0/95") );
+ rProps[ index ].Value <<= OUString("MS Excel 5.0/95");
break;
case excel::XlFileFormat::xlHtml:
- rProps[ index ].Value = uno::Any( OUString("HTML (StarCalc)") );
+ rProps[ index ].Value <<= OUString("HTML (StarCalc)");
break;
case excel::XlFileFormat::xlExcel9795:
default:
- rProps[ index ].Value = uno::Any( OUString("MS Excel 97") );
+ rProps[ index ].Value <<= OUString("MS Excel 97");
break;
}
bRes = true;