From 58a32075ca4f457f570af75aef368dd6c389aca7 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 3 May 2016 08:39:03 +0200 Subject: use Any constructor instead of temporaries Change-Id: Iffb82a2cee1a28d89eeea2b905aaa14086ee475a --- fpicker/source/win32/misc/WinImplHelper.cxx | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'fpicker') diff --git a/fpicker/source/win32/misc/WinImplHelper.cxx b/fpicker/source/win32/misc/WinImplHelper.cxx index 84c51419d919..d4156bca3888 100644 --- a/fpicker/source/win32/misc/WinImplHelper.cxx +++ b/fpicker/source/win32/misc/WinImplHelper.cxx @@ -264,10 +264,7 @@ Any SAL_CALL ListboxGetItems( HWND hwnd ) } } - Any aAny; - aAny <<= aItemList; - - return aAny; + return Any(aItemList); } @@ -277,10 +274,7 @@ Any SAL_CALL ListboxGetSelectedItem( HWND hwnd ) LRESULT idxItem = SendMessageW( hwnd, CB_GETCURSEL, 0, 0 ); - Any aAny; - aAny <<= ListboxGetString( hwnd, idxItem ); - - return aAny; + return Any( ListboxGetString( hwnd, idxItem ) ); } @@ -290,10 +284,7 @@ Any SAL_CALL ListboxGetSelectedItemIndex( HWND hwnd ) LRESULT idxItem = SendMessageW( hwnd, CB_GETCURSEL, 0, 0 ); - Any aAny; - aAny <<= static_cast< sal_Int32 >( idxItem ); - - return aAny; + return Any( static_cast< sal_Int32 >( idxItem ) ); } @@ -302,10 +293,8 @@ Any SAL_CALL CheckboxGetState( HWND hwnd ) OSL_ASSERT( IsWindow( hwnd ) ); LRESULT lChkState = SendMessageW( hwnd, BM_GETCHECK, 0, 0 ); - sal_Bool bChkState = (lChkState == BST_CHECKED) ? sal_True : sal_False; - Any aAny; - aAny.setValue( &bChkState, cppu::UnoType::get()); - return aAny; + bool bChkState = (lChkState == BST_CHECKED); + return Any(bChkState); } -- cgit