summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2011-07-25 19:33:56 +0000
committerJon A. Cruz <jon@joncruz.org>2011-07-25 19:33:56 +0000
commitc38ea35d79b2990cfb8f56c029962a0f4e952547 (patch)
tree63336a524f5490172bdcd4aaca395849d8c39c4d /src
parentFilters. New Channel painting custom predefined filter. (diff)
downloadinkscape-c38ea35d79b2990cfb8f56c029962a0f4e952547.tar.gz
inkscape-c38ea35d79b2990cfb8f56c029962a0f4e952547.zip
Temporary fix for crash when launching via command-line.
(bzr r10505)
Diffstat (limited to 'src')
-rw-r--r--src/sp-item.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/sp-item.cpp b/src/sp-item.cpp
index 946c94353..9e3bc02ae 100644
--- a/src/sp-item.cpp
+++ b/src/sp-item.cpp
@@ -1467,11 +1467,18 @@ Geom::Affine SPItem::i2doc_affine() const
*/
Geom::Affine SPItem::i2dt_affine() const
{
-// Geom::Affine const ret( i2doc_affine()
-// * Geom::Scale(1, -1)
-// * Geom::Translate(0, document->getHeight()) );
+ Geom::Affine ret;
SPDesktop const *desktop = inkscape_active_desktop();
- Geom::Affine const ret( i2doc_affine() * desktop->doc2dt() );
+ if ( desktop ) {
+ ret = i2doc_affine() * desktop->doc2dt();
+ } else {
+ // TODO temp code to prevent crashing on command-line launch:
+ ret = i2doc_affine()
+ * Geom::Scale(1, -1)
+ * Geom::Translate(0, document->getHeight());
+
+ g_return_val_if_fail(desktop != NULL, ret);
+ }
return ret;
}