diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-10 16:12:07 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-11 12:50:55 +0200 |
commit | 20571c472528c4f98fe3f55700d134915d32a49a (patch) | |
tree | 9b350824d845b8aaeb13d087ef74febb454b821b /svx | |
parent | b401896a56149aa2871b65a330a6f601a9830ccd (diff) |
use more range-for on uno::Sequence
Change-Id: Ifad32425d79be5a22d33d721bdc5fb993f699759
Reviewed-on: https://gerrit.libreoffice.org/39763
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/rubydialog.cxx | 41 | ||||
-rw-r--r-- | svx/source/fmcomp/fmgridif.cxx | 5 | ||||
-rw-r--r-- | svx/source/form/fmshimp.cxx | 5 | ||||
-rw-r--r-- | svx/source/form/navigatortree.cxx | 8 |
4 files changed, 24 insertions, 35 deletions
diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx index 888965e6ea2e..1ee45524aed9 100644 --- a/svx/source/dialog/rubydialog.cxx +++ b/svx/source/dialog/rubydialog.cxx @@ -436,13 +436,12 @@ void SvxRubyDialog::GetRubyText() DBG_ASSERT(aRubyValues.getLength() > (i / 2 + nTempLastPos), "wrong index" ); SetModified(true); Sequence<PropertyValue>& rProps = aRubyValues.getArray()[i / 2 + nTempLastPos]; - PropertyValue* pProps = rProps.getArray(); - for (sal_Int32 nProp = 0; nProp < rProps.getLength(); nProp++) + for (PropertyValue & propVal : rProps) { - if (pProps[nProp].Name == cRubyBaseText) - pProps[nProp].Value <<= aEditArr[i]->GetText(); - else if (pProps[nProp].Name == cRubyText) - pProps[nProp].Value <<= aEditArr[i + 1]->GetText(); + if (propVal.Name == cRubyBaseText) + propVal.Value <<= aEditArr[i]->GetText(); + else if (propVal.Name == cRubyText) + propVal.Value <<= aEditArr[i + 1]->GetText(); } } } @@ -597,14 +596,12 @@ IMPL_LINK(SvxRubyDialog, AdjustHdl_Impl, ListBox&, rBox, void) AssertOneEntry(); sal_Int16 nAdjust = rBox.GetSelectEntryPos(); Sequence<PropertyValues>& aRubyValues = m_pImpl->GetRubyValues(); - for (sal_Int32 nRuby = 0; nRuby < aRubyValues.getLength(); nRuby++) + for (PropertyValues & rProps : aRubyValues) { - Sequence<PropertyValue> &rProps = aRubyValues.getArray()[nRuby]; - PropertyValue* pProps = rProps.getArray(); - for (sal_Int32 nProp = 0; nProp < rProps.getLength(); nProp++) + for (PropertyValue & propVal : rProps) { - if (pProps[nProp].Name == cRubyAdjust) - pProps[nProp].Value <<= nAdjust; + if (propVal.Name == cRubyAdjust) + propVal.Value <<= nAdjust; } SetModified(true); } @@ -616,14 +613,12 @@ IMPL_LINK(SvxRubyDialog, PositionHdl_Impl, ListBox&, rBox, void) AssertOneEntry(); bool bAbove = !rBox.GetSelectEntryPos(); Sequence<PropertyValues>& aRubyValues = m_pImpl->GetRubyValues(); - for (sal_Int32 nRuby = 0; nRuby < aRubyValues.getLength(); nRuby++) + for (PropertyValues & rProps : aRubyValues) { - Sequence<PropertyValue> &rProps = aRubyValues.getArray()[nRuby]; - PropertyValue* pProps = rProps.getArray(); - for (sal_Int32 nProp = 0; nProp < rProps.getLength(); nProp++) + for (PropertyValue & propVal : rProps) { - if (pProps[nProp].Name == cRubyIsAbove) - pProps[nProp].Value <<= bAbove; + if (propVal.Name == cRubyIsAbove) + propVal.Value <<= bAbove; } SetModified(true); } @@ -637,15 +632,13 @@ IMPL_LINK_NOARG(SvxRubyDialog, CharStyleHdl_Impl, ListBox&, void) if (LISTBOX_ENTRY_NOTFOUND != m_pCharStyleLB->GetSelectEntryPos()) sStyleName = *static_cast<OUString*>(m_pCharStyleLB->GetSelectEntryData()); Sequence<PropertyValues>& aRubyValues = m_pImpl->GetRubyValues(); - for (sal_Int32 nRuby = 0; nRuby < aRubyValues.getLength(); nRuby++) + for (PropertyValues & rProps : aRubyValues) { - Sequence<PropertyValue> &rProps = aRubyValues.getArray()[nRuby]; - PropertyValue* pProps = rProps.getArray(); - for (sal_Int32 nProp = 0; nProp < rProps.getLength(); nProp++) + for (PropertyValue & propVal : rProps) { - if (pProps[nProp].Name == cRubyCharStyleName) + if (propVal.Name == cRubyCharStyleName) { - pProps[nProp].Value <<= sStyleName; + propVal.Value <<= sStyleName; } } SetModified(true); diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx index 6b61ab0acd5b..ada679becd45 100644 --- a/svx/source/fmcomp/fmgridif.cxx +++ b/svx/source/fmcomp/fmgridif.cxx @@ -2682,9 +2682,8 @@ Sequence< css::util::URL>& FmXGridPeer::getSupportedURLs() // let an css::util::URL-transformer normalize the URLs Reference< css::util::XURLTransformer > xTransformer( util::URLTransformer::create(::comphelper::getProcessComponentContext()) ); - pSupported = aSupported.getArray(); - for (sal_Int32 i=0; i<aSupported.getLength(); ++i) - xTransformer->parseStrict(pSupported[i]); + for (css::util::URL & rURL : aSupported) + xTransformer->parseStrict(rURL); } return aSupported; diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index bb780941d291..0e285474c6ad 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -2838,11 +2838,10 @@ Reference< XControl> FmXFormShell::impl_getControl( const Reference< XControlMod Reference< XControlContainer> xControlContainer( getControlContainerForView(), UNO_SET_THROW ); Sequence< Reference< XControl > > seqControls( xControlContainer->getControls() ); - const Reference< XControl >* pControls = seqControls.getArray(); // ... that I can then search - for (sal_Int32 i=0; i<seqControls.getLength(); ++i) + for (Reference< XControl > const & control : seqControls) { - xControl.set( pControls[i], UNO_SET_THROW ); + xControl.set( control, UNO_SET_THROW ); Reference< XControlModel > xCurrentModel( xControl->getModel() ); if ( xCurrentModel == i_rxModel ) break; diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx index 5de1ae5490cf..ffa434938cae 100644 --- a/svx/source/form/navigatortree.cxx +++ b/svx/source/form/navigatortree.cxx @@ -980,14 +980,12 @@ namespace svxform #endif // (OSL_DEBUG_LEVEL > 0) Reference< XPropertySetInfo > xPropInfo( xCurrent->getPropertySetInfo()); Sequence< Property> seqAllCurrentProps = xPropInfo->getProperties(); - Property* pAllCurrentProps = seqAllCurrentProps.getArray(); - for (sal_Int32 j=0; j<seqAllCurrentProps.getLength(); ++j) + for (Property const & currentProp : seqAllCurrentProps) { - OUString sCurrentProp = pAllCurrentProps[j].Name; - if (((pAllCurrentProps[j].Attributes & PropertyAttribute::READONLY) == 0) && (sCurrentProp != FM_PROP_NAME)) + if (((currentProp.Attributes & PropertyAttribute::READONLY) == 0) && (currentProp.Name != FM_PROP_NAME)) { // (read-only attribs aren't set, ditto name, // NewControl defined it uniquely - xNewPropSet->setPropertyValue(sCurrentProp, xCurrent->getPropertyValue(sCurrentProp)); + xNewPropSet->setPropertyValue(currentProp.Name, xCurrent->getPropertyValue(currentProp.Name)); } } |