Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(933)

Unified Diff: Source/core/editing/ModifySelectionListLevel.cpp

Issue 23822003: Have EditCommand classes deal with Document references, not pointers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/editing/ModifySelectionListLevel.h ('k') | Source/core/editing/MoveSelectionCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/ModifySelectionListLevel.cpp
diff --git a/Source/core/editing/ModifySelectionListLevel.cpp b/Source/core/editing/ModifySelectionListLevel.cpp
index f0e5f64b4588f389a5cc8ee3550d5e99ee056948..bdf29a8ec2ffe18e7333a3446fa2d6a60ec0eaea 100644
--- a/Source/core/editing/ModifySelectionListLevel.cpp
+++ b/Source/core/editing/ModifySelectionListLevel.cpp
@@ -35,7 +35,7 @@
namespace WebCore {
-ModifySelectionListLevelCommand::ModifySelectionListLevelCommand(Document* document)
+ModifySelectionListLevelCommand::ModifySelectionListLevelCommand(Document& document)
: CompositeEditCommand(document)
{
}
@@ -134,7 +134,7 @@ void ModifySelectionListLevelCommand::appendSiblingNodeRange(Node* startNode, No
}
}
-IncreaseSelectionListLevelCommand::IncreaseSelectionListLevelCommand(Document* document, Type listType)
+IncreaseSelectionListLevelCommand::IncreaseSelectionListLevelCommand(Document& document, Type listType)
: ModifySelectionListLevelCommand(document)
, m_listType(listType)
{
@@ -190,10 +190,10 @@ void IncreaseSelectionListLevelCommand::doApply()
newParent = newParent->cloneElementWithoutChildren();
break;
case OrderedList:
- newParent = createOrderedListElement(document());
+ newParent = createOrderedListElement(&document());
break;
case UnorderedList:
- newParent = createUnorderedListElement(document());
+ newParent = createUnorderedListElement(&document());
break;
}
insertNodeBefore(newParent, startListChild);
@@ -202,38 +202,37 @@ void IncreaseSelectionListLevelCommand::doApply()
}
}
-bool IncreaseSelectionListLevelCommand::canIncreaseSelectionListLevel(Document* document)
+bool IncreaseSelectionListLevelCommand::canIncreaseSelectionListLevel(Document& document)
{
Node* startListChild;
Node* endListChild;
- return canIncreaseListLevel(document->frame()->selection()->selection(), startListChild, endListChild);
+ return canIncreaseListLevel(document.frame()->selection()->selection(), startListChild, endListChild);
}
-PassRefPtr<Node> IncreaseSelectionListLevelCommand::increaseSelectionListLevel(Document* document, Type type)
+PassRefPtr<Node> IncreaseSelectionListLevelCommand::increaseSelectionListLevel(Document& document, Type type)
{
- ASSERT(document);
- ASSERT(document->frame());
+ ASSERT(document.frame());
RefPtr<IncreaseSelectionListLevelCommand> command = create(document, type);
command->apply();
return command->m_listElement.release();
}
-PassRefPtr<Node> IncreaseSelectionListLevelCommand::increaseSelectionListLevel(Document* document)
+PassRefPtr<Node> IncreaseSelectionListLevelCommand::increaseSelectionListLevel(Document& document)
{
return increaseSelectionListLevel(document, InheritedListType);
}
-PassRefPtr<Node> IncreaseSelectionListLevelCommand::increaseSelectionListLevelOrdered(Document* document)
+PassRefPtr<Node> IncreaseSelectionListLevelCommand::increaseSelectionListLevelOrdered(Document& document)
{
return increaseSelectionListLevel(document, OrderedList);
}
-PassRefPtr<Node> IncreaseSelectionListLevelCommand::increaseSelectionListLevelUnordered(Document* document)
+PassRefPtr<Node> IncreaseSelectionListLevelCommand::increaseSelectionListLevelUnordered(Document& document)
{
return increaseSelectionListLevel(document, UnorderedList);
}
-DecreaseSelectionListLevelCommand::DecreaseSelectionListLevelCommand(Document* document)
+DecreaseSelectionListLevelCommand::DecreaseSelectionListLevelCommand(Document& document)
: ModifySelectionListLevelCommand(document)
{
}
@@ -278,17 +277,16 @@ void DecreaseSelectionListLevelCommand::doApply()
}
}
-bool DecreaseSelectionListLevelCommand::canDecreaseSelectionListLevel(Document* document)
+bool DecreaseSelectionListLevelCommand::canDecreaseSelectionListLevel(Document& document)
{
Node* startListChild;
Node* endListChild;
- return canDecreaseListLevel(document->frame()->selection()->selection(), startListChild, endListChild);
+ return canDecreaseListLevel(document.frame()->selection()->selection(), startListChild, endListChild);
}
-void DecreaseSelectionListLevelCommand::decreaseSelectionListLevel(Document* document)
+void DecreaseSelectionListLevelCommand::decreaseSelectionListLevel(Document& document)
{
- ASSERT(document);
- ASSERT(document->frame());
+ ASSERT(document.frame());
applyCommand(create(document));
}
« no previous file with comments | « Source/core/editing/ModifySelectionListLevel.h ('k') | Source/core/editing/MoveSelectionCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698