diff --git a/src/document.cpp b/src/document.cpp
index 9fc6dc4dae13491a348cbecf999dbe60164a39e8..c6dc66a514cd5675f5eaaf1831c561a648600f3e 100644 (file)
--- a/src/document.cpp
+++ b/src/document.cpp
p->history_size = 0;
p->undo = NULL;
p->redo = NULL;
+ p->seeking = false;
priv = p;
Inkscape::XML::Node *rroot;
Inkscape::Version sodipodi_version;
- rroot = sp_repr_document_root(rdoc);
+ rroot = rdoc->root();
document = new SPDocument();
/* Quick hack 3 - Set uri attributes */
if (uri) {
- /* fixme: Think, what this means for images (Lauris) */
rroot->setAttribute("sodipodi:docname", uri);
- if (document->base)
- rroot->setAttribute("sodipodi:docbase", document->base);
}
/* End of quick hack 3 */
rdoc = sp_repr_read_file(uri, SP_SVG_NS_URI);
/* If file cannot be loaded, return NULL without warning */
if (rdoc == NULL) return NULL;
- rroot = sp_repr_document_root(rdoc);
+ rroot = rdoc->root();
/* If xml file is not svg, return NULL without warning */
/* fixme: destroy document */
if (strcmp(rroot->name(), "svg:svg") != 0) return NULL;
@@ -390,7 +388,7 @@ sp_document_new_from_mem(gchar const *buffer, gint length, unsigned int keepaliv
/* If it cannot be loaded, return NULL without warning */
if (rdoc == NULL) return NULL;
- rroot = sp_repr_document_root(rdoc);
+ rroot = rdoc->root();
/* If xml file is not svg, return NULL without warning */
/* fixme: destroy document */
if (strcmp(rroot->name(), "svg:svg") != 0) return NULL;
*/
void SPDocument::fitToRect(NRRect const & rect)
{
- g_return_if_fail(!empty(rect));
+ g_return_if_fail(!nr_rect_d_test_empty(&rect));
gdouble w = rect.x1 - rect.x0;
gdouble h = rect.y1 - rect.y0;
// changing uri in the document repr must not be not undoable
bool saved = sp_document_get_undo_sensitive(document);
sp_document_set_undo_sensitive(document, false);
- if (document->base)
- repr->setAttribute("sodipodi:docbase", document->base);
repr->setAttribute("sodipodi:docname", document->name);
sp_document_set_undo_sensitive(document, saved);
s = find_items_in_area(s, SP_GROUP(o), dkey, area, test);
} else {
SPItem *child = SP_ITEM(o);
- NR::Rect box = sp_item_bbox_desktop(child);
- if (test(area, box) && (take_insensitive || child->isVisibleAndUnlocked(dkey))) {
+ NR::Maybe<NR::Rect> box = sp_item_bbox_desktop(child);
+ if ( box && test(area, *box) && (take_insensitive || child->isVisibleAndUnlocked(dkey))) {
s = g_slist_append(s, child);
}
}
return start - newend;
}
+bool SPDocument::isSeeking() const {
+ return priv->seeking;
+}
+
/*
Local Variables: