From 2b769cc45cc030a4a3947e22daa174cf28bf57de Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Tue, 27 Nov 2018 17:18:45 +0100 Subject: Add a rotation action. --- src/selection-chemistry.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'src/selection-chemistry.cpp') diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 082ff49a7..2f77e1093 100755 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -1875,9 +1875,10 @@ void ObjectSet::rotate90(bool ccw) } } - DocumentUndo::done(document(), - ccw ? SP_VERB_OBJECT_ROTATE_90_CCW : SP_VERB_OBJECT_ROTATE_90_CW, - ccw ? _("Rotate 90\xc2\xb0 CCW") : _("Rotate 90\xc2\xb0 CW")); + if (document()) + DocumentUndo::done(document(), + ccw ? SP_VERB_OBJECT_ROTATE_90_CCW : SP_VERB_OBJECT_ROTATE_90_CW, + ccw ? _("Rotate 90\xc2\xb0 CCW") : _("Rotate 90\xc2\xb0 CW")); } void ObjectSet::rotate(gdouble const angle_degrees) @@ -1891,12 +1892,13 @@ void ObjectSet::rotate(gdouble const angle_degrees) } rotateRelative(*center_, angle_degrees); - DocumentUndo::maybeDone(document(), - ( ( angle_degrees > 0 ) - ? "selector:rotate:ccw" - : "selector:rotate:cw" ), - SP_VERB_CONTEXT_SELECT, - _("Rotate")); + if (document()) + DocumentUndo::maybeDone(document(), + ( ( angle_degrees > 0 ) + ? "selector:rotate:ccw" + : "selector:rotate:cw" ), + SP_VERB_CONTEXT_SELECT, + _("Rotate")); } /* -- cgit v1.2.3