diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-03 08:39:03 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-05-04 12:39:40 +0200 |
commit | 58a32075ca4f457f570af75aef368dd6c389aca7 (patch) | |
tree | e437dcbdeb248b4316cb8a9281d1543419853f6d /xmloff/source/core | |
parent | 7d47700972d267fe7c5270c5dadd45a523a2baec (diff) |
use Any constructor instead of temporaries
Change-Id: Iffb82a2cee1a28d89eeea2b905aaa14086ee475a
Diffstat (limited to 'xmloff/source/core')
-rw-r--r-- | xmloff/source/core/unoatrcn.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/core/xmlerror.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/core/xmlexp.cxx | 15 | ||||
-rw-r--r-- | xmloff/source/core/xmlimp.cxx | 19 |
4 files changed, 11 insertions, 31 deletions
diff --git a/xmloff/source/core/unoatrcn.cxx b/xmloff/source/core/unoatrcn.cxx index eb1fc7caa917..ed811df66157 100644 --- a/xmloff/source/core/unoatrcn.cxx +++ b/xmloff/source/core/unoatrcn.cxx @@ -126,9 +126,7 @@ uno::Any SAL_CALL SvUnoAttributeContainer::getByName(const OUString& aName) aData.Type = "CDATA"; aData.Value = mpContainer->GetAttrValue(nAttr); - uno::Any aAny; - aAny <<= aData; - return aAny; + return uno::Any(aData); } uno::Sequence< OUString > SAL_CALL SvUnoAttributeContainer::getElementNames() throw( uno::RuntimeException, std::exception ) diff --git a/xmloff/source/core/xmlerror.cxx b/xmloff/source/core/xmlerror.cxx index eebd4ba91746..fbdcc941e399 100644 --- a/xmloff/source/core/xmlerror.cxx +++ b/xmloff/source/core/xmlerror.cxx @@ -210,10 +210,8 @@ void XMLErrors::ThrowErrorAsSAXException(sal_Int32 nIdMask) { // we throw the error ErrorRecord& rErr = aErrors[0]; - Any aAny; - aAny <<= rErr.aParams; throw SAXParseException( - rErr.sExceptionMessage, nullptr, aAny, + rErr.sExceptionMessage, nullptr, Any(rErr.aParams), rErr.sPublicId, rErr.sSystemId, rErr.nRow, rErr.nColumn ); } } diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 807e55a4de33..8ed21181dff9 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -555,11 +555,8 @@ SvXMLExport::~SvXMLExport() { sal_Int32 nProgressMax(mpProgressBarHelper->GetReference()); sal_Int32 nProgressCurrent(mpProgressBarHelper->GetValue()); - uno::Any aAny; - aAny <<= nProgressMax; - mxExportInfo->setPropertyValue(sProgressMax, aAny); - aAny <<= nProgressCurrent; - mxExportInfo->setPropertyValue(sProgressCurrent, aAny); + mxExportInfo->setPropertyValue(sProgressMax, uno::Any(nProgressMax)); + mxExportInfo->setPropertyValue(sProgressCurrent, uno::Any(nProgressCurrent)); } if (xPropertySetInfo->hasPropertyByName(sRepeat)) mxExportInfo->setPropertyValue(sRepeat, css::uno::makeAny(mpProgressBarHelper->GetRepeat())); @@ -571,9 +568,7 @@ SvXMLExport::~SvXMLExport() { uno::Sequence<sal_Int32> aWasUsed; mpNumExport->GetWasUsed(aWasUsed); - uno::Any aAny; - aAny <<= aWasUsed; - mxExportInfo->setPropertyValue(sWrittenNumberFormats, aAny); + mxExportInfo->setPropertyValue(sWrittenNumberFormats, Any(aWasUsed)); } } } @@ -1313,9 +1308,7 @@ sal_uInt32 SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass ) ::comphelper::GenericPropertySet_CreateInstance( new ::comphelper::PropertySetInfo( aInfoMap ) ) ); - Any aAny; - aAny <<= GetXMLToken( eClass ); - xConvPropSet->setPropertyValue( "Class", aAny ); + xConvPropSet->setPropertyValue( "Class", Any(GetXMLToken( eClass )) ); Reference< XPropertySet > xPropSet = mxExportInfo.is() diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index f3e897eae52b..3b702cd7afd9 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -574,11 +574,8 @@ void SAL_CALL SvXMLImport::endDocument() { sal_Int32 nProgressMax(mpProgressBarHelper->GetReference()); sal_Int32 nProgressCurrent(mpProgressBarHelper->GetValue()); - uno::Any aAny; - aAny <<= nProgressMax; - mxImportInfo->setPropertyValue(sProgressMax, aAny); - aAny <<= nProgressCurrent; - mxImportInfo->setPropertyValue(sProgressCurrent, aAny); + mxImportInfo->setPropertyValue(sProgressMax, uno::Any(nProgressMax)); + mxImportInfo->setPropertyValue(sProgressCurrent, uno::Any(nProgressCurrent)); } if (xPropertySetInfo->hasPropertyByName(sRepeat)) mxImportInfo->setPropertyValue(sRepeat, css::uno::makeAny(mpProgressBarHelper->GetRepeat())); @@ -587,9 +584,7 @@ void SAL_CALL SvXMLImport::endDocument() OUString sNumberStyles(XML_NUMBERSTYLES); if (mxNumberStyles.is() && xPropertySetInfo->hasPropertyByName(sNumberStyles)) { - uno::Any aAny; - aAny <<= mxNumberStyles; - mxImportInfo->setPropertyValue(sNumberStyles, aAny); + mxImportInfo->setPropertyValue(sNumberStyles, Any(mxNumberStyles)); } } } @@ -1424,9 +1419,7 @@ void SvXMLImport::AddStyleDisplayName( sal_uInt16 nFamily, { Reference < XInterface > xIfc( static_cast< XUnoTunnel *>( mpStyleMap ) ); - Any aAny; - aAny <<= xIfc; - mxImportInfo->setPropertyValue( sPrivateData, aAny ); + mxImportInfo->setPropertyValue( sPrivateData, Any(xIfc) ); } } } @@ -1522,11 +1515,9 @@ void SvXMLImport::AddNumberStyle(sal_Int32 nKey, const OUString& rName) mxNumberStyles.set( comphelper::NameContainer_createInstance( ::cppu::UnoType<sal_Int32>::get()) ); if (mxNumberStyles.is()) { - uno::Any aAny; - aAny <<= nKey; try { - mxNumberStyles->insertByName(rName, aAny); + mxNumberStyles->insertByName(rName, Any(nKey)); } catch ( uno::Exception& ) { |