[glom] Remove useless old LIBXMLCPP_EXCEPTIONS_ENABLED ifdefs.



commit dd94edc2fdcd28cde5566bb2ab35740f844533d0
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Nov 3 20:04:01 2015 +0100

    Remove useless old LIBXMLCPP_EXCEPTIONS_ENABLED ifdefs.

 glom/libglom/document/bakery/document_xml.cc |    8 --------
 glom/mode_design/iso_codes.cc                |   12 ------------
 tests/glade_toplevels_instantiation.cc       |    5 -----
 3 files changed, 0 insertions(+), 25 deletions(-)
---
diff --git a/glom/libglom/document/bakery/document_xml.cc b/glom/libglom/document/bakery/document_xml.cc
index 61e12be..43a6cd6 100644
--- a/glom/libglom/document/bakery/document_xml.cc
+++ b/glom/libglom/document/bakery/document_xml.cc
@@ -44,9 +44,7 @@ bool Document_XML::load_after(int& failure_code)
   if(!bTest)
     return false; //Failed.
 
-#ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
   try
-#endif
   {
     //Link the parser to the XML text that was loaded:
     //m_DOM_Parser.setDoValidation(true);
@@ -60,14 +58,12 @@ bool Document_XML::load_after(int& failure_code)
 
     return true; //Success.
   }
-#ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
   catch(const std::exception& ex)
   {
     std::cerr << G_STRFUNC << ": XML Parser error: \n" << ex.what() << std::endl;
 
     return false; //Failed.
   }
-#endif
 }
 
 
@@ -99,21 +95,17 @@ Glib::ustring Document_XML::get_xml() const
 
 void Document_XML::Util_DOM_Write(Glib::ustring& refstrXML) const
 {
-#ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
   try
-#endif
   {
     if(m_write_formatted)
       refstrXML = m_pDOM_Document->write_to_string_formatted();
     else
       refstrXML = m_pDOM_Document->write_to_string();
   }
-#ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
   catch(xmlpp::exception& ex)
   {
     std::cerr << G_STRFUNC << ": exception caught: " << ex.what() << std::endl;
   }
-#endif
 }
 
 void Document_XML::set_dtd_name(const std::string& strVal)
diff --git a/glom/mode_design/iso_codes.cc b/glom/mode_design/iso_codes.cc
index b51dd0b..cf3724f 100644
--- a/glom/mode_design/iso_codes.cc
+++ b/glom/mode_design/iso_codes.cc
@@ -47,9 +47,7 @@ type_list_currencies get_list_of_currency_symbols()
   {
     const Glib::ustring filename = ISO_CODES_PREFIX "/share/xml/iso-codes/iso_4217.xml";
 
-#ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
     try
-#endif // LIBXMLCPP_EXCEPTIONS_ENABLED
     {
       xmlpp::DomParser parser;
       //parser.set_validate();
@@ -87,12 +85,10 @@ type_list_currencies get_list_of_currency_symbols()
         }
       }
     }
-#ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
     catch(const std::exception& ex)
     {
       std::cerr << G_STRFUNC << ": Exception while parsing iso codes (currencies): " << ex.what() << 
std::endl;
     }
-#endif // LIBXMLCPP_EXCEPTIONS_ENABLED
   }
 
   return list_currencies;
@@ -152,9 +148,7 @@ Glib::ustring get_locale_name(const Glib::ustring& locale_id)
 
     const std::string filename_languages = ISO_CODES_PREFIX "/share/xml/iso-codes/iso_639.xml";
 
-#ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
     try
-#endif // LIBXMLCPP_EXCEPTIONS_ENABLED
     {
       xmlpp::DomParser parser;
       //parser.set_validate();
@@ -193,12 +187,10 @@ Glib::ustring get_locale_name(const Glib::ustring& locale_id)
         }
       }
     }
-#ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
     catch(const std::exception& ex)
     {
       std::cerr << G_STRFUNC << ": Exception while parsing iso codes (locales): " << ex.what() << std::endl;
     }
-#endif // LIBXMLCPP_EXCEPTIONS_ENABLED
 
     //Get the (translated) country names:
     typedef std::map<Glib::ustring, Glib::ustring> type_map_country; //ID to country name.
@@ -206,9 +198,7 @@ Glib::ustring get_locale_name(const Glib::ustring& locale_id)
 
     const Glib::ustring filename_countries = ISO_CODES_PREFIX "/share/xml/iso-codes/iso_3166.xml";
 
-#ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
     try
-#endif // LIBXMLCPP_EXCEPTIONS_ENABLED
     {
       xmlpp::DomParser parser;
       //parser.set_validate();
@@ -246,12 +236,10 @@ Glib::ustring get_locale_name(const Glib::ustring& locale_id)
         }
       }
     }
-#ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
     catch(const std::exception& ex)
     {
       std::cerr << G_STRFUNC << ": Exception while parsing iso codes (locales): " << ex.what() << std::endl;
     }
-#endif // LIBXMLCPP_EXCEPTIONS_ENABLED
 
     //Use a map so we can easily check for duplicates.
     for(const auto& id : list_ids)
diff --git a/tests/glade_toplevels_instantiation.cc b/tests/glade_toplevels_instantiation.cc
index 94a75f5..4c72754 100644
--- a/tests/glade_toplevels_instantiation.cc
+++ b/tests/glade_toplevels_instantiation.cc
@@ -103,10 +103,8 @@ int main(int argc, char* argv[])
     return EXIT_FAILURE;
   }
 
-  #ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
   try
   {
-  #endif //LIBXMLCPP_EXCEPTIONS_ENABLED
     xmlpp::DomParser parser;
     //parser.set_validate();
     parser.set_substitute_entities(); //We just want the text to be resolved/unescaped automatically.
@@ -126,14 +124,11 @@ int main(int argc, char* argv[])
        if(child && !attempt_instantiation(filepath, child))
          return EXIT_FAILURE;
     }
-
-  #ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
   }
   catch(const std::exception& ex)
   {
     std::cout << "Exception caught: " << ex.what() << std::endl;
   }
-  #endif //LIBXMLCPP_EXCEPTIONS_ENABLED
 
   return EXIT_SUCCESS;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]