summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-11-11 22:04:52 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-11-12 11:15:14 +0100
commit20d971a58727715475b3dcdd22ad568190c2fac4 (patch)
tree5b483b6dea92dc0a7e2bf4f213464c3bb54a9a33 /sd
parentde44eadeb7032c6938e0e30de4b0c906207c92a2 (diff)
clang-tidy: performance-unnecessary-copy-initialization in sd
Change-Id: I2521bc29afb9ae98d7db2fab81f93264c91c4065 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176438 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
Diffstat (limited to 'sd')
-rw-r--r--sd/source/core/CustomAnimationEffect.cxx2
-rw-r--r--sd/source/core/EffectMigration.cxx22
-rw-r--r--sd/source/core/drawdoc3.cxx6
-rw-r--r--sd/source/core/sdpage.cxx2
-rw-r--r--sd/source/filter/eppt/epptso.cxx8
-rw-r--r--sd/source/filter/html/htmlex.cxx2
-rw-r--r--sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx2
-rw-r--r--sd/source/ui/framework/configuration/ConfigurationUpdater.cxx7
8 files changed, 25 insertions, 26 deletions
diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx
index c0db269932d4..c74d384c17a8 100644
--- a/sd/source/core/CustomAnimationEffect.cxx
+++ b/sd/source/core/CustomAnimationEffect.cxx
@@ -2717,7 +2717,7 @@ void EffectSequenceHelper::setAnimateForm( const CustomAnimationTextGroupPtr& pT
if( !bAnimateForm && (aEffects.size() == 1) )
{
- CustomAnimationEffectPtr pEffect( *aIter );
+ const CustomAnimationEffectPtr& pEffect( *aIter );
pEffect->setTarget( Any( (*aIter)->getTargetShape() ) );
pEffect->setTargetSubItem( ShapeAnimationSubType::ONLY_TEXT );
pTextGroup->addEffect( pEffect );
diff --git a/sd/source/core/EffectMigration.cxx b/sd/source/core/EffectMigration.cxx
index 8acdd0681dd9..e1a880592101 100644
--- a/sd/source/core/EffectMigration.cxx
+++ b/sd/source/core/EffectMigration.cxx
@@ -832,7 +832,7 @@ void EffectMigration::SetAnimationSpeed( SvxShape* pShape, AnimationSpeed eSpeed
for( aIter = pMainSequence->getBegin(); aIter != pMainSequence->getEnd(); ++aIter )
{
- CustomAnimationEffectPtr pEffect( *aIter );
+ const CustomAnimationEffectPtr& pEffect( *aIter );
if( pEffect->getTargetShape() == xShape )
{
if( pEffect->getDuration() != 0.1 )
@@ -861,7 +861,7 @@ AnimationSpeed EffectMigration::GetAnimationSpeed( SvxShape* pShape )
});
if (aIter != pMainSequence->getEnd())
{
- CustomAnimationEffectPtr pEffect( *aIter );
+ const CustomAnimationEffectPtr& pEffect( *aIter );
fDuration = pEffect->getDuration();
}
@@ -902,7 +902,7 @@ void EffectMigration::SetDimColor( SvxShape* pShape, sal_Int32 nColor )
for( aIter = pMainSequence->getBegin(); aIter != pMainSequence->getEnd(); ++aIter )
{
- CustomAnimationEffectPtr pEffect( *aIter );
+ const CustomAnimationEffectPtr& pEffect( *aIter );
if( pEffect->getTargetShape() == xShape )
{
pEffect->setHasAfterEffect( true );
@@ -935,7 +935,7 @@ sal_Int32 EffectMigration::GetDimColor( SvxShape* pShape )
});
if (aIter != pMainSequence->getEnd())
{
- CustomAnimationEffectPtr pEffect( *aIter );
+ const CustomAnimationEffectPtr& pEffect( *aIter );
pEffect->getDimColor() >>= nColor;
}
}
@@ -964,7 +964,7 @@ void EffectMigration::SetDimHide( SvxShape* pShape, bool bDimHide )
for( aIter = pMainSequence->getBegin(); aIter != pMainSequence->getEnd(); ++aIter )
{
- CustomAnimationEffectPtr pEffect( *aIter );
+ const CustomAnimationEffectPtr& pEffect( *aIter );
if( pEffect->getTargetShape() == xShape )
{
pEffect->setHasAfterEffect( bDimHide );
@@ -997,7 +997,7 @@ bool EffectMigration::GetDimHide( SvxShape* pShape )
[&xShape](const CustomAnimationEffectPtr& pEffect) { return pEffect->getTargetShape() == xShape; });
if (aIter != pMainSequence->getEnd())
{
- CustomAnimationEffectPtr pEffect( *aIter );
+ const CustomAnimationEffectPtr& pEffect( *aIter );
bRet = pEffect->hasAfterEffect() &&
!pEffect->getDimColor().hasValue() &&
(!pEffect->IsAfterEffectOnNext());
@@ -1033,7 +1033,7 @@ void EffectMigration::SetDimPrevious( SvxShape* pShape, bool bDimPrevious )
for( aIter = pMainSequence->getBegin(); aIter != pMainSequence->getEnd(); ++aIter )
{
- CustomAnimationEffectPtr pEffect( *aIter );
+ const CustomAnimationEffectPtr& pEffect( *aIter );
if( pEffect->getTargetShape() == xShape )
{
pEffect->setHasAfterEffect( bDimPrevious );
@@ -1064,7 +1064,7 @@ bool EffectMigration::GetDimPrevious( SvxShape* pShape )
[&xShape](const CustomAnimationEffectPtr& pEffect) { return pEffect->getTargetShape() == xShape; });
if (aIter != pMainSequence->getEnd())
{
- CustomAnimationEffectPtr pEffect( *aIter );
+ const CustomAnimationEffectPtr& pEffect( *aIter );
bRet = pEffect->hasAfterEffect() &&
pEffect->getDimColor().hasValue() &&
pEffect->IsAfterEffectOnNext();
@@ -1097,7 +1097,7 @@ void EffectMigration::SetPresentationOrder( SvxShape* pShape, sal_Int32 nNewPos
EffectSequence::iterator aEnd( rSequence.end() );
for( nPos = 0; aIter != aEnd; ++aIter )
{
- CustomAnimationEffectPtr pEffect = *aIter;
+ const CustomAnimationEffectPtr& pEffect = *aIter;
if( !xCurrent.is() )
{
@@ -1210,7 +1210,7 @@ void EffectMigration::UpdateSoundEffect( SvxShape* pShape, SdAnimationInfo const
for( aIter = pMainSequence->getBegin(); aIter != pMainSequence->getEnd(); ++aIter )
{
- CustomAnimationEffectPtr pEffect( *aIter );
+ const CustomAnimationEffectPtr& pEffect( *aIter );
if( pEffect->getTargetShape() == xShape )
{
if( !aSoundFile.isEmpty() )
@@ -1248,7 +1248,7 @@ OUString EffectMigration::GetSoundFile( SvxShape* pShape )
(aSoundFile.isEmpty()) && (aIter != pMainSequence->getEnd());
++aIter )
{
- CustomAnimationEffectPtr pEffect( *aIter );
+ const CustomAnimationEffectPtr& pEffect( *aIter );
if( pEffect->getTargetShape() == xShape )
{
if( pEffect->getAudio().is() )
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index 77975328daed..82cc1611caff 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -158,7 +158,7 @@ static void lcl_IterateBookmarkPages( SdDrawDocument &rDoc, SdDrawDocument* pBoo
else
{
// fetch nPos'th entry from bookmark list, and determine master page
- OUString aBMPgName(rBookmarkList[nPos]);
+ const OUString& aBMPgName(rBookmarkList[nPos]);
bool bIsMasterPage;
sal_uInt16 nBMPage = pBookmarkDoc->GetPageByName( aBMPgName, bIsMasterPage );
@@ -664,7 +664,7 @@ bool SdDrawDocument::InsertBookmarkAsPage(
::std::vector<SdPage*> aBookmarkedPages (rBookmarkList.size(), nullptr);
for ( size_t nPos = 0, n = rBookmarkList.size(); nPos < n; ++nPos)
{
- OUString aPgName(rBookmarkList[nPos]);
+ const OUString& aPgName(rBookmarkList[nPos]);
bool bIsMasterPage;
sal_uInt16 nBMPage = pBookmarkDoc->GetPageByName( aPgName, bIsMasterPage );
@@ -687,7 +687,7 @@ bool SdDrawDocument::InsertBookmarkAsPage(
// delay renaming *after* pages are copied (might destroy source otherwise)
// don't change name if source and dest model are the same!
// avoid renaming if replacing the same page
- OUString aPgName(rBookmarkList[nPos]);
+ const OUString& aPgName(rBookmarkList[nPos]);
bool bIsMasterPage;
sal_uInt16 nPageSameName = GetPageByName(aPgName, bIsMasterPage);
if( pBookmarkDoc != this &&
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index de125de66590..ba3bbfb9d014 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -1394,7 +1394,7 @@ static void CalcAutoLayoutRectangles( SdPage const & rPage,::tools::Rectangle* r
return;
int count=0;
- Reference<XNode> layoutNode = *aIter;
+ const Reference<XNode>& layoutNode = *aIter;
Reference<XNodeList> layoutChildren = layoutNode->getChildNodes();
const int presobjsize = layoutChildren->getLength();
for( int j=0; j< presobjsize ; j++)
diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx
index a5305e60404c..ffec0145717c 100644
--- a/sd/source/filter/eppt/epptso.cxx
+++ b/sd/source/filter/eppt/epptso.cxx
@@ -87,10 +87,10 @@ sal_uInt16 PPTExBulletProvider::GetId(Graphic const & rGraphic, Size& rGraphicSi
if (!rGraphic.IsNone())
{
- Graphic aMappedGraphic, aGraphic(rGraphic);
- GraphicObject aGraphicObject(aGraphic);
- Size aPrefSize( aGraphic.GetPrefSize() );
- BitmapEx aBmpEx( aGraphic.GetBitmapEx() );
+ Graphic aMappedGraphic;
+ GraphicObject aGraphicObject(rGraphic);
+ Size aPrefSize( rGraphic.GetPrefSize() );
+ BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
if ( rGraphicSize.Width() && rGraphicSize.Height() )
{
diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx
index d64005a44710..fb9a276c58e7 100644
--- a/sd/source/filter/html/htmlex.cxx
+++ b/sd/source/filter/html/htmlex.cxx
@@ -270,7 +270,7 @@ namespace
OUString getParagraphStyle( const SdrOutliner* pOutliner, sal_Int32 nPara )
{
- SfxItemSet aParaSet( pOutliner->GetParaAttribs( nPara ) );
+ const SfxItemSet& aParaSet( pOutliner->GetParaAttribs( nPara ) );
OUString sStyle;
diff --git a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
index 2c1898d1242a..abf5a5ffb046 100644
--- a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
+++ b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx
@@ -525,7 +525,7 @@ OUString AccessibleDrawDocumentView::CreateAccessibleName()
if (xInfo.is())
{
uno::Sequence< OUString > aServices( xInfo->getSupportedServiceNames() );
- OUString sFirstService = aServices[0];
+ const OUString& sFirstService = aServices[0];
if ( sFirstService == "com.sun.star.drawing.DrawingDocumentDrawView" )
{
if( aServices.getLength() >= 2 && aServices[1] == "com.sun.star.presentation.PresentationView")
diff --git a/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx b/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx
index feea95eacc13..9a35356d99f5 100644
--- a/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx
+++ b/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx
@@ -291,7 +291,7 @@ void ConfigurationUpdater::CheckPureAnchors (
sal_Int32 nIndex (nCount-1);
while (nIndex >= 0)
{
- const Reference<XResourceId> xResourceId (aResources[nIndex]);
+ const Reference<XResourceId>& xResourceId (aResources[nIndex]);
const Reference<XResource> xResource (
mpResourceManager->GetResource(xResourceId).mxResource);
bool bDeactiveCurrentResource (false);
@@ -309,7 +309,7 @@ void ConfigurationUpdater::CheckPureAnchors (
}
else
{
- const Reference<XResourceId> xPrevResourceId (aResources[nIndex+1]);
+ const Reference<XResourceId>& xPrevResourceId (aResources[nIndex+1]);
if ( ! xPrevResourceId.is()
|| ! xPrevResourceId->isBoundTo(xResourceId, AnchorBindingMode_DIRECT))
{
@@ -325,12 +325,11 @@ void ConfigurationUpdater::CheckPureAnchors (
SAL_INFO("sd.fwk", __func__ << ": deactivating pure anchor " <<
FrameworkHelper::ResourceIdToString(xResourceId) <<
"because it has no children");
+ rResourcesToDeactivate.push_back(xResourceId);
// Erase element from current configuration.
for (sal_Int32 nI=nIndex; nI<nCount-2; ++nI)
aResourcesRange[nI] = aResources[nI+1];
nCount -= 1;
-
- rResourcesToDeactivate.push_back(xResourceId);
}
nIndex -= 1;
}