[glom] C++11: More use of nullptr.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] C++11: More use of nullptr.
- Date: Mon, 7 Nov 2016 19:47:54 +0000 (UTC)
commit bdf9efc6eeded0246c93beb0bfea127377945cec
Author: Murray Cumming <murrayc murrayc com>
Date: Mon Nov 7 16:55:38 2016 +0100
C++11: More use of nullptr.
With help from clang-tidy.
glom/appwindow.cc | 4 ++--
glom/base_db.cc | 2 +-
glom/dialog_existing_or_new.cc | 4 ++--
glom/import_csv/dialog_import_csv_progress.cc | 2 +-
glom/import_csv/file_encodings.cc | 4 ++--
glom/libglom/connectionpool.cc | 8 ++++----
glom/libglom/connectionpool_backends/sqlite.cc | 2 +-
glom/libglom/data_structure/glomconversions.cc | 4 ++--
glom/libglom/db_utils.cc | 4 ++--
glom/libglom/python_embed/py_glom_record.cc | 2 +-
glom/libglom/spawn_with_feedback.cc | 10 +++++-----
glom/libglom/sql_utils.cc | 2 +-
glom/libglom/translations_po.cc | 2 +-
glom/libglom/xsl_utils.cc | 6 +++---
glom/mode_data/box_data.cc | 2 +-
glom/mode_data/box_data_calendar_related.cc | 2 +-
glom/mode_data/buttonglom.cc | 2 +-
glom/mode_data/datawidget/checkbutton.cc | 2 +-
glom/mode_data/datawidget/combo.cc | 2 +-
.../mode_data/datawidget/combo_as_radio_buttons.cc | 2 +-
glom/mode_data/datawidget/datawidget.cc | 4 ++--
glom/mode_data/datawidget/entry.cc | 2 +-
glom/mode_data/datawidget/label.cc | 2 +-
glom/mode_data/datawidget/textview.cc | 2 +-
glom/mode_data/db_adddel/db_adddel.cc | 6 +++---
glom/mode_data/flowtablewithfields.cc | 2 +-
glom/print_layout/canvas_layout_item.cc | 2 +-
glom/print_layout/canvas_print_layout.cc | 4 ++--
glom/utility_widgets/adddel/adddel.cc | 6 +++---
glom/utility_widgets/dialog_image_save_progress.cc | 2 +-
glom/utility_widgets/flowtable.cc | 2 +-
glom/utility_widgets/imageglom.cc | 4 ++--
glom/utility_widgets/notebooklabelglom.cc | 2 +-
glom/utils_ui.cc | 2 +-
tests/python/test_python_execute_func.cc | 2 +-
.../python/test_python_execute_func_bad_syntax.cc | 2 +-
.../test_python_execute_func_change_result_type.cc | 2 +-
tests/python/test_python_execute_func_date.cc | 4 ++--
.../python/test_python_execute_func_with_record.cc | 2 +-
tests/python/test_python_execute_script.cc | 2 +-
tests/python/test_python_module.cc | 4 ++--
tests/test_xml_utils.cc | 2 +-
tests/translations_po/test_document_export_po.cc | 2 +-
43 files changed, 66 insertions(+), 66 deletions(-)
---
diff --git a/glom/appwindow.cc b/glom/appwindow.cc
index 12c3d65..9407a50 100644
--- a/glom/appwindow.cc
+++ b/glom/appwindow.cc
@@ -694,7 +694,7 @@ void AppWindow::open_browsed_document(const EpcServiceInfo* server, const Glib::
}
g_free(document_contents);
- document_contents = 0;
+ document_contents = nullptr;
//TODO_Performance: Horribly inefficient, but happens rarely:
const auto temp_document_contents = document_temp.build_and_get_contents();
@@ -2692,7 +2692,7 @@ Glib::ustring AppWindow::get_current_locale()
return m_current_locale;
//Get the user's current locale:
- const auto cLocale = setlocale(LC_ALL, 0); //Passing NULL means query, instead of set.
+ const auto cLocale = setlocale(LC_ALL, nullptr); //Passing NULL means query, instead of set.
if(cLocale)
{
//std::cout << "debug1: " << G_STRFUNC << ": locale=" << cLocale << std::endl;
diff --git a/glom/base_db.cc b/glom/base_db.cc
index 2cfc704..178dfa7 100644
--- a/glom/base_db.cc
+++ b/glom/base_db.cc
@@ -649,7 +649,7 @@ void Base_DB::calculate_field(const LayoutFieldInRecord& field_in_record)
if(field)
{
//We need the connection when we run the script, so that the script may use it.
- auto sharedconnection = connect_to_server(0 /* parent window */);
+ auto sharedconnection = connect_to_server(nullptr /* parent window */);
g_assert(sharedconnection);
diff --git a/glom/dialog_existing_or_new.cc b/glom/dialog_existing_or_new.cc
index b67d114..5e61f5f 100644
--- a/glom/dialog_existing_or_new.cc
+++ b/glom/dialog_existing_or_new.cc
@@ -161,7 +161,7 @@ Dialog_ExistingOrNew::Dialog_ExistingOrNew(BaseObjectType* cobject, const Glib::
// Browse local network
#ifndef G_OS_WIN32
gchar* service_type = epc_service_type_new(EPC_PROTOCOL_HTTPS, "glom");
- m_service_monitor = epc_service_monitor_new_for_types(0, service_type, (void*)0);
+ m_service_monitor = epc_service_monitor_new_for_types(nullptr, service_type, (void*)nullptr);
g_signal_connect(m_service_monitor, "service-found", G_CALLBACK(on_service_found_static), this);
g_signal_connect(m_service_monitor, "service-removed", G_CALLBACK(on_service_removed_static), this);
g_free(service_type);
@@ -718,7 +718,7 @@ void Dialog_ExistingOrNew::on_service_found(const Glib::ustring& name, EpcServic
gchar* title = g_strdup_printf(_("%s on %s (via %s)"), name.c_str(), epc_service_info_get_host(info),
epc_service_info_get_interface(info));
auto iter = m_existing_model->prepend(m_iter_existing_network->children());
(*iter)[m_existing_columns.m_col_title] = title;
- (*iter)[m_existing_columns.m_col_time] = std::time(0); /* sort more recently discovered items above */
+ (*iter)[m_existing_columns.m_col_time] = std::time(nullptr); /* sort more recently discovered items above
*/
(*iter)[m_existing_columns.m_col_service_name] = name;
(*iter)[m_existing_columns.m_col_service_info] = info;
diff --git a/glom/import_csv/dialog_import_csv_progress.cc b/glom/import_csv/dialog_import_csv_progress.cc
index 6d5b3da..54ca591 100644
--- a/glom/import_csv/dialog_import_csv_progress.cc
+++ b/glom/import_csv/dialog_import_csv_progress.cc
@@ -106,7 +106,7 @@ void Dialog_Import_CSV_Progress::clear()
m_progress_connection.disconnect();
m_ready_connection.disconnect();
- m_data_source = 0;
+ m_data_source = nullptr;
m_current_row = 0;
}
diff --git a/glom/import_csv/file_encodings.cc b/glom/import_csv/file_encodings.cc
index 2286d03..ff38f19 100644
--- a/glom/import_csv/file_encodings.cc
+++ b/glom/import_csv/file_encodings.cc
@@ -73,7 +73,7 @@ type_list_encodings get_list_of_encodings()
add_encoding(_("Unicode"), "UTF-7");
add_encoding(_("Unicode"), "UCS-2");
add_encoding(_("Unicode"), "UCS-4");
- add_encoding(0, 0); // This just adds a separator in the combo box
+ add_encoding(nullptr, nullptr); // This just adds a separator in the combo box
add_encoding(_("Western"), "ISO-8859-1");
add_encoding(_("Central European"), "ISO-8859-2");
add_encoding(_("South European"), "ISO-8859-3");
@@ -89,7 +89,7 @@ type_list_encodings get_list_of_encodings()
add_encoding(_("Celtic"), "ISO-8859-14");
add_encoding(_("Western"), "ISO-8859-15");
add_encoding(_("Romanian"), "ISO-8859-16");
- add_encoding(0, 0); // This just adds a separator in the combo box
+ add_encoding(nullptr, nullptr); // This just adds a separator in the combo box
add_encoding(_("Central European"), "WINDOWS-1250");
add_encoding(_("Cyrillic"), "WINDOWS-1251");
add_encoding(_("Western"), "WINDOWS-1252");
diff --git a/glom/libglom/connectionpool.cc b/glom/libglom/connectionpool.cc
index 21f094d..1c30f39 100644
--- a/glom/libglom/connectionpool.cc
+++ b/glom/libglom/connectionpool.cc
@@ -901,22 +901,22 @@ void ConnectionPool::avahi_start_publishing()
if(!document)
return;
- m_epc_publisher = epc_publisher_new(document->get_database_title_original().c_str(), "glom", 0);
+ m_epc_publisher = epc_publisher_new(document->get_database_title_original().c_str(), "glom", nullptr);
epc_publisher_set_protocol(m_epc_publisher, publish_protocol);
- epc_publisher_add_handler(m_epc_publisher, "document", on_publisher_document_requested, this /* user_data
*/, 0);
+ epc_publisher_add_handler(m_epc_publisher, "document", on_publisher_document_requested, this /* user_data
*/, nullptr);
//Password-protect the document,
//because the document's structure could be considered as a business secret:
epc_publisher_set_auth_flags(m_epc_publisher, EPC_AUTH_PASSWORD_TEXT_NEEDED);
- epc_publisher_set_auth_handler(m_epc_publisher, "document", on_publisher_document_authentication, this /*
user_data */, 0);
+ epc_publisher_set_auth_handler(m_epc_publisher, "document", on_publisher_document_authentication, this /*
user_data */, nullptr);
//Install progress callback, so we can keep the UI responsive while libepc is generating certificates for
the first time:
EpcShellProgressHooks callbacks;
callbacks.begin = &ConnectionPool::on_epc_progress_begin;
callbacks.update = &ConnectionPool::on_epc_progress_update;
callbacks.end = &ConnectionPool::on_epc_progress_end;
- epc_shell_set_progress_hooks(&callbacks, this, 0);
+ epc_shell_set_progress_hooks(&callbacks, this, nullptr);
//Prevent the consumer from seeing duplicates,
//if multiple client computers advertize the same document:
diff --git a/glom/libglom/connectionpool_backends/sqlite.cc b/glom/libglom/connectionpool_backends/sqlite.cc
index d966d8e..db9a596 100644
--- a/glom/libglom/connectionpool_backends/sqlite.cc
+++ b/glom/libglom/connectionpool_backends/sqlite.cc
@@ -202,7 +202,7 @@ bool Sqlite::recreate_table(const Glib::RefPtr<Gnome::Gda::Connection>& connecti
Glib::ustring trans_fields;
- for(GSList* item = table->columns; item != 0; item = item->next)
+ for(GSList* item = table->columns; item != nullptr; item = item->next)
{
GdaMetaTableColumn* column = GDA_META_TABLE_COLUMN(item->data);
diff --git a/glom/libglom/data_structure/glomconversions.cc b/glom/libglom/data_structure/glomconversions.cc
index fdb1cf7..a5215a5 100644
--- a/glom/libglom/data_structure/glomconversions.cc
+++ b/glom/libglom/data_structure/glomconversions.cc
@@ -103,7 +103,7 @@ static inline const char* glom_get_locale_date_format()
//each time.
//Even when the LC_TIME environment variable is not set, we still seem
//to get a useful value here, based on LC_ALL, for instance.
- char* lc_time = setlocale(LC_TIME, NULL);
+ char* lc_time = setlocale(LC_TIME, nullptr);
if(lc_time)
lc_time = g_strdup(lc_time);
@@ -121,7 +121,7 @@ static inline const char* glom_get_locale_date_format()
//(which uses 2 digits when using %x).
//Get the current LC_MESSAGES value:
- old_lc_messages = g_strdup(setlocale(LC_MESSAGES, NULL));
+ old_lc_messages = g_strdup(setlocale(LC_MESSAGES, nullptr));
if(old_lc_messages)
old_lc_messages = g_strdup(old_lc_messages);
diff --git a/glom/libglom/db_utils.cc b/glom/libglom/db_utils.cc
index b3ac45a..d4918a6 100644
--- a/glom/libglom/db_utils.cc
+++ b/glom/libglom/db_utils.cc
@@ -758,7 +758,7 @@ static bool meta_table_column_is_primary_key(GdaMetaTable* meta_table, const Gli
if(!meta_table)
return false;
- for(GSList* item = meta_table->columns; item != 0; item = item->next)
+ for(GSList* item = meta_table->columns; item != nullptr; item = item->next)
{
GdaMetaTableColumn* column = GDA_META_TABLE_COLUMN(item->data);
if(!column)
@@ -1313,7 +1313,7 @@ bool create_table_add_missing_fields(const std::shared_ptr<const TableInfo>& tab
{
if(!get_field_exists_in_database(table_name, field->get_name()))
{
- const auto test = add_column(table_name, field, 0); /* TODO: parent_window */
+ const auto test = add_column(table_name, field, nullptr); /* TODO: parent_window */
if(!test)
return test;
}
diff --git a/glom/libglom/python_embed/py_glom_record.cc b/glom/libglom/python_embed/py_glom_record.cc
index 19b3ae3..7eb7848 100644
--- a/glom/libglom/python_embed/py_glom_record.cc
+++ b/glom/libglom/python_embed/py_glom_record.cc
@@ -224,7 +224,7 @@ void PyGlomRecord::set_fields(const PyGlomRecord::type_map_field_values& field_v
m_key_field = key_field;
m_key_field_value = key_field_value;
- if(m_document == 0)
+ if(m_document == nullptr)
m_document = document;
m_connection = opened_connection;
diff --git a/glom/libglom/spawn_with_feedback.cc b/glom/libglom/spawn_with_feedback.cc
index 4771348..957686f 100644
--- a/glom/libglom/spawn_with_feedback.cc
+++ b/glom/libglom/spawn_with_feedback.cc
@@ -188,7 +188,7 @@ public:
std::vector<std::string> arguments = Glib::shell_parse_argv(command_line);
int child_stdout = 0;
int child_stderr = 0;
- Glib::spawn_async_with_pipes(Glib::get_current_dir(), arguments, Glib::SPAWN_DO_NOT_REAP_CHILD,
sigc::slot<void()>(), &pid, 0, (redirect & REDIRECT_STDOUT) ? &child_stdout : 0, (redirect & REDIRECT_STDERR)
? &child_stderr : 0);
+ Glib::spawn_async_with_pipes(Glib::get_current_dir(), arguments, Glib::SPAWN_DO_NOT_REAP_CHILD,
sigc::slot<void()>(), &pid, nullptr, (redirect & REDIRECT_STDOUT) ? &child_stdout : nullptr, (redirect &
REDIRECT_STDERR) ? &child_stderr : nullptr);
if(redirect & REDIRECT_STDOUT)
redirect_to_string(child_stdout, stdout_text);
if(redirect & REDIRECT_STDERR)
@@ -297,7 +297,7 @@ static std::shared_ptr<const SpawnInfo> spawn_async(const Glib::ustring& command
* @param return_status: The return value of the command.
* @result Whether we successfully ended the async spawn.
*/
-static bool spawn_async_end(std::shared_ptr<const SpawnInfo> info, std::string* stdout_text = 0,
std::string* stderr_text = 0, int* return_status = 0)
+static bool spawn_async_end(std::shared_ptr<const SpawnInfo> info, std::string* stdout_text = nullptr,
std::string* stderr_text = nullptr, int* return_status = nullptr)
{
if(stdout_text)
info->get_stdout(*stdout_text);
@@ -371,7 +371,7 @@ bool execute_command_line_and_wait(const std::string& command, const SlotProgres
timeout_connection.disconnect();
int return_status = false;
- const auto returned = Impl::spawn_async_end(info, 0, 0, &return_status);
+ const auto returned = Impl::spawn_async_end(info, nullptr, nullptr, &return_status);
if(!returned)
return false; // User closed the dialog prematurely?
@@ -472,7 +472,7 @@ namespace
std::string stdout_output;
try
{
- return_status = Impl::spawn_sync(second_command, &stdout_output, 0);
+ return_status = Impl::spawn_sync(second_command, &stdout_output, nullptr);
}
catch(const Impl::SpawnError& ex)
{
@@ -585,7 +585,7 @@ bool execute_command_line_and_wait_until_second_command_returns_success(const st
std::string stderr_text;
int return_status = 0;
- const auto success = Impl::spawn_async_end(info, 0, &stderr_text, &return_status);
+ const auto success = Impl::spawn_async_end(info, nullptr, &stderr_text, &return_status);
if(success && (return_status == EXIT_SUCCESS))
{
diff --git a/glom/libglom/sql_utils.cc b/glom/libglom/sql_utils.cc
index a6e3656..d20cc07 100644
--- a/glom/libglom/sql_utils.cc
+++ b/glom/libglom/sql_utils.cc
@@ -434,7 +434,7 @@ std::string sqlbuilder_get_full_query(
result.raw().data(), result.raw().size(),
"ISO-8859-1", "UTF-8",
(char*)"?",
- 0, 0, 0));
+ nullptr, nullptr, nullptr));
const Glib::ustring str = std::string(buf.get());
if(str.empty())
diff --git a/glom/libglom/translations_po.cc b/glom/libglom/translations_po.cc
index 29120c5..13fcd60 100644
--- a/glom/libglom/translations_po.cc
+++ b/glom/libglom/translations_po.cc
@@ -285,7 +285,7 @@ bool import_translations_from_po_file(const std::shared_ptr<Document>& document,
//Look at each domain (could there be more than one?):
const char* const* domains = po_file_domains(po_file);
- for (int i = 0; domains[i] != 0; ++i)
+ for (int i = 0; domains[i] != nullptr; ++i)
{
//Look at each message:
auto iter = po_message_iterator(po_file, domains[i]);
diff --git a/glom/libglom/xsl_utils.cc b/glom/libglom/xsl_utils.cc
index 0eb80c8..85651e0 100644
--- a/glom/libglom/xsl_utils.cc
+++ b/glom/libglom/xsl_utils.cc
@@ -73,7 +73,7 @@ static Glib::ustring xslt_process(const xmlpp::Document& xml_document, const std
Glib::ustring result;
//Use libxslt to transform the XML:
- xmlDocPtr style = xmlReadDoc((xmlChar*)xslt_data, 0, 0, 0);
+ xmlDocPtr style = xmlReadDoc((xmlChar*)xslt_data, nullptr, nullptr, 0);
if(style)
{
//We need this to be able to use the exsl: functions, even if we declare the namespace at the start of
the xsl.
@@ -85,14 +85,14 @@ static Glib::ustring xslt_process(const xmlpp::Document& xml_document, const std
if(cur)
{
//Use the parsed stylesheet on the XML:
- xmlDocPtr pDocOutput = xsltApplyStylesheet(cur, const_cast<xmlDoc*>(xml_document.cobj()), 0);
+ xmlDocPtr pDocOutput = xsltApplyStylesheet(cur, const_cast<xmlDoc*>(xml_document.cobj()), nullptr);
xsltFreeStylesheet(cur);
//Get the output text:
xmlChar* buffer = nullptr;
int length = 0;
xmlIndentTreeOutput = 1; //Format the output with extra white space. TODO: Is there a better way than
this global variable?
- xmlDocDumpFormatMemoryEnc(pDocOutput, &buffer, &length, 0, 0);
+ xmlDocDumpFormatMemoryEnc(pDocOutput, &buffer, &length, nullptr, 0);
if(buffer)
{
diff --git a/glom/mode_data/box_data.cc b/glom/mode_data/box_data.cc
index fed70ed..966e459 100644
--- a/glom/mode_data/box_data.cc
+++ b/glom/mode_data/box_data.cc
@@ -361,7 +361,7 @@ void Box_Data::execute_button_script(const std::shared_ptr<const LayoutItem_Butt
const auto field_values = get_record_field_values_for_calculation(m_table_name, field_primary_key,
primary_key_value);
//We need the connection when we run the script, so that the script may use it.
- auto sharedconnection = connect_to_server(0 /* parent window */);
+ auto sharedconnection = connect_to_server(nullptr /* parent window */);
//Allow this UI to respond to UI change requests from the Python code:
AppPythonUICallbacks callbacks;
diff --git a/glom/mode_data/box_data_calendar_related.cc b/glom/mode_data/box_data_calendar_related.cc
index 69fcafa..54d80f0 100644
--- a/glom/mode_data/box_data_calendar_related.cc
+++ b/glom/mode_data/box_data_calendar_related.cc
@@ -517,7 +517,7 @@ void Box_Data_Calendar_Related::on_calendar_button_press_event(GdkEventButton *b
#endif
GdkModifierType mods;
- gdk_window_get_device_position( gtk_widget_get_window(Gtk::Widget::gobj()), button_event->device, 0, 0,
&mods );
+ gdk_window_get_device_position( gtk_widget_get_window(Gtk::Widget::gobj()), button_event->device, nullptr,
nullptr, &mods );
if(mods & GDK_BUTTON3_MASK)
{
//Give user choices of actions on this item:
diff --git a/glom/mode_data/buttonglom.cc b/glom/mode_data/buttonglom.cc
index eb50e12..69901c0 100644
--- a/glom/mode_data/buttonglom.cc
+++ b/glom/mode_data/buttonglom.cc
@@ -83,7 +83,7 @@ bool ButtonGlom::on_button_press_event(GdkEventButton *button_event)
if(pApp && pApp->get_userlevel() == AppState::userlevels::DEVELOPER)
{
GdkModifierType mods;
- gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device, 0, 0,
&mods );
+ gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device,
nullptr, nullptr, &mods );
if(mods & GDK_BUTTON3_MASK)
{
//Give user choices of actions on this item:
diff --git a/glom/mode_data/datawidget/checkbutton.cc b/glom/mode_data/datawidget/checkbutton.cc
index cd50697..814ea8e 100644
--- a/glom/mode_data/datawidget/checkbutton.cc
+++ b/glom/mode_data/datawidget/checkbutton.cc
@@ -57,7 +57,7 @@ bool CheckButton::on_button_press_event(GdkEventButton *button_event)
if(pApp->get_userlevel() == AppState::userlevels::DEVELOPER)
{
GdkModifierType mods;
- gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device, 0,
0, &mods );
+ gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device,
nullptr, nullptr, &mods );
if(mods & GDK_BUTTON3_MASK)
{
//Give user choices of actions on this item:
diff --git a/glom/mode_data/datawidget/combo.cc b/glom/mode_data/datawidget/combo.cc
index 63cc98a..c56839a 100644
--- a/glom/mode_data/datawidget/combo.cc
+++ b/glom/mode_data/datawidget/combo.cc
@@ -320,7 +320,7 @@ g_warning("ComboGlom::on_button_press_event()");
if(pApp->get_userlevel() == AppState::userlevels::DEVELOPER)
{
GdkModifierType mods;
- gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device, 0,
0, &mods );
+ gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device,
nullptr, nullptr, &mods );
if(mods & GDK_BUTTON3_MASK)
{
//Give user choices of actions on this item:
diff --git a/glom/mode_data/datawidget/combo_as_radio_buttons.cc
b/glom/mode_data/datawidget/combo_as_radio_buttons.cc
index d2c7911..3cfedb9 100644
--- a/glom/mode_data/datawidget/combo_as_radio_buttons.cc
+++ b/glom/mode_data/datawidget/combo_as_radio_buttons.cc
@@ -268,7 +268,7 @@ void ComboAsRadioButtons::show_context_menu(GdkEventButton *button_event)
if(pApp->get_userlevel() == AppState::userlevels::DEVELOPER)
{
GdkModifierType mods;
- gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device, 0,
0, &mods );
+ gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device,
nullptr, nullptr, &mods );
if(mods & GDK_BUTTON3_MASK)
{
//Give user choices of actions on this item:
diff --git a/glom/mode_data/datawidget/datawidget.cc b/glom/mode_data/datawidget/datawidget.cc
index b7a5094..9f1db87 100644
--- a/glom/mode_data/datawidget/datawidget.cc
+++ b/glom/mode_data/datawidget/datawidget.cc
@@ -73,7 +73,7 @@ DataWidget::DataWidget(const std::shared_ptr<LayoutItem_Field>& field, const Gli
//http://library.gnome.org/devel/hig-book/stable/design-text-labels.html.en
const auto title = Glib::ustring::compose(_("%1:"), item_get_title_or_name(field));
- m_child = 0;
+ m_child = nullptr;
LayoutWidgetField* pFieldWidget = nullptr;
if(glom_type == Field::glom_field_type::BOOLEAN)
{
@@ -439,7 +439,7 @@ bool DataWidget::on_button_press_event(GdkEventButton *button_event)
if(pApp->get_userlevel() == AppState::userlevels::DEVELOPER)
{
GdkModifierType mods;
- gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device, 0,
0, &mods );
+ gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device,
nullptr, nullptr, &mods );
if(mods & GDK_BUTTON3_MASK)
{
//Give user choices of actions on this item:
diff --git a/glom/mode_data/datawidget/entry.cc b/glom/mode_data/datawidget/entry.cc
index 1e90d44..60b1260 100644
--- a/glom/mode_data/datawidget/entry.cc
+++ b/glom/mode_data/datawidget/entry.cc
@@ -197,7 +197,7 @@ bool Entry::on_button_press_event(GdkEventButton *button_event)
if(pApp->get_userlevel() == AppState::userlevels::DEVELOPER)
{
GdkModifierType mods;
- gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device, 0,
0, &mods );
+ gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device,
nullptr, nullptr, &mods );
if(mods & GDK_BUTTON3_MASK)
{
//Give user choices of actions on this item:
diff --git a/glom/mode_data/datawidget/label.cc b/glom/mode_data/datawidget/label.cc
index b0c9ac0..8f695aa 100644
--- a/glom/mode_data/datawidget/label.cc
+++ b/glom/mode_data/datawidget/label.cc
@@ -101,7 +101,7 @@ bool Label::on_button_press_event(GdkEventButton *button_event)
if(pApp && pApp->get_userlevel() == AppState::userlevels::DEVELOPER)
{
GdkModifierType mods;
- gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device, 0, 0,
&mods );
+ gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device,
nullptr, nullptr, &mods );
if(mods & GDK_BUTTON3_MASK)
{
//Give user choices of actions on this item:
diff --git a/glom/mode_data/datawidget/textview.cc b/glom/mode_data/datawidget/textview.cc
index 139cb15..d043841 100644
--- a/glom/mode_data/datawidget/textview.cc
+++ b/glom/mode_data/datawidget/textview.cc
@@ -156,7 +156,7 @@ bool TextView::on_button_press_event(GdkEventButton *button_event)
if(pApp->get_userlevel() == AppState::userlevels::DEVELOPER)
{
GdkModifierType mods;
- gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device, 0,
0, &mods );
+ gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device,
nullptr, nullptr, &mods );
if(mods & GDK_BUTTON3_MASK)
{
//Give user choices of actions on this item:
diff --git a/glom/mode_data/db_adddel/db_adddel.cc b/glom/mode_data/db_adddel/db_adddel.cc
index 00af2f0..d7b7a93 100644
--- a/glom/mode_data/db_adddel/db_adddel.cc
+++ b/glom/mode_data/db_adddel/db_adddel.cc
@@ -294,7 +294,7 @@ bool DbAddDel::on_button_press_event_Popup(GdkEventButton *button_event)
#endif
GdkModifierType mods;
- gdk_window_get_device_position( gtk_widget_get_window(Gtk::Widget::gobj()), button_event->device, 0, 0,
&mods );
+ gdk_window_get_device_position( gtk_widget_get_window(Gtk::Widget::gobj()), button_event->device, nullptr,
nullptr, &mods );
if(mods & GDK_BUTTON3_MASK)
{
//Give user choices of actions on this item:
@@ -552,7 +552,7 @@ guint DbAddDel::get_fixed_cell_height()
//We get this style property, which might be causing it. murrayc
//TODO: Find out if this is reallyt the right way to calculate the correct height:
int extra_height = 0;
- gtk_widget_style_get(GTK_WIDGET(m_tree_view.gobj()), "vertical-separator", &extra_height, (void*)0);
+ gtk_widget_style_get(GTK_WIDGET(m_tree_view.gobj()), "vertical-separator", &extra_height, (void*)nullptr);
//std::cout << "debug: extra_height=" << extra_height << std::endl;
return m_fixed_cell_height + extra_height;
@@ -1196,7 +1196,7 @@ DbAddDel::InnerIgnore::~InnerIgnore()
m_pOuter->set_ignore_treeview_signals(m_bIgnoreTreeViewSignals);
}
- m_pOuter = 0;
+ m_pOuter = nullptr;
}
Gnome::Gda::Value DbAddDel::treeview_get_key(const Gtk::TreeModel::iterator& row) const
diff --git a/glom/mode_data/flowtablewithfields.cc b/glom/mode_data/flowtablewithfields.cc
index 2969e9f..36f134d 100644
--- a/glom/mode_data/flowtablewithfields.cc
+++ b/glom/mode_data/flowtablewithfields.cc
@@ -1320,7 +1320,7 @@ bool FlowTableWithFields::on_button_press_event(GdkEventButton *button_event)
if(pApp && pApp->get_userlevel() == AppState::userlevels::DEVELOPER)
{
GdkModifierType mods;
- gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device, 0, 0,
&mods );
+ gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device,
nullptr, nullptr, &mods );
if(mods & GDK_BUTTON3_MASK)
{
//Give user choices of actions on this item:
diff --git a/glom/print_layout/canvas_layout_item.cc b/glom/print_layout/canvas_layout_item.cc
index 00fe0f3..4adfecd 100644
--- a/glom/print_layout/canvas_layout_item.cc
+++ b/glom/print_layout/canvas_layout_item.cc
@@ -394,7 +394,7 @@ void CanvasLayoutItem::add_portal_rows_if_necessary(const Glib::RefPtr<CanvasTab
auto rect =
Goocanvas::Rect::create(0, 0, width, row_height);
//TODO: Find out why this doesn't work: rect->property_stroke_pattern() =
Cairo::RefPtr<Cairo::Pattern>();
- g_object_set(rect->gobj(), "stroke-pattern", (void*)0, (void*)0);
+ g_object_set(rect->gobj(), "stroke-pattern", (void*)nullptr, (void*)nullptr);
canvas_table->attach(rect,
col /* left_attach */, col + 1 /* right_attach */,
diff --git a/glom/print_layout/canvas_print_layout.cc b/glom/print_layout/canvas_print_layout.cc
index 5456d8e..e357ccf 100644
--- a/glom/print_layout/canvas_print_layout.cc
+++ b/glom/print_layout/canvas_print_layout.cc
@@ -731,7 +731,7 @@ void Canvas_PrintLayout::fill_with_data_system_preferences(const Glib::RefPtr<Ca
field_in_record.m_field = layoutitem_field;
field_in_record.m_table_name = m_table_name;
const Gnome::Gda::Value value = get_field_value_in_database(
- field_in_record, 0 /* TODO: parent window */);
+ field_in_record, nullptr /* TODO: parent window */);
if(!Glom::Conversions::value_is_empty(value))
{
canvas_item->set_db_data(value);
@@ -783,7 +783,7 @@ void Canvas_PrintLayout::fill_with_data(const Glib::RefPtr<Goocanvas::Group>& ca
const auto document = get_document();
const auto from_field = DbUtils::get_fields_for_table_one_field(document,
relationship->get_from_table(), relationship->get_from_field());
- const Gnome::Gda::Value from_key_value = get_field_value_in_database(from_field, found_set, 0 /*
TODO: window */);
+ const Gnome::Gda::Value from_key_value = get_field_value_in_database(from_field, found_set,
nullptr /* TODO: window */);
fill_with_data_portal(canvas_item, from_key_value);
}
}
diff --git a/glom/utility_widgets/adddel/adddel.cc b/glom/utility_widgets/adddel/adddel.cc
index 06defd0..ebde76d 100644
--- a/glom/utility_widgets/adddel/adddel.cc
+++ b/glom/utility_widgets/adddel/adddel.cc
@@ -246,7 +246,7 @@ void AddDel::setup_menu(Gtk::Widget* /* widget */)
bool AddDel::on_button_press_event_Popup(GdkEventButton *button_event)
{
GdkModifierType mods;
- gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device, 0, 0,
&mods );
+ gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device,
nullptr, nullptr, &mods );
if(mods & GDK_BUTTON3_MASK)
{
//Give user choices of actions on this item:
@@ -713,7 +713,7 @@ void AddDel::construct_specified_columns()
}
}
- pModelColumn = 0;
+ pModelColumn = nullptr;
}
else
{
@@ -1035,7 +1035,7 @@ AddDel::InnerIgnore::~InnerIgnore()
m_outer->set_ignore_treeview_signals(m_bIgnoreSheetSignals);
}
- m_outer = 0;
+ m_outer = nullptr;
}
Glib::ustring AddDel::treeview_get_key(const Gtk::TreeModel::iterator& row)
diff --git a/glom/utility_widgets/dialog_image_save_progress.cc
b/glom/utility_widgets/dialog_image_save_progress.cc
index 87ffd53..b4a5a70 100644
--- a/glom/utility_widgets/dialog_image_save_progress.cc
+++ b/glom/utility_widgets/dialog_image_save_progress.cc
@@ -55,7 +55,7 @@ void DialogImageSaveProgress::save(const Glib::ustring& uri)
{
g_assert(m_data);
- if(m_data->data == 0)
+ if(m_data->data == nullptr)
return;
if(m_data->binary_length == 0)
diff --git a/glom/utility_widgets/flowtable.cc b/glom/utility_widgets/flowtable.cc
index 3583cf1..acf3b72 100644
--- a/glom/utility_widgets/flowtable.cc
+++ b/glom/utility_widgets/flowtable.cc
@@ -126,7 +126,7 @@ void FlowTable::add_widgets(Gtk::Widget& first, Gtk::Widget& second, bool expand
void FlowTable::add_widgets(Gtk::Widget& first, bool expand)
{
- insert(&first, 0 /* second */, -1, expand);
+ insert(&first, nullptr /* second */, -1, expand);
}
void FlowTable::insert(Gtk::Widget* first, Gtk::Widget* second, int index, bool expand)
diff --git a/glom/utility_widgets/imageglom.cc b/glom/utility_widgets/imageglom.cc
index aeec3c8..9465451 100644
--- a/glom/utility_widgets/imageglom.cc
+++ b/glom/utility_widgets/imageglom.cc
@@ -159,7 +159,7 @@ void ImageGlom::set_layout_item(const std::shared_ptr<LayoutItem>& layout_item,
bool ImageGlom::on_button_press_event(GdkEventButton *button_event)
{
GdkModifierType mods;
- gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device, 0, 0,
&mods );
+ gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device,
nullptr, nullptr, &mods );
//Enable/Disable items.
//We did this earlier, but get_appwindow is more likely to work now:
@@ -675,7 +675,7 @@ static void set_file_filter_images(Gtk::FileChooser& file_chooser)
filter->add_pixbuf_formats();
file_chooser.add_filter(filter);
- ev_document_factory_add_filters(GTK_WIDGET(file_chooser.gobj()), 0);
+ ev_document_factory_add_filters(GTK_WIDGET(file_chooser.gobj()), nullptr);
//Make Images the currently-selected one:
file_chooser.set_filter(filter);
diff --git a/glom/utility_widgets/notebooklabelglom.cc b/glom/utility_widgets/notebooklabelglom.cc
index 36c1c8c..b309359 100644
--- a/glom/utility_widgets/notebooklabelglom.cc
+++ b/glom/utility_widgets/notebooklabelglom.cc
@@ -127,7 +127,7 @@ bool NotebookLabel::on_button_press_event(GdkEventButton *button_event)
if(pApp && pApp->get_userlevel() == AppState::userlevels::DEVELOPER)
{
GdkModifierType mods;
- gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device, 0, 0,
&mods );
+ gdk_window_get_device_position( gtk_widget_get_window (Gtk::Widget::gobj()), button_event->device,
nullptr, nullptr, &mods );
if(mods & GDK_BUTTON3_MASK)
{
//Give user choices of actions on this item:
diff --git a/glom/utils_ui.cc b/glom/utils_ui.cc
index 0dd9425..de179d8 100644
--- a/glom/utils_ui.cc
+++ b/glom/utils_ui.cc
@@ -242,7 +242,7 @@ Glib::RefPtr<Gdk::Pixbuf> UiUtils::get_pixbuf_for_gda_value(const Gnome::Gda::Va
else
{
buffer_binary_length = 0;
- buffer_binary = 0;
+ buffer_binary = nullptr;
std::cerr << G_STRFUNC << ": Failed to read BLOB data\n";
}
}
diff --git a/tests/python/test_python_execute_func.cc b/tests/python/test_python_execute_func.cc
index 9e5819b..a8a0a06 100644
--- a/tests/python/test_python_execute_func.cc
+++ b/tests/python/test_python_execute_func.cc
@@ -19,7 +19,7 @@ int main()
{
value = Glom::glom_evaluate_python_function_implementation(
Glom::Field::glom_field_type::NUMERIC, calculation, field_values,
- 0 /* document */, "" /* table name */,
+ nullptr /* document */, "" /* table name */,
std::shared_ptr<Glom::Field>(), Gnome::Gda::Value(), // primary key details. Not used in this test.
connection,
error_message);
diff --git a/tests/python/test_python_execute_func_bad_syntax.cc
b/tests/python/test_python_execute_func_bad_syntax.cc
index 4df57d2..8fd7cf8 100644
--- a/tests/python/test_python_execute_func_bad_syntax.cc
+++ b/tests/python/test_python_execute_func_bad_syntax.cc
@@ -21,7 +21,7 @@ int main()
{
value = Glom::glom_evaluate_python_function_implementation(
Glom::Field::glom_field_type::NUMERIC, calculation, field_values,
- 0 /* document */, "" /* table name */,
+ nullptr /* document */, "" /* table name */,
std::shared_ptr<Glom::Field>(), Gnome::Gda::Value(), // primary key details. Not used in this test.
connection,
error_message);
diff --git a/tests/python/test_python_execute_func_change_result_type.cc
b/tests/python/test_python_execute_func_change_result_type.cc
index 6ad22ca..33979f2 100644
--- a/tests/python/test_python_execute_func_change_result_type.cc
+++ b/tests/python/test_python_execute_func_change_result_type.cc
@@ -21,7 +21,7 @@ int main()
//We ask for a text result though the python function actually returns a number.
value = Glom::glom_evaluate_python_function_implementation(
result_type, calculation, field_values,
- 0 /* document */, "" /* table name */,
+ nullptr /* document */, "" /* table name */,
std::shared_ptr<Glom::Field>(), Gnome::Gda::Value(), // primary key details. Not used in this test.
connection,
error_message);
diff --git a/tests/python/test_python_execute_func_date.cc b/tests/python/test_python_execute_func_date.cc
index 447feb5..d46ca84 100644
--- a/tests/python/test_python_execute_func_date.cc
+++ b/tests/python/test_python_execute_func_date.cc
@@ -19,7 +19,7 @@ void execute_func_with_date_return_value()
Glib::ustring error_message;
const auto value = Glom::glom_evaluate_python_function_implementation(
Glom::Field::glom_field_type::DATE, calculation, field_values,
- 0 /* document */, "" /* table name */,
+ nullptr /* document */, "" /* table name */,
std::shared_ptr<Glom::Field>(), Gnome::Gda::Value(), // primary key details. Not used in this test.
connection,
error_message);
@@ -57,7 +57,7 @@ void execute_func_with_date_input_value()
Glib::ustring error_message;
const auto value = Glom::glom_evaluate_python_function_implementation(
Glom::Field::glom_field_type::NUMERIC, calculation, field_values,
- 0 /* document */, "" /* table name */,
+ nullptr /* document */, "" /* table name */,
std::shared_ptr<Glom::Field>(), Gnome::Gda::Value(), // primary key details. Not used in this test.
connection,
error_message);
diff --git a/tests/python/test_python_execute_func_with_record.cc
b/tests/python/test_python_execute_func_with_record.cc
index 09d4532..589538d 100644
--- a/tests/python/test_python_execute_func_with_record.cc
+++ b/tests/python/test_python_execute_func_with_record.cc
@@ -101,7 +101,7 @@ int main()
{
value = Glom::glom_evaluate_python_function_implementation(
Glom::Field::glom_field_type::BOOLEAN, calculation, field_values,
- 0 /* document */, "" /* table name */,
+ nullptr /* document */, "" /* table name */,
std::shared_ptr<Glom::Field>(), Gnome::Gda::Value(), // primary key details. Not used in this test.
gda_connection,
error_message);
diff --git a/tests/python/test_python_execute_script.cc b/tests/python/test_python_execute_script.cc
index 015fea1..e9f66fe 100644
--- a/tests/python/test_python_execute_script.cc
+++ b/tests/python/test_python_execute_script.cc
@@ -86,7 +86,7 @@ int main()
{
Glom::glom_execute_python_function_implementation(
script, field_values,
- 0 /* document */, table_name_input,
+ nullptr /* document */, table_name_input,
std::shared_ptr<Glom::Field>(), Gnome::Gda::Value(), // primary key details. Not used in this test.
connection,
callbacks,
diff --git a/tests/python/test_python_module.cc b/tests/python/test_python_module.cc
index 7206bff..2c8ac33 100644
--- a/tests/python/test_python_module.cc
+++ b/tests/python/test_python_module.cc
@@ -24,7 +24,7 @@ bool glom_python_module_is_available()
Py_XDECREF(module_glom);
- return module_glom != 0;
+ return module_glom != nullptr;
}
bool gda_python_module_is_available()
@@ -44,7 +44,7 @@ bool gda_python_module_is_available()
Py_XDECREF(module_glom);
- return module_glom != 0;
+ return module_glom != nullptr;
}
}
diff --git a/tests/test_xml_utils.cc b/tests/test_xml_utils.cc
index df6a3f7..ddc86f9 100644
--- a/tests/test_xml_utils.cc
+++ b/tests/test_xml_utils.cc
@@ -27,7 +27,7 @@
static
xmlpp::Element* create_element()
{
- xmlNodePtr cnode = xmlNewNode(0, (const xmlChar*)"somenodename");
+ xmlNodePtr cnode = xmlNewNode(nullptr, (const xmlChar*)"somenodename");
return new xmlpp::Element(cnode);
}
diff --git a/tests/translations_po/test_document_export_po.cc
b/tests/translations_po/test_document_export_po.cc
index ea16ecb..bdfc5b7 100644
--- a/tests/translations_po/test_document_export_po.cc
+++ b/tests/translations_po/test_document_export_po.cc
@@ -47,7 +47,7 @@ static bool check_po_file(const std::string& filepath)
Glib::shell_quote(filepath));
try
{
- Glib::spawn_command_line_sync(command, &stdout_output, 0, &return_status);
+ Glib::spawn_command_line_sync(command, &stdout_output, nullptr, &return_status);
//std::cout << " debug: output=" << stdout_output << std::endl;
}
catch(const Glib::Error& ex)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]