summaryrefslogtreecommitdiffstats
path: root/src/document.cpp
diff options
context:
space:
mode:
authorNicolas Dufour <nicoduf@yahoo.fr>2013-05-21 11:17:25 +0000
committerJazzyNico <nicoduf@yahoo.fr>2013-05-21 11:17:25 +0000
commit608843c38bc77cffe831c1d397de9f166831e0ab (patch)
treeac48a804051eb617148dd858d49ac540fd129b89 /src/document.cpp
parentRefactored internals to use a vector of structs instead of several parallel a... (diff)
downloadinkscape-608843c38bc77cffe831c1d397de9f166831e0ab.tar.gz
inkscape-608843c38bc77cffe831c1d397de9f166831e0ab.zip
Fix for bug #1022543 (Ctrl+C increments the documents count) by Maggio.
Fixed bugs: - https://launchpad.net/bugs/1022543 (bzr r12340)
Diffstat (limited to 'src/document.cpp')
-rw-r--r--src/document.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/document.cpp b/src/document.cpp
index 706710cfc..2fc6d3bc6 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;
@@ -480,15 +481,16 @@ SPDocument *SPDocument::createNewDoc(gchar const *uri, unsigned int keepalive, b
base = NULL;
name = g_strdup(uri);
}
+ if (make_new) {
+ 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
@@ -514,7 +516,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);
}
}