diff options
author | Noel Grandin <noel@peralex.com> | 2016-04-12 16:39:03 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-04-18 07:37:31 +0000 |
commit | 789055bc2acb4c71483fd60ea258d158bd5aec10 (patch) | |
tree | 7849de841a71f667a30b2a971ad0c3d406110396 /filter | |
parent | 150ac9cf05ed9da6a2af5bc3f820280fd853e519 (diff) |
clang-tidy performance-unnecessary-copy-initialization
probably not much performance benefit, but it sure is good at
identifying leftover intermediate variables from previous
refactorings.
Change-Id: I3ce16fe496ac2733c1cb0a35f74c0fc9193cc657
Reviewed-on: https://gerrit.libreoffice.org/24026
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/config/cache/cacheitem.cxx | 4 | ||||
-rw-r--r-- | filter/source/flash/swfwriter1.cxx | 3 | ||||
-rw-r--r-- | filter/source/msfilter/escherex.cxx | 7 | ||||
-rw-r--r-- | filter/source/msfilter/msdffimp.cxx | 4 | ||||
-rw-r--r-- | filter/source/svg/svgfontexport.cxx | 2 | ||||
-rw-r--r-- | filter/source/svg/svgreader.cxx | 5 | ||||
-rw-r--r-- | filter/source/svg/svgwriter.cxx | 18 | ||||
-rw-r--r-- | filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx | 5 |
8 files changed, 20 insertions, 28 deletions
diff --git a/filter/source/config/cache/cacheitem.cxx b/filter/source/config/cache/cacheitem.cxx index 57c69adc7399..b21d2fcea365 100644 --- a/filter/source/config/cache/cacheitem.cxx +++ b/filter/source/config/cache/cacheitem.cxx @@ -118,8 +118,8 @@ css::uno::Sequence< css::beans::PropertyValue > CacheItem::getAsPackedPropertyVa bool isSubSet(const css::uno::Any& aSubSet, const css::uno::Any& aSet ) { - css::uno::Type aT1 = aSubSet.getValueType(); - css::uno::Type aT2 = aSet.getValueType(); + const css::uno::Type& aT1 = aSubSet.getValueType(); + const css::uno::Type& aT2 = aSet.getValueType(); if (!aT1.equals(aT2)) { diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx index 2379fe71f861..05613b7c31ac 100644 --- a/filter/source/flash/swfwriter1.cxx +++ b/filter/source/flash/swfwriter1.cxx @@ -485,8 +485,7 @@ void Writer::Impl_writeText( const Point& rPos, const OUString& rText, const lon Reference < XBreakIterator > xBI( Impl_GetBreakIterator() ); if( xBI.is() ) { - const OUString oText( rText ); - nScriptType = xBI->getScriptType( oText, 0 ); + nScriptType = xBI->getScriptType( rText, 0 ); } // if the text is either right to left or complex or asian, we diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index b15cbd0e0822..c56d27a4eca2 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -1348,14 +1348,13 @@ void EscherPropertyContainer::CreateEmbeddedBitmapProperties( const OUString& rBitmapUrl, css::drawing::BitmapMode eBitmapMode ) { OUString aVndUrl( "vnd.sun.star.GraphicObject:" ); - OUString aBmpUrl( rBitmapUrl ); - sal_Int32 nIndex = aBmpUrl.indexOf( aVndUrl ); + sal_Int32 nIndex = rBitmapUrl.indexOf( aVndUrl ); if( nIndex != -1 ) { nIndex += aVndUrl.getLength(); - if( aBmpUrl.getLength() > nIndex ) + if( rBitmapUrl.getLength() > nIndex ) { - OString aUniqueId(OUStringToOString(aBmpUrl.copy(nIndex, aBmpUrl.getLength() - nIndex), RTL_TEXTENCODING_UTF8)); + OString aUniqueId(OUStringToOString(rBitmapUrl.copy(nIndex, rBitmapUrl.getLength() - nIndex), RTL_TEXTENCODING_UTF8)); bool bRetValue = ImplCreateEmbeddedBmp( aUniqueId ); if( bRetValue ) { diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 29ae6d8cb76a..43b409bd0a70 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -6564,11 +6564,11 @@ bool SvxMSDffManager::MakeContentStream( SotStorage * pStor, const GDIMetaFile & // If a not applicable MapUnit (device dependent) is used, // SV tries to guess a best match for the right value Size aSize = rMtf.GetPrefSize(); - MapMode aMMSrc = rMtf.GetPrefMapMode(); + const MapMode& aMMSrc = rMtf.GetPrefMapMode(); MapMode aMMDst( MAP_100TH_MM ); aSize = OutputDevice::LogicToLogic( aSize, aMMSrc, aMMDst ); aEle.SetSize( aSize ); - aEle.SetAspect( nAspect ); + aEle.SetAspect( nAspect ); aEle.SetAdviseFlags( nAdviseModes ); aEle.SetMtf( rMtf ); aEle.Write( *xStm ); diff --git a/filter/source/svg/svgfontexport.cxx b/filter/source/svg/svgfontexport.cxx index 121704a93738..366c673bbb79 100644 --- a/filter/source/svg/svgfontexport.cxx +++ b/filter/source/svg/svgfontexport.cxx @@ -47,7 +47,7 @@ SVGFontExport::GlyphSet& SVGFontExport::implGetGlyphSet( const vcl::Font& rFont { FontWeight eWeight( WEIGHT_NORMAL ); FontItalic eItalic( ITALIC_NONE ); - OUString aFontName( rFont.GetFamilyName() ); + const OUString& aFontName( rFont.GetFamilyName() ); sal_Int32 nNextTokenPos( 0 ); switch( rFont.GetWeight() ) diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx index 4dcde82bc265..a81b3767c012 100644 --- a/filter/source/svg/svgreader.cxx +++ b/filter/source/svg/svgreader.cxx @@ -1853,14 +1853,13 @@ struct ShapeWritingVisitor void writePathShape( rtl::Reference<SvXMLAttributeList>& xAttrs, const uno::Reference<xml::sax::XAttributeList>& xUnoAttrs, const uno::Reference<xml::dom::XElement>& xElem, - const OUString& rStyleId, + const OUString& rStyleId, const basegfx::B2DPolyPolygon& rPoly ) { // we might need to split up polypolygon into multiple path // shapes (e.g. when emulating line stroking) std::vector<basegfx::B2DPolyPolygon> aPolys(1,rPoly); State aState = maCurrState; - OUString aStyleId(rStyleId); xAttrs->Clear(); @@ -1889,7 +1888,7 @@ struct ShapeWritingVisitor fillShapeProperties(xAttrs, xElem, aBounds, - "svggraphicstyle"+aStyleId); + "svggraphicstyle"+rStyleId); // force path coordinates to 100th millimeter, after // putting polygon data at origin (ODF viewbox diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index 33d250109848..e3ea5b170319 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -1668,8 +1668,6 @@ void SVGTextWriter::implWriteTextPortion( const Point& rPos, mpContext->AddPaintAttr( COL_TRANSPARENT, aTextColor ); - OUString sTextContent = rText; - // <a> tag for link should be the innermost tag, inside <tspan> if( !mbIsPlaceholderShape && mbIsURLField && !msUrl.isEmpty() ) { @@ -1680,16 +1678,16 @@ void SVGTextWriter::implWriteTextPortion( const Point& rPos, mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrXLinkHRef, msUrl ); { SvXMLElementExport aSVGAElem( mrExport, XML_NAMESPACE_NONE, aXMLElemA, mbIWS, mbIWS ); - mrExport.GetDocHandler()->characters( sTextContent ); + mrExport.GetDocHandler()->characters( rText ); } } else { SvXMLElementExport aSVGTspanElem( mrExport, XML_NAMESPACE_NONE, aXMLElemTspan, mbIWS, mbIWS ); - mrExport.GetDocHandler()->characters( sTextContent ); + mrExport.GetDocHandler()->characters( rText ); } - mnTextWidth += mpVDev->GetTextWidth( sTextContent ); + mnTextWidth += mpVDev->GetTextWidth( rText ); } @@ -2512,16 +2510,15 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const OUString& rText, if( mbIsPlaceholderShape ) { - OUString sTextContent = rText; - bIsPlaceholderField = sTextContent.match( sPlaceholderTag ); + bIsPlaceholderField = rText.match( sPlaceholderTag ); // for a placeholder text field we export only one <text> svg element if( bIsPlaceholderField ) { OUString sCleanTextContent; static const sal_Int32 nFrom = sPlaceholderTag.getLength(); - if( sTextContent.getLength() > nFrom ) + if( rText.getLength() > nFrom ) { - sCleanTextContent = sTextContent.copy( nFrom ); + sCleanTextContent = rText.copy( nFrom ); } mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", "PlaceholderText" ); mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrX, OUString::number( aPos.X() ) ); @@ -3686,8 +3683,7 @@ void SAL_CALL SVGWriter::write( const Reference<XDocumentHandler>& rxDocHandler, ReadGDIMetaFile( aMemStm, aMtf ); - const Reference< XDocumentHandler > xDocumentHandler( rxDocHandler ); - Reference<SVGExport> pWriter(new SVGExport( mxContext, xDocumentHandler, maFilterData )); + Reference<SVGExport> pWriter(new SVGExport( mxContext, rxDocHandler, maFilterData )); pWriter->writeMtf( aMtf ); } diff --git a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx index 429fdc5f9033..d177204a726d 100644 --- a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx +++ b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx @@ -67,8 +67,8 @@ using namespace ::com::sun::star::task; bool SAL_CALL XmlFilterAdaptor::importImpl( const Sequence< css::beans::PropertyValue >& aDescriptor ) throw (RuntimeException, std::exception) { - OUString udConvertClass=msUserData[0]; - OUString udImport =msUserData[2]; + OUString udConvertClass = msUserData[0]; + const OUString sXMLImportService = msUserData[2]; sal_Int32 nSteps= 0; sal_Int32 nProgressRange = 4; @@ -80,7 +80,6 @@ bool SAL_CALL XmlFilterAdaptor::importImpl( const Sequence< css::beans::Property xStatusIndicator->start( "Loading :",nProgressRange); } - OUString sXMLImportService ( udImport ); Reference < XParser > xSaxParser = Parser::create( mxContext ); Sequence< Any > aAnys(1); |