Code

Pot and Dutch translation update
[inkscape.git] / src / ui / clipboard.cpp
index 9ce2ac5bac211ae2b5908a00d549a181c32171cc..90a9ba0f548e3a80f9a96b421a199a6017e4a790 100644 (file)
@@ -653,23 +653,23 @@ void ClipboardManagerImpl::_copySelection(Inkscape::Selection *selection)
 void ClipboardManagerImpl::_copyUsedDefs(SPItem *item)
 {
     // copy fill and stroke styles (patterns and gradients)
-    SPStyle *style = SP_OBJECT_STYLE(item);
+    SPStyle *style = item->style;
 
     if (style && (style->fill.isPaintserver())) {
-        SPObject *server = SP_OBJECT_STYLE_FILL_SERVER(item);
-        if (SP_IS_LINEARGRADIENT(server) || SP_IS_RADIALGRADIENT(server)) {
+        SPPaintServer *server = item->style->getFillPaintServer();
+        if ( SP_IS_LINEARGRADIENT(server) || SP_IS_RADIALGRADIENT(server) ) {
             _copyGradient(SP_GRADIENT(server));
         }
-        if (SP_IS_PATTERN(server)) {
+        if ( SP_IS_PATTERN(server) ) {
             _copyPattern(SP_PATTERN(server));
         }
     }
     if (style && (style->stroke.isPaintserver())) {
-        SPObject *server = SP_OBJECT_STYLE_STROKE_SERVER(item);
-        if (SP_IS_LINEARGRADIENT(server) || SP_IS_RADIALGRADIENT(server)) {
+        SPPaintServer *server = item->style->getStrokePaintServer();
+        if ( SP_IS_LINEARGRADIENT(server) || SP_IS_RADIALGRADIENT(server) ) {
             _copyGradient(SP_GRADIENT(server));
         }
-        if (SP_IS_PATTERN(server)) {
+        if ( SP_IS_PATTERN(server) ) {
             _copyPattern(SP_PATTERN(server));
         }
     }
@@ -875,6 +875,7 @@ void ClipboardManagerImpl::_pasteDocument(SPDesktop *desktop, SPDocument *clipdo
             // get offset from mouse pointer to bbox center, snap to grid if enabled
             Geom::Point mouse_offset = desktop->point() - sel_bbox->midpoint();
             offset = m.multipleOfGridPitch(mouse_offset - offset, sel_bbox->midpoint() + offset) + offset;
+            m.unSetup();
         }
 
         sp_selection_move_relative(selection, offset);
@@ -1533,4 +1534,4 @@ ClipboardManager *ClipboardManager::get()
   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 :