diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-21 09:13:11 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-21 12:52:36 +0200 |
commit | 09c757cbdd3f973c97151203d8ff522141102da7 (patch) | |
tree | d1424cd2d3698965f847dc161c282ce1d00f9a94 /vcl/osx | |
parent | 22a4b7e621cbb6cab1d82d57c370e3cf33b4e74e (diff) |
use for-range on Sequence in testtools..xmloff
Change-Id: I05b02a2f8b4b9091c7de0f7e98409d5b608ed250
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94610
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/osx')
-rw-r--r-- | vcl/osx/OSXTransferable.cxx | 4 | ||||
-rw-r--r-- | vcl/osx/a11ytextattributeswrapper.mm | 3 | ||||
-rw-r--r-- | vcl/osx/a11ywrapper.mm | 10 | ||||
-rw-r--r-- | vcl/osx/printaccessoryview.mm | 14 | ||||
-rw-r--r-- | vcl/osx/salprn.cxx | 6 |
5 files changed, 18 insertions, 19 deletions
diff --git a/vcl/osx/OSXTransferable.cxx b/vcl/osx/OSXTransferable.cxx index 426b618c95bd..77417f3c29bb 100644 --- a/vcl/osx/OSXTransferable.cxx +++ b/vcl/osx/OSXTransferable.cxx @@ -143,8 +143,8 @@ Sequence< DataFlavor > SAL_CALL OSXTransferable::getTransferDataFlavors( ) sal_Bool SAL_CALL OSXTransferable::isDataFlavorSupported(const DataFlavor& aFlavor) { - for (sal_Int32 i = 0; i < mFlavorList.getLength(); i++) - if (compareDataFlavors(aFlavor, mFlavorList[i])) + for (const DataFlavor& rFlavor : mFlavorList) + if (compareDataFlavors(aFlavor, rFlavor)) return true; return false; diff --git a/vcl/osx/a11ytextattributeswrapper.mm b/vcl/osx/a11ytextattributeswrapper.mm index 28489268f4ee..433906d7d9b3 100644 --- a/vcl/osx/a11ytextattributeswrapper.mm +++ b/vcl/osx/a11ytextattributeswrapper.mm @@ -212,8 +212,7 @@ using namespace ::com::sun::star::uno; sal_Int32 underlineColor = 0; bool underlineHasColor = false; // add attributes to string - for ( int attrIndex = 0; attrIndex < attributes.getLength(); attrIndex++ ) { - PropertyValue property = attributes [ attrIndex ]; + for ( const PropertyValue& property : attributes ) { // TODO: NSAccessibilityMisspelledTextAttribute, NSAccessibilityAttachmentTextAttribute, NSAccessibilityLinkTextAttribute // NSAccessibilityStrikethroughColorTextAttribute is unsupported by UNP-API if ( property.Value.hasValue() ) { diff --git a/vcl/osx/a11ywrapper.mm b/vcl/osx/a11ywrapper.mm index ec09d61b479b..d3a42058dca9 100644 --- a/vcl/osx/a11ywrapper.mm +++ b/vcl/osx/a11ywrapper.mm @@ -315,8 +315,8 @@ static std::ostream &operator<<(std::ostream &s, NSObject *obj) { Reference < XAccessibleRelationSet > rxAccessibleRelationSet = [ self accessibleContext ] -> getAccessibleRelationSet(); AccessibleRelation relationMemberOf = rxAccessibleRelationSet -> getRelationByType ( AccessibleRelationType::MEMBER_OF ); if ( relationMemberOf.RelationType == AccessibleRelationType::MEMBER_OF && relationMemberOf.TargetSet.hasElements() ) { - for ( int index = 0; index < relationMemberOf.TargetSet.getLength(); index++ ) { - Reference < XAccessible > rMateAccessible( relationMemberOf.TargetSet[index], UNO_QUERY ); + for ( const auto& i : relationMemberOf.TargetSet ) { + Reference < XAccessible > rMateAccessible( i, UNO_QUERY ); if ( rMateAccessible.is() ) { Reference< XAccessibleContext > rMateAccessibleContext( rMateAccessible -> getAccessibleContext() ); if ( rMateAccessibleContext.is() ) { @@ -1046,11 +1046,13 @@ static Reference < XAccessibleContext > hitTestRunner ( css::awt::Point point, if ( relationSet.is() && relationSet -> containsRelation ( AccessibleRelationType::SUB_WINDOW_OF )) { // we have a valid relation to the parent element AccessibleRelation relation = relationSet -> getRelationByType ( AccessibleRelationType::SUB_WINDOW_OF ); - for ( int i = 0; i < relation.TargetSet.getLength() && !hitChild.is(); i++ ) { - Reference < XAccessible > rxAccessible ( relation.TargetSet [ i ], UNO_QUERY ); + for ( const auto & i : relation.TargetSet ) { + Reference < XAccessible > rxAccessible ( i, UNO_QUERY ); if ( rxAccessible.is() && rxAccessible -> getAccessibleContext().is() ) { // hit test for children of parent hitChild = hitTestRunner ( hitPoint, rxAccessible -> getAccessibleContext() ); + if (hitChild.is()) + break; } } } diff --git a/vcl/osx/printaccessoryview.mm b/vcl/osx/printaccessoryview.mm index c6490ee36f68..932b65dd3609 100644 --- a/vcl/osx/printaccessoryview.mm +++ b/vcl/osx/printaccessoryview.mm @@ -1006,19 +1006,18 @@ static void addEdit( NSView* pCurParent, long rCurX, long& rCurY, long nAttachOf // prepend a "selection" checkbox if the properties have such a selection in PrintContent bool bAddSelectionCheckBox = false, bSelectionBoxEnabled = false, bSelectionBoxChecked = false; - for( int i = 0; i < rOptions.getLength(); i++ ) + for( const PropertyValue & prop : rOptions ) { Sequence< beans::PropertyValue > aOptProp; - rOptions[i].Value >>= aOptProp; + prop.Value >>= aOptProp; OUString aCtrlType; OUString aPropertyName; Sequence< OUString > aChoices; Sequence< sal_Bool > aChoicesDisabled; sal_Int32 aSelectionChecked = 0; - for( int n = 0; n < aOptProp.getLength(); n++ ) + for( const beans::PropertyValue& rEntry : aOptProp ) { - const beans::PropertyValue& rEntry( aOptProp[ n ] ); if( rEntry.Name == "ControlType" ) { rEntry.Value >>= aCtrlType; @@ -1051,10 +1050,10 @@ static void addEdit( NSView* pCurParent, long rCurX, long& rCurY, long nAttachOf } } - for( int i = 0; i < rOptions.getLength(); i++ ) + for( const PropertyValue & prop : rOptions ) { Sequence< beans::PropertyValue > aOptProp; - rOptions[i].Value >>= aOptProp; + prop.Value >>= aOptProp; // extract ui element OUString aCtrlType; @@ -1067,9 +1066,8 @@ static void addEdit( NSView* pCurParent, long rCurX, long& rCurY, long nAttachOf long nAttachOffset = 0; bool bIgnore = false; - for( int n = 0; n < aOptProp.getLength(); n++ ) + for( const beans::PropertyValue& rEntry : aOptProp ) { - const beans::PropertyValue& rEntry( aOptProp[ n ] ); if( rEntry.Name == "Text" ) { rEntry.Value >>= aText; diff --git a/vcl/osx/salprn.cxx b/vcl/osx/salprn.cxx index 9831bd24bd06..a1e5a0908b3b 100644 --- a/vcl/osx/salprn.cxx +++ b/vcl/osx/salprn.cxx @@ -334,12 +334,12 @@ static Size getPageSize( vcl::PrinterController const & i_rController, sal_Int32 { Size aPageSize; uno::Sequence< PropertyValue > aPageParms( i_rController.getPageParameters( i_nPage ) ); - for( sal_Int32 nProperty = 0, nPropertyCount = aPageParms.getLength(); nProperty < nPropertyCount; ++nProperty ) + for( const PropertyValue & pv : aPageParms ) { - if ( aPageParms[ nProperty ].Name == "PageSize" ) + if ( pv.Name == "PageSize" ) { awt::Size aSize; - aPageParms[ nProperty].Value >>= aSize; + pv.Value >>= aSize; aPageSize.setWidth( aSize.Width ); aPageSize.setHeight( aSize.Height ); break; |