Bug 1003894 Followup to switch from Text to nsIContent so that we can safely use do_QueryInterface r=ehsan

This commit is contained in:
Neil Rashbrook 2014-05-10 21:16:03 +01:00
parent c0b231792a
commit 8d54e5cbb7
4 changed files with 15 additions and 15 deletions

View File

@ -2444,7 +2444,7 @@ nsEditor::InsertTextImpl(const nsAString& aStringToInsert,
nsresult nsEditor::InsertTextIntoTextNodeImpl(const nsAString& aStringToInsert,
Text* aTextNode,
nsINode* aTextNode,
int32_t aOffset,
bool aSuppressIME)
{

View File

@ -198,7 +198,7 @@ public:
int32_t *aInOutOffset,
nsIDOMDocument *aDoc);
nsresult InsertTextIntoTextNodeImpl(const nsAString& aStringToInsert,
mozilla::dom::Text* aTextNode,
nsINode* aTextNode,
int32_t aOffset,
bool aSuppressIME = false);
nsresult InsertTextIntoTextNodeImpl(const nsAString& aStringToInsert,

View File

@ -439,7 +439,7 @@ nsWSRunObject::DeleteWSBackward()
// Caller's job to ensure that previous char is really ws. If it is normal
// ws, we need to delete the whole run.
if (nsCRT::IsAsciiSpace(point.mChar)) {
nsCOMPtr<Text> startNodeText, endNodeText;
nsCOMPtr<nsIContent> startNodeText, endNodeText;
int32_t startOffset, endOffset;
GetAsciiWSBounds(eBoth, point.mTextNode, point.mOffset + 1,
getter_AddRefs(startNodeText), &startOffset,
@ -1495,7 +1495,7 @@ nsWSRunObject::GetCharAfter(nsIDOMNode *aNode, int32_t aOffset)
{
MOZ_ASSERT(aNode);
nsCOMPtr<nsINode> node(do_QueryInterface(aNode));
nsCOMPtr<nsIContent> node(do_QueryInterface(aNode));
int32_t idx = mNodeArray.IndexOf(node);
if (idx == -1)
{
@ -1515,7 +1515,7 @@ nsWSRunObject::GetCharBefore(nsIDOMNode *aNode, int32_t aOffset)
{
MOZ_ASSERT(aNode);
nsCOMPtr<nsINode> node(do_QueryInterface(aNode));
nsCOMPtr<nsIContent> node(do_QueryInterface(aNode));
int32_t idx = mNodeArray.IndexOf(node);
if (idx == -1)
{
@ -1648,15 +1648,15 @@ nsWSRunObject::ConvertToNBSP(WSPoint aPoint, AreaRestriction aAR)
void
nsWSRunObject::GetAsciiWSBounds(int16_t aDir, nsINode* aNode, int32_t aOffset,
Text** outStartNode, int32_t* outStartOffset,
Text** outEndNode, int32_t* outEndOffset)
nsIContent** outStartNode, int32_t* outStartOffset,
nsIContent** outEndNode, int32_t* outEndOffset)
{
nsCOMPtr<nsIDOMNode> outStartDOMNode, outEndDOMNode;
GetAsciiWSBounds(aDir, GetAsDOMNode(aNode), aOffset,
address_of(outStartDOMNode), outStartOffset,
address_of(outEndDOMNode), outEndOffset);
nsCOMPtr<Text> start(do_QueryInterface(outStartDOMNode));
nsCOMPtr<Text> end(do_QueryInterface(outEndDOMNode));
nsCOMPtr<nsIContent> start(do_QueryInterface(outStartDOMNode));
nsCOMPtr<nsIContent> end(do_QueryInterface(outEndDOMNode));
start.forget(outStartNode);
end.forget(outEndNode);
}
@ -2001,7 +2001,7 @@ nsWSRunObject::CheckTrailingNBSPOfRun(WSFragment *aRun)
// editor softwraps at this point, the spaces won't be split across lines,
// which looks ugly and is bad for the moose.
nsCOMPtr<Text> startNode, endNode;
nsCOMPtr<nsIContent> startNode, endNode;
int32_t startOffset, endOffset;
GetAsciiWSBounds(eBoth, prevPoint.mTextNode, prevPoint.mOffset + 1,
getter_AddRefs(startNode), &startOffset,

View File

@ -295,13 +295,13 @@ class MOZ_STACK_CLASS nsWSRunObject
// stored in the struct.
struct MOZ_STACK_CLASS WSPoint
{
nsCOMPtr<mozilla::dom::Text> mTextNode;
nsCOMPtr<nsIContent> mTextNode;
uint32_t mOffset;
char16_t mChar;
WSPoint() : mTextNode(0),mOffset(0),mChar(0) {}
WSPoint(nsINode* aNode, int32_t aOffset, char16_t aChar) :
mTextNode(do_QueryInterface(aNode)),mOffset(aOffset),mChar(aChar)
WSPoint(nsIContent* aNode, int32_t aOffset, char16_t aChar) :
mTextNode(aNode),mOffset(aOffset),mChar(aChar)
{
MOZ_ASSERT(mTextNode->IsNodeOfType(nsINode::eTEXT));
}
@ -348,9 +348,9 @@ class MOZ_STACK_CLASS nsWSRunObject
nsresult ConvertToNBSP(WSPoint aPoint,
AreaRestriction aAR = eAnywhere);
void GetAsciiWSBounds(int16_t aDir, nsINode* aNode, int32_t aOffset,
mozilla::dom::Text** outStartNode,
nsIContent** outStartNode,
int32_t* outStartOffset,
mozilla::dom::Text** outEndNode,
nsIContent** outEndNode,
int32_t* outEndOffset);
void GetAsciiWSBounds(int16_t aDir, nsIDOMNode *aNode, int32_t aOffset,
nsCOMPtr<nsIDOMNode> *outStartNode, int32_t *outStartOffset,