diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2018-03-17 22:06:55 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2018-03-18 09:13:59 +0100 |
commit | 93f8b703a0f0287354723855afe8e65297ecf716 (patch) | |
tree | 1edb1c9599937726bdaef63fb5443559ec46d7a5 /helpcompiler/source/BasCodeTagger.cxx | |
parent | ea01c61fe374b1122a03568d72f166bb16fa7858 (diff) |
Use for-range loops in helpcompiler
Change-Id: I787a5b43cb09ac308082cac0e66540f975d79ead
Reviewed-on: https://gerrit.libreoffice.org/51473
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'helpcompiler/source/BasCodeTagger.cxx')
-rw-r--r-- | helpcompiler/source/BasCodeTagger.cxx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/helpcompiler/source/BasCodeTagger.cxx b/helpcompiler/source/BasCodeTagger.cxx index f59c1d268e0d..8af743e1b5f7 100644 --- a/helpcompiler/source/BasCodeTagger.cxx +++ b/helpcompiler/source/BasCodeTagger.cxx @@ -82,7 +82,7 @@ void BasicCodeTagger::getBasicCodeContainerNodes() } while ( !m_pXmlTreeWalker->end() ) { - m_pXmlTreeWalker->nextNode(); + m_pXmlTreeWalker->nextNode(); if ( !( xmlStrcmp( m_pXmlTreeWalker->currentNode()->name, reinterpret_cast<const xmlChar*>("bascode") ) ) ) { //Found <bascode> m_BasicCodeContainerTags.push_back( m_pXmlTreeWalker->currentNode() ); //it goes to the end of the list @@ -139,14 +139,13 @@ void BasicCodeTagger::tagParagraph( xmlNodePtr paragraph ) RTL_TEXTENCODING_UTF8 ); std::vector<HighlightPortion> portions; m_Highlighter.getHighlightPortions( strLine, portions ); - for (std::vector<HighlightPortion>::iterator i(portions.begin()); - i != portions.end(); ++i) + for (auto const& portion : portions) { - OString sToken(OUStringToOString(strLine.copy(i->nBegin, i->nEnd-i->nBegin), RTL_TEXTENCODING_UTF8)); + OString sToken(OUStringToOString(strLine.copy(portion.nBegin, portion.nEnd-portion.nBegin), RTL_TEXTENCODING_UTF8)); xmlNodePtr text = xmlNewText(reinterpret_cast<const xmlChar*>(sToken.getStr())); - if ( i->tokenType != TokenType::Whitespace ) + if ( portion.tokenType != TokenType::Whitespace ) { - xmlChar* typeStr = getTypeString( i->tokenType ); + xmlChar* typeStr = getTypeString( portion.tokenType ); curNode = xmlNewTextChild( paragraph, nullptr, reinterpret_cast<xmlChar const *>("item"), nullptr ); xmlNewProp( curNode, reinterpret_cast<xmlChar const *>("type"), typeStr ); xmlAddChild( curNode, text ); |