From 300b0183542d39469cfeb28c06530cee0b2d5d37 Mon Sep 17 00:00:00 2001 From: John Smith Date: Thu, 12 Jul 2012 10:00:16 +0900 Subject: Fix for 377294 : Layer dialog rename when no label exists (bzr r11541) --- src/ui/dialog/layers.cpp | 11 +---------- src/ui/dialog/layers.h | 1 - 2 files changed, 1 insertion(+), 11 deletions(-) (limited to 'src') diff --git a/src/ui/dialog/layers.cpp b/src/ui/dialog/layers.cpp index e8fe6dc08..c01b533a3 100644 --- a/src/ui/dialog/layers.cpp +++ b/src/ui/dialog/layers.cpp @@ -657,20 +657,13 @@ void LayersPanel::_handleEditingCancelled() _text_renderer->property_editable() = false; } -void LayersPanel::_handleRowChange( Gtk::TreeModel::Path const& /*path*/, Gtk::TreeModel::iterator const& iter ) -{ - Gtk::TreeModel::Row row = *iter; - Glib::ustring label = row[_model->_colLabel]; - _renameLayer(row, label); -} - void LayersPanel::_renameLayer(Gtk::TreeModel::Row row, const Glib::ustring& name) { if ( row && _desktop && _desktop->layer_manager) { SPObject* obj = row[_model->_colObject]; if ( obj ) { gchar const* oldLabel = obj->label(); - if ( oldLabel && oldLabel[0] && !name.empty() && (name != oldLabel) ) { + if ( !name.empty() && (!oldLabel || name != oldLabel) ) { _desktop->layer_manager->renameLayer( obj, name.c_str(), FALSE ); DocumentUndo::done( _desktop->doc() , SP_VERB_NONE, _("Renamed layer")); @@ -771,8 +764,6 @@ LayersPanel::LayersPanel() : _tree.get_selection()->set_select_function( sigc::mem_fun(*this, &LayersPanel::_rowSelectFunction) ); _tree.signal_drag_drop().connect( sigc::mem_fun(*this, &LayersPanel::_handleDragDrop), false); - _tree.get_model()->signal_row_changed().connect( sigc::mem_fun(*this, &LayersPanel::_handleRowChange) ); - _text_renderer->signal_edited().connect( sigc::mem_fun(*this, &LayersPanel::_handleEdited) ); _text_renderer->signal_editing_canceled().connect( sigc::mem_fun(*this, &LayersPanel::_handleEditingCancelled) ); diff --git a/src/ui/dialog/layers.h b/src/ui/dialog/layers.h index 957d61853..12e5f7986 100644 --- a/src/ui/dialog/layers.h +++ b/src/ui/dialog/layers.h @@ -67,7 +67,6 @@ private: void _handleButtonEvent(GdkEventButton *event); bool _handleKeyEvent(GdkEventKey *event); - void _handleRowChange( Gtk::TreeModel::Path const& path, Gtk::TreeModel::iterator const& iter ); bool _handleDragDrop(const Glib::RefPtr& context, int x, int y, guint time); void _handleEdited(const Glib::ustring& path, const Glib::ustring& new_text); void _handleEditingCancelled(); -- cgit v1.2.3