summaryrefslogtreecommitdiff
path: root/sdext
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-10-11 18:52:02 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-10-12 08:30:14 +0200
commit2c596b694a641de1b18afb1e9a5b843df638af24 (patch)
tree74a0826108797bc62fa57677b51a670bf6bfea3e /sdext
parent4da10f6931166ddef04aa2731c52e9b401303bb3 (diff)
loplugin:moveparam in sdext
Change-Id: I46e0f73f67cffb11ab5f1cf2453450a3066eb1fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123425 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sdext')
-rw-r--r--sdext/source/pdfimport/tree/drawtreevisiting.cxx28
-rw-r--r--sdext/source/pdfimport/tree/style.cxx8
-rw-r--r--sdext/source/pdfimport/tree/style.hxx6
-rw-r--r--sdext/source/pdfimport/tree/writertreevisiting.cxx28
4 files changed, 35 insertions, 35 deletions
diff --git a/sdext/source/pdfimport/tree/drawtreevisiting.cxx b/sdext/source/pdfimport/tree/drawtreevisiting.cxx
index 436f9f532c20..ffc27c65f56c 100644
--- a/sdext/source/pdfimport/tree/drawtreevisiting.cxx
+++ b/sdext/source/pdfimport/tree/drawtreevisiting.cxx
@@ -767,7 +767,7 @@ void DrawXmlFinalizer::visit( PolyPolyElement& elem, const std::list< std::uniqu
{
PropertyMap props;
FillDashStyleProps(props, rGC.DashArray, scale);
- StyleContainer::Style style("draw:stroke-dash", props);
+ StyleContainer::Style style("draw:stroke-dash", std::move(props));
aGCProps[ "draw:stroke" ] = "dash";
aGCProps[ "draw:stroke-dash" ] =
@@ -800,8 +800,8 @@ void DrawXmlFinalizer::visit( PolyPolyElement& elem, const std::list< std::uniqu
aGCProps[ "draw:fill" ] = "none";
}
- StyleContainer::Style aStyle( "style:style", aProps );
- StyleContainer::Style aSubStyle( "style:graphic-properties", aGCProps );
+ StyleContainer::Style aStyle( "style:style", std::move(aProps) );
+ StyleContainer::Style aSubStyle( "style:graphic-properties", std::move(aGCProps) );
aStyle.SubStyles.push_back( &aSubStyle );
elem.StyleId = m_rStyleContainer.getStyleId( aStyle );
@@ -877,8 +877,8 @@ void DrawXmlFinalizer::visit( TextElement& elem, const std::list< std::unique_pt
aFontProps[ "style:text-scale" ] = getPercentString(textScale);
}
- StyleContainer::Style aStyle( "style:style", aProps );
- StyleContainer::Style aSubStyle( "style:text-properties", aFontProps );
+ StyleContainer::Style aStyle( "style:style", std::move(aProps) );
+ StyleContainer::Style aSubStyle( "style:text-properties", std::move(aFontProps) );
aStyle.SubStyles.push_back( &aSubStyle );
elem.StyleId = m_rStyleContainer.getStyleId( aStyle );
}
@@ -899,8 +899,8 @@ void DrawXmlFinalizer::visit( ParagraphElement& elem, const std::list< std::uniq
else
aParProps[ "style:writing-mode"] = "lr-tb";
- StyleContainer::Style aStyle( "style:style", aProps );
- StyleContainer::Style aSubStyle( "style:paragraph-properties", aParProps );
+ StyleContainer::Style aStyle( "style:style", std::move(aProps) );
+ StyleContainer::Style aSubStyle( "style:paragraph-properties", std::move(aParProps) );
aStyle.SubStyles.push_back( &aSubStyle );
elem.StyleId = m_rStyleContainer.getStyleId( aStyle );
@@ -931,8 +931,8 @@ void DrawXmlFinalizer::visit( FrameElement& elem, const std::list< std::unique_p
aGCProps[ "fo:padding-right" ] = "0cm";
aGCProps[ "fo:padding-bottom" ] = "0cm";
- StyleContainer::Style style1( "style:style", props1 );
- StyleContainer::Style subStyle1( "style:graphic-properties", aGCProps );
+ StyleContainer::Style style1( "style:style", std::move(props1) );
+ StyleContainer::Style subStyle1( "style:graphic-properties", std::move(aGCProps) );
style1.SubStyles.push_back(&subStyle1);
elem.StyleId = m_rStyleContainer.getStyleId(style1);
@@ -945,8 +945,8 @@ void DrawXmlFinalizer::visit( FrameElement& elem, const std::list< std::unique_p
PropertyMap textProps;
SetFontsizeProperties(textProps, elem.FontSize);
- StyleContainer::Style style2("style:style", props2);
- StyleContainer::Style subStyle2("style:text-properties", textProps);
+ StyleContainer::Style style2("style:style", std::move(props2));
+ StyleContainer::Style subStyle2("style:text-properties", std::move(textProps));
style2.SubStyles.push_back(&subStyle2);
elem.TextStyleId = m_rStyleContainer.getStyleId(style2);
}
@@ -1039,8 +1039,8 @@ void DrawXmlFinalizer::visit( PageElement& elem, const std::list< std::unique_pt
aPageLayoutProps[ "style:print-orientation" ]= elem.w < elem.h ? std::u16string_view(u"portrait") : std::u16string_view(u"landscape");
aPageLayoutProps[ "style:writing-mode" ]= "lr-tb";
- StyleContainer::Style aStyle( "style:page-layout", aPageProps);
- StyleContainer::Style aSubStyle( "style:page-layout-properties", aPageLayoutProps);
+ StyleContainer::Style aStyle( "style:page-layout", std::move(aPageProps));
+ StyleContainer::Style aSubStyle( "style:page-layout-properties", std::move(aPageLayoutProps));
aStyle.SubStyles.push_back(&aSubStyle);
sal_Int32 nPageStyle = m_rStyleContainer.impl_getStyleId( aStyle, false );
@@ -1048,7 +1048,7 @@ void DrawXmlFinalizer::visit( PageElement& elem, const std::list< std::unique_pt
OUString aMasterPageLayoutName = m_rStyleContainer.getStyleName( nPageStyle );
aPageProps[ "style:page-layout-name" ] = aMasterPageLayoutName;
- StyleContainer::Style aMPStyle( "style:master-page", aPageProps);
+ StyleContainer::Style aMPStyle( "style:master-page", std::move(aPageProps));
elem.StyleId = m_rStyleContainer.impl_getStyleId( aMPStyle,false );
diff --git a/sdext/source/pdfimport/tree/style.cxx b/sdext/source/pdfimport/tree/style.cxx
index 73a9bd936663..b1cb02a489b3 100644
--- a/sdext/source/pdfimport/tree/style.cxx
+++ b/sdext/source/pdfimport/tree/style.cxx
@@ -79,7 +79,7 @@ sal_Int32 StyleContainer::getStandardStyleId( std::string_view rName )
aProps[ "style:family" ] = OStringToOUString( rName, RTL_TEXTENCODING_UTF8 );
aProps[ "style:name" ] = "standard";
- Style aStyle( "style:style", aProps );
+ Style aStyle( "style:style", std::move(aProps) );
return getStyleId( aStyle );
}
@@ -90,7 +90,7 @@ const PropertyMap* StyleContainer::getProperties( sal_Int32 nStyleId ) const
return it != m_aIdToStyle.end() ? &(it->second.style.Properties) : nullptr;
}
-sal_Int32 StyleContainer::setProperties( sal_Int32 nStyleId, const PropertyMap& rNewProps )
+sal_Int32 StyleContainer::setProperties( sal_Int32 nStyleId, PropertyMap&& rNewProps )
{
sal_Int32 nRet = -1;
std::unordered_map< sal_Int32, RefCountedHashedStyle >::iterator it =
@@ -103,7 +103,7 @@ sal_Int32 StyleContainer::setProperties( sal_Int32 nStyleId, const PropertyMap&
// erase old hash to id mapping
m_aStyleToId.erase( it->second.style );
// change properties
- it->second.style.Properties = rNewProps;
+ it->second.style.Properties = std::move(rNewProps);
// fill in new hash to id mapping
m_aStyleToId[ it->second.style ] = nRet;
}
@@ -114,7 +114,7 @@ sal_Int32 StyleContainer::setProperties( sal_Int32 nStyleId, const PropertyMap&
// acquire new HashedStyle
HashedStyle aSearchStyle;
aSearchStyle.Name = it->second.style.Name;
- aSearchStyle.Properties = rNewProps;
+ aSearchStyle.Properties = std::move(rNewProps);
aSearchStyle.Contents = it->second.style.Contents;
aSearchStyle.ContainedElement = it->second.style.ContainedElement;
aSearchStyle.SubStyles = it->second.style.SubStyles;
diff --git a/sdext/source/pdfimport/tree/style.hxx b/sdext/source/pdfimport/tree/style.hxx
index 784249a114c4..572be241e9e8 100644
--- a/sdext/source/pdfimport/tree/style.hxx
+++ b/sdext/source/pdfimport/tree/style.hxx
@@ -45,9 +45,9 @@ namespace pdfi
Element* ContainedElement;
std::vector< Style* > SubStyles;
- Style( const OString& rName, const PropertyMap& rProps ) :
+ Style( const OString& rName, PropertyMap&& rProps ) :
Name( rName ),
- Properties( rProps ),
+ Properties( std::move(rProps) ),
ContainedElement( nullptr )
{}
};
@@ -156,7 +156,7 @@ namespace pdfi
// returns NULL for an invalid style id
const PropertyMap* getProperties( sal_Int32 nStyleId ) const;
- sal_Int32 setProperties( sal_Int32 nStyleId, const PropertyMap &rNewProps );
+ sal_Int32 setProperties( sal_Int32 nStyleId, PropertyMap&& rNewProps );
OUString getStyleName( sal_Int32 nStyle ) const;
};
}
diff --git a/sdext/source/pdfimport/tree/writertreevisiting.cxx b/sdext/source/pdfimport/tree/writertreevisiting.cxx
index 6a841e7bc57d..f8211352f771 100644
--- a/sdext/source/pdfimport/tree/writertreevisiting.cxx
+++ b/sdext/source/pdfimport/tree/writertreevisiting.cxx
@@ -859,7 +859,7 @@ void WriterXmlFinalizer::visit( PolyPolyElement& elem, const std::list< std::uni
{
PropertyMap props;
FillDashStyleProps(props, rGC.DashArray, scale);
- StyleContainer::Style style("draw:stroke-dash", props);
+ StyleContainer::Style style("draw:stroke-dash", std::move(props));
aGCProps[ "draw:stroke" ] = "dash";
aGCProps[ "draw:stroke-dash" ] =
@@ -888,8 +888,8 @@ void WriterXmlFinalizer::visit( PolyPolyElement& elem, const std::list< std::uni
aGCProps[ "draw:fill" ] = "none";
}
- StyleContainer::Style aStyle( "style:style", aProps );
- StyleContainer::Style aSubStyle( "style:graphic-properties", aGCProps );
+ StyleContainer::Style aStyle( "style:style", std::move(aProps) );
+ StyleContainer::Style aSubStyle( "style:graphic-properties", std::move(aGCProps) );
aStyle.SubStyles.push_back( &aSubStyle );
elem.StyleId = m_rStyleContainer.getStyleId( aStyle );
@@ -949,8 +949,8 @@ void WriterXmlFinalizer::visit( TextElement& elem, const std::list< std::unique_
const GraphicsContext& rGC = m_rProcessor.getGraphicsContext( elem.GCId );
aFontProps[ "fo:color" ] = getColorString( rFont.isOutline ? rGC.LineColor : rGC.FillColor );
- StyleContainer::Style aStyle( "style:style", aProps );
- StyleContainer::Style aSubStyle( "style:text-properties", aFontProps );
+ StyleContainer::Style aStyle( "style:style", std::move(aProps) );
+ StyleContainer::Style aSubStyle( "style:text-properties", std::move(aFontProps) );
aStyle.SubStyles.push_back( &aSubStyle );
elem.StyleId = m_rStyleContainer.getStyleId( aStyle );
}
@@ -1018,8 +1018,8 @@ void WriterXmlFinalizer::visit( ParagraphElement& elem, const std::list< std::un
{
PropertyMap aProps;
aProps[ "style:family" ] = "paragraph";
- StyleContainer::Style aStyle( "style:style", aProps );
- StyleContainer::Style aSubStyle( "style:paragraph-properties", aParaProps );
+ StyleContainer::Style aStyle( "style:style", std::move(aProps) );
+ StyleContainer::Style aSubStyle( "style:paragraph-properties", std::move(aParaProps) );
aStyle.SubStyles.push_back( &aSubStyle );
elem.StyleId = m_rStyleContainer.getStyleId( aStyle );
}
@@ -1047,8 +1047,8 @@ void WriterXmlFinalizer::visit( FrameElement& elem, const std::list< std::unique
aGCProps[ "fo:padding-right" ] = "0cm";
aGCProps[ "fo:padding-bottom" ] = "0cm";
- StyleContainer::Style aStyle( "style:style", aProps );
- StyleContainer::Style aSubStyle( "style:graphic-properties", aGCProps );
+ StyleContainer::Style aStyle( "style:style", std::move(aProps) );
+ StyleContainer::Style aSubStyle( "style:graphic-properties", std::move(aGCProps) );
aStyle.SubStyles.push_back( &aSubStyle );
elem.StyleId = m_rStyleContainer.getStyleId( aStyle );
@@ -1075,10 +1075,10 @@ void WriterXmlFinalizer::setFirstOnPage( ParagraphElement& rElem,
aProps[ "style:master-page-name" ] = rMasterPageName;
if( rElem.StyleId != -1 )
- rElem.StyleId = rStyles.setProperties( rElem.StyleId, aProps );
+ rElem.StyleId = rStyles.setProperties( rElem.StyleId, std::move(aProps) );
else
{
- StyleContainer::Style aStyle( "style:style", aProps );
+ StyleContainer::Style aStyle( "style:style", std::move(aProps) );
rElem.StyleId = rStyles.getStyleId( aStyle );
}
}
@@ -1183,15 +1183,15 @@ void WriterXmlFinalizer::visit( PageElement& elem, const std::list< std::unique_
aPageLayoutProps[ "fo:margin-right" ] = unitMMString( right_margin );
aPageLayoutProps[ "style:writing-mode" ]= "lr-tb";
- StyleContainer::Style aStyle( "style:page-layout", aPageProps);
- StyleContainer::Style aSubStyle( "style:page-layout-properties", aPageLayoutProps);
+ StyleContainer::Style aStyle( "style:page-layout", std::move(aPageProps));
+ StyleContainer::Style aSubStyle( "style:page-layout-properties", std::move(aPageLayoutProps));
aStyle.SubStyles.push_back(&aSubStyle);
sal_Int32 nPageStyle = m_rStyleContainer.impl_getStyleId( aStyle, false );
// create master page
OUString aMasterPageLayoutName = m_rStyleContainer.getStyleName( nPageStyle );
aPageProps[ "style:page-layout-name" ] = aMasterPageLayoutName;
- StyleContainer::Style aMPStyle( "style:master-page", aPageProps );
+ StyleContainer::Style aMPStyle( "style:master-page", std::move(aPageProps) );
StyleContainer::Style aHeaderStyle( "style:header", PropertyMap() );
StyleContainer::Style aFooterStyle( "style:footer", PropertyMap() );
if( elem.HeaderElement )