summaryrefslogtreecommitdiff
path: root/xmloff/source/style
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-08-15 20:26:46 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-08-16 08:11:34 +0200
commit50679d449fa71bebdc3cba1d30c6c81ac846990c (patch)
treef903dc5160a9953cd9211efe44261ba7cd77b520 /xmloff/source/style
parenta0073744aac89648e89506b79e227b17dacf58d0 (diff)
loplugin:sequenceloop in xmloff
Change-Id: I1fde11da5f6e97255a9140f11c298d6d525f7230 Reviewed-on: https://gerrit.libreoffice.org/77543 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff/source/style')
-rw-r--r--xmloff/source/style/AttributeContainerHandler.cxx2
-rw-r--r--xmloff/source/style/XMLFontAutoStylePool.cxx6
-rw-r--r--xmloff/source/style/XMLPageExport.cxx2
-rw-r--r--xmloff/source/style/styleexp.cxx2
-rw-r--r--xmloff/source/style/xmlexppr.cxx4
-rw-r--r--xmloff/source/style/xmlimppr.cxx2
-rw-r--r--xmloff/source/style/xmltabe.cxx2
7 files changed, 11 insertions, 9 deletions
diff --git a/xmloff/source/style/AttributeContainerHandler.cxx b/xmloff/source/style/AttributeContainerHandler.cxx
index 5db11689e28d..07d98dedc472 100644
--- a/xmloff/source/style/AttributeContainerHandler.cxx
+++ b/xmloff/source/style/AttributeContainerHandler.cxx
@@ -47,7 +47,7 @@ bool XMLAttributeContainerHandler::equals(
if( ( r1 >>= xContainer1 ) && ( r2 >>= xContainer2 ) )
{
- uno::Sequence< OUString > aAttribNames1( xContainer1->getElementNames() );
+ const uno::Sequence< OUString > aAttribNames1( xContainer1->getElementNames() );
uno::Sequence< OUString > aAttribNames2( xContainer2->getElementNames() );
if( aAttribNames1.getLength() == aAttribNames2.getLength() )
diff --git a/xmloff/source/style/XMLFontAutoStylePool.cxx b/xmloff/source/style/XMLFontAutoStylePool.cxx
index d9b205b1c7df..af44e28525d7 100644
--- a/xmloff/source/style/XMLFontAutoStylePool.cxx
+++ b/xmloff/source/style/XMLFontAutoStylePool.cxx
@@ -304,14 +304,16 @@ std::unordered_set<OUString> XMLFontAutoStylePool::getUsedFontList()
uno::Reference<container::XNameAccess> xFamilies(xFamiliesSupp->getStyleFamilies());
if (xFamilies.is())
{
- for (OUString const & sFamilyName : xFamilies->getElementNames())
+ const uno::Sequence<OUString> aFamilyNames = xFamilies->getElementNames();
+ for (OUString const & sFamilyName : aFamilyNames)
{
uno::Reference<container::XNameAccess> xStyleContainer;
xFamilies->getByName(sFamilyName) >>= xStyleContainer;
if (xStyleContainer.is())
{
- for (OUString const & rName : xStyleContainer->getElementNames())
+ const uno::Sequence<OUString> aStyleNames = xStyleContainer->getElementNames();
+ for (OUString const & rName : aStyleNames)
{
uno::Reference<style::XStyle> xStyle;
xStyleContainer->getByName(rName) >>= xStyle;
diff --git a/xmloff/source/style/XMLPageExport.cxx b/xmloff/source/style/XMLPageExport.cxx
index 64c7645e4980..4baa8a43f24c 100644
--- a/xmloff/source/style/XMLPageExport.cxx
+++ b/xmloff/source/style/XMLPageExport.cxx
@@ -199,7 +199,7 @@ void XMLPageExport::exportStyles( bool bUsed, bool bAutoStyles )
{
if( xPageStyles.is() )
{
- uno::Sequence< OUString> aSeq = xPageStyles->getElementNames();
+ const uno::Sequence< OUString> aSeq = xPageStyles->getElementNames();
for(const auto& rName : aSeq)
{
Reference< XStyle > xStyle(xPageStyles->getByName( rName ),uno::UNO_QUERY);
diff --git a/xmloff/source/style/styleexp.cxx b/xmloff/source/style/styleexp.cxx
index e7f39c6314fe..afffbf832d1a 100644
--- a/xmloff/source/style/styleexp.cxx
+++ b/xmloff/source/style/styleexp.cxx
@@ -90,7 +90,7 @@ void XMLStyleExport::exportStyleContent( const Reference< XStyle >& rStyle )
aProperty >>= aSeq;
- for (beans::NamedValue const& rNamedCond : aSeq)
+ for (beans::NamedValue const& rNamedCond : std::as_const(aSeq))
{
OUString aStyleName;
diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx
index a0ed1e483d9d..76fd72c71deb 100644
--- a/xmloff/source/style/xmlexppr.cxx
+++ b/xmloff/source/style/xmlexppr.cxx
@@ -316,7 +316,7 @@ void FilterPropertiesInfo_Impl::FillPropertyStateArray(
}
else
{
- Sequence < beans::GetPropertyTolerantResult > aResults(xTolPropSet->getPropertyValuesTolerant(rApiNames));
+ const Sequence < beans::GetPropertyTolerantResult > aResults(xTolPropSet->getPropertyValuesTolerant(rApiNames));
OSL_ENSURE( rApiNames.getLength() == aResults.getLength(), "wrong implemented XTolerantMultiPropertySet" );
FilterPropertyInfoList_Impl::iterator aPropIter(aPropInfos.begin());
XMLPropertyState aNewProperty( -1 );
@@ -919,7 +919,7 @@ void SvXMLExportPropertyMapper::_exportXML(
std::unique_ptr<SvXMLNamespaceMap> pNewNamespaceMap;
const SvXMLNamespaceMap *pNamespaceMap = &rNamespaceMap;
- uno::Sequence< OUString > aAttribNames( xAttrContainer->getElementNames() );
+ const uno::Sequence< OUString > aAttribNames( xAttrContainer->getElementNames() );
OUStringBuffer sNameBuffer;
xml::AttributeData aData;
diff --git a/xmloff/source/style/xmlimppr.cxx b/xmloff/source/style/xmlimppr.cxx
index 79f8a5f09b45..d21c219f12cb 100644
--- a/xmloff/source/style/xmlimppr.cxx
+++ b/xmloff/source/style/xmlimppr.cxx
@@ -688,7 +688,7 @@ bool SvXMLImportPropertyMapper::FillTolerantMultiPropertySet_(
// and, finally, try to set the values
try
{
- Sequence< SetPropertyTolerantFailed > aResults(rTolMultiPropSet->setPropertyValuesTolerant( aNames, aValues ));
+ const Sequence< SetPropertyTolerantFailed > aResults(rTolMultiPropSet->setPropertyValuesTolerant( aNames, aValues ));
bSuccessful = !aResults.hasElements();
for( const auto& rResult : aResults)
{
diff --git a/xmloff/source/style/xmltabe.cxx b/xmloff/source/style/xmltabe.cxx
index 63cb2ce79f94..d9cd53384f60 100644
--- a/xmloff/source/style/xmltabe.cxx
+++ b/xmloff/source/style/xmltabe.cxx
@@ -113,7 +113,7 @@ void SvxXMLTabStopExport::Export( const uno::Any& rAny )
SvXMLElementExport rElem( rExport, XML_NAMESPACE_STYLE, XML_TAB_STOPS,
true, true );
- for( const auto& rTab : aSeq )
+ for( const auto& rTab : std::as_const(aSeq) )
{
if( style::TabAlign_DEFAULT != rTab.Alignment )
exportTabStop( &rTab );