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 /sfx2 | |
parent | 7d47700972d267fe7c5270c5dadd45a523a2baec (diff) |
use Any constructor instead of temporaries
Change-Id: Iffb82a2cee1a28d89eeea2b905aaa14086ee475a
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/fileobj.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/appl/newhelp.cxx | 8 | ||||
-rw-r--r-- | sfx2/source/appl/opengrf.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/doc/docfile.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 8 | ||||
-rw-r--r-- | sfx2/source/doc/sfxbasemodel.cxx | 7 | ||||
-rw-r--r-- | sfx2/source/view/viewfrm2.cxx | 3 |
7 files changed, 11 insertions, 26 deletions
diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx index 4b2a4960a63b..4e9b9011682c 100644 --- a/sfx2/source/appl/fileobj.cxx +++ b/sfx2/source/appl/fileobj.cxx @@ -575,10 +575,8 @@ void SvFileObject::SendStateChg_Impl( sfx2::LinkManager::LinkState nState ) { if( !bStateChangeCalled && HasDataLinks() ) { - css::uno::Any aAny; - aAny <<= OUString::number( nState ); DataChanged( SotExchange::GetFormatName( - sfx2::LinkManager::RegisterStatusInfoId()), aAny ); + sfx2::LinkManager::RegisterStatusInfoId()), css::uno::Any(OUString::number( nState )) ); bStateChangeCalled = true; } } diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 685824919102..051ca2258063 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -2182,9 +2182,7 @@ IMPL_LINK_NOARG_TYPED(SfxHelpTextWindow_Impl, SelectHdl, Idle *, void) Reference < XSelectionSupplier > xSelectionSup( xController, UNO_QUERY ); if ( xSelectionSup.is() ) { - Any aAny; - aAny <<= xSelection; - xSelectionSup->select( aAny ); + xSelectionSup->select( Any(xSelection) ); } } } @@ -2249,9 +2247,7 @@ void SfxHelpTextWindow_Impl::FindHdl(sfx2::SearchDialog* pDlg) Reference < XSelectionSupplier > xSelectionSup( xController, UNO_QUERY ); if ( xSelectionSup.is() ) { - Any aAny; - aAny <<= xSelection; - xSelectionSup->select( aAny ); + xSelectionSup->select( Any(xSelection) ); } } else if ( pDlg->IsWrapAround() && !bWrapAround ) diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx index a98514c1dce3..2668096f3750 100644 --- a/sfx2/source/appl/opengrf.cxx +++ b/sfx2/source/appl/opengrf.cxx @@ -212,8 +212,7 @@ void SvxOpenGraphicDialog::AsLink(bool bState) { try { - Any aAny; aAny <<= bState; - mpImpl->xCtrlAcc->setValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0, aAny ); + mpImpl->xCtrlAcc->setValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0, Any(bState) ); } catch(const IllegalArgumentException&) { diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 28e12befcd2b..e3663e41facb 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -1936,11 +1936,9 @@ void SfxMedium::Transfer_Impl() // set segment size property; package will automatically be divided in pieces fitting // into this size - css::uno::Any aAny; - aAny <<= pSegmentSize->GetValue(); uno::Reference < beans::XPropertySet > xSet( pImp->xStorage, uno::UNO_QUERY ); - xSet->setPropertyValue("SegmentSize", aAny ); + xSet->setPropertyValue("SegmentSize", Any(pSegmentSize->GetValue()) ); // copy the temporary storage into the disk spanned package GetStorage()->copyToStorage( xStor ); diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index f8c9d4b43ec0..ab7319a7b7d7 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -1710,7 +1710,6 @@ bool SfxObjectShell::SaveTo_Impl OUString aAuthor( "Author" ); OUString aKeywords( "Keywords" ); OUString aSubject( "Subject" ); - Any aAny; uno::Reference<document::XDocumentPropertiesSupplier> xDPS( GetModel(), uno::UNO_QUERY_THROW); @@ -1719,19 +1718,18 @@ bool SfxObjectShell::SaveTo_Impl if ( xProps->hasPropertyByName( aAuthor ) ) { - aAny <<= xDocProps->getAuthor(); - aContent.setPropertyValue( aAuthor, aAny ); + aContent.setPropertyValue( aAuthor, Any(xDocProps->getAuthor()) ); } if ( xProps->hasPropertyByName( aKeywords ) ) { + Any aAny; aAny <<= ::comphelper::string::convertCommaSeparated( xDocProps->getKeywords()); aContent.setPropertyValue( aKeywords, aAny ); } if ( xProps->hasPropertyByName( aSubject ) ) { - aAny <<= xDocProps->getSubject(); - aContent.setPropertyValue( aSubject, aAny ); + aContent.setPropertyValue( aSubject, Any(xDocProps->getSubject()) ); } } } diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 56467835cab7..6be889c2b9dd 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -3205,14 +3205,12 @@ Reference < container::XIndexAccess > SAL_CALL SfxBaseModel::getViewData() throw Reference < container::XIndexContainer > xCont( m_pData->m_contViewData, UNO_QUERY ); sal_Int32 nCount = 0; Sequence < beans::PropertyValue > aSeq; - Any aAny; for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst( m_pData->m_pObjectShell ); pFrame; pFrame = SfxViewFrame::GetNext( *pFrame, m_pData->m_pObjectShell ) ) { bool bIsActive = ( pFrame == pActFrame ); pFrame->GetViewShell()->WriteUserDataSequence( aSeq ); - aAny <<= aSeq; - xCont->insertByIndex( bIsActive ? 0 : nCount, aAny ); + xCont->insertByIndex( bIsActive ? 0 : nCount, Any(aSeq) ); nCount++; } } @@ -3524,8 +3522,7 @@ Reference< ui::XUIConfigurationManager2 > SfxBaseModel::getUIConfigurationManage Any a = xPropSet->getPropertyValue( aMediaTypeProp ); if ( !( a >>= aMediaType ) || aMediaType.isEmpty()) { - a <<= aUIConfigMediaType; - xPropSet->setPropertyValue( aMediaTypeProp, a ); + xPropSet->setPropertyValue( aMediaTypeProp, Any(aUIConfigMediaType) ); } } else diff --git a/sfx2/source/view/viewfrm2.cxx b/sfx2/source/view/viewfrm2.cxx index 81ada85c2420..27292d8cfbd6 100644 --- a/sfx2/source/view/viewfrm2.cxx +++ b/sfx2/source/view/viewfrm2.cxx @@ -321,8 +321,7 @@ void SfxViewFrame::GetState_Impl( SfxItemSet &rSet ) case SID_OBJECT: if ( GetViewShell() && GetViewShell()->GetVerbs().getLength() && !GetObjectShell()->IsInPlaceActive() ) { - uno::Any aAny; - aAny <<= GetViewShell()->GetVerbs(); + uno::Any aAny(GetViewShell()->GetVerbs()); rSet.Put( SfxUnoAnyItem( sal_uInt16( SID_OBJECT ), aAny ) ); } else |