summaryrefslogtreecommitdiffstats
path: root/src/extension/internal/grid.cpp
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2010-12-12 08:40:34 +0000
committerJon A. Cruz <jon@joncruz.org>2010-12-12 08:40:34 +0000
commitaadfea4113abc6863d7ab03d21b973802c41c503 (patch)
tree3f890c0c112433fd850d59558208addf1baa85da /src/extension/internal/grid.cpp
parentPot and Dutch translation update (diff)
parentA simple layout document as to what, why and how is cppification. (diff)
downloadinkscape-aadfea4113abc6863d7ab03d21b973802c41c503.tar.gz
inkscape-aadfea4113abc6863d7ab03d21b973802c41c503.zip
Merge and cleanup of GSoC C++-ification project.
(bzr r9945.1.1)
Diffstat (limited to 'src/extension/internal/grid.cpp')
-rw-r--r--src/extension/internal/grid.cpp11
1 files changed, 7 insertions, 4 deletions
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 <ted@gould.cx>
* Copyright (C) 2007 MenTaLguY <mental@rydia.net>
+ * 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<SPDesktop *>(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<SPDesktop *>(document)->currentLayer()->getRepr();
Inkscape::XML::Node * path = xml_doc->createElement("svg:path");
path->setAttribute("d", path_data.c_str());