summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-05-03 08:39:03 +0200
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2016-07-20 01:26:04 -0400
commita0e8e05008e143ee5e3bbc281d1c253c7e5ed136 (patch)
treeeaf5f70a067fd48704addd9f2b582624a2fb44ae /sfx2
parent9c7cae1561cfe16226b1f16dce59f08a38da3ce0 (diff)
use Any constructor instead of temporaries
(cherry picked from commit 58a32075ca4f457f570af75aef368dd6c389aca7) Change-Id: Iffb82a2cee1a28d89eeea2b905aaa14086ee475a
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/fileobj.cxx4
-rw-r--r--sfx2/source/appl/newhelp.cxx8
-rw-r--r--sfx2/source/appl/opengrf.cxx3
-rw-r--r--sfx2/source/doc/docfile.cxx4
-rw-r--r--sfx2/source/doc/objstor.cxx8
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx7
-rw-r--r--sfx2/source/view/viewfrm2.cxx3
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 aa96d2cc7e33..1efc00beaf59 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -2190,9 +2190,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) );
}
}
}
@@ -2257,9 +2255,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 5f1f33dd2f79..f827dd56876a 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -1933,11 +1933,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 a83535738f4e..d58ed2e6b396 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -1711,7 +1711,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);
@@ -1720,19 +1719,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 8b135cf225f3..263a9d4a8026 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -3232,14 +3232,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++;
}
}
@@ -3551,8 +3549,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 c37293e62c50..b3d4963fe46d 100644
--- a/sfx2/source/view/viewfrm2.cxx
+++ b/sfx2/source/view/viewfrm2.cxx
@@ -320,8 +320,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