diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-23 09:47:23 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-24 08:36:27 +0200 |
commit | 645db9a2643832e29dbdf904e1cf7b323d273f86 (patch) | |
tree | bb799a9a87fb09b5d93972c6a627b1bc0b67ff85 /sw/source/ui | |
parent | 2629aac31142449312f77c5843ea209cc810acb4 (diff) |
clang-tidy performance-unnecessary-copy-init in sw
Change-Id: I515e3e8ddaee3e3ddc4bf3827fb85f3489e84539
Reviewed-on: https://gerrit.libreoffice.org/62253
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/ui')
-rw-r--r-- | sw/source/ui/chrdlg/chardlg.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/dbui/mmresultdialogs.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/index/cnttab.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/misc/bookmark.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/misc/glossary.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/misc/num.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/vba/vbaaddins.cxx | 2 |
7 files changed, 13 insertions, 13 deletions
diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx index 6ad98ca3fbf8..b83104256817 100644 --- a/sw/source/ui/chrdlg/chardlg.cxx +++ b/sw/source/ui/chrdlg/chardlg.cxx @@ -295,7 +295,7 @@ IMPL_LINK_NOARG(SwCharURLPage, InsertFileHdl, weld::Button&, void) FileDialogFlags::NONE, GetFrameWeld()); if( aDlgHelper.Execute() == ERRCODE_NONE ) { - Reference<XFilePicker3> xFP = aDlgHelper.GetFilePicker(); + const Reference<XFilePicker3>& xFP = aDlgHelper.GetFilePicker(); m_xURLED->set_text(xFP->getSelectedFiles().getConstArray()[0]); } } diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx b/sw/source/ui/dbui/mmresultdialogs.cxx index fe95b26a54ad..dfde81645aa8 100644 --- a/sw/source/ui/dbui/mmresultdialogs.cxx +++ b/sw/source/ui/dbui/mmresultdialogs.cxx @@ -230,7 +230,7 @@ SwMMResultSaveDialog::SwMMResultSaveDialog(weld::Window* pParent) // m_pSaveAsOneRB is the default, so disable m_xFromNF and m_xToNF initially. aLink.Call(*m_xSaveAsOneRB); SwView* pView = ::GetActiveView(); - std::shared_ptr<SwMailMergeConfigItem> xConfigItem = pView->GetMailMergeConfigItem(); + const std::shared_ptr<SwMailMergeConfigItem>& xConfigItem = pView->GetMailMergeConfigItem(); assert(xConfigItem); sal_Int32 nCount = xConfigItem->GetMergedDocumentCount(); m_xFromNF->set_max(nCount); @@ -319,7 +319,7 @@ void SwMMResultPrintDialog::FillInPrinterSettings() { //fill printer ListBox SwView* pView = ::GetActiveView(); - std::shared_ptr<SwMailMergeConfigItem> xConfigItem = pView->GetMailMergeConfigItem(); + const std::shared_ptr<SwMailMergeConfigItem>& xConfigItem = pView->GetMailMergeConfigItem(); const std::vector<OUString>& rPrinters = Printer::GetPrinterQueues(); unsigned int nCount = rPrinters.size(); bool bMergePrinterExists = false; @@ -352,7 +352,7 @@ void SwMMResultPrintDialog::FillInPrinterSettings() void SwMMResultEmailDialog::FillInEmailSettings() { SwView* pView = ::GetActiveView(); - std::shared_ptr<SwMailMergeConfigItem> xConfigItem = pView->GetMailMergeConfigItem(); + const std::shared_ptr<SwMailMergeConfigItem>& xConfigItem = pView->GetMailMergeConfigItem(); assert(xConfigItem); SwView* pSourceView = xConfigItem->GetSourceView(); @@ -688,7 +688,7 @@ IMPL_LINK_NOARG(SwMMResultSaveDialog, SaveOutputHdl_Impl, weld::Button&, void) IMPL_LINK(SwMMResultPrintDialog, PrinterChangeHdl_Impl, weld::ComboBox&, rBox, void) { SwView* pView = ::GetActiveView(); - std::shared_ptr<SwMailMergeConfigItem> xConfigItem = pView->GetMailMergeConfigItem(); + const std::shared_ptr<SwMailMergeConfigItem>& xConfigItem = pView->GetMailMergeConfigItem(); assert(xConfigItem); if (rBox.get_active() != -1) { diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 445c83a83006..ca883f1876bd 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -1089,7 +1089,7 @@ void SwTOXSelectTabPage::ApplyTOXDescription() } else if(TOX_AUTHORITIES == aCurType.eType) { - const OUString sBrackets(rDesc.GetAuthBrackets()); + const OUString& sBrackets(rDesc.GetAuthBrackets()); if(sBrackets.isEmpty() || sBrackets == " ") m_pBracketLB->SelectEntryPos(0); else @@ -2056,7 +2056,7 @@ void SwTOXEntryTabPage::Reset( const SfxItemSet* ) if(TOX_INDEX == aCurType.eType) { SwTOXDescription& rDesc = pTOXDlg->GetTOXDescription(aCurType); - const OUString sMainEntryCharStyle = rDesc.GetMainEntryCharStyle(); + const OUString& sMainEntryCharStyle = rDesc.GetMainEntryCharStyle(); if(!sMainEntryCharStyle.isEmpty()) { if( LISTBOX_ENTRY_NOTFOUND == diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx index 61182dae5e04..03584d8cf387 100644 --- a/sw/source/ui/misc/bookmark.cxx +++ b/sw/source/ui/misc/bookmark.cxx @@ -150,7 +150,7 @@ IMPL_LINK_NOARG(SwInsertBookmarkDlg, SelectionChangedHdl, SvTreeListBox*, void) for (sal_Int32 i = m_pBookmarksBox->GetSelectionCount(); i; i--) { sw::mark::IMark* pBookmark = static_cast<sw::mark::IMark*>(pSelected->GetUserData()); - OUString sEntryName = pBookmark->GetName(); + const OUString& sEntryName = pBookmark->GetName(); sEditBoxText.append(sEntryName); if (i > 1) sEditBoxText.append(";"); @@ -412,7 +412,7 @@ void BookmarkTable::InsertBookmark(sw::mark::IMark* pMark) OUString sHidden = "No"; if (pBookmark->IsHidden()) sHidden = "Yes"; - OUString sHideCondition = pBookmark->GetHideCondition(); + const OUString& sHideCondition = pBookmark->GetHideCondition(); OUString sPageNum = OUString::number(SwPaM(pMark->GetMarkStart()).GetPageNum()); OUString sColumnData = sPageNum + "\t" + pBookmark->GetName() + "\t" + sBookmarkNodeText + "\t" + sHidden + "\t" + sHideCondition; InsertEntryToColumn(sColumnData, TREELIST_APPEND, 0xffff, pMark); @@ -459,7 +459,7 @@ OUString BookmarkTable::GetNameProposal() while (pEntry) { sw::mark::IMark* pBookmark = static_cast<sw::mark::IMark*>(pEntry->GetUserData()); - OUString sName = pBookmark->GetName(); + const OUString& sName = pBookmark->GetName(); sal_Int32 nIndex = 0; if (sName.getToken(0, ' ', nIndex) == sDefaultBookmarkName) { diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx index 58ec33857f9c..9572219f7d6c 100644 --- a/sw/source/ui/misc/glossary.cxx +++ b/sw/source/ui/misc/glossary.cxx @@ -605,7 +605,7 @@ IMPL_LINK_NOARG(SwGlossaryDlg, BibHdl, Button*, void) { //check if at least one glossary path is write enabled SvtPathOptions aPathOpt; - const OUString sGlosPath( aPathOpt.GetAutoTextPath() ); + const OUString& sGlosPath( aPathOpt.GetAutoTextPath() ); const sal_Int32 nPaths = comphelper::string::getTokenCount(sGlosPath, ';'); bool bIsWritable = false; for(sal_Int32 nPath = 0; nPath < nPaths; nPath++) diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx index 35e763f326d6..764eec430efa 100644 --- a/sw/source/ui/misc/num.cxx +++ b/sw/source/ui/misc/num.cxx @@ -842,7 +842,7 @@ IMPL_LINK_NOARG(SwNumPositionTabPage, StandardHdl, weld::Button&, void) SwNumRule aTmpNumRule( pWrtSh->GetUniqueNumRuleName(), aNumFormat.GetPositionAndSpaceMode(), pOutlineDlg ? OUTLINE_RULE : NUM_RULE ); - SwNumFormat aTempFormat(aTmpNumRule.Get( i )); + const SwNumFormat& aTempFormat(aTmpNumRule.Get( i )); aNumFormat.SetPositionAndSpaceMode( aTempFormat.GetPositionAndSpaceMode() ); if ( aTempFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) { diff --git a/sw/source/ui/vba/vbaaddins.cxx b/sw/source/ui/vba/vbaaddins.cxx index 265f850206b8..a9c5e355bfc2 100644 --- a/sw/source/ui/vba/vbaaddins.cxx +++ b/sw/source/ui/vba/vbaaddins.cxx @@ -35,7 +35,7 @@ static uno::Reference< container::XIndexAccess > lcl_getAddinCollection( const u uno::Reference<ucb::XSimpleFileAccess3> xSFA(ucb::SimpleFileAccess::create(xContext)); SvtPathOptions aPathOpt; // FIXME: temporary the STARTUP path is located in $OO/basic3.1/program/addin - OUString aAddinPath = aPathOpt.GetAddinPath(); + const OUString& aAddinPath = aPathOpt.GetAddinPath(); SAL_INFO("sw.vba", "lcl_getAddinCollection: " << aAddinPath ); if( xSFA->isFolder( aAddinPath ) ) { |