From 8fec9e7e4ca97e14551a737583226f89b0c6eecd Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 30 May 2016 15:14:03 +0200 Subject: Some clean up of uses of css::uno::Any::setValue Change-Id: I04e8aef35a6083b61d775c8eb3f96757da2b31bd --- cppu/qa/test_reference.cxx | 8 +++----- editeng/source/items/xmlcnitm.cxx | 2 +- editeng/source/uno/unonrule.cxx | 2 +- extensions/source/bibliography/bibload.cxx | 4 ++-- extensions/source/bibliography/datman.cxx | 7 +++---- extensions/source/bibliography/framectr.cxx | 6 ++---- extensions/source/bibliography/general.cxx | 2 +- filter/source/graphicfilter/icgm/actimpr.cxx | 3 +-- filter/source/msfilter/msocximex.cxx | 3 +-- stoc/source/typeconv/convert.cxx | 5 ++--- svx/source/form/fmsrcimp.cxx | 2 +- svx/source/unodraw/unoshape.cxx | 2 +- sw/source/core/doc/docbasic.cxx | 2 +- sw/source/core/fields/docufld.cxx | 7 +++---- sw/source/core/layout/atrfrm.cxx | 4 ++-- sw/source/core/para/paratr.cxx | 2 +- sw/source/core/unocore/unocoll.cxx | 14 ++++++-------- sw/source/core/unocore/unocrsrhelper.cxx | 10 +++++----- sw/source/core/unocore/unodraw.cxx | 9 ++++----- sw/source/core/unocore/unofield.cxx | 2 +- sw/source/core/unocore/unoframe.cxx | 4 ++-- sw/source/core/unocore/unoparagraph.cxx | 2 +- sw/source/core/unocore/unosett.cxx | 4 ++-- sw/source/core/unocore/unostyle.cxx | 4 ++-- sw/source/core/unocore/unotbl.cxx | 2 +- sw/source/filter/html/htmlform.cxx | 22 ++++++++-------------- sw/source/filter/ww8/ww8par3.cxx | 2 +- sw/source/uibase/shells/drformsh.cxx | 3 +-- sw/source/uibase/shells/textdrw.cxx | 3 +-- sw/source/uibase/uno/unotxdoc.cxx | 26 +++++++++----------------- sw/source/uibase/uno/unotxvw.cxx | 18 +++++++++--------- sw/source/uibase/utlui/uiitems.cxx | 2 +- sw/source/uibase/utlui/unotools.cxx | 5 ++--- unotools/source/config/lingucfg.cxx | 19 +++++++------------ 34 files changed, 89 insertions(+), 123 deletions(-) diff --git a/cppu/qa/test_reference.cxx b/cppu/qa/test_reference.cxx index c04b8b1e010f..df57eab424da 100644 --- a/cppu/qa/test_reference.cxx +++ b/cppu/qa/test_reference.cxx @@ -52,16 +52,14 @@ public: virtual Any SAL_CALL queryInterface(const Type & _type) throw (RuntimeException, std::exception) override { - Any aInterface; if (_type == cppu::UnoType::get()) { - Reference< XInterface > ref( static_cast< XInterface * >( this ) ); - aInterface.setValue( &ref, _type ); + return css::uno::makeAny>( + this); } else if (_type == cppu::UnoType::get()) { - Reference< Interface1 > ref( this ); - aInterface.setValue( &ref, _type ); + return css::uno::makeAny>(this); } return Any(); diff --git a/editeng/source/items/xmlcnitm.cxx b/editeng/source/items/xmlcnitm.cxx index 6b4dca473634..f83289064695 100644 --- a/editeng/source/items/xmlcnitm.cxx +++ b/editeng/source/items/xmlcnitm.cxx @@ -74,7 +74,7 @@ bool SvXMLAttrContainerItem::QueryValue( css::uno::Any& rVal, sal_uInt8 /*nMembe Reference xContainer = new SvUnoAttributeContainer( new SvXMLAttrContainerData( *pImpl.get() ) ); - rVal.setValue( &xContainer, cppu::UnoType::get()); + rVal <<= xContainer; return true; } diff --git a/editeng/source/uno/unonrule.cxx b/editeng/source/uno/unonrule.cxx index a6a6841a28cf..a2075e3958e2 100644 --- a/editeng/source/uno/unonrule.cxx +++ b/editeng/source/uno/unonrule.cxx @@ -218,7 +218,7 @@ Sequence SvxUnoNumberingRules::getNumberingRuleByIndex(sal { awt::FontDescriptor aDesc; SvxUnoFontDescriptor::ConvertFromFont( *rFmt.GetBulletFont(), aDesc ); - aVal.setValue(&aDesc, ::cppu::UnoType::get()); + aVal <<= aDesc; pArray[nIdx++] = beans::PropertyValue( OUString(UNO_NAME_NRULE_BULLET_FONT), -1, aVal, beans::PropertyState_DIRECT_VALUE); } diff --git a/extensions/source/bibliography/bibload.cxx b/extensions/source/bibliography/bibload.cxx index ce394a16d289..fb36a2f31bda 100644 --- a/extensions/source/bibliography/bibload.cxx +++ b/extensions/source/bibliography/bibload.cxx @@ -480,7 +480,7 @@ Any BibliographyLoader::getByName(const OUString& rName) throw pValues[nEntry].Name = sColName; pValues[nEntry].Value <<= lcl_AddProperty(xColumns, pMapping, sColName); } - aRet.setValue(&aPropSequ, cppu::UnoType>::get()); + aRet <<= aPropSequ; break; } @@ -641,7 +641,7 @@ Any BibliographyLoader::getPropertyValue(const OUString& rPropertyName) pArray[i].Name = pConfig->GetDefColumnName(aInternalMapping[i]); pArray[i].Value <<= (sal_Int16) i; } - aRet.setValue(&aSeq, cppu::UnoType>::get()); + aRet <<= aSeq; } else throw UnknownPropertyException(); diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx index 0ec1fe2daa9f..d9ff7c9d0022 100644 --- a/extensions/source/bibliography/datman.cxx +++ b/extensions/source/bibliography/datman.cxx @@ -1325,8 +1325,7 @@ Reference< awt::XControlModel > BibDataManager::loadControlModel( //uno::Reference< beans::XPropertySet > xPropSet(xControl, UNO_QUERY); aAny <<= (sal_Int16)1; xPropSet->setPropertyValue("BoundColumn", aAny); - ListSourceType eSet = ListSourceType_VALUELIST; - aAny.setValue( &eSet, ::cppu::UnoType::get() ); + aAny <<= ListSourceType_VALUELIST; xPropSet->setPropertyValue("ListSourceType", aAny); uno::Sequence aListSource(TYPE_COUNT); @@ -1334,7 +1333,7 @@ Reference< awt::XControlModel > BibDataManager::loadControlModel( //pListSourceArr[0] = "select TypeName, TypeIndex from TypeNms"; for(sal_Int32 i = 0; i < TYPE_COUNT; ++i) pListSourceArr[i] = OUString::number(i); - aAny.setValue(&aListSource, cppu::UnoType>::get()); + aAny <<= aListSource; xPropSet->setPropertyValue("ListSource", aAny); @@ -1365,7 +1364,7 @@ Reference< awt::XControlModel > BibDataManager::loadControlModel( // empty string if an invalid value no values is set pValuesArr[TYPE_COUNT].clear(); - aAny.setValue(&aValues, cppu::UnoType>::get()); + aAny <<= aValues; xPropSet->setPropertyValue("StringItemList", aAny); diff --git a/extensions/source/bibliography/framectr.cxx b/extensions/source/bibliography/framectr.cxx index 7e448f8ff887..df541538dee4 100644 --- a/extensions/source/bibliography/framectr.cxx +++ b/extensions/source/bibliography/framectr.cxx @@ -664,8 +664,7 @@ void BibFrameController_Impl::addStatusListener( aEvent.IsEnabled = true; aEvent.FeatureDescriptor=pDatMan->getQueryField(); - uno::Sequence aStringSeq=pDatMan->getQueryFields(); - aEvent.State.setValue(&aStringSeq,cppu::UnoType>::get()); + aEvent.State <<= pDatMan->getQueryFields(); } else if ( aURL.Path == "Bib/source") @@ -673,8 +672,7 @@ void BibFrameController_Impl::addStatusListener( aEvent.IsEnabled = true; aEvent.FeatureDescriptor=pDatMan->getActiveDataTable(); - uno::Sequence aStringSeq=pDatMan->getDataSources(); - aEvent.State.setValue(&aStringSeq,cppu::UnoType>::get()); + aEvent.State <<= pDatMan->getDataSources(); } else if( aURL.Path == "Bib/sdbsource" || aURL.Path == "Bib/Mapping" || diff --git a/extensions/source/bibliography/general.cxx b/extensions/source/bibliography/general.cxx index 14c256ab0c46..7758e4f0e305 100644 --- a/extensions/source/bibliography/general.cxx +++ b/extensions/source/bibliography/general.cxx @@ -150,7 +150,7 @@ void BibPosListener::cursorMoved(const lang::EventObject& /*aEvent*/) throw( uno uno::Sequence aSelSeq(1); sal_Int16* pArr = aSelSeq.getArray(); pArr[0] = TYPE_COUNT; - aSel.setValue(&aSelSeq, cppu::UnoType>::get()); + aSel <<= aSelSeq; xPropSet->setPropertyValue("SelectedItems", aSel); } } diff --git a/filter/source/graphicfilter/icgm/actimpr.cxx b/filter/source/graphicfilter/icgm/actimpr.cxx index de256bad966a..2d364c48e580 100644 --- a/filter/source/graphicfilter/icgm/actimpr.cxx +++ b/filter/source/graphicfilter/icgm/actimpr.cxx @@ -516,8 +516,7 @@ void CGMImpressOutAct::DrawEllipticalArc( FloatPoint& rCenter, FloatPoint& rSize if ( nType == 2 ) { ImplSetLineBundle(); - drawing::FillStyle eFillStyle = drawing::FillStyle_NONE; - aAny.setValue( &eFillStyle, cppu::UnoType::get()); + aAny <<= drawing::FillStyle_NONE; maXPropSet->setPropertyValue( "FillStyle", aAny ); } } diff --git a/filter/source/msfilter/msocximex.cxx b/filter/source/msfilter/msocximex.cxx index 5ed9bbf2b5a3..784844821091 100644 --- a/filter/source/msfilter/msocximex.cxx +++ b/filter/source/msfilter/msocximex.cxx @@ -132,8 +132,7 @@ const uno::Reference< container::XIndexContainer >& uno::UNO_QUERY ); OSL_ENSURE( xForms.is(), "XForms not available" ); - aTmp.setValue( &xForm, - cppu::UnoType::get()); + aTmp <<= xForm; xForms->insertByIndex( xForms->getCount(), aTmp ); xFormComps = uno::Reference< container::XIndexContainer > diff --git a/stoc/source/typeconv/convert.cxx b/stoc/source/typeconv/convert.cxx index 2a6cc736a557..7b21b926d543 100644 --- a/stoc/source/typeconv/convert.cxx +++ b/stoc/source/typeconv/convert.cxx @@ -825,9 +825,8 @@ Any TypeConverter_Impl::convertToSimpleType( const Any& rVal, TypeClass aDestina } if (nPos >= 0) { - aRet.setValue( - &reinterpret_cast(aEnumTD.get())->ppEnumNames[nPos], - cppu::UnoType::get()); + aRet <<= OUString::unacquired( + &reinterpret_cast(aEnumTD.get())->ppEnumNames[nPos]); } else { diff --git a/svx/source/form/fmsrcimp.cxx b/svx/source/form/fmsrcimp.cxx index 5d0e72d9a80a..2e6ab8ed47a1 100644 --- a/svx/source/form/fmsrcimp.cxx +++ b/svx/source/form/fmsrcimp.cxx @@ -1189,7 +1189,7 @@ void FmSearchEngine::StartOverSpecial(bool _bSearchForNull) void FmSearchEngine::InvalidatePreviousLoc() { - m_aPreviousLocBookmark.setValue(nullptr,cppu::UnoType::get()); + m_aPreviousLocBookmark.clear(); m_iterPreviousLocField = m_arrUsedFields.end(); } diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 8074c5393e19..a6fe3ae4f1bf 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -686,7 +686,7 @@ uno::Any SvxShape::GetBitmap( bool bMetaFile /* = false */ ) const const uno::Sequence aSeq( static_cast< const sal_Int8* >(aDestStrm.GetData()), aDestStrm.GetEndOfData()); - aAny.setValue( &aSeq, cppu::UnoType>::get() ); + aAny <<= aSeq; } else { diff --git a/sw/source/core/doc/docbasic.cxx b/sw/source/core/doc/docbasic.cxx index 43275185f056..b189e573224e 100644 --- a/sw/source/core/doc/docbasic.cxx +++ b/sw/source/core/doc/docbasic.cxx @@ -63,7 +63,7 @@ static Sequence *lcl_docbasic_convertArgs( SbxArray& rArgs ) pUnoArgs[i] <<= (sal_Int32)pVar->GetLong(); break; default: - pUnoArgs[i].setValue(nullptr, cppu::UnoType::get()); + pUnoArgs[i].clear(); break; } } diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index f20e418784b7..578fa595acdb 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -258,7 +258,7 @@ bool SwPageNumberField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const eType = text::PageNumberType_PREV; else if(nSubType == PG_NEXT) eType = text::PageNumberType_NEXT; - rAny.setValue(&eType, cppu::UnoType::get()); + rAny <<= eType; } break; case FIELD_PROP_PAR1: @@ -1192,7 +1192,7 @@ bool SwDocInfoField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const case FIELD_PROP_DOUBLE: { double fVal = GetValue(); - rAny.setValue(&fVal, cppu::UnoType::get()); + rAny <<= fVal; } break; case FIELD_PROP_PAR3: @@ -1771,8 +1771,7 @@ bool SwPostItField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const } case FIELD_PROP_DATE: { - css::util::Date aSetDate = aDateTime.GetUNODate(); - rAny.setValue(&aSetDate, ::cppu::UnoType::get()); + rAny <<= aDateTime.GetUNODate(); } break; case FIELD_PROP_DATE_TIME: diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index 849af3b88ed0..72b0181d3826 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -218,7 +218,7 @@ bool SwFormatFrameSize::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const awt::Size aTmp; aTmp.Height = convertTwipToMm100(m_aSize.Height()); aTmp.Width = convertTwipToMm100(m_aSize.Width()); - rVal.setValue(&aTmp, ::cppu::UnoType::get()); + rVal <<= aTmp; } break; case MID_FRMSIZE_REL_HEIGHT: @@ -1050,7 +1050,7 @@ bool SwFormatCol::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const else { uno::Reference< text::XTextColumns > xCols = new SwXTextColumns(*this); - rVal.setValue(&xCols, cppu::UnoType::get()); + rVal <<= xCols; } return true; } diff --git a/sw/source/core/para/paratr.cxx b/sw/source/core/para/paratr.cxx index e017364d4cc3..44abc86f09f1 100644 --- a/sw/source/core/para/paratr.cxx +++ b/sw/source/core/para/paratr.cxx @@ -136,7 +136,7 @@ bool SwFormatDrop::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const aDrop.Lines = nLines ; aDrop.Count = nChars ; aDrop.Distance = convertTwipToMm100(nDistance); - rVal.setValue(&aDrop, ::cppu::UnoType::get()); + rVal <<= aDrop; } break; case MID_DROPCAP_WHOLE_WORD: diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index 09ee314ace34..4a6adb3a45b2 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -856,8 +856,7 @@ uno::Any SAL_CALL SwXTextTables::getByIndex(sal_Int32 nIndex) { SwFrameFormat& rFormat = GetDoc()->GetTableFrameFormat(nIndex, true); uno::Reference< XTextTable > xTable = SwXTextTables::GetObject(rFormat); - aRet.setValue( &xTable, - cppu::UnoType::get()); + aRet <<= xTable; } else throw IndexOutOfBoundsException(); @@ -882,8 +881,7 @@ uno::Any SwXTextTables::getByName(const OUString& rItemName) if (rItemName == rFormat.GetName()) { xTable = SwXTextTables::GetObject(rFormat); - aRet.setValue(&xTable, - cppu::UnoType::get()); + aRet <<= xTable; break; } } @@ -1447,7 +1445,7 @@ uno::Any SwXTextSections::getByName(const OUString& rName) && (rName == pFormat->GetSection()->GetSectionName())) { xSect = GetObject(*pFormat); - aRet.setValue(&xSect, cppu::UnoType::get()); + aRet <<= xSect; break; } } @@ -1727,7 +1725,7 @@ uno::Any SwXNumberingRulesCollection::getByIndex(sal_Int32 nIndex) if ( static_cast(nIndex) < GetDoc()->GetNumRuleTable().size() ) { xRef = new SwXNumberingRules( *GetDoc()->GetNumRuleTable()[ nIndex ], GetDoc()); - aRet.setValue(&xRef, cppu::UnoType::get()); + aRet <<= xRef; } if(!xRef.is()) @@ -1897,7 +1895,7 @@ uno::Any SwXReferenceMarks::getByIndex(sal_Int32 nIndex) if(pMark) { xRef = SwXReferenceMark::CreateXReferenceMark(*GetDoc(), pMark); - aRet.setValue(&xRef, cppu::UnoType::get()); + aRet <<= xRef; } } if(!xRef.is()) @@ -1918,7 +1916,7 @@ uno::Any SwXReferenceMarks::getByName(const OUString& rName) { uno::Reference const xRef = SwXReferenceMark::CreateXReferenceMark(*GetDoc(), pMark); - aRet.setValue(&xRef, cppu::UnoType::get()); + aRet <<= xRef; } else throw NoSuchElementException(); diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 22b41fed67fc..f3a725a53885 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -544,13 +544,13 @@ bool getCursorPropertyValue(const SfxItemPropertySimpleEntry& rEntry if(FN_UNO_TEXT_TABLE == rEntry.nWID) { uno::Reference< XTextTable > xTable = SwXTextTables::GetObject(*pTableFormat); - pAny->setValue(&xTable, cppu::UnoType::get()); + *pAny <<= xTable; } else { SwTableBox* pBox = pSttNode->GetTableBox(); uno::Reference< XCell > xCell = SwXCell::CreateXCell(pTableFormat, pBox); - pAny->setValue(&xCell, cppu::UnoType::get()); + *pAny <<= xCell; } } } @@ -585,7 +585,7 @@ bool getCursorPropertyValue(const SfxItemPropertySimpleEntry& rEntry if( pAny ) { uno::Reference< XTextSection > xSect = SwXTextSections::GetObject( *pSect->GetFormat() ); - pAny->setValue(&xSect, cppu::UnoType::get()); + *pAny <<= xSect; } } else @@ -635,7 +635,7 @@ bool getCursorPropertyValue(const SfxItemPropertySimpleEntry& rEntry uno::Reference const xRef = SwXReferenceMark::CreateXReferenceMark(*rPam.GetDoc(), const_cast(&rRef)); - pAny->setValue(&xRef, cppu::UnoType::get()); + *pAny <<= xRef; } } else @@ -885,7 +885,7 @@ void getNumberingProperty(SwPaM& rPam, PropertyState& eState, Any * pAny ) { uno::Reference< XIndexReplace > xNum = new SwXNumberingRules(*pNumRule); if ( pAny ) - pAny->setValue(&xNum, cppu::UnoType::get()); + *pAny <<= xNum; eState = PropertyState_DIRECT_VALUE; } else diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 10024027c658..a12fa5dd1089 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -1529,7 +1529,7 @@ uno::Any SwXShape::getPropertyValue(const OUString& rPropertyName) Point aPt = pObj->GetAnchorPos(); awt::Point aPoint( convertTwipToMm100( aPt.X() ), convertTwipToMm100( aPt.Y() ) ); - aRet.setValue(&aPoint, cppu::UnoType::get()); + aRet <<= aPoint; } } // #i26791# - special handling for FN_TEXT_RANGE @@ -1552,7 +1552,7 @@ uno::Any SwXShape::getPropertyValue(const OUString& rPropertyName) *pFormat->GetDoc(), *aAnchor.GetContentAnchor(), nullptr ); - aRet.setValue(&xTextRange, cppu::UnoType::get()); + aRet <<= xTextRange; } else { @@ -1664,15 +1664,14 @@ uno::Any SwXShape::getPropertyValue(const OUString& rPropertyName) pItem = pImpl->GetSurround(); break; case FN_TEXT_RANGE : - aRet.setValue(&pImpl->GetTextRange(), cppu::UnoType::get()); + aRet <<= pImpl->GetTextRange(); break; case RES_OPAQUE : aRet <<= pImpl->GetOpaque(); break; case FN_ANCHOR_POSITION : { - awt::Point aPoint; - aRet.setValue(&aPoint, cppu::UnoType::get()); + aRet <<= awt::Point(); } break; // #i26791# diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index 89e5f1780cd7..b0a084f78322 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -2334,7 +2334,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::Sequence aTypes(1); text::TextContentAnchorType* pArray = aTypes.getArray(); pArray[0] = text::TextContentAnchorType_AS_CHARACTER; - aRet.setValue(&aTypes, cppu::UnoType>::get()); + aRet <<= aTypes; } break; diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 2bb4a87ce860..6cbff2e618a0 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -2021,7 +2021,7 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) pArray[2] = text::TextContentAnchorType_AT_PAGE; pArray[3] = text::TextContentAnchorType_AT_FRAME; pArray[4] = text::TextContentAnchorType_AT_CHARACTER; - aAny.setValue(&aTypes, cppu::UnoType>::get()); + aAny <<= aTypes; } else if(pFormat) { @@ -2169,7 +2169,7 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) awt::Size aTmp; aTmp.Width = convertTwipToMm100(aActSize.Width()); aTmp.Height = convertTwipToMm100(aActSize.Height()); - aAny.setValue(&aTmp, ::cppu::UnoType::get()); + aAny <<= aTmp; } } else if(FN_PARAM_LINK_DISPLAY_NAME == pEntry->nWID) diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx index 39417de5c410..7f7573261310 100644 --- a/sw/source/core/unocore/unoparagraph.cxx +++ b/sw/source/core/unocore/unoparagraph.cxx @@ -894,7 +894,7 @@ bool ::sw::GetDefaultTextContentValue( { uno::Sequence aTypes(1); text::TextContentAnchorType* pArray = aTypes.getArray(); pArray[0] = text::TextContentAnchorType_AT_PARAGRAPH; - rAny.setValue(&aTypes, cppu::UnoType>::get()); + rAny <<= aTypes; } break; default: diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index cd84531a3558..9f9991aaed89 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -1265,14 +1265,14 @@ uno::Any SwXNumberingRules::getByIndex(sal_Int32 nIndex) { uno::Sequence aRet = GetNumberingRuleByIndex( *pRule, nIndex); - aVal.setValue(&aRet, cppu::UnoType>::get()); + aVal <<= aRet; } else if(pDocShell) { uno::Sequence aRet = GetNumberingRuleByIndex( *pDocShell->GetDoc()->GetOutlineNumRule(), nIndex); - aVal.setValue(&aRet, cppu::UnoType>::get()); + aVal <<= aRet; } else throw uno::RuntimeException(); diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 0c60416f6ee1..ae6d428c18fe 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -3326,7 +3326,7 @@ uno::Any SwXAutoStyles::getByIndex(sal_Int32 nIndex) default: ; } - aRet.setValue(&aRef, cppu::UnoType::get()); + aRet <<= aRef; } else throw uno::RuntimeException(); @@ -3724,7 +3724,7 @@ uno::Any SwXAutoStylesEnumerator::nextElement( ) SfxItemSet_Pointer_t pNextSet = m_pImpl->nextElement(); uno::Reference< style::XAutoStyle > xAutoStyle = new SwXAutoStyle(m_pImpl->getDoc(), pNextSet, m_pImpl->getFamily()); - aRet.setValue(&xAutoStyle, cppu::UnoType::get()); + aRet <<= xAutoStyle; } return aRet; } diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index aa4057441de4..ba58c94ca6de 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -657,7 +657,7 @@ static void lcl_GetTableSeparators(uno::Any& rRet, SwTable* pTable, SwTableBox* } } if(!bError) - rRet.setValue(&aColSeq, cppu::UnoType>::get()); + rRet <<= aColSeq; } diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx index 5fb9e1ade649..aeb520d418f6 100644 --- a/sw/source/filter/html/htmlform.cxx +++ b/sw/source/filter/html/htmlform.cxx @@ -630,7 +630,7 @@ static void lcl_html_setFixedFontProperty( rPropSet->setPropertyValue("FontPitch", aTmp ); float fVal(10.); - aTmp.setValue( &fVal, cppu::UnoType::get()); + aTmp <<= fVal; rPropSet->setPropertyValue("FontHeight", aTmp ); } @@ -1000,7 +1000,7 @@ uno::Reference< drawing::XShape > SwHTMLParser::InsertControl( { float fVal = static_cast< float >( (static_cast(pItem)->GetHeight()) / 20.0 ); - aTmp.setValue( &fVal, cppu::UnoType::get()); + aTmp <<= fVal; rFCompPropSet->setPropertyValue( sPropName, aTmp ); } @@ -1047,7 +1047,7 @@ uno::Reference< drawing::XShape > SwHTMLParser::InsertControl( { float fVal = VCLUnoHelper::ConvertFontWeight( static_cast(pItem)->GetWeight() ); - aTmp.setValue( &fVal, cppu::UnoType::get()); + aTmp <<= fVal; rFCompPropSet->setPropertyValue( sPropName, aTmp ); } @@ -1176,8 +1176,7 @@ uno::Reference< drawing::XShape > SwHTMLParser::InsertControl( xTextRg = new SwXTextRange( *m_pPam, xDummyTextRef ); } - aTmp.setValue( &xTextRg, - cppu::UnoType::get()); + aTmp <<= xTextRg; xShapePropSet->setPropertyValue("TextRange", aTmp ); } @@ -1354,13 +1353,11 @@ void SwHTMLParser::NewForm( bool bAppend ) xFormPropSet->setPropertyValue("TargetURL", aTmp ); - FormSubmitMethod eMethod = (FormSubmitMethod)nMethod; - aTmp.setValue( &eMethod, cppu::UnoType::get()); + aTmp <<= FormSubmitMethod(nMethod); xFormPropSet->setPropertyValue("SubmitMethod", aTmp ); - FormSubmitEncoding eEncType = (FormSubmitEncoding)nEncType; - aTmp.setValue( &eEncType, cppu::UnoType::get()); + aTmp <<= FormSubmitEncoding(nEncType); xFormPropSet->setPropertyValue("SubmitEncoding", aTmp ); if( !sTarget.isEmpty() ) @@ -1700,9 +1697,7 @@ void SwHTMLParser::InsertInput() aSz = Application::GetDefaultDevice() ->PixelToLogic( aSz, MapMode( MAP_100TH_MM ) ); } - FormButtonType eButtonType = FormButtonType_SUBMIT; - aTmp.setValue( &eButtonType, - cppu::UnoType::get()); + aTmp <<= FormButtonType_SUBMIT; xPropSet->setPropertyValue("ButtonType", aTmp ); aTmp <<= (sal_Int16) 0 ; @@ -1738,8 +1733,7 @@ void SwHTMLParser::InsertInput() xPropSet->setPropertyValue("Label", aTmp ); - aTmp.setValue( &eButtonType, - cppu::UnoType::get()); + aTmp <<= eButtonType; xPropSet->setPropertyValue("ButtonType", aTmp ); bMinWidth = bMinHeight = true; diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index 7b0d024df430..4882660c1f68 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -2596,7 +2596,7 @@ bool SwMSConvertControls::InsertControl( uno::Reference< text::XTextRange > xTextRg = new SwXTextRange( *pPaM, xDummyTextRef ); - aTmp.setValue(&xTextRg, cppu::UnoType::get()); + aTmp <<= xTextRg; xShapePropSet->setPropertyValue("TextRange", aTmp ); // Das Control-Model am Control-Shape setzen diff --git a/sw/source/uibase/shells/drformsh.cxx b/sw/source/uibase/shells/drformsh.cxx index 50058a1b65f3..360d99bc0d8e 100644 --- a/sw/source/uibase/shells/drformsh.cxx +++ b/sw/source/uibase/shells/drformsh.cxx @@ -142,8 +142,7 @@ void SwDrawFormShell::Execute(SfxRequest &rReq) xPropSet->setPropertyValue( "TargetFrame", aTmp ); } - form::FormButtonType eButtonType = form::FormButtonType_URL; - aTmp.setValue( &eButtonType, ::cppu::UnoType::get()); + aTmp <<= form::FormButtonType_URL; xPropSet->setPropertyValue( "ButtonType", aTmp ); } } diff --git a/sw/source/uibase/shells/textdrw.cxx b/sw/source/uibase/shells/textdrw.cxx index 64d527e685a7..256cbe3722ca 100644 --- a/sw/source/uibase/shells/textdrw.cxx +++ b/sw/source/uibase/shells/textdrw.cxx @@ -104,8 +104,7 @@ void SwBaseShell::InsertURLButton(const OUString& rURL, const OUString& rTarget, xPropSet->setPropertyValue( "TargetFrame", aTmp ); } - form::FormButtonType eButtonType = form::FormButtonType_URL; - aTmp.setValue( &eButtonType, ::cppu::UnoType::get()); + aTmp <<= form::FormButtonType_URL; xPropSet->setPropertyValue( "ButtonType", aTmp ); #if HAVE_FEATURE_AVMEDIA diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 3a8a7ada5119..28ecfb6ab4fe 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3736,56 +3736,49 @@ Any SwXLinkTargetSupplier::getByName(const OUString& rName) Reference< XNameAccess > xTables = new SwXLinkNameAccessWrapper( pxDoc->getTextTables(), rName, sSuffix ); - Reference< XPropertySet > xRet(xTables, UNO_QUERY); - aRet.setValue(&xRet, cppu::UnoType::get()); + aRet <<= Reference< XPropertySet >(xTables, UNO_QUERY); } else if(rName == sFrames) { sSuffix += "frame"; Reference< XNameAccess > xTables = new SwXLinkNameAccessWrapper( pxDoc->getTextFrames(), rName, sSuffix ); - Reference< XPropertySet > xRet(xTables, UNO_QUERY); - aRet.setValue(&xRet, cppu::UnoType::get()); + aRet <<= Reference< XPropertySet >(xTables, UNO_QUERY); } else if(rName == sSections) { sSuffix += "region"; Reference< XNameAccess > xTables = new SwXLinkNameAccessWrapper( pxDoc->getTextSections(), rName, sSuffix ); - Reference< XPropertySet > xRet(xTables, UNO_QUERY); - aRet.setValue(&xRet, cppu::UnoType::get()); + aRet <<= Reference< XPropertySet >(xTables, UNO_QUERY); } else if(rName == sGraphics) { sSuffix += "graphic"; Reference< XNameAccess > xTables = new SwXLinkNameAccessWrapper( pxDoc->getGraphicObjects(), rName, sSuffix ); - Reference< XPropertySet > xRet(xTables, UNO_QUERY); - aRet.setValue(&xRet, cppu::UnoType::get()); + aRet <<= Reference< XPropertySet >(xTables, UNO_QUERY); } else if(rName == sOLEs) { sSuffix += "ole"; Reference< XNameAccess > xTables = new SwXLinkNameAccessWrapper( pxDoc->getEmbeddedObjects(), rName, sSuffix ); - Reference< XPropertySet > xRet(xTables, UNO_QUERY); - aRet.setValue(&xRet, cppu::UnoType::get()); + aRet <<= Reference< XPropertySet >(xTables, UNO_QUERY); } else if(rName == sOutlines) { sSuffix += "outline"; Reference< XNameAccess > xTables = new SwXLinkNameAccessWrapper( *pxDoc, rName, sSuffix ); - Reference< XPropertySet > xRet(xTables, UNO_QUERY); - aRet.setValue(&xRet, cppu::UnoType::get()); + aRet <<= Reference< XPropertySet >(xTables, UNO_QUERY); } else if(rName == sBookmarks) { sSuffix.clear(); Reference< XNameAccess > xBkms = new SwXLinkNameAccessWrapper( pxDoc->getBookmarks(), rName, sSuffix ); - Reference< XPropertySet > xRet(xBkms, UNO_QUERY); - aRet.setValue(&xRet, cppu::UnoType::get()); + aRet <<= Reference< XPropertySet >(xBkms, UNO_QUERY); } else throw NoSuchElementException(); @@ -3903,7 +3896,7 @@ Any SwXLinkNameAccessWrapper::getByName(const OUString& rName) if(sParam == lcl_CreateOutlineString(i, rOutlineNodes, pOutlRule)) { Reference< XPropertySet > xOutline = new SwXOutlineTarget(sParam); - aRet.setValue(&xOutline, cppu::UnoType::get()); + aRet <<= xOutline; bFound = true; } } @@ -4069,8 +4062,7 @@ static Any lcl_GetDisplayBitmap(const OUString& _sLinkSuffix) ImageList aEntryImages( SW_RES(IMG_NAVI_ENTRYBMP) ); const Image& rImage = aEntryImages.GetImage( (int)nImgId + 2000 ); Bitmap aBitmap( rImage.GetBitmapEx().GetBitmap() ); - Reference xBmp = VCLUnoHelper::CreateBitmap( aBitmap ); - aRet.setValue( &xBmp, cppu::UnoType::get()); + aRet <<= VCLUnoHelper::CreateBitmap( aBitmap ); } return aRet; } diff --git a/sw/source/uibase/uno/unotxvw.cxx b/sw/source/uibase/uno/unotxvw.cxx index ecbb9df8a620..22a2648547b4 100644 --- a/sw/source/uibase/uno/unotxvw.cxx +++ b/sw/source/uibase/uno/unotxvw.cxx @@ -172,47 +172,47 @@ uno::Any SAL_CALL SwXTextView::queryInterface( const uno::Type& aType ) if(aType == cppu::UnoType::get()) { uno::Reference xRet = this; - aRet.setValue(&xRet, aType); + aRet <<= xRet; } else if(aType == cppu::UnoType::get()) { uno::Reference xRet = this; - aRet.setValue(&xRet, aType); + aRet <<= xRet; } else if(aType == cppu::UnoType::get()) { uno::Reference xRet = this; - aRet.setValue(&xRet, aType); + aRet <<= xRet; } else if(aType == cppu::UnoType::get()) { uno::Reference xRet = this; - aRet.setValue(&xRet, aType); + aRet <<= xRet; } else if(aType == cppu::UnoType::get()) { uno::Reference xRet = this; - aRet.setValue(&xRet, aType); + aRet <<= xRet; } else if(aType == cppu::UnoType::get()) { uno::Reference xRet = this; - aRet.setValue(&xRet, aType); + aRet <<= xRet; } else if(aType == cppu::UnoType::get()) { uno::Reference xRet = this; - aRet.setValue(&xRet, aType); + aRet <<= xRet; } else if(aType == cppu::UnoType::get()) { uno::Reference xRet = this; - aRet.setValue(&xRet, aType); + aRet <<= xRet; } else if(aType == cppu::UnoType::get()) { uno::Reference xRet = this; - aRet.setValue(&xRet, aType); + aRet <<= xRet; } else aRet = SfxBaseController::queryInterface(aType); diff --git a/sw/source/uibase/utlui/uiitems.cxx b/sw/source/uibase/utlui/uiitems.cxx index 42fc1d2b6e34..7c20a88e157e 100644 --- a/sw/source/uibase/utlui/uiitems.cxx +++ b/sw/source/uibase/utlui/uiitems.cxx @@ -251,7 +251,7 @@ bool SwUINumRuleItem::operator==( const SfxPoolItem& rAttr ) const bool SwUINumRuleItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const { uno::Reference< container::XIndexReplace >xRules = new SwXNumberingRules(*pRule); - rVal.setValue(&xRules, cppu::UnoType::get()); + rVal <<= xRules; return true; } bool SwUINumRuleItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) diff --git a/sw/source/uibase/utlui/unotools.cxx b/sw/source/uibase/utlui/unotools.cxx index da7512c57687..f83991a8e35b 100644 --- a/sw/source/uibase/utlui/unotools.cxx +++ b/sw/source/uibase/utlui/unotools.cxx @@ -145,8 +145,7 @@ void SwOneExampleFrame::CreateControl() pValues[1].Value <<= OUString("-RB"); pValues[2].Name = "Referer"; pValues[2].Value <<= OUString("private:user"); - uno::Any aArgs; - aArgs.setValue(&aSeq, cppu::UnoType>::get()); + uno::Any aArgs(aSeq); xPrSet->setPropertyValue( "LoaderArguments", aArgs ); //save and set readonly??? @@ -356,7 +355,7 @@ IMPL_LINK_TYPED( SwOneExampleFrame, TimeoutHdl, Idle*, pTimer, void ) aSize >>= aPSize; //TODO: set page width to card width aPSize.Width = 10000; - aSize.setValue(&aPSize, ::cppu::UnoType::get()); + aSize <<= aPSize; xPProp->setPropertyValue(UNO_NAME_SIZE, aSize); uno::Any aZero; aZero <<= (sal_Int32)0; diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx index 03b2275cc2be..929354479e2d 100644 --- a/unotools/source/config/lingucfg.cxx +++ b/unotools/source/config/lingucfg.cxx @@ -363,20 +363,17 @@ uno::Any SvtLinguConfigItem::GetProperty( sal_Int32 nPropertyHandle ) const } case UPH_DEFAULT_LOCALE : { - lang::Locale aLocale( LanguageTag::convertToLocale( rOpt.nDefaultLanguage, false) ); - aRes.setValue( &aLocale, cppu::UnoType::get()); + aRes <<= LanguageTag::convertToLocale( rOpt.nDefaultLanguage, false); break; } case UPH_DEFAULT_LOCALE_CJK : { - lang::Locale aLocale( LanguageTag::convertToLocale( rOpt.nDefaultLanguage_CJK, false) ); - aRes.setValue( &aLocale, cppu::UnoType::get()); + aRes <<= LanguageTag::convertToLocale( rOpt.nDefaultLanguage_CJK, false); break; } case UPH_DEFAULT_LOCALE_CTL : { - lang::Locale aLocale( LanguageTag::convertToLocale( rOpt.nDefaultLanguage_CTL, false) ); - aRes.setValue( &aLocale, cppu::UnoType::get()); + aRes <<= LanguageTag::convertToLocale( rOpt.nDefaultLanguage_CTL, false); break; } case UPH_IS_IGNORE_POST_POSITIONAL_WORD : pbVal = &rOpt.bIsIgnorePostPositionalWord; break; @@ -671,8 +668,6 @@ bool SvtLinguConfigItem::SaveOptions( const uno::Sequence< OUString > &rProperyN osl::MutexGuard aGuard(theSvtLinguConfigItemMutex::get()); bool bRet = false; - const uno::Type &rINT16 = cppu::UnoType::get(); - const uno::Type &rINT32 = cppu::UnoType::get(); sal_Int32 nProps = rProperyNames.getLength(); uno::Sequence< uno::Any > aValues( nProps ); @@ -699,9 +694,9 @@ bool SvtLinguConfigItem::SaveOptions( const uno::Sequence< OUString > &rProperyN *pValue++ <<= rOpt.bIsSpellSpecial; // 11 *pValue++ <<= rOpt.bIsSpellReverse; // 14 - pValue++->setValue( &rOpt.nHyphMinLeading, rINT16 ); // 15 - pValue++->setValue( &rOpt.nHyphMinTrailing, rINT16 ); // 16 - pValue++->setValue( &rOpt.nHyphMinWordLength, rINT16 ); // 17 + *pValue++ <<= rOpt.nHyphMinLeading; // 15 + *pValue++ <<= rOpt.nHyphMinTrailing; // 16 + *pValue++ <<= rOpt.nHyphMinWordLength; // 17 *pValue++ <<= rOpt.bIsHyphSpecial; // 18 *pValue++ <<= rOpt.bIsHyphAuto; // 19 @@ -717,7 +712,7 @@ bool SvtLinguConfigItem::SaveOptions( const uno::Sequence< OUString > &rProperyN *pValue++ <<= rOpt.bIsTranslateCommonTerms; // 27 *pValue++ <<= rOpt.bIsReverseMapping; // 28 - pValue++->setValue( &rOpt.nDataFilesChangedCheckValue, rINT32 ); // 29 + *pValue++ <<= rOpt.nDataFilesChangedCheckValue; // 29 *pValue++ <<= rOpt.bIsGrammarAuto; // 30 *pValue++ <<= rOpt.bIsGrammarInteractive; // 31 -- cgit v1.2.3