[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
cblu
cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:32:59 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 0b46ed5eb3604e648dfebb83ff22909c7446af53
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Apr 8 22:31:49 2004 +0000
Renamed the PasteHTMLCommand to PasteMarkupCommand. Removed PasteImageCommand because we will use PasteMarkupCommand for pasting images.
Reviewed by kocienda.
* khtml/editing/htmlediting.cpp:
(PasteMarkupCommand::PasteMarkupCommand):
(PasteMarkupCommand::~PasteMarkupCommand):
(PasteMarkupCommand::impl):
(PasteMarkupCommand::markupString):
* khtml/editing/htmlediting.h:
(khtml::):
* khtml/editing/htmlediting_impl.cpp:
(PasteMarkupCommandImpl::PasteMarkupCommandImpl):
(PasteMarkupCommandImpl::~PasteMarkupCommandImpl):
(PasteMarkupCommandImpl::commandID):
(PasteMarkupCommandImpl::doApply):
* khtml/editing/htmlediting_impl.h:
(khtml::PasteMarkupCommandImpl::markupString):
* khtml/khtml_part.cpp:
(KHTMLPart::pasteMarkupString):
* khtml/khtml_part.h:
* kwq/WebCoreBridge.h:
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge pasteMarkupString:]):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6335 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 75a1e67..775867c 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,30 @@
+2004-04-08 Chris Blumenberg <cblu at apple.com>
+
+ Renamed the PasteHTMLCommand to PasteMarkupCommand. Removed PasteImageCommand because we will use PasteMarkupCommand for pasting images.
+
+ Reviewed by kocienda.
+
+ * khtml/editing/htmlediting.cpp:
+ (PasteMarkupCommand::PasteMarkupCommand):
+ (PasteMarkupCommand::~PasteMarkupCommand):
+ (PasteMarkupCommand::impl):
+ (PasteMarkupCommand::markupString):
+ * khtml/editing/htmlediting.h:
+ (khtml::):
+ * khtml/editing/htmlediting_impl.cpp:
+ (PasteMarkupCommandImpl::PasteMarkupCommandImpl):
+ (PasteMarkupCommandImpl::~PasteMarkupCommandImpl):
+ (PasteMarkupCommandImpl::commandID):
+ (PasteMarkupCommandImpl::doApply):
+ * khtml/editing/htmlediting_impl.h:
+ (khtml::PasteMarkupCommandImpl::markupString):
+ * khtml/khtml_part.cpp:
+ (KHTMLPart::pasteMarkupString):
+ * khtml/khtml_part.h:
+ * kwq/WebCoreBridge.h:
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge pasteMarkupString:]):
+
2004-04-08 David Hyatt <hyatt at apple.com>
Fix for 3608430 and 3608462, crashes in findNextLineBreak when deleting. Make sure that the removal of line boxes
diff --git a/WebCore/khtml/editing/htmlediting.cpp b/WebCore/khtml/editing/htmlediting.cpp
index ac1fa78..bc6c59f 100644
--- a/WebCore/khtml/editing/htmlediting.cpp
+++ b/WebCore/khtml/editing/htmlediting.cpp
@@ -70,10 +70,8 @@ using khtml::RemoveNodeCommand;
using khtml::RemoveNodeCommandImpl;
using khtml::RemoveNodeAndPruneCommand;
using khtml::RemoveNodeAndPruneCommandImpl;
-using khtml::PasteHTMLCommand;
-using khtml::PasteHTMLCommandImpl;
-using khtml::PasteImageCommand;
-using khtml::PasteImageCommandImpl;
+using khtml::PasteMarkupCommand;
+using khtml::PasteMarkupCommandImpl;
using khtml::SplitTextNodeCommand;
using khtml::SplitTextNodeCommandImpl;
using khtml::TypingCommand;
@@ -514,43 +512,26 @@ TextImpl *JoinTextNodesCommand::secondNode() const
}
//------------------------------------------------------------------------------------------
-// PasteHTMLCommand
+// PasteMarkupCommand
-PasteHTMLCommand::PasteHTMLCommand(DocumentImpl *document, const DOMString &HTMLString)
- : CompositeEditCommand(new PasteHTMLCommandImpl(document, HTMLString))
+PasteMarkupCommand::PasteMarkupCommand(DocumentImpl *document, const DOMString &markupString)
+ : CompositeEditCommand(new PasteMarkupCommandImpl(document, markupString))
{
}
-PasteHTMLCommand::~PasteHTMLCommand()
+PasteMarkupCommand::~PasteMarkupCommand()
{
}
-PasteHTMLCommandImpl *PasteHTMLCommand::impl() const
+PasteMarkupCommandImpl *PasteMarkupCommand::impl() const
{
- return static_cast<PasteHTMLCommandImpl *>(get());
+ return static_cast<PasteMarkupCommandImpl *>(get());
}
-DOMString PasteHTMLCommand::HTMLString() const
+DOMString PasteMarkupCommand::markupString() const
{
IF_IMPL_NULL_RETURN_ARG(DOMString());
- return impl()->HTMLString();
-}
-
-//------------------------------------------------------------------------------------------
-// PasteImageCommand
-
-PasteImageCommand::PasteImageCommand(DocumentImpl *document, const DOMString &src)
- : CompositeEditCommand(new PasteImageCommandImpl(document, src))
-{
-}
-
-PasteImageCommand::~PasteImageCommand()
-{
-}
-
-PasteImageCommandImpl *PasteImageCommand::impl() const
-{
- return static_cast<PasteImageCommandImpl *>(get());
+ return impl()->markupString();
}
//------------------------------------------------------------------------------------------
diff --git a/WebCore/khtml/editing/htmlediting.h b/WebCore/khtml/editing/htmlediting.h
index 1324fef..3534756 100644
--- a/WebCore/khtml/editing/htmlediting.h
+++ b/WebCore/khtml/editing/htmlediting.h
@@ -55,8 +55,7 @@ class InputTextCommandImpl;
class InsertNodeBeforeCommandImpl;
class InsertTextCommandImpl;
class JoinTextNodesCommandImpl;
-class PasteHTMLCommandImpl;
-class PasteImageCommandImpl;
+class PasteMarkupCommandImpl;
class RemoveNodeCommandImpl;
class RemoveNodeAndPruneCommandImpl;
class SplitTextNodeCommandImpl;
@@ -77,8 +76,7 @@ enum ECommandID {
InsertNodeBeforeCommandID,
InsertTextCommandID,
JoinTextNodesCommandID,
- PasteHTMLCommandID,
- PasteImageCommandID,
+ PasteMarkupCommandID,
RemoveNodeCommandID,
RemoveNodeAndPruneCommandID,
SplitTextNodeCommandID,
@@ -318,31 +316,18 @@ private:
};
//------------------------------------------------------------------------------------------
-// PasteHTMLCommand
+// PasteMarkupCommand
-class PasteHTMLCommand : public CompositeEditCommand
+class PasteMarkupCommand : public CompositeEditCommand
{
public:
- PasteHTMLCommand(DOM::DocumentImpl *document, const DOM::DOMString &HTMLString);
- virtual ~PasteHTMLCommand();
+ PasteMarkupCommand(DOM::DocumentImpl *document, const DOM::DOMString &markupString);
+ virtual ~PasteMarkupCommand();
- DOM::DOMString HTMLString() const;
+ DOM::DOMString markupString() const;
private:
- inline PasteHTMLCommandImpl *impl() const;
-};
-
-//------------------------------------------------------------------------------------------
-// PasteImageCommand
-
-class PasteImageCommand : public CompositeEditCommand
-{
-public:
- PasteImageCommand(DOM::DocumentImpl *document, const DOM::DOMString &src);
- virtual ~PasteImageCommand();
-
-private:
- inline PasteImageCommandImpl *impl() const;
+ inline PasteMarkupCommandImpl *impl() const;
};
//------------------------------------------------------------------------------------------
diff --git a/WebCore/khtml/editing/htmlediting_impl.cpp b/WebCore/khtml/editing/htmlediting_impl.cpp
index b7454ad..276b90a 100644
--- a/WebCore/khtml/editing/htmlediting_impl.cpp
+++ b/WebCore/khtml/editing/htmlediting_impl.cpp
@@ -95,10 +95,8 @@ using khtml::RemoveNodeAndPruneCommandImpl;
using khtml::RenderObject;
using khtml::RenderStyle;
using khtml::RenderText;
-using khtml::PasteHTMLCommand;
-using khtml::PasteHTMLCommandImpl;
-using khtml::PasteImageCommand;
-using khtml::PasteImageCommandImpl;
+using khtml::PasteMarkupCommand;
+using khtml::PasteMarkupCommandImpl;
using khtml::SplitTextNodeCommand;
using khtml::SplitTextNodeCommandImpl;
using khtml::TypingCommand;
@@ -1392,26 +1390,26 @@ void JoinTextNodesCommandImpl::doUnapply()
}
//------------------------------------------------------------------------------------------
-// PasteHTMLCommandImpl
+// PasteMarkupCommandImpl
-PasteHTMLCommandImpl::PasteHTMLCommandImpl(DocumentImpl *document, const DOMString &HTMLString)
- : CompositeEditCommandImpl(document), m_HTMLString(HTMLString)
+PasteMarkupCommandImpl::PasteMarkupCommandImpl(DocumentImpl *document, const DOMString &markupString)
+ : CompositeEditCommandImpl(document), m_markupString(markupString)
{
- ASSERT(!m_HTMLString.isEmpty());
+ ASSERT(!m_markupString.isEmpty());
}
-PasteHTMLCommandImpl::~PasteHTMLCommandImpl()
+PasteMarkupCommandImpl::~PasteMarkupCommandImpl()
{
}
-int PasteHTMLCommandImpl::commandID() const
+int PasteMarkupCommandImpl::commandID() const
{
- return PasteHTMLCommandID;
+ return PasteMarkupCommandID;
}
-void PasteHTMLCommandImpl::doApply()
+void PasteMarkupCommandImpl::doApply()
{
- DocumentFragmentImpl *root = static_cast<HTMLElementImpl *>(document()->documentElement())->createContextualFragment(m_HTMLString);
+ DocumentFragmentImpl *root = static_cast<HTMLElementImpl *>(document()->documentElement())->createContextualFragment(m_markupString);
ASSERT(root);
NodeImpl *firstChild = root->firstChild();
@@ -1464,44 +1462,6 @@ void PasteHTMLCommandImpl::doApply()
}
//------------------------------------------------------------------------------------------
-// PasteImageCommandImpl
-
-PasteImageCommandImpl::PasteImageCommandImpl(DocumentImpl *document, const DOMString &src)
-: CompositeEditCommandImpl(document)
-{
- ASSERT(!src.isEmpty());
- m_src = src;
-}
-
-PasteImageCommandImpl::~PasteImageCommandImpl()
-{
-}
-
-int PasteImageCommandImpl::commandID() const
-{
- return PasteImageCommandID;
-}
-
-void PasteImageCommandImpl::doApply()
-{
- deleteSelection();
-
- KHTMLPart *part = document()->part();
- ASSERT(part);
-
- KHTMLSelection selection = part->selection();
- ASSERT(!selection.isEmpty());
-
- DOM::NodeImpl *startNode = selection.startNode();
- HTMLImageElementImpl *imageNode = new HTMLImageElementImpl(startNode->docPtr());
- imageNode->setAttribute(ATTR_SRC, m_src);
-
- insertNodeAt(imageNode, startNode, selection.startOffset());
- selection = KHTMLSelection(imageNode, imageNode->caretMaxOffset());
- setEndingSelection(selection);
-}
-
-//------------------------------------------------------------------------------------------
// RemoveNodeCommandImpl
RemoveNodeCommandImpl::RemoveNodeCommandImpl(DocumentImpl *document, NodeImpl *removeChild)
diff --git a/WebCore/khtml/editing/htmlediting_impl.h b/WebCore/khtml/editing/htmlediting_impl.h
index 6a87061..47fec02 100644
--- a/WebCore/khtml/editing/htmlediting_impl.h
+++ b/WebCore/khtml/editing/htmlediting_impl.h
@@ -338,39 +338,22 @@ private:
};
//------------------------------------------------------------------------------------------
-// PasteHTMLCommandImpl
+// PasteMarkupCommandImpl
-class PasteHTMLCommandImpl : public CompositeEditCommandImpl
+class PasteMarkupCommandImpl : public CompositeEditCommandImpl
{
public:
- PasteHTMLCommandImpl(DOM::DocumentImpl *document, const DOM::DOMString &HTMLString);
- virtual ~PasteHTMLCommandImpl();
+ PasteMarkupCommandImpl(DOM::DocumentImpl *document, const DOM::DOMString &markupString);
+ virtual ~PasteMarkupCommandImpl();
virtual int commandID() const;
virtual void doApply();
- DOM::DOMString HTMLString() const { return m_HTMLString; }
+ DOM::DOMString markupString() const { return m_markupString; }
private:
- DOM::DOMString m_HTMLString;
-};
-
-//------------------------------------------------------------------------------------------
-// PasteImageCommandImpl
-
-class PasteImageCommandImpl : public CompositeEditCommandImpl
-{
-public:
- PasteImageCommandImpl(DOM::DocumentImpl *document, const DOM::DOMString &src);
- virtual ~PasteImageCommandImpl();
-
- virtual int commandID() const;
-
- virtual void doApply();
-
-private:
- DOM::DOMString m_src;
+ DOM::DOMString m_markupString;
};
//------------------------------------------------------------------------------------------
diff --git a/WebCore/khtml/khtml_part.cpp b/WebCore/khtml/khtml_part.cpp
index 3a9ed7f..bb118ef 100644
--- a/WebCore/khtml/khtml_part.cpp
+++ b/WebCore/khtml/khtml_part.cpp
@@ -102,8 +102,7 @@ using khtml::Decoder;
using khtml::DeleteSelectionCommand;
using khtml::EditCommand;
using khtml::InlineTextBox;
-using khtml::PasteHTMLCommand;
-using khtml::PasteImageCommand;
+using khtml::PasteMarkupCommand;
using khtml::RenderObject;
using khtml::RenderText;
using khtml::Tokenizer;
@@ -5158,15 +5157,9 @@ void KHTMLPart::reappliedEditing(EditCommand &cmd)
d->m_lastEditCommand = EditCommand::emptyCommand();
}
-void KHTMLPart::pasteHTMLString(const QString &HTMLString)
+void KHTMLPart::pasteMarkupString(const QString &markupString)
{
- EditCommand cmd(PasteHTMLCommand(d->m_doc, DOMString(HTMLString)));
- cmd.apply();
-}
-
-void KHTMLPart::pasteImage(const QString &src)
-{
- EditCommand cmd(PasteImageCommand(d->m_doc, DOMString(src)));
+ EditCommand cmd(PasteMarkupCommand(d->m_doc, DOMString(markupString)));
cmd.apply();
}
diff --git a/WebCore/khtml/khtml_part.h b/WebCore/khtml/khtml_part.h
index 64d4945..667400c 100644
--- a/WebCore/khtml/khtml_part.h
+++ b/WebCore/khtml/khtml_part.h
@@ -654,14 +654,9 @@ public:
void reappliedEditing(khtml::EditCommand &);
/**
- * Pastes an HTML string at the current caret position.
+ * Pastes a markup string (such as an HTML string) at the current caret position.
*/
- void pasteHTMLString(const QString &HTMLString);
-
- /**
- * Pastes a new image node at the current caret position.
- */
- void pasteImage(const QString &src);
+ void pasteMarkupString(const QString &markupString);
/**
* Convenience method to show the document's view.
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index 63c6fcb..befc9c9 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -230,7 +230,6 @@ typedef enum {
- (BOOL)moveCaretToPoint:(NSPoint)point;
- (void)pasteMarkupString:(NSString *)markupString;
-- (void)pasteImageWithURL:(NSURL *)URL;
- (void)deleteSelection;
- (BOOL)haveSelection;
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index caab38e..e3aa9dd 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -419,12 +419,7 @@ static bool initializedKJS = FALSE;
- (void)pasteMarkupString:(NSString *)markupString
{
- _part->pasteHTMLString(QString::fromNSString(markupString));
-}
-
-- (void)pasteImageWithURL:(NSURL *)URL
-{
- _part->pasteImage(QString::fromNSString([URL absoluteString]));
+ _part->pasteMarkupString(QString::fromNSString(markupString));
}
- (void)deleteSelection
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list