summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/filedialogimpl-win32.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/ui/dialog/filedialogimpl-win32.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/ui/dialog/filedialogimpl-win32.cpp')
-rw-r--r--src/ui/dialog/filedialogimpl-win32.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/ui/dialog/filedialogimpl-win32.cpp b/src/ui/dialog/filedialogimpl-win32.cpp
index e2bf47db9..65bb49f13 100644
--- a/src/ui/dialog/filedialogimpl-win32.cpp
+++ b/src/ui/dialog/filedialogimpl-win32.cpp
@@ -4,6 +4,7 @@
/* Authors:
* Joel Holdsworth
* The Inkscape Organization
+ * Abhishek Sharma
*
* Copyright (C) 2004-2008 The Inkscape Organization
*
@@ -906,20 +907,20 @@ bool FileOpenDialogImplWin32::set_svg_preview()
gchar *utf8string = g_utf16_to_utf8((const gunichar2*)_path_string,
_MAX_PATH, NULL, NULL, NULL);
- SPDocument *svgDoc = sp_document_new (utf8string, true);
+ SPDocument *svgDoc = SPDocument::createNewDoc (utf8string, true);
g_free(utf8string);
// Check the document loaded properly
if(svgDoc == NULL) return false;
if(svgDoc->root == NULL)
{
- sp_document_unref(svgDoc);
+ svgDoc->doUnref();
return false;
}
// Get the size of the document
- const double svgWidth = sp_document_width(svgDoc);
- const double svgHeight = sp_document_height(svgDoc);
+ const double svgWidth = svgDoc->getWidth();
+ const double svgHeight = svgDoc->getHeight();
// Find the minimum scale to fit the image inside the preview area
const double scaleFactorX = PreviewSize / svgWidth;
@@ -936,9 +937,9 @@ bool FileOpenDialogImplWin32::set_svg_preview()
// write object bbox to area
Geom::OptRect maybeArea(area);
- sp_document_ensure_up_to_date (svgDoc);
- sp_item_invoke_bbox((SPItem *) svgDoc->root, maybeArea,
- sp_item_i2d_affine((SPItem *)(svgDoc->root)), TRUE);
+ svgDoc->ensureUpToDate ();
+ static_cast<(SPItem *)>(svgDoc->root)->invoke_bbox( maybeArea,
+ static_cast<(SPItem *)>(svgDoc->root)->i2d_affine(), TRUE);
NRArena *const arena = NRArena::create();
@@ -968,7 +969,7 @@ bool FileOpenDialogImplWin32::set_svg_preview()
// Fail if the pixblock failed to allocate
if(pixBlock.data.px == NULL)
{
- sp_document_unref(svgDoc);
+ svgDoc->doUnref();
return false;
}
@@ -980,7 +981,7 @@ bool FileOpenDialogImplWin32::set_svg_preview()
nr_arena_item_invoke_render(NULL, root, &bbox, &pixBlock, /*0*/NR_ARENA_ITEM_RENDER_NO_CACHE);
// Tidy up
- sp_document_unref(svgDoc);
+ svgDoc->doUnref();
sp_item_invoke_hide((SPItem*)(svgDoc->root), key);
nr_object_unref((NRObject *) arena);