[Libreoffice-commits] core.git: shell/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Feb 6 09:00:22 UTC 2019


 shell/source/all/xml_parser.cxx                           |   22 +++++++-------
 shell/source/unix/sysshell/recently_used_file_handler.cxx |   22 +++++++-------
 2 files changed, 22 insertions(+), 22 deletions(-)

New commits:
commit 202d9af5ab4291a8f867791293477a18ae48051d
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Feb 6 09:26:46 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Feb 6 09:59:59 2019 +0100

    loplugin:flatten in shell
    
    Change-Id: Id58f692168274a942d2b976f10885341dfe63ac3
    Reviewed-on: https://gerrit.libreoffice.org/67434
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

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<const char*>(get_local_name(atts[i])))] = UTF8ToWString(reinterpret_cast<const char*>(atts[i+1]));
-            i += 2; // skip to next pair
-        }
+    int i = 0;
 
-        pDocHdl->start_element(
-            UTF8ToWString(reinterpret_cast<const char*>(name)), UTF8ToWString(reinterpret_cast<const char*>(get_local_name(name))), attributes);
+    while(atts[i])
+    {
+        attributes[UTF8ToWString(reinterpret_cast<const char*>(get_local_name(atts[i])))] = UTF8ToWString(reinterpret_cast<const char*>(atts[i+1]));
+        i += 2; // skip to next pair
     }
+
+    pDocHdl->start_element(
+        UTF8ToWString(reinterpret_cast<const char*>(name)), UTF8ToWString(reinterpret_cast<const char*>(get_local_name(name))), attributes);
 }
 
 static void xml_end_element_handler(void* UserData, const XML_Char* name)
diff --git a/shell/source/unix/sysshell/recently_used_file_handler.cxx b/shell/source/unix/sysshell/recently_used_file_handler.cxx
index d85861346f21..b2c2a419adf3 100644
--- a/shell/source/unix/sysshell/recently_used_file_handler.cxx
+++ b/shell/source/unix/sysshell/recently_used_file_handler.cxx
@@ -313,20 +313,20 @@ namespace /* private */ {
         recently_used_file& file,
         recently_used_item_list_t& item_list)
     {
-        if (!item_list.empty())
-        {
-            file.truncate();
-            file.reset();
+        if (item_list.empty())
+            return;
 
-            file.write(XML_HEADER, strlen(XML_HEADER));
+        file.truncate();
+        file.reset();
 
-            std::for_each(
-                item_list.begin(),
-                item_list.end(),
-                recent_item_writer(file));
+        file.write(XML_HEADER, strlen(XML_HEADER));
 
-            file.write(XML_FOOTER, strlen(XML_FOOTER));
-        }
+        std::for_each(
+            item_list.begin(),
+            item_list.end(),
+            recent_item_writer(file));
+
+        file.write(XML_FOOTER, strlen(XML_FOOTER));
     }
 
 


More information about the Libreoffice-commits mailing list