[glom] App_WithDoc_Gtk: Improve simple clipboard handlers.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] App_WithDoc_Gtk: Improve simple clipboard handlers.
- Date: Thu, 29 Dec 2011 21:14:23 +0000 (UTC)
commit 984ccb57069d75000f624691b8bf33b0acac6038
Author: Murray Cumming <murrayc murrayc com>
Date: Thu Dec 29 22:14:17 2011 +0100
App_WithDoc_Gtk: Improve simple clipboard handlers.
* glom/bakery/app_withdoc_gtk.cc: Do not use C code. And therefore do
not use Glib::wrap() strangely.
ChangeLog | 7 +++++++
glom/bakery/app_withdoc_gtk.cc | 12 ++++++------
2 files changed, 13 insertions(+), 6 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 16aa23d..282d8ab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2011-12-29 Murray Cumming <murrayc murrayc com>
+ App_WithDoc_Gtk: Improve simple clipboard handlers.
+
+ * glom/bakery/app_withdoc_gtk.cc: Do not use C code. And therefore do
+ not use Glib::wrap() strangely.
+
+2011-12-29 Murray Cumming <murrayc murrayc com>
+
Document::fill_layout_field_details(): Handle related choices sort fields.
* glom/libglom/document/document.[h|cc]: fill_layout_field_details():
diff --git a/glom/bakery/app_withdoc_gtk.cc b/glom/bakery/app_withdoc_gtk.cc
index 1e3f14d..d161836 100644
--- a/glom/bakery/app_withdoc_gtk.cc
+++ b/glom/bakery/app_withdoc_gtk.cc
@@ -573,8 +573,8 @@ void App_WithDoc_Gtk::document_history_remove(const Glib::ustring& file_uri)
void App_WithDoc_Gtk::on_menu_edit_copy_activate()
{
- GtkEditable* editable_gobj = (GtkEditable *)this->get_focus()->gobj();
- Glib::RefPtr<Gtk::Editable> editable = Glib::RefPtr<Gtk::Editable>::cast_dynamic(Glib::wrap(editable_gobj, true));
+ Gtk::Widget* widget = get_focus();
+ Gtk::Editable* editable = dynamic_cast<Gtk::Editable*>(widget);
if(editable)
editable->copy_clipboard();
@@ -582,8 +582,8 @@ void App_WithDoc_Gtk::on_menu_edit_copy_activate()
void App_WithDoc_Gtk::on_menu_edit_cut_activate()
{
- GtkEditable* editable_gobj = (GtkEditable *)this->get_focus()->gobj();
- Glib::RefPtr<Gtk::Editable> editable = Glib::RefPtr<Gtk::Editable>::cast_dynamic(Glib::wrap(editable_gobj, true));
+ Gtk::Widget* widget = get_focus();
+ Gtk::Editable* editable = dynamic_cast<Gtk::Editable*>(widget);
if(editable)
editable->cut_clipboard();
@@ -591,8 +591,8 @@ void App_WithDoc_Gtk::on_menu_edit_cut_activate()
void App_WithDoc_Gtk::on_menu_edit_paste_activate()
{
- GtkEditable* editable_gobj = (GtkEditable *)this->get_focus()->gobj();
- Glib::RefPtr<Gtk::Editable> editable = Glib::RefPtr<Gtk::Editable>::cast_dynamic(Glib::wrap(editable_gobj, true));
+ Gtk::Widget* widget = get_focus();
+ Gtk::Editable* editable = dynamic_cast<Gtk::Editable*>(widget);
if(editable)
editable->paste_clipboard();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]