diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-06 08:50:58 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-06 09:54:25 +0200 |
commit | 24eae7bd702f3f6dd790be7ac38ac16e9fe6a375 (patch) | |
tree | 56398264184709e84517c2e843aa3a0894cc1c51 /sw | |
parent | fad919eb0d30b2303193e1c00ba765514957652c (diff) |
clang-tidy performance-unnecessary-value-param
Change-Id: I69247498e13331f6ef84afeb242479f8fb1178a8
Reviewed-on: https://gerrit.libreoffice.org/60068
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/editsh.hxx | 6 | ||||
-rw-r--r-- | sw/inc/swscanner.hxx | 9 | ||||
-rw-r--r-- | sw/qa/extras/accessibility/accessible_relation_set.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/edit/edfcol.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/edit/edlingu.cxx | 7 | ||||
-rw-r--r-- | sw/source/core/inc/frame.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/dbg_lay.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/wsfrm.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/txtnode/txtedt.cxx | 23 | ||||
-rw-r--r-- | sw/source/filter/html/htmlatr.cxx | 20 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.hxx | 5 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8gr.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.hxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par4.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/docvw/PageBreakWin.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/inc/PageBreakWin.hxx | 2 |
16 files changed, 49 insertions, 52 deletions
diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx index b0692592213a..13617fb279df 100644 --- a/sw/inc/editsh.hxx +++ b/sw/inc/editsh.hxx @@ -785,9 +785,9 @@ public: /// Is hyphenation active somewhere else? static bool HasHyphIter(); - void HandleCorrectionError( const OUString aText, SwPosition aPos, - sal_Int32 nBegin, sal_Int32 nLen, SwPaM* pCursor, - const Point* pPt, SwRect& rSelectRect ); + void HandleCorrectionError(const OUString& aText, SwPosition aPos, sal_Int32 nBegin, + sal_Int32 nLen, SwPaM* pCursor, const Point* pPt, + SwRect& rSelectRect); css::uno::Reference< css::linguistic2::XSpellAlternatives > GetCorrection( const Point* pPt, SwRect& rSelectRect ); diff --git a/sw/inc/swscanner.hxx b/sw/inc/swscanner.hxx index 70793def9257..de273d679b8b 100644 --- a/sw/inc/swscanner.hxx +++ b/sw/inc/swscanner.hxx @@ -47,12 +47,9 @@ class SwScanner bool m_bClip; public: - SwScanner( std::function<LanguageType (sal_Int32, sal_Int32, bool)> pGetLangOfChar, - const OUString& rText, - const LanguageType* pLang, - const ModelToViewHelper& rConvMap, - sal_uInt16 nWordType, - sal_Int32 nStart, sal_Int32 nEnde, bool bClip = false ); + SwScanner(const std::function<LanguageType(sal_Int32, sal_Int32, bool)>& pGetLangOfChar, + const OUString& rText, const LanguageType* pLang, const ModelToViewHelper& rConvMap, + sal_uInt16 nWordType, sal_Int32 nStart, sal_Int32 nEnde, bool bClip = false); SwScanner( const SwTextNode& rNd, const OUString& rText, const LanguageType* pLang, const ModelToViewHelper& rConvMap, diff --git a/sw/qa/extras/accessibility/accessible_relation_set.cxx b/sw/qa/extras/accessibility/accessible_relation_set.cxx index bb283698ad02..68eb27c17ec1 100644 --- a/sw/qa/extras/accessibility/accessible_relation_set.cxx +++ b/sw/qa/extras/accessibility/accessible_relation_set.cxx @@ -43,13 +43,13 @@ class AccessibilityTools { public: static css::uno::Reference<css::accessibility::XAccessibleContext> - getAccessibleObjectForRole(css::uno::Reference<css::accessibility::XAccessible> xacc, + getAccessibleObjectForRole(const css::uno::Reference<css::accessibility::XAccessible>& xacc, sal_Int16 role); }; css::uno::Reference<css::accessibility::XAccessibleContext> AccessibilityTools::getAccessibleObjectForRole( - css::uno::Reference<css::accessibility::XAccessible> xacc, sal_Int16 role) + const css::uno::Reference<css::accessibility::XAccessible>& xacc, sal_Int16 role) { css::uno::Reference<css::accessibility::XAccessibleContext> ac = xacc->getAccessibleContext(); bool isShowing = ac->getAccessibleStateSet()->contains(AccessibleStateType::SHOWING); diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx index 43ec52565128..4666ca93aaf0 100644 --- a/sw/source/core/edit/edfcol.cxx +++ b/sw/source/core/edit/edfcol.cxx @@ -56,6 +56,7 @@ #include <sfx2/classificationhelper.hxx> #include <svx/ClassificationCommon.hxx> #include <svl/cryptosign.hxx> +#include <utility> #include <vcl/svapp.hxx> #include <vcl/weld.hxx> @@ -1269,7 +1270,7 @@ void SwEditShell::ApplyParagraphClassification(std::vector<svx::ClassificationRe uno::Reference<frame::XModel> xModel = pDocShell->GetBaseModel(); uno::Reference<text::XTextContent> xParent = SwXParagraph::CreateXParagraph(*pNode->GetDoc(), pNode); - lcl_ApplyParagraphClassification(GetDoc(), xModel, xParent, aResults); + lcl_ApplyParagraphClassification(GetDoc(), xModel, xParent, std::move(aResults)); } std::vector<svx::ClassificationResult> lcl_CollectParagraphClassification(const uno::Reference<frame::XModel>& xModel, const uno::Reference<text::XTextContent>& xParagraph) diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index 13187c6889d4..c6a28d3162e2 100644 --- a/sw/source/core/edit/edlingu.cxx +++ b/sw/source/core/edit/edlingu.cxx @@ -814,10 +814,9 @@ void SwEditShell::HyphIgnore() g_pHyphIter->ShowSelection(); } -void SwEditShell::HandleCorrectionError( - const OUString aText, SwPosition aPos, sal_Int32 nBegin, - sal_Int32 nLen, SwPaM* pCursor, - const Point* pPt, SwRect& rSelectRect ) +void SwEditShell::HandleCorrectionError(const OUString& aText, SwPosition aPos, sal_Int32 nBegin, + sal_Int32 nLen, SwPaM* pCursor, const Point* pPt, + SwRect& rSelectRect) { // save the start and end positions of the line and the starting point Push(); diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx index 5756edf07e43..e761e259b326 100644 --- a/sw/source/core/inc/frame.hxx +++ b/sw/source/core/inc/frame.hxx @@ -273,7 +273,7 @@ public: void adaptFrameAreasToTransformations(); // Modify current definitions by applying the given transformation - void transform(const basegfx::B2DHomMatrix aTransform); + void transform(const basegfx::B2DHomMatrix& aTransform); }; /** diff --git a/sw/source/core/layout/dbg_lay.cxx b/sw/source/core/layout/dbg_lay.cxx index 0b76176ff7aa..613bd5d6a73f 100644 --- a/sw/source/core/layout/dbg_lay.cxx +++ b/sw/source/core/layout/dbg_lay.cxx @@ -466,7 +466,7 @@ static void lcl_Padded(OStringBuffer& rOut, const long n, size_t length = 5) } /// output the frame as plain text. -static void lcl_FrameRect(OStringBuffer& rOut, const char* hint, const SwRect rect) +static void lcl_FrameRect(OStringBuffer& rOut, const char* hint, const SwRect& rect) { rOut.append("["); rOut.append(hint); diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index bc41904eea2c..42b6fb90d0cd 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -272,7 +272,7 @@ void TransformableSwFrame::restoreFrameAreas() } // transform by given B2DHomMatrix -void TransformableSwFrame::transform(const basegfx::B2DHomMatrix aTransform) +void TransformableSwFrame::transform(const basegfx::B2DHomMatrix& aTransform) { maFrameAreaTransformation *= aTransform; maFramePrintAreaTransformation *= aTransform; diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index 19a239c7cca8..46fe039ee514 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -738,19 +738,18 @@ SwScanner::SwScanner( const SwTextNode& rNd, const OUString& rText, { } -SwScanner::SwScanner( - std::function<LanguageType (sal_Int32, sal_Int32, bool)> const pGetLangOfChar, - const OUString& rText, - const LanguageType* pLang, const ModelToViewHelper& rConvMap, - sal_uInt16 nType, sal_Int32 nStart, sal_Int32 nEnde, bool bClp ) - : m_pGetLangOfChar( pGetLangOfChar ) +SwScanner::SwScanner(std::function<LanguageType(sal_Int32, sal_Int32, bool)> const& pGetLangOfChar, + const OUString& rText, const LanguageType* pLang, + const ModelToViewHelper& rConvMap, sal_uInt16 nType, sal_Int32 nStart, + sal_Int32 nEnde, bool bClp) + : m_pGetLangOfChar(pGetLangOfChar) , m_aPreDashReplacementText(rText) - , m_pLanguage( pLang ) - , m_ModelToView( rConvMap ) - , m_nLength( 0 ) - , m_nOverriddenDashCount( 0 ) - , m_nWordType( nType ) - , m_bClip( bClp ) + , m_pLanguage(pLang) + , m_ModelToView(rConvMap) + , m_nLength(0) + , m_nOverriddenDashCount(0) + , m_nWordType(nType) + , m_bClip(bClp) { m_nStartPos = m_nBegin = nStart; m_nEndPos = nEnde; diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index e5a8b05e993b..90587f8c3cff 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -20,6 +20,7 @@ #include <hintids.hxx> #include <com/sun/star/i18n/ScriptType.hpp> #include <comphelper/string.hxx> +#include <utility> #include <vcl/svapp.hxx> #include <vcl/wrkwin.hxx> #include <svtools/htmlout.hxx> @@ -1569,16 +1570,15 @@ const SwHTMLFormatInfo *HTMLEndPosLst::GetFormatInfo( const SwFormat& rFormat, return pFormatInfo; } -HTMLEndPosLst::HTMLEndPosLst( SwDoc *pD, SwDoc* pTempl, - boost::optional<Color> xDfltCol, bool bStyles, - sal_uLong nMode, const OUString& rText, - std::set<OUString>& rStyles ): - pDoc( pD ), - pTemplate( pTempl ), - xDfltColor( xDfltCol ), - rScriptTextStyles( rStyles ), - nHTMLMode( nMode ), - bOutStyles( bStyles ) +HTMLEndPosLst::HTMLEndPosLst(SwDoc* pD, SwDoc* pTempl, boost::optional<Color> xDfltCol, + bool bStyles, sal_uLong nMode, const OUString& rText, + std::set<OUString>& rStyles) + : pDoc(pD) + , pTemplate(pTempl) + , xDfltColor(std::move(xDfltCol)) + , rScriptTextStyles(rStyles) + , nHTMLMode(nMode) + , bOutStyles(bStyles) { sal_Int32 nEndPos = rText.getLength(); sal_Int32 nPos = 0; diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 1b96c9aab0cb..778446e79c36 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -1046,8 +1046,9 @@ public: void StartCommentOutput( const OUString& rName ); void EndCommentOutput( const OUString& rName ); void OutGrf(const ww8::Frame &rFrame); - bool TestOleNeedsGraphic(const SwAttrSet& rSet, tools::SvRef<SotStorage> const & xOleStg, - tools::SvRef<SotStorage> xObjStg, OUString const &rStorageName, SwOLENode *pOLENd); + bool TestOleNeedsGraphic(const SwAttrSet& rSet, tools::SvRef<SotStorage> const& xOleStg, + const tools::SvRef<SotStorage>& xObjStg, OUString const& rStorageName, + SwOLENode* pOLENd); virtual void AppendBookmarks( const SwTextNode& rNd, sal_Int32 nCurrentPos, sal_Int32 nLen ) override; virtual void AppendBookmark( const OUString& rName ) override; diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx index e1db0e0a33e8..3bb894d99ad2 100644 --- a/sw/source/filter/ww8/wrtww8gr.cxx +++ b/sw/source/filter/ww8/wrtww8gr.cxx @@ -92,9 +92,9 @@ void WW8Export::OutputGrfNode( const SwGrfNode& /*rNode*/ ) } } -bool WW8Export::TestOleNeedsGraphic(const SwAttrSet& rSet, - tools::SvRef<SotStorage> const & xOleStg, tools::SvRef<SotStorage> xObjStg, OUString const &rStorageName, - SwOLENode *pOLENd) +bool WW8Export::TestOleNeedsGraphic(const SwAttrSet& rSet, tools::SvRef<SotStorage> const& xOleStg, + const tools::SvRef<SotStorage>& xObjStg, + OUString const& rStorageName, SwOLENode* pOLENd) { bool bGraphicNeeded = false; SfxItemIter aIter( rSet ); diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index 64c49ba6c5a1..38bdcaa078c6 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -1886,8 +1886,8 @@ public: // really private, but can only be done public static bool GetPictGrafFromStream(Graphic& rGraphic, SvStream& rSrc); static void PicRead( SvStream *pDataStream, WW8_PIC *pPic, bool bVer67); - static bool ImportOleWMF( tools::SvRef<SotStorage> xSrc1, GDIMetaFile &rWMF, - long &rX, long &rY); + static bool ImportOleWMF(const tools::SvRef<SotStorage>& xSrc1, GDIMetaFile& rWMF, long& rX, + long& rY); static Color GetCol(sal_uInt8 nIco); SwWW8ImplReader( sal_uInt8 nVersionPara, SotStorage* pStorage, SvStream* pSt, diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx index b22115331faf..1a7370f03da9 100644 --- a/sw/source/filter/ww8/ww8par4.cxx +++ b/sw/source/filter/ww8/ww8par4.cxx @@ -309,8 +309,8 @@ SwFrameFormat* SwWW8ImplReader::ImportOle(const Graphic* pGrf, return pFormat; } -bool SwWW8ImplReader::ImportOleWMF(tools::SvRef<SotStorage> xSrc1,GDIMetaFile &rWMF, - long &rX,long &rY) +bool SwWW8ImplReader::ImportOleWMF(const tools::SvRef<SotStorage>& xSrc1, GDIMetaFile& rWMF, + long& rX, long& rY) { bool bOk = false; OLE_MFP aMfp; diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx index 7d68143d0acb..87f2b1fb442f 100644 --- a/sw/source/uibase/docvw/PageBreakWin.cxx +++ b/sw/source/uibase/docvw/PageBreakWin.cxx @@ -323,7 +323,7 @@ void SwPageBreakWin::Activate( ) MenuButton::Activate(); } -void SwPageBreakWin::UpdatePosition( boost::optional<Point> xEvtPt ) +void SwPageBreakWin::UpdatePosition(const boost::optional<Point>& xEvtPt) { if ( xEvtPt ) { diff --git a/sw/source/uibase/inc/PageBreakWin.hxx b/sw/source/uibase/inc/PageBreakWin.hxx index 5b84ee1d8a6a..e51766641b7c 100644 --- a/sw/source/uibase/inc/PageBreakWin.hxx +++ b/sw/source/uibase/inc/PageBreakWin.hxx @@ -44,7 +44,7 @@ public: virtual void MouseMove( const MouseEvent& rMEvt ) override; virtual void Activate( ) override; - void UpdatePosition( boost::optional<Point> xEvtPt = boost::optional<Point>() ); + void UpdatePosition(const boost::optional<Point>& xEvtPt = boost::optional<Point>()); virtual void ShowAll( bool bShow ) override; virtual bool Contains( const Point &rDocPt ) const override; |