diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-12 10:07:50 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-05-13 08:09:03 +0000 |
commit | 96fab0513215cc416e96e1b2089466afd0d2791c (patch) | |
tree | 7c03bd56b0c3744f0560c05ebb2f422155e64543 /xmlscript/source | |
parent | b3d5da663ff09c72455a8d3bf9be7c00220271bb (diff) |
clang-tidy modernize-loop-convert in writerfilter to xmlsecurity
Change-Id: I334411c6b57c028ffb41b5deb72002f9d54038c3
Reviewed-on: https://gerrit.libreoffice.org/24923
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'xmlscript/source')
-rw-r--r-- | xmlscript/source/xml_helper/xml_element.cxx | 4 | ||||
-rw-r--r-- | xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx | 4 | ||||
-rw-r--r-- | xmlscript/source/xmldlg_imexp/xmldlg_export.cxx | 12 | ||||
-rw-r--r-- | xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx | 6 | ||||
-rw-r--r-- | xmlscript/source/xmldlg_imexp/xmldlg_import.cxx | 4 |
5 files changed, 13 insertions, 17 deletions
diff --git a/xmlscript/source/xml_helper/xml_element.cxx b/xmlscript/source/xml_helper/xml_element.cxx index d758b0fa9662..1347ac84d582 100644 --- a/xmlscript/source/xml_helper/xml_element.cxx +++ b/xmlscript/source/xml_helper/xml_element.cxx @@ -44,9 +44,9 @@ Reference< xml::sax::XAttributeList > XMLElement::getSubElement( sal_Int32 nInde void XMLElement::dumpSubElements( Reference< xml::sax::XDocumentHandler > const & xOut ) { - for ( size_t nPos = 0; nPos < _subElems.size(); ++nPos ) + for (Reference<XAttributeList> & _subElem : _subElems) { - XMLElement * pElem = static_cast< XMLElement * >( _subElems[ nPos ].get() ); + XMLElement * pElem = static_cast< XMLElement * >( _subElem.get() ); pElem->dump( xOut ); } } diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx index 7f17cf8a83c6..6610f76d4ad4 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx @@ -1229,9 +1229,9 @@ void ElementDescriptor::readBullitinBoard( StyleBag * all_styles ) } if (! all_elements.empty()) { - for ( std::size_t n = 0; n < all_elements.size(); ++n ) + for (ElementDescriptor* p : all_elements) { - addSubElement( all_elements[ n ] ); + addSubElement( p ); } } } diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx index d4a250984e54..d8a7446d51b3 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx @@ -1270,10 +1270,8 @@ OUString StyleBag::getStyleId( Style const & rStyle ) } // lookup existing style - for ( size_t nStylesPos = 0; nStylesPos < _styles.size(); ++nStylesPos ) + for (Style* pStyle : _styles) { - Style * pStyle = _styles[ nStylesPos ]; - short demanded_defaults = ~rStyle._set & rStyle._all; // test, if defaults are not set if ((~pStyle->_set & demanded_defaults) == demanded_defaults && @@ -1342,9 +1340,9 @@ OUString StyleBag::getStyleId( Style const & rStyle ) StyleBag::~StyleBag() { - for ( size_t nPos = 0; nPos < _styles.size(); ++nPos ) + for (Style* _style : _styles) { - delete _styles[ nPos ]; + delete _style; } } @@ -1356,9 +1354,9 @@ void StyleBag::dump( Reference< xml::sax::XExtendedDocumentHandler > const & xOu xOut->ignorableWhitespace( OUString() ); xOut->startElement( aStylesName, Reference< xml::sax::XAttributeList >() ); // export styles - for ( size_t nPos = 0; nPos < _styles.size(); ++nPos ) + for (Style* _style : _styles) { - Reference< xml::sax::XAttributeList > xAttr( _styles[ nPos ]->createElement() ); + Reference< xml::sax::XAttributeList > xAttr( _style->createElement() ); static_cast< ElementDescriptor * >( xAttr.get() )->dump( xOut.get() ); } xOut->ignorableWhitespace( OUString() ); diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx index 4d157d2c6736..006adccdb427 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx @@ -1195,9 +1195,8 @@ void TitledBoxElement::endElement() } // create radios AFTER group box! - for ( size_t nPos = 0; nPos < _radios.size(); ++nPos ) + for (Reference<XElement>& xRadio : _radios) { - Reference< xml::input::XElement > xRadio( _radios[ nPos ] ); Reference< xml::input::XAttributes > xAttributes( xRadio->getAttributes() ); ControlImportContext ctx( _pImport, getControlId( xAttributes ), getControlModelName( "com.sun.star.awt.UnoControlRadioButtonModel", xAttributes ) ); @@ -1291,9 +1290,8 @@ Reference< xml::input::XElement > RadioGroupElement::startChildElement( void RadioGroupElement::endElement() throw (xml::sax::SAXException, RuntimeException, std::exception) { - for ( size_t nPos = 0; nPos < _radios.size(); ++nPos ) + for (Reference<XElement>& xRadio : _radios) { - Reference< xml::input::XElement > xRadio( _radios[ nPos ] ); Reference< xml::input::XAttributes > xAttributes( xRadio->getAttributes() ); diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx index 3303bb0a1614..3b53820b090c 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx @@ -1441,11 +1441,11 @@ void ImportContext::importEvents( Reference< container::XNameContainer > xEvents( xSupplier->getEvents() ); if (xEvents.is()) { - for ( size_t nPos = 0; nPos < rEvents.size(); ++nPos ) + for (const auto & rEvent : rEvents) { script::ScriptEventDescriptor descr; - EventElement * pEventElement = static_cast< EventElement * >( rEvents[ nPos ].get() ); + EventElement * pEventElement = static_cast< EventElement * >( rEvent.get() ); sal_Int32 nUid = pEventElement->getUid(); OUString aLocalName( pEventElement->getLocalName() ); Reference< xml::input::XAttributes > xAttributes( pEventElement->getAttributes() ); |