[Libreoffice-commits] core.git: 4 commits - include/vcl sw/qa sw/source test/source toolkit/source unoxml/source uui/source vbahelper/source vcl/qt5 vcl/source vcl/unx vcl/workben writerfilter/source writerperfect/qa writerperfect/source xmlhelp/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Thu Aug 15 18:26:19 UTC 2019
include/vcl/graphicfilter.hxx | 2
sw/qa/extras/globalfilter/globalfilter.cxx | 4 -
sw/qa/extras/mailmerge/mailmerge.cxx | 2
sw/qa/extras/odfexport/odfexport.cxx | 3
sw/qa/extras/uiwriter/uiwriter.cxx | 6 -
sw/qa/extras/unowriter/unowriter.cxx | 4 -
sw/qa/extras/ww8export/ww8export2.cxx | 2
sw/source/core/crsr/DropDownFormFieldButton.cxx | 2
sw/source/core/doc/docglos.cxx | 4 -
sw/source/core/doc/docxforms.cxx | 2
sw/source/core/edit/edfcol.cxx | 4 -
sw/source/core/fields/authfld.cxx | 2
sw/source/core/unocore/unochart.cxx | 4 -
sw/source/core/unocore/unocrsrhelper.cxx | 2
sw/source/core/unocore/unoevent.cxx | 2
sw/source/core/unocore/unoframe.cxx | 2
sw/source/core/unocore/unoidx.cxx | 2
sw/source/filter/html/htmlforw.cxx | 2
sw/source/filter/html/wrthtml.cxx | 2
sw/source/filter/ww8/docxattributeoutput.cxx | 40 +++++-----
sw/source/filter/ww8/docxexport.cxx | 18 ++--
sw/source/filter/ww8/docxexport.hxx | 2
sw/source/filter/ww8/docxtablestyleexport.cxx | 66 +++++++++---------
sw/source/filter/ww8/docxtablestyleexport.hxx | 2
sw/source/filter/ww8/rtfattributeoutput.cxx | 2
sw/source/filter/ww8/rtfexport.cxx | 4 -
sw/source/filter/ww8/rtfexport.hxx | 3
sw/source/filter/ww8/wrtw8esh.cxx | 2
sw/source/filter/ww8/wrtww8.hxx | 4 -
sw/source/filter/ww8/ww8par.cxx | 2
sw/source/filter/xml/xmlimp.cxx | 4 -
sw/source/ui/config/optcomp.cxx | 2
sw/source/ui/dbui/addresslistdialog.cxx | 4 -
sw/source/ui/dbui/dbinsdlg.cxx | 10 +-
sw/source/ui/dbui/mmaddressblockpage.cxx | 4 -
sw/source/ui/dbui/mmgreetingspage.cxx | 4 -
sw/source/ui/dbui/mmoutputtypepage.cxx | 2
sw/source/ui/dbui/mmresultdialogs.cxx | 2
sw/source/ui/dbui/selectdbtabledialog.cxx | 2
sw/source/ui/envelp/envlop1.cxx | 2
sw/source/ui/envelp/label1.cxx | 2
sw/source/ui/fldui/DropDownFieldDialog.cxx | 2
sw/source/ui/fldui/DropDownFormFieldDialog.cxx | 2
sw/source/ui/fldui/fldfunc.cxx | 2
sw/source/ui/index/swuiidxmrk.cxx | 4 -
sw/source/ui/vba/vbaaddins.cxx | 2
sw/source/uibase/app/docsh.cxx | 2
sw/source/uibase/app/docshini.cxx | 2
sw/source/uibase/dbui/dbmgr.cxx | 4 -
sw/source/uibase/dbui/dbtree.cxx | 8 +-
sw/source/uibase/lingu/olmenu.cxx | 8 +-
sw/source/uibase/shells/textsh1.cxx | 2
sw/source/uibase/uno/unomailmerge.cxx | 2
test/source/beans/xpropertyset.cxx | 2
test/source/sheet/xdatabaserange.cxx | 2
test/source/sheet/xfunctiondescriptions.cxx | 4 -
test/source/sheet/xsheetcellrangecontainer.cxx | 4 -
test/source/sheet/xsheetfilterableex.cxx | 2
test/source/sheet/xsheetpagebreak.cxx | 4 -
test/source/text/textsettings.cxx | 2
toolkit/source/awt/vclxtoolkit.cxx | 4 -
toolkit/source/awt/vclxwindow1.cxx | 2
toolkit/source/awt/vclxwindows.cxx | 4 -
toolkit/source/controls/controlmodelcontainerbase.cxx | 10 +-
toolkit/source/controls/dialogcontrol.cxx | 4 -
toolkit/source/controls/geometrycontrolmodel.cxx | 4 -
toolkit/source/controls/stdtabcontroller.cxx | 4 -
toolkit/source/controls/tabpagecontainer.cxx | 2
toolkit/source/controls/tabpagemodel.cxx | 2
toolkit/source/controls/unocontrolcontainer.cxx | 4 -
toolkit/source/controls/unocontrolmodel.cxx | 4 -
toolkit/source/helper/vclunohelper.cxx | 2
unoxml/source/dom/saxbuilder.cxx | 2
uui/source/iahndl.cxx | 2
uui/source/passwordcontainer.cxx | 2
vbahelper/source/msforms/vbauserform.cxx | 2
vbahelper/source/vbahelper/vbashape.cxx | 2
vbahelper/source/vbahelper/vbashapes.cxx | 2
vcl/qt5/Qt5FilePicker.cxx | 2
vcl/qt5/Qt5Transferable.cxx | 2
vcl/source/bitmap/BitmapTools.cxx | 2
vcl/source/filter/FilterConfigCache.cxx | 2
vcl/source/filter/graphicfilter.cxx | 4 -
vcl/source/gdi/configsettings.cxx | 2
vcl/source/gdi/print3.cxx | 2
vcl/source/graphic/GraphicObject.cxx | 3
vcl/source/graphic/UnoGraphicProvider.cxx | 4 -
vcl/source/uitest/uno/uiobject_uno.cxx | 2
vcl/source/window/printdlg.cxx | 4 -
vcl/unx/generic/dtrans/config.cxx | 2
vcl/unx/gtk/a11y/atktextattributes.cxx | 2
vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx | 4 -
vcl/unx/gtk/salprn-gtk.cxx | 4 -
vcl/workben/vcldemo.cxx | 2
writerfilter/source/dmapper/DomainMapper_Impl.cxx | 8 +-
writerfilter/source/dmapper/NumberingManager.cxx | 4 -
writerfilter/source/dmapper/PropertyMap.cxx | 2
writerfilter/source/dmapper/StyleSheetTable.cxx | 6 -
writerfilter/source/ooxml/OOXMLDocumentImpl.cxx | 6 -
writerfilter/source/ooxml/OOXMLStreamImpl.cxx | 4 -
writerfilter/source/rtftok/rtfdocumentimpl.cxx | 2
writerperfect/qa/unit/WpftLoader.cxx | 2
writerperfect/source/writer/EPUBExportFilter.cxx | 2
xmlhelp/source/cxxhelp/provider/databases.cxx | 2
xmlhelp/source/treeview/tvread.cxx | 2
105 files changed, 222 insertions(+), 215 deletions(-)
New commits:
commit dc50b7f952cf339f66fcdf1ac78d7fbeb31014d4
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Aug 15 16:14:44 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Aug 15 20:24:12 2019 +0200
loplugin:sequenceloop in writerfilter..xmlhelp
Change-Id: I7c9c911aa6b051eeab46344f25ea2919605de645
Reviewed-on: https://gerrit.libreoffice.org/77534
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 7e4728af2bac..1fe07ac3d8e5 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -2375,7 +2375,7 @@ void DomainMapper_Impl::PushShapeContext( const uno::Reference< drawing::XShape
uno::Sequence<beans::PropertyValue> aGrabBag;
xShapePropertySet->getPropertyValue("FrameInteropGrabBag") >>= aGrabBag;
- for (const auto& rProp : aGrabBag)
+ for (const auto& rProp : std::as_const(aGrabBag))
{
if (rProp.Name == "VML-Z-ORDER")
{
@@ -2419,7 +2419,7 @@ void DomainMapper_Impl::PushShapeContext( const uno::Reference< drawing::XShape
uno::Reference<beans::XPropertySet> xShapePropertySet(xShape, uno::UNO_QUERY);
uno::Sequence<beans::PropertyValue> aGrabBag;
xShapePropertySet->getPropertyValue("InteropGrabBag") >>= aGrabBag;
- for (const auto& rProp : aGrabBag)
+ for (const auto& rProp : std::as_const(aGrabBag))
{
if (rProp.Name == "VML-Z-ORDER")
{
@@ -2553,14 +2553,14 @@ bool DomainMapper_Impl::IsSdtEndBefore()
PropertyMapPtr pContext = GetTopContextOfType(CONTEXT_CHARACTER);
if(pContext)
{
- uno::Sequence< beans::PropertyValue > currentCharProps = pContext->GetPropertyValues();
+ const uno::Sequence< beans::PropertyValue > currentCharProps = pContext->GetPropertyValues();
for (const auto& rCurrentCharProp : currentCharProps)
{
if (rCurrentCharProp.Name == "CharInteropGrabBag")
{
uno::Sequence<beans::PropertyValue> aCharGrabBag;
rCurrentCharProp.Value >>= aCharGrabBag;
- for (const auto& rProp : aCharGrabBag)
+ for (const auto& rProp : std::as_const(aCharGrabBag))
{
if(rProp.Name == "SdtEndBefore")
{
diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx
index e5bf229d174e..659bbed2bb90 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -72,7 +72,7 @@ static sal_Int32 lcl_findProperty( const uno::Sequence< beans::PropertyValue >&
return nPos;
}
-static void lcl_mergeProperties( uno::Sequence< beans::PropertyValue >& aSrc,
+static void lcl_mergeProperties( const uno::Sequence< beans::PropertyValue >& aSrc,
uno::Sequence< beans::PropertyValue >& aDst )
{
for ( const auto& rProp : aSrc )
@@ -329,7 +329,7 @@ void ListLevel::AddParaProperties( uno::Sequence< beans::PropertyValue >* props
if( hasFirstLineIndent && hasIndentAt )
return; // has them all, nothing to add
- uno::Sequence< beans::PropertyValue > aParaProps = m_pParaStyle->pProperties->GetPropertyValues( );
+ const uno::Sequence< beans::PropertyValue > aParaProps = m_pParaStyle->pProperties->GetPropertyValues( );
// ParaFirstLineIndent -> FirstLineIndent
// ParaLeftMargin -> IndentAt
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index f720131c5fd5..1cd31bb56954 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1596,7 +1596,7 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl )
// Unfortunately using setParent() does not work for page styles, so make a deep copy of the page style.
uno::Reference< beans::XPropertySet > pageProperties( m_bTitlePage ? m_aFirstPageStyle : m_aFollowPageStyle );
uno::Reference< beans::XPropertySetInfo > pagePropertiesInfo( pageProperties->getPropertySetInfo() );
- uno::Sequence< beans::Property > propertyList( pagePropertiesInfo->getProperties() );
+ const uno::Sequence< beans::Property > propertyList( pagePropertiesInfo->getProperties() );
// Ignore write-only properties.
static const std::set<OUString> aBlacklist
= { "FooterBackGraphicURL", "BackGraphicURL", "HeaderBackGraphicURL" };
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx
index da7fef117c63..8864336611ce 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -1499,7 +1499,7 @@ void StyleSheetTable::applyDefaults(bool bParaProperties)
// This is the built-in default style that every style inherits from
xParagraphStyles->getByName("Paragraph style") >>= xDefault;
- uno::Sequence< beans::PropertyValue > aPropValues = m_pImpl->m_pDefaultParaProps->GetPropertyValues();
+ const uno::Sequence< beans::PropertyValue > aPropValues = m_pImpl->m_pDefaultParaProps->GetPropertyValues();
for( const auto& rPropValue : aPropValues )
{
try
@@ -1514,7 +1514,7 @@ void StyleSheetTable::applyDefaults(bool bParaProperties)
}
if( !bParaProperties && m_pImpl->m_pDefaultCharProps.get())
{
- uno::Sequence< beans::PropertyValue > aPropValues = m_pImpl->m_pDefaultCharProps->GetPropertyValues();
+ const uno::Sequence< beans::PropertyValue > aPropValues = m_pImpl->m_pDefaultCharProps->GetPropertyValues();
for( const auto& rPropValue : aPropValues )
{
try
@@ -1548,7 +1548,7 @@ OUString StyleSheetTable::getOrCreateCharStyle( PropertyValueVector_t& rCharProp
xStyleFamilies->getByName("CharacterStyles") >>= xCharStyles;
//search for all character styles with the name sListLabel + <index>
sal_Int32 nStyleFound = 0;
- uno::Sequence< OUString > aStyleNames = xCharStyles->getElementNames();
+ const uno::Sequence< OUString > aStyleNames = xCharStyles->getElementNames();
for( const auto& rStyleName : aStyleNames )
{
OUString sSuffix;
diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
index e8386c5898ef..3042407088fa 100644
--- a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
@@ -557,7 +557,7 @@ void OOXMLDocumentImpl::resolveCustomXmlStream(Stream & rStream)
static const char sCustomType[] = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml";
static const char sCustomTypeStrict[] = "http://purl.oclc.org/ooxml/officeDocument/relationships/customXml";
bool bFound = false;
- uno::Sequence<uno::Sequence< beans::StringPair>> aSeqs = xRelationshipAccess->getAllRelationships();
+ const uno::Sequence<uno::Sequence< beans::StringPair>> aSeqs = xRelationshipAccess->getAllRelationships();
std::vector<uno::Reference<xml::dom::XDocument>> aCustomXmlDomList;
std::vector<uno::Reference<xml::dom::XDocument>> aCustomXmlDomPropsList;
for (const uno::Sequence<beans::StringPair>& aSeq : aSeqs)
@@ -625,7 +625,7 @@ void OOXMLDocumentImpl::resolveGlossaryStream(Stream & /*rStream*/)
if (xRelationshipAccess.is())
{
- uno::Sequence< uno::Sequence< beans::StringPair > >aSeqs = xRelationshipAccess->getAllRelationships();
+ const uno::Sequence< uno::Sequence< beans::StringPair > >aSeqs = xRelationshipAccess->getAllRelationships();
std::vector< uno::Sequence<uno::Any> > aGlossaryDomList;
for (const uno::Sequence< beans::StringPair >& aSeq : aSeqs)
{
@@ -724,7 +724,7 @@ void OOXMLDocumentImpl::resolveEmbeddingsStream(const OOXMLStream::Pointer_t& pS
bool bFound = false;
bool bHeaderFooterFound = false;
OOXMLStream::StreamType_t streamType = OOXMLStream::UNKNOWN;
- uno::Sequence< uno::Sequence< beans::StringPair > >aSeqs = xRelationshipAccess->getAllRelationships();
+ const uno::Sequence< uno::Sequence< beans::StringPair > >aSeqs = xRelationshipAccess->getAllRelationships();
for (const uno::Sequence< beans::StringPair >& aSeq : aSeqs)
{
for (const beans::StringPair& aPair : aSeq)
diff --git a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
index cd9426fe1a41..417dd1acf0b2 100644
--- a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
@@ -95,7 +95,7 @@ bool OOXMLStreamImpl::lcl_getTarget(const uno::Reference<embed::XRelationshipAcc
if (maIdCache.empty())
{
// Cache is empty? Then let's build it!
- uno::Sequence< uno::Sequence<beans::StringPair> >aSeqs = xRelationshipAccess->getAllRelationships();
+ const uno::Sequence< uno::Sequence<beans::StringPair> >aSeqs = xRelationshipAccess->getAllRelationships();
for (const uno::Sequence<beans::StringPair>& rSeq : aSeqs)
{
OUString aId;
@@ -257,7 +257,7 @@ bool OOXMLStreamImpl::lcl_getTarget(const uno::Reference<embed::XRelationshipAcc
if (xRelationshipAccess.is())
{
- uno::Sequence< uno::Sequence< beans::StringPair > >aSeqs =
+ const uno::Sequence< uno::Sequence< beans::StringPair > >aSeqs =
xRelationshipAccess->getAllRelationships();
for (const uno::Sequence< beans::StringPair > &rSeq : aSeqs)
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index a022b6c67de3..14fb9f711527 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -3138,7 +3138,7 @@ RTFError RTFDocumentImpl::popState()
xClipboardPropertyContainer, uno::UNO_QUERY);
uno::Reference<beans::XPropertySet> xDocumentPropertySet(xDocumentPropertyContainer,
uno::UNO_QUERY);
- uno::Sequence<beans::Property> aClipboardProperties
+ const uno::Sequence<beans::Property> aClipboardProperties
= xClipboardPropertySet->getPropertySetInfo()->getProperties();
uno::Sequence<beans::Property> aDocumentProperties
= xDocumentPropertySet->getPropertySetInfo()->getProperties();
diff --git a/writerperfect/qa/unit/WpftLoader.cxx b/writerperfect/qa/unit/WpftLoader.cxx
index 4c5696c18067..f29cd89c001f 100644
--- a/writerperfect/qa/unit/WpftLoader.cxx
+++ b/writerperfect/qa/unit/WpftLoader.cxx
@@ -190,7 +190,7 @@ void WpftLoader::impl_detectFilterName(uno::Sequence<beans::PropertyValue>& rDes
uno::Sequence<beans::PropertyValue> aTypes;
if (m_xTypeMap->getByName(rTypeName) >>= aTypes)
{
- for (const auto& rType : aTypes)
+ for (const auto& rType : std::as_const(aTypes))
{
OUString aFilterName;
if (("PreferredFilter" == rType.Name) && (rType.Value >>= aFilterName))
diff --git a/writerperfect/source/writer/EPUBExportFilter.cxx b/writerperfect/source/writer/EPUBExportFilter.cxx
index 747206ec7e45..d944b080ddd3 100644
--- a/writerperfect/source/writer/EPUBExportFilter.cxx
+++ b/writerperfect/source/writer/EPUBExportFilter.cxx
@@ -69,7 +69,7 @@ sal_Bool EPUBExportFilter::filter(const uno::Sequence<beans::PropertyValue>& rDe
if (aFilterOptions == "layout=fixed")
nLayoutMethod = libepubgen::EPUB_LAYOUT_METHOD_FIXED;
- for (const auto& rProp : aFilterData)
+ for (const auto& rProp : std::as_const(aFilterData))
{
if (rProp.Name == "EPUBVersion")
rProp.Value >>= nVersion;
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx
index 20f8b51fd861..c097c08a40b3 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -1308,7 +1308,7 @@ void ExtensionIteratorBase::implGetLanguageVectorFromPackage( ::std::vector< OUS
{
rv.clear();
OUString aExtensionPath = xPackage->getURL();
- Sequence< OUString > aEntrySeq = m_xSFA->getFolderContents( aExtensionPath, true );
+ const Sequence< OUString > aEntrySeq = m_xSFA->getFolderContents( aExtensionPath, true );
for( const OUString& aEntry : aEntrySeq )
{
diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx
index 1aacebcf8768..4ae8f7a0aff8 100644
--- a/xmlhelp/source/treeview/tvread.cxx
+++ b/xmlhelp/source/treeview/tvread.cxx
@@ -1018,7 +1018,7 @@ void ExtensionIteratorBase::implGetLanguageVectorFromPackage( ::std::vector< OUS
{
rv.clear();
OUString aExtensionPath = xPackage->getURL();
- Sequence< OUString > aEntrySeq = m_xSFA->getFolderContents( aExtensionPath, true );
+ const Sequence< OUString > aEntrySeq = m_xSFA->getFolderContents( aExtensionPath, true );
for( const OUString& aEntry : aEntrySeq )
{
commit 7841194ed70385627b9f8f88315fb1d0b5b8147c
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Aug 15 15:55:45 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Aug 15 20:23:59 2019 +0200
loplugin:sequenceloop in unoxml..vcl
Change-Id: Ic3c48ec4d86252b62d3dd25bbc198f7d7fb75e90
Reviewed-on: https://gerrit.libreoffice.org/77533
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/include/vcl/graphicfilter.hxx b/include/vcl/graphicfilter.hxx
index b603d3479852..2e8dda3c0d2d 100644
--- a/include/vcl/graphicfilter.hxx
+++ b/include/vcl/graphicfilter.hxx
@@ -291,7 +291,7 @@ public:
SvStream& rStream,
sal_uInt16 nFormat,
sal_uInt16 * pDeterminedFormat, GraphicFilterImportFlags nImportFlags,
- css::uno::Sequence< css::beans::PropertyValue >* pFilterData,
+ const css::uno::Sequence< css::beans::PropertyValue >* pFilterData,
WmfExternal const *pExtHeader = nullptr );
// Setting sizeLimit limits how much will be read from the stream.
diff --git a/unoxml/source/dom/saxbuilder.cxx b/unoxml/source/dom/saxbuilder.cxx
index 5769ad579666..00db5396da64 100644
--- a/unoxml/source/dom/saxbuilder.cxx
+++ b/unoxml/source/dom/saxbuilder.cxx
@@ -253,7 +253,7 @@ namespace DOM
if (xAttribs.is())
{
setElementFastAttributes(aElement, xAttribs);
- Sequence< css::xml::Attribute > unknownAttribs = xAttribs->getUnknownAttributes();
+ const Sequence< css::xml::Attribute > unknownAttribs = xAttribs->getUnknownAttributes();
for ( const auto& rUnknownAttrib : unknownAttribs )
{
const OUString& rAttrValue = rUnknownAttrib.Value;
diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx
index 4b074d151984..7f31daafd5c2 100644
--- a/uui/source/iahndl.cxx
+++ b/uui/source/iahndl.cxx
@@ -883,7 +883,7 @@ UUIInteractionHelper::getInteractionHandlerList(
uno::Reference< container::XNameAccess > xNameAccess(
xInterface, uno::UNO_QUERY_THROW );
- uno::Sequence< OUString > aElems = xNameAccess->getElementNames();
+ const uno::Sequence< OUString > aElems = xNameAccess->getElementNames();
if ( aElems.hasElements() )
{
diff --git a/uui/source/passwordcontainer.cxx b/uui/source/passwordcontainer.cxx
index c48f3cd2c029..a97725ef1ca3 100644
--- a/uui/source/passwordcontainer.cxx
+++ b/uui/source/passwordcontainer.cxx
@@ -360,7 +360,7 @@ PasswordContainerInteractionHandler::handleInteractionRequest(
if ( aAnyRequest >>= aURLAuthenticationRequest )
aURL = aURLAuthenticationRequest.URL;
- uno::Sequence< uno::Reference< task::XInteractionContinuation > >
+ const uno::Sequence< uno::Reference< task::XInteractionContinuation > >
rContinuations = rRequest->getContinuations();
uno::Reference< ucb::XInteractionSupplyAuthentication >
diff --git a/vbahelper/source/msforms/vbauserform.cxx b/vbahelper/source/msforms/vbauserform.cxx
index c29c9782b3c9..96acd3af6034 100644
--- a/vbahelper/source/msforms/vbauserform.cxx
+++ b/vbahelper/source/msforms/vbauserform.cxx
@@ -233,7 +233,7 @@ ScVbaUserForm::nestedSearch( const OUString& aPropertyName, uno::Reference< awt:
uno::Reference< awt::XControl > xControl = xContainer->getControl( aPropertyName );
if ( !xControl.is() )
{
- uno::Sequence< uno::Reference< awt::XControl > > aControls = xContainer->getControls();
+ const uno::Sequence< uno::Reference< awt::XControl > > aControls = xContainer->getControls();
for ( const auto& rCtrl : aControls )
{
diff --git a/vbahelper/source/vbahelper/vbashape.cxx b/vbahelper/source/vbahelper/vbashape.cxx
index 2dd9cdbda000..f49d48370c9e 100644
--- a/vbahelper/source/vbahelper/vbashape.cxx
+++ b/vbahelper/source/vbahelper/vbashape.cxx
@@ -178,7 +178,7 @@ sal_Int32 ScVbaShape::getAutoShapeType(const css::uno::Reference< drawing::XShap
uno::Sequence< beans::PropertyValue > aGeoPropSeq;
if ( aGeoPropSet >>= aGeoPropSeq )
{
- for( const auto& rProp : aGeoPropSeq )
+ for( const auto& rProp : std::as_const(aGeoPropSeq) )
{
if( rProp.Name == "Type" )
{
diff --git a/vbahelper/source/vbahelper/vbashapes.cxx b/vbahelper/source/vbahelper/vbashapes.cxx
index d993d443ea5e..7c9ca3f22cd9 100644
--- a/vbahelper/source/vbahelper/vbashapes.cxx
+++ b/vbahelper/source/vbahelper/vbashapes.cxx
@@ -145,7 +145,7 @@ ScVbaShapes::getShapesByArrayIndices( const uno::Any& Index )
uno::Sequence< uno::Any > sIndices;
aConverted >>= sIndices;
XNamedObjectCollectionHelper< drawing::XShape >::XNamedVec aShapes;
- for( const auto& rIndex : sIndices )
+ for( const auto& rIndex : std::as_const(sIndices) )
{
uno::Reference< drawing::XShape > xShape;
if ( rIndex.getValueTypeClass() == uno::TypeClass_STRING )
diff --git a/vcl/qt5/Qt5FilePicker.cxx b/vcl/qt5/Qt5FilePicker.cxx
index f499c2db53dd..602ee21569ee 100644
--- a/vcl/qt5/Qt5FilePicker.cxx
+++ b/vcl/qt5/Qt5FilePicker.cxx
@@ -415,7 +415,7 @@ void Qt5FilePicker::handleSetListValue(QComboBox* pWidget, sal_Int16 nControlAct
{
Sequence<OUString> aStringList;
rValue >>= aStringList;
- for (auto const& sItem : aStringList)
+ for (auto const& sItem : std::as_const(aStringList))
pWidget->addItem(toQString(sItem));
break;
}
diff --git a/vcl/qt5/Qt5Transferable.cxx b/vcl/qt5/Qt5Transferable.cxx
index 10a139093041..e3c5bfa42a1a 100644
--- a/vcl/qt5/Qt5Transferable.cxx
+++ b/vcl/qt5/Qt5Transferable.cxx
@@ -249,7 +249,7 @@ QStringList Qt5MimeData::formats() const
if (!m_aMimeTypeList.isEmpty())
return m_aMimeTypeList;
- css::uno::Sequence<css::datatransfer::DataFlavor> aFormats
+ const css::uno::Sequence<css::datatransfer::DataFlavor> aFormats
= m_aContents->getTransferDataFlavors();
QStringList aList;
bool bHaveUTF16 = false;
diff --git a/vcl/source/bitmap/BitmapTools.cxx b/vcl/source/bitmap/BitmapTools.cxx
index 4fbecf3fc47e..24f202e3e636 100644
--- a/vcl/source/bitmap/BitmapTools.cxx
+++ b/vcl/source/bitmap/BitmapTools.cxx
@@ -71,7 +71,7 @@ void loadFromSvg(SvStream& rStream, const OUString& sPath, BitmapEx& rBitmapEx,
uno::Sequence<sal_Int8> aData(aBuffer.data(), nSize + 1);
uno::Reference<io::XInputStream> aInputStream(new comphelper::SequenceInputStream(aData));
- Primitive2DSequence aPrimitiveSequence = xSvgParser->getDecomposition(aInputStream, sPath);
+ const Primitive2DSequence aPrimitiveSequence = xSvgParser->getDecomposition(aInputStream, sPath);
if (!aPrimitiveSequence.hasElements())
return;
diff --git a/vcl/source/filter/FilterConfigCache.cxx b/vcl/source/filter/FilterConfigCache.cxx
index e2cf35d510c7..0ed0a431e235 100644
--- a/vcl/source/filter/FilterConfigCache.cxx
+++ b/vcl/source/filter/FilterConfigCache.cxx
@@ -158,7 +158,7 @@ void FilterConfigCache::ImplInit()
if ( xTypeAccess.is() && xFilterAccess.is() )
{
- Sequence< OUString > lAllFilter = xFilterAccess->getElementNames();
+ const Sequence< OUString > lAllFilter = xFilterAccess->getElementNames();
for ( const OUString& sInternalFilterName : lAllFilter )
{
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx
index cb9b5768f047..901c9407e36f 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -1440,7 +1440,7 @@ void GraphicFilter::preload()
ErrCode GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPath, SvStream& rIStream,
sal_uInt16 nFormat, sal_uInt16* pDeterminedFormat, GraphicFilterImportFlags nImportFlags,
- css::uno::Sequence< css::beans::PropertyValue >* pFilterData,
+ const css::uno::Sequence< css::beans::PropertyValue >* pFilterData,
WmfExternal const *pExtHeader )
{
OUString aFilterName;
@@ -2077,7 +2077,7 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString& r
css::uno::Sequence< css::beans::PropertyValue > aAdditionalChunkSequence;
if ( rPropVal.Value >>= aAdditionalChunkSequence )
{
- for ( const auto& rAdditionalChunk : aAdditionalChunkSequence )
+ for ( const auto& rAdditionalChunk : std::as_const(aAdditionalChunkSequence) )
{
if ( rAdditionalChunk.Name.getLength() == 4 )
{
diff --git a/vcl/source/gdi/configsettings.cxx b/vcl/source/gdi/configsettings.cxx
index f04ddd0ffa37..f8b9edb7c50c 100644
--- a/vcl/source/gdi/configsettings.cxx
+++ b/vcl/source/gdi/configsettings.cxx
@@ -86,7 +86,7 @@ void SettingsConfigItem::getValues()
{
m_aSettings.clear();
- Sequence< OUString > aNames( GetNodeNames( OUString() ) );
+ const Sequence< OUString > aNames( GetNodeNames( OUString() ) );
for( const auto& aKeyName : aNames )
{
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index eefe65573270..b3c3f9ead130 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -1516,7 +1516,7 @@ void PrinterController::setUIOptions( const css::uno::Sequence< css::beans::Prop
OUString aPropName;
vcl::ImplPrinterControllerData::ControlDependency aDep;
css::uno::Sequence< sal_Bool > aChoicesDisabled;
- for( const css::beans::PropertyValue& rEntry : aOptProp )
+ for( const css::beans::PropertyValue& rEntry : std::as_const(aOptProp) )
{
if ( rEntry.Name == "Property" )
{
diff --git a/vcl/source/graphic/GraphicObject.cxx b/vcl/source/graphic/GraphicObject.cxx
index 49334eb51837..7f6a343b0050 100644
--- a/vcl/source/graphic/GraphicObject.cxx
+++ b/vcl/source/graphic/GraphicObject.cxx
@@ -83,7 +83,8 @@ void SearchForGraphics(uno::Reference<uno::XInterface> const & xInterface,
Reference<XNameContainer> xContainer(xInterface, UNO_QUERY);
if (xContainer.is())
{
- for (OUString const & rName : xContainer->getElementNames())
+ const css::uno::Sequence<OUString> aElementNames = xContainer->getElementNames();
+ for (OUString const & rName : aElementNames)
{
uno::Reference<XInterface> xInnerInterface;
xContainer->getByName(rName) >>= xInnerInterface;
diff --git a/vcl/source/graphic/UnoGraphicProvider.cxx b/vcl/source/graphic/UnoGraphicProvider.cxx
index 2ab3b2f38b99..c5919770402c 100644
--- a/vcl/source/graphic/UnoGraphicProvider.cxx
+++ b/vcl/source/graphic/UnoGraphicProvider.cxx
@@ -341,7 +341,7 @@ uno::Reference< ::graphic::XGraphic > SAL_CALL GraphicProvider::queryGraphic( co
sal_uInt16 nExtWidth = 0;
sal_uInt16 nExtHeight = 0;
sal_uInt16 nExtMapMode = 0;
- for( const auto& rProp : aFilterData )
+ for( const auto& rProp : std::as_const(aFilterData) )
{
const OUString aName( rProp.Name );
const uno::Any aValue( rProp.Value );
@@ -562,7 +562,7 @@ void ImplApplyBitmapResolution( ::Graphic& rGraphic, sal_Int32 nImageResolution,
ImplApplyBitmapScaling( rGraphic, nDestPixelWidth, nDestPixelHeight );
}
-void ImplApplyFilterData( ::Graphic& rGraphic, uno::Sequence< beans::PropertyValue >& rFilterData )
+void ImplApplyFilterData( ::Graphic& rGraphic, const uno::Sequence< beans::PropertyValue >& rFilterData )
{
/* this method applies following attributes to the graphic, in the first step the
cropping area (logical size in 100thmm) is applied, in the second step the resolution
diff --git a/vcl/source/uitest/uno/uiobject_uno.cxx b/vcl/source/uitest/uno/uiobject_uno.cxx
index d4a88f7513f6..714f16a72dbc 100644
--- a/vcl/source/uitest/uno/uiobject_uno.cxx
+++ b/vcl/source/uitest/uno/uiobject_uno.cxx
@@ -115,7 +115,7 @@ void SAL_CALL UIObjectUnoObj::executeAction(const OUString& rAction, const css::
SolarMutexGuard aGuard;
StringMap aMap;
- for (const auto& rPropVal : mPropValues)
+ for (const auto& rPropVal : std::as_const(mPropValues))
{
OUString aVal;
if (!(rPropVal.Value >>= aVal))
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index df1a8c7bac8c..fda6c7bbbd2d 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -1364,7 +1364,7 @@ void PrintDialog::setupOptionalUI()
sal_Int64 nMinValue = 0, nMaxValue = 0;
OUString aGroupingHint;
- for( const beans::PropertyValue& rEntry : aOptProp )
+ for( const beans::PropertyValue& rEntry : std::as_const(aOptProp) )
{
if ( rEntry.Name == "ID" )
{
@@ -1586,7 +1586,7 @@ void PrintDialog::setupOptionalUI()
continue;
// iterate options
- for( const auto& rChoice : aChoices )
+ for( const auto& rChoice : std::as_const(aChoices) )
{
pList->InsertEntry( rChoice );
}
diff --git a/vcl/unx/generic/dtrans/config.cxx b/vcl/unx/generic/dtrans/config.cxx
index 2e65e4f42d64..f2926ef9ec78 100644
--- a/vcl/unx/generic/dtrans/config.cxx
+++ b/vcl/unx/generic/dtrans/config.cxx
@@ -71,7 +71,7 @@ DtransX11ConfigItem::DtransX11ConfigItem() :
m_nSelectionTimeout( 3 )
{
Sequence<OUString> aKeys { SELECTION_PROPERTY };
- Sequence< Any > aValues = GetProperties( aKeys );
+ const Sequence< Any > aValues = GetProperties( aKeys );
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "found %" SAL_PRIdINT32 " properties for %s\n", aValues.getLength(), SELECTION_PROPERTY );
#endif
diff --git a/vcl/unx/gtk/a11y/atktextattributes.cxx b/vcl/unx/gtk/a11y/atktextattributes.cxx
index 6f3a7c5075e0..0ba7fd561862 100644
--- a/vcl/unx/gtk/a11y/atktextattributes.cxx
+++ b/vcl/unx/gtk/a11y/atktextattributes.cxx
@@ -925,7 +925,7 @@ TabStopList2String( const uno::Any& rAny, bool default_tabs )
{
sal_Unicode lastFillChar = ' ';
- for( const auto& rTabStop : theTabStops )
+ for( const auto& rTabStop : std::as_const(theTabStops) )
{
bool is_default_tab = (style::TabAlign_DEFAULT == rTabStop.Alignment);
diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
index a6d8ab7d1e76..e9b16217882b 100644
--- a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
+++ b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
@@ -1150,7 +1150,7 @@ void SalGtkFilePicker::HandleSetListValue(GtkComboBox *pWidget, sal_Int16 nContr
{
Sequence< OUString > aStringList;
rValue >>= aStringList;
- for (const auto& rString : aStringList)
+ for (const auto& rString : std::as_const(aStringList))
{
ComboBoxAppendText(pWidget, rString);
if (!bVersionWidthUnset)
@@ -1920,7 +1920,7 @@ void SalGtkFilePicker::SetFilters()
{ // it's a filter group
css::uno::Sequence< css::beans::StringPair > aSubFilters;
filter.getSubFilters( aSubFilters );
- for( const auto& rSubFilter : aSubFilters )
+ for( const auto& rSubFilter : std::as_const(aSubFilters) )
aAllFormats.insert(rSubFilter.Second);
}
else
diff --git a/vcl/unx/gtk/salprn-gtk.cxx b/vcl/unx/gtk/salprn-gtk.cxx
index 695b778b59ad..e5e17a5ec9e1 100644
--- a/vcl/unx/gtk/salprn-gtk.cxx
+++ b/vcl/unx/gtk/salprn-gtk.cxx
@@ -432,7 +432,7 @@ GtkPrintDialog::impl_initCustomTab()
if (!aOptProp.hasElements())
continue;
- for (const beans::PropertyValue& rEntry : aOptProp)
+ for (const beans::PropertyValue& rEntry : std::as_const(aOptProp))
{
if ( rEntry.Name == "Text" )
{
@@ -608,7 +608,7 @@ GtkPrintDialog::impl_initCustomTab()
{
pWidget = lcl_combo_box_text_new();
- for (const auto& rChoice : aChoices)
+ for (const auto& rChoice : std::as_const(aChoices))
{
lcl_combo_box_text_append(pWidget,
OUStringToOString(rChoice, RTL_TEXTENCODING_UTF8).getStr());
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index f9d0fb965914..78381da7c155 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -1220,7 +1220,7 @@ public:
bHasLoadedAll = true;
css::uno::Reference<css::container::XNameAccess> xRef(ImageTree::get().getNameAccess());
- css::uno::Sequence< OUString > aAllIcons = xRef->getElementNames();
+ const css::uno::Sequence< OUString > aAllIcons = xRef->getElementNames();
for (const auto& rIcon : aAllIcons)
{
commit 2dfb192edfd1ab10e9d39e265e26ac6db93ac755
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Aug 15 15:01:55 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Aug 15 20:23:50 2019 +0200
loplugin:sequenceloop in test..toolkit
Change-Id: Ic8dad06c535b0af713bfe7cd46e601c8ea7ba6c7
Reviewed-on: https://gerrit.libreoffice.org/77531
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/test/source/beans/xpropertyset.cxx b/test/source/beans/xpropertyset.cxx
index c1638ca0e548..4abb48c44d88 100644
--- a/test/source/beans/xpropertyset.cxx
+++ b/test/source/beans/xpropertyset.cxx
@@ -273,7 +273,7 @@ void XPropertySet::fillPropsToTest(const uno::Reference<beans::XPropertySetInfo>
if (maPropsToTest.initialized)
return;
- uno::Sequence<beans::Property> aProps = xPropInfo->getProperties();
+ const uno::Sequence<beans::Property> aProps = xPropInfo->getProperties();
// some properties should not be changed in a unspecific way.
// TODO: Maybe we should mark these properties read-only, instead of
diff --git a/test/source/sheet/xdatabaserange.cxx b/test/source/sheet/xdatabaserange.cxx
index 756d204ff597..074f4c178338 100644
--- a/test/source/sheet/xdatabaserange.cxx
+++ b/test/source/sheet/xdatabaserange.cxx
@@ -64,7 +64,7 @@ void XDatabaseRange::testGetSubtotalDescriptor()
void XDatabaseRange::testGetSortDescriptor()
{
uno::Reference< sheet::XDatabaseRange > xDBRange(init("SortDescriptor"), UNO_QUERY_THROW);
- uno::Sequence< beans::PropertyValue > xSortDescr = xDBRange->getSortDescriptor();
+ const uno::Sequence< beans::PropertyValue > xSortDescr = xDBRange->getSortDescriptor();
for (const beans::PropertyValue& aProp : xSortDescr)
{
//std::cout << "Prop " << i << " Name: " << OUString(aProp.Name) << std::endl;
diff --git a/test/source/sheet/xfunctiondescriptions.cxx b/test/source/sheet/xfunctiondescriptions.cxx
index 5c53b52971ac..d8cfd17d28f4 100644
--- a/test/source/sheet/xfunctiondescriptions.cxx
+++ b/test/source/sheet/xfunctiondescriptions.cxx
@@ -42,7 +42,7 @@ void XFunctionDescriptions::testGetById()
OUString aName1;
uno::Sequence<beans::PropertyValue> aProps1;
CPPUNIT_ASSERT(xFD->getByIndex(nNumber) >>= aProps1);
- for (const auto& aProp : aProps1)
+ for (const auto& aProp : std::as_const(aProps1))
{
if (aProp.Name == "Id")
aId1 = aProp.Value.get<sal_Int32>();
@@ -53,7 +53,7 @@ void XFunctionDescriptions::testGetById()
// fetch the same descriptions by its id
sal_Int32 aId2 = 0;
OUString aName2;
- uno::Sequence<beans::PropertyValue> aProps2 = xFD->getById(aId1);
+ const uno::Sequence<beans::PropertyValue> aProps2 = xFD->getById(aId1);
CPPUNIT_ASSERT_MESSAGE("Received empty FunctionDescriptions from getById()",
aProps2.hasElements());
for (const auto& aProp : aProps2)
diff --git a/test/source/sheet/xsheetcellrangecontainer.cxx b/test/source/sheet/xsheetcellrangecontainer.cxx
index be3c7453a2a0..3dfa1a5eecd9 100644
--- a/test/source/sheet/xsheetcellrangecontainer.cxx
+++ b/test/source/sheet/xsheetcellrangecontainer.cxx
@@ -42,7 +42,7 @@ void XSheetCellRangeContainer::testAddRemoveRangeAddress()
CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to remove CellRangeAddress (count)", cnt - 1,
xSCRC->getCount());
- uno::Sequence<table::CellRangeAddress> aAfterRemoveAddr = xSCRC->getRangeAddresses();
+ const uno::Sequence<table::CellRangeAddress> aAfterRemoveAddr = xSCRC->getRangeAddresses();
for (auto const& addr : aAfterRemoveAddr)
{
CPPUNIT_ASSERT_MESSAGE("Unable to remove CellRangeAddress (entry)", aAddr[0] != addr);
@@ -71,7 +71,7 @@ void XSheetCellRangeContainer::testAddRemoveRangeAddresses()
CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to remove CellRangeAddresses (count)", cnt - 2,
xSCRC->getCount());
- uno::Sequence<table::CellRangeAddress> aAfterRemoveAddr = xSCRC->getRangeAddresses();
+ const uno::Sequence<table::CellRangeAddress> aAfterRemoveAddr = xSCRC->getRangeAddresses();
for (auto const& addr : aAfterRemoveAddr)
{
CPPUNIT_ASSERT_MESSAGE("Unable to remove CellRangeAddresses (entry: first)",
diff --git a/test/source/sheet/xsheetfilterableex.cxx b/test/source/sheet/xsheetfilterableex.cxx
index 46759b224ae3..5730bde11e18 100644
--- a/test/source/sheet/xsheetfilterableex.cxx
+++ b/test/source/sheet/xsheetfilterableex.cxx
@@ -35,7 +35,7 @@ void XSheetFilterableEx::testCreateFilterDescriptorByObject()
uno::Reference<sheet::XSheetFilterDescriptor> xSFD = xSFEx->createFilterDescriptorByObject(xSF);
CPPUNIT_ASSERT_MESSAGE("no XSheetFilterDescriptor", xSFD.is());
- uno::Sequence<sheet::TableFilterField> xTFF = xSFD->getFilterFields();
+ const uno::Sequence<sheet::TableFilterField> xTFF = xSFD->getFilterFields();
CPPUNIT_ASSERT_MESSAGE("The gained XSheetFilterDescriptor is empty", xTFF.hasElements());
for (const auto& field : xTFF)
diff --git a/test/source/sheet/xsheetpagebreak.cxx b/test/source/sheet/xsheetpagebreak.cxx
index 656a33a0cb0b..7f96aa3be557 100644
--- a/test/source/sheet/xsheetpagebreak.cxx
+++ b/test/source/sheet/xsheetpagebreak.cxx
@@ -44,7 +44,7 @@ void XSheetPageBreak::testRemoveAllManualPageBreaks()
xSheetPageBreak->removeAllManualPageBreaks();
- uno::Sequence< sheet::TablePageBreakData > xColPageBreak = xSheetPageBreak->getColumnPageBreaks();
+ const uno::Sequence< sheet::TablePageBreakData > xColPageBreak = xSheetPageBreak->getColumnPageBreaks();
sal_Int32 manualColPageBreaks = 0;
for ( const auto & data : xColPageBreak )
{
@@ -54,7 +54,7 @@ void XSheetPageBreak::testRemoveAllManualPageBreaks()
CPPUNIT_ASSERT_EQUAL_MESSAGE("Found manual column page break",
sal_Int32(0), manualColPageBreaks);
- uno::Sequence< sheet::TablePageBreakData > xRowPageBreak = xSheetPageBreak->getRowPageBreaks();
+ const uno::Sequence< sheet::TablePageBreakData > xRowPageBreak = xSheetPageBreak->getRowPageBreaks();
sal_Int32 manualRowPageBreaks = 0;
for ( const auto & data : xRowPageBreak )
{
diff --git a/test/source/text/textsettings.cxx b/test/source/text/textsettings.cxx
index 8371ed54c38d..6e64264f0e0f 100644
--- a/test/source/text/textsettings.cxx
+++ b/test/source/text/textsettings.cxx
@@ -31,7 +31,7 @@ bool isPropertyReadOnly(css::uno::Reference<css::beans::XPropertySet> const& rxP
{
css::uno::Reference<css::beans::XPropertySetInfo> xPropertySetInfo(
rxPropertySet->getPropertySetInfo());
- css::uno::Sequence<css::beans::Property> xProperties = xPropertySetInfo->getProperties();
+ const css::uno::Sequence<css::beans::Property> xProperties = xPropertySetInfo->getProperties();
for (auto const& rProperty : xProperties)
{
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index 9505a6e907db..b385ce385958 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -1414,7 +1414,7 @@ vcl::Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp,
css::uno::Sequence< css::beans::NamedValue > aProps;
if( anyHandle >>= aProps )
{
- for( const css::beans::NamedValue& rProp : aProps )
+ for( const css::beans::NamedValue& rProp : std::as_const(aProps) )
{
if ( rProp.Name == "WINDOW" )
rProp.Value >>= nWindowHandle;
@@ -1647,7 +1647,7 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::createSystemChild( con
css::uno::Sequence< css::beans::NamedValue > aProps;
if( Parent >>= aProps )
{
- for( const css::beans::NamedValue& rProp : aProps )
+ for( const css::beans::NamedValue& rProp : std::as_const(aProps) )
{
if ( rProp.Name == "WINDOW" )
rProp.Value >>= nWindowHandle;
diff --git a/toolkit/source/awt/vclxwindow1.cxx b/toolkit/source/awt/vclxwindow1.cxx
index 16f696a1c138..8b0cbe1320b3 100644
--- a/toolkit/source/awt/vclxwindow1.cxx
+++ b/toolkit/source/awt/vclxwindow1.cxx
@@ -55,7 +55,7 @@ void VCLXWindow::SetSystemParent_Impl( const css::uno::Any& rHandle )
css::uno::Sequence< css::beans::NamedValue > aProps;
if( rHandle >>= aProps )
{
- for( const css::beans::NamedValue& rProp : aProps )
+ for( const css::beans::NamedValue& rProp : std::as_const(aProps) )
{
if ( rProp.Name == "WINDOW" )
rProp.Value >>= nHandle;
diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx
index 8d96999406a3..d03331a5876f 100644
--- a/toolkit/source/awt/vclxwindows.cxx
+++ b/toolkit/source/awt/vclxwindows.cxx
@@ -2155,7 +2155,7 @@ void SAL_CALL VCLXListBox::itemListChanged( const EventObject& i_rEvent )
Reference< XItemList > xItemList( i_rEvent.Source, uno::UNO_QUERY_THROW );
- uno::Sequence< beans::Pair< OUString, OUString > > aItems = xItemList->getAllItems();
+ const uno::Sequence< beans::Pair< OUString, OUString > > aItems = xItemList->getAllItems();
for ( const auto& rItem : aItems )
{
OUString aLocalizationKey( rItem.First );
@@ -4615,7 +4615,7 @@ void SAL_CALL VCLXComboBox::itemListChanged( const EventObject& i_rEvent )
Reference< XItemList > xItemList( i_rEvent.Source, uno::UNO_QUERY_THROW );
- uno::Sequence< beans::Pair< OUString, OUString > > aItems = xItemList->getAllItems();
+ const uno::Sequence< beans::Pair< OUString, OUString > > aItems = xItemList->getAllItems();
for ( const auto& rItem : aItems )
{
OUString aLocalizationKey( rItem.First );
diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx
index e08d8c24e3e8..f81468526b13 100644
--- a/toolkit/source/controls/controlmodelcontainerbase.cxx
+++ b/toolkit/source/controls/controlmodelcontainerbase.cxx
@@ -914,7 +914,7 @@ void ControlModelContainerBase::implUpdateGroupStructure()
maGroups.clear();
- Sequence< Reference< XControlModel > > aControlModels = getControlModels();
+ const Sequence< Reference< XControlModel > > aControlModels = getControlModels();
// in extreme we have as much groups as controls
maGroups.reserve( aControlModels.getLength() );
@@ -1436,7 +1436,7 @@ sal_Bool ControlContainerBase::setModel( const Reference< XControlModel >& rxMod
if ( getModel().is() )
{
- Sequence< Reference< XControl > > aControls = getControls();
+ const Sequence< Reference< XControl > > aControls = getControls();
for ( const Reference< XControl >& rCtrl : aControls )
removeControl( rCtrl );
@@ -1460,7 +1460,7 @@ sal_Bool ControlContainerBase::setModel( const Reference< XControlModel >& rxMod
Reference< XNameAccess > xNA( getModel(), UNO_QUERY );
if ( xNA.is() )
{
- Sequence< OUString > aNames = xNA->getElementNames();
+ const Sequence< OUString > aNames = xNA->getElementNames();
Reference< XControlModel > xCtrlModel;
for( const OUString& rName : aNames )
@@ -1818,7 +1818,7 @@ ControlModelContainerBase::updateUserFormChildren( const Reference< XNameContain
// global list of containers
if ( xProps.is() )
xProps->setPropertyValue( GetPropertyName( BASEPROPERTY_USERFORMCONTAINEES ), uno::makeAny( uno::Reference< XNameContainer >() ) );
- Sequence< OUString > aChildNames = xChildContainer->getElementNames();
+ const Sequence< OUString > aChildNames = xChildContainer->getElementNames();
for ( const auto& rName : aChildNames )
updateUserFormChildren( xAllChildren, rName, Operation, Reference< XControlModel > () );
}
@@ -1834,7 +1834,7 @@ ControlModelContainerBase::updateUserFormChildren( const Reference< XNameContain
Reference< XPropertySet > xProps( xChildContainer, UNO_QUERY );
if ( xProps.is() )
xProps->setPropertyValue( GetPropertyName( BASEPROPERTY_USERFORMCONTAINEES ), uno::makeAny( xAllChildren ) );
- Sequence< OUString > aChildNames = xChildContainer->getElementNames();
+ const Sequence< OUString > aChildNames = xChildContainer->getElementNames();
for ( const auto& rName : aChildNames )
{
Reference< XControlModel > xChildTarget( xChildContainer->getByName( rName ), UNO_QUERY );
diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx
index dede0319d66d..e67f33bef885 100644
--- a/toolkit/source/controls/dialogcontrol.cxx
+++ b/toolkit/source/controls/dialogcontrol.cxx
@@ -210,7 +210,7 @@ UnoControlDialogModel::UnoControlDialogModel( const UnoControlDialogModel& rMode
Reference< XNameContainer > xSrcNameCont( const_cast< UnoControlDialogModel& >(rModel).getPropertyValue( GetPropertyName( BASEPROPERTY_USERFORMCONTAINEES ) ), UNO_QUERY );
Reference<XNameContainer > xNameCont( new SimpleNamedThingContainer< XControlModel > );
- uno::Sequence< OUString > sNames = xSrcNameCont->getElementNames();
+ const uno::Sequence< OUString > sNames = xSrcNameCont->getElementNames();
for ( OUString const & name : sNames )
{
if ( xSrcNameCont->hasByName( name ) )
@@ -792,7 +792,7 @@ void UnoMultiPageControl::createPeer( const Reference< XToolkit > & rxToolkit, c
UnoControlContainer::createPeer( rxToolkit, rParentPeer );
- uno::Sequence< uno::Reference< awt::XControl > > aCtrls = getControls();
+ const uno::Sequence< uno::Reference< awt::XControl > > aCtrls = getControls();
for( const auto& rCtrl : aCtrls )
bindPage( rCtrl );
sal_Int32 nActiveTab(0);
diff --git a/toolkit/source/controls/geometrycontrolmodel.cxx b/toolkit/source/controls/geometrycontrolmodel.cxx
index 38827556bb0b..f47283a0b9e2 100644
--- a/toolkit/source/controls/geometrycontrolmodel.cxx
+++ b/toolkit/source/controls/geometrycontrolmodel.cxx
@@ -400,7 +400,7 @@
Reference< XNameContainer > xEventCont = xEventsSupplier->getEvents();
Reference< XNameContainer > xCloneEventCont = xCloneEventsSupplier->getEvents();
- css::uno::Sequence< OUString > aNames =
+ const css::uno::Sequence< OUString > aNames =
xEventCont->getElementNames();
for( const OUString& aName : aNames )
@@ -533,7 +533,7 @@
);
// now loop through our own props
- for ( const Property& rProp : aProps )
+ for ( const Property& rProp : std::as_const(aProps) )
{
// look for the current property in the properties of our aggregate
const Property* pAggPropPos = ::std::find_if( aAggregateProps.begin(), aAggregateProps.end(), PropertyNameEqual( rProp.Name ) );
diff --git a/toolkit/source/controls/stdtabcontroller.cxx b/toolkit/source/controls/stdtabcontroller.cxx
index 6d0bc4621809..3eba0ee86288 100644
--- a/toolkit/source/controls/stdtabcontroller.cxx
+++ b/toolkit/source/controls/stdtabcontroller.cxx
@@ -96,7 +96,7 @@ bool StdTabController::ImplCreateComponentSequence(
}
bool bOK = true;
- for ( const Reference< XControl >& xCtrl : rControls )
+ for ( const Reference< XControl >& xCtrl : std::as_const(rControls) )
{
// Get the matching control for this model
if ( !xCtrl.is() )
@@ -259,7 +259,7 @@ void StdTabController::autoTabOrder( )
// insert sort algorithm
std::vector< ComponentEntry > aCtrls;
aCtrls.reserve(nCtrls);
- for ( const Reference< XWindow >& rComponent : aCompSeq )
+ for ( const Reference< XWindow >& rComponent : std::as_const(aCompSeq) )
{
XWindow* pC = rComponent.get();
ComponentEntry newEntry;
diff --git a/toolkit/source/controls/tabpagecontainer.cxx b/toolkit/source/controls/tabpagecontainer.cxx
index f488687f5d75..2a67e44e756b 100644
--- a/toolkit/source/controls/tabpagecontainer.cxx
+++ b/toolkit/source/controls/tabpagecontainer.cxx
@@ -308,7 +308,7 @@ void UnoControlTabPageContainer::updateFromModel()
ContainerEvent aEvent;
aEvent.Source = getModel();
- Sequence< Reference< XControl > > aControls = getControls();
+ const Sequence< Reference< XControl > > aControls = getControls();
for ( const Reference< XControl >& rCtrl : aControls )
{
diff --git a/toolkit/source/controls/tabpagemodel.cxx b/toolkit/source/controls/tabpagemodel.cxx
index 7d0ff366ba73..27e2f3342c94 100644
--- a/toolkit/source/controls/tabpagemodel.cxx
+++ b/toolkit/source/controls/tabpagemodel.cxx
@@ -130,7 +130,7 @@ void SAL_CALL UnoControlTabPageModel::initialize (const Sequence<Any>& rArgument
Reference<container::XNameContainer > xDialogModel = awt::UnoControlDialogModelProvider::create( m_xContext, sURL );
if ( xDialogModel.is() )
{
- Sequence< OUString> aNames = xDialogModel->getElementNames();
+ const Sequence< OUString> aNames = xDialogModel->getElementNames();
for(const OUString& rName : aNames)
{
try
diff --git a/toolkit/source/controls/unocontrolcontainer.cxx b/toolkit/source/controls/unocontrolcontainer.cxx
index 77eb161f8ac9..5b9889a6bb68 100644
--- a/toolkit/source/controls/unocontrolcontainer.cxx
+++ b/toolkit/source/controls/unocontrolcontainer.cxx
@@ -295,7 +295,7 @@ static void implUpdateVisibility
const uno::Reference< awt::XControlContainer >& xControlContainer
)
{
- uno::Sequence< uno::Reference< awt::XControl > >
+ const uno::Sequence< uno::Reference< awt::XControl > >
aCtrls = xControlContainer->getControls();
bool bCompleteVisible = (nDialogStep == 0);
for( const uno::Reference< awt::XControl >& xControl : aCtrls )
@@ -406,7 +406,7 @@ void UnoControlContainer::dispose( )
maCListeners.disposeAndClear( aDisposeEvent );
- uno::Sequence< uno::Reference< awt::XControl > > aCtrls = getControls();
+ const uno::Sequence< uno::Reference< awt::XControl > > aCtrls = getControls();
for( uno::Reference< awt::XControl > const & control : aCtrls )
{
diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx
index 8a287b710109..8b9b09fe489f 100644
--- a/toolkit/source/controls/unocontrolmodel.cxx
+++ b/toolkit/source/controls/unocontrolmodel.cxx
@@ -344,7 +344,7 @@ css::uno::Any UnoControlModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
sBankSymbol = aLocaleInfo.getCurrBankSymbol();
// look for the currency entry (for this language) which has the given bank symbol
- Sequence< Currency2 > aAllCurrencies = aLocaleInfo.getAllCurrencies();
+ const Sequence< Currency2 > aAllCurrencies = aLocaleInfo.getAllCurrencies();
OUString sCurrencySymbol = aLocaleInfo.getCurrSymbol();
if ( sBankSymbol.isEmpty() )
@@ -670,7 +670,7 @@ void UnoControlModel::write( const css::uno::Reference< css::io::XObjectOutputSt
rValue >>= aSeq;
long nEntries = aSeq.getLength();
OutStream->writeLong( nEntries );
- for ( const auto& rVal : aSeq )
+ for ( const auto& rVal : std::as_const(aSeq) )
OutStream->writeUTF( rVal );
}
else if ( rType == cppu::UnoType< cppu::UnoSequenceType<cppu::UnoUnsignedShortType> >::get() )
diff --git a/toolkit/source/helper/vclunohelper.cxx b/toolkit/source/helper/vclunohelper.cxx
index 8fe3609f4b14..3e43f81502a8 100644
--- a/toolkit/source/helper/vclunohelper.cxx
+++ b/toolkit/source/helper/vclunohelper.cxx
@@ -133,7 +133,7 @@ vcl::Region VCLUnoHelper::GetRegion( const css::uno::Reference< css::awt::XRegio
aRegion = pVCLRegion->GetRegion();
else
{
- css::uno::Sequence< css::awt::Rectangle > aRects = rxRegion->getRectangles();
+ const css::uno::Sequence< css::awt::Rectangle > aRects = rxRegion->getRectangles();
for ( const auto& rRect : aRects )
aRegion.Union( VCLRectangle( rRect ) );
}
commit 3c6cb83b80b502975dce89c02401a064872b5ea3
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Aug 15 14:39:03 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Aug 15 20:23:38 2019 +0200
loplugin:sequenceloop in sw
Change-Id: Icda7c89b396e5607ca847c0a8393cb27a2d50c6c
Reviewed-on: https://gerrit.libreoffice.org/77530
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sw/qa/extras/globalfilter/globalfilter.cxx b/sw/qa/extras/globalfilter/globalfilter.cxx
index f9a8acf615f4..0d60df55210b 100644
--- a/sw/qa/extras/globalfilter/globalfilter.cxx
+++ b/sw/qa/extras/globalfilter/globalfilter.cxx
@@ -925,7 +925,7 @@ void Test::testBulletAsImage()
awt::Size aSize;
sal_Int16 nNumberingType = -1;
- for (beans::PropertyValue const & rProperty : aProperties)
+ for (beans::PropertyValue const & rProperty : std::as_const(aProperties))
{
if (rProperty.Name == "NumberingType")
{
@@ -985,7 +985,7 @@ void Test::testBulletAsImage()
awt::Size aSize;
sal_Int16 nNumberingType = -1;
- for (beans::PropertyValue const & rProperty : aProperties)
+ for (beans::PropertyValue const & rProperty : std::as_const(aProperties))
{
if (rProperty.Name == "NumberingType")
{
diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx b/sw/qa/extras/mailmerge/mailmerge.cxx
index 51d80cea19ca..7144bd80f358 100644
--- a/sw/qa/extras/mailmerge/mailmerge.cxx
+++ b/sw/qa/extras/mailmerge/mailmerge.cxx
@@ -177,7 +177,7 @@ public:
void executeMailMerge( bool bDontLoadResult = false )
{
- uno::Sequence< beans::NamedValue > aSeqMailMergeArgs = comphelper::containerToSequence( mMMargs );
+ const uno::Sequence< beans::NamedValue > aSeqMailMergeArgs = comphelper::containerToSequence( mMMargs );
uno::Any res = mxJob->execute( aSeqMailMergeArgs );
bool bOk = true;
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index 7d1f2debc760..5fbe7508cbeb 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -1618,7 +1618,8 @@ DECLARE_ODFEXPORT_TEST(testEmbeddedPdf, "embedded-pdf.odt")
aArgs[0] <<= maTempFile.GetURL();
uno::Reference<container::XNameAccess> xNameAccess(m_xSFactory->createInstanceWithArguments("com.sun.star.packages.zip.ZipFileAccess", aArgs), uno::UNO_QUERY);
bool bHasBitmap = false;
- for (const auto& rElementName : xNameAccess->getElementNames())
+ const uno::Sequence<OUString> aNames = xNameAccess->getElementNames();
+ for (const auto& rElementName : aNames)
{
if (rElementName.startsWith("Pictures") && rElementName.endsWith("png"))
{
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 3c955903a5e5..959a5990744c 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -1905,7 +1905,7 @@ void SwUiWriterTest::testDefaultsOfOutlineNumbering()
css::lang::Locale alocale;
alocale.Language = "en";
alocale.Country = "US";
- uno::Sequence<beans::PropertyValues> aPropVal(xDefNum->getDefaultContinuousNumberingLevels(alocale));
+ const uno::Sequence<beans::PropertyValues> aPropVal(xDefNum->getDefaultContinuousNumberingLevels(alocale));
CPPUNIT_ASSERT_EQUAL(sal_Int32(8), aPropVal.getLength());
for(const auto& rPropValues : aPropVal)
{
@@ -1997,7 +1997,7 @@ void SwUiWriterTest::testTdf81995()
css::lang::Locale alocale;
alocale.Language = "en";
alocale.Country = "US";
- uno::Sequence<uno::Reference<container::XIndexAccess>> aIndexAccess(xDefNum->getDefaultOutlineNumberings(alocale));
+ const uno::Sequence<uno::Reference<container::XIndexAccess>> aIndexAccess(xDefNum->getDefaultOutlineNumberings(alocale));
CPPUNIT_ASSERT_EQUAL(sal_Int32(8), aIndexAccess.getLength());
for(const auto& rIndexAccess : aIndexAccess)
{
@@ -2007,7 +2007,7 @@ void SwUiWriterTest::testTdf81995()
uno::Sequence<beans::PropertyValue> aProps;
rIndexAccess->getByIndex(j) >>= aProps;
CPPUNIT_ASSERT_EQUAL(sal_Int32(12), aProps.getLength());
- for(const beans::PropertyValue& rProp : aProps)
+ for(const beans::PropertyValue& rProp : std::as_const(aProps))
{
uno::Any aAny = rProp.Value;
if(rProp.Name == "Prefix" || rProp.Name == "Suffix" || rProp.Name == "BulletChar" || rProp.Name == "BulletFontName" || rProp.Name == "Transliteration")
diff --git a/sw/qa/extras/unowriter/unowriter.cxx b/sw/qa/extras/unowriter/unowriter.cxx
index ae3fa65be9df..e819cb9d7d7d 100644
--- a/sw/qa/extras/unowriter/unowriter.cxx
+++ b/sw/qa/extras/unowriter/unowriter.cxx
@@ -175,7 +175,7 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testGraphicDesciptorURLBitmap)
static bool ensureAutoTextExistsByTitle(const uno::Reference<text::XAutoTextGroup>& autoTextGroup,
const OUString& autoTextName)
{
- uno::Sequence<OUString> aTitles(autoTextGroup->getTitles());
+ const uno::Sequence<OUString> aTitles(autoTextGroup->getTitles());
for (const auto& rTitle : aTitles)
{
if (rTitle == autoTextName)
@@ -187,7 +187,7 @@ static bool ensureAutoTextExistsByTitle(const uno::Reference<text::XAutoTextGrou
static bool ensureAutoTextExistsByName(const uno::Reference<text::XAutoTextGroup>& autoTextGroup,
const OUString& autoTextName)
{
- uno::Sequence<OUString> aTitles(autoTextGroup->getElementNames());
+ const uno::Sequence<OUString> aTitles(autoTextGroup->getElementNames());
for (const auto& rTitle : aTitles)
{
if (rTitle == autoTextName)
diff --git a/sw/qa/extras/ww8export/ww8export2.cxx b/sw/qa/extras/ww8export/ww8export2.cxx
index 053307cb0d73..58997a1c7e27 100644
--- a/sw/qa/extras/ww8export/ww8export2.cxx
+++ b/sw/qa/extras/ww8export/ww8export2.cxx
@@ -296,7 +296,7 @@ DECLARE_WW8EXPORT_TEST(testTdf104805, "tdf104805.doc")
uno::Reference<container::XIndexAccess> xLevels(xPropertySet->getPropertyValue("NumberingRules"), uno::UNO_QUERY);
uno::Sequence<beans::PropertyValue> aNumberingRule;
xLevels->getByIndex(1) >>= aNumberingRule; // 2nd level
- for (const auto& rPair : aNumberingRule)
+ for (const auto& rPair : std::as_const(aNumberingRule))
{
if (rPair.Name == "Prefix")
// This was "." instead of empty, so the second paragraph was
diff --git a/sw/source/core/crsr/DropDownFormFieldButton.cxx b/sw/source/core/crsr/DropDownFormFieldButton.cxx
index d2c97f382e22..1114a1a97d40 100644
--- a/sw/source/core/crsr/DropDownFormFieldButton.cxx
+++ b/sw/source/core/crsr/DropDownFormFieldButton.cxx
@@ -55,7 +55,7 @@ SwFieldDialog::SwFieldDialog(SwEditWin* parent, sw::mark::IFieldmark* fieldBM, l
if (pListEntries != pParameters->end())
{
pListEntries->second >>= vListEntries;
- for (OUString const& i : vListEntries)
+ for (OUString const& i : std::as_const(vListEntries))
aListBox->InsertEntry(i);
}
diff --git a/sw/source/core/doc/docglos.cxx b/sw/source/core/doc/docglos.cxx
index ea05dac8a66f..8cd47c0e7c3c 100644
--- a/sw/source/core/doc/docglos.cxx
+++ b/sw/source/core/doc/docglos.cxx
@@ -54,7 +54,7 @@ void SwDoc::ReplaceUserDefinedDocumentProperties(
xDocProps->getUserDefinedProperties());
uno::Reference<beans::XPropertySet> xTargetUDSet(xTargetUD,
uno::UNO_QUERY_THROW);
- uno::Sequence<beans::Property> tgtprops
+ const uno::Sequence<beans::Property> tgtprops
= xTargetUDSet->getPropertySetInfo()->getProperties();
for (const auto& rTgtProp : tgtprops) {
@@ -67,7 +67,7 @@ void SwDoc::ReplaceUserDefinedDocumentProperties(
uno::Reference<beans::XPropertySetInfo> xSetInfo
= xSourceUDSet->getPropertySetInfo();
- uno::Sequence<beans::Property> srcprops = xSetInfo->getProperties();
+ const uno::Sequence<beans::Property> srcprops = xSetInfo->getProperties();
for (const auto& rSrcProp : srcprops) {
try {
diff --git a/sw/source/core/doc/docxforms.cxx b/sw/source/core/doc/docxforms.cxx
index dc4088f734a9..950683ed914c 100644
--- a/sw/source/core/doc/docxforms.cxx
+++ b/sw/source/core/doc/docxforms.cxx
@@ -92,7 +92,7 @@ void SwDoc::disposeXForms( )
if( mxXForms.is() )
{
// iterate over all models
- uno::Sequence<OUString> aNames = mxXForms->getElementNames();
+ const uno::Sequence<OUString> aNames = mxXForms->getElementNames();
for( const OUString& rName : aNames )
{
Reference< xforms::XModel > xModel(
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index 5856527a1c8d..8dce2d6731d6 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -1095,7 +1095,7 @@ void SwEditShell::SetClassification(const OUString& rName, SfxClassificationPoli
uno::Reference<style::XStyleFamiliesSupplier> xStyleFamiliesSupplier(xModel, uno::UNO_QUERY);
uno::Reference<container::XNameAccess> xStyleFamilies = xStyleFamiliesSupplier->getStyleFamilies();
uno::Reference<container::XNameAccess> xStyleFamily(xStyleFamilies->getByName("PageStyles"), uno::UNO_QUERY);
- uno::Sequence<OUString> aStyles = xStyleFamily->getElementNames();
+ const uno::Sequence<OUString> aStyles = xStyleFamily->getElementNames();
for (const OUString& rPageStyleName : aStyles)
{
@@ -1616,7 +1616,7 @@ void SwEditShell::SetWatermark(const SfxWatermarkItem& rWatermark)
uno::Reference<style::XStyleFamiliesSupplier> xStyleFamiliesSupplier(xModel, uno::UNO_QUERY);
uno::Reference<container::XNameAccess> xStyleFamilies = xStyleFamiliesSupplier->getStyleFamilies();
uno::Reference<container::XNameAccess> xStyleFamily(xStyleFamilies->getByName("PageStyles"), uno::UNO_QUERY);
- uno::Sequence<OUString> aStyles = xStyleFamily->getElementNames();
+ const uno::Sequence<OUString> aStyles = xStyleFamily->getElementNames();
for (const OUString& rPageStyleName : aStyles)
{
diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx
index b42a91e56d65..8c91051135f9 100644
--- a/sw/source/core/fields/authfld.cxx
+++ b/sw/source/core/fields/authfld.cxx
@@ -636,7 +636,7 @@ bool SwAuthorityField::PutValue( const Any& rAny, sal_uInt16 /*nWhichId*/ )
OUStringBuffer sBuf;
comphelper::string::padToLength(sBuf, AUTH_FIELD_ISBN, TOX_STYLE_DELIMITER);
OUString sToSet(sBuf.makeStringAndClear());
- for(const PropertyValue& rParam : aParam)
+ for(const PropertyValue& rParam : std::as_const(aParam))
{
const sal_Int32 nFound = lcl_Find(rParam.Name);
if(nFound >= 0)
diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx
index 49d6a9b72c0a..f0ad74a61bb5 100644
--- a/sw/source/core/unocore/unochart.cxx
+++ b/sw/source/core/unocore/unochart.cxx
@@ -667,7 +667,7 @@ uno::Reference< chart2::data::XDataSource > SwChartDataProvider::Impl_createData
//!! by proceeding this way we automatically get rid of
//!! multiple listed or overlapping cell ranges which should
//!! just be ignored silently
- for (const OUString& rSubRange : aSubRanges)
+ for (const OUString& rSubRange : std::as_const(aSubRanges))
{
OUString aTableName, aStartCell, aEndCell;
bool bOk2 = GetTableAndCellsFromRangeRep(
@@ -1233,7 +1233,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume
GetSubranges( aCellRanges, aSortedRanges, false /*sub ranges should already be normalized*/ );
SortSubranges( aSortedRanges, (nDtaSrcIsColumns == 1) );
OUString aSortedCellRanges;
- for (const OUString& rSortedRange : aSortedRanges)
+ for (const OUString& rSortedRange : std::as_const(aSortedRanges))
{
if (!aSortedCellRanges.isEmpty())
aSortedCellRanges += ";";
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx
index d18d9593852e..ddb0d1263768 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -1238,7 +1238,7 @@ void makeRedline( SwPaM const & rPaM,
aEntries.reserve(aRevertProperties.getLength());
sal_uInt16 nStyleId = USHRT_MAX;
sal_uInt16 nNumId = USHRT_MAX;
- for (const auto& rRevertProperty : aRevertProperties)
+ for (const auto& rRevertProperty : std::as_const(aRevertProperties))
{
const OUString &rPropertyName = rRevertProperty.Name;
SfxItemPropertySimpleEntry const* pEntry = rPropSet.getPropertyMap().getByName(rPropertyName);
diff --git a/sw/source/core/unocore/unoevent.cxx b/sw/source/core/unocore/unoevent.cxx
index 0d00638da1dd..c1b50004d150 100644
--- a/sw/source/core/unocore/unoevent.cxx
+++ b/sw/source/core/unocore/unoevent.cxx
@@ -141,7 +141,7 @@ void SwHyperlinkEventDescriptor::copyMacrosFromNameReplace(
container::XNameReplace> const & xReplace)
{
// iterate over all names (all names that *we* support)
- Sequence<OUString> aNames = getElementNames();
+ const Sequence<OUString> aNames = getElementNames();
for(const OUString& rName : aNames)
{
// copy element for that name
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index 4f974a3230d3..24bef2288a44 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -1479,7 +1479,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any&
else if(aValue >>= aParam)
{
tools::PolyPolygon aPoly(static_cast<sal_uInt16>(aParam.getLength()));
- for(const ::drawing::PointSequence& rPointSeq : aParam)
+ for(const ::drawing::PointSequence& rPointSeq : std::as_const(aParam))
{
sal_Int32 nPoints = rPointSeq.getLength();
const ::awt::Point* pPoints = rPointSeq.getConstArray();
diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx
index 5a08d64b1068..fac4fcec2dc4 100644
--- a/sw/source/core/unocore/unoidx.cxx
+++ b/sw/source/core/unocore/unoidx.cxx
@@ -2677,7 +2677,7 @@ SwXDocumentIndex::TokenAccess_Impl::replaceByIndex(
}
OUStringBuffer sPattern;
- for(const beans::PropertyValues& rToken : aSeq)
+ for(const beans::PropertyValues& rToken : std::as_const(aSeq))
{
const beans::PropertyValue* pProperties = rToken.getConstArray();
const sal_Int32 nProperties = rToken.getLength();
diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx
index 87a190b322c0..0aec0dd8e16b 100644
--- a/sw/source/filter/html/htmlforw.cxx
+++ b/sw/source/filter/html/htmlforw.cxx
@@ -124,7 +124,7 @@ static void lcl_html_outEvents( SvStream& rStrm,
if( nPos == nCount )
return;
- uno::Sequence< script::ScriptEventDescriptor > aDescs =
+ const uno::Sequence< script::ScriptEventDescriptor > aDescs =
xEventManager->getScriptEvents( nPos );
if( !aDescs.hasElements() )
return;
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index 1357b828c5dd..2fe1d4edc369 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -206,7 +206,7 @@ void SwHTMLWriter::SetupFilterOptions(const OUString& rFilterOptions)
mbEmbedImages = true;
}
- uno::Sequence<OUString> aOptionSeq = comphelper::string::convertCommaSeparated(rFilterOptions);
+ const uno::Sequence<OUString> aOptionSeq = comphelper::string::convertCommaSeparated(rFilterOptions);
const OUString aXhtmlNsKey("xhtmlns=");
for (const auto& rOption : aOptionSeq)
{
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index defd85643aea..af6301741cf6 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -814,7 +814,7 @@ void DocxAttributeOutput::WriteSdtBlock( sal_Int32& nSdtPrToken,
}
if (nSdtPrToken == FSNS( XML_w, XML_date ) || nSdtPrToken == FSNS( XML_w, XML_docPartObj ) || nSdtPrToken == FSNS( XML_w, XML_docPartList ) || nSdtPrToken == FSNS( XML_w14, XML_checkbox )) {
- uno::Sequence<xml::FastAttribute> aChildren = pSdtPrTokenChildren->getFastAttributes();
+ const uno::Sequence<xml::FastAttribute> aChildren = pSdtPrTokenChildren->getFastAttributes();
for( const auto& rChild : aChildren )
m_pSerializer->singleElement( rChild.Token,
FSNS(XML_w, XML_val), rChild.Value.toUtf8() );
@@ -2483,7 +2483,7 @@ void lclProcessRecursiveGrabBag(sal_Int32 aElementId, const css::uno::Sequence<c
}
}
- for (const auto& rAttribute : aAttributes)
+ for (const auto& rAttribute : std::as_const(aAttributes))
{
uno::Any aAny = rAttribute.Value;
OString aValue;
@@ -3630,14 +3630,14 @@ sal_Int32 lcl_getWordCompatibilityMode( const SwDoc& rDoc )
uno::Sequence< beans::PropertyValue > propList;
xPropSet->getPropertyValue( UNO_NAME_MISC_OBJ_INTEROPGRABBAG ) >>= propList;
- for ( const auto& rProp : propList )
+ for ( const auto& rProp : std::as_const(propList) )
{
if ( rProp.Name == "CompatSettings" )
{
css::uno::Sequence< css::beans::PropertyValue > aCurrentCompatSettings;
rProp.Value >>= aCurrentCompatSettings;
- for ( const auto& rCurrentCompatSetting : aCurrentCompatSettings )
+ for ( const auto& rCurrentCompatSetting : std::as_const(aCurrentCompatSettings) )
{
uno::Sequence< beans::PropertyValue > aCompatSetting;
rCurrentCompatSetting.Value >>= aCompatSetting;
@@ -3646,7 +3646,7 @@ sal_Int32 lcl_getWordCompatibilityMode( const SwDoc& rDoc )
OUString sUri;
OUString sVal;
- for ( const auto& rPropVal : aCompatSetting )
+ for ( const auto& rPropVal : std::as_const(aCompatSetting) )
{
if ( rPropVal.Name == "name" ) rPropVal.Value >>= sName;
if ( rPropVal.Name == "uri" ) rPropVal.Value >>= sUri;
@@ -3774,7 +3774,7 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t
else if (rGrabBagElement.first == "TableStyleLook")
{
FastAttributeList* pAttributeList = FastSerializerHelper::createAttrList();
- uno::Sequence<beans::PropertyValue> aAttributeList = rGrabBagElement.second.get< uno::Sequence<beans::PropertyValue> >();
+ const uno::Sequence<beans::PropertyValue> aAttributeList = rGrabBagElement.second.get< uno::Sequence<beans::PropertyValue> >();
for (const auto& rAttribute : aAttributeList)
{
@@ -3804,7 +3804,7 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t
else if (rGrabBagElement.first == "TablePosition" )
{
FastAttributeList *attrListTablePos = FastSerializerHelper::createAttrList( );
- uno::Sequence<beans::PropertyValue> aTablePosition = rGrabBagElement.second.get<uno::Sequence<beans::PropertyValue> >();
+ const uno::Sequence<beans::PropertyValue> aTablePosition = rGrabBagElement.second.get<uno::Sequence<beans::PropertyValue> >();
// look for a surrounding frame and take it's position values
const ww8::Frame* pFrame = m_rExport.GetFloatingTableFrame();
if( pFrame )
@@ -4378,7 +4378,7 @@ void DocxAttributeOutput::LatentStyles()
// Extract default attributes first.
sax_fastparser::FastAttributeList* pAttributeList = FastSerializerHelper::createAttrList();
uno::Sequence<beans::PropertyValue> aLsdExceptions;
- for (const auto& rLatentStyle : aLatentStyles)
+ for (const auto& rLatentStyle : std::as_const(aLatentStyles))
{
if (sal_Int32 nToken = DocxStringGetToken(aDefaultTokens, rLatentStyle.Name))
pAttributeList->add(FSNS(XML_w, nToken), OUStringToOString(rLatentStyle.Value.get<OUString>(), RTL_TEXTENCODING_UTF8));
@@ -4391,13 +4391,13 @@ void DocxAttributeOutput::LatentStyles()
pAttributeList = nullptr;
// Then handle the exceptions.
- for (const auto& rLsdException : aLsdExceptions)
+ for (const auto& rLsdException : std::as_const(aLsdExceptions))
{
pAttributeList = FastSerializerHelper::createAttrList();
uno::Sequence<beans::PropertyValue> aAttributes;
rLsdException.Value >>= aAttributes;
- for (const auto& rAttribute : aAttributes)
+ for (const auto& rAttribute : std::as_const(aAttributes))
if (sal_Int32 nToken = DocxStringGetToken(aExceptionTokens, rAttribute.Name))
pAttributeList->add(FSNS(XML_w, nToken), OUStringToOString(rAttribute.Value.get<OUString>(), RTL_TEXTENCODING_UTF8));
@@ -5177,7 +5177,7 @@ void DocxAttributeOutput::WritePostponedFormControl(const SdrObject* pObject)
uno::Reference<beans::XPropertySet> xPropertySet(xControlModel, uno::UNO_QUERY);
OUString sText = xPropertySet->getPropertyValue("Text").get<OUString>();
- uno::Sequence<OUString> aItems = xPropertySet->getPropertyValue("StringItemList").get< uno::Sequence<OUString> >();
+ const uno::Sequence<OUString> aItems = xPropertySet->getPropertyValue("StringItemList").get< uno::Sequence<OUString> >();
// output component
@@ -5360,7 +5360,7 @@ void DocxAttributeOutput::WriteOLE( SwOLENode& rNode, const Size& rSize, const S
if (pObjectsInterop != aObjectsInteropList.end())
pObjectsInterop->Value >>= aObjectInteropAttributes;
- for( const auto& rObjectInteropAttribute : aObjectInteropAttributes )
+ for( const auto& rObjectInteropAttribute : std::as_const(aObjectInteropAttributes) )
{
if ( rObjectInteropAttribute.Name == "ProgID" )
{
@@ -8695,7 +8695,7 @@ void DocxAttributeOutput::ParaGrabBag(const SfxGrabBagItem& rItem)
uno::Sequence<beans::PropertyValue> aGrabBagSeq;
rGrabBagElement.second >>= aGrabBagSeq;
- for (const auto& rProp : aGrabBagSeq)
+ for (const auto& rProp : std::as_const(aGrabBagSeq))
{
OString sVal = OUStringToOString(rProp.Value.get<OUString>(), RTL_TEXTENCODING_UTF8);
@@ -8726,7 +8726,7 @@ void DocxAttributeOutput::ParaGrabBag(const SfxGrabBagItem& rItem)
}
else if (rGrabBagElement.first == "SdtPr")
{
- uno::Sequence<beans::PropertyValue> aGrabBagSdt =
+ const uno::Sequence<beans::PropertyValue> aGrabBagSdt =
rGrabBagElement.second.get< uno::Sequence<beans::PropertyValue> >();
for (const beans::PropertyValue& aPropertyValue : aGrabBagSdt)
{
@@ -8740,7 +8740,7 @@ void DocxAttributeOutput::ParaGrabBag(const SfxGrabBagItem& rItem)
uno::Sequence<beans::PropertyValue> aGrabBag;
aPropertyValue.Value >>= aGrabBag;
- for (const auto& rProp : aGrabBag)
+ for (const auto& rProp : std::as_const(aGrabBag))
{
OUString sValue = rProp.Value.get<OUString>();
if (rProp.Name == "ooxml:CT_SdtDocPart_docPartGallery")
@@ -8774,7 +8774,7 @@ void DocxAttributeOutput::ParaGrabBag(const SfxGrabBagItem& rItem)
{
uno::Sequence<beans::PropertyValue> aGrabBag;
aPropertyValue.Value >>= aGrabBag;
- for (const auto& rProp : aGrabBag)
+ for (const auto& rProp : std::as_const(aGrabBag))
{
OUString sValue = rProp.Value.get<OUString>();
if (rProp.Name == "ooxml:CT_DataBinding_prefixMappings")
@@ -8802,7 +8802,7 @@ void DocxAttributeOutput::ParaGrabBag(const SfxGrabBagItem& rItem)
m_nParagraphSdtPrToken = FSNS( XML_w14, XML_checkbox );
uno::Sequence<beans::PropertyValue> aGrabBag;
aPropertyValue.Value >>= aGrabBag;
- for (const auto& rProp : aGrabBag)
+ for (const auto& rProp : std::as_const(aGrabBag))
{
OUString sValue = rProp.Value.get<OUString>();
if (rProp.Name == "ooxml:CT_SdtCheckbox_checked")
@@ -8959,7 +8959,7 @@ void DocxAttributeOutput::CharGrabBag( const SfxGrabBagItem& rItem )
}
else if (rGrabBagElement.first == "SdtPr" && FLY_NOT_PROCESSED != m_nStateOfFlyFrame )
{
- uno::Sequence<beans::PropertyValue> aGrabBagSdt =
+ const uno::Sequence<beans::PropertyValue> aGrabBagSdt =
rGrabBagElement.second.get< uno::Sequence<beans::PropertyValue> >();
for (const beans::PropertyValue& aPropertyValue : aGrabBagSdt)
{
@@ -8968,7 +8968,7 @@ void DocxAttributeOutput::CharGrabBag( const SfxGrabBagItem& rItem )
m_nRunSdtPrToken = FSNS( XML_w14, XML_checkbox );
uno::Sequence<beans::PropertyValue> aGrabBag;
aPropertyValue.Value >>= aGrabBag;
- for (const auto& rProp : aGrabBag)
+ for (const auto& rProp : std::as_const(aGrabBag))
{
OUString sValue = rProp.Value.get<OUString>();
if (rProp.Name == "ooxml:CT_SdtCheckbox_checked")
@@ -8989,7 +8989,7 @@ void DocxAttributeOutput::CharGrabBag( const SfxGrabBagItem& rItem )
{
uno::Sequence<beans::PropertyValue> aGrabBag;
aPropertyValue.Value >>= aGrabBag;
- for (const auto& rProp : aGrabBag)
+ for (const auto& rProp : std::as_const(aGrabBag))
{
OUString sValue = rProp.Value.get<OUString>();
if (rProp.Name == "ooxml:CT_DataBinding_prefixMappings")
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index 06ddb97be542..0107c7a0d3ad 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -337,7 +337,7 @@ void DocxExport::DoComboBox(const OUString& rName,
const OUString& rHelp,
const OUString& rToolTip,
const OUString& rSelected,
- uno::Sequence<OUString>& rListItems)
+ const uno::Sequence<OUString>& rListItems)
{
m_pDocumentFS->startElementNS(XML_w, XML_ffData);
@@ -1042,14 +1042,14 @@ void DocxExport::WriteSettings()
uno::Sequence< beans::PropertyValue > propList;
xPropSet->getPropertyValue( aGrabBagName ) >>= propList;
- for( const auto& rProp : propList )
+ for( const auto& rProp : std::as_const(propList) )
{
if ( rProp.Name == "ThemeFontLangProps" )
{
uno::Sequence< beans::PropertyValue > themeFontLangProps;
rProp.Value >>= themeFontLangProps;
OUString aValues[3];
- for( const auto& rThemeFontLangProp : themeFontLangProps )
+ for( const auto& rThemeFontLangProp : std::as_const(themeFontLangProps) )
{
if( rThemeFontLangProp.Name == "val" )
rThemeFontLangProp.Value >>= aValues[0];
@@ -1070,7 +1070,7 @@ void DocxExport::WriteSettings()
uno::Sequence< beans::PropertyValue > aCompatSettingsSequence;
rProp.Value >>= aCompatSettingsSequence;
- for(const auto& rCompatSetting : aCompatSettingsSequence)
+ for(const auto& rCompatSetting : std::as_const(aCompatSettingsSequence))
{
uno::Sequence< beans::PropertyValue > aCompatSetting;
rCompatSetting.Value >>= aCompatSetting;
@@ -1078,7 +1078,7 @@ void DocxExport::WriteSettings()
OUString aUri;
OUString aValue;
- for(const auto& rPropVal : aCompatSetting)
+ for(const auto& rPropVal : std::as_const(aCompatSetting))
{
if( rPropVal.Name == "name" )
rPropVal.Value >>= aName;
@@ -1104,7 +1104,7 @@ void DocxExport::WriteSettings()
if (rAttributeList.hasElements())
{
sax_fastparser::FastAttributeList* pAttributeList = sax_fastparser::FastSerializerHelper::createAttrList();
- for (const auto& rAttribute : rAttributeList)
+ for (const auto& rAttribute : std::as_const(rAttributeList))
{
static DocxStringTokenMap const aTokens[] =
{
@@ -1202,7 +1202,7 @@ void DocxExport::WriteGlossary()
uno::Sequence< beans::PropertyValue > propList;
xPropSet->getPropertyValue( aName ) >>= propList;
sal_Int32 collectedProperties = 0;
- for ( const auto& rProp : propList )
+ for ( const auto& rProp : std::as_const(propList) )
{
OUString propName = rProp.Name;
if ( propName == "OOXGlossary" )
@@ -1236,7 +1236,7 @@ void DocxExport::WriteGlossary()
serializer->serialize( uno::Reference< xml::sax::XDocumentHandler >( writer, uno::UNO_QUERY_THROW ),
uno::Sequence< beans::StringPair >() );
- for ( const uno::Sequence< uno::Any>& glossaryElement : glossaryDomList)
+ for ( const uno::Sequence< uno::Any>& glossaryElement : std::as_const(glossaryDomList))
{
OUString gTarget, gType, gId, contentType;
uno::Reference<xml::dom::XDocument> xDom;
@@ -1391,7 +1391,7 @@ void DocxExport::WriteEmbeddings()
[](const beans::PropertyValue& rProp) { return rProp.Name == "OOXEmbeddings"; });
if (pProp != propList.end())
pProp->Value >>= embeddingsList;
- for (const auto& rEmbedding : embeddingsList)
+ for (const auto& rEmbedding : std::as_const(embeddingsList))
{
OUString embeddingPath = rEmbedding.Name;
uno::Reference<io::XInputStream> embeddingsStream;
diff --git a/sw/source/filter/ww8/docxexport.hxx b/sw/source/filter/ww8/docxexport.hxx
index 396ea628ef61..1dfb33b327a2 100644
--- a/sw/source/filter/ww8/docxexport.hxx
+++ b/sw/source/filter/ww8/docxexport.hxx
@@ -176,7 +176,7 @@ public:
const OUString &rHelp,
const OUString &ToolTip,
const OUString &rSelected,
- css::uno::Sequence<OUString> &rListItems) override;
+ const css::uno::Sequence<OUString> &rListItems) override;
virtual void DoFormText(const SwInputField * pField) override;
diff --git a/sw/source/filter/ww8/docxtablestyleexport.cxx b/sw/source/filter/ww8/docxtablestyleexport.cxx
index 3471c695a175..930888444528 100644
--- a/sw/source/filter/ww8/docxtablestyleexport.cxx
+++ b/sw/source/filter/ww8/docxtablestyleexport.cxx
@@ -36,7 +36,7 @@ public:
{
}
- void TableStyle(uno::Sequence<beans::PropertyValue>& rStyle);
+ void TableStyle(const uno::Sequence<beans::PropertyValue>& rStyle);
void setSerializer(sax_fastparser::FSHelperPtr pSerializer)
{
@@ -51,40 +51,40 @@ public:
void handleBoolean(const OUString& aValue, sal_Int32 nToken);
/// Export of w:pPr.
- void tableStylePPr(uno::Sequence<beans::PropertyValue>& rPPr);
+ void tableStylePPr(const uno::Sequence<beans::PropertyValue>& rPPr);
/// Export of w:tblStylePr.
- void tableStyleTableStylePr(uno::Sequence<beans::PropertyValue>& rTableStylePr);
+ void tableStyleTableStylePr(const uno::Sequence<beans::PropertyValue>& rTableStylePr);
/// Export of w:rPr.
- void tableStyleRPr(uno::Sequence<beans::PropertyValue>& rRPr);
+ void tableStyleRPr(const uno::Sequence<beans::PropertyValue>& rRPr);
/// Export of w:rFonts.
- void tableStyleRRFonts(uno::Sequence<beans::PropertyValue>& rRFonts);
+ void tableStyleRRFonts(const uno::Sequence<beans::PropertyValue>& rRFonts);
/// Export of w:lang.
- void tableStyleRLang(uno::Sequence<beans::PropertyValue>& rLang);
+ void tableStyleRLang(const uno::Sequence<beans::PropertyValue>& rLang);
/// Export of w:ind in a pPr.
- void tableStylePInd(uno::Sequence<beans::PropertyValue>& rInd);
+ void tableStylePInd(const uno::Sequence<beans::PropertyValue>& rInd);
/// Export of w:spacing.
- void tableStylePSpacing(uno::Sequence<beans::PropertyValue>& rSpacing);
+ void tableStylePSpacing(const uno::Sequence<beans::PropertyValue>& rSpacing);
/// Export of w:tblPr.
- void tableStyleTablePr(uno::Sequence<beans::PropertyValue>& rTablePr);
+ void tableStyleTablePr(const uno::Sequence<beans::PropertyValue>& rTablePr);
/// Export of w:tcPr.
- void tableStyleTcPr(uno::Sequence<beans::PropertyValue>& rTcPr);
+ void tableStyleTcPr(const uno::Sequence<beans::PropertyValue>& rTcPr);
/// Export of w:tcBorders (and w:tblBorders).
- void tableStyleTcBorders(uno::Sequence<beans::PropertyValue>& rTcBorders,
+ void tableStyleTcBorders(const uno::Sequence<beans::PropertyValue>& rTcBorders,
sal_Int32 nToken = XML_tcBorders);
/// Export of w:tblInd.
- void tableStyleTableInd(uno::Sequence<beans::PropertyValue>& rTableInd);
+ void tableStyleTableInd(const uno::Sequence<beans::PropertyValue>& rTableInd);
/// Export of w:tblCellMar (and w:tcMar).
- void tableStyleTableCellMar(uno::Sequence<beans::PropertyValue>& rTableCellMar,
+ void tableStyleTableCellMar(const uno::Sequence<beans::PropertyValue>& rTableCellMar,
sal_Int32 nType = XML_tblCellMar);
/// Export of a given table cell border type.
void tableStyleTcBorder(sal_Int32 nToken, const uno::Sequence<beans::PropertyValue>& rTcBorder);
/// Export of w:shd.
- void tableStyleShd(uno::Sequence<beans::PropertyValue>& rShd);
+ void tableStyleShd(const uno::Sequence<beans::PropertyValue>& rShd);
/// Export of w:color.
- void tableStyleRColor(uno::Sequence<beans::PropertyValue>& rColor);
+ void tableStyleRColor(const uno::Sequence<beans::PropertyValue>& rColor);
};
-void DocxTableStyleExport::CnfStyle(uno::Sequence<beans::PropertyValue>& rAttributeList)
+void DocxTableStyleExport::CnfStyle(const uno::Sequence<beans::PropertyValue>& rAttributeList)
{
sax_fastparser::FastAttributeList* pAttributeList
= sax_fastparser::FastSerializerHelper::createAttrList();
@@ -147,7 +147,7 @@ void DocxTableStyleExport::TableStyles(sal_Int32 nCountStylesToWrite)
}
void DocxTableStyleExport::Impl::tableStyleTableCellMar(
- uno::Sequence<beans::PropertyValue>& rTableCellMar, sal_Int32 nType)
+ const uno::Sequence<beans::PropertyValue>& rTableCellMar, sal_Int32 nType)
{
static DocxStringTokenMap const aTableCellMarTokens[]
= { { "left", XML_left }, { "right", XML_right }, { "start", XML_start },
@@ -197,7 +197,7 @@ void DocxTableStyleExport::Impl::tableStyleTcBorder(
}
void DocxTableStyleExport::Impl::tableStyleTcBorders(
- uno::Sequence<beans::PropertyValue>& rTcBorders, sal_Int32 nToken)
+ const uno::Sequence<beans::PropertyValue>& rTcBorders, sal_Int32 nToken)
{
static DocxStringTokenMap const aTcBordersTokens[] = { { "left", XML_left },
{ "right", XML_right },
@@ -222,7 +222,7 @@ void DocxTableStyleExport::Impl::tableStyleTcBorders(
m_pSerializer->endElementNS(XML_w, nToken);
}
-void DocxTableStyleExport::Impl::tableStyleShd(uno::Sequence<beans::PropertyValue>& rShd)
+void DocxTableStyleExport::Impl::tableStyleShd(const uno::Sequence<beans::PropertyValue>& rShd)
{
if (!rShd.hasElements())
return;
@@ -250,7 +250,7 @@ void DocxTableStyleExport::Impl::tableStyleShd(uno::Sequence<beans::PropertyValu
m_pSerializer->singleElementNS(XML_w, XML_shd, xAttributeList);
}
-void DocxTableStyleExport::Impl::tableStyleRColor(uno::Sequence<beans::PropertyValue>& rColor)
+void DocxTableStyleExport::Impl::tableStyleRColor(const uno::Sequence<beans::PropertyValue>& rColor)
{
if (!rColor.hasElements())
return;
@@ -272,7 +272,7 @@ void DocxTableStyleExport::Impl::tableStyleRColor(uno::Sequence<beans::PropertyV
m_pSerializer->singleElementNS(XML_w, XML_color, xAttributeList);
}
-void DocxTableStyleExport::Impl::tableStyleRLang(uno::Sequence<beans::PropertyValue>& rLang)
+void DocxTableStyleExport::Impl::tableStyleRLang(const uno::Sequence<beans::PropertyValue>& rLang)
{
if (!rLang.hasElements())
return;
@@ -292,7 +292,8 @@ void DocxTableStyleExport::Impl::tableStyleRLang(uno::Sequence<beans::PropertyVa
m_pSerializer->singleElementNS(XML_w, XML_lang, xAttributeList);
}
-void DocxTableStyleExport::Impl::tableStyleRRFonts(uno::Sequence<beans::PropertyValue>& rRFonts)
+void DocxTableStyleExport::Impl::tableStyleRRFonts(
+ const uno::Sequence<beans::PropertyValue>& rRFonts)
{
if (!rRFonts.hasElements())
return;
@@ -315,7 +316,8 @@ void DocxTableStyleExport::Impl::tableStyleRRFonts(uno::Sequence<beans::Property
m_pSerializer->singleElementNS(XML_w, XML_rFonts, xAttributeList);
}
-void DocxTableStyleExport::Impl::tableStylePSpacing(uno::Sequence<beans::PropertyValue>& rSpacing)
+void DocxTableStyleExport::Impl::tableStylePSpacing(
+ const uno::Sequence<beans::PropertyValue>& rSpacing)
{
if (!rSpacing.hasElements())
return;
@@ -347,7 +349,7 @@ void DocxTableStyleExport::Impl::tableStylePSpacing(uno::Sequence<beans::Propert
m_pSerializer->singleElementNS(XML_w, XML_spacing, xAttributeList);
}
-void DocxTableStyleExport::Impl::tableStylePInd(uno::Sequence<beans::PropertyValue>& rInd)
+void DocxTableStyleExport::Impl::tableStylePInd(const uno::Sequence<beans::PropertyValue>& rInd)
{
if (!rInd.hasElements())
return;
@@ -365,7 +367,8 @@ void DocxTableStyleExport::Impl::tableStylePInd(uno::Sequence<beans::PropertyVal
m_pSerializer->singleElementNS(XML_w, XML_ind, xAttributeList);
}
-void DocxTableStyleExport::Impl::tableStyleTableInd(uno::Sequence<beans::PropertyValue>& rTableInd)
+void DocxTableStyleExport::Impl::tableStyleTableInd(
+ const uno::Sequence<beans::PropertyValue>& rTableInd)
{
if (!rTableInd.hasElements())
return;
@@ -395,7 +398,7 @@ void DocxTableStyleExport::Impl::handleBoolean(const OUString& aValue, sal_Int32
m_pSerializer->singleElementNS(XML_w, nToken, xAttributeList);
}
-void DocxTableStyleExport::Impl::tableStyleRPr(uno::Sequence<beans::PropertyValue>& rRPr)
+void DocxTableStyleExport::Impl::tableStyleRPr(const uno::Sequence<beans::PropertyValue>& rRPr)
{
if (!rRPr.hasElements())
return;
@@ -473,7 +476,7 @@ void DocxTableStyleExport::Impl::tableStyleRPr(uno::Sequence<beans::PropertyValu
m_pSerializer->endElementNS(XML_w, XML_rPr);
}
-void DocxTableStyleExport::Impl::tableStylePPr(uno::Sequence<beans::PropertyValue>& rPPr)
+void DocxTableStyleExport::Impl::tableStylePPr(const uno::Sequence<beans::PropertyValue>& rPPr)
{
if (!rPPr.hasElements())
return;
@@ -509,7 +512,8 @@ void DocxTableStyleExport::Impl::tableStylePPr(uno::Sequence<beans::PropertyValu
m_pSerializer->endElementNS(XML_w, XML_pPr);
}
-void DocxTableStyleExport::Impl::tableStyleTablePr(uno::Sequence<beans::PropertyValue>& rTablePr)
+void DocxTableStyleExport::Impl::tableStyleTablePr(
+ const uno::Sequence<beans::PropertyValue>& rTablePr)
{
if (!rTablePr.hasElements())
return;
@@ -547,7 +551,7 @@ void DocxTableStyleExport::Impl::tableStyleTablePr(uno::Sequence<beans::Property
m_pSerializer->endElementNS(XML_w, XML_tblPr);
}
-void DocxTableStyleExport::Impl::tableStyleTcPr(uno::Sequence<beans::PropertyValue>& rTcPr)
+void DocxTableStyleExport::Impl::tableStyleTcPr(const uno::Sequence<beans::PropertyValue>& rTcPr)
{
if (!rTcPr.hasElements())
return;
@@ -579,7 +583,7 @@ void DocxTableStyleExport::Impl::tableStyleTcPr(uno::Sequence<beans::PropertyVal
}
void DocxTableStyleExport::Impl::tableStyleTableStylePr(
- uno::Sequence<beans::PropertyValue>& rTableStylePr)
+ const uno::Sequence<beans::PropertyValue>& rTableStylePr)
{
if (!rTableStylePr.hasElements())
return;
@@ -619,7 +623,7 @@ void DocxTableStyleExport::Impl::tableStyleTableStylePr(
m_pSerializer->endElementNS(XML_w, XML_tblStylePr);
}
-void DocxTableStyleExport::Impl::TableStyle(uno::Sequence<beans::PropertyValue>& rStyle)
+void DocxTableStyleExport::Impl::TableStyle(const uno::Sequence<beans::PropertyValue>& rStyle)
{
bool bDefault = false;
bool bCustomStyle = false;
diff --git a/sw/source/filter/ww8/docxtablestyleexport.hxx b/sw/source/filter/ww8/docxtablestyleexport.hxx
index c6f0c219d596..8303aafdc518 100644
--- a/sw/source/filter/ww8/docxtablestyleexport.hxx
+++ b/sw/source/filter/ww8/docxtablestyleexport.hxx
@@ -39,7 +39,7 @@ public:
void TableStyles(sal_Int32 nCountStylesToWrite);
/// Writes <w:cnfStyle .../> based on grab-bagged para, cell or row properties.
- void CnfStyle(css::uno::Sequence<css::beans::PropertyValue>& rAttributeList);
+ void CnfStyle(const css::uno::Sequence<css::beans::PropertyValue>& rAttributeList);
void SetSerializer(const sax_fastparser::FSHelperPtr& pSerializer);
DocxTableStyleExport(SwDoc* pDoc, const sax_fastparser::FSHelperPtr& pSerializer);
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 85b775ad5bb1..2c4a01bc0ed7 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -2191,7 +2191,7 @@ void RtfAttributeOutput::OutputFlyFrame_Impl(const ww8::Frame& rFrame, const Poi
}
xPropSet->getPropertyValue("StringItemList") >>= aStrSeq;
- for (const auto& rStr : aStrSeq)
+ for (const auto& rStr : std::as_const(aStrSeq))
m_aRun
->append(
"{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_FFL
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index 4ffcda747017..5176f9a06664 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -330,7 +330,7 @@ void RtfExport::WriteHyperlinkData(const ::sw::mark::IFieldmark& /*rFieldmark*/)
void RtfExport::DoComboBox(const OUString& /*rName*/, const OUString& /*rHelp*/,
const OUString& /*rToolTip*/, const OUString& /*rSelected*/,
- uno::Sequence<OUString>& /*rListItems*/)
+ const uno::Sequence<OUString>& /*rListItems*/)
{
// this is handled in RtfAttributeOutput::OutputFlyFrame_Impl
}
@@ -564,7 +564,7 @@ void RtfExport::WriteUserProps()
{
uno::Reference<beans::XPropertySet> xPropertySet(xUserDefinedProperties,
uno::UNO_QUERY);
- uno::Sequence<beans::Property> aProperties
+ const uno::Sequence<beans::Property> aProperties
= xPropertySet->getPropertySetInfo()->getProperties();
for (const beans::Property& rProperty : aProperties)
diff --git a/sw/source/filter/ww8/rtfexport.hxx b/sw/source/filter/ww8/rtfexport.hxx
index bdc349bec5cc..ac9d2f980943 100644
--- a/sw/source/filter/ww8/rtfexport.hxx
+++ b/sw/source/filter/ww8/rtfexport.hxx
@@ -108,7 +108,8 @@ public:
void WriteHyperlinkData(const ::sw::mark::IFieldmark& rFieldmark) override;
void DoComboBox(const OUString& rName, const OUString& rHelp, const OUString& ToolTip,
- const OUString& rSelected, css::uno::Sequence<OUString>& rListItems) override;
+ const OUString& rSelected,
+ const css::uno::Sequence<OUString>& rListItems) override;
void DoFormText(const SwInputField* pField) override;
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 422e007a1cbc..93942e9e6f68 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -438,7 +438,7 @@ void WW8Export::DoComboBox(const OUString &rName,
const OUString &rHelp,
const OUString &rToolTip,
const OUString &rSelected,
- uno::Sequence<OUString> &rListItems)
+ const uno::Sequence<OUString> &rListItems)
{
OutputField(nullptr, ww::eFORMDROPDOWN, FieldString(ww::eFORMDROPDOWN),
FieldFlags::Start | FieldFlags::CmdStart);
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 58e6dc06e456..883f9b5eeba2 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -779,7 +779,7 @@ public:
const OUString &rHelp,
const OUString &ToolTip,
const OUString &rSelected,
- css::uno::Sequence<OUString> &rListItems) = 0;
+ const css::uno::Sequence<OUString> &rListItems) = 0;
virtual void DoFormText(const SwInputField * pField) = 0;
@@ -1141,7 +1141,7 @@ public:
const OUString &rHelp,
const OUString &ToolTip,
const OUString &rSelected,
- css::uno::Sequence<OUString> &rListItems) override;
+ const css::uno::Sequence<OUString> &rListItems) override;
virtual void DoFormText(const SwInputField * pField) override;
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index c1ac48f408fe..e4e9cee6cdd6 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -4891,7 +4891,7 @@ void SwWW8ImplReader::ReadGlobalTemplateSettings( const OUString& sCreatedFrom,
if( xSFA->isFolder( aAddinPath ) )
sGlobalTemplates = xSFA->getFolderContents( aAddinPath, false );
- for ( const auto& rGlobalTemplate : sGlobalTemplates )
+ for ( const auto& rGlobalTemplate : std::as_const(sGlobalTemplates) )
{
INetURLObject aObj;
aObj.SetURL( rGlobalTemplate );
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index ca87bb3d13aa..fcfdd47b6231 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -520,7 +520,7 @@ void SwXMLImport::startDocument()
if( aAny >>= aFamiliesSeq )
{
SfxStyleFamily nFamilyMask = SfxStyleFamily::None;
- for( const OUString& rFamily : aFamiliesSeq )
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list