diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-23 09:46:31 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-24 08:35:39 +0200 |
commit | ec98adb2ec71882801a4db031c8e2bcf3075c5a0 (patch) | |
tree | 24c3bb82d9d1ebaaf9ea29289a2a775f6d1ee3c4 /sd | |
parent | fdb68feeb12362f1d9d8f70d8cae49b2fa004493 (diff) |
clang-tidy performance-unnecessary-copy-init in sd
Change-Id: I4a494aebdae9b9cba3794e5eee1f3a29eb3ec838
Reviewed-on: https://gerrit.libreoffice.org/62250
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
32 files changed, 46 insertions, 54 deletions
diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx index 8835e7feabb4..d695ef8c2dcc 100644 --- a/sd/source/core/CustomAnimationEffect.cxx +++ b/sd/source/core/CustomAnimationEffect.cxx @@ -3309,9 +3309,8 @@ bool MainSequence::setTrigger( const CustomAnimationEffectPtr& pEffect, const cs EffectSequenceHelper* pNewSequence = nullptr; if( xTriggerShape.is() ) { - for (auto const& iteractiveSequence : maInteractiveSequenceVector) + for (InteractiveSequencePtr const& pIS : maInteractiveSequenceVector) { - InteractiveSequencePtr pIS(iteractiveSequence); if( pIS->getTriggerShape() == xTriggerShape ) { pNewSequence = pIS.get(); diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx index ca8ee466efae..a8ad9df0a16d 100644 --- a/sd/source/filter/eppt/eppt.cxx +++ b/sd/source/filter/eppt/eppt.cxx @@ -1261,7 +1261,7 @@ void PPTWriter::ImplWriteOLE( ) SdrObject* pSdrObj = GetSdrObjectFromXShape( pPtr->xShape ); if ( auto pSdrOle2Obj = dynamic_cast< SdrOle2Obj* >(pSdrObj) ) { - ::uno::Reference < embed::XEmbeddedObject > xObj( pSdrOle2Obj->GetObjRef() ); + const ::uno::Reference < embed::XEmbeddedObject >& xObj( pSdrOle2Obj->GetObjRef() ); if( xObj.is() ) { tools::SvRef<SotStorage> xTempStorage( new SotStorage( new SvMemoryStream(), true ) ); diff --git a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx index ccb908089a0e..ce310215752f 100644 --- a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx +++ b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx @@ -715,7 +715,7 @@ uno::Any SAL_CALL AccessibleDocumentViewBase::getExtendedAttributes() SdrLayer* aSdrLayer = rLayerAdmin.GetLayer(sLayerName); if( aSdrLayer ) { - OUString layerAltText = aSdrLayer->GetTitle(); + const OUString& layerAltText = aSdrLayer->GetTitle(); if (!layerAltText.isEmpty()) { sName = " "; diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx index a1cb53c31431..1d70cb38f7ff 100644 --- a/sd/source/ui/animations/CustomAnimationList.cxx +++ b/sd/source/ui/animations/CustomAnimationList.cxx @@ -618,10 +618,8 @@ void CustomAnimationList::update() auto rInteractiveSequenceVector = mpMainSequence->getInteractiveSequenceVector(); - for (auto const& interactiveSequence : rInteractiveSequenceVector) + for (InteractiveSequencePtr const& pIS : rInteractiveSequenceVector) { - InteractiveSequencePtr pIS( interactiveSequence ); - Reference< XShape > xShape( pIS->getTriggerShape() ); if( xShape.is() ) { @@ -857,7 +855,7 @@ EffectSequence CustomAnimationList::getSelection() const { if( !IsSelected( pChild ) ) { - CustomAnimationEffectPtr pChildEffect( pChild->getEffect() ); + const CustomAnimationEffectPtr& pChildEffect( pChild->getEffect() ); if( pChildEffect.get() ) aSelection.push_back( pChildEffect ); } diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index 8b3f3c76acaf..0047558b2dfc 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -827,9 +827,8 @@ void CustomAnimationPane::updateMotionPathTags() bChanges = updateMotionPathImpl( *this, *pView, mpMainSequence->getBegin(), mpMainSequence->getEnd(), aTags, maMotionPathTags ); auto rInteractiveSequenceVector = mpMainSequence->getInteractiveSequenceVector(); - for (auto const& interactiveSequence : rInteractiveSequenceVector) + for (InteractiveSequencePtr const& pIS : rInteractiveSequenceVector) { - InteractiveSequencePtr pIS(interactiveSequence); bChanges |= updateMotionPathImpl( *this, *pView, pIS->getBegin(), pIS->getEnd(), aTags, maMotionPathTags ); } } diff --git a/sd/source/ui/animations/motionpathtag.cxx b/sd/source/ui/animations/motionpathtag.cxx index 10ef7cfab409..aa9bfe2e3dae 100644 --- a/sd/source/ui/animations/motionpathtag.cxx +++ b/sd/source/ui/animations/motionpathtag.cxx @@ -283,11 +283,11 @@ void SdPathHdl::CreateB2dIAObject() if(rPageWindow.GetPaintWindow().OutputToWindow()) { - rtl::Reference< sdr::overlay::OverlayManager > xManager = rPageWindow.GetOverlayManager(); + const rtl::Reference< sdr::overlay::OverlayManager >& xManager = rPageWindow.GetOverlayManager(); if (xManager.is() && mpPathObj) { const sdr::contact::ViewContact& rVC = mpPathObj->GetViewContact(); - const drawinglayer::primitive2d::Primitive2DContainer aSequence = rVC.getViewIndependentPrimitive2DContainer(); + const drawinglayer::primitive2d::Primitive2DContainer& aSequence = rVC.getViewIndependentPrimitive2DContainer(); std::unique_ptr<sdr::overlay::OverlayObject> pNew(new sdr::overlay::OverlayPrimitive2DSequenceObject(aSequence)); xManager->add(*pNew); diff --git a/sd/source/ui/annotations/annotationtag.cxx b/sd/source/ui/annotations/annotationtag.cxx index 1b5d9bd86585..9a27599411e6 100644 --- a/sd/source/ui/annotations/annotationtag.cxx +++ b/sd/source/ui/annotations/annotationtag.cxx @@ -208,7 +208,7 @@ void AnnotationHdl::CreateB2dIAObject() const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(b); SdrPaintWindow& rPaintWindow = rPageWindow.GetPaintWindow(); - rtl::Reference< sdr::overlay::OverlayManager > xManager = rPageWindow.GetOverlayManager(); + const rtl::Reference< sdr::overlay::OverlayManager >& xManager = rPageWindow.GetOverlayManager(); if(rPaintWindow.OutputToWindow() && xManager.is() ) { std::unique_ptr<sdr::overlay::OverlayObject> pOverlayObject; diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx index 45af870b9679..979b46c1c3da 100644 --- a/sd/source/ui/app/sdmod2.cxx +++ b/sd/source/ui/app/sdmod2.cxx @@ -335,7 +335,7 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo, void) break; } - OUString aURL = pURLField->GetURL(); + const OUString& aURL = pURLField->GetURL(); svtools::ColorConfig aConfig; svtools::ColorConfigEntry eEntry = diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx index 2a7dadaf9118..4562df261e59 100644 --- a/sd/source/ui/app/sdxfer.cxx +++ b/sd/source/ui/app/sdxfer.cxx @@ -179,7 +179,7 @@ void SdTransferable::CreateObjectReplacement( SdrObject* pObj ) if (pUnoCtrl && SdrInventor::FmForm == pUnoCtrl->GetObjInventor()) { - Reference< css::awt::XControlModel > xControlModel( pUnoCtrl->GetUnoControlModel() ); + const Reference< css::awt::XControlModel >& xControlModel( pUnoCtrl->GetUnoControlModel() ); if( !xControlModel.is() ) return; diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index 3bac4eee91cd..bf0169a1ee1c 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -132,7 +132,7 @@ void SdNavigatorWin::FreshTree( const SdDrawDocument* pDoc ) { SdDrawDocument* pNonConstDoc = const_cast<SdDrawDocument*>(pDoc); // const as const can... sd::DrawDocShell* pDocShell = pNonConstDoc->GetDocSh(); - OUString aDocShName( pDocShell->GetName() ); + const OUString& aDocShName( pDocShell->GetName() ); OUString aDocName = pDocShell->GetMedium()->GetName(); maTlbObjects->SetSaveTreeItemStateFlag(true); //Added by yanjun for sym2_6385 maTlbObjects->Clear(); diff --git a/sd/source/ui/dlg/tpaction.cxx b/sd/source/ui/dlg/tpaction.cxx index 5637ffd92250..93c51087aa28 100644 --- a/sd/source/ui/dlg/tpaction.cxx +++ b/sd/source/ui/dlg/tpaction.cxx @@ -220,7 +220,7 @@ void SdTPAction::Construct() } else if( pOleObj ) { - uno::Reference < embed::XEmbeddedObject > xObj = pOleObj->GetObjRef(); + const uno::Reference < embed::XEmbeddedObject >& xObj = pOleObj->GetObjRef(); if ( xObj.is() ) { bOLEAction = true; diff --git a/sd/source/ui/docshell/docshel3.cxx b/sd/source/ui/docshell/docshel3.cxx index b79cd11cf1bb..a9925bf5f13b 100644 --- a/sd/source/ui/docshell/docshel3.cxx +++ b/sd/source/ui/docshell/docshel3.cxx @@ -224,7 +224,7 @@ void DrawDocShell::Execute( SfxRequest& rReq ) case SID_GET_COLORLIST: { const SvxColorListItem* pColItem = GetItem( SID_COLOR_TABLE ); - XColorListRef pList = pColItem->GetColorList(); + const XColorListRef& pList = pColItem->GetColorList(); rReq.SetReturnValue( OfaRefItem<XColorList>( SID_GET_COLORLIST, pList ) ); } break; diff --git a/sd/source/ui/func/fubullet.cxx b/sd/source/ui/func/fubullet.cxx index 606f38c0b94f..81dc443b5a7c 100644 --- a/sd/source/ui/func/fubullet.cxx +++ b/sd/source/ui/func/fubullet.cxx @@ -165,7 +165,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest const & rReq ) const SfxStringItem* pFontItem = dynamic_cast<const SfxStringItem*>( pFtItem ); if ( pFontItem ) { - OUString aFontName = pFontItem->GetValue(); + const OUString& aFontName = pFontItem->GetValue(); aFont = vcl::Font( aFontName, Size(1,1) ); } else diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx index d9b7e9c5b555..a2429c38c2f5 100644 --- a/sd/source/ui/func/fuinsert.cxx +++ b/sd/source/ui/func/fuinsert.cxx @@ -461,7 +461,7 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq ) const SfxGlobalNameItem* pNameItem = rReq.GetArg<SfxGlobalNameItem>(SID_INSERT_OBJECT); if ( nSlotId == SID_INSERT_OBJECT && pNameItem ) { - SvGlobalName aClassName = pNameItem->GetValue(); + const SvGlobalName& aClassName = pNameItem->GetValue(); xObj = mpViewShell->GetViewFrame()->GetObjectShell()-> GetEmbeddedObjectContainer().CreateEmbeddedObject( aClassName.GetByteSequence(), aName ); } diff --git a/sd/source/ui/func/fumorph.cxx b/sd/source/ui/func/fumorph.cxx index 2390e16eb828..7604ab825a6e 100644 --- a/sd/source/ui/func/fumorph.cxx +++ b/sd/source/ui/func/fumorph.cxx @@ -302,7 +302,7 @@ void FuMorph::ImpAddPolys( { while(rSmaller.count() < rBigger.count()) { - const ::basegfx::B2DPolygon aToBeCopied(rBigger.getB2DPolygon(rSmaller.count())); + const ::basegfx::B2DPolygon& aToBeCopied(rBigger.getB2DPolygon(rSmaller.count())); const ::basegfx::B2DRange aToBeCopiedPolySize(::basegfx::utils::getRange(aToBeCopied)); ::basegfx::B2DPoint aNewPoint(aToBeCopiedPolySize.getCenter()); ::basegfx::B2DPolygon aNewPoly; @@ -457,8 +457,8 @@ void FuMorph::ImpInsertPolygons( for(sal_uInt32 a(0); a < rPolyPolyStart.count(); a++) { - const ::basegfx::B2DPolygon aPolyStart(rPolyPolyStart.getB2DPolygon(a)); - const ::basegfx::B2DPolygon aPolyEnd(rPolyPolyEnd.getB2DPolygon(a)); + const ::basegfx::B2DPolygon& aPolyStart(rPolyPolyStart.getB2DPolygon(a)); + const ::basegfx::B2DPolygon& aPolyEnd(rPolyPolyEnd.getB2DPolygon(a)); const sal_uInt32 nCount(aPolyStart.count()); ::basegfx::B2DPolygon aNewPolygon; diff --git a/sd/source/ui/func/fuoaprms.cxx b/sd/source/ui/func/fuoaprms.cxx index 7f6f208942ff..dd3fd2c8f277 100644 --- a/sd/source/ui/func/fuoaprms.cxx +++ b/sd/source/ui/func/fuoaprms.cxx @@ -660,7 +660,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) Point aCurCenter(aCurRect.Center()); const ::basegfx::B2DPolyPolygon& rPolyPolygon = pPath->GetPathPoly(); sal_uInt32 nNoOfPolygons(rPolyPolygon.count()); - const ::basegfx::B2DPolygon aPolygon(rPolyPolygon.getB2DPolygon(nNoOfPolygons - 1)); + const ::basegfx::B2DPolygon& aPolygon(rPolyPolygon.getB2DPolygon(nNoOfPolygons - 1)); sal_uInt32 nPoints(aPolygon.count()); const ::basegfx::B2DPoint aNewB2DCenter(aPolygon.getB2DPoint(nPoints - 1)); const Point aNewCenter(FRound(aNewB2DCenter.getX()), FRound(aNewB2DCenter.getY())); diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx index 38de3444595b..286d95a8cd1a 100644 --- a/sd/source/ui/func/fuolbull.cxx +++ b/sd/source/ui/func/fuolbull.cxx @@ -213,7 +213,7 @@ void FuOutlineBullet::SetCurrentBulletsNumbering(SfxRequest& rReq) { if(nActNumLvl & nMask) { - SvxNumberFormat aFmt(aTmpRule.GetLevel(i)); + const SvxNumberFormat& aFmt(aTmpRule.GetLevel(i)); pNumRule->SetLevel(i, aFmt); } nMask <<= 1; diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx index 786730151acd..6d738f3f4240 100644 --- a/sd/source/ui/func/futext.cxx +++ b/sd/source/ui/func/futext.cxx @@ -1085,7 +1085,7 @@ void FuText::SetInEditMode(const MouseEvent& rMEvt, bool bQuickDrag) const SdrPageWindow& rPageWindow = *pPV->GetPageWindow(b); if (!rPageWindow.GetPaintWindow().OutputToWindow()) continue; - rtl::Reference< sdr::overlay::OverlayManager > xManager = rPageWindow.GetOverlayManager(); + const rtl::Reference< sdr::overlay::OverlayManager >& xManager = rPageWindow.GetOverlayManager(); if (!xManager.is()) continue; xManager->flush(); diff --git a/sd/source/ui/func/smarttag.cxx b/sd/source/ui/func/smarttag.cxx index d63f7a096eda..3468e9125ee6 100644 --- a/sd/source/ui/func/smarttag.cxx +++ b/sd/source/ui/func/smarttag.cxx @@ -217,7 +217,7 @@ bool SmartTagSet::KeyInput( const KeyEvent& rKEvt ) if( pSmartHdl ) { const_cast< SdrHdlList& >( mrView.GetHdlList() ).ResetFocusHdl(); - SmartTagReference xTag( pSmartHdl->getTag() ); + const SmartTagReference& xTag( pSmartHdl->getTag() ); select( xTag ); return true; } @@ -237,7 +237,7 @@ bool SmartTagSet::RequestHelp( const HelpEvent& rHEvt ) SmartHdl* pSmartHdl = dynamic_cast< SmartHdl* >( pHdl ); if(pSmartHdl && pSmartHdl->getTag().is() ) { - SmartTagReference xTag( pSmartHdl->getTag() ); + const SmartTagReference& xTag( pSmartHdl->getTag() ); return xTag->RequestHelp( rHEvt ); } } @@ -259,7 +259,7 @@ bool SmartTagSet::Command( const CommandEvent& rCEvt ) SmartHdl* pSmartHdl = dynamic_cast< SmartHdl* >( pHdl ); if(pSmartHdl && pSmartHdl->getTag().is() ) { - SmartTagReference xTag( pSmartHdl->getTag() ); + const SmartTagReference& xTag( pSmartHdl->getTag() ); return xTag->Command( rCEvt ); } } diff --git a/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx b/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx index af3fa0a2566e..8819704796b2 100644 --- a/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx +++ b/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx @@ -111,7 +111,7 @@ void InsertionIndicatorOverlay::Create ( const sal_Int32 nSelectionCount) { view::Layouter& rLayouter (mrSlideSorter.GetView().GetLayouter()); - std::shared_ptr<view::PageObjectLayouter> pPageObjectLayouter ( + const std::shared_ptr<view::PageObjectLayouter>& pPageObjectLayouter ( rLayouter.GetPageObjectLayouter()); std::shared_ptr<view::Theme> pTheme (mrSlideSorter.GetTheme()); const Size aOriginalPreviewSize (pPageObjectLayouter->GetPreviewSize()); diff --git a/sd/source/ui/table/TableDesignPane.cxx b/sd/source/ui/table/TableDesignPane.cxx index 3c1a0ed4e7a5..386986cea857 100644 --- a/sd/source/ui/table/TableDesignPane.cxx +++ b/sd/source/ui/table/TableDesignPane.cxx @@ -171,7 +171,7 @@ void TableDesignWidget::ApplyStyle() SfxRequest aReq( SID_TABLE_STYLE, SfxCallMode::SYNCHRON, SfxGetpApp()->GetPool() ); aReq.AppendItem( SfxStringItem( SID_TABLE_STYLE, sStyleName ) ); - rtl::Reference< sdr::SelectionController > xController( pView->getSelectionController() ); + const rtl::Reference< sdr::SelectionController >& xController( pView->getSelectionController() ); if( xController.is() ) xController->Execute( aReq ); @@ -223,7 +223,7 @@ void TableDesignWidget::ApplyOptions() SdrView* pView = mrBase.GetDrawView(); if( pView ) { - rtl::Reference< sdr::SelectionController > xController( pView->getSelectionController() ); + const rtl::Reference< sdr::SelectionController >& xController( pView->getSelectionController() ); if( xController.is() ) { xController->Execute( aReq ); diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx index 273f5839c146..b41ecc598890 100644 --- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx +++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx @@ -337,7 +337,7 @@ uno::Sequence<beans::PropertyValue> SdDrawDocument* pDoc = mxModel->GetDoc(); for( size_t i = 0; i < SAL_N_ELEMENTS( aURLPropertyNames ); i++ ) { - XPropertyListRef pList = pDoc->GetPropertyList( static_cast<XPropertyListType>(i) ); + const XPropertyListRef& pList = pDoc->GetPropertyList( static_cast<XPropertyListType>(i) ); bHasEmbed = pList.is() && pList->IsEmbedInDocument(); if( bHasEmbed ) break; @@ -359,7 +359,7 @@ uno::Sequence<beans::PropertyValue> XPropertyListType t = getTypeOfName( aConfigProps[i].Name ); aRet[i] = aConfigProps[i]; if (t != XPropertyListType::Unknown) { - XPropertyListRef pList = pDoc->GetPropertyList( t ); + const XPropertyListRef& pList = pDoc->GetPropertyList( t ); if( !pList.is() || !pList->IsEmbedInDocument() ) continue; // no change ... else diff --git a/sd/source/ui/unoidl/facreg.cxx b/sd/source/ui/unoidl/facreg.cxx index 2da5885a34d5..7b69d936ea9e 100644 --- a/sd/source/ui/unoidl/facreg.cxx +++ b/sd/source/ui/unoidl/facreg.cxx @@ -74,7 +74,7 @@ SAL_DLLPUBLIC_EXPORT void * sd_component_getFactory( uno::Reference<lang::XSingleServiceFactory> xFactory; uno::Reference<lang::XSingleComponentFactory> xComponentFactory; - std::shared_ptr<FactoryMap> pFactoryMap (GetFactoryMap()); + const std::shared_ptr<FactoryMap>& pFactoryMap (GetFactoryMap()); OUString sImplementationName (OUString::createFromAscii(pImplName)); FactoryMap::const_iterator iFactory (pFactoryMap->find(sImplementationName)); if (iFactory != pFactoryMap->end()) diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 898eeda69772..9a703bca5716 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -1834,7 +1834,7 @@ bool ImplRenderPaintProc::IsVisible( const SdrObject* pObj ) const const SdrLayer* pSdrLayer = rLayerAdmin.GetLayerPerID( nLayerId ); if ( pSdrLayer ) { - OUString aLayerName = pSdrLayer->GetName(); + const OUString& aLayerName = pSdrLayer->GetName(); bVisible = pSdrPageView->IsLayerVisible( aLayerName ); } } @@ -1849,7 +1849,7 @@ bool ImplRenderPaintProc::IsPrintable( const SdrObject* pObj ) const const SdrLayer* pSdrLayer = rLayerAdmin.GetLayerPerID( nLayerId ); if ( pSdrLayer ) { - OUString aLayerName = pSdrLayer->GetName(); + const OUString& aLayerName = pSdrLayer->GetName(); bPrintable = pSdrPageView->IsLayerPrintable( aLayerName ); } } @@ -2405,10 +2405,8 @@ OUString SdXImpressDocument::getPostIts() pPage = static_cast<SdPage*>(mpDoc->GetPage(nPage)); const sd::AnnotationVector& aPageAnnotations = pPage->getAnnotations(); - for (const auto& aPageAnnotation : aPageAnnotations) + for (const uno::Reference<office::XAnnotation>& xAnnotation : aPageAnnotations) { - uno::Reference<office::XAnnotation> xAnnotation(aPageAnnotation); - boost::property_tree::ptree aAnnotation; aAnnotation.put("id", sd::getAnnotationId(xAnnotation)); aAnnotation.put("author", xAnnotation->getAuthor()); diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx index 9d1b02e8d552..f039c3b66dad 100644 --- a/sd/source/ui/unoidl/unoobj.cxx +++ b/sd/source/ui/unoidl/unoobj.cxx @@ -649,8 +649,7 @@ void SAL_CALL SdXShape::setPropertyValue( const OUString& aPropertyName, const c } else { - uno::Any aAny( aValue ); - mpShape->_setPropertyValue(aPropertyName, aAny); + mpShape->_setPropertyValue(aPropertyName, aValue); } if( mpModel ) diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx index 51d7938f86ed..28903c556424 100644 --- a/sd/source/ui/view/drtxtob.cxx +++ b/sd/source/ui/view/drtxtob.cxx @@ -474,7 +474,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) } // paragraph justification - SvxLRSpaceItem aLR = aAttrSet.Get( EE_PARA_LRSPACE ); + const SvxLRSpaceItem& aLR = aAttrSet.Get( EE_PARA_LRSPACE ); rSet.Put(aLR); SvxAdjust eAdj = aAttrSet.Get( EE_PARA_JUST ).GetAdjust(); switch( eAdj ) diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index d6272c24ff29..f51470312c4a 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -211,7 +211,7 @@ void DrawViewShell::SelectionHasChanged() } else { - uno::Reference < embed::XEmbeddedObject > xObj = pOleObj->GetObjRef(); + const uno::Reference < embed::XEmbeddedObject >& xObj = pOleObj->GetObjRef(); if ( xObj.is() ) { rBase.SetVerbs( xObj->getSupportedVerbs() ); @@ -226,7 +226,7 @@ void DrawViewShell::SelectionHasChanged() { if ( pOleObj ) { - uno::Reference < embed::XEmbeddedObject > xObj = pOleObj->GetObjRef(); + const uno::Reference < embed::XEmbeddedObject >& xObj = pOleObj->GetObjRef(); if ( xObj.is() ) { rBase.SetVerbs( xObj->getSupportedVerbs() ); diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 7af12dbb6aa0..8366b9911579 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -279,7 +279,7 @@ private: nullptr; if (pCustomPropertyField) { - OUString aKey = pCustomPropertyField->GetName(); + const OUString& aKey = pCustomPropertyField->GetName(); if (m_aKeyCreator.isMarkingTextKey(aKey)) { OUString aValue = svx::classification::getProperty(m_xPropertyContainer, aKey); @@ -785,7 +785,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) OUString aTitle = SdResId(STR_TITLE_RENAMESLIDE); OUString aDescr = SdResId(STR_DESC_RENAMESLIDE); - OUString aPageName = pCurrentPage->GetName(); + const OUString& aPageName = pCurrentPage->GetName(); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); ScopedVclPtr<AbstractSvxNameDialog> aNameDlg(pFact->CreateSvxNameDialog(GetFrameWeld(), aPageName, aDescr)); @@ -1310,7 +1310,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) } else if (nState == RET_NO) { - GraphicObject aGraphicObject(pObj->GetGraphicObject()); + const GraphicObject& aGraphicObject(pObj->GetGraphicObject()); GraphicHelper::ExportGraphic(pFrame, aGraphicObject.GetGraphic(), ""); } } diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index f66533ea1a84..7fc676643d6d 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -1465,7 +1465,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) if ( pUnoCtrl && SdrInventor::FmForm == pUnoCtrl->GetObjInventor() ) { - uno::Reference< awt::XControlModel > xControlModel( pUnoCtrl->GetUnoControlModel() ); + const uno::Reference< awt::XControlModel >& xControlModel( pUnoCtrl->GetUnoControlModel() ); if( xControlModel.is() ) { uno::Reference< beans::XPropertySet > xPropSet( xControlModel, uno::UNO_QUERY ); diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index 796f29347eed..837b40927758 100644 --- a/sd/source/ui/view/outlview.cxx +++ b/sd/source/ui/view/outlview.cxx @@ -1668,8 +1668,7 @@ void OutlineView::OnEndPasteOrDrop( PasteOrDropInfos* pInfo ) SdStyleSheet* pStyleSheet = dynamic_cast< SdStyleSheet* >( mrOutliner.GetStyleSheet( nPara ) ); if( pStyleSheet ) { - const OUString aName( pStyleSheet->GetApiName() ); - if ( aName == "title" ) + if ( pStyleSheet->GetApiName() == "title" ) bPage = true; } } diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx index 16e083a2f8a8..c2f2abbc5c6f 100644 --- a/sd/source/ui/view/sdview2.cxx +++ b/sd/source/ui/view/sdview2.cxx @@ -349,7 +349,7 @@ void View::StartDrag( const Point& rStartPos, vcl::Window* pWindow ) if( pDrawViewShell ) { - rtl::Reference<FuPoor> xFunction( pDrawViewShell->GetCurrentFunction() ); + const rtl::Reference<FuPoor>& xFunction( pDrawViewShell->GetCurrentFunction() ); if( xFunction.is() && nullptr != dynamic_cast< const FuDraw *>( xFunction.get() ) ) static_cast<FuDraw*>(xFunction.get())->ForcePointer(); @@ -804,7 +804,7 @@ IMPL_LINK( View, ExecuteNavigatorDrop, void*, p, void ) if( pSdNavigatorDropEvent->mpTargetWindow ) aPos = pSdNavigatorDropEvent->mpTargetWindow->PixelToLogic( pSdNavigatorDropEvent->maPosPixel ); - const OUString aURL( aINetBookmark.GetURL() ); + const OUString& aURL( aINetBookmark.GetURL() ); sal_Int32 nIndex = aURL.indexOf( '#' ); if( nIndex != -1 ) aBookmark = aURL.copy( nIndex+1 ); diff --git a/sd/source/ui/view/viewoverlaymanager.cxx b/sd/source/ui/view/viewoverlaymanager.cxx index 9331b53d50f9..e774bdff8a03 100644 --- a/sd/source/ui/view/viewoverlaymanager.cxx +++ b/sd/source/ui/view/viewoverlaymanager.cxx @@ -242,7 +242,7 @@ void ImageButtonHdl::CreateB2dIAObject() const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(b); SdrPaintWindow& rPaintWindow = rPageWindow.GetPaintWindow(); - rtl::Reference< sdr::overlay::OverlayManager > xManager = rPageWindow.GetOverlayManager(); + const rtl::Reference< sdr::overlay::OverlayManager >& xManager = rPageWindow.GetOverlayManager(); if(rPaintWindow.OutputToWindow() && xManager.is() ) { std::unique_ptr<sdr::overlay::OverlayObject> pOverlayObject( |