[Libreoffice-commits] core.git: sfx2/source svgio/source svtools/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Oct 24 06:36:23 UTC 2018


 sfx2/source/appl/appcfg.cxx                   |    2 +-
 sfx2/source/appl/linkmgr2.cxx                 |    2 +-
 sfx2/source/appl/sfxhelp.cxx                  |    2 +-
 sfx2/source/control/bindings.cxx              |    2 +-
 sfx2/source/control/emojicontrol.cxx          |    2 +-
 sfx2/source/control/statcach.cxx              |    2 +-
 sfx2/source/dialog/templdlg.cxx               |    3 +--
 sfx2/source/doc/DocumentMetadataAccess.cxx    |    6 +++---
 sfx2/source/doc/docfile.cxx                   |    2 +-
 sfx2/source/doc/objmisc.cxx                   |    2 +-
 sfx2/source/doc/objserv.cxx                   |    2 +-
 sfx2/source/doc/objstor.cxx                   |    2 +-
 sfx2/source/doc/sfxbasemodel.cxx              |    6 +++---
 sfx2/source/doc/templatedlg.cxx               |    6 +++---
 sfx2/source/inet/inettbc.cxx                  |    3 +--
 sfx2/source/notebookbar/NotebookbarPopup.cxx  |    4 ++--
 sfx2/source/sidebar/ResourceManager.cxx       |    3 +--
 sfx2/source/sidebar/UnoDeck.cxx               |    2 +-
 sfx2/source/view/classificationcontroller.cxx |    2 +-
 sfx2/source/view/frame.cxx                    |    2 +-
 sfx2/source/view/lokcharthelper.cxx           |    4 ++--
 sfx2/source/view/viewfrm.cxx                  |    2 +-
 svgio/source/svgreader/svgcharacternode.cxx   |    2 +-
 svgio/source/svgreader/svgdocumenthandler.cxx |    2 +-
 svgio/source/svgreader/svgstyleattributes.cxx |    4 ++--
 svgio/source/svgreader/svgtextpathnode.cxx    |    2 +-
 svtools/source/control/ctrlbox.cxx            |    4 ++--
 27 files changed, 37 insertions(+), 40 deletions(-)

New commits:
commit 4e51d68dc3595dae8b2519e0a023c9b1ca13a8fd
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Oct 23 09:46:58 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Oct 24 08:35:56 2018 +0200

    clang-tidy performance-unnecessary-copy-init in sfx2..svtools
    
    Change-Id: I1e92472b4aaeca1eb1372bd18d10cc9e0766dc39
    Reviewed-on: https://gerrit.libreoffice.org/62251
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx
index 789852b40e4e..5abd5594baeb 100644
--- a/sfx2/source/appl/appcfg.cxx
+++ b/sfx2/source/appl/appcfg.cxx
@@ -733,7 +733,7 @@ void SfxApplication::SetOptions(const SfxItemSet &rSet)
         OUString aNoChangeStr( ' ' );
         for( sal_uInt32 nPath=0; nPath<nCount; ++nPath )
         {
-            OUString sValue = pEnumItem->GetValueTextByPos(static_cast<sal_uInt16>(nPath));
+            const OUString& sValue = pEnumItem->GetValueTextByPos(static_cast<sal_uInt16>(nPath));
             if ( sValue != aNoChangeStr )
             {
                 switch( nPath )
diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx
index 059dcb22a48b..e9665e6c5e74 100644
--- a/sfx2/source/appl/linkmgr2.cxx
+++ b/sfx2/source/appl/linkmgr2.cxx
@@ -217,7 +217,7 @@ bool LinkManager::GetDisplayNames( const SvBaseLink * pLink,
                                         OUString* pFilter )
 {
     bool bRet = false;
-    const OUString sLNm( pLink->GetLinkSourceName() );
+    const OUString& sLNm( pLink->GetLinkSourceName() );
     if( !sLNm.isEmpty() )
     {
         switch( pLink->GetObjType() )
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index 4d07364cf725..19d08453f1d7 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -691,7 +691,7 @@ static bool impl_showOnlineHelp( const OUString& rURL )
 
 static bool impl_showOfflineHelp( const OUString& rURL )
 {
-    OUString aBaseInstallPath = getHelpRootURL();
+    const OUString& aBaseInstallPath = getHelpRootURL();
     OUString const aInternal( "vnd.sun.star.help://"  );
 
     OUString aHelpLink( aBaseInstallPath + "/index.html?" );
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index 3e225cd367c6..2b2409be3369 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -1570,7 +1570,7 @@ SfxItemState SfxBindings::QueryState( sal_uInt16 nSlot, std::unique_ptr<SfxPoolI
                 else
                 {
                     css::uno::Any aAny = xBind->GetStatus().State;
-                    css::uno::Type aType = aAny.getValueType();
+                    const css::uno::Type& aType = aAny.getValueType();
 
                     if ( aType == cppu::UnoType<bool>::get() )
                     {
diff --git a/sfx2/source/control/emojicontrol.cxx b/sfx2/source/control/emojicontrol.cxx
index 635408e8d77f..12b640c191fe 100644
--- a/sfx2/source/control/emojicontrol.cxx
+++ b/sfx2/source/control/emojicontrol.cxx
@@ -160,7 +160,7 @@ IMPL_LINK_NOARG(SfxEmojiControl, ActivatePageHdl, TabControl*, void)
 
 IMPL_STATIC_LINK(SfxEmojiControl, InsertHdl, ThumbnailViewItem*, pItem, void)
 {
-    OUString sHexText = pItem->getTitle();
+    const OUString& sHexText = pItem->getTitle();
     sal_uInt32 cEmojiChar = sHexText.toUInt32(16);
 
     uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
diff --git a/sfx2/source/control/statcach.cxx b/sfx2/source/control/statcach.cxx
index db9c1e6945eb..a190168ea1ce 100644
--- a/sfx2/source/control/statcach.cxx
+++ b/sfx2/source/control/statcach.cxx
@@ -90,7 +90,7 @@ void SAL_CALL  BindDispatch_Impl::statusChanged( const css::frame::FeatureStateE
             eState = SfxItemState::DEFAULT;
             css::uno::Any aAny = aStatus.State;
 
-            css::uno::Type aType = aAny.getValueType();
+            const css::uno::Type& aType = aAny.getValueType();
             if ( aType == cppu::UnoType< bool >::get() )
             {
                 bool bTemp = false;
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 226e59ba7431..78d21ebeba20 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -1396,8 +1396,7 @@ IMPL_LINK_NOARG( SfxCommonTemplateDialog_Impl, TimeOut, Timer *, void )
             SfxTemplateItem *pState = pFamilyState[nActFamily-1].get();
             if(pState)
             {
-                const OUString aStyle(pState->GetStyleName());
-                SelectStyle(aStyle);
+                SelectStyle(pState->GetStyleName());
                 EnableDelete();
             }
         }
diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx
index 6df5505c2961..c39e525ff5e1 100644
--- a/sfx2/source/doc/DocumentMetadataAccess.cxx
+++ b/sfx2/source/doc/DocumentMetadataAccess.cxx
@@ -1073,11 +1073,11 @@ void SAL_CALL DocumentMetadataAccess::loadMetadataFromStorage(
     try {
         const ::std::vector< uno::Reference< rdf::XURI > > parts(
             getAllParts(*m_pImpl) );
-        const uno::Reference<rdf::XURI> xContentFile(
+        const uno::Reference<rdf::XURI>& xContentFile(
             getURI<rdf::URIs::ODF_CONTENTFILE>(m_pImpl->m_xContext));
-        const uno::Reference<rdf::XURI> xStylesFile(
+        const uno::Reference<rdf::XURI>& xStylesFile(
             getURI<rdf::URIs::ODF_STYLESFILE>(m_pImpl->m_xContext));
-        const uno::Reference<rdf::XURI> xMetadataFile(
+        const uno::Reference<rdf::XURI>& xMetadataFile(
             getURI<rdf::URIs::PKG_METADATAFILE>(m_pImpl->m_xContext));
         const sal_Int32 len( baseURI.getLength() );
         for (::std::vector< uno::Reference< rdf::XURI > >::const_iterator it
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index fe951607c1a5..ab0645207379 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -1564,7 +1564,7 @@ uno::Reference < embed::XStorage > SfxMedium::GetStorage( bool bCreateTempIfNo )
                 {
                     // Unpack Stream  in TempDir
                     ::utl::TempFile aTempFile;
-                    OUString          aTmpName = aTempFile.GetURL();
+                    const OUString& aTmpName = aTempFile.GetURL();
                     SvFileStream    aTmpStream( aTmpName, SFX_STREAM_READWRITE );
 
                     pStream->ReadStream( aTmpStream );
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index f96947d94970..4bcfd9118e59 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -1576,7 +1576,7 @@ vcl::Window* SfxObjectShell::GetDialogParent( SfxMedium const * pLoadingMedium )
     const SfxUnoFrameItem* pUnoItem = SfxItemSet::GetItem<SfxUnoFrameItem>(pSet, SID_FILLFRAME, false);
     if ( pUnoItem )
     {
-        uno::Reference < frame::XFrame > xFrame( pUnoItem->GetFrame() );
+        const uno::Reference < frame::XFrame >& xFrame( pUnoItem->GetFrame() );
         pWindow = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() );
     }
 
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 3874f21cd56b..ce6b1cf0666d 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -488,7 +488,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
                         {
                             // user has done some changes to DocumentInfo
                             pDocInfoItem->UpdateDocumentInfo(getDocProperties());
-                            uno::Sequence< document::CmisProperty > aNewCmisProperties =
+                            const uno::Sequence< document::CmisProperty >& aNewCmisProperties =
                                 pDocInfoItem->GetCmisProperties( );
                             if ( aNewCmisProperties.getLength( ) > 0 )
                                 xCmisDoc->updateCmisProperties( aNewCmisProperties );
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 2d00677ad01a..af28e43a7185 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2041,7 +2041,7 @@ bool SfxObjectShell::DoSaveCompleted( SfxMedium* pNewMed, bool bRegisterRecent )
             uno::Reference< frame::XModel > xModel = GetModel();
             if ( xModel.is() )
             {
-                const OUString aURL {pNewMed->GetOrigURL()};
+                const OUString& aURL {pNewMed->GetOrigURL()};
                 uno::Sequence< beans::PropertyValue > aMediaDescr;
                 TransformItems( SID_OPENDOC, *pNewMed->GetItemSet(), aMediaDescr );
                 try
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index c1953d91739c..f94a6cf18d3f 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -359,7 +359,7 @@ SfxOwnFramesLocker::SfxOwnFramesLocker( SfxObjectShell const * pObjectShell )
         try
         {
             // get vcl window related to the frame and lock it if it is still not locked
-            Reference< frame::XFrame > xFrame = rSfxFrame.GetFrameInterface();
+            const Reference< frame::XFrame >& xFrame = rSfxFrame.GetFrameInterface();
             vcl::Window* pWindow = GetVCLWindow( xFrame );
             if ( !pWindow )
                 throw RuntimeException();
@@ -1726,7 +1726,7 @@ namespace {
 
 OUString getFilterProvider( SfxMedium const & rMedium )
 {
-    std::shared_ptr<const SfxFilter> pFilter = rMedium.GetFilter();
+    const std::shared_ptr<const SfxFilter>& pFilter = rMedium.GetFilter();
     if (!pFilter)
         return OUString();
 
@@ -2856,7 +2856,7 @@ void SfxBaseModel::impl_store(  const   OUString&                   sURL
             SfxMedium* pMedium = m_pData->m_pObjectShell->GetMedium();
             if ( pMedium )
             {
-                std::shared_ptr<const SfxFilter> pFilter = pMedium->GetFilter();
+                const std::shared_ptr<const SfxFilter>& pFilter = pMedium->GetFilter();
                 if ( pFilter && aFilterName == pFilter->GetFilterName() )
                 {
                     // #i119366# - If the former file saving with password, do not trying in StoreSelf anyway...
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 2398eb635539..2d0776b7f69c 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -577,7 +577,7 @@ IMPL_LINK_NOARG(SfxTemplateManagerDlg, MoveClickHdl, Button*, void)
 
     if (aDlg.run() == RET_OK)
     {
-        OUString sCategory = aDlg.GetSelectedCategory();
+        const OUString& sCategory = aDlg.GetSelectedCategory();
         bool bIsNewCategory = aDlg.IsNewCategoryCreated();
         if(bIsNewCategory)
         {
@@ -616,7 +616,7 @@ IMPL_LINK_NOARG(SfxTemplateManagerDlg, ImportClickHdl, Button*, void)
 
     if (aDlg.run() == RET_OK)
     {
-        OUString sCategory = aDlg.GetSelectedCategory();
+        const OUString& sCategory = aDlg.GetSelectedCategory();
         bool bIsNewCategory = aDlg.IsNewCategoryCreated();
         if(bIsNewCategory)
         {
@@ -1176,7 +1176,7 @@ void SfxTemplateManagerDlg::OnCategoryDelete()
 
     if (aDlg.run() == RET_OK)
     {
-        OUString sCategory = aDlg.GetSelectedCategory();
+        const OUString& sCategory = aDlg.GetSelectedCategory();
         std::unique_ptr<weld::MessageDialog> popupDlg(Application::CreateMessageDialog(GetFrameWeld(), VclMessageType::Question, VclButtonsType::YesNo,
                                                       SfxResId(STR_QMSG_SEL_FOLDER_DELETE)));
         if (popupDlg->run() != RET_YES)
diff --git a/sfx2/source/inet/inettbc.cxx b/sfx2/source/inet/inettbc.cxx
index 4533f7083bb5..e5d63f757042 100644
--- a/sfx2/source/inet/inettbc.cxx
+++ b/sfx2/source/inet/inettbc.cxx
@@ -227,8 +227,7 @@ void SfxURLToolBoxControl_Impl::StateChanged
             }
 
             const SfxStringItem *pURL = dynamic_cast< const SfxStringItem* >(pState);
-            OUString aRep( pURL->GetValue() );
-            INetURLObject aURL( aRep );
+            INetURLObject aURL( pURL->GetValue() );
             INetProtocol eProt = aURL.GetProtocol();
             if ( eProt == INetProtocol::File )
             {
diff --git a/sfx2/source/notebookbar/NotebookbarPopup.cxx b/sfx2/source/notebookbar/NotebookbarPopup.cxx
index aa2b6e8c277a..cba325a43c56 100644
--- a/sfx2/source/notebookbar/NotebookbarPopup.cxx
+++ b/sfx2/source/notebookbar/NotebookbarPopup.cxx
@@ -18,7 +18,7 @@ NotebookbarPopup::NotebookbarPopup(const VclPtr<VclHBox>& pParent)
     get(m_pBox, "box");
     m_pBox->SetSizePixel(Size(100, 75));
     const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
-    const BitmapEx aPersona = rStyleSettings.GetPersonaHeader();
+    const BitmapEx& aPersona = rStyleSettings.GetPersonaHeader();
 
     if (!aPersona.IsEmpty())
         m_pBox->SetBackground(Wallpaper(aPersona));
@@ -120,7 +120,7 @@ void NotebookbarPopup::dispose()
 void NotebookbarPopup::ApplyBackground(vcl::Window* pWindow)
 {
     const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
-    const BitmapEx aPersona = rStyleSettings.GetPersonaHeader();
+    const BitmapEx& aPersona = rStyleSettings.GetPersonaHeader();
 
     if (!aPersona.IsEmpty())
         pWindow->SetBackground(Wallpaper(aPersona));
diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx
index 4596fef559b4..669402270691 100644
--- a/sfx2/source/sidebar/ResourceManager.cxx
+++ b/sfx2/source/sidebar/ResourceManager.cxx
@@ -194,10 +194,9 @@ const ResourceManager::DeckContextDescriptorContainer& ResourceManager::GetMatch
 const ResourceManager::PanelContextDescriptorContainer& ResourceManager::GetMatchingPanels (
                                                             PanelContextDescriptorContainer& rPanelIds,
                                                             const Context& rContext,
-                                                            const OUString& rsDeckId,
+                                                            const OUString& sDeckId,
                                                             const Reference<frame::XController>& rxController)
 {
-    OUString sDeckId(rsDeckId);
     ReadLegacyAddons(rxController);
 
     std::multimap<sal_Int32, PanelContextDescriptor> aOrderedIds;
diff --git a/sfx2/source/sidebar/UnoDeck.cxx b/sfx2/source/sidebar/UnoDeck.cxx
index 1bcc0d8f7e86..bd6dfe015e23 100644
--- a/sfx2/source/sidebar/UnoDeck.cxx
+++ b/sfx2/source/sidebar/UnoDeck.cxx
@@ -69,7 +69,7 @@ void SAL_CALL SfxUnoDeck::setTitle( const OUString& newTitle )
     if (xDeckDescriptor)
     {
         Deck* pDeck = xDeckDescriptor->mpDeck;
-        VclPtr<DeckTitleBar> pTitleBar = pDeck->GetTitleBar();
+        const VclPtr<DeckTitleBar>& pTitleBar = pDeck->GetTitleBar();
         pTitleBar->SetTitle(newTitle);
 
         xDeckDescriptor->msTitle = newTitle;
diff --git a/sfx2/source/view/classificationcontroller.cxx b/sfx2/source/view/classificationcontroller.cxx
index 56e404560f48..accb1d9d0c28 100644
--- a/sfx2/source/view/classificationcontroller.cxx
+++ b/sfx2/source/view/classificationcontroller.cxx
@@ -187,7 +187,7 @@ IMPL_LINK(ClassificationCategoriesController, SelectHdl, ListBox&, rCategory, vo
     {
         OUString aEntry = rCategory.GetSelectedEntry();
 
-        OUString aType = getCategoryType();
+        const OUString& aType = getCategoryType();
         uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence({
             {"Name", uno::makeAny(aEntry)},
             {"Type", uno::makeAny(aType)},
diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx
index 6fd9832b2b4d..c7e8c7738f5d 100644
--- a/sfx2/source/view/frame.cxx
+++ b/sfx2/source/view/frame.cxx
@@ -324,7 +324,7 @@ void SfxFrame::UpdateDescriptor( SfxObjectShell const *pDoc )
     // Mark FileOpen parameter
     SfxItemSet* pItemSet = pMed->GetItemSet();
 
-    std::shared_ptr<const SfxFilter> pFilter = pMed->GetFilter();
+    const std::shared_ptr<const SfxFilter>& pFilter = pMed->GetFilter();
     OUString aFilter;
     if ( pFilter )
         aFilter = pFilter->GetFilterName();
diff --git a/sfx2/source/view/lokcharthelper.cxx b/sfx2/source/view/lokcharthelper.cxx
index 5369b803a692..04b433c66677 100644
--- a/sfx2/source/view/lokcharthelper.cxx
+++ b/sfx2/source/view/lokcharthelper.cxx
@@ -52,7 +52,7 @@ css::uno::Reference<css::frame::XController>& LokChartHelper::GetXController()
             SfxInPlaceClient* pIPClient = mpViewShell->GetIPClient();
             if (pIPClient)
             {
-                css::uno::Reference< ::css::embed::XEmbeddedObject > xEmbObj = pIPClient->GetObject();
+                const css::uno::Reference< ::css::embed::XEmbeddedObject >& xEmbObj = pIPClient->GetObject();
                 if( xEmbObj.is() )
                 {
                     ::css::uno::Reference< ::css::chart2::XChartDocument > xChart( xEmbObj->getComponent(), uno::UNO_QUERY );
@@ -138,7 +138,7 @@ tools::Rectangle LokChartHelper::GetChartBoundingBox()
                 {
                     // In all cases, the following code fragment
                     // returns the chart bounding box in twips.
-                    MapMode aCWMapMode = pWindow->GetMapMode();
+                    const MapMode& aCWMapMode = pWindow->GetMapMode();
                     double fXScale( aCWMapMode.GetScaleX() );
                     double fYScale( aCWMapMode.GetScaleY() );
                     Point aOffset = pWindow->GetOffsetPixelFrom(*pRootWin);
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 3a0e06f02716..b12c96a2d048 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -202,7 +202,7 @@ bool IsSignPDF(const SfxObjectShellRef& xObjSh)
     SfxMedium* pMedium = xObjSh->GetMedium();
     if (pMedium && !pMedium->IsOriginallyReadOnly())
     {
-        std::shared_ptr<const SfxFilter> pFilter = pMedium->GetFilter();
+        const std::shared_ptr<const SfxFilter>& pFilter = pMedium->GetFilter();
         if (pFilter && pFilter->GetName() == "draw_pdf_import")
             return true;
     }
diff --git a/svgio/source/svgreader/svgcharacternode.cxx b/svgio/source/svgreader/svgcharacternode.cxx
index dbcf95a84f3f..70e99384b440 100644
--- a/svgio/source/svgreader/svgcharacternode.cxx
+++ b/svgio/source/svgreader/svgcharacternode.cxx
@@ -518,7 +518,7 @@ namespace svgio
                     if(pCandidate)
                     {
                         const localTextBreakupHelper alocalTextBreakupHelper(*pCandidate, rSvgTextPosition);
-                        const drawinglayer::primitive2d::Primitive2DContainer aResult(
+                        const drawinglayer::primitive2d::Primitive2DContainer& aResult(
                             alocalTextBreakupHelper.getResult());
 
                         if(!aResult.empty())
diff --git a/svgio/source/svgreader/svgdocumenthandler.cxx b/svgio/source/svgreader/svgdocumenthandler.cxx
index b9ef76de8bf2..d32534d9896e 100644
--- a/svgio/source/svgreader/svgdocumenthandler.cxx
+++ b/svgio/source/svgreader/svgdocumenthandler.cxx
@@ -507,7 +507,7 @@ namespace svgio
 
                 if(pSvgTitleDescNode && mpTarget)
                 {
-                    const OUString aText(pSvgTitleDescNode->getText());
+                    const OUString& aText(pSvgTitleDescNode->getText());
 
                     if(!aText.isEmpty())
                     {
diff --git a/svgio/source/svgreader/svgstyleattributes.cxx b/svgio/source/svgreader/svgstyleattributes.cxx
index 7780d8aa4e5f..342cca90cace 100644
--- a/svgio/source/svgreader/svgstyleattributes.cxx
+++ b/svgio/source/svgreader/svgstyleattributes.cxx
@@ -677,7 +677,7 @@ namespace svgio
                         // the geometry for a single dot
                         if(1 == rPath.count())
                         {
-                            const basegfx::B2DPolygon aSingle(rPath.getB2DPolygon(0));
+                            const basegfx::B2DPolygon& aSingle(rPath.getB2DPolygon(0));
 
                             if(2 == aSingle.count() && aSingle.getB2DPoint(0).equal(aSingle.getB2DPoint(1)))
                             {
@@ -925,7 +925,7 @@ namespace svgio
                     for (sal_uInt32 a(0); a < nSubPathCount; a++)
                     {
                         // iterate over sub-paths
-                        const basegfx::B2DPolygon aSubPolygonPath(rPath.getB2DPolygon(a));
+                        const basegfx::B2DPolygon& aSubPolygonPath(rPath.getB2DPolygon(a));
                         const sal_uInt32 nSubPolygonPointCount(aSubPolygonPath.count());
                         const bool bSubPolygonPathIsClosed(aSubPolygonPath.isClosed());
 
diff --git a/svgio/source/svgreader/svgtextpathnode.cxx b/svgio/source/svgreader/svgtextpathnode.cxx
index 6644996ee101..4e7567566317 100644
--- a/svgio/source/svgreader/svgtextpathnode.cxx
+++ b/svgio/source/svgreader/svgtextpathnode.cxx
@@ -418,7 +418,7 @@ namespace svgio
                                             fPosition,
                                             rTextStart);
 
-                                        const drawinglayer::primitive2d::Primitive2DContainer aResult(
+                                        const drawinglayer::primitive2d::Primitive2DContainer& aResult(
                                             aPathTextBreakupHelper.getResult());
 
                                         if(!aResult.empty())
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index 4a8c98c046a1..43e8bb79e8e2 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -289,7 +289,7 @@ static void lclDrawPolygon( OutputDevice& rDev, const basegfx::B2DPolygon& rPoly
 
     for ( sal_uInt32 i = 0; i < aPolygons.count( ); i++ )
     {
-        basegfx::B2DPolygon aDash = aPolygons.getB2DPolygon( i );
+        const basegfx::B2DPolygon& aDash = aPolygons.getB2DPolygon( i );
         basegfx::B2DPoint aStart = aDash.getB2DPoint( 0 );
         basegfx::B2DPoint aEnd = aDash.getB2DPoint( aDash.count() - 1 );
 
@@ -851,7 +851,7 @@ void FontNameBox::UserDraw( const UserDrawEvent& rUDEvt )
         tools::Rectangle aTextRect;
 
         // Preview the font name
-        OUString sFontName = rFontMetric.GetFamilyName();
+        const OUString& sFontName = rFontMetric.GetFamilyName();
 
         //If it shouldn't or can't draw its own name because it doesn't have the glyphs
         if (!canRenderNameOfSelectedFont(*pRenderContext))


More information about the Libreoffice-commits mailing list