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.
git-svn-id: svn://10.0.0.236/trunk@148257 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -648,16 +648,14 @@ void StyleSetImpl::AddDocStyleSheet(nsIStyleSheet* aSheet, nsIDocument* aDocumen
|
||||
if (EnsureArray(mDocSheets)) {
|
||||
mDocSheets->RemoveElement(aSheet);
|
||||
// lowest index last
|
||||
PRInt32 newDocIndex = 0;
|
||||
aDocument->GetIndexOfStyleSheet(aSheet, &newDocIndex);
|
||||
PRInt32 newDocIndex = aDocument->GetIndexOfStyleSheet(aSheet);
|
||||
PRUint32 count;
|
||||
nsresult rv = mDocSheets->Count(&count);
|
||||
if (NS_FAILED(rv)) return; // XXX error?
|
||||
PRUint32 index;
|
||||
for (index = 0; index < count; index++) {
|
||||
nsIStyleSheet* sheet = (nsIStyleSheet*)mDocSheets->ElementAt(index);
|
||||
PRInt32 sheetDocIndex = 0;
|
||||
aDocument->GetIndexOfStyleSheet(sheet, &sheetDocIndex);
|
||||
PRInt32 sheetDocIndex = aDocument->GetIndexOfStyleSheet(sheet);
|
||||
if (sheetDocIndex < newDocIndex) {
|
||||
mDocSheets->InsertElementAt(aSheet, index);
|
||||
index = count; // break loop
|
||||
|
||||
Reference in New Issue
Block a user