summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-05-03 08:39:03 +0200
committerNoel Grandin <noel@peralex.com>2016-05-04 12:39:40 +0200
commit58a32075ca4f457f570af75aef368dd6c389aca7 (patch)
treee437dcbdeb248b4316cb8a9281d1543419853f6d /svx/source
parent7d47700972d267fe7c5270c5dadd45a523a2baec (diff)
use Any constructor instead of temporaries
Change-Id: Iffb82a2cee1a28d89eeea2b905aaa14086ee475a
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/accessibility/AccessibleSvxFindReplaceDialog.cxx4
-rw-r--r--svx/source/form/datanavi.cxx4
-rw-r--r--svx/source/form/fmshimp.cxx8
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx4
-rw-r--r--svx/source/unodraw/XPropertyTable.cxx26
-rw-r--r--svx/source/unodraw/gluepts.cxx8
-rw-r--r--svx/source/unodraw/unoshap3.cxx4
-rw-r--r--svx/source/xml/xmlgrhlp.cxx7
8 files changed, 16 insertions, 49 deletions
diff --git a/svx/source/accessibility/AccessibleSvxFindReplaceDialog.cxx b/svx/source/accessibility/AccessibleSvxFindReplaceDialog.cxx
index 72bc10adc988..aafb7df1bb73 100644
--- a/svx/source/accessibility/AccessibleSvxFindReplaceDialog.cxx
+++ b/svx/source/accessibility/AccessibleSvxFindReplaceDialog.cxx
@@ -58,11 +58,9 @@ void VCLXAccessibleSvxFindReplaceDialog::FillAccessibleRelationSet( utl::Accessi
{
return;
}
- Any aAny;
- aAny <<= ( pSrchDlg->GetSrchFlag() );
const sal_Int32 FORFINDREPLACEFLOWTO = 2;
- uno::Sequence<uno::Any> aAnySeq = xGetAccFlowTo->getAccFlowTo( aAny, FORFINDREPLACEFLOWTO );
+ uno::Sequence<uno::Any> aAnySeq = xGetAccFlowTo->getAccFlowTo( Any(pSrchDlg->GetSrchFlag()), FORFINDREPLACEFLOWTO );
sal_Int32 nLen = aAnySeq.getLength();
if ( nLen )
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index eab715d0fbd1..5f5c94335c63 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -1427,9 +1427,7 @@ namespace svxform
{
SvtViewOptions aViewOpt( E_TABDIALOG, CFGNAME_DATANAVIGATOR );
aViewOpt.SetPageID( static_cast< sal_Int32 >( m_pTabCtrl->GetCurPageId() ) );
- Any aAny;
- aAny <<= m_bShowDetails;
- aViewOpt.SetUserItem(CFGNAME_SHOWDETAILS,aAny);
+ aViewOpt.SetUserItem(CFGNAME_SHOWDETAILS, Any(m_bShowDetails));
m_pInstPage.disposeAndClear();
m_pSubmissionPage.disposeAndClear();
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index 8cf9565d4be4..192d71721783 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -1638,9 +1638,7 @@ void FmXFormShell::SetY2KState(sal_uInt16 n)
{
try
{
- Any aVal;
- aVal <<= n;
- xSet->setPropertyValue("TwoDigitDateStart", aVal);
+ xSet->setPropertyValue("TwoDigitDateStart", makeAny<sal_uInt16>(n));
}
catch(Exception&)
{
@@ -1679,9 +1677,7 @@ void FmXFormShell::SetY2KState(sal_uInt16 n)
{
try
{
- Any aVal;
- aVal <<= n;
- xSet->setPropertyValue("TwoDigitDateStart", aVal);
+ xSet->setPropertyValue("TwoDigitDateStart", makeAny<sal_uInt16>(n));
}
catch(Exception&)
{
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
index 6caf85a5c0e9..2f5ce4752af2 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
@@ -799,9 +799,7 @@ short ChineseDictionaryDialog::Execute()
{
//save settings to configuration
SvtLinguConfig aLngCfg;
- Any aAny;
- aAny <<= m_pCB_Reverse->IsChecked();
- aLngCfg.SetProperty( OUString( UPN_IS_REVERSE_MAPPING ), aAny );
+ aLngCfg.SetProperty( OUString( UPN_IS_REVERSE_MAPPING ), uno::Any(m_pCB_Reverse->IsChecked()) );
m_pCT_DictionaryToSimplified->save();
m_pCT_DictionaryToTraditional->save();
diff --git a/svx/source/unodraw/XPropertyTable.cxx b/svx/source/unodraw/XPropertyTable.cxx
index 1d2b7df82c7d..dc036a1546c5 100644
--- a/svx/source/unodraw/XPropertyTable.cxx
+++ b/svx/source/unodraw/XPropertyTable.cxx
@@ -267,9 +267,7 @@ uno::Reference< uno::XInterface > SAL_CALL SvxUnoXColorTable_createInstance( XPr
// SvxUnoXPropertyTable
uno::Any SvxUnoXColorTable::getAny( const XPropertyEntry* pEntry ) const throw()
{
- uno::Any aAny;
- aAny <<= (sal_Int32)static_cast<const XColorEntry*>(pEntry)->GetColor().GetColor();
- return aAny;
+ return uno::Any( (sal_Int32)static_cast<const XColorEntry*>(pEntry)->GetColor().GetColor() );
}
XPropertyEntry* SvxUnoXColorTable::getEntry( const OUString& rName, const uno::Any& rAny ) const throw()
@@ -328,18 +326,14 @@ uno::Reference< uno::XInterface > SAL_CALL SvxUnoXLineEndTable_createInstance( X
// SvxUnoXPropertyTable
uno::Any SvxUnoXLineEndTable::getAny( const XPropertyEntry* pEntry ) const throw()
{
-
- uno::Any aAny;
drawing::PolyPolygonBezierCoords aBezier;
basegfx::unotools::b2DPolyPolygonToPolyPolygonBezier( static_cast<const XLineEndEntry*>(pEntry)->GetLineEnd(),
aBezier );
- aAny <<= aBezier;
- return aAny;
+ return uno::Any(aBezier);
}
XPropertyEntry* SvxUnoXLineEndTable::getEntry( const OUString& rName, const uno::Any& rAny ) const throw(lang::IllegalArgumentException)
{
-
if( !rAny.getValue() || rAny.getValueType() != cppu::UnoType<drawing::PolyPolygonBezierCoords>::get())
return nullptr;
@@ -411,9 +405,7 @@ uno::Any SvxUnoXDashTable::getAny( const XPropertyEntry* pEntry ) const throw()
aLineDash.DashLen = rXD.GetDashLen();
aLineDash.Distance = rXD.GetDistance();
- uno::Any aAny;
- aAny <<= aLineDash;
- return aAny;
+ return uno::Any(aLineDash);
}
XPropertyEntry* SvxUnoXDashTable::getEntry( const OUString& rName, const uno::Any& rAny ) const throw()
@@ -489,9 +481,7 @@ uno::Any SvxUnoXHatchTable::getAny( const XPropertyEntry* pEntry ) const throw()
aUnoHatch.Distance = aHatch.GetDistance();
aUnoHatch.Angle = aHatch.GetAngle();
- uno::Any aAny;
- aAny <<= aUnoHatch;
- return aAny;
+ return uno::Any(aUnoHatch);
}
XPropertyEntry* SvxUnoXHatchTable::getEntry( const OUString& rName, const uno::Any& rAny ) const throw()
@@ -569,9 +559,7 @@ uno::Any SvxUnoXGradientTable::getAny( const XPropertyEntry* pEntry ) const thro
aGradient.EndIntensity = aXGradient.GetEndIntens();
aGradient.StepCount = aXGradient.GetSteps();
- uno::Any aAny;
- aAny <<= aGradient;
- return aAny;
+ return uno::Any(aGradient);
}
XPropertyEntry* SvxUnoXGradientTable::getEntry( const OUString& rName, const uno::Any& rAny ) const throw()
@@ -646,9 +634,7 @@ uno::Any SvxUnoXBitmapTable::getAny( const XPropertyEntry* pEntry ) const throw(
const GraphicObject& rGraphicObject(static_cast<const XBitmapEntry*>(pEntry)->GetGraphicObject());
aURL += OStringToOUString(rGraphicObject.GetUniqueID(), RTL_TEXTENCODING_ASCII_US);
- uno::Any aAny;
- aAny <<= aURL;
- return aAny;
+ return uno::Any(aURL);
}
XPropertyEntry* SvxUnoXBitmapTable::getEntry( const OUString& rName, const uno::Any& rAny ) const throw(uno::RuntimeException)
diff --git a/svx/source/unodraw/gluepts.cxx b/svx/source/unodraw/gluepts.cxx
index 9a812cd9ca23..bb0e3a54b726 100644
--- a/svx/source/unodraw/gluepts.cxx
+++ b/svx/source/unodraw/gluepts.cxx
@@ -481,9 +481,7 @@ uno::Any SAL_CALL SvxUnoGluePointAccess::getByIndex( sal_Int32 Index )
SdrGluePoint aTempPoint = mpObject->GetVertexGluePoint( (sal_uInt16)Index );
aGluePoint.IsUserDefined = false;
convert( aTempPoint, aGluePoint );
- uno::Any aAny;
- aAny <<= aGluePoint;
- return aAny;
+ return uno::Any(aGluePoint);
}
else
{
@@ -494,9 +492,7 @@ uno::Any SAL_CALL SvxUnoGluePointAccess::getByIndex( sal_Int32 Index )
const SdrGluePoint& rTempPoint = (*pList)[(sal_uInt16)Index];
aGluePoint.IsUserDefined = true;
convert( rTempPoint, aGluePoint );
- uno::Any aAny;
- aAny <<= aGluePoint;
- return aAny;
+ return uno::Any(aGluePoint);
}
}
}
diff --git a/svx/source/unodraw/unoshap3.cxx b/svx/source/unodraw/unoshap3.cxx
index 6bd9c7f235d5..a969b65cb24b 100644
--- a/svx/source/unodraw/unoshap3.cxx
+++ b/svx/source/unodraw/unoshap3.cxx
@@ -218,9 +218,7 @@ uno::Any SAL_CALL Svx3DSceneObject::getByIndex( sal_Int32 Index )
throw lang::IndexOutOfBoundsException();
Reference< drawing::XShape > xShape( pDestObj->getUnoShape(), uno::UNO_QUERY );
- uno::Any aAny;
- aAny <<= xShape;
- return aAny;
+ return uno::Any(xShape);
}
diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx
index 0deeae571dc2..8a8720620360 100644
--- a/svx/source/xml/xmlgrhlp.cxx
+++ b/svx/source/xml/xmlgrhlp.cxx
@@ -524,14 +524,12 @@ bool SvXMLGraphicHelper::ImplWriteGraphic( const OUString& rPictureStorageName,
Graphic aGraphic( (Graphic&) aGrfObject.GetGraphic() );
const GfxLink aGfxLink( aGraphic.GetLink() );
const OUString aMimeType( ImplGetGraphicMimeType( rPictureStreamName ) );
- uno::Any aAny;
uno::Reference < beans::XPropertySet > xProps( aStream.xStream, uno::UNO_QUERY );
// set stream properties (MediaType/Compression)
if( !aMimeType.isEmpty() )
{
- aAny <<= aMimeType;
- xProps->setPropertyValue( "MediaType", aAny );
+ xProps->setPropertyValue( "MediaType", Any(aMimeType) );
}
// picture formats that actuall _do_ benefit from zip
@@ -561,8 +559,7 @@ bool SvXMLGraphicHelper::ImplWriteGraphic( const OUString& rPictureStorageName,
}
}
- aAny <<= bCompressed;
- xProps->setPropertyValue( "Compressed", aAny );
+ xProps->setPropertyValue( "Compressed", Any(bCompressed) );
std::unique_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream( aStream.xStream ));
if( bUseGfxLink && aGfxLink.GetDataSize() && aGfxLink.GetData() )