diff --git a/src/xml/event.cpp b/src/xml/event.cpp
index d91dd681fb5ae912cb7f3909952d82b874cc5b7d..d713200e574f9161c7ec5eb5ac1773f2bfd91cf3 100644 (file)
--- a/src/xml/event.cpp
+++ b/src/xml/event.cpp
* Released under GNU GPL, read the file 'COPYING' for more information
*/
+#include <glib.h> // g_assert()
+
#include "event.h"
#include "event-fns.h"
#include "util/reverse-list.h"
int Inkscape::XML::Event::_next_serial=0;
-using Inkscape::XML::Session;
-
void
sp_repr_begin_transaction (Inkscape::XML::Document *doc)
{
EventTracker<SimpleEvent<Event::XML> > tracker("begin-transaction");
g_assert(doc != NULL);
- Session *session=doc->session();
- g_assert(session != NULL);
- session->beginTransaction();
+ doc->beginTransaction();
}
void
EventTracker<SimpleEvent<Event::XML> > tracker("rollback");
g_assert(doc != NULL);
- Session *session=doc->session();
- g_assert(session != NULL);
- session->rollback();
+ doc->rollback();
}
void
EventTracker<SimpleEvent<Event::XML> > tracker("commit");
g_assert(doc != NULL);
- Session *session=doc->session();
- g_assert(session != NULL);
- session->commit();
+ doc->commit();
}
Inkscape::XML::Event *
EventTracker<SimpleEvent<Event::XML> > tracker("commit");
g_assert(doc != NULL);
- Session *session=doc->session();
- g_assert(session != NULL);
- return session->commitUndoable();
+ return doc->commitUndoable();
}
namespace {
EventTracker<SimpleEvent<Event::XML> > tracker("undo-log");
- if (log) {
- g_assert(!log->repr->session()->inTransaction());
+ if (log && log->repr) {
+ g_assert(!log->repr->document()->inTransaction());
}
Inkscape::XML::undo_log_to_observer(log, LogPerformer::instance());
EventTracker<SimpleEvent<Event::XML> > tracker("replay-log");
if (log) {
- // Nodes created by the whiteboard deserializer tend to not
- // have an associated session. This conditional hacks a way around that,
- // but what's the best way to fix the whiteboard code so that new nodes
- // will have an associated session? -- yipdw
- if (log->repr->session()) {
- g_assert(!log->repr->session()->inTransaction());
+ if (log->repr->document()) {
+ g_assert(!log->repr->document()->inTransaction());
}
}