Misc fixes for pedantic build warnings.

r=jfrancis@netscape.com a=sfraser@netscape.com
This commit is contained in:
kin%netscape.com 2000-11-29 22:06:02 +00:00
Родитель f3f07257d5
Коммит 2f644b83f5
10 изменённых файлов: 34 добавлений и 32 удалений

Просмотреть файл

@ -87,7 +87,7 @@ NS_IMETHODIMP InsertElementTxn::Do(void)
{
PRUint32 count;
childNodes->GetLength(&count);
if (mOffset>count) mOffset = count;
if (mOffset>(PRInt32)count) mOffset = count;
result = childNodes->Item(mOffset, getter_AddRefs(refNode));
if (NS_FAILED(result)) return result;
// note, it's ok for mRefNode to be null. that means append

Просмотреть файл

@ -899,6 +899,8 @@ nsEditor::nsEditor()
, mRangeUpdater()
, mShouldTxnSetSelection(PR_TRUE)
, mBodyElement(nsnull)
, mAction(nsnull)
, mDirection(eNone)
, mInIMEMode(PR_FALSE)
, mIMETextRangeList(nsnull)
, mIMETextNode(nsnull)
@ -908,8 +910,6 @@ nsEditor::nsEditor()
, mEditorObservers(nsnull)
, mDocDirtyState(-1)
, mDocWeak(nsnull)
, mAction(nsnull)
, mDirection(eNone)
{
//initialize member variables here
NS_INIT_REFCNT();

Просмотреть файл

@ -5175,6 +5175,9 @@ nsEditorShell::OnEndDocumentLoad(nsIDocumentLoader* aLoader, nsIChannel* aChanne
case eCantEditOther:
stringID.AssignWithConversion("CantEditDocumentMsg");
break;
default:
// Do nothing.
break;
}
GetBundleString(stringID, alertMessage);

Просмотреть файл

@ -621,7 +621,7 @@ nsHTMLEditRules::GetAlignment(PRBool &aMixed, nsIHTMLEditor::EAlignment &aAlign)
{
nsAutoString typeAttrName; typeAttrName.AssignWithConversion("align");
nsAutoString typeAttrVal;
nsresult res = elem->GetAttribute(typeAttrName, typeAttrVal);
res = elem->GetAttribute(typeAttrName, typeAttrVal);
typeAttrVal.ToLowerCase();
if (NS_SUCCEEDED(res) && typeAttrVal.Length())
{
@ -705,7 +705,7 @@ nsHTMLEditRules::GetParagraphState(PRBool &aMixed, nsString &outFormat)
nsCOMPtr<nsIDOMNode> selNode;
PRInt32 selOffset;
nsCOMPtr<nsISelection>selection;
nsresult res = mEditor->GetSelection(getter_AddRefs(selection));
res = mEditor->GetSelection(getter_AddRefs(selection));
if (NS_FAILED(res)) return res;
res = mEditor->GetStartNodeAndOffset(selection, &selNode, &selOffset);
if (NS_FAILED(res)) return res;
@ -1108,8 +1108,6 @@ nsHTMLEditRules::WillInsertBreak(nsISelection *aSelection, PRBool *aCancel, PRBo
// its something else (body, div, td, ...): insert a normal br
else
{
nsCOMPtr<nsISelection> selection(aSelection);
nsCOMPtr<nsISelectionPrivate> selPriv(do_QueryInterface(selection));
nsCOMPtr<nsIDOMNode> brNode;
res = mEditor->CreateBR(node, offset, &brNode);
if (NS_FAILED(res)) return res;
@ -3445,7 +3443,7 @@ nsHTMLEditRules::GetNodesForOperation(nsISupportsArray *inArrayOfRanges,
res = item->GetRange(&opRange);
if (NS_FAILED(res)) return res;
delete item;
nsCOMPtr<nsISupports> isupports = do_QueryInterface(opRange);
isupports = do_QueryInterface(opRange);
inArrayOfRanges->AppendElement(isupports);
}
}
@ -3472,7 +3470,7 @@ nsHTMLEditRules::GetNodesForOperation(nsISupportsArray *inArrayOfRanges,
(*outArrayOfNodes)->Count(&listCount);
for (i=(PRInt32)listCount-1; i>=0; i--)
{
nsCOMPtr<nsISupports> isupports = (dont_AddRef)((*outArrayOfNodes)->ElementAt(i));
isupports = (dont_AddRef)((*outArrayOfNodes)->ElementAt(i));
nsCOMPtr<nsIDOMNode> node( do_QueryInterface(isupports) );
if ( (nsHTMLEditUtils::IsTableElement(node) && !nsHTMLEditUtils::IsTable(node))
|| (nsHTMLEditUtils::IsListItem(node)))
@ -3492,7 +3490,7 @@ nsHTMLEditRules::GetNodesForOperation(nsISupportsArray *inArrayOfRanges,
(*outArrayOfNodes)->Count(&listCount);
for (i=(PRInt32)listCount-1; i>=0; i--)
{
nsCOMPtr<nsISupports> isupports = (dont_AddRef)((*outArrayOfNodes)->ElementAt(i));
isupports = (dont_AddRef)((*outArrayOfNodes)->ElementAt(i));
nsCOMPtr<nsIDOMNode> node( do_QueryInterface(isupports) );
if ( (nsHTMLEditUtils::IsTableElement(node) && !nsHTMLEditUtils::IsTable(node)) )
{
@ -3516,7 +3514,7 @@ nsHTMLEditRules::GetNodesForOperation(nsISupportsArray *inArrayOfRanges,
(*outArrayOfNodes)->Count(&listCount);
for (i=(PRInt32)listCount-1; i>=0; i--)
{
nsCOMPtr<nsISupports> isupports = (dont_AddRef)((*outArrayOfNodes)->ElementAt(i));
isupports = (dont_AddRef)((*outArrayOfNodes)->ElementAt(i));
nsCOMPtr<nsIDOMNode> node( do_QueryInterface(isupports) );
if (!aDontTouchContent && mEditor->IsInlineNode(node)
&& mEditor->IsContainer(node) && !mEditor->IsTextNode(node))
@ -4324,12 +4322,12 @@ nsHTMLEditRules::MakeBlockquote(nsISupportsArray *arrayOfNodes)
// further nodes in a new parent
if (prevParent)
{
nsCOMPtr<nsIDOMNode> curParent;
curNode->GetParentNode(getter_AddRefs(curParent));
if (curParent != prevParent)
nsCOMPtr<nsIDOMNode> temp;
curNode->GetParentNode(getter_AddRefs(temp));
if (temp != prevParent)
{
curBlock = 0; // forget any previous blockquote node we were using
prevParent = curParent;
prevParent = temp;
}
}
else

Просмотреть файл

@ -6190,7 +6190,7 @@ NS_IMETHODIMP nsHTMLEditor::OutputToString(nsAWritableString& aOutputString,
nsCOMPtr<nsIDocumentEncoder> encoder;
nsCAutoString formatType(NS_DOC_ENCODER_CONTRACTID_BASE);
formatType.AppendWithConversion(aFormatType);
rv = nsComponentManager::CreateInstance(formatType,
rv = nsComponentManager::CreateInstance((char*)formatType,
nsnull,
NS_GET_IID(nsIDocumentEncoder),
getter_AddRefs(encoder));

Просмотреть файл

@ -5175,6 +5175,9 @@ nsEditorShell::OnEndDocumentLoad(nsIDocumentLoader* aLoader, nsIChannel* aChanne
case eCantEditOther:
stringID.AssignWithConversion("CantEditDocumentMsg");
break;
default:
// Do nothing.
break;
}
GetBundleString(stringID, alertMessage);

Просмотреть файл

@ -87,7 +87,7 @@ NS_IMETHODIMP InsertElementTxn::Do(void)
{
PRUint32 count;
childNodes->GetLength(&count);
if (mOffset>count) mOffset = count;
if (mOffset>(PRInt32)count) mOffset = count;
result = childNodes->Item(mOffset, getter_AddRefs(refNode));
if (NS_FAILED(result)) return result;
// note, it's ok for mRefNode to be null. that means append

Просмотреть файл

@ -899,6 +899,8 @@ nsEditor::nsEditor()
, mRangeUpdater()
, mShouldTxnSetSelection(PR_TRUE)
, mBodyElement(nsnull)
, mAction(nsnull)
, mDirection(eNone)
, mInIMEMode(PR_FALSE)
, mIMETextRangeList(nsnull)
, mIMETextNode(nsnull)
@ -908,8 +910,6 @@ nsEditor::nsEditor()
, mEditorObservers(nsnull)
, mDocDirtyState(-1)
, mDocWeak(nsnull)
, mAction(nsnull)
, mDirection(eNone)
{
//initialize member variables here
NS_INIT_REFCNT();

Просмотреть файл

@ -621,7 +621,7 @@ nsHTMLEditRules::GetAlignment(PRBool &aMixed, nsIHTMLEditor::EAlignment &aAlign)
{
nsAutoString typeAttrName; typeAttrName.AssignWithConversion("align");
nsAutoString typeAttrVal;
nsresult res = elem->GetAttribute(typeAttrName, typeAttrVal);
res = elem->GetAttribute(typeAttrName, typeAttrVal);
typeAttrVal.ToLowerCase();
if (NS_SUCCEEDED(res) && typeAttrVal.Length())
{
@ -705,7 +705,7 @@ nsHTMLEditRules::GetParagraphState(PRBool &aMixed, nsString &outFormat)
nsCOMPtr<nsIDOMNode> selNode;
PRInt32 selOffset;
nsCOMPtr<nsISelection>selection;
nsresult res = mEditor->GetSelection(getter_AddRefs(selection));
res = mEditor->GetSelection(getter_AddRefs(selection));
if (NS_FAILED(res)) return res;
res = mEditor->GetStartNodeAndOffset(selection, &selNode, &selOffset);
if (NS_FAILED(res)) return res;
@ -1108,8 +1108,6 @@ nsHTMLEditRules::WillInsertBreak(nsISelection *aSelection, PRBool *aCancel, PRBo
// its something else (body, div, td, ...): insert a normal br
else
{
nsCOMPtr<nsISelection> selection(aSelection);
nsCOMPtr<nsISelectionPrivate> selPriv(do_QueryInterface(selection));
nsCOMPtr<nsIDOMNode> brNode;
res = mEditor->CreateBR(node, offset, &brNode);
if (NS_FAILED(res)) return res;
@ -3445,7 +3443,7 @@ nsHTMLEditRules::GetNodesForOperation(nsISupportsArray *inArrayOfRanges,
res = item->GetRange(&opRange);
if (NS_FAILED(res)) return res;
delete item;
nsCOMPtr<nsISupports> isupports = do_QueryInterface(opRange);
isupports = do_QueryInterface(opRange);
inArrayOfRanges->AppendElement(isupports);
}
}
@ -3472,7 +3470,7 @@ nsHTMLEditRules::GetNodesForOperation(nsISupportsArray *inArrayOfRanges,
(*outArrayOfNodes)->Count(&listCount);
for (i=(PRInt32)listCount-1; i>=0; i--)
{
nsCOMPtr<nsISupports> isupports = (dont_AddRef)((*outArrayOfNodes)->ElementAt(i));
isupports = (dont_AddRef)((*outArrayOfNodes)->ElementAt(i));
nsCOMPtr<nsIDOMNode> node( do_QueryInterface(isupports) );
if ( (nsHTMLEditUtils::IsTableElement(node) && !nsHTMLEditUtils::IsTable(node))
|| (nsHTMLEditUtils::IsListItem(node)))
@ -3492,7 +3490,7 @@ nsHTMLEditRules::GetNodesForOperation(nsISupportsArray *inArrayOfRanges,
(*outArrayOfNodes)->Count(&listCount);
for (i=(PRInt32)listCount-1; i>=0; i--)
{
nsCOMPtr<nsISupports> isupports = (dont_AddRef)((*outArrayOfNodes)->ElementAt(i));
isupports = (dont_AddRef)((*outArrayOfNodes)->ElementAt(i));
nsCOMPtr<nsIDOMNode> node( do_QueryInterface(isupports) );
if ( (nsHTMLEditUtils::IsTableElement(node) && !nsHTMLEditUtils::IsTable(node)) )
{
@ -3516,7 +3514,7 @@ nsHTMLEditRules::GetNodesForOperation(nsISupportsArray *inArrayOfRanges,
(*outArrayOfNodes)->Count(&listCount);
for (i=(PRInt32)listCount-1; i>=0; i--)
{
nsCOMPtr<nsISupports> isupports = (dont_AddRef)((*outArrayOfNodes)->ElementAt(i));
isupports = (dont_AddRef)((*outArrayOfNodes)->ElementAt(i));
nsCOMPtr<nsIDOMNode> node( do_QueryInterface(isupports) );
if (!aDontTouchContent && mEditor->IsInlineNode(node)
&& mEditor->IsContainer(node) && !mEditor->IsTextNode(node))
@ -4324,12 +4322,12 @@ nsHTMLEditRules::MakeBlockquote(nsISupportsArray *arrayOfNodes)
// further nodes in a new parent
if (prevParent)
{
nsCOMPtr<nsIDOMNode> curParent;
curNode->GetParentNode(getter_AddRefs(curParent));
if (curParent != prevParent)
nsCOMPtr<nsIDOMNode> temp;
curNode->GetParentNode(getter_AddRefs(temp));
if (temp != prevParent)
{
curBlock = 0; // forget any previous blockquote node we were using
prevParent = curParent;
prevParent = temp;
}
}
else

Просмотреть файл

@ -6190,7 +6190,7 @@ NS_IMETHODIMP nsHTMLEditor::OutputToString(nsAWritableString& aOutputString,
nsCOMPtr<nsIDocumentEncoder> encoder;
nsCAutoString formatType(NS_DOC_ENCODER_CONTRACTID_BASE);
formatType.AppendWithConversion(aFormatType);
rv = nsComponentManager::CreateInstance(formatType,
rv = nsComponentManager::CreateInstance((char*)formatType,
nsnull,
NS_GET_IID(nsIDocumentEncoder),
getter_AddRefs(encoder));