[gtkmm] treeview demo: Use std::stoi() instead of atod() and c_str().
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] treeview demo: Use std::stoi() instead of atod() and c_str().
- Date: Tue, 1 Sep 2015 10:54:45 +0000 (UTC)
commit 9a3ebfbbbe56f68646a3f6168bc937fbc7f9ad25
Author: Murray Cumming <murrayc murrayc com>
Date: Tue Sep 1 12:43:48 2015 +0200
treeview demo: Use std::stoi() instead of atod() and c_str().
demos/gtk-demo/example_treeview_editable_cells.cc | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
---
diff --git a/demos/gtk-demo/example_treeview_editable_cells.cc
b/demos/gtk-demo/example_treeview_editable_cells.cc
index 08614a2..4bf72de 100644
--- a/demos/gtk-demo/example_treeview_editable_cells.cc
+++ b/demos/gtk-demo/example_treeview_editable_cells.cc
@@ -9,8 +9,6 @@
#include <cstdlib>
#include <gtkmm.h>
-using std::strtod;
-
class CellItem_Product
{
public:
@@ -204,8 +202,7 @@ void Example_TreeView_EditableCells::on_column_number_edited(const Glib::ustring
if(iter)
{
//Convert the text to a number, using the same logic used by GtkCellRendererText when it stores
numbers.
- char* pchEnd = nullptr;
- int new_value = (int) strtod(new_text.c_str(), &pchEnd);
+ auto new_value = std::stoi(new_text);
//Store the user's new text in the model:
Gtk::TreeRow row = *iter;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]