summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-05-03 08:39:03 +0200
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2016-07-20 01:26:04 -0400
commita0e8e05008e143ee5e3bbc281d1c253c7e5ed136 (patch)
treeeaf5f70a067fd48704addd9f2b582624a2fb44ae /svx
parent9c7cae1561cfe16226b1f16dce59f08a38da3ce0 (diff)
use Any constructor instead of temporaries
(cherry picked from commit 58a32075ca4f457f570af75aef368dd6c389aca7) Change-Id: Iffb82a2cee1a28d89eeea2b905aaa14086ee475a
Diffstat (limited to 'svx')
-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 53b5f50de11c..3c17643a3121 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 164234a7adb4..8ecadc94fe12 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -1644,9 +1644,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&)
{
@@ -1685,9 +1683,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 d7b5c1141040..260be8c02b49 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
@@ -806,9 +806,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 6ff4621b2635..c86da59d3776 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 30e08df4d008..47a96a7ec205 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 = sal_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 = sal_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 9f5128f7789c..b0cde191e6ec 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 9c70a6556b21..d2f6a20cb0fa 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() )