From 3cc158ecff4f2420590ab102d7f3a84d7ca2a711 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Thu, 23 Dec 2010 00:10:28 -0800 Subject: Split SPCanvasItem and SPCanvasGroup to individual .h files. Removed forward header. (bzr r9978.1.1) --- src/interface.cpp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'src/interface.cpp') diff --git a/src/interface.cpp b/src/interface.cpp index 0fd2b65ea..551e2bf91 100644 --- a/src/interface.cpp +++ b/src/interface.cpp @@ -8,6 +8,7 @@ * Jon A. Cruz * Abhishek Sharma * + * Copyright (C) 2010 authors * Copyright (C) 1999-2005 authors * Copyright (C) 2001-2002 Ximian, Inc. * Copyright (C) 2004 David Turner @@ -272,7 +273,9 @@ sp_create_window(SPViewWidget *vw, gboolean editable) win->show(); // needed because the first ACTIVATE_DESKTOP was sent when there was no window yet - inkscape_reactivate_desktop(SP_DESKTOP_WIDGET(vw)->desktop); + if ( SP_IS_DESKTOP_WIDGET(vw) ) { + inkscape_reactivate_desktop(SP_DESKTOP_WIDGET(vw)->desktop); + } } void @@ -294,20 +297,16 @@ sp_ui_new_view() /* TODO: not yet working */ /* To be re-enabled (by adding to menu) once it works. */ -void -sp_ui_new_view_preview() +void sp_ui_new_view_preview() { - SPDocument *document; - SPViewWidget *dtw; - - document = SP_ACTIVE_DOCUMENT; - if (!document) return; + SPDocument *document = SP_ACTIVE_DOCUMENT; + if ( document ) { + SPViewWidget *dtw = reinterpret_cast(sp_svg_view_widget_new(document)); + g_return_if_fail(dtw != NULL); + SP_SVG_VIEW_WIDGET(dtw)->setResize(true, 400.0, 400.0); - dtw = (SPViewWidget *) sp_svg_view_widget_new(document); - g_return_if_fail(dtw != NULL); - sp_svg_view_widget_set_resize(SP_SVG_VIEW_WIDGET(dtw), TRUE, 400.0, 400.0); - - sp_create_window(dtw, FALSE); + sp_create_window(dtw, FALSE); + } } /** -- cgit v1.2.3