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 /embedserv | |
parent | 7d47700972d267fe7c5270c5dadd45a523a2baec (diff) |
use Any constructor instead of temporaries
Change-Id: Iffb82a2cee1a28d89eeea2b905aaa14086ee475a
Diffstat (limited to 'embedserv')
-rw-r--r-- | embedserv/source/embed/docholder.cxx | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/embedserv/source/embed/docholder.cxx b/embedserv/source/embed/docholder.cxx index 97f3ffabfc26..556853566a01 100644 --- a/embedserv/source/embed/docholder.cxx +++ b/embedserv/source/embed/docholder.cxx @@ -114,56 +114,48 @@ void DocumentHolder::LoadDocInFrame( sal_Bool bPluginMode ) uno::Reference< task::XInteractionHandler2 > xHandler( task::InteractionHandler::createWithParent(comphelper::getComponentContext(m_xFactory), 0) ); - uno::Any aAny; sal_Int32 nLen = 3; uno::Sequence<beans::PropertyValue> aSeq( nLen ); - aAny <<= uno::Reference<uno::XInterface>( - m_xDocument, uno::UNO_QUERY); aSeq[0] = beans::PropertyValue( OUString("Model"), -1, - aAny, + uno::Any(uno::Reference<uno::XInterface>(m_xDocument, uno::UNO_QUERY)), beans::PropertyState_DIRECT_VALUE); - aAny <<= sal_False; aSeq[1] = beans::PropertyValue( OUString("ReadOnly"), -1, - aAny, + uno::Any(false), beans::PropertyState_DIRECT_VALUE); - aAny <<= (sal_Bool) sal_True; aSeq[2] = beans::PropertyValue( OUString("NoAutoSave"), -1, - aAny, + uno::Any(true), beans::PropertyState_DIRECT_VALUE); if ( bPluginMode ) { aSeq.realloc( ++nLen ); - aAny <<= (sal_Int16) 3; aSeq[nLen-1] = beans::PropertyValue( OUString("PluginMode"), -1, - aAny, + uno::Any((sal_Int16) 3), beans::PropertyState_DIRECT_VALUE); } aSeq.realloc( nLen+=2 ); - aAny <<= xHandler; aSeq[nLen-2] = beans::PropertyValue( OUString("InteractionHandler"), -1, - aAny, + uno::Any(xHandler), beans::PropertyState_DIRECT_VALUE); - aAny <<= m_nMacroExecMode; aSeq[nLen-1] = beans::PropertyValue( OUString("MacroExecutionMode"), -1, - aAny, + uno::Any(m_nMacroExecMode), beans::PropertyState_DIRECT_VALUE); xComponentLoader->loadComponentFromURL( @@ -291,10 +283,9 @@ HRESULT DocumentHolder::InPlaceActivate( hWndxWinParent = hWndSite; } - aAny <<= sal_Int32(hWndxWinParent); xWin.set( xToolkit->createSystemChild( - aAny, + uno::Any(sal_Int32(hWndxWinParent)), aProcessIdent, lang::SystemDependent::SYSTEM_WIN32), uno::UNO_QUERY); @@ -1230,11 +1221,9 @@ css::uno::Reference< css::awt::XWindow> SAL_CALL DocumentHolder::getContainerWin uno::Sequence<sal_Int8> aProcessIdent(16); rtl_getGlobalProcessId((sal_uInt8*)aProcessIdent.getArray()); - uno::Any aAny; - aAny <<= sal_Int32(hWnd); xWin.set( xToolkit->createSystemChild( - aAny, + uno::Any(sal_Int32(hWnd)), aProcessIdent, lang::SystemDependent::SYSTEM_WIN32), uno::UNO_QUERY); @@ -1252,7 +1241,7 @@ css::uno::Reference< css::awt::XWindow> SAL_CALL DocumentHolder::getContainerWin uno::Reference<awt::XSystemDependentWindowPeer> xSysWin( xWin,uno::UNO_QUERY); if(xSysWin.is()) { - aAny = xSysWin->getWindowHandle( + uno::Any aAny = xSysWin->getWindowHandle( aProcessIdent,lang::SystemDependent::SYSTEM_WIN32); sal_Int64 tmp; if( aAny >>= tmp ) |