diff options
| author | Nicolas Dufour <nicoduf@yahoo.fr> | 2013-10-22 08:34:00 +0000 |
|---|---|---|
| committer | JazzyNico <nicoduf@yahoo.fr> | 2013-10-22 08:34:00 +0000 |
| commit | 85288191bbf9afd5d91b2bd0b0ea5d0e5c270ce0 (patch) | |
| tree | e9fd778da92053a51e7b41482cb82d19769368a8 /src/document.cpp | |
| parent | Fixing unit convertion in PNG import Imagemagick fallback (see Bug #165952). (diff) | |
| download | inkscape-85288191bbf9afd5d91b2bd0b0ea5d0e5c270ce0.tar.gz inkscape-85288191bbf9afd5d91b2bd0b0ea5d0e5c270ce0.zip | |
Fix for Bug #1022543 (Ctrl+C increments the documents count).
Fixed bugs:
- https://launchpad.net/bugs/1022543
(bzr r12712)
Diffstat (limited to '')
| -rw-r--r-- | src/document.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/document.cpp b/src/document.cpp index 4f57cf080..41defcc01 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -84,6 +84,7 @@ static gint sp_document_rerouting_handler(gpointer data); gboolean sp_document_resource_list_free(gpointer key, gpointer value, gpointer data); static gint doc_count = 0; +static gint doc_mem_count = 0; static unsigned long next_serial = 0; @@ -500,15 +501,18 @@ SPDocument *SPDocument::createNewDoc(gchar const *uri, unsigned int keepalive, b base = NULL; name = g_strdup(uri); } + if (make_new) { + base = NULL; + uri = NULL; + name = g_strdup_printf(_("New document %d"), ++doc_count); + } g_free(s); } else { - rdoc = sp_repr_document_new("svg:svg"); - } + if (make_new) { + name = g_strdup_printf(_("Memory document %d"), ++doc_mem_count); + } - if (make_new) { - base = NULL; - uri = NULL; - name = g_strdup_printf(_("New document %d"), ++doc_count); + rdoc = sp_repr_document_new("svg:svg"); } //# These should be set by now @@ -534,7 +538,7 @@ SPDocument *SPDocument::createNewDocFromMem(gchar const *buffer, gint length, un // If xml file is not svg, return NULL without warning // TODO fixme: destroy document } else { - Glib::ustring name = Glib::ustring::compose( _("Memory document %1"), ++doc_count ); + Glib::ustring name = Glib::ustring::compose( _("Memory document %1"), ++doc_mem_count ); doc = createDoc(rdoc, NULL, NULL, name.c_str(), keepalive); } } |
