summaryrefslogtreecommitdiff
path: root/vcl/source/filter/graphicfilter.cxx
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-06-15 17:13:48 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-06-18 09:43:08 +0200
commit452a8e4abe0c416d664078baddff67c1561025ec (patch)
tree037f973aebd5e740d97525ff7aa852515762ae0b /vcl/source/filter/graphicfilter.cxx
parente1eb7cb04a4c30cec238ab0f54d41a6cdc3299c1 (diff)
Simplify Sequence iterations in vcl
Use range-based loops or replace with comphelper or STL functions Change-Id: If046738084c2d13cc1eaea6a03aaf60b63f62767 Reviewed-on: https://gerrit.libreoffice.org/74104 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/filter/graphicfilter.cxx')
-rw-r--r--vcl/source/filter/graphicfilter.cxx32
1 files changed, 15 insertions, 17 deletions
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx
index 87aeaefa0ec7..c6b26c6ec2da 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -1440,13 +1440,12 @@ ErrCode GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPath,
if ( pFilterData )
{
- sal_Int32 i;
- for ( i = 0; i < pFilterData->getLength(); i++ )
+ for ( const auto& rPropVal : *pFilterData )
{
- if ( (*pFilterData)[ i ].Name == "PreviewSizeHint" )
+ if ( rPropVal.Name == "PreviewSizeHint" )
{
css::awt::Size aSize;
- if ( (*pFilterData)[ i ].Value >>= aSize )
+ if ( rPropVal.Value >>= aSize )
{
aPreviewSizeHint = Size( aSize.Width, aSize.Height );
if ( aSize.Width || aSize.Height )
@@ -1455,13 +1454,13 @@ ErrCode GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPath,
nImportFlags &=~GraphicFilterImportFlags::ForPreview;
}
}
- else if ( (*pFilterData)[ i ].Name == "AllowPartialStreamRead" )
+ else if ( rPropVal.Name == "AllowPartialStreamRead" )
{
- (*pFilterData)[ i ].Value >>= bAllowPartialStreamRead;
+ rPropVal.Value >>= bAllowPartialStreamRead;
}
- else if ( (*pFilterData)[ i ].Name == "CreateNativeLink" )
+ else if ( rPropVal.Name == "CreateNativeLink" )
{
- (*pFilterData)[ i ].Value >>= bCreateNativeLink;
+ rPropVal.Value >>= bCreateNativeLink;
}
}
}
@@ -2050,26 +2049,25 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString& r
vcl::PNGWriter aPNGWriter( aGraphic.GetBitmapEx(), pFilterData );
if ( pFilterData )
{
- sal_Int32 k, j, i = 0;
- for ( i = 0; i < pFilterData->getLength(); i++ )
+ for ( const auto& rPropVal : *pFilterData )
{
- if ( (*pFilterData)[ i ].Name == "AdditionalChunks" )
+ if ( rPropVal.Name == "AdditionalChunks" )
{
css::uno::Sequence< css::beans::PropertyValue > aAdditionalChunkSequence;
- if ( (*pFilterData)[ i ].Value >>= aAdditionalChunkSequence )
+ if ( rPropVal.Value >>= aAdditionalChunkSequence )
{
- for ( j = 0; j < aAdditionalChunkSequence.getLength(); j++ )
+ for ( const auto& rAdditionalChunk : aAdditionalChunkSequence )
{
- if ( aAdditionalChunkSequence[ j ].Name.getLength() == 4 )
+ if ( rAdditionalChunk.Name.getLength() == 4 )
{
sal_uInt32 nChunkType = 0;
- for ( k = 0; k < 4; k++ )
+ for ( sal_Int32 k = 0; k < 4; k++ )
{
nChunkType <<= 8;
- nChunkType |= static_cast<sal_uInt8>(aAdditionalChunkSequence[ j ].Name[ k ]);
+ nChunkType |= static_cast<sal_uInt8>(rAdditionalChunk.Name[ k ]);
}
css::uno::Sequence< sal_Int8 > aByteSeq;
- if ( aAdditionalChunkSequence[ j ].Value >>= aByteSeq )
+ if ( rAdditionalChunk.Value >>= aByteSeq )
{
std::vector< vcl::PNGWriter::ChunkData >& rChunkData = aPNGWriter.GetChunks();
if ( !rChunkData.empty() )