[glom] Remove unused methods.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] Remove unused methods.
- Date: Thu, 16 Dec 2010 13:29:02 +0000 (UTC)
commit 8c957e25fdf6068a0aa1ef6409e441d0b70c6125
Author: Murray Cumming <murrayc murrayc com>
Date: Thu Dec 16 14:26:24 2010 +0100
Remove unused methods.
* glom/libglom/data_structure/glomconversions.cc:
* glom/libglom/document/bakery/document.cc:
* glom/libglom/document/bakery/document.h:
* glom/libglom/document/bakery/document_xml.cc:
* glom/libglom/document/bakery/document_xml.h:
* glom/libglom/document/document.cc:
* glom/libglom/document/document.h:
* glom/utility_widgets/canvas/test_canvas_editable.cc:
Remove unused methods, found by cppcheck. Some other methods that cppcheck
mentions seem to be virtual methods that are used.
ChangeLog | 15 +++++++++++
glom/libglom/data_structure/glomconversions.cc | 4 +++
glom/libglom/document/bakery/document.cc | 5 ---
glom/libglom/document/bakery/document.h | 1 -
glom/libglom/document/bakery/document_xml.cc | 27 --------------------
glom/libglom/document/bakery/document_xml.h | 1 -
glom/libglom/document/document.cc | 19 --------------
glom/libglom/document/document.h | 2 -
.../utility_widgets/canvas/test_canvas_editable.cc | 4 ++-
9 files changed, 22 insertions(+), 56 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index cfd4886..ff4d03f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,20 @@
2010-12-16 Murray Cumming <murrayc murrayc com>
+ Remove unused methods.
+
+ * glom/libglom/data_structure/glomconversions.cc:
+ * glom/libglom/document/bakery/document.cc:
+ * glom/libglom/document/bakery/document.h:
+ * glom/libglom/document/bakery/document_xml.cc:
+ * glom/libglom/document/bakery/document_xml.h:
+ * glom/libglom/document/document.cc:
+ * glom/libglom/document/document.h:
+ * glom/utility_widgets/canvas/test_canvas_editable.cc:
+ Remove unused methods, found by cppcheck. Some other methods that cppcheck
+ mentions seem to be virtual methods that are used.
+
+2010-12-16 Murray Cumming <murrayc murrayc com>
+
Remove unnecessary checks before use of delete.
* glom/application.cc:
diff --git a/glom/libglom/data_structure/glomconversions.cc b/glom/libglom/data_structure/glomconversions.cc
index ecca89c..03218ca 100644
--- a/glom/libglom/data_structure/glomconversions.cc
+++ b/glom/libglom/data_structure/glomconversions.cc
@@ -256,9 +256,11 @@ Glib::ustring Conversions::format_tm(const tm& tm_data, const std::locale& local
*/
}
+
namespace //anonymous
{
+/*
class numpunct_thousands_separator: public std::numpunct<char>
{
//Override
@@ -267,6 +269,7 @@ class numpunct_thousands_separator: public std::numpunct<char>
return "\3";
};
};
+*/
class numpunct_no_thousands_separator: public std::numpunct<char>
{
@@ -279,6 +282,7 @@ class numpunct_no_thousands_separator: public std::numpunct<char>
} //anonymous namespace
+
Glib::ustring Conversions::get_text_for_gda_value(Field::glom_field_type glom_type, const Gnome::Gda::Value& value, const NumericFormat& numeric_format)
{
return get_text_for_gda_value(glom_type, value, std::locale("") /* the user's current locale */, numeric_format); //Get the current locale.
diff --git a/glom/libglom/document/bakery/document.cc b/glom/libglom/document/bakery/document.cc
index 567c7b4..29fa535 100644
--- a/glom/libglom/document/bakery/document.cc
+++ b/glom/libglom/document/bakery/document.cc
@@ -89,11 +89,6 @@ void Document::set_file_uri(const Glib::ustring& file_uri, bool bEnforceFileExte
m_file_uri = get_file_uri_with_extension(m_file_uri);
}
-void Document::set_contents(const Glib::ustring& strVal)
-{
- m_strContents = strVal;
-}
-
Glib::ustring Document::get_contents() const
{
return m_strContents;
diff --git a/glom/libglom/document/bakery/document.h b/glom/libglom/document/bakery/document.h
index 9ea69f6..ca82b7c 100644
--- a/glom/libglom/document/bakery/document.h
+++ b/glom/libglom/document/bakery/document.h
@@ -74,7 +74,6 @@ public:
void set_is_new(bool bVal);
Glib::ustring get_contents() const;
- void set_contents(const Glib::ustring& strVal);
Glib::ustring get_file_uri_with_extension(const Glib::ustring& uri);
diff --git a/glom/libglom/document/bakery/document_xml.cc b/glom/libglom/document/bakery/document_xml.cc
index 74b856b..96ba688 100644
--- a/glom/libglom/document/bakery/document_xml.cc
+++ b/glom/libglom/document/bakery/document_xml.cc
@@ -88,33 +88,6 @@ bool Document_XML::save_before()
}
}
-//TODO: Why is this parameter here if it is not used?
-bool Document_XML::set_xml(const Glib::ustring& /* strXML */)
-{
-#ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
- try
-#endif
- {
- if(m_strContents.empty())
- g_warning("Document_XML::set_xml(): parsing empty document.");
-
- m_DOM_Parser.parse_memory(m_strContents);
- m_pDOM_Document = m_DOM_Parser.get_document();
- if(!m_pDOM_Document)
- return false;
-
- return true;
- }
-#ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
- catch(const std::exception& ex)
- {
- std::cerr << "XML Parser error: \n" << ex.what() << std::endl;
- return false; //Failed.
- }
-#endif
-}
-
-
Glib::ustring Document_XML::get_xml() const
{
//Write XML to string:
diff --git a/glom/libglom/document/bakery/document_xml.h b/glom/libglom/document/bakery/document_xml.h
index c079cac..612d0b2 100644
--- a/glom/libglom/document/bakery/document_xml.h
+++ b/glom/libglom/document/bakery/document_xml.h
@@ -65,7 +65,6 @@ public:
*/
void add_indenting_white_space();
- bool set_xml(const Glib::ustring& strXML); //Parse the XML from the text.
Glib::ustring get_xml() const; //Get the text for the XML.
protected:
diff --git a/glom/libglom/document/document.cc b/glom/libglom/document/document.cc
index 24d9f1e..34c2bbd 100644
--- a/glom/libglom/document/document.cc
+++ b/glom/libglom/document/document.cc
@@ -3873,16 +3873,6 @@ Document::type_listReports Document::get_report_names(const Glib::ustring& table
return type_listReports();
}
-void Document::remove_all_reports(const Glib::ustring& table_name)
-{
- type_tables::iterator iterFind = m_tables.find(table_name);
- if(iterFind != m_tables.end())
- {
- iterFind->second.m_reports.clear();
- set_modified();
- }
-}
-
void Document::set_report(const Glib::ustring& table_name, const sharedptr<Report>& report)
{
type_tables::iterator iterFind = m_tables.find(table_name);
@@ -3941,15 +3931,6 @@ Document::type_listPrintLayouts Document::get_print_layout_names(const Glib::ust
return type_listReports();
}
-void Document::remove_all_print_layouts(const Glib::ustring& table_name)
-{
- type_tables::iterator iterFind = m_tables.find(table_name);
- if(iterFind != m_tables.end())
- {
- iterFind->second.m_print_layouts.clear();
- set_modified();
- }
-}
void Document::set_print_layout(const Glib::ustring& table_name, const sharedptr<PrintLayout>& print_layout)
{
diff --git a/glom/libglom/document/document.h b/glom/libglom/document/document.h
index e0c7c47..100124c 100644
--- a/glom/libglom/document/document.h
+++ b/glom/libglom/document/document.h
@@ -320,7 +320,6 @@ public:
typedef std::list<Glib::ustring> type_listReports;
type_listReports get_report_names(const Glib::ustring& table_name) const;
- void remove_all_reports(const Glib::ustring& table_name);
void set_report(const Glib::ustring& table_name, const sharedptr<Report>& report);
sharedptr<Report> get_report(const Glib::ustring& table_name, const Glib::ustring& report_name) const;
@@ -329,7 +328,6 @@ public:
//Print Layouts are precisely positioned layouts for printing to a printer:
typedef std::list<Glib::ustring> type_listPrintLayouts;
type_listPrintLayouts get_print_layout_names(const Glib::ustring& table_name) const;
- void remove_all_print_layouts(const Glib::ustring& table_name);
void set_print_layout(const Glib::ustring& table_name, const sharedptr<PrintLayout>& print_layout);
sharedptr<PrintLayout> get_print_layout(const Glib::ustring& table_name, const Glib::ustring& print_layout_name) const;
void remove_print_layout(const Glib::ustring& table_name, const Glib::ustring& print_layout_name);
diff --git a/glom/utility_widgets/canvas/test_canvas_editable.cc b/glom/utility_widgets/canvas/test_canvas_editable.cc
index 39ffd47..bc77657 100644
--- a/glom/utility_widgets/canvas/test_canvas_editable.cc
+++ b/glom/utility_widgets/canvas/test_canvas_editable.cc
@@ -133,6 +133,7 @@ public:
private:
//This is an override:
+ /*
virtual void on_show_context_menu(guint button, guint32 activate_time)
{
if(m_context_menu)
@@ -146,7 +147,8 @@ private:
void on_context_menu_delete()
{
}
-
+ */
+
void setup_context_menu()
{
m_context_menu_action_group = Gtk::ActionGroup::create();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]