diff --git a/src/xml/event.cpp b/src/xml/event.cpp
index dd71678743749b5c6572a9bfc17e7a4bbb16e0a0..40f3029e14f04014367b83d0a3596d0e0d3b4467 100644 (file)
--- a/src/xml/event.cpp
+++ b/src/xml/event.cpp
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 {
}
void notifyAttributeChanged(Node &node, GQuark name,
- Inkscape::Util::shared_ptr<char> old_value,
- Inkscape::Util::shared_ptr<char> new_value)
+ Inkscape::Util::ptr_shared<char> old_value,
+ Inkscape::Util::ptr_shared<char> new_value)
{
node.setAttribute(g_quark_to_string(name), new_value);
}
void notifyContentChanged(Node &node,
- Inkscape::Util::shared_ptr<char> old_value,
- Inkscape::Util::shared_ptr<char> new_value)
+ Inkscape::Util::ptr_shared<char> old_value,
+ Inkscape::Util::ptr_shared<char> new_value)
{
node.setContent(new_value);
}
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());
}
}
}
void notifyAttributeChanged(Node &node, GQuark name,
- Inkscape::Util::shared_ptr<char> old_value,
- Inkscape::Util::shared_ptr<char> new_value)
+ Inkscape::Util::ptr_shared<char> old_value,
+ Inkscape::Util::ptr_shared<char> new_value)
{
if (new_value) {
g_warning("Event: Set attribute %s to \"%s\" on %s", g_quark_to_string(name), new_value.pointer(), node_to_string(node).c_str());
}
void notifyContentChanged(Node &node,
- Inkscape::Util::shared_ptr<char> old_value,
- Inkscape::Util::shared_ptr<char> new_value)
+ Inkscape::Util::ptr_shared<char> old_value,
+ Inkscape::Util::ptr_shared<char> new_value)
{
if (new_value) {
g_warning("Event: Set content of %s to \"%s\"", node_to_string(node).c_str(), new_value.pointer());