diff options
author | Hossein <hossein@libreoffice.org> | 2021-10-17 15:23:42 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-17 17:04:00 +0200 |
commit | fb1469ea68b8f87f17e1729e7c5d4cc8ebbb45bd (patch) | |
tree | d6d15dab0eb06ee7a1f1c11977c84ec130efb84d /svgio | |
parent | a2adb7fa926c2b9ed053c65e130a9da336cc98b0 (diff) |
Use range based for loops
* Use range based for loops where it was possible in svgio
+ Goal: Better readability of the code
Change-Id: I6259e2391006287d5d330277dd8d700012c32932
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123712
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'svgio')
-rw-r--r-- | svgio/source/svgreader/svgcharacternode.cxx | 8 | ||||
-rw-r--r-- | svgio/source/svgreader/svgnode.cxx | 4 | ||||
-rw-r--r-- | svgio/source/svgreader/svgstylenode.cxx | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/svgio/source/svgreader/svgcharacternode.cxx b/svgio/source/svgreader/svgcharacternode.cxx index 7bc2944f7058..02abae1f53df 100644 --- a/svgio/source/svgreader/svgcharacternode.cxx +++ b/svgio/source/svgreader/svgcharacternode.cxx @@ -280,9 +280,9 @@ namespace svgio::svgreader ::std::vector< double > aExtendArray(aTextLayouterDevice.getTextArray(getText(), nArray, nLength - nArray)); aTextArray.reserve(nLength); - for(size_t a(0); a < aExtendArray.size(); a++) + for(const auto &a : aExtendArray) { - aTextArray.push_back(aExtendArray[a] + fStartX); + aTextArray.push_back(a + fStartX); } } } @@ -305,9 +305,9 @@ namespace svgio::svgreader aTextArray = aTextLayouterDevice.getTextArray(getText(), nIndex, nLength); } - for(size_t a(0); a < aTextArray.size(); a++) + for(auto &a : aTextArray) { - aTextArray[a] *= fFactor; + a *= fFactor; } } else diff --git a/svgio/source/svgreader/svgnode.cxx b/svgio/source/svgreader/svgnode.cxx index 3bc3fb76baca..103b7f940615 100644 --- a/svgio/source/svgreader/svgnode.cxx +++ b/svgio/source/svgreader/svgnode.cxx @@ -107,10 +107,10 @@ namespace svgio::svgreader } } - for(size_t a(0); a < aParts.size(); a++) + for(const auto &a : aParts) { const OUString aNewConcatenated( - "." + aParts[a] + aConcatenated); + "." + a + aConcatenated); if(pParent) { diff --git a/svgio/source/svgreader/svgstylenode.cxx b/svgio/source/svgreader/svgstylenode.cxx index 5f31482e833e..89f6200138bd 100644 --- a/svgio/source/svgreader/svgstylenode.cxx +++ b/svgio/source/svgreader/svgstylenode.cxx @@ -117,9 +117,9 @@ namespace svgio::svgreader OUStringBuffer aConcatenatedSelector; // re-combine without spaces, create a unique name (for now) - for(size_t a(0); a < aSelectorParts.size(); a++) + for(const auto &a : aSelectorParts) { - aConcatenatedSelector.append(aSelectorParts[a]); + aConcatenatedSelector.append(a); } // CssStyles in SVG are currently not completely supported; the current idea for |