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 /sw/source/filter | |
parent | 7d47700972d267fe7c5270c5dadd45a523a2baec (diff) |
use Any constructor instead of temporaries
Change-Id: Iffb82a2cee1a28d89eeea2b905aaa14086ee475a
Diffstat (limited to 'sw/source/filter')
-rw-r--r-- | sw/source/filter/html/htmlform.cxx | 16 | ||||
-rw-r--r-- | sw/source/filter/xml/wrtxml.cxx | 10 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlimp.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlimpit.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/xml/xmltexte.cxx | 21 |
5 files changed, 15 insertions, 40 deletions
diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx index f66a46901f09..13fb7a76cd94 100644 --- a/sw/source/filter/html/htmlform.cxx +++ b/sw/source/filter/html/htmlform.cxx @@ -2404,16 +2404,11 @@ void SwHTMLParser::EndSelect() pValues[i] = sText; } - Any aAny( &aList, cppu::UnoType<uno::Sequence<OUString>>::get() ); + rPropSet->setPropertyValue("StringItemList", Any(aList) ); - rPropSet->setPropertyValue("StringItemList", aAny ); + rPropSet->setPropertyValue("ListSourceType", Any(ListSourceType_VALUELIST) ); - aAny <<= ListSourceType_VALUELIST; - rPropSet->setPropertyValue("ListSourceType", aAny ); - - aAny.setValue( &aValueList, cppu::UnoType<uno::Sequence<OUString>>::get() ); - - rPropSet->setPropertyValue("ListSource", aAny ); + rPropSet->setPropertyValue("ListSource", Any(aValueList) ); size_t nSelCnt = m_pFormImpl->GetSelectedList().size(); if( !nSelCnt && 1 == m_nSelectEntryCnt && nEntryCnt ) @@ -2429,10 +2424,7 @@ void SwHTMLParser::EndSelect() { pSels[i] = (sal_Int16)m_pFormImpl->GetSelectedList()[i]; } - aAny.setValue( &aSelList, - cppu::UnoType<uno::Sequence<sal_Int16>>::get() ); - - rPropSet->setPropertyValue("DefaultSelection", aAny ); + rPropSet->setPropertyValue("DefaultSelection", Any(aSelList) ); m_pFormImpl->EraseStringList(); m_pFormImpl->EraseValueList(); diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx index 6967c98860a6..2fbdd81aabdc 100644 --- a/sw/source/filter/xml/wrtxml.cxx +++ b/sw/source/filter/xml/wrtxml.cxx @@ -170,11 +170,9 @@ sal_uInt32 SwXMLWriter::Write_( const uno::Reference < task::XStatusIndicator >& xStatusIndicator->start(SW_RESSTR( STR_STATSTR_SWGWRITE), nProgressRange); } - aAny <<= nProgressRange; - xInfoSet->setPropertyValue("ProgressRange", aAny); + xInfoSet->setPropertyValue("ProgressRange", Any(nProgressRange)); - aAny <<= static_cast < sal_Int32 >( -1 ); - xInfoSet->setPropertyValue("ProgressMax", aAny); + xInfoSet->setPropertyValue("ProgressMax", Any(static_cast < sal_Int32 >( -1 ))); } SvtSaveOptions aSaveOpt; @@ -486,9 +484,7 @@ bool SwXMLWriter::WriteThroughComponent( if( !xSet.is() ) return false; - uno::Any aAny; - aAny <<= OUString("text/xml"); - xSet->setPropertyValue("MediaType", aAny ); + xSet->setPropertyValue("MediaType", Any(OUString("text/xml")) ); // even plain stream should be encrypted in encrypted documents xSet->setPropertyValue( "UseCommonStoragePasswordEncryption", makeAny(true) ); diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index 12c1e246b4d5..e749b3a3d2c2 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -1283,10 +1283,8 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC if( ! bPrinterIndependentLayout ) { - Any aAny; sal_Int16 nTmp = document::PrinterIndependentLayout::DISABLED; - aAny <<= nTmp; - xProps->setPropertyValue( "PrinterIndependentLayout", aAny ); + xProps->setPropertyValue( "PrinterIndependentLayout", Any(nTmp) ); } if( ! bAddExternalLeading ) diff --git a/sw/source/filter/xml/xmlimpit.cxx b/sw/source/filter/xml/xmlimpit.cxx index ea475c3e1d87..ed7fb7c295a5 100644 --- a/sw/source/filter/xml/xmlimpit.cxx +++ b/sw/source/filter/xml/xmlimpit.cxx @@ -663,9 +663,7 @@ bool SvXMLImportItemMapper::PutXMLValue( case MID_GRAPHIC_LINK: { SvxGraphicPosition eOldGraphicPos = rBrush.GetGraphicPos(); - uno::Any aAny; - aAny <<= rValue; - rBrush.PutValue( aAny, MID_GRAPHIC_URL ); + rBrush.PutValue( Any(rValue), MID_GRAPHIC_URL ); if( GPOS_NONE == eOldGraphicPos && GPOS_NONE != rBrush.GetGraphicPos() ) rBrush.SetGraphicPos( GPOS_TILED ); diff --git a/sw/source/filter/xml/xmltexte.cxx b/sw/source/filter/xml/xmltexte.cxx index 2ce19b9a639f..5dcfedb3a21c 100644 --- a/sw/source/filter/xml/xmltexte.cxx +++ b/sw/source/filter/xml/xmltexte.cxx @@ -224,21 +224,16 @@ static void lcl_addOutplaceProperties( if( aSize.Width() && aSize.Height() ) { - Any aAny; - aAny <<= 0L; - *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_OLE_VIS_AREA_LEFT ), aAny ); + *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_OLE_VIS_AREA_LEFT ), Any(0L) ); pStates++; - aAny <<= 0L; - *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_OLE_VIS_AREA_TOP ), aAny ); + *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_OLE_VIS_AREA_TOP ), Any(0L) ); pStates++; - aAny <<= (sal_Int32)aSize.Width(); - *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_OLE_VIS_AREA_WIDTH ), aAny ); + *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_OLE_VIS_AREA_WIDTH ), Any((sal_Int32)aSize.Width()) ); pStates++; - aAny <<= (sal_Int32)aSize.Height(); - *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_OLE_VIS_AREA_HEIGHT ), aAny ); + *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_OLE_VIS_AREA_HEIGHT ), Any((sal_Int32)aSize.Height()) ); } } } @@ -299,16 +294,12 @@ static void lcl_addFrameProperties( } if( SIZE_NOT_SET != nWidth ) { - Any aAny2; - aAny <<= nWidth; - *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_FRAME_MARGIN_HORI ), aAny2 ); + *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_FRAME_MARGIN_HORI ), Any(nWidth) ); pStates++; } if( SIZE_NOT_SET != nHeight ) { - Any aAny2; - aAny <<= nHeight; - *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_FRAME_MARGIN_VERT ), aAny2 ); + *pStates = new XMLPropertyState( rMapper->FindEntryIndex( CTF_FRAME_MARGIN_VERT ), Any(nHeight) ); } } |