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 /toolkit/source/controls/roadmapcontrol.cxx | |
parent | 7d47700972d267fe7c5270c5dadd45a523a2baec (diff) |
use Any constructor instead of temporaries
Change-Id: Iffb82a2cee1a28d89eeea2b905aaa14086ee475a
Diffstat (limited to 'toolkit/source/controls/roadmapcontrol.cxx')
-rw-r--r-- | toolkit/source/controls/roadmapcontrol.cxx | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/toolkit/source/controls/roadmapcontrol.cxx b/toolkit/source/controls/roadmapcontrol.cxx index 6febbff43d34..1c742f07efb2 100644 --- a/toolkit/source/controls/roadmapcontrol.cxx +++ b/toolkit/source/controls/roadmapcontrol.cxx @@ -207,7 +207,6 @@ static void lcl_throwIndexOutOfBoundsException( ) void UnoControlRoadmapModel::SetRMItemDefaultProperties( const sal_Int32 , const Reference< XInterface >& xRoadmapItem) { - Any aAny; Reference< XPropertySet > xPropertySet( xRoadmapItem, UNO_QUERY ); Reference< XPropertySet > xProps( xRoadmapItem, UNO_QUERY ); if ( xProps.is() ) @@ -217,8 +216,7 @@ static void lcl_throwIndexOutOfBoundsException( ) aValue >>= LocID; if (LocID < 0) // index may not be smaller than zero { - aAny <<= GetUniqueID(); - xPropertySet->setPropertyValue("ID", aAny ); + xPropertySet->setPropertyValue("ID", Any(GetUniqueID()) ); } } } @@ -290,8 +288,7 @@ static void lcl_throwIndexOutOfBoundsException( ) sal_Int16 n_CurrentItemID = GetCurrentItemID( xPropertySet ); if ( Index <= n_CurrentItemID ) { - Any aAny; - aAny <<= ( sal_Int16 ) ( n_CurrentItemID + 1 ); + Any aAny(( sal_Int16 ) ( n_CurrentItemID + 1 ) ); xPropertySet->setPropertyValue( GetPropertyName( BASEPROPERTY_CURRENTITEMID ), aAny ); } } @@ -455,11 +452,9 @@ void UnoRoadmapControl::elementReplaced( const ContainerEvent& rEvent )throw(Run void SAL_CALL UnoRoadmapControl::itemStateChanged( const ItemEvent& rEvent ) throw (RuntimeException, std::exception) { sal_Int16 CurItemIndex = sal::static_int_cast< sal_Int16 >(rEvent.ItemId); - Any aAny; - aAny <<= CurItemIndex; Reference< XControlModel > xModel( getModel( ), UNO_QUERY ); Reference< XPropertySet > xPropertySet( xModel, UNO_QUERY ); - xPropertySet->setPropertyValue( GetPropertyName( BASEPROPERTY_CURRENTITEMID ), aAny ); + xPropertySet->setPropertyValue( GetPropertyName( BASEPROPERTY_CURRENTITEMID ), Any(CurItemIndex) ); if ( maItemListeners.getLength() ) maItemListeners.itemStateChanged( rEvent ); } |