diff options
Diffstat (limited to 'reportdesign')
-rw-r--r-- | reportdesign/source/filter/xml/xmlExport.cxx | 4 | ||||
-rw-r--r-- | reportdesign/source/ui/dlg/DateTime.cxx | 4 | ||||
-rw-r--r-- | reportdesign/source/ui/dlg/GroupsSorting.cxx | 20 | ||||
-rw-r--r-- | reportdesign/source/ui/inspection/DataProviderHandler.cxx | 4 | ||||
-rw-r--r-- | reportdesign/source/ui/inspection/DefaultInspection.cxx | 4 | ||||
-rw-r--r-- | reportdesign/source/ui/inspection/GeometryHandler.cxx | 6 | ||||
-rw-r--r-- | reportdesign/source/ui/misc/UITools.cxx | 10 | ||||
-rw-r--r-- | reportdesign/source/ui/report/ReportController.cxx | 40 | ||||
-rw-r--r-- | reportdesign/source/ui/report/propbrw.cxx | 4 |
9 files changed, 48 insertions, 48 deletions
diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx index 7d01e8e76118..26a5b216372e 100644 --- a/reportdesign/source/filter/xml/xmlExport.cxx +++ b/reportdesign/source/filter/xml/xmlExport.cxx @@ -1569,8 +1569,8 @@ void ORptExport::exportGroupsExpressionAsFunction(const Reference< XGroups>& _xG if ( !sFunction.isEmpty() ) { const sal_Unicode pReplaceChars[] = { '(',')',';',',','+','-','[',']','/','*'}; - for(sal_uInt32 j= 0; j < SAL_N_ELEMENTS(pReplaceChars);++j) - sFunctionName = sFunctionName.replace(pReplaceChars[j],'_'); + for(sal_Unicode ch : pReplaceChars) + sFunctionName = sFunctionName.replace(ch,'_'); xFunction->setName(sFunctionName); if ( !sInitialFormula.isEmpty() ) diff --git a/reportdesign/source/ui/dlg/DateTime.cxx b/reportdesign/source/ui/dlg/DateTime.cxx index 3e2e1b7866f6..86e048228630 100644 --- a/reportdesign/source/ui/dlg/DateTime.cxx +++ b/reportdesign/source/ui/dlg/DateTime.cxx @@ -87,8 +87,8 @@ ODateTimeDialog::ODateTimeDialog( vcl::Window* _pParent m_aTimeControlling.enableOnCheckMark( *m_pTime, *m_pFTTimeFormat, *m_pTimeListBox); CheckBox* aCheckBoxes[] = { m_pDate,m_pTime}; - for ( size_t i = 0 ; i < SAL_N_ELEMENTS(aCheckBoxes); ++i) - aCheckBoxes[i]->SetClickHdl(LINK(this,ODateTimeDialog,CBClickHdl)); + for (CheckBox* pCheckBox : aCheckBoxes) + pCheckBox->SetClickHdl(LINK(this,ODateTimeDialog,CBClickHdl)); } diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx index a659c3de334c..62857d7f81b5 100644 --- a/reportdesign/source/ui/dlg/GroupsSorting.cxx +++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx @@ -961,11 +961,11 @@ OGroupsSortingDialog::OGroupsSortingDialog(vcl::Window* _pParent, bool _bReadOnl m_pFieldExpression->set_vexpand(true); Control* pControlsLst[] = { m_pHeaderLst, m_pFooterLst, m_pGroupOnLst, m_pKeepTogetherLst, m_pOrderLst, m_pGroupIntervalEd}; - for (size_t i = 0; i < SAL_N_ELEMENTS(pControlsLst); ++i) + for (Control* i : pControlsLst) { - pControlsLst[i]->SetGetFocusHdl(LINK(this, OGroupsSortingDialog, OnControlFocusGot)); - pControlsLst[i]->SetLoseFocusHdl(LINK(this, OGroupsSortingDialog, OnControlFocusLost)); - pControlsLst[i]->Show(); + i->SetGetFocusHdl(LINK(this, OGroupsSortingDialog, OnControlFocusGot)); + i->SetLoseFocusHdl(LINK(this, OGroupsSortingDialog, OnControlFocusLost)); + i->Show(); } for (size_t i = 0; i < SAL_N_ELEMENTS(pControlsLst) - 1; ++i) @@ -1072,8 +1072,8 @@ void OGroupsSortingDialog::SaveData( sal_Int32 _nRow) xGroup->setSortAscending( m_pOrderLst->GetSelectEntryPos() == 0 ); ListBox* pControls[] = { m_pHeaderLst, m_pFooterLst, m_pGroupOnLst, m_pKeepTogetherLst, m_pOrderLst}; - for (size_t i = 0; i < SAL_N_ELEMENTS(pControls); ++i) - pControls[i]->SaveValue(); + for (ListBox* pControl : pControls) + pControl->SaveValue(); } @@ -1305,13 +1305,13 @@ void OGroupsSortingDialog::displayGroup(const uno::Reference<report::XGroup>& _x m_pOrderLst->SelectEntryPos(_xGroup->getSortAscending() ? 0 : 1); ListBox* pControls[] = { m_pHeaderLst, m_pFooterLst, m_pGroupOnLst, m_pKeepTogetherLst, m_pOrderLst}; - for (size_t i = 0; i < SAL_N_ELEMENTS(pControls); ++i) - pControls[i]->SaveValue(); + for (ListBox* pControl : pControls) + pControl->SaveValue(); ListBox* pControlsLst2[] = { m_pHeaderLst, m_pFooterLst, m_pGroupOnLst, m_pKeepTogetherLst, m_pOrderLst}; bool bReadOnly = !m_pController->isEditable(); - for (size_t i = 0; i < SAL_N_ELEMENTS(pControlsLst2); ++i) - pControlsLst2[i]->SetReadOnly(bReadOnly); + for (ListBox* i : pControlsLst2) + i->SetReadOnly(bReadOnly); m_pGroupIntervalEd->SetReadOnly(bReadOnly); } diff --git a/reportdesign/source/ui/inspection/DataProviderHandler.cxx b/reportdesign/source/ui/inspection/DataProviderHandler.cxx index 054f249dc871..bdcca01828c3 100644 --- a/reportdesign/source/ui/inspection/DataProviderHandler.cxx +++ b/reportdesign/source/ui/inspection/DataProviderHandler.cxx @@ -374,9 +374,9 @@ uno::Sequence< beans::Property > SAL_CALL DataProviderHandler::getSupportedPrope ,OUString(PROPERTY_PREVIEW_COUNT) }; - for (size_t nPos = 0; nPos < SAL_N_ELEMENTS(s_pProperties); ++nPos ) + for (const OUString & rName : s_pProperties) { - aValue.Name = s_pProperties[nPos]; + aValue.Name = rName; aNewProps.push_back(aValue); } } diff --git a/reportdesign/source/ui/inspection/DefaultInspection.cxx b/reportdesign/source/ui/inspection/DefaultInspection.cxx index cd68746685b1..fe0e6c122c46 100644 --- a/reportdesign/source/ui/inspection/DefaultInspection.cxx +++ b/reportdesign/source/ui/inspection/DefaultInspection.cxx @@ -119,9 +119,9 @@ namespace rptui const size_t nFactories = SAL_N_ELEMENTS( aFactories ); Sequence< Any > aReturn( nFactories ); Any* pReturn = aReturn.getArray(); - for ( size_t i = 0; i < nFactories; ++i ) + for (const auto& rFactory : aFactories) { - *pReturn++ <<= OUString::createFromAscii( aFactories[i].serviceName ); + *pReturn++ <<= OUString::createFromAscii( rFactory.serviceName ); } return aReturn; diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx index 4bf753ae801c..535fa5800dc4 100644 --- a/reportdesign/source/ui/inspection/GeometryHandler.cxx +++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx @@ -1309,15 +1309,15 @@ uno::Sequence< beans::Property > SAL_CALL GeometryHandler::getSupportedPropertie }; const uno::Reference < beans::XPropertySetInfo > xInfo = m_xReportComponent->getPropertySetInfo(); const uno::Sequence< beans::Property> aSeq = xInfo->getProperties(); - for (size_t i = 0; i < SAL_N_ELEMENTS(pIncludeProperties); ++i ) + for (const auto & rIncludeProp : pIncludeProperties) { const beans::Property* pIter = aSeq.getConstArray(); const beans::Property* pEnd = pIter + aSeq.getLength(); - const beans::Property* pFind = ::std::find_if(pIter,pEnd,::std::bind2nd(PropertyCompare(),boost::cref(pIncludeProperties[i]))); + const beans::Property* pFind = ::std::find_if(pIter,pEnd,::std::bind2nd(PropertyCompare(),boost::cref(rIncludeProp))); if ( pFind != pEnd ) { // special case for controls which contain a data field - if ( PROPERTY_DATAFIELD == pIncludeProperties[i] ) + if ( PROPERTY_DATAFIELD == rIncludeProp ) { beans::Property aValue; aValue.Name = PROPERTY_FORMULALIST; diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx index 4ab8226d84c8..e7c3fc07549b 100644 --- a/reportdesign/source/ui/misc/UITools.cxx +++ b/reportdesign/source/ui/misc/UITools.cxx @@ -540,13 +540,13 @@ namespace ,{ITEMID_LANGUAGE_ASIAN,OUString(PROPERTY_CHARLOCALEASIAN)} ,{ITEMID_LANGUAGE_COMPLEX,OUString(PROPERTY_CHARLOCALECOMPLEX)} }; - for(size_t k = 0; k < SAL_N_ELEMENTS(pItems); ++k) + for(const auto & k : pItems) { - if ( SfxItemState::SET == _rItemSet.GetItemState( pItems[k].nWhich,true,&pItem) && dynamic_cast< const SvxLanguageItem *>( pItem ) != nullptr) + if ( SfxItemState::SET == _rItemSet.GetItemState( k.nWhich,true,&pItem) && dynamic_cast< const SvxLanguageItem *>( pItem ) != nullptr) { const SvxLanguageItem* pFontItem = static_cast<const SvxLanguageItem*>(pItem); lang::Locale aCharLocale( LanguageTag( pFontItem->GetLanguage()).getLocale()); - lcl_pushBack( _out_rProperties, pItems[k].sPropertyName, uno::makeAny( aCharLocale ) ); + lcl_pushBack( _out_rProperties, k.sPropertyName, uno::makeAny( aCharLocale ) ); } } if ( SfxItemState::SET == _rItemSet.GetItemState( ITEMID_ESCAPEMENT,true,&pItem) && dynamic_cast< const SvxEscapementItem *>( pItem ) != nullptr) @@ -730,8 +730,8 @@ bool openCharDialog( const uno::Reference<report::XReportControlFormat >& _rxRep } SfxItemPool::Free(pPool); - for (sal_uInt16 i=0; i<SAL_N_ELEMENTS(pDefaults); ++i) - delete pDefaults[i]; + for (SfxPoolItem* pDefault : pDefaults) + delete pDefault; return bSuccess; } diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index 8ed293d56581..0125f607c7bd 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -2093,10 +2093,10 @@ void OReportController::onLoadedMenu(const Reference< frame::XLayoutManager >& _ ,OUString("private:resource/toolbar/resizebar") ,OUString("private:resource/toolbar/sectionshrinkbar") }; - for (size_t i = 0; i< SAL_N_ELEMENTS(s_sMenu); ++i) + for (const auto & i : s_sMenu) { - _xLayoutManager->createElement( s_sMenu[i] ); - _xLayoutManager->requestElement( s_sMenu[i] ); + _xLayoutManager->createElement( i ); + _xLayoutManager->requestElement( i ); } } } @@ -2536,8 +2536,8 @@ void OReportController::openPageDialog(const uno::Reference<report::XSection>& _ } SfxItemPool::Free(pPool); - for (sal_uInt16 i=0; i<SAL_N_ELEMENTS(pDefaults); ++i) - delete pDefaults[i]; + for (SfxPoolItem* pDefault : pDefaults) + delete pDefault; } @@ -2735,11 +2735,11 @@ uno::Any SAL_CALL OReportController::getViewData() throw( uno::RuntimeException, }; ::comphelper::NamedValueCollection aCommandProperties; - for ( size_t i=0; i < SAL_N_ELEMENTS(nCommandIDs); ++i ) + for (sal_Int32 nCommandID : nCommandIDs) { - const FeatureState aFeatureState = GetState( nCommandIDs[i] ); + const FeatureState aFeatureState = GetState( nCommandID ); - OUString sCommandURL( getURLForId( nCommandIDs[i] ).Main ); + OUString sCommandURL( getURLForId( nCommandID ).Main ); OSL_ENSURE( sCommandURL.startsWith( ".uno:" ), "OReportController::getViewData: illegal command URL!" ); sCommandURL = sCommandURL.copy( 5 ); @@ -3208,10 +3208,10 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co ,OUString(PROPERTY_FORMATSSUPPLIER) ,OUString(PROPERTY_BACKGROUNDCOLOR) }; - for(size_t i = 0; i < SAL_N_ELEMENTS(sProps); ++i) + for(const auto & sProp : sProps) { - if ( xInfo->hasPropertyByName(sProps[i]) && xShapeInfo->hasPropertyByName(sProps[i]) ) - xUnoProp->setPropertyValue(sProps[i],xShapeProp->getPropertyValue(sProps[i])); + if ( xInfo->hasPropertyByName(sProp) && xShapeInfo->hasPropertyByName(sProp) ) + xUnoProp->setPropertyValue(sProp,xShapeProp->getPropertyValue(sProp)); } if ( xInfo->hasPropertyByName(PROPERTY_BORDER) && xShapeInfo->hasPropertyByName(PROPERTY_CONTROLBORDER) ) @@ -3507,10 +3507,10 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs) ,OUString(PROPERTY_BORDER) ,OUString(PROPERTY_BACKGROUNDCOLOR) }; - for(size_t k = 0; k < SAL_N_ELEMENTS(sProps); ++k) + for(const auto & sProp : sProps) { - if ( xInfo->hasPropertyByName(sProps[k]) && xShapeInfo->hasPropertyByName(sProps[k]) ) - xUnoProp->setPropertyValue(sProps[k],xShapeProp->getPropertyValue(sProps[k])); + if ( xInfo->hasPropertyByName(sProp) && xShapeInfo->hasPropertyByName(sProp) ) + xUnoProp->setPropertyValue(sProp,xShapeProp->getPropertyValue(sProp)); } if ( xInfo->hasPropertyByName(PROPERTY_DATAFIELD) ) { @@ -3618,8 +3618,8 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs) } else { - for(size_t i = 0; i < SAL_N_ELEMENTS(pControl); ++i) - delete pControl[i]; + for(SdrUnoObj* i : pControl) + delete i; } } } @@ -3679,8 +3679,8 @@ void OReportController::listen(const bool _bAdd) void (SAL_CALL XPropertySet::*pPropertyListenerAction)( const OUString&, const uno::Reference< XPropertyChangeListener >& ) = _bAdd ? &XPropertySet::addPropertyChangeListener : &XPropertySet::removePropertyChangeListener; - for (size_t i = 0; i < SAL_N_ELEMENTS(aProps); ++i) - (m_xReportDefinition.get()->*pPropertyListenerAction)( aProps[i], static_cast< XPropertyChangeListener* >( this ) ); + for (const auto & aProp : aProps) + (m_xReportDefinition.get()->*pPropertyListenerAction)( aProp, static_cast< XPropertyChangeListener* >( this ) ); OXUndoEnvironment& rUndoEnv = m_aReportModel->GetUndoEnv(); uno::Reference< XPropertyChangeListener > xUndo = &rUndoEnv; @@ -4259,8 +4259,8 @@ void OReportController::openZoomDialog() } SfxItemPool::Free(pPool); - for (sal_uInt16 i=0; i<SAL_N_ELEMENTS(pDefaults); ++i) - delete pDefaults[i]; + for (SfxPoolItem* pDefault : pDefaults) + delete pDefault; } } diff --git a/reportdesign/source/ui/report/propbrw.cxx b/reportdesign/source/ui/report/propbrw.cxx index acb161f75798..594a27c627b8 100644 --- a/reportdesign/source/ui/report/propbrw.cxx +++ b/reportdesign/source/ui/report/propbrw.cxx @@ -194,8 +194,8 @@ void PropBrw::dispose() const OUString pProps[] = { OUString( "ContextDocument" ) , OUString( "DialogParentWindow" ) , OUString( "ActiveConnection" )}; - for (size_t i = 0; i < SAL_N_ELEMENTS(pProps); ++i) - xName->removeByName(pProps[i]); + for (const auto & i : pProps) + xName->removeByName(i); } } catch(Exception&) |