X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fextension%2Finternal%2Femf-win32-inout.cpp;h=293e9b7d8ef9c68ae18682826697c8890b9f8879;hb=6162a8278ea4c335a186141dabe74b7b3155924f;hp=0e283b909fde8240d742a93b9669ba4fb0871c3a;hpb=d819256ce77c1d6ef3ee083d256c9be65a84ee0a;p=inkscape.git diff --git a/src/extension/internal/emf-win32-inout.cpp b/src/extension/internal/emf-win32-inout.cpp index 0e283b909..293e9b7d8 100644 --- a/src/extension/internal/emf-win32-inout.cpp +++ b/src/extension/internal/emf-win32-inout.cpp @@ -3,6 +3,8 @@ */ /* Authors: * Ulf Erikson + * Jon A. Cruz + * Abhishek Sharma * * Copyright (C) 2006-2008 Authors * @@ -109,7 +111,7 @@ emf_print_document_to_file(SPDocument *doc, gchar const *filename) gchar *oldoutput; unsigned int ret; - sp_document_ensure_up_to_date(doc); + doc->ensureUpToDate(); mod = Inkscape::Extension::get_print(PRINT_EMF_WIN32); oldconst = mod->get_param_string("destination"); @@ -120,20 +122,20 @@ emf_print_document_to_file(SPDocument *doc, gchar const *filename) context.module = mod; /* fixme: This has to go into module constructor somehow */ /* Create new arena */ - mod->base = SP_ITEM(sp_document_root(doc)); + mod->base = SP_ITEM(doc->getRoot()); mod->arena = NRArena::create(); mod->dkey = sp_item_display_key_new(1); - mod->root = sp_item_invoke_show(mod->base, mod->arena, mod->dkey, SP_ITEM_SHOW_DISPLAY); + mod->root = mod->base->invoke_show(mod->arena, mod->dkey, SP_ITEM_SHOW_DISPLAY); /* Print document */ ret = mod->begin(doc); if (ret) { g_free(oldoutput); throw Inkscape::Extension::Output::save_failed(); } - sp_item_invoke_print(mod->base, &context); + mod->base->invoke_print(&context); ret = mod->finish(); /* Release arena */ - sp_item_invoke_hide(mod->base, mod->dkey); + mod->base->invoke_hide(mod->dkey); mod->base = NULL; mod->root = NULL; nr_object_unref((NRObject *) mod->arena); @@ -2353,7 +2355,8 @@ EmfWin32::open( Inkscape::Extension::Input * /*mod*/, const gchar *uri ) d.pDesc[lstrlen(d.pDesc)] = '#'; } - EnumEnhMetaFile(NULL, hemf, myEnhMetaFileProc, (LPVOID) &d, NULL); + // This ugly reinterpret_cast is to prevent old versions of gcc from whining about a mismatch in the const-ness of the arguments + EnumEnhMetaFile(NULL, hemf, reinterpret_cast(myEnhMetaFileProc), (LPVOID) &d, NULL); DeleteEnhMetaFile(hemf); } else { @@ -2366,7 +2369,7 @@ EmfWin32::open( Inkscape::Extension::Input * /*mod*/, const gchar *uri ) // std::cout << "SVG Output: " << std::endl << *(d.outsvg) << std::endl; - SPDocument *doc = sp_document_new_from_mem(d.outsvg->c_str(), d.outsvg->length(), TRUE); + SPDocument *doc = SPDocument::createNewDocFromMem(d.outsvg->c_str(), d.outsvg->length(), TRUE); delete d.outsvg; delete d.path; @@ -2453,4 +2456,4 @@ EmfWin32::init (void) fill-column:99 End: */ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :