diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2013-10-31 16:25:36 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2013-10-31 16:25:36 +0000 |
| commit | 5aad46200120de4d40f75aac876ff65f3b9dceb8 (patch) | |
| tree | 2a520a16c23268c322b5d58463c73ed7c4c7649e /src/selection-describer.cpp | |
| parent | fix memleak. Export dialog still has many of its pointer members leaking !!! (diff) | |
| download | inkscape-5aad46200120de4d40f75aac876ff65f3b9dceb8.tar.gz inkscape-5aad46200120de4d40f75aac876ff65f3b9dceb8.zip | |
Partially fix crashes when entering a group with deleted id
(bzr r12754)
Diffstat (limited to 'src/selection-describer.cpp')
| -rw-r--r-- | src/selection-describer.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/selection-describer.cpp b/src/selection-describer.cpp index 4fd920bf8..88450dfdf 100644 --- a/src/selection-describer.cpp +++ b/src/selection-describer.cpp @@ -134,9 +134,12 @@ void SelectionDescriber::_updateMessageFromSelection(Inkscape::Selection *select // Parent name SPObject *parent = item->parent; gchar const *parent_label = parent->getId(); - char *quoted_parent_label = xml_quote_strdup(parent_label); - gchar *parent_name = g_strdup_printf(_("<i>%s</i>"), quoted_parent_label); - g_free(quoted_parent_label); + gchar *parent_name = NULL; + if (parent_label) { + char *quoted_parent_label = xml_quote_strdup(parent_label); + parent_name = g_strdup_printf(_("<i>%s</i>"), quoted_parent_label); + g_free(quoted_parent_label); + } gchar *in_phrase; guint num_layers = selection->numberOfLayers(); @@ -147,8 +150,10 @@ void SelectionDescriber::_updateMessageFromSelection(Inkscape::Selection *select in_phrase = g_strdup_printf(_(" in %s"), layer_name); else if (!layer) in_phrase = g_strdup_printf("%s", _(" hidden in definitions")); - else + else if (parent_name) in_phrase = g_strdup_printf(_(" in group %s (%s)"), parent_name, layer_name); + else + in_phrase = g_strdup_printf(_(" in unnamed group (%s)"), layer_name); } else { in_phrase = g_strdup_printf(ngettext(" in <b>%i</b> parent (%s)", " in <b>%i</b> parents (%s)", num_parents), num_parents, layer_name); } |
