[Libreoffice-commits] core.git: sdext/source sd/qa sd/source

Noel Grandin noel.grandin at collabora.co.uk
Tue Sep 12 08:33:54 UTC 2017


 sd/qa/unit/tiledrendering/tiledrendering.cxx                    |    2 
 sd/source/core/drawdoc3.cxx                                     |    2 
 sd/source/core/stlpool.cxx                                      |   28 ++--
 sd/source/filter/eppt/eppt.cxx                                  |    2 
 sd/source/filter/eppt/epptso.cxx                                |    6 -
 sd/source/ui/dlg/assclass.cxx                                   |    2 
 sd/source/ui/framework/configuration/ResourceFactoryManager.cxx |    2 
 sd/source/ui/func/fuinsfil.cxx                                  |    2 
 sd/source/ui/presenter/CanvasUpdateRequester.cxx                |    2 
 sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx                |    2 
 sd/source/ui/slideshow/slideshowimpl.cxx                        |   50 +++-----
 sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx               |    3 
 sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx          |    8 -
 sd/source/ui/slidesorter/controller/SlsAnimationFunction.cxx    |    2 
 sd/source/ui/slidesorter/controller/SlsClipboard.cxx            |    8 -
 sd/source/ui/unoidl/DrawController.cxx                          |   60 ++++------
 sd/source/ui/view/DocumentRenderer.cxx                          |    8 -
 sd/source/ui/view/Outliner.cxx                                  |    2 
 sd/source/ui/view/ViewShellManager.cxx                          |    2 
 sd/source/ui/view/WindowUpdater.cxx                             |    2 
 sd/source/ui/view/drviews2.cxx                                  |    2 
 sdext/source/minimizer/configurationaccess.cxx                  |    4 
 sdext/source/minimizer/optimizerdialogcontrols.cxx              |    4 
 sdext/source/pdfimport/sax/saxattrlist.cxx                      |    2 
 sdext/source/presenter/PresenterAccessibility.cxx               |    3 
 sdext/source/presenter/PresenterTextView.cxx                    |    4 
 sdext/source/presenter/PresenterTheme.cxx                       |   12 +-
 27 files changed, 101 insertions(+), 125 deletions(-)

New commits:
commit a185ea4ec12898574d52ebdf4a1017005745df7d
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Sep 12 09:45:17 2017 +0200

    clang-tidy modernize-use-emplace in sd
    
    Change-Id: I2e3000f7bd0f3beed8309e0e3dd18e6ed4b8feee
    Reviewed-on: https://gerrit.libreoffice.org/42184
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 7f85c8892d9e..c72b42a5ac5b 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -285,7 +285,7 @@ void SdTiledRenderingTest::callbackImpl(int nType, const char* pPayload)
         boost::property_tree::read_json(aStream, aTree);
         for (boost::property_tree::ptree::value_type& rValue : aTree.get_child("searchResultSelection"))
         {
-            m_aSearchResultSelection.push_back(rValue.second.get<std::string>("rectangles").c_str());
+            m_aSearchResultSelection.emplace_back(rValue.second.get<std::string>("rectangles").c_str());
             m_aSearchResultPart.push_back(std::atoi(rValue.second.get<std::string>("part").c_str()));
         }
     }
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index f1bdd1f78260..a2f9352fb40d 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -1595,7 +1595,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
                         pMySheet->GetItemSet().ClearItem();  // Delete all
                         pMySheet->GetItemSet().Put(pHisSheet->GetItemSet());
 
-                        aCreatedStyles.push_back( SdStyleSheetRef( static_cast< SdStyleSheet* >( pMySheet ) ) );
+                        aCreatedStyles.emplace_back( static_cast< SdStyleSheet* >( pMySheet ) );
                     }
 
                     StyleReplaceData aReplData;
diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx
index 6397dc1f5fd6..d2dcd481d1c6 100644
--- a/sd/source/core/stlpool.cxx
+++ b/sd/source/core/stlpool.cxx
@@ -680,7 +680,7 @@ void SdStyleSheetPool::CopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily
             // Also set parent relation for copied style sheets
             OUString aParent( xSheet->GetParent() );
             if( !aParent.isEmpty() )
-                aNewStyles.push_back( std::pair< rtl::Reference< SfxStyleSheetBase >, OUString >( xNewSheet, aParent ) );
+                aNewStyles.emplace_back( xNewSheet, aParent );
 
             if( !bAddToList )
             {
@@ -689,14 +689,14 @@ void SdStyleSheetPool::CopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily
             }
             xNewSheet->GetItemSet().Put( xSheet->GetItemSet() );
 
-            rCreatedSheets.push_back( SdStyleSheetRef( static_cast< SdStyleSheet* >( xNewSheet.get() ) ) );
-            aRenamedList.push_back( std::pair< OUString, OUString >( xSheet->GetName(), aName ) );
+            rCreatedSheets.emplace_back( static_cast< SdStyleSheet* >( xNewSheet.get() ) );
+            aRenamedList.emplace_back( xSheet->GetName(), aName );
         }
         else if (bAddToList)
         {
             // Add to list - used for renaming
-            rCreatedSheets.push_back( SdStyleSheetRef( static_cast< SdStyleSheet* >( pExistingSheet ) ) );
-            aRenamedList.push_back( std::pair< OUString, OUString >( xSheet->GetName(), aName ) );
+            rCreatedSheets.emplace_back( static_cast< SdStyleSheet* >( pExistingSheet ) );
+            aRenamedList.emplace_back( xSheet->GetName(), aName );
         }
     }
 
@@ -752,7 +752,7 @@ void SdStyleSheetPool::CopyLayoutSheets(const OUString& rLayoutName, SdStyleShee
                 OUString file;
                 rNewSheet.SetHelpId( file, pSourceSheet->GetHelpId( file ) );
                 rNewSheet.GetItemSet().Put(pSourceSheet->GetItemSet());
-                rCreatedSheets.push_back( SdStyleSheetRef( static_cast< SdStyleSheet* >( &rNewSheet ) ) );
+                rCreatedSheets.emplace_back( static_cast< SdStyleSheet* >( &rNewSheet ) );
             }
         }
     }
@@ -796,13 +796,13 @@ void SdStyleSheetPool::CreateLayoutSheetNames(const OUString& rLayoutName, std::
     OUString aPrefix(rLayoutName + SD_LT_SEPARATOR);
 
     for (sal_Int32 nLevel = 1; nLevel < 10; nLevel++)
-        aNameList.push_back( aPrefix + STR_LAYOUT_OUTLINE " " + OUString::number( nLevel ) );
+        aNameList.emplace_back(aPrefix + STR_LAYOUT_OUTLINE " " + OUString::number( nLevel ) );
 
-    aNameList.push_back(aPrefix + STR_LAYOUT_TITLE);
-    aNameList.push_back(aPrefix + STR_LAYOUT_SUBTITLE);
-    aNameList.push_back(aPrefix + STR_LAYOUT_NOTES);
-    aNameList.push_back(aPrefix + STR_LAYOUT_BACKGROUNDOBJECTS);
-    aNameList.push_back(aPrefix + STR_LAYOUT_BACKGROUND);
+    aNameList.emplace_back(aPrefix + STR_LAYOUT_TITLE);
+    aNameList.emplace_back(aPrefix + STR_LAYOUT_SUBTITLE);
+    aNameList.emplace_back(aPrefix + STR_LAYOUT_NOTES);
+    aNameList.emplace_back(aPrefix + STR_LAYOUT_BACKGROUNDOBJECTS);
+    aNameList.emplace_back(aPrefix + STR_LAYOUT_BACKGROUND);
 }
 
 /*************************************************************************
@@ -822,7 +822,7 @@ void SdStyleSheetPool::CreateLayoutSheetList(const OUString& rLayoutName, SdStyl
     while (pSheet)
     {
         if (pSheet->GetName().startsWith(aLayoutNameWithSep))
-            rLayoutSheets.push_back( SdStyleSheetRef( static_cast< SdStyleSheet* >( pSheet ) ) );
+            rLayoutSheets.emplace_back( static_cast< SdStyleSheet* >( pSheet ) );
         pSheet = aIter.Next();
     }
 }
@@ -1406,7 +1406,7 @@ SdStyleSheetVector SdStyleSheetPool::CreateChildList( SdStyleSheet const * pShee
         SdStyleSheet* pChild = dynamic_cast< SdStyleSheet* >( pSheet->GetListener(n) );
         if(pChild && pChild->GetParent() == pSheet->GetName())
         {
-            aResult.push_back( SdStyleSheetRef( pChild ) );
+            aResult.emplace_back( pChild );
         }
     }
 
diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx
index c9224fd7aacc..7b882ed168d0 100644
--- a/sd/source/filter/eppt/eppt.cxx
+++ b/sd/source/filter/eppt/eppt.cxx
@@ -732,7 +732,7 @@ bool PPTWriter::ImplCreateDocument()
         if ( aXName.is() )
             maSlideNameList.push_back( aXName->getName() );
         else
-            maSlideNameList.push_back( OUString() );
+            maSlideNameList.emplace_back( );
     }
     mpPptEscherEx->CloseContainer();    // EPP_SlideListWithText
 
diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx
index 5fe016dcbba7..a025423adddc 100644
--- a/sd/source/filter/eppt/epptso.cxx
+++ b/sd/source/filter/eppt/epptso.cxx
@@ -369,7 +369,7 @@ sal_uInt32 PPTWriter::ImplInsertBookmarkURL( const OUString& rBookmarkURL, const
         if ( !aRelUrl.isEmpty() )
             sBookmarkURL = aRelUrl;
     }
-    maHyperlink.push_back( EPPTHyperlink( sBookmarkURL, nType ) );
+    maHyperlink.emplace_back( sBookmarkURL, nType );
 
     mpExEmbed->WriteUInt16( 0xf )
                .WriteUInt16( EPP_ExHyperlink )
@@ -3090,7 +3090,7 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape > const & rXSha
                 awt::Size aS( 0, 0 );
                 xPropSet->getPropertyValue( "Width" ) >>= aS.Width;
                 awt::Size aM( MapSize( aS ) );
-                aColumns.push_back( std::pair< sal_Int32, sal_Int32 >( nPosition, aM.Width ) );
+                aColumns.emplace_back( nPosition, aM.Width );
                 nPosition += aM.Width;
                 if ( x == nColumnCount - 1  && nPosition != maRect.Right() )
                     maRect.Right() = nPosition;
@@ -3103,7 +3103,7 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape > const & rXSha
                 awt::Size aS( 0, 0 );
                 xPropSet->getPropertyValue( "Height" ) >>= aS.Height;
                 awt::Size aM( MapSize( aS ) );
-                aRows.push_back( std::pair< sal_Int32, sal_Int32 >( nPosition, aM.Height ) );
+                aRows.emplace_back( nPosition, aM.Height );
                 nPosition += aM.Height;
                 if ( y == nRowCount - 1 && nPosition != maRect.Bottom())
                     maRect.Bottom() = nPosition;
diff --git a/sd/source/ui/dlg/assclass.cxx b/sd/source/ui/dlg/assclass.cxx
index 286ddc08be35..b88445232a7a 100644
--- a/sd/source/ui/dlg/assclass.cxx
+++ b/sd/source/ui/dlg/assclass.cxx
@@ -40,7 +40,7 @@ bool Assistent::InsertControl(int nDestPage, vcl::Window* pUsedControl)
 
     if((nDestPage>0)&&(nDestPage<=mnPages))
     {
-        maPages[nDestPage-1].push_back(pUsedControl);
+        maPages[nDestPage-1].emplace_back(pUsedControl);
         pUsedControl->Hide();
         pUsedControl->Disable();
         return true;
diff --git a/sd/source/ui/framework/configuration/ResourceFactoryManager.cxx b/sd/source/ui/framework/configuration/ResourceFactoryManager.cxx
index 22133635c731..c6264ddef099 100644
--- a/sd/source/ui/framework/configuration/ResourceFactoryManager.cxx
+++ b/sd/source/ui/framework/configuration/ResourceFactoryManager.cxx
@@ -79,7 +79,7 @@ void ResourceFactoryManager::AddFactory (
     if (rsURL.indexOf('*') >= 0 || rsURL.indexOf('?') >= 0)
     {
         // The URL is a URL pattern not an single URL.
-        maFactoryPatternList.push_back(FactoryPatternList::value_type(rsURL, rxFactory));
+        maFactoryPatternList.emplace_back(rsURL, rxFactory);
 
 #if defined VERBOSE && VERBOSE>=1
         SAL_INFO("sd","ResourceFactoryManager::AddFactory pattern " << rsURL << std::hex << rxFactory.get());
diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx
index 210d8d95a4cd..58b13887bbe5 100644
--- a/sd/source/ui/func/fuinsfil.cxx
+++ b/sd/source/ui/func/fuinsfil.cxx
@@ -100,7 +100,7 @@ void lcl_AddFilter ( ::std::vector< FilterDesc >& rFilterDescList,
                      const std::shared_ptr<const SfxFilter>& pFilter )
 {
     if (pFilter)
-        rFilterDescList.push_back( ::std::make_pair( pFilter->GetUIName(), pFilter->GetDefaultExtension() ) );
+        rFilterDescList.emplace_back( pFilter->GetUIName(), pFilter->GetDefaultExtension() );
 }
 
 }
diff --git a/sd/source/ui/presenter/CanvasUpdateRequester.cxx b/sd/source/ui/presenter/CanvasUpdateRequester.cxx
index 2517c710c1d7..e5013c5436b1 100644
--- a/sd/source/ui/presenter/CanvasUpdateRequester.cxx
+++ b/sd/source/ui/presenter/CanvasUpdateRequester.cxx
@@ -76,7 +76,7 @@ std::shared_ptr<CanvasUpdateRequester> CanvasUpdateRequester::Instance (
     // No requester for the given canvas found.  Create a new one.
     std::shared_ptr<CanvasUpdateRequester> pRequester (
         new CanvasUpdateRequester(rxSharedCanvas), Deleter());
-    s_RequesterMap.push_back(std::make_pair(rxSharedCanvas, pRequester));
+    s_RequesterMap.emplace_back(rxSharedCanvas, pRequester);
     return pRequester;
 }
 
diff --git a/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx b/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx
index b38442bafa2c..639ba57386bf 100644
--- a/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx
+++ b/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx
@@ -166,7 +166,7 @@ void RecentlyUsedMasterPages::LoadPersistentValues()
                     pDescriptor->mpPreviewProvider = std::shared_ptr<PreviewProvider>(
                         new PagePreviewProvider());
                 MasterPageContainer::Token aToken (mpContainer->PutMasterPage(pDescriptor));
-                mvMasterPages.push_back(Descriptor(aToken,sURL,sName));
+                mvMasterPages.emplace_back(aToken,sURL,sName);
             }
         }
 
diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx
index 9b0e78166dcf..358b603f7c86 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -441,11 +441,10 @@ void AnimationSlideController::displayCurrentSlide( const Reference< XSlideShow
             Sequence< Any > aValue(2);
             aValue[0] <<= xSlide;
             aValue[1] <<= xAnimNode;
-            aProperties.push_back(
-                PropertyValue( "Prefetch" ,
+            aProperties.emplace_back( "Prefetch" ,
                     -1,
                     Any(aValue),
-                    PropertyState_DIRECT_VALUE));
+                    PropertyState_DIRECT_VALUE);
         }
         if (bSkipAllMainSequenceEffects)
         {
@@ -453,16 +452,14 @@ void AnimationSlideController::displayCurrentSlide( const Reference< XSlideShow
             // shown (to speed up the transition to the previous slide) and
             // one to show all main sequence effects so that the user can
             // continue to undo effects.
-            aProperties.push_back(
-                PropertyValue( "SkipAllMainSequenceEffects",
+            aProperties.emplace_back( "SkipAllMainSequenceEffects",
                     -1,
                     Any(true),
-                    PropertyState_DIRECT_VALUE));
-            aProperties.push_back(
-                PropertyValue("SkipSlideTransition",
+                    PropertyState_DIRECT_VALUE);
+            aProperties.emplace_back("SkipSlideTransition",
                     -1,
                     Any(true),
-                    PropertyState_DIRECT_VALUE));
+                    PropertyState_DIRECT_VALUE);
         }
 
         if( getSlideAPI( nCurrentSlideNumber, xSlide, xAnimNode ) )
@@ -977,47 +974,40 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings )
             std::vector<beans::PropertyValue> aProperties;
             aProperties.reserve( 4 );
 
-            aProperties.push_back(
-                beans::PropertyValue( "AdvanceOnClick" ,
+            aProperties.emplace_back( "AdvanceOnClick" ,
                     -1, Any( !maPresSettings.mbLockedPages ),
-                    beans::PropertyState_DIRECT_VALUE ) );
+                    beans::PropertyState_DIRECT_VALUE );
 
-            aProperties.push_back(
-                beans::PropertyValue( "ImageAnimationsAllowed" ,
+            aProperties.emplace_back( "ImageAnimationsAllowed" ,
                     -1, Any( maPresSettings.mbAnimationAllowed ),
-                    beans::PropertyState_DIRECT_VALUE ) );
+                    beans::PropertyState_DIRECT_VALUE );
 
             const bool bZOrderEnabled(
                 SD_MOD()->GetSdOptions( mpDoc->GetDocumentType() )->IsSlideshowRespectZOrder() );
-            aProperties.push_back(
-                beans::PropertyValue( "DisableAnimationZOrder" ,
+            aProperties.emplace_back( "DisableAnimationZOrder" ,
                     -1, Any( !bZOrderEnabled ),
-                    beans::PropertyState_DIRECT_VALUE ) );
+                    beans::PropertyState_DIRECT_VALUE );
 
-            aProperties.push_back(
-                beans::PropertyValue( "ForceManualAdvance" ,
+            aProperties.emplace_back( "ForceManualAdvance" ,
                     -1, Any( maPresSettings.mbManual ),
-                    beans::PropertyState_DIRECT_VALUE ) );
+                    beans::PropertyState_DIRECT_VALUE );
 
             if( mbUsePen )
              {
-                aProperties.push_back(
-                    beans::PropertyValue( "UserPaintColor" ,
+                aProperties.emplace_back( "UserPaintColor" ,
                         // User paint color is black by default.
                         -1, Any( mnUserPaintColor ),
-                        beans::PropertyState_DIRECT_VALUE ) );
+                        beans::PropertyState_DIRECT_VALUE );
 
-                aProperties.push_back(
-                    beans::PropertyValue( "UserPaintStrokeWidth" ,
+                aProperties.emplace_back( "UserPaintStrokeWidth" ,
                         // User paint color is black by default.
                         -1, Any( mdUserPaintStrokeWidth ),
-                        beans::PropertyState_DIRECT_VALUE ) );
+                        beans::PropertyState_DIRECT_VALUE );
             }
 
             if (mbRehearseTimings) {
-                aProperties.push_back(
-                    beans::PropertyValue( "RehearseTimings" ,
-                        -1, Any(true), beans::PropertyState_DIRECT_VALUE ) );
+                aProperties.emplace_back( "RehearseTimings" ,
+                        -1, Any(true), beans::PropertyState_DIRECT_VALUE );
             }
 
             bRet = startShowImpl( Sequence<beans::PropertyValue>(
diff --git a/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx b/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx
index ba9e1686bd76..c26da7a5cab1 100644
--- a/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx
+++ b/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx
@@ -387,8 +387,7 @@ void BitmapCache::Recycle (const BitmapCache& rCache)
         if ( ! iEntry->second.HasPreview())
             continue;
 
-        aSortedContainer.push_back(SortableBitmapContainer::value_type(
-            iEntry->first,iEntry->second));
+        aSortedContainer.emplace_back(iEntry->first,iEntry->second);
     }
 
     // Sort the remaining entries.
diff --git a/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx b/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx
index a2d93d23a48a..b5626c8ccba6 100644
--- a/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx
+++ b/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx
@@ -233,8 +233,8 @@ void PageCacheManager::Recycle (
     for (iActiveCache=mpPageCaches->begin(); iActiveCache!=mpPageCaches->end(); ++iActiveCache)
     {
         if (iActiveCache->first.mpDocument == pDocument)
-            aCaches.push_back(BestFittingPageCaches::value_type(
-                iActiveCache->first.maPreviewSize, iActiveCache->second));
+            aCaches.emplace_back(
+                iActiveCache->first.maPreviewSize, iActiveCache->second);
     }
 
     // Add bitmap caches from recently used caches.
@@ -243,8 +243,8 @@ void PageCacheManager::Recycle (
     {
         RecentlyUsedQueue::const_iterator iRecentCache;
         for (iRecentCache=iQueue->second.begin();iRecentCache!=iQueue->second.end();++iRecentCache)
-            aCaches.push_back(BestFittingPageCaches::value_type(
-                iRecentCache->maPreviewSize, iRecentCache->mpCache));
+            aCaches.emplace_back(
+                iRecentCache->maPreviewSize, iRecentCache->mpCache);
     }
 
     ::std::sort(aCaches.begin(), aCaches.end(), BestFittingCacheComparer(rPreviewSize));
diff --git a/sd/source/ui/slidesorter/controller/SlsAnimationFunction.cxx b/sd/source/ui/slidesorter/controller/SlsAnimationFunction.cxx
index 95661edd2725..3527bda5e98a 100644
--- a/sd/source/ui/slidesorter/controller/SlsAnimationFunction.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsAnimationFunction.cxx
@@ -82,7 +82,7 @@ AnimationParametricFunction::AnimationParametricFunction (const ParametricFuncti
     for (sal_Int32 nIndex=0; nIndex<nSampleCount; ++nIndex)
     {
         const double nT (nIndex/double(nSampleCount-1));
-        aPoints.push_back(basegfx::B2DPoint(rFunction(nT)));
+        aPoints.emplace_back(rFunction(nT));
     }
 
     // Interpolate at evenly spaced points.
diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
index a1985f744fe3..826ca1f60aaf 100644
--- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
@@ -424,9 +424,9 @@ void Clipboard::CreateSlideTransferable (
         if ( ! pDescriptor || pDescriptor->GetPage()==nullptr)
             continue;
         Bitmap aPreview (pPreviewCache->GetPreviewBitmap(pDescriptor->GetPage(), false));
-        aRepresentatives.push_back(TransferableData::Representative(
+        aRepresentatives.emplace_back(
             aPreview,
-            pDescriptor->HasState(model::PageDescriptor::ST_Excluded)));
+            pDescriptor->HasState(model::PageDescriptor::ST_Excluded));
         if (aRepresentatives.size() >= 3)
             break;
     }
@@ -535,9 +535,9 @@ std::shared_ptr<SdTransferable::UserData> Clipboard::CreateTransferableUserData
         if ( ! pDescriptor || pDescriptor->GetPage()==nullptr)
             break;
         Bitmap aPreview (pPreviewCache->GetPreviewBitmap(pDescriptor->GetPage(), false));
-        aRepresentatives.push_back(TransferableData::Representative(
+        aRepresentatives.emplace_back(
                 aPreview,
-                pDescriptor->HasState(model::PageDescriptor::ST_Excluded)));
+                pDescriptor->HasState(model::PageDescriptor::ST_Excluded));
 
         // Remember the page in maPagesToRemove so that it can be removed
         // when drag and drop action is "move".
diff --git a/sd/source/ui/unoidl/DrawController.cxx b/sd/source/ui/unoidl/DrawController.cxx
index 4feccd46cae4..ba6b31ebe8b5 100644
--- a/sd/source/ui/unoidl/DrawController.cxx
+++ b/sd/source/ui/unoidl/DrawController.cxx
@@ -583,69 +583,57 @@ sal_Int64 SAL_CALL DrawController::getSomething (const Sequence<sal_Int8>& rId)
 void DrawController::FillPropertyTable (
     ::std::vector<beans::Property>& rProperties)
 {
-    rProperties.push_back(
-        beans::Property("VisibleArea",
+    rProperties.emplace_back("VisibleArea",
             PROPERTY_WORKAREA,
             ::cppu::UnoType< css::awt::Rectangle>::get(),
-            beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY));
-    rProperties.push_back(
-        beans::Property(
+            beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY);
+    rProperties.emplace_back(
             "SubController",
             PROPERTY_SUB_CONTROLLER,
             cppu::UnoType<drawing::XDrawSubController>::get(),
-            beans::PropertyAttribute::BOUND));
-    rProperties.push_back(
-        beans::Property(
+            beans::PropertyAttribute::BOUND);
+    rProperties.emplace_back(
             "CurrentPage",
             PROPERTY_CURRENTPAGE,
             cppu::UnoType<drawing::XDrawPage>::get(),
-            beans::PropertyAttribute::BOUND ));
-    rProperties.push_back(
-        beans::Property("IsLayerMode",
+            beans::PropertyAttribute::BOUND );
+    rProperties.emplace_back("IsLayerMode",
             PROPERTY_LAYERMODE,
             cppu::UnoType<bool>::get(),
-            beans::PropertyAttribute::BOUND ));
-    rProperties.push_back(
-        beans::Property("IsMasterPageMode",
+            beans::PropertyAttribute::BOUND );
+    rProperties.emplace_back("IsMasterPageMode",
             PROPERTY_MASTERPAGEMODE,
             cppu::UnoType<bool>::get(),
-            beans::PropertyAttribute::BOUND ));
-    rProperties.push_back(
-        beans::Property("ActiveLayer",
+            beans::PropertyAttribute::BOUND );
+    rProperties.emplace_back("ActiveLayer",
             PROPERTY_ACTIVE_LAYER,
             cppu::UnoType<drawing::XLayer>::get(),
-            beans::PropertyAttribute::BOUND ));
-    rProperties.push_back(
-        beans::Property("ZoomValue",
+            beans::PropertyAttribute::BOUND );
+    rProperties.emplace_back("ZoomValue",
             PROPERTY_ZOOMVALUE,
             ::cppu::UnoType<sal_Int16>::get(),
-            beans::PropertyAttribute::BOUND ));
-    rProperties.push_back(
-        beans::Property("ZoomType",
+            beans::PropertyAttribute::BOUND );
+    rProperties.emplace_back("ZoomType",
             PROPERTY_ZOOMTYPE,
             ::cppu::UnoType<sal_Int16>::get(),
-            beans::PropertyAttribute::BOUND ));
-    rProperties.push_back(
-        beans::Property("ViewOffset",
+            beans::PropertyAttribute::BOUND );
+    rProperties.emplace_back("ViewOffset",
             PROPERTY_VIEWOFFSET,
             ::cppu::UnoType< css::awt::Point>::get(),
-            beans::PropertyAttribute::BOUND ));
-    rProperties.push_back(
-        beans::Property("DrawViewMode",
+            beans::PropertyAttribute::BOUND );
+    rProperties.emplace_back("DrawViewMode",
             PROPERTY_DRAWVIEWMODE,
             ::cppu::UnoType< css::awt::Point>::get(),
-            beans::PropertyAttribute::BOUND|beans::PropertyAttribute::READONLY|beans::PropertyAttribute::MAYBEVOID ));
+            beans::PropertyAttribute::BOUND|beans::PropertyAttribute::READONLY|beans::PropertyAttribute::MAYBEVOID );
     // add new property to update current page's acc information
-    rProperties.push_back(
-        beans::Property( "UpdateAcc",
+    rProperties.emplace_back( "UpdateAcc",
             PROPERTY_UPDATEACC,
             ::cppu::UnoType<sal_Int16>::get(),
-            beans::PropertyAttribute::BOUND ));
-    rProperties.push_back(
-        beans::Property( "PageChange",
+            beans::PropertyAttribute::BOUND );
+    rProperties.emplace_back( "PageChange",
             PROPERTY_PAGE_CHANGE,
             ::cppu::UnoType<sal_Int16>::get(),
-            beans::PropertyAttribute::BOUND ));
+            beans::PropertyAttribute::BOUND );
 }
 
 IPropertyArrayHelper & DrawController::getInfoHelper()
diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx
index fab60111657b..4cadfb2e3540 100644
--- a/sd/source/ui/view/DocumentRenderer.cxx
+++ b/sd/source/ui/view/DocumentRenderer.cxx
@@ -2034,16 +2034,16 @@ private:
             sal_uInt32 nFirstIndex = 0, nLastIndex = aPageVector.size() - 1;
 
             if( aPageVector.size() & 1 )
-                aPairVector.push_back( std::make_pair( (sal_uInt16) 65535, aPageVector[ nFirstIndex++ ] ) );
+                aPairVector.emplace_back( (sal_uInt16) 65535, aPageVector[ nFirstIndex++ ] );
             else
-                aPairVector.push_back( std::make_pair( aPageVector[ nLastIndex-- ], aPageVector[ nFirstIndex++ ] ) );
+                aPairVector.emplace_back( aPageVector[ nLastIndex-- ], aPageVector[ nFirstIndex++ ] );
 
             while( nFirstIndex < nLastIndex )
             {
                 if( nFirstIndex & 1 )
-                    aPairVector.push_back( std::make_pair( aPageVector[ nFirstIndex++ ], aPageVector[ nLastIndex-- ] ) );
+                    aPairVector.emplace_back( aPageVector[ nFirstIndex++ ], aPageVector[ nLastIndex-- ] );
                 else
-                    aPairVector.push_back( std::make_pair( aPageVector[ nLastIndex-- ], aPageVector[ nFirstIndex++ ] ) );
+                    aPairVector.emplace_back( aPageVector[ nLastIndex-- ], aPageVector[ nFirstIndex++ ] );
             }
         }
 
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index e6af2d221c9a..be8c1a9c3faa 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -1554,7 +1554,7 @@ void SdOutliner::HandleChangedSelection()
             maMarkListCopy.clear();
             maMarkListCopy.reserve (nCount);
             for (size_t i=0; i<nCount; ++i)
-                maMarkListCopy.push_back (rMarkList.GetMark(i)->GetMarkedSdrObj ());
+                maMarkListCopy.emplace_back(rMarkList.GetMark(i)->GetMarkedSdrObj ());
         }
         else
             // No marked object.  Is this case possible?
diff --git a/sd/source/ui/view/ViewShellManager.cxx b/sd/source/ui/view/ViewShellManager.cxx
index 7fd7e6a8d438..5c0dc56a4c6f 100644
--- a/sd/source/ui/view/ViewShellManager.cxx
+++ b/sd/source/ui/view/ViewShellManager.cxx
@@ -540,7 +540,7 @@ void ViewShellManager::Implementation::ActivateSubShell (
     // Add just the id of the sub shell. The actual shell is created
     // later in CreateShells().
     UpdateLock aLock (*this);
-    rList.push_back(ShellDescriptor(nId));
+    rList.emplace_back(nId);
 }
 
 void ViewShellManager::Implementation::DeactivateSubShell (
diff --git a/sd/source/ui/view/WindowUpdater.cxx b/sd/source/ui/view/WindowUpdater.cxx
index e355feb42ee6..394ad5c6c677 100644
--- a/sd/source/ui/view/WindowUpdater.cxx
+++ b/sd/source/ui/view/WindowUpdater.cxx
@@ -53,7 +53,7 @@ void WindowUpdater::RegisterWindow (vcl::Window* pWindow)
         {
             // Update the device once right now and add it to the list.
             Update (pWindow);
-            maWindowList.push_back (pWindow);
+            maWindowList.emplace_back(pWindow);
         }
     }
 }
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index cbd8088f8e8d..71da780084cf 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -806,7 +806,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
                     {
                         auto pNewSet = o3tl::make_unique<SfxItemSet>( GetDoc()->GetPool(), svl::Items<SDRATTR_TEXT_MINFRAMEHEIGHT, SDRATTR_TEXT_AUTOGROWHEIGHT>{} );
                         pNewSet->Put(pObj->GetMergedItemSet());
-                        aAttrList.push_back(std::make_pair(std::move(pNewSet), pObj->GetUserCall()));
+                        aAttrList.emplace_back(std::move(pNewSet), pObj->GetUserCall());
                     }
                 }
 
diff --git a/sdext/source/minimizer/configurationaccess.cxx b/sdext/source/minimizer/configurationaccess.cxx
index d9b58d0a7fc8..4387e9bc0df5 100644
--- a/sdext/source/minimizer/configurationaccess.cxx
+++ b/sdext/source/minimizer/configurationaccess.cxx
@@ -147,7 +147,7 @@ ConfigurationAccess::ConfigurationAccess( const Reference< uno::XComponentContex
     mxContext( rxContext )
 {
     LoadStrings();
-    maSettings.push_back( OptimizerSettings() );
+    maSettings.emplace_back( );
     maSettings.back().maName = "LastUsedSettings";
     LoadConfiguration();
     maInitialSettings = maSettings;
@@ -224,7 +224,7 @@ void ConfigurationAccess::LoadConfiguration()
                         Reference< container::XNameAccess > xTemplates( GetConfigurationNode( xRoot, aPath ), UNO_QUERY );
                         if ( xTemplates.is() )
                         {
-                            maSettings.push_back( OptimizerSettings() );
+                            maSettings.emplace_back( );
                             maSettings.back().LoadSettingsFromConfiguration( xTemplates );
                         }
                     }
diff --git a/sdext/source/minimizer/optimizerdialogcontrols.cxx b/sdext/source/minimizer/optimizerdialogcontrols.cxx
index 9c942d832b16..dd3045a3c795 100644
--- a/sdext/source/minimizer/optimizerdialogcontrols.cxx
+++ b/sdext/source/minimizer/optimizerdialogcontrols.cxx
@@ -777,7 +777,7 @@ void OptimizerDialog::UpdateControlStatesPage4()
         }
     }
     while( aSummaryStrings.size() < 3 )
-        aSummaryStrings.push_back( OUString() );
+        aSummaryStrings.emplace_back( );
     setControlProperty( "FixedText4Pg4", "Label", Any( aSummaryStrings[ 0 ] ) );
     setControlProperty( "FixedText5Pg4", "Label", Any( aSummaryStrings[ 1 ] ) );
     setControlProperty( "FixedText6Pg4", "Label", Any( aSummaryStrings[ 2 ] ) );
@@ -864,7 +864,7 @@ void OptimizerDialog::InitPage4()
     aControlList.push_back( InsertRadioButton( *this, "RadioButton0Pg4", mxItemListener, getString(  STR_APPLY_TO_CURRENT ), PAGE_POS_X + 6, PAGE_POS_Y + 78, PAGE_WIDTH - 12, 8, false, mnTabIndex++ ) );
     aControlList.push_back( InsertRadioButton( *this, "RadioButton1Pg4", mxItemListener, getString( STR_SAVE_AS ), PAGE_POS_X + 6, PAGE_POS_Y + 90, PAGE_WIDTH - 12, 8, false, mnTabIndex++ ) );
     aControlList.push_back( InsertFixedText( *this, "FixedText1Pg4", OUString(), PAGE_POS_X + 6, DIALOG_HEIGHT - 87, PAGE_WIDTH - 12, 8, true, false, mnTabIndex++ ) );
-    aControlList.push_back( "Progress" );
+    aControlList.emplace_back("Progress" );
     aControlList.push_back( InsertSeparator( *this, "Separator1Pg4", 0, PAGE_POS_X + 6, DIALOG_HEIGHT - 58, PAGE_WIDTH - 12, 1 ) );
     aControlList.push_back( InsertCheckBox(  *this, "CheckBox1Pg4", mxItemListener, getString( STR_SAVE_SETTINGS ), PAGE_POS_X + 6, DIALOG_HEIGHT - 47, 100, 8, mnTabIndex++ ) );
     aControlList.push_back( InsertComboBox(  *this, "ComboBox0Pg4", xTextListener, true, aItemList, PAGE_POS_X + 106, DIALOG_HEIGHT - 48, 100, 12, mnTabIndex++ ) );
diff --git a/sdext/source/pdfimport/sax/saxattrlist.cxx b/sdext/source/pdfimport/sax/saxattrlist.cxx
index 5b65cd9cd531..f2cf5fc16de3 100644
--- a/sdext/source/pdfimport/sax/saxattrlist.cxx
+++ b/sdext/source/pdfimport/sax/saxattrlist.cxx
@@ -32,7 +32,7 @@ SaxAttrList::SaxAttrList( const std::unordered_map< OUString, OUString, OUString
          it != rMap.end(); ++it )
     {
         m_aIndexMap[ it->first ] = m_aAttributes.size();
-        m_aAttributes.push_back( AttrEntry( it->first, it->second ) );
+        m_aAttributes.emplace_back( it->first, it->second );
     }
 }
 
diff --git a/sdext/source/presenter/PresenterAccessibility.cxx b/sdext/source/presenter/PresenterAccessibility.cxx
index a2764c1b7d2e..21ae24d542dd 100644
--- a/sdext/source/presenter/PresenterAccessibility.cxx
+++ b/sdext/source/presenter/PresenterAccessibility.cxx
@@ -1719,8 +1719,7 @@ void AccessibleNotes::SetTextView (
                 Reference<awt::XWindow>(mxContentWindow, UNO_QUERY),
                 Reference<awt::XWindow>(mxBorderWindow, UNO_QUERY));
             pParagraph->SetAccessibleParent(this);
-            aChildren.push_back(
-                rtl::Reference<PresenterAccessible::AccessibleObject>(pParagraph.get()));
+            aChildren.emplace_back(pParagraph.get());
         }
         maChildren.swap(aChildren);
         FireAccessibleEvent(AccessibleEventId::INVALIDATE_ALL_CHILDREN, Any(), Any());
diff --git a/sdext/source/presenter/PresenterTextView.cxx b/sdext/source/presenter/PresenterTextView.cxx
index 39ad5591c4b9..c6fef6764269 100644
--- a/sdext/source/presenter/PresenterTextView.cxx
+++ b/sdext/source/presenter/PresenterTextView.cxx
@@ -1057,10 +1057,10 @@ void PresenterTextParagraph::SetupCellArray (
             rpFont->mxFont->createTextLayout(aContext, nTextDirection, 0));
         css::geometry::RealRectangle2D aCharacterBox (xLayout->queryTextBounds());
 
-        maCells.push_back(Cell(
+        maCells.emplace_back(
             nPosition,
             nNewPosition-nPosition,
-            aCharacterBox.X2-aCharacterBox.X1));
+            aCharacterBox.X2-aCharacterBox.X1);
 
         nPosition = nNewPosition;
     }
diff --git a/sdext/source/presenter/PresenterTheme.cxx b/sdext/source/presenter/PresenterTheme.cxx
index 295bf8e1550d..3836838c72d9 100644
--- a/sdext/source/presenter/PresenterTheme.cxx
+++ b/sdext/source/presenter/PresenterTheme.cxx
@@ -822,12 +822,12 @@ void PaneStyleContainer::Read (
     {
         ::std::vector<OUString> aProperties;
         aProperties.reserve(6);
-        aProperties.push_back("StyleName");
-        aProperties.push_back("ParentStyle");
-        aProperties.push_back("TitleFont");
-        aProperties.push_back("InnerBorderSize");
-        aProperties.push_back("OuterBorderSize");
-        aProperties.push_back("BorderBitmapList");
+        aProperties.emplace_back("StyleName");
+        aProperties.emplace_back("ParentStyle");
+        aProperties.emplace_back("TitleFont");
+        aProperties.emplace_back("InnerBorderSize");
+        aProperties.emplace_back("OuterBorderSize");
+        aProperties.emplace_back("BorderBitmapList");
         PresenterConfigurationAccess::ForAll(
             xPaneStyleList,
             aProperties,


More information about the Libreoffice-commits mailing list