diff --git a/src/org/openstreetmap/josm/actions/UnGlueAction.java b/src/org/openstreetmap/josm/actions/UnGlueAction.java
index 8c6b3f2..7a118ca 100644
--- a/src/org/openstreetmap/josm/actions/UnGlueAction.java
+++ b/src/org/openstreetmap/josm/actions/UnGlueAction.java
@@ -60,12 +60,16 @@ public class UnGlueAction extends JosmAction {
      *
      * This method does some checking on the selection and calls the matching unGlueWay method.
      */
+    @Override
     public void actionPerformed(ActionEvent e) {
 
         Collection<OsmPrimitive> selection = getCurrentDataSet().getSelected();
 
         String errMsg = null;
         if (checkSelection(selection)) {
+            if (!checkAndConfirmOutlying()) {
+                return;
+            }
             int count = 0;
             for (Way w : OsmPrimitive.getFilteredList(selectedNode.getReferrers(), Way.class)) {
                 if (!w.isUsable() || w.getNodesCount() < 1) {
@@ -86,6 +90,9 @@ public class UnGlueAction extends JosmAction {
                 unglueWays();
             }
         } else if (checkSelection2(selection)) {
+            if (!checkAndConfirmOutlying()) {
+                return;
+            }
             ArrayList<Node> tmpNodes = new ArrayList<Node>();
             for (Node n : selectedNodes) {
                 int count = 0;
@@ -407,4 +414,15 @@ public class UnGlueAction extends JosmAction {
     protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) {
         setEnabled(selection != null && !selection.isEmpty());
     }
+
+    protected boolean checkAndConfirmOutlying() {
+        List<OsmPrimitive> p = new ArrayList<OsmPrimitive>(2 + (selectedNodes == null ? 0 : selectedNodes.size()));
+        if (selectedNodes != null)
+            p.addAll(selectedNodes);
+        if (selectedNode != null)
+            p.add(selectedNode);
+        if (selectedWay != null)
+            p.add(selectedWay);
+        return Command.checkAndConfirmOutlyingOperation("unglue", getEditLayer(), p);
+    }
 }
diff --git a/src/org/openstreetmap/josm/command/Command.java b/src/org/openstreetmap/josm/command/Command.java
index f1ee512..94a5ea7 100644
--- a/src/org/openstreetmap/josm/command/Command.java
+++ b/src/org/openstreetmap/josm/command/Command.java
@@ -1,6 +1,10 @@
 //License: GPL. Copyright 2007 by Immanuel Scholz and others
 package org.openstreetmap.josm.command;
 
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.GridBagLayout;
+import java.awt.geom.Area;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
@@ -8,6 +12,9 @@ import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.Map.Entry;
 
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
 import javax.swing.tree.DefaultMutableTreeNode;
 import javax.swing.tree.MutableTreeNode;
 
@@ -18,6 +25,7 @@ import org.openstreetmap.josm.data.osm.PrimitiveData;
 import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.data.osm.visitor.AbstractVisitor;
+import org.openstreetmap.josm.gui.ConditionalOptionPaneUtil;
 import org.openstreetmap.josm.gui.layer.Layer;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
@@ -170,4 +178,78 @@ abstract public class Command extends PseudoCommand {
         return null;
     }
 
+    /**
+     * Check whether user is about to operate on data outside of the download area. Request confirmation
+     * if he is.
+     *
+     * @param layer the layer in whose context data is deleted
+     * @param primitives the primitives to operate on
+     * @return true, if deleting outlying primitives is OK; false, otherwise
+     */
+    public static boolean checkAndConfirmOutlyingOperation(String operation, OsmDataLayer layer, Collection<OsmPrimitive> primitives) {
+        Area a = layer.data.getDataSourceArea();
+        boolean outside = false;
+        boolean incomplete = false;
+        if (a != null) {
+            for (OsmPrimitive osm : primitives) {
+                if (osm.isIncomplete()) {
+                    incomplete = true;
+                } else if (osm instanceof Node && !osm.isNewOrUndeleted()
+                        && !a.contains(((Node) osm).getCoor())) {
+                    outside = true;
+                }
+            }
+        } else {
+            for (OsmPrimitive osm : primitives) {
+                if (osm.isIncomplete()) {
+                    incomplete = true;
+                }
+            }
+        }
+        String title = tr("{0} confirmation", tr(Character.toUpperCase(operation.charAt(0)) + operation.substring(1)));
+        if (outside) {
+            JPanel msg = new JPanel(new GridBagLayout());
+            msg.add(new JLabel(
+                    "<html>" +
+                    // leave message in one tr() as there is a grammatical connection.
+                    tr("You are about to {0} nodes outside of the area you have downloaded."
+                            + "<br>"
+                            + "This can cause problems because other objects (that you do not see) might use them."
+                            + "<br>" + "Do you really want to delete?", tr(operation))
+                    + "</html>"));
+            boolean answer = ConditionalOptionPaneUtil.showConfirmationDialog(
+                    operation + "_outside_nodes",
+                    Main.parent,
+                    msg,
+                    title,
+                    JOptionPane.YES_NO_OPTION,
+                    JOptionPane.QUESTION_MESSAGE,
+                    JOptionPane.YES_OPTION);
+            if(!answer)
+                return false;
+        }
+        if (incomplete) {
+            JPanel msg = new JPanel(new GridBagLayout());
+            msg.add(new JLabel(
+                    "<html>" +
+                    // leave message in one tr() as there is a grammatical connection.
+                    tr("You are about to {0} incomplete objects."
+                            + "<br>"
+                            + "This will cause problems because you don''t see the real object."
+                            + "<br>" + "Do you really want to delete?", tr(operation))
+                    + "</html>"));
+            boolean answer = ConditionalOptionPaneUtil.showConfirmationDialog(
+                    operation + "_incomplete",
+                    Main.parent,
+                    msg,
+                    title,
+                    JOptionPane.YES_NO_OPTION,
+                    JOptionPane.QUESTION_MESSAGE,
+                    JOptionPane.YES_OPTION);
+            if(!answer)
+                return false;
+        }
+        return true;
+    }
+
 }
diff --git a/src/org/openstreetmap/josm/command/DeleteCommand.java b/src/org/openstreetmap/josm/command/DeleteCommand.java
index bbd40b2..baa7c9d 100644
--- a/src/org/openstreetmap/josm/command/DeleteCommand.java
+++ b/src/org/openstreetmap/josm/command/DeleteCommand.java
@@ -5,8 +5,6 @@ import static org.openstreetmap.josm.tools.I18n.marktr;
 import static org.openstreetmap.josm.tools.I18n.tr;
 import static org.openstreetmap.josm.tools.I18n.trn;
 
-import java.awt.GridBagLayout;
-import java.awt.geom.Area;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -20,10 +18,7 @@ import java.util.Set;
 import java.util.Map.Entry;
 
 import javax.swing.JLabel;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.SplitWayAction;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -33,7 +28,6 @@ import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.data.osm.RelationToChildReference;
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.data.osm.WaySegment;
-import org.openstreetmap.josm.gui.ConditionalOptionPaneUtil;
 import org.openstreetmap.josm.gui.DefaultNameFormatter;
 import org.openstreetmap.josm.gui.actionsupport.DeleteFromRelationConfirmationDialog;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
@@ -233,7 +227,7 @@ public class DeleteCommand extends Command {
 
         if (parents.isEmpty())
             return null;
-        if (!silent && !checkAndConfirmOutlyingDeletes(layer,parents))
+        if (!silent && !checkAndConfirmOutlyingOperation("delete", layer, parents))
             return null;
         return new DeleteCommand(layer,parents);
     }
@@ -330,7 +324,7 @@ public class DeleteCommand extends Command {
             primitivesToDelete.addAll(nodesToDelete);
         }
 
-        if (!silent && !checkAndConfirmOutlyingDeletes(layer,primitivesToDelete))
+        if (!silent && !checkAndConfirmOutlyingOperation("delete", layer, primitivesToDelete))
             return null;
 
         waysToBeChanged.addAll(OsmPrimitive.getFilteredSet(OsmPrimitive.getReferrer(primitivesToDelete), Way.class));
@@ -426,81 +420,4 @@ public class DeleteCommand extends Command {
         }
     }
 
-    /**
-     * Check whether user is about to delete data outside of the download area. Request confirmation
-     * if he is.
-     *
-     * @param layer the layer in whose context data is deleted
-     * @param primitivesToDelete the primitives to delete
-     * @return true, if deleting outlying primitives is OK; false, otherwise
-     */
-    private static boolean checkAndConfirmOutlyingDeletes(OsmDataLayer layer, Collection<OsmPrimitive> primitivesToDelete) {
-        Area a = layer.data.getDataSourceArea();
-        boolean outside = false;
-        boolean incomplete = false;
-        if (a != null) {
-            for (OsmPrimitive osm : primitivesToDelete) {
-                if (osm.isIncomplete()) {
-                    incomplete = true;
-                } else if (osm instanceof Node && !osm.isNewOrUndeleted()
-                        && !a.contains(((Node) osm).getCoor())) {
-                    outside = true;
-                }
-            }
-        }
-        else
-        {
-            for (OsmPrimitive osm : primitivesToDelete)
-                if (osm.isIncomplete()) {
-                    incomplete = true;
-                }
-        }
-        if(outside)
-        {
-            JPanel msg = new JPanel(new GridBagLayout());
-            msg.add(new JLabel(
-                    "<html>" +
-                    // leave message in one tr() as there is a grammatical
-                    // connection.
-                    tr("You are about to delete nodes outside of the area you have downloaded."
-                            + "<br>"
-                            + "This can cause problems because other objects (that you do not see) might use them."
-                            + "<br>" + "Do you really want to delete?") + "</html>"));
-            boolean answer = ConditionalOptionPaneUtil.showConfirmationDialog(
-                    "delete_outside_nodes",
-                    Main.parent,
-                    msg,
-                    tr("Delete confirmation"),
-                    JOptionPane.YES_NO_OPTION,
-                    JOptionPane.QUESTION_MESSAGE,
-                    JOptionPane.YES_OPTION
-            );
-            if(!answer)
-                return false;
-        }
-        if(incomplete)
-        {
-            JPanel msg = new JPanel(new GridBagLayout());
-            msg.add(new JLabel(
-                    "<html>" +
-                    // leave message in one tr() as there is a grammatical
-                    // connection.
-                    tr("You are about to delete incomplete objects."
-                            + "<br>"
-                            + "This will cause problems because you don''t see the real object."
-                            + "<br>" + "Do you really want to delete?") + "</html>"));
-            boolean answer = ConditionalOptionPaneUtil.showConfirmationDialog(
-                    "delete_incomplete",
-                    Main.parent,
-                    msg,
-                    tr("Delete confirmation"),
-                    JOptionPane.YES_NO_OPTION,
-                    JOptionPane.QUESTION_MESSAGE,
-                    JOptionPane.YES_OPTION
-            );
-            if(!answer)
-                return false;
-        }
-        return true;
-    }
 }
