From 202d9af5ab4291a8f867791293477a18ae48051d Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 6 Feb 2019 09:26:46 +0200 Subject: loplugin:flatten in shell Change-Id: Id58f692168274a942d2b976f10885341dfe63ac3 Reviewed-on: https://gerrit.libreoffice.org/67434 Tested-by: Jenkins Reviewed-by: Noel Grandin --- shell/source/all/xml_parser.cxx | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'shell/source/all') diff --git a/shell/source/all/xml_parser.cxx b/shell/source/all/xml_parser.cxx index fd24e3c16919..b067c6231b81 100644 --- a/shell/source/all/xml_parser.cxx +++ b/shell/source/all/xml_parser.cxx @@ -94,21 +94,21 @@ static void xml_start_element_handler(void* UserData, const XML_Char* name, cons xml_parser* pImpl = get_parser_instance(UserData); i_xml_parser_event_handler* pDocHdl = pImpl->get_document_handler(); - if (pDocHdl) - { - xml_tag_attribute_container_t attributes; + if (!pDocHdl) + return; - int i = 0; + xml_tag_attribute_container_t attributes; - while(atts[i]) - { - attributes[UTF8ToWString(reinterpret_cast(get_local_name(atts[i])))] = UTF8ToWString(reinterpret_cast(atts[i+1])); - i += 2; // skip to next pair - } + int i = 0; - pDocHdl->start_element( - UTF8ToWString(reinterpret_cast(name)), UTF8ToWString(reinterpret_cast(get_local_name(name))), attributes); + while(atts[i]) + { + attributes[UTF8ToWString(reinterpret_cast(get_local_name(atts[i])))] = UTF8ToWString(reinterpret_cast(atts[i+1])); + i += 2; // skip to next pair } + + pDocHdl->start_element( + UTF8ToWString(reinterpret_cast(name)), UTF8ToWString(reinterpret_cast(get_local_name(name))), attributes); } static void xml_end_element_handler(void* UserData, const XML_Char* name) -- cgit