diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-07-07 16:20:12 +0300 |
---|---|---|
committer | Arkadiy Illarionov <qarkai@gmail.com> | 2019-07-09 17:48:06 +0200 |
commit | 44a6335f49a64ac77207d3aa46c267503c65c5ff (patch) | |
tree | 8ed220967528dc6caa72fa9e753c0955f3de2433 /svx/source/xoutdev | |
parent | 4a96a5d862ed46bbcb64d34b32720b5b1b3d7ca8 (diff) |
Simplify Sequence iterations in svx
Use range-based loops, STL and comphelper functions
Change-Id: If6d190cf72b8653c1c3fbe9a6a6e47f10f1a6765
Reviewed-on: https://gerrit.libreoffice.org/75255
Tested-by: Jenkins
Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
Diffstat (limited to 'svx/source/xoutdev')
-rw-r--r-- | svx/source/xoutdev/xattr.cxx | 30 | ||||
-rw-r--r-- | svx/source/xoutdev/xattrbmp.cxx | 14 |
2 files changed, 22 insertions, 22 deletions
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index 7c273143e6ad..9c4727447c3f 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -742,13 +742,13 @@ bool XLineDashItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) css::drawing::LineDash aLineDash; OUString aName; bool bLineDash( false ); - for ( sal_Int32 n = 0; n < aPropSeq.getLength(); n++ ) + for ( const auto& rProp : aPropSeq ) { - if ( aPropSeq[n].Name == "Name" ) - aPropSeq[n].Value >>= aName; - else if ( aPropSeq[n].Name == "LineDash" ) + if ( rProp.Name == "Name" ) + rProp.Value >>= aName; + else if ( rProp.Name == "LineDash" ) { - if ( aPropSeq[n].Value >>= aLineDash ) + if ( rProp.Value >>= aLineDash ) bLineDash = true; } } @@ -2105,13 +2105,13 @@ bool XFillGradientItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId css::awt::Gradient aGradient2; OUString aName; bool bGradient( false ); - for ( sal_Int32 n = 0; n < aPropSeq.getLength(); n++ ) + for ( const auto& rProp : aPropSeq ) { - if ( aPropSeq[n].Name == "Name" ) - aPropSeq[n].Value >>= aName; - else if ( aPropSeq[n].Name == "FillGradient" ) + if ( rProp.Name == "Name" ) + rProp.Value >>= aName; + else if ( rProp.Name == "FillGradient" ) { - if ( aPropSeq[n].Value >>= aGradient2 ) + if ( rProp.Value >>= aGradient2 ) bGradient = true; } } @@ -2498,13 +2498,13 @@ bool XFillHatchItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) css::drawing::Hatch aUnoHatch; OUString aName; bool bHatch( false ); - for ( sal_Int32 n = 0; n < aPropSeq.getLength(); n++ ) + for ( const auto& rProp : aPropSeq ) { - if ( aPropSeq[n].Name == "Name" ) - aPropSeq[n].Value >>= aName; - else if ( aPropSeq[n].Name == "FillHatch" ) + if ( rProp.Name == "Name" ) + rProp.Value >>= aName; + else if ( rProp.Name == "FillHatch" ) { - if ( aPropSeq[n].Value >>= aUnoHatch ) + if ( rProp.Value >>= aUnoHatch ) bHatch = true; } } diff --git a/svx/source/xoutdev/xattrbmp.cxx b/svx/source/xoutdev/xattrbmp.cxx index 49e589542b50..bb284e903e36 100644 --- a/svx/source/xoutdev/xattrbmp.cxx +++ b/svx/source/xoutdev/xattrbmp.cxx @@ -265,14 +265,14 @@ bool XFillBitmapItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) uno::Sequence< beans::PropertyValue > aPropSeq; if( rVal >>= aPropSeq ) { - for ( sal_Int32 n = 0; n < aPropSeq.getLength(); n++ ) + for ( const auto& rProp : aPropSeq ) { - if ( aPropSeq[n].Name == "Name" ) - bSetName = (aPropSeq[n].Value >>= aName); - else if ( aPropSeq[n].Name == "Bitmap" ) - bSetBitmap = (aPropSeq[n].Value >>= xBmp); - else if ( aPropSeq[n].Name == "FillBitmapURL" ) - bSetURL = (aPropSeq[n].Value >>= aURL); + if ( rProp.Name == "Name" ) + bSetName = (rProp.Value >>= aName); + else if ( rProp.Name == "Bitmap" ) + bSetBitmap = (rProp.Value >>= xBmp); + else if ( rProp.Name == "FillBitmapURL" ) + bSetURL = (rProp.Value >>= aURL); } } } |