From f14b1b883c6709286f7ea4d5a0e2fbb5b5776a29 Mon Sep 17 00:00:00 2001 From: "jfrancis%netscape.com" Date: Mon, 9 Aug 1999 21:43:53 +0000 Subject: [PATCH] adding InsertHeader() git-svn-id: svn://10.0.0.236/trunk@42816 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/editor/base/nsJSEditorLog.cpp | 18 ++++++++++++++++++ mozilla/editor/base/nsJSEditorLog.h | 1 + 2 files changed, 19 insertions(+) diff --git a/mozilla/editor/base/nsJSEditorLog.cpp b/mozilla/editor/base/nsJSEditorLog.cpp index 84441a5f4a7..71372012481 100644 --- a/mozilla/editor/base/nsJSEditorLog.cpp +++ b/mozilla/editor/base/nsJSEditorLog.cpp @@ -610,6 +610,24 @@ nsJSEditorLog::InsertList(const nsString& aListType) return NS_OK; } + +NS_IMETHODIMP +nsJSEditorLog::InsertHeader(const nsString& aHeaderType) +{ + if (mLocked) + return NS_OK; + + PrintSelection(); + + Write("window.editorShell.InsertHeader(\""); + PrintUnicode(aHeaderType); + Write("\");\n"); + Flush(); + + return NS_OK; +} + + NS_IMETHODIMP nsJSEditorLog::Indent(const nsString& aIndent) { diff --git a/mozilla/editor/base/nsJSEditorLog.h b/mozilla/editor/base/nsJSEditorLog.h index 85200d4cf88..044a938b40c 100644 --- a/mozilla/editor/base/nsJSEditorLog.h +++ b/mozilla/editor/base/nsJSEditorLog.h @@ -117,6 +117,7 @@ public: NS_IMETHOD RemoveParagraphStyle(); NS_IMETHOD RemoveParent(const nsString &aParentTag); NS_IMETHOD InsertList(const nsString& aListType); + NS_IMETHOD InsertHeader(const nsString& aHeaderType); NS_IMETHOD Indent(const nsString& aIndent); NS_IMETHOD Align(const nsString& aAlign); NS_IMETHOD GetElementOrParentByTagName(const nsString& aTagName, nsIDOMNode *aNode, nsIDOMElement** aReturn);