summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2007-05-12 19:15:27 +0000
committerjoncruz <joncruz@users.sourceforge.net>2007-05-12 19:15:27 +0000
commit1a76e293b8f5a30aefccacf9532570743e27a482 (patch)
treece2d168080cfbd2a2bdd44471d1859afe062c4de /src
parentFixed print specifier (diff)
downloadinkscape-1a76e293b8f5a30aefccacf9532570743e27a482.tar.gz
inkscape-1a76e293b8f5a30aefccacf9532570743e27a482.zip
Cleaned up test doc creation
(bzr r3007)
Diffstat (limited to 'src')
-rw-r--r--src/document.cpp5
-rw-r--r--src/document.h1
-rw-r--r--src/sp-style-elem.cpp4
-rw-r--r--src/test-helpers.h2
4 files changed, 4 insertions, 8 deletions
diff --git a/src/document.cpp b/src/document.cpp
index 6ab08ffb6..f4ebfb7cb 100644
--- a/src/document.cpp
+++ b/src/document.cpp
@@ -405,11 +405,6 @@ sp_document_new_from_mem(gchar const *buffer, gint length, unsigned int keepaliv
return doc;
}
-SPDocument *sp_document_new_dummy() {
- SPDocument *document = new SPDocument();
- return document;
-}
-
SPDocument *
sp_document_ref(SPDocument *doc)
{
diff --git a/src/document.h b/src/document.h
index d9acc93fc..94b976314 100644
--- a/src/document.h
+++ b/src/document.h
@@ -141,7 +141,6 @@ public:
SPDocument *sp_document_new (const gchar *uri, unsigned int keepalive, bool make_new = false);
SPDocument *sp_document_new_from_mem (const gchar *buffer, gint length, unsigned int keepalive);
-SPDocument *sp_document_new_dummy();
SPDocument *sp_document_ref (SPDocument *doc);
SPDocument *sp_document_unref (SPDocument *doc);
diff --git a/src/sp-style-elem.cpp b/src/sp-style-elem.cpp
index 63a9bae38..fa756242c 100644
--- a/src/sp-style-elem.cpp
+++ b/src/sp-style-elem.cpp
@@ -367,7 +367,9 @@ sp_style_elem_read_content(SPObject *const object)
// that uses a style from it. It just forces the parent of <style> to reread its style as soon as the stylesheet
// is fully loaded. Naturally, this won't work if the user of the stylesheet is its grandparent or precedent.
SPObject *parent = SP_OBJECT_PARENT (object);
- sp_style_read_from_object(parent->style, parent);
+ if ( parent ) {
+ sp_style_read_from_object(parent->style, parent);
+ }
}
/**
diff --git a/src/test-helpers.h b/src/test-helpers.h
index 594f4b7ae..8dba0c942 100644
--- a/src/test-helpers.h
+++ b/src/test-helpers.h
@@ -32,7 +32,7 @@ T* createSuiteAndDocument( void (*fun)(T*&) )
static_cast<void>(g_object_new(inkscape_get_type(), NULL));
}
- SPDocument* tmp = sp_document_new_dummy();
+ SPDocument* tmp = sp_document_new( NULL, TRUE, true );
if ( tmp ) {
fun( suite );
if ( suite )