summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/layers.cpp
diff options
context:
space:
mode:
authorJohn Smith <john.smith7545@yahoo.com>2012-07-12 01:00:16 +0000
committerJohn Smith <john.smith7545@yahoo.com>2012-07-12 01:00:16 +0000
commit300b0183542d39469cfeb28c06530cee0b2d5d37 (patch)
tree0d7a0f100877806e95e5825260c5f58b208fc353 /src/ui/dialog/layers.cpp
parentFix for 167781 : opacity in selected style loses focus on kbd value scroll, f... (diff)
downloadinkscape-300b0183542d39469cfeb28c06530cee0b2d5d37.tar.gz
inkscape-300b0183542d39469cfeb28c06530cee0b2d5d37.zip
Fix for 377294 : Layer dialog rename when no label exists
(bzr r11541)
Diffstat (limited to 'src/ui/dialog/layers.cpp')
-rw-r--r--src/ui/dialog/layers.cpp11
1 files changed, 1 insertions, 10 deletions
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) );