deCOMtaminate nsIDocument by changing methods to use return value instead of out-params, eliminating unused nsresult return values, moving some members to nsIDocument and inlining the getters/setters. Bug 222134, r=bzbarsky, sr=jst.

This commit is contained in:
bryner%brianryner.com 2006-05-17 02:38:19 +00:00
Родитель 2d063297b7
Коммит 47d0b5b667
3 изменённых файлов: 5 добавлений и 15 удалений

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

@ -106,13 +106,10 @@ inCSSValueSearch::SearchSync()
nsCOMPtr<nsIDocument> doc = do_QueryInterface(mDocument);
if (doc) {
PRInt32 count = 0;
// we want all the sheets, including inline style and such
doc->GetNumberOfStyleSheets(PR_TRUE, &count);
PRInt32 count = doc->GetNumberOfStyleSheets(PR_TRUE);
for (PRInt32 i = 0; i < count; i++) {
nsCOMPtr<nsIStyleSheet> sheet;
doc->GetStyleSheetAt(i, PR_TRUE, getter_AddRefs(sheet));
SearchStyleSheet(sheet);
SearchStyleSheet(doc->GetStyleSheetAt(i, PR_TRUE));
}
}

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

@ -219,8 +219,7 @@ inDOMUtils::GetBindingURLs(nsIDOMElement *aElement, nsISimpleEnumerator **_retva
if (!doc1) return NS_OK;
nsCOMPtr<nsIDocument> doc = do_QueryInterface(doc1);
nsCOMPtr<nsIBindingManager> bindingManager;
doc->GetBindingManager(getter_AddRefs(bindingManager));
nsIBindingManager *bindingManager = doc->GetBindingManager();
if (!bindingManager) return NS_OK;
nsCOMPtr<nsIContent> content = do_QueryInterface(aElement);

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

@ -236,10 +236,7 @@ inLayoutUtils::GetBindingManagerFor(nsIDOMNode* aNode)
aNode->GetOwnerDocument(getter_AddRefs(domdoc));
if (domdoc) {
nsCOMPtr<nsIDocument> doc = do_QueryInterface(domdoc);
nsCOMPtr<nsIBindingManager> bindingManager = do_QueryInterface(domdoc);
doc->GetBindingManager(getter_AddRefs(bindingManager));
return bindingManager;
return doc->GetBindingManager();
}
return nsnull;
@ -252,10 +249,7 @@ inLayoutUtils::GetSubDocumentFor(nsIDOMNode* aNode)
if (content) {
nsCOMPtr<nsIDocument> doc = content->GetDocument();
if (doc) {
nsCOMPtr<nsIDocument> sub_doc;
doc->GetSubDocumentFor(content, getter_AddRefs(sub_doc));
nsCOMPtr<nsIDOMDocument> domdoc(do_QueryInterface(sub_doc));
nsCOMPtr<nsIDOMDocument> domdoc(do_QueryInterface(doc->GetSubDocumentFor(content)));
return domdoc;
}