summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2008-06-12 09:49:31 +0000
committerjoncruz <joncruz@users.sourceforge.net>2008-06-12 09:49:31 +0000
commitd4a4862e200c5cc05641199769c9bbfef66e9a3b (patch)
treebd97d1a0a4bdf5585c7327edd21b19db3ee86e53 /src
parentpatch 185522 (diff)
downloadinkscape-d4a4862e200c5cc05641199769c9bbfef66e9a3b.tar.gz
inkscape-d4a4862e200c5cc05641199769c9bbfef66e9a3b.zip
Fixed uninitialized variables, including modified-since-save.
(bzr r5897)
Diffstat (limited to 'src')
-rw-r--r--src/document.cpp45
-rw-r--r--src/document.h6
2 files changed, 24 insertions, 27 deletions
diff --git a/src/document.cpp b/src/document.cpp
index 333ce8d5a..af65d2d30 100644
--- a/src/document.cpp
+++ b/src/document.cpp
@@ -77,33 +77,30 @@ static gint doc_count = 0;
static unsigned long next_serial = 0;
-SPDocument::SPDocument() {
- SPDocumentPrivate *p;
-
- keepalive = FALSE;
- virgin = TRUE;
-
- modified_id = 0;
-
- rdoc = NULL;
- rroot = NULL;
- root = NULL;
- style_cascade = cr_cascade_new(NULL, NULL, NULL);
-
- uri = NULL;
- base = NULL;
- name = NULL;
-
- _collection_queue = NULL;
-
- // Initialise instance of connector router.
- router = new Avoid::Router();
+SPDocument::SPDocument() :
+ keepalive(FALSE),
+ virgin(TRUE),
+ modified_since_save(FALSE),
+ rdoc(0),
+ rroot(0),
+ root(0),
+ style_cascade(cr_cascade_new(NULL, NULL, NULL)),
+ uri(0),
+ base(0),
+ name(0),
+ priv(0), // reset in ctor
+ actionkey(0),
+ modified_id(0),
+ profileManager(0), // deferred until after other initialization
+ router(new Avoid::Router()),
+ perspectives(0),
+ current_persp3d(0),
+ _collection_queue(0)
+{
// Don't use the Consolidate moves optimisation.
router->ConsolidateMoves = false;
- perspectives = NULL;
-
- p = new SPDocumentPrivate();
+ SPDocumentPrivate *p = new SPDocumentPrivate();
p->serial = next_serial++;
diff --git a/src/document.h b/src/document.h
index b0d6afecb..a5cc3b855 100644
--- a/src/document.h
+++ b/src/document.h
@@ -108,6 +108,8 @@ struct SPDocument : public Inkscape::GC::Managed<>,
Persp3D *current_persp3d; // "currently active" perspective (e.g., newly created boxes are attached to this one)
+ GSList *_collection_queue;
+
void add_persp3d (Persp3D * const persp);
void remove_persp3d (Persp3D * const persp);
@@ -130,8 +132,6 @@ sigc::connection connectCommit(CommitSignal::slot_type slot);
void _emitModified();
- GSList *_collection_queue;
-
void addUndoObserver(Inkscape::UndoStackObserver& observer);
void removeUndoObserver(Inkscape::UndoStackObserver& observer);
@@ -141,7 +141,7 @@ sigc::connection connectCommit(CommitSignal::slot_type slot);
bool isSeeking() const;
bool isModifiedSinceSave() const { return modified_since_save; }
- void setModifiedSinceSave(bool modified=true) {
+ void setModifiedSinceSave(bool modified = true) {
modified_since_save = modified;
}