X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fextension%2Finternal%2Fgrid.cpp;h=a19ab75388c49e36a1d4ab0a44f63d4487481752;hb=9dc68827cbd515262ecb8d5ae8547d9e82c72e00;hp=ed41dd97b6002fb0a5d0fcd165891dc3ae046726;hpb=8c6aa1264d2d7b0f1d6e31a97937572068aeaaae;p=inkscape.git diff --git a/src/extension/internal/grid.cpp b/src/extension/internal/grid.cpp index ed41dd97b..a19ab7538 100644 --- a/src/extension/internal/grid.cpp +++ b/src/extension/internal/grid.cpp @@ -6,6 +6,7 @@ /* * Copyright (C) 2004-2005 Ted Gould * Copyright (C) 2007 MenTaLguY + * Abhishek Sharma * * Released under GNU GPL, read the file 'COPYING' for more information */ @@ -87,14 +88,14 @@ Grid::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View *doc /* get page size */ SPDocument * doc = document->doc(); bounding_area = Geom::Rect( Geom::Point(0,0), - Geom::Point(sp_document_width(doc), sp_document_height(doc)) ); + Geom::Point(doc->getWidth(), doc->getHeight()) ); } else { Geom::OptRect bounds = selection->bounds(); if (bounds) { bounding_area = *bounds; } - gdouble doc_height = sp_document_height(document->doc()); + gdouble doc_height = (document->doc())->getHeight(); Geom::Rect temprec = Geom::Rect(Geom::Point(bounding_area.min()[Geom::X], doc_height - bounding_area.min()[Geom::Y]), Geom::Point(bounding_area.max()[Geom::X], doc_height - bounding_area.max()[Geom::Y])); @@ -111,8 +112,10 @@ Grid::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View *doc path_data = build_lines(bounding_area, offsets, spacings); - Inkscape::XML::Document * xml_doc = sp_document_repr_doc(document->doc()); - Inkscape::XML::Node * current_layer = static_cast(document)->currentLayer()->repr; + Inkscape::XML::Document * xml_doc = document->doc()->getReprDoc(); + + //XML Tree being used directly here while it shouldn't be. + Inkscape::XML::Node * current_layer = static_cast(document)->currentLayer()->getRepr(); Inkscape::XML::Node * path = xml_doc->createElement("svg:path"); path->setAttribute("d", path_data.c_str());