diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-23 09:47:38 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-24 08:37:51 +0200 |
commit | f31c9f16fefd16ea434cdd68721d45bced9b78e1 (patch) | |
tree | c0c504cb4e4d41e168f7118c1baee6b4091aa51d /vcl/source | |
parent | 645db9a2643832e29dbdf904e1cf7b323d273f86 (diff) |
clang-tidy performance-unnecessary-copy-init in test..xmlscript
Change-Id: I1ae16467a8e58e8a50f59b7a140e9f8b68bde07e
Reviewed-on: https://gerrit.libreoffice.org/62254
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/control/button.cxx | 3 | ||||
-rw-r--r-- | vcl/source/control/notebookbar.cxx | 2 | ||||
-rw-r--r-- | vcl/source/filter/wmf/emfwr.cxx | 4 | ||||
-rw-r--r-- | vcl/source/filter/wmf/wmfwr.cxx | 4 | ||||
-rw-r--r-- | vcl/source/gdi/CommonSalLayout.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/bmpacc.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl2.cxx | 10 | ||||
-rw-r--r-- | vcl/source/gdi/textlayout.cxx | 2 | ||||
-rw-r--r-- | vcl/source/outdev/polygon.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/brdwin.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/dlgctrl.cxx | 2 |
11 files changed, 17 insertions, 18 deletions
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 52fe3b483573..170476de444f 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -2256,9 +2256,8 @@ void RadioButton::ImplUncheckAllOther() std::vector<VclPtr<RadioButton> > aGroup(GetRadioButtonGroup(false)); // iterate over radio button group and checked buttons - for (auto const& elem : aGroup) + for (VclPtr<RadioButton>& pWindow : aGroup) { - VclPtr<RadioButton> pWindow = elem; if ( pWindow->IsChecked() ) { pWindow->SetState( false ); diff --git a/vcl/source/control/notebookbar.cxx b/vcl/source/control/notebookbar.cxx index 5c8fed1fee15..76ebd74c3ad5 100644 --- a/vcl/source/control/notebookbar.cxx +++ b/vcl/source/control/notebookbar.cxx @@ -193,7 +193,7 @@ void NotebookBar::StateChanged(const StateChangedType nStateChange ) void NotebookBar::UpdateBackground() { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); - const BitmapEx aPersona = rStyleSettings.GetPersonaHeader(); + const BitmapEx& aPersona = rStyleSettings.GetPersonaHeader(); Wallpaper aWallpaper(aPersona); aWallpaper.SetStyle(WallpaperStyle::TopRight); if (!aPersona.IsEmpty()) diff --git a/vcl/source/filter/wmf/emfwr.cxx b/vcl/source/filter/wmf/emfwr.cxx index 914b8a8c1cd6..d03b6448a249 100644 --- a/vcl/source/filter/wmf/emfwr.cxx +++ b/vcl/source/filter/wmf/emfwr.cxx @@ -1206,7 +1206,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) case MetaActionType::EPS: { const MetaEPSAction* pA = static_cast<const MetaEPSAction*>(pAction); - const GDIMetaFile aSubstitute( pA->GetSubstitute() ); + const GDIMetaFile& aSubstitute( pA->GetSubstitute() ); for( size_t i = 0, nCount = aSubstitute.GetActionSize(); i < nCount; i++ ) { @@ -1328,7 +1328,7 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) case MetaActionType::TEXTRECT: { const MetaTextRectAction* pA = static_cast<const MetaTextRectAction*>(pAction); - const OUString aText( pA->GetText() ); + const OUString& aText( pA->GetText() ); ImplCheckTextAttr(); ImplWriteTextRecord( pA->GetRect().TopLeft(), aText, nullptr, 0 ); diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx index 9ba9c2b91161..ef3545b5f511 100644 --- a/vcl/source/filter/wmf/wmfwr.cxx +++ b/vcl/source/filter/wmf/wmfwr.cxx @@ -1398,7 +1398,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) { if( pA->GetMapMode().GetMapUnit() == MapUnit::MapRelative ) { - MapMode aMM = pA->GetMapMode(); + const MapMode& aMM = pA->GetMapMode(); Fraction aScaleX = aMM.GetScaleX(); Fraction aScaleY = aMM.GetScaleY(); @@ -1526,7 +1526,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) case MetaActionType::EPS : { const MetaEPSAction* pA = static_cast<const MetaEPSAction*>(pMA); - const GDIMetaFile aGDIMetaFile( pA->GetSubstitute() ); + const GDIMetaFile& aGDIMetaFile( pA->GetSubstitute() ); size_t nCount = aGDIMetaFile.GetActionSize(); for ( size_t i = 0; i < nCount; i++ ) diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx index 29c9ac4bbeab..cb9493f45037 100644 --- a/vcl/source/gdi/CommonSalLayout.cxx +++ b/vcl/source/gdi/CommonSalLayout.cxx @@ -70,7 +70,7 @@ GenericSalLayout::~GenericSalLayout() void GenericSalLayout::ParseFeatures(const OUString& aName) { vcl::font::FeatureParser aParser(aName); - OUString sLanguage = aParser.getLanguage(); + const OUString& sLanguage = aParser.getLanguage(); if (!sLanguage.isEmpty()) msLanguage = OUStringToOString(sLanguage, RTL_TEXTENCODING_ASCII_US); diff --git a/vcl/source/gdi/bmpacc.cxx b/vcl/source/gdi/bmpacc.cxx index d180d8600d1d..ba7a1923e4ca 100644 --- a/vcl/source/gdi/bmpacc.cxx +++ b/vcl/source/gdi/bmpacc.cxx @@ -86,7 +86,7 @@ BitmapReadAccess::BitmapReadAccess( Bitmap& rBitmap, BitmapAccessMode nMode ) : if (!mpBuffer) return; - std::shared_ptr<SalBitmap> xImpBmp = rBitmap.ImplGetSalBitmap(); + const std::shared_ptr<SalBitmap>& xImpBmp = rBitmap.ImplGetSalBitmap(); if (!xImpBmp) return; diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index 1572248e8263..660795082c94 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -265,7 +265,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa pDummyVDev->EnableOutput( false ); pDummyVDev->SetMapMode( i_rMtf.GetPrefMapMode() ); } - GDIMetaFile aMtf( i_rMtf ); + const GDIMetaFile& aMtf( i_rMtf ); for( sal_uInt32 i = 0, nCount = aMtf.GetActionSize(); i < nCount; ) { @@ -506,7 +506,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa case MetaActionType::EPS: { const MetaEPSAction* pA = static_cast<const MetaEPSAction*>(pAction); - const GDIMetaFile aSubstitute( pA->GetSubstitute() ); + const GDIMetaFile& aSubstitute( pA->GetSubstitute() ); m_rOuterFace.Push(); pDummyVDev->Push(); @@ -822,7 +822,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa case MetaActionType::BMPEX: { const MetaBmpExAction* pA = static_cast<const MetaBmpExAction*>(pAction); - BitmapEx aBitmapEx( pA->GetBitmapEx() ); + const BitmapEx& aBitmapEx( pA->GetBitmapEx() ); Size aSize( OutputDevice::LogicToLogic( aBitmapEx.GetPrefSize(), aBitmapEx.GetPrefMapMode(), pDummyVDev->GetMapMode() ) ); Graphic aGraphic = i_pOutDevData ? i_pOutDevData->GetCurrentGraphic() : Graphic(); @@ -902,7 +902,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa m_rOuterFace.SetClipRegion( basegfx::B2DPolyPolygon() ); else { - vcl::Region aReg( pA->GetRegion() ); + const vcl::Region& aReg( pA->GetRegion() ); m_rOuterFace.SetClipRegion( aReg.GetAsB2DPolyPolygon() ); } } @@ -921,7 +921,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa case MetaActionType::ISECTREGIONCLIPREGION: { const MetaISectRegionClipRegionAction* pA = static_cast<const MetaISectRegionClipRegionAction*>(pAction); - vcl::Region aReg( pA->GetRegion() ); + const vcl::Region& aReg( pA->GetRegion() ); m_rOuterFace.IntersectClipRegion( aReg.GetAsB2DPolyPolygon() ); } break; diff --git a/vcl/source/gdi/textlayout.cxx b/vcl/source/gdi/textlayout.cxx index fab85035412c..5338acc2ad5b 100644 --- a/vcl/source/gdi/textlayout.cxx +++ b/vcl/source/gdi/textlayout.cxx @@ -106,7 +106,7 @@ namespace vcl ,m_aUnzoomedPointFont( _rControl.GetUnzoomedControlPointFont() ) ,m_bRTLEnabled( _rControl.IsRTLEnabled() ) { - const Fraction aZoom( _rControl.GetZoom() ); + const Fraction& aZoom( _rControl.GetZoom() ); m_rTargetDevice.Push( PushFlags::MAPMODE | PushFlags::FONT | PushFlags::TEXTLAYOUTMODE ); MapMode aTargetMapMode( m_rTargetDevice.GetMapMode() ); diff --git a/vcl/source/outdev/polygon.cxx b/vcl/source/outdev/polygon.cxx index 567c4d58e93b..aacbe00df924 100644 --- a/vcl/source/outdev/polygon.cxx +++ b/vcl/source/outdev/polygon.cxx @@ -475,7 +475,7 @@ void OutputDevice::ImplDrawPolyPolygon( const tools::PolyPolygon& rPolyPoly, con } if( pPolyPoly->Count() == 1 ) { - const tools::Polygon rPoly = pPolyPoly->GetObject( 0 ); + const tools::Polygon& rPoly = pPolyPoly->GetObject( 0 ); sal_uInt16 nSize = rPoly.GetSize(); if( nSize >= 2 ) diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx index 418d99a04520..8e60d8a7bbfc 100644 --- a/vcl/source/window/brdwin.cxx +++ b/vcl/source/window/brdwin.cxx @@ -1782,7 +1782,7 @@ void ImplBorderWindow::Resize() long nNotebookBarHeight = mpNotebookBar->GetSizePixel().Height(); const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); - const BitmapEx aPersona = rStyleSettings.GetPersonaHeader(); + const BitmapEx& aPersona = rStyleSettings.GetPersonaHeader(); // since size of notebookbar changes, to make common persona for menubar // and notebookbar persona should be set again with changed coordinates if (!aPersona.IsEmpty()) diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx index ccfb6a17c840..261cf32b23a6 100644 --- a/vcl/source/window/dlgctrl.cxx +++ b/vcl/source/window/dlgctrl.cxx @@ -396,7 +396,7 @@ vcl::Window* ImplFindAccelWindow( vcl::Window* pParent, sal_uInt16& rIndex, sal_ sal_uInt16 i = rIndex; vcl::Window* pWindow; - uno::Reference<i18n::XCharacterClassification> const xCharClass(ImplGetCharClass()); + uno::Reference<i18n::XCharacterClassification> const& xCharClass(ImplGetCharClass()); const css::lang::Locale& rLocale = Application::GetSettings().GetUILanguageTag().getLocale(); cCharCode = xCharClass->toUpper( OUString(cCharCode), 0, 1, rLocale )[0]; |