diff --git a/editor/libeditor/base/CreateElementTxn.cpp b/editor/libeditor/base/CreateElementTxn.cpp index f785c9ea644c..3d7ef70b60a6 100644 --- a/editor/libeditor/base/CreateElementTxn.cpp +++ b/editor/libeditor/base/CreateElementTxn.cpp @@ -11,13 +11,14 @@ #include "nsIDOMElement.h" #include "nsReadableUtils.h" -//included for new nsEditor::CreateContent() -#include "nsIContent.h" +#include "mozilla/dom/Element.h" #ifdef NS_DEBUG static bool gNoisy = false; #endif +using namespace mozilla; + CreateElementTxn::CreateElementTxn() : EditTxn() { @@ -80,7 +81,7 @@ NS_IMETHODIMP CreateElementTxn::DoTransaction(void) NS_ASSERTION(mEditor && mParent, "bad state"); NS_ENSURE_TRUE(mEditor && mParent, NS_ERROR_NOT_INITIALIZED); - nsCOMPtr newContent; + nsCOMPtr newContent; //new call to use instead to get proper HTML element, bug# 39919 nsresult result = mEditor->CreateHTMLContent(mTag, getter_AddRefs(newContent)); diff --git a/editor/libeditor/base/nsEditor.cpp b/editor/libeditor/base/nsEditor.cpp index e901f83bac64..4268a9da95bd 100644 --- a/editor/libeditor/base/nsEditor.cpp +++ b/editor/libeditor/base/nsEditor.cpp @@ -1540,7 +1540,7 @@ nsEditor::ReplaceContainer(nsIDOMNode *inNode, NS_ENSURE_SUCCESS(res, res); // create new container - nsCOMPtr newContent; + nsCOMPtr newContent; //new call to use instead to get proper HTML element, bug# 39919 res = CreateHTMLContent(aNodeType, getter_AddRefs(newContent)); @@ -1658,7 +1658,7 @@ nsEditor::InsertContainerAbove( nsIDOMNode *inNode, NS_ENSURE_SUCCESS(res, res); // create new container - nsCOMPtr newContent; + nsCOMPtr newContent; //new call to use instead to get proper HTML element, bug# 39919 res = CreateHTMLContent(aNodeType, getter_AddRefs(newContent)); @@ -5034,7 +5034,7 @@ nsresult nsEditor::ClearSelection() } nsresult -nsEditor::CreateHTMLContent(const nsAString& aTag, nsIContent** aContent) +nsEditor::CreateHTMLContent(const nsAString& aTag, dom::Element** aContent) { nsCOMPtr doc = GetDocument(); NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE); @@ -5047,7 +5047,8 @@ nsEditor::CreateHTMLContent(const nsAString& aTag, nsIContent** aContent) return NS_ERROR_FAILURE; } - return doc->CreateElem(aTag, nsnull, kNameSpaceID_XHTML, aContent); + return doc->CreateElem(aTag, nsnull, kNameSpaceID_XHTML, + reinterpret_cast(aContent)); } nsresult diff --git a/editor/libeditor/base/nsEditor.h b/editor/libeditor/base/nsEditor.h index 5f3869f29701..9164ab4b5948 100644 --- a/editor/libeditor/base/nsEditor.h +++ b/editor/libeditor/base/nsEditor.h @@ -201,7 +201,8 @@ public: nsString& aTag - tag you want nsIContent** aContent - returned Content that was created with above namespace. */ - nsresult CreateHTMLContent(const nsAString& aTag, nsIContent** aContent); + nsresult CreateHTMLContent(const nsAString& aTag, + mozilla::dom::Element** aContent); // IME event handlers virtual nsresult BeginIMEComposition(); diff --git a/editor/libeditor/html/nsHTMLAnonymousUtils.cpp b/editor/libeditor/html/nsHTMLAnonymousUtils.cpp index 88ab20a7077a..b6943686807e 100644 --- a/editor/libeditor/html/nsHTMLAnonymousUtils.cpp +++ b/editor/libeditor/html/nsHTMLAnonymousUtils.cpp @@ -27,6 +27,8 @@ #include "nsUnicharUtils.h" #include "nsContentUtils.h" +using namespace mozilla; + // retrieve an integer stored into a CSS computed float value static PRInt32 GetCSSFloatValue(nsIDOMCSSStyleDeclaration * aDecl, const nsAString & aProperty) @@ -123,7 +125,7 @@ nsHTMLEditor::CreateAnonymousElement(const nsAString & aTag, nsIDOMNode * aPare NS_ENSURE_TRUE(ps, NS_ERROR_NOT_INITIALIZED); // Create a new node through the element factory - nsCOMPtr newContent; + nsCOMPtr newContent; nsresult res = CreateHTMLContent(aTag, getter_AddRefs(newContent)); NS_ENSURE_SUCCESS(res, res); diff --git a/editor/libeditor/html/nsHTMLEditor.cpp b/editor/libeditor/html/nsHTMLEditor.cpp index c7d8e5e2e4a8..b13b5131a33c 100644 --- a/editor/libeditor/html/nsHTMLEditor.cpp +++ b/editor/libeditor/html/nsHTMLEditor.cpp @@ -2856,7 +2856,7 @@ nsHTMLEditor::CreateElementWithDefaults(const nsAString& aTagName, nsIDOMElement // go through the transaction system nsCOMPtrnewElement; - nsCOMPtr newContent; + nsCOMPtr newContent; nsCOMPtr doc = do_QueryReferent(mDocWeak); NS_ENSURE_TRUE(doc, NS_ERROR_NOT_INITIALIZED); diff --git a/editor/libeditor/html/nsHTMLEditorStyle.cpp b/editor/libeditor/html/nsHTMLEditorStyle.cpp index 95f288fdfd5d..6d6f96cf6060 100644 --- a/editor/libeditor/html/nsHTMLEditorStyle.cpp +++ b/editor/libeditor/html/nsHTMLEditorStyle.cpp @@ -284,16 +284,16 @@ nsHTMLEditor::IsSimpleModifiableNode(nsIContent* aContent, // "text-decoration: underline", which decomposes into four different text-* // properties. So for now, we just create a span, add the desired style, and // see if it matches. - nsCOMPtr newSpan; + nsCOMPtr newSpan; nsresult res = CreateHTMLContent(NS_LITERAL_STRING("span"), getter_AddRefs(newSpan)); NS_ASSERTION(NS_SUCCEEDED(res), "CreateHTMLContent failed"); NS_ENSURE_SUCCESS(res, false); - mHTMLCSSUtils->SetCSSEquivalentToHTMLStyle(newSpan->AsElement(), aProperty, + mHTMLCSSUtils->SetCSSEquivalentToHTMLStyle(newSpan, aProperty, aAttribute, aValue, /*suppress transaction*/ true); - return mHTMLCSSUtils->ElementsSameStyle(newSpan->AsElement(), element); + return mHTMLCSSUtils->ElementsSameStyle(newSpan, element); } diff --git a/editor/libeditor/text/nsTextEditRules.cpp b/editor/libeditor/text/nsTextEditRules.cpp index dbedaf32c641..2fafb2cf3bd1 100644 --- a/editor/libeditor/text/nsTextEditRules.cpp +++ b/editor/libeditor/text/nsTextEditRules.cpp @@ -1116,7 +1116,7 @@ nsTextEditRules::CreateBogusNodeIfNeeded(nsISelection *aSelection) } // Create a br. - nsCOMPtr newContent; + nsCOMPtr newContent; nsresult rv = mEditor->CreateHTMLContent(NS_LITERAL_STRING("br"), getter_AddRefs(newContent)); NS_ENSURE_SUCCESS(rv, rv);