file.cpp revision 51d5d061f1756df3d3865c0d36522a7d8c5c9d22
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches * @brief File/Print operations
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches * Lauris Kaplinski <lauris@kaplinski.com>
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches * Chema Celorio <chema@celorio.com>
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches * bulia byak <buliabyak@users.sf.net>
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches * Bruno Dilly <bruno.dilly@gmail.com>
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches * Stephen Silver <sasilver@users.sourceforge.net>
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches * Copyright (C) 2006 Johan Engelen <johan@shouraizou.nl>
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches * Copyright (C) 1999-2008 Authors
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches * Copyright (C) 2004 David Turner
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches * Copyright (C) 2001-2002 Ximian, Inc.
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches * Released under GNU GPL, read the file 'COPYING' for more information
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches * @note This file needs to be cleaned up extensively.
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches * What it probably needs is to have one .h file for
24db7b4ad7915f5f79ed265e2c2bddf0d8cf9611Felipe C. da S. Sanches * the API, and two or more .cpp files for the implementations.
#include "preferences.h"
#include "print.h"
#include "rdf.h"
#include "selection-chemistry.h"
#include "selection.h"
#include "sp-namedview.h"
#include "style.h"
#include "ui/dialog/filedialog.h"
#include "ui/dialog/ocaldialogs.h"
#include "ui/view/view-widget.h"
#include "uri.h"
#include "xml/rebase-hrefs.h"
#ifdef WITH_GNOME_VFS
#ifdef WITH_INKBOARD
#include "jabber_whiteboard/session-manager.h"
#ifdef WIN32
#include <windows.h>
if (fn) {
if (uri_to_add) {
return dt;
// TRANSLATORS: default.svg is localizable - this is the name of the default document
// localized share/templates/default.xx.svg file, where xx is your language code.
if (desktop)
if (desktop)
if (doc) {
if (add_to_recent) {
return TRUE;
return FALSE;
if (!uri) {
desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("Document not saved yet. Cannot revert."));
bool do_revert = true;
gchar *text = g_strdup_printf(_("Changes will be lost! Are you sure you want to reload document %s?"), uri);
if (!response) {
do_revert = false;
bool reverted;
if (do_revert) {
if (reverted) {
reverted = false;
if (reverted) {
for (unsigned i = 0; i < total; i++) {
if (i < dataLen) {
if (i < byteLen) {
if ( i < cstrLen ) {
#ifdef WIN32
if(utf8path)
if (!success)
delete openDialogInstance;
delete openDialogInstance;
#ifdef INK_DUMP_FILENAME_CONV
if (diff > 0) {
diff),
diff);
gchar *text = g_strdup_printf(_("No Inkscape extension found to save document (%s). This may have been caused by an unknown filename extension."), safeUri);
return FALSE;
return FALSE;
return FALSE;
#ifdef WITH_GNOME_VFS
#ifdef WITH_GNOME_VFS
result = gnome_vfs_create (&to_handle, uri_local, GNOME_VFS_OPEN_WRITE, FALSE, GNOME_VFS_PERM_USER_ALL);
if (!attr) {
if (extension)
char const * dialog_title;
if (is_copy) {
if (!success) {
delete saveDialog;
return success;
delete saveDialog;
saveDialog = 0;
return success;
bool success = true;
SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("No changes need to be saved."));
return success;
if (!SP_ACTIVE_DOCUMENT)
if (!SP_ACTIVE_DOCUMENT)
if (!SP_ACTIVE_DOCUMENT)
if (desktop) {
Geom::Matrix affine = SP_ROOT(SP_DOCUMENT_ROOT(doc))->c2p * sp_item_i2doc_affine(SP_ITEM(place_to_insert)).inverse();
if (sel_bbox) {
if (!doc)
if (!success) {
delete importDialogInstance;
delete importDialogInstance;
#ifdef NEW_EXPORT_DIALOG
if (!attr) {
if (extension)
if (!success) {
delete exportDialogInstance;
return success;
delete exportDialogInstance;
if (success) {
return success;
if (!SP_ACTIVE_DOCUMENT)
bool success = false;
static bool gotSuccess = false;
(void)repr;
if (!success) {
delete exportDialogInstance;
return success;
delete exportDialogInstance;
if (!success){
return success;
if(!gotSuccess)
if (!success) {
delete exportPasswordDialogInstance;
return success;
delete exportPasswordDialogInstance;
if (!success)
gchar *text = g_strdup_printf(_("Error exporting the document. Verify if the server name, username and password are correct, if the server has support for webdav and verify if you didn't forget to choose a license."));
gotSuccess = true;
return success;
if (!SP_ACTIVE_DOCUMENT)
if (success)
if (!doc)
if (!importDialogInstance) {
importDialogInstance = new
if (!success) {
delete importDialogInstance;
delete importDialogInstance;
if (doc)
if (doc)