diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2018-02-06 12:55:53 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2018-02-06 18:57:39 +0100 |
commit | ccf7025d7c60f73d65a772181399a5339968360b (patch) | |
tree | e8110063d53f9d2bd7fd9ebd4d8df6bcceac24db /vcl | |
parent | 5c3d0a70a0edb182714725ef920d74667feffb0e (diff) |
Use for-range loop in graphicfilter (vcl)
Change-Id: I416746df2b2f120b264fab85f6a9570c5f176ddf
Reviewed-on: https://gerrit.libreoffice.org/49290
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/filter/graphicfilter.cxx | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 4c0166716ddd..340308c83073 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -1561,19 +1561,16 @@ ErrCode GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPath, { // check if this PNG contains a GIF chunk! const std::vector<vcl::PNGReader::ChunkData>& rChunkData = aPNGReader.GetChunks(); - std::vector<vcl::PNGReader::ChunkData>::const_iterator aIter(rChunkData.begin()); - std::vector<vcl::PNGReader::ChunkData>::const_iterator aEnd(rChunkData.end()); - - while (aIter != aEnd) + for (auto const& chunk : rChunkData) { // Microsoft Office is storing Animated GIFs in following chunk - if (aIter->nType == PMGCHUNG_msOG) + if (chunk.nType == PMGCHUNG_msOG) { - sal_uInt32 nChunkSize = aIter->aData.size(); + sal_uInt32 nChunkSize = chunk.aData.size(); if (nChunkSize > 11) { - const std::vector<sal_uInt8>& rData = aIter->aData; + const std::vector<sal_uInt8>& rData = chunk.aData; nGraphicContentSize = nChunkSize - 11; SvMemoryStream aIStrm(const_cast<sal_uInt8*>(&rData[11]), nGraphicContentSize, StreamMode::READ); pGraphicContent.reset(new sal_uInt8[nGraphicContentSize]); @@ -1585,7 +1582,6 @@ ErrCode GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPath, break; } } - ++aIter; } } |