summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-05-12 10:05:54 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-05-13 08:10:29 +0000
commit0f6725454823a5789f3e1c70dad024c46d3f6fc9 (patch)
tree370646f32cddb69aadf0d9659e90ed8600d43901 /toolkit
parentf12b17867ef8fa2cfc2ddb7ecda9d7acc57cfa59 (diff)
clang-tidy modernize-loop-convert in toolkit to uui
Change-Id: I805aa1389ef8dde158f0b776d6b59579fa3082e4 Reviewed-on: https://gerrit.libreoffice.org/24921 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/source/awt/vclxtoolkit.cxx12
-rw-r--r--toolkit/source/controls/unocontrol.cxx4
-rw-r--r--toolkit/source/helper/unowrapper.cxx3
-rw-r--r--toolkit/source/helper/vclunohelper.cxx12
4 files changed, 15 insertions, 16 deletions
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index 4230cdb56da1..c99030cabecf 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -1787,10 +1787,10 @@ void VCLXToolkit::callTopWindowListeners(
{
css::lang::EventObject aAwtEvent(
static_cast< css::awt::XWindow * >(pWindow->GetWindowPeer()));
- for (::sal_Int32 i = 0; i < (sal_Int32)aListeners.size(); ++i)
+ for (css::uno::Reference<XInterface> & i : aListeners)
{
css::uno::Reference< css::awt::XTopWindowListener >
- xListener(aListeners[i], css::uno::UNO_QUERY);
+ xListener(i, css::uno::UNO_QUERY);
try
{
(xListener.get()->*pFn)(aAwtEvent);
@@ -1833,10 +1833,10 @@ bool VCLXToolkit::callKeyHandlers(::VclSimpleEvent const * pEvent,
pKeyEvent->GetKeyCode().GetCode(), pKeyEvent->GetCharCode(),
sal::static_int_cast< sal_Int16 >(
pKeyEvent->GetKeyCode().GetFunction()));
- for (::sal_Int32 i = 0; i < (sal_Int32)aHandlers.size(); ++i)
+ for (css::uno::Reference<XInterface> & i : aHandlers)
{
css::uno::Reference< css::awt::XKeyHandler > xHandler(
- aHandlers[i], css::uno::UNO_QUERY);
+ i, css::uno::UNO_QUERY);
try
{
if ((bPressed ? xHandler->keyPressed(aAwtEvent)
@@ -1883,10 +1883,10 @@ void VCLXToolkit::callFocusListeners(::VclSimpleEvent const * pEvent,
static_cast< css::awt::XWindow * >(pWindow->GetWindowPeer()),
static_cast<sal_Int16>(pWindow->GetGetFocusFlags()),
xNext, false);
- for (::sal_Int32 i = 0; i < (sal_Int32)aListeners.size(); ++i)
+ for (css::uno::Reference<XInterface> & i : aListeners)
{
css::uno::Reference< css::awt::XFocusListener > xListener(
- aListeners[i], css::uno::UNO_QUERY);
+ i, css::uno::UNO_QUERY);
try
{
bGained ? xListener->focusGained(aAwtEvent)
diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx
index 75959ed08cf9..adb398993403 100644
--- a/toolkit/source/controls/unocontrol.cxx
+++ b/toolkit/source/controls/unocontrol.cxx
@@ -586,9 +586,9 @@ void UnoControl::ImplModelPropertiesChanged( const Sequence< PropertyChangeEvent
while ( pLangDepProp->pPropName != nullptr )
{
bool bMustBeInserted( true );
- for ( size_t i = 0; i < aPeerPropertiesToSet.size(); i++ )
+ for (PropertyValue & i : aPeerPropertiesToSet)
{
- if ( aPeerPropertiesToSet[i].Name.equalsAsciiL(
+ if ( i.Name.equalsAsciiL(
pLangDepProp->pPropName, pLangDepProp->nPropNameLength ))
{
bMustBeInserted = false;
diff --git a/toolkit/source/helper/unowrapper.cxx b/toolkit/source/helper/unowrapper.cxx
index cc217b7fd390..d5a00ada8826 100644
--- a/toolkit/source/helper/unowrapper.cxx
+++ b/toolkit/source/helper/unowrapper.cxx
@@ -197,9 +197,8 @@ void UnoWrapper::ReleaseAllGraphics( OutputDevice* pOutDev )
std::vector< VCLXGraphics* > *pLst = pOutDev->GetUnoGraphicsList();
if ( pLst )
{
- for ( size_t n = 0; n < pLst->size(); n++ )
+ for (VCLXGraphics* pGrf : *pLst)
{
- VCLXGraphics* pGrf = (*pLst)[ n ];
pGrf->SetOutputDevice( nullptr );
}
}
diff --git a/toolkit/source/helper/vclunohelper.cxx b/toolkit/source/helper/vclunohelper.cxx
index bfe0e51613f6..dda017297fb2 100644
--- a/toolkit/source/helper/vclunohelper.cxx
+++ b/toolkit/source/helper/vclunohelper.cxx
@@ -544,19 +544,19 @@ namespace
{ FUNIT_FOOT, MeasureUnit::FOOT, 1 },
{ FUNIT_MILE, MeasureUnit::MILE, 1 },
};
- for ( size_t i = 0; i < SAL_N_ELEMENTS( aUnits ); ++i )
+ for (auto & aUnit : aUnits)
{
if ( eDirection == FieldUnitToMeasurementUnit )
{
- if ( ( aUnits[ i ].eFieldUnit == (FieldUnit)_nUnit ) && ( aUnits[ i ].nFieldToMeasureFactor == _rFieldToUNOValueFactor ) )
- return aUnits[ i ].nMeasurementUnit;
+ if ( ( aUnit.eFieldUnit == (FieldUnit)_nUnit ) && ( aUnit.nFieldToMeasureFactor == _rFieldToUNOValueFactor ) )
+ return aUnit.nMeasurementUnit;
}
else
{
- if ( aUnits[ i ].nMeasurementUnit == _nUnit )
+ if ( aUnit.nMeasurementUnit == _nUnit )
{
- _rFieldToUNOValueFactor = aUnits[ i ].nFieldToMeasureFactor;
- return (sal_Int16)aUnits[ i ].eFieldUnit;
+ _rFieldToUNOValueFactor = aUnit.nFieldToMeasureFactor;
+ return (sal_Int16)aUnit.eFieldUnit;
}
}
}