diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-06-12 11:21:20 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-06-13 19:43:13 +0200 |
commit | 54afdbd1b442d93313a01e58dba8fe3b84f596d1 (patch) | |
tree | 4564dd8bf6443521622b96b52e22caf65bb87d4d /writerfilter/source/ooxml/OOXMLDocumentImpl.cxx | |
parent | 8b3c861c46ae12d21b7b3a550e2daa21d2006b77 (diff) |
Simplify Sequence iterations in writerfilter, writerperfect, xmlhelp
Use range-based loops or replace with comphelper or STL functions
Change-Id: I9113e04d15ad84d0abac087afc627969e8ebc354
Reviewed-on: https://gerrit.libreoffice.org/73867
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'writerfilter/source/ooxml/OOXMLDocumentImpl.cxx')
-rw-r--r-- | writerfilter/source/ooxml/OOXMLDocumentImpl.cxx | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx index 0d00b0eff303..9601a5311923 100644 --- a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx +++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx @@ -560,12 +560,10 @@ void OOXMLDocumentImpl::resolveCustomXmlStream(Stream & rStream) 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 (sal_Int32 j = 0; j < aSeqs.getLength(); j++) + for (const uno::Sequence<beans::StringPair>& aSeq : aSeqs) { - const uno::Sequence<beans::StringPair>& aSeq = aSeqs[j]; - for (sal_Int32 i = 0; i < aSeq.getLength(); i++) + for (const beans::StringPair& aPair : aSeq) { - const beans::StringPair& aPair = aSeq[i]; // Need to resolve only customxml files from document relationships. // Skipping other files. if (aPair.Second == sCustomType || @@ -629,10 +627,9 @@ void OOXMLDocumentImpl::resolveGlossaryStream(Stream & /*rStream*/) uno::Sequence< uno::Sequence< beans::StringPair > >aSeqs = xRelationshipAccess->getAllRelationships(); std::vector< uno::Sequence<uno::Any> > aGlossaryDomList; - for (sal_Int32 j = 0; j < aSeqs.getLength(); j++) + for (const uno::Sequence< beans::StringPair >& aSeq : aSeqs) { OOXMLStream::Pointer_t gStream; - uno::Sequence< beans::StringPair > aSeq = aSeqs[j]; //Follows following aSeq[0] is Id, aSeq[1] is Type, aSeq[2] is Target if (aSeq.getLength() < 3) { @@ -728,12 +725,10 @@ void OOXMLDocumentImpl::resolveEmbeddingsStream(const OOXMLStream::Pointer_t& pS bool bHeaderFooterFound = false; OOXMLStream::StreamType_t streamType = OOXMLStream::UNKNOWN; uno::Sequence< uno::Sequence< beans::StringPair > >aSeqs = xRelationshipAccess->getAllRelationships(); - for (sal_Int32 j = 0; j < aSeqs.getLength(); j++) + for (const uno::Sequence< beans::StringPair >& aSeq : aSeqs) { - uno::Sequence< beans::StringPair > aSeq = aSeqs[j]; - for (sal_Int32 i = 0; i < aSeq.getLength(); i++) + for (const beans::StringPair& aPair : aSeq) { - beans::StringPair aPair = aSeq[i]; if (aPair.Second == sChartType || aPair.Second == sChartTypeStrict) { |