Turn avoidIntersectionWithNode into Editor member functions to encapsulate delete...
[WebKit-https.git] / Source / WebCore / editing / EditCommand.cpp
index 527580e74ed78901e3e5a26052fce797df5c78d9..be5ef1566fec7c2afce26d07a6710f367128b72d 100644 (file)
@@ -27,9 +27,6 @@
 #include "EditCommand.h"
 
 #include "CompositeEditCommand.h"
-#if ENABLE(DELETION_UI)
-#include "DeleteButtonController.h"
-#endif
 #include "Document.h"
 #include "Editor.h"
 #include "Element.h"
@@ -48,11 +45,7 @@ EditCommand::EditCommand(Document* document)
 {
     ASSERT(m_document);
     ASSERT(m_document->frame());
-#if ENABLE(DELETION_UI)
-    setStartingSelection(avoidIntersectionWithNode(m_document->frame()->selection()->selection(), m_document->frame()->editor()->deleteButtonController()->containerElement()));
-#else
-    setStartingSelection(m_document->frame()->selection()->selection());
-#endif
+    setStartingSelection(m_document->frame()->editor()->avoidIntersectionWithDeleteButtonController(m_document->frame()->selection()->selection()));
     setEndingSelection(m_startingSelection);
 }