diff options
Diffstat (limited to 'reportdesign/source/ui')
-rw-r--r-- | reportdesign/source/ui/dlg/AddField.cxx | 18 | ||||
-rw-r--r-- | reportdesign/source/ui/dlg/DateTime.cxx | 6 | ||||
-rw-r--r-- | reportdesign/source/ui/dlg/GroupsSorting.cxx | 18 | ||||
-rw-r--r-- | reportdesign/source/ui/dlg/Navigator.cxx | 6 | ||||
-rw-r--r-- | reportdesign/source/ui/inspection/GeometryHandler.cxx | 8 | ||||
-rw-r--r-- | reportdesign/source/ui/misc/RptUndo.cxx | 10 | ||||
-rw-r--r-- | reportdesign/source/ui/report/ReportController.cxx | 27 | ||||
-rw-r--r-- | reportdesign/source/ui/report/ReportSection.cxx | 17 | ||||
-rw-r--r-- | reportdesign/source/ui/report/ViewsWindow.cxx | 14 |
9 files changed, 45 insertions, 79 deletions
diff --git a/reportdesign/source/ui/dlg/AddField.cxx b/reportdesign/source/ui/dlg/AddField.cxx index ec3297328428..5a56839f1ef9 100644 --- a/reportdesign/source/ui/dlg/AddField.cxx +++ b/reportdesign/source/ui/dlg/AddField.cxx @@ -277,26 +277,22 @@ namespace { void lcl_addToList( OAddFieldWindowListBox& _rListBox, const uno::Sequence< OUString >& _rEntries ) { - const OUString* pEntries = _rEntries.getConstArray(); - sal_Int32 nEntries = _rEntries.getLength(); - for ( sal_Int32 i = 0; i < nEntries; ++i, ++pEntries ) - _rListBox.InsertEntry( *pEntries,nullptr,false,TREELIST_APPEND,new ColumnInfo(*pEntries) ); + for ( const OUString& rEntry : _rEntries ) + _rListBox.InsertEntry( rEntry,nullptr,false,TREELIST_APPEND,new ColumnInfo(rEntry) ); } void lcl_addToList( OAddFieldWindowListBox& _rListBox, const uno::Reference< container::XNameAccess>& i_xColumns ) { - uno::Sequence< OUString > aEntries = i_xColumns->getElementNames(); - const OUString* pEntries = aEntries.getConstArray(); - sal_Int32 nEntries = aEntries.getLength(); - for ( sal_Int32 i = 0; i < nEntries; ++i, ++pEntries ) + const uno::Sequence< OUString > aEntries = i_xColumns->getElementNames(); + for ( const OUString& rEntry : aEntries ) { - uno::Reference< beans::XPropertySet> xColumn(i_xColumns->getByName(*pEntries),UNO_QUERY_THROW); + uno::Reference< beans::XPropertySet> xColumn(i_xColumns->getByName(rEntry),UNO_QUERY_THROW); OUString sLabel; if ( xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_LABEL) ) xColumn->getPropertyValue(PROPERTY_LABEL) >>= sLabel; if ( !sLabel.isEmpty() ) - _rListBox.InsertEntry( sLabel,nullptr,false,TREELIST_APPEND,new ColumnInfo(*pEntries,sLabel) ); + _rListBox.InsertEntry( sLabel,nullptr,false,TREELIST_APPEND,new ColumnInfo(rEntry,sLabel) ); else - _rListBox.InsertEntry( *pEntries,nullptr,false,TREELIST_APPEND,new ColumnInfo(*pEntries,sLabel) ); + _rListBox.InsertEntry( rEntry,nullptr,false,TREELIST_APPEND,new ColumnInfo(rEntry,sLabel) ); } } } diff --git a/reportdesign/source/ui/dlg/DateTime.cxx b/reportdesign/source/ui/dlg/DateTime.cxx index 6aa4c1566073..4d2be17a59b5 100644 --- a/reportdesign/source/ui/dlg/DateTime.cxx +++ b/reportdesign/source/ui/dlg/DateTime.cxx @@ -86,11 +86,9 @@ void ODateTimeDialog::InsertEntry(sal_Int16 _nNumberFormatId) const uno::Reference< util::XNumberFormatter> xNumberFormatter = m_pController->getReportNumberFormatter(); const uno::Reference< util::XNumberFormats> xFormats = xNumberFormatter->getNumberFormatsSupplier()->getNumberFormats(); const uno::Sequence<sal_Int32> aFormatKeys = xFormats->queryKeys(_nNumberFormatId,m_nLocale,true); - const sal_Int32* pIter = aFormatKeys.getConstArray(); - const sal_Int32* pEnd = pIter + aFormatKeys.getLength(); - for (;pIter != pEnd; ++pIter) + for (const sal_Int32 nFormatKey : aFormatKeys) { - pListBox->append(OUString::number(*pIter), getFormatStringByKey(*pIter,xFormats,bTime)); + pListBox->append(OUString::number(nFormatKey), getFormatStringByKey(nFormatKey,xFormats,bTime)); } } diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx index 84e5c626b123..5bdc020c929c 100644 --- a/reportdesign/source/ui/dlg/GroupsSorting.cxx +++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx @@ -58,20 +58,18 @@ using namespace ::comphelper; static void lcl_addToList_throw( ComboBoxControl& _rListBox, ::std::vector<ColumnInfo>& o_aColumnList,const uno::Reference< container::XNameAccess>& i_xColumns ) { - uno::Sequence< OUString > aEntries = i_xColumns->getElementNames(); - const OUString* pEntries = aEntries.getConstArray(); - sal_Int32 nEntries = aEntries.getLength(); - for ( sal_Int32 i = 0; i < nEntries; ++i, ++pEntries ) + const uno::Sequence< OUString > aEntries = i_xColumns->getElementNames(); + for ( const OUString& rEntry : aEntries ) { - uno::Reference< beans::XPropertySet> xColumn(i_xColumns->getByName(*pEntries),uno::UNO_QUERY_THROW); + uno::Reference< beans::XPropertySet> xColumn(i_xColumns->getByName(rEntry),uno::UNO_QUERY_THROW); OUString sLabel; if ( xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_LABEL) ) xColumn->getPropertyValue(PROPERTY_LABEL) >>= sLabel; - o_aColumnList.emplace_back(*pEntries,sLabel ); + o_aColumnList.emplace_back(rEntry,sLabel ); if ( !sLabel.isEmpty() ) _rListBox.InsertEntry( sLabel ); else - _rListBox.InsertEntry( *pEntries ); + _rListBox.InsertEntry( rEntry ); } } @@ -317,11 +315,9 @@ void OFieldExpressionControl::moveGroups(const uno::Sequence<uno::Any>& _aGroups const UndoContext aUndoContext( m_pParent->m_pController->getUndoManager(), sUndoAction ); uno::Reference< report::XGroups> xGroups = m_pParent->getGroups(); - const uno::Any* pIter = _aGroups.getConstArray(); - const uno::Any* pEnd = pIter + _aGroups.getLength(); - for(;pIter != pEnd;++pIter) + for(const uno::Any& rGroup : _aGroups) { - uno::Reference< report::XGroup> xGroup(*pIter,uno::UNO_QUERY); + uno::Reference< report::XGroup> xGroup(rGroup,uno::UNO_QUERY); if ( xGroup.is() ) { uno::Sequence< beans::PropertyValue > aArgs(1); diff --git a/reportdesign/source/ui/dlg/Navigator.cxx b/reportdesign/source/ui/dlg/Navigator.cxx index 6dd851e5bd0c..80d018d88220 100644 --- a/reportdesign/source/ui/dlg/Navigator.cxx +++ b/reportdesign/source/ui/dlg/Navigator.cxx @@ -502,11 +502,9 @@ void NavigatorTree::_selectionChanged( const lang::EventObject& aEvent ) } else { - const uno::Reference< report::XReportComponent >* pIter = aSelection.getConstArray(); - const uno::Reference< report::XReportComponent >* pEnd = pIter + aSelection.getLength(); - for (; pIter != pEnd; ++pIter) + for (const uno::Reference<report::XReportComponent>& rElem : std::as_const(aSelection)) { - SvTreeListEntry* pEntry = find(*pIter); + SvTreeListEntry* pEntry = find(rElem); if ( pEntry && !IsSelected(pEntry) ) { Select(pEntry); diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx index 37631941ce21..4a724dd490a5 100644 --- a/reportdesign/source/ui/inspection/GeometryHandler.cxx +++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx @@ -1711,12 +1711,10 @@ void GeometryHandler::impl_fillMimeTypes_nothrow(::std::vector< OUString >& _out const uno::Reference< report::XReportDefinition> xReportDefinition(m_xReportComponent,uno::UNO_QUERY); if ( xReportDefinition.is() ) { - uno::Sequence< OUString > aMimeTypes( xReportDefinition->getAvailableMimeTypes() ); - const OUString* pIter = aMimeTypes.getConstArray(); - const OUString* pEnd = pIter + aMimeTypes.getLength(); - for(;pIter != pEnd; ++pIter) + const uno::Sequence< OUString > aMimeTypes( xReportDefinition->getAvailableMimeTypes() ); + for(const OUString& rMimeType : aMimeTypes) { - const OUString sDocName( impl_ConvertMimeTypeToUI_nothrow(*pIter) ); + const OUString sDocName( impl_ConvertMimeTypeToUI_nothrow(rMimeType) ); if ( !sDocName.isEmpty() ) _out_rList.push_back(sDocName); } diff --git a/reportdesign/source/ui/misc/RptUndo.cxx b/reportdesign/source/ui/misc/RptUndo.cxx index 1f53e763207a..121f8e76d3be 100644 --- a/reportdesign/source/ui/misc/RptUndo.cxx +++ b/reportdesign/source/ui/misc/RptUndo.cxx @@ -155,13 +155,11 @@ void OSectionUndo::collectControls(const uno::Reference< report::XSection >& _xS { // copy all properties for restoring uno::Reference< beans::XPropertySetInfo> xInfo = _xSection->getPropertySetInfo(); - uno::Sequence< beans::Property> aSeq = xInfo->getProperties(); - const beans::Property* pIter = aSeq.getConstArray(); - const beans::Property* pEnd = pIter + aSeq.getLength(); - for(;pIter != pEnd;++pIter) + const uno::Sequence< beans::Property> aSeq = xInfo->getProperties(); + for(const beans::Property& rProp : aSeq) { - if ( 0 == (pIter->Attributes & beans::PropertyAttribute::READONLY) ) - m_aValues.emplace_back(pIter->Name,_xSection->getPropertyValue(pIter->Name)); + if ( 0 == (rProp.Attributes & beans::PropertyAttribute::READONLY) ) + m_aValues.emplace_back(rProp.Name,_xSection->getPropertyValue(rProp.Name)); } lcl_collectElements(_xSection,m_aControls); } diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index fd0a6b4ca88e..1c7d05fd1f12 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -3306,12 +3306,12 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs) try { bool bHandleOnlyOne = false; - const PropertyValue* pIter = aArgs.getConstArray(); - const PropertyValue* pEnd = pIter + aArgs.getLength(); - for(;pIter != pEnd && !bHandleOnlyOne;++pIter) + for(const PropertyValue& rArg : aArgs) { + if (bHandleOnlyOne) + break; Sequence< PropertyValue > aValue; - if ( !(pIter->Value >>= aValue) ) + if ( !(rArg.Value >>= aValue) ) { // the sequence has only one element which already contains the descriptor bHandleOnlyOne = true; aValue = aArgs; @@ -3666,15 +3666,13 @@ void OReportController::listen(const bool _bAdd) OXUndoEnvironment& rUndoEnv = m_aReportModel->GetUndoEnv(); uno::Reference< XPropertyChangeListener > xUndo = &rUndoEnv; - uno::Sequence< beans::Property> aSeq = m_xReportDefinition->getPropertySetInfo()->getProperties(); - const beans::Property* pIter = aSeq.getConstArray(); - const beans::Property* pEnd = pIter + aSeq.getLength(); + const uno::Sequence< beans::Property> aSeq = m_xReportDefinition->getPropertySetInfo()->getProperties(); const OUString* pPropsBegin = &aProps[0]; const OUString* pPropsEnd = pPropsBegin + SAL_N_ELEMENTS(aProps) - 3; - for(;pIter != pEnd;++pIter) + for(const beans::Property& rProp : aSeq) { - if ( ::std::find(pPropsBegin,pPropsEnd,pIter->Name) == pPropsEnd ) - (m_xReportDefinition.get()->*pPropertyListenerAction)( pIter->Name, xUndo ); + if ( ::std::find(pPropsBegin,pPropsEnd,rProp.Name) == pPropsEnd ) + (m_xReportDefinition.get()->*pPropertyListenerAction)( rProp.Name, xUndo ); } // Add Listeners to UndoEnvironment @@ -4060,14 +4058,7 @@ css::uno::Sequence< OUString > SAL_CALL OReportController::getSupportedModes( ) sal_Bool SAL_CALL OReportController::supportsMode( const OUString& aMode ) { uno::Sequence< OUString> aModes = getSupportedModes(); - const OUString* pIter = aModes.getConstArray(); - const OUString* pEnd = pIter + aModes.getLength(); - for(;pIter != pEnd;++pIter) - { - if ( *pIter == aMode ) - break; - } - return pIter != pEnd; + return comphelper::findValue(aModes, aMode) != -1; } bool OReportController::isUiVisible() const diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx index 880a68f7b59c..6c8b6af013ab 100644 --- a/reportdesign/source/ui/report/ReportSection.cxx +++ b/reportdesign/source/ui/report/ReportSection.cxx @@ -244,29 +244,24 @@ void OReportSection::Paste(const uno::Sequence< beans::NamedValue >& _aAllreadyC // unmark all objects m_pView->UnmarkAll(); const OUString sSectionName = m_xSection->getName(); - const sal_Int32 nLength = _aAllreadyCopiedObjects.getLength(); - const beans::NamedValue* pIter = _aAllreadyCopiedObjects.getConstArray(); - const beans::NamedValue* pEnd = pIter + nLength; - for(;pIter != pEnd;++pIter) + for(const beans::NamedValue& rObject : _aAllreadyCopiedObjects) { - if ( _bForce || pIter->Name == sSectionName) + if ( _bForce || rObject.Name == sSectionName) { try { uno::Sequence< uno::Reference<report::XReportComponent> > aCopies; - pIter->Value >>= aCopies; - const uno::Reference<report::XReportComponent>* pCopiesIter = aCopies.getConstArray(); - const uno::Reference<report::XReportComponent>* pCopiesEnd = pCopiesIter + aCopies.getLength(); - for (;pCopiesIter != pCopiesEnd ; ++pCopiesIter) + rObject.Value >>= aCopies; + for (const uno::Reference<report::XReportComponent>& rCopy : std::as_const(aCopies)) { - SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( *pCopiesIter ); + SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( rCopy ); SdrObject* pObject = pShape ? pShape->GetSdrObject() : nullptr; if ( pObject ) { // Clone to target SdrModel SdrObject* pNewObj(pObject->CloneSdrObject(*m_pModel.get())); m_pPage->InsertObject(pNewObj, SAL_MAX_SIZE); - tools::Rectangle aRet(VCLPoint((*pCopiesIter)->getPosition()),VCLSize((*pCopiesIter)->getSize())); + tools::Rectangle aRet(VCLPoint(rCopy->getPosition()),VCLSize(rCopy->getSize())); aRet.setHeight(aRet.getHeight() + 1); aRet.setWidth(aRet.getWidth() + 1); bool bOverlapping = true; diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index f81db3a9a4bf..bbff52d5e05f 100644 --- a/reportdesign/source/ui/report/ViewsWindow.cxx +++ b/reportdesign/source/ui/report/ViewsWindow.cxx @@ -602,11 +602,9 @@ void OViewsWindow::setMarked(const uno::Reference< report::XSection>& _xSection, void OViewsWindow::setMarked(const uno::Sequence< uno::Reference< report::XReportComponent> >& _aShapes, bool _bMark) { bool bFirst = true; - const uno::Reference< report::XReportComponent>* pIter = _aShapes.getConstArray(); - const uno::Reference< report::XReportComponent>* pEnd = pIter + _aShapes.getLength(); - for(;pIter != pEnd;++pIter) + for(const uno::Reference< report::XReportComponent>& rShape : _aShapes) { - const uno::Reference< report::XSection> xSection = (*pIter)->getSection(); + const uno::Reference< report::XSection> xSection = rShape->getSection(); if ( xSection.is() ) { if ( bFirst ) @@ -617,7 +615,7 @@ void OViewsWindow::setMarked(const uno::Sequence< uno::Reference< report::XRepor OSectionWindow* pSectionWindow = getSectionWindow(xSection); if ( pSectionWindow ) { - SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( *pIter ); + SvxShape* pShape = comphelper::getUnoTunnelImplementation<SvxShape>( rShape ); SdrObject* pObject = pShape ? pShape->GetSdrObject() : nullptr; OSL_ENSURE( pObject, "OViewsWindow::setMarked: no SdrObject for the shape!" ); if ( pObject ) @@ -1607,12 +1605,10 @@ void OViewsWindow::fillCollapsedSections(::std::vector<sal_uInt16>& _rCollapsedP void OViewsWindow::collapseSections(const uno::Sequence< beans::PropertyValue>& _aCollpasedSections) { - const beans::PropertyValue* pIter = _aCollpasedSections.getConstArray(); - const beans::PropertyValue* pEnd = pIter + _aCollpasedSections.getLength(); - for (; pIter != pEnd; ++pIter) + for (const beans::PropertyValue& rSection : _aCollpasedSections) { sal_uInt16 nPos = sal_uInt16(-1); - if ( (pIter->Value >>= nPos) && nPos < m_aSections.size() ) + if ( (rSection.Value >>= nPos) && nPos < m_aSections.size() ) { m_aSections[nPos]->setCollapsed(true); } |