From 1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353 Mon Sep 17 00:00:00 2001 From: The Android Open Source Project Date: Wed, 17 Dec 2008 18:05:15 -0800 Subject: Code drop from //branches/cupcake/...@124589 --- WebCore/editing/InsertParagraphSeparatorCommand.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'WebCore/editing/InsertParagraphSeparatorCommand.h') diff --git a/WebCore/editing/InsertParagraphSeparatorCommand.h b/WebCore/editing/InsertParagraphSeparatorCommand.h index d866ed5..01c08bf 100644 --- a/WebCore/editing/InsertParagraphSeparatorCommand.h +++ b/WebCore/editing/InsertParagraphSeparatorCommand.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved. + * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,19 +32,26 @@ namespace WebCore { class InsertParagraphSeparatorCommand : public CompositeEditCommand { public: - InsertParagraphSeparatorCommand(Document*, bool useDefaultParagraphElement = false); + static PassRefPtr create(Document* document, bool useDefaultParagraphElement = false) + { + return adoptRef(new InsertParagraphSeparatorCommand(document, useDefaultParagraphElement)); + } + +private: + InsertParagraphSeparatorCommand(Document*, bool useDefaultParagraphElement); virtual void doApply(); -private: void calculateStyleBeforeInsertion(const Position&); - void applyStyleAfterInsertion(); + void applyStyleAfterInsertion(Node* originalEnclosingBlock); + + bool shouldUseDefaultParagraphElement(Node*) const; virtual bool preservesTypingStyle() const; RefPtr m_style; - bool m_useDefaultParagraphElement; + bool m_mustUseDefaultParagraphElement; }; } -- cgit v1.1