Skip to content

Commit

Permalink
bug 794038 pt 0 - use the existing #defines for XUL window attribute …
Browse files Browse the repository at this point in the history
…names instead of repeating NS_LITERAL_STRING. r=roc
  • Loading branch information
jfkthame committed Oct 16, 2012
1 parent 605fd8c commit 49b40a7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions xpfe/appshell/src/nsXULWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1022,15 +1022,15 @@ bool nsXULWindow::LoadPositionFromXUL()
nsAutoString posString;
int32_t appPerDev = AppUnitsPerDevPixel();

rv = windowElement->GetAttribute(NS_LITERAL_STRING("screenX"), posString);
rv = windowElement->GetAttribute(SCREENX_ATTRIBUTE, posString);
if (NS_SUCCEEDED(rv)) {
temp = posString.ToInteger(&errorCode);
if (NS_SUCCEEDED(errorCode)) {
specX = CSSToDevPixels(temp, appPerDev);
gotPosition = true;
}
}
rv = windowElement->GetAttribute(NS_LITERAL_STRING("screenY"), posString);
rv = windowElement->GetAttribute(SCREENY_ATTRIBUTE, posString);
if (NS_SUCCEEDED(rv)) {
temp = posString.ToInteger(&errorCode);
if (NS_SUCCEEDED(errorCode)) {
Expand Down Expand Up @@ -1086,15 +1086,15 @@ bool nsXULWindow::LoadSizeFromXUL()
nsAutoString sizeString;
int32_t appPerDev = AppUnitsPerDevPixel();

rv = windowElement->GetAttribute(NS_LITERAL_STRING("width"), sizeString);
rv = windowElement->GetAttribute(WIDTH_ATTRIBUTE, sizeString);
if (NS_SUCCEEDED(rv)) {
temp = sizeString.ToInteger(&errorCode);
if (NS_SUCCEEDED(errorCode) && temp > 0) {
specWidth = CSSToDevPixels(NS_MAX(temp, 100), appPerDev);
gotSize = true;
}
}
rv = windowElement->GetAttribute(NS_LITERAL_STRING("height"), sizeString);
rv = windowElement->GetAttribute(HEIGHT_ATTRIBUTE, sizeString);
if (NS_SUCCEEDED(rv)) {
temp = sizeString.ToInteger(&errorCode);
if (NS_SUCCEEDED(errorCode) && temp > 0) {
Expand Down Expand Up @@ -1154,7 +1154,7 @@ bool nsXULWindow::LoadMiscPersistentAttributesFromXUL()
nsAutoString stateString;

// sizemode
rv = windowElement->GetAttribute(NS_LITERAL_STRING("sizemode"), stateString);
rv = windowElement->GetAttribute(MODE_ATTRIBUTE, stateString);
if (NS_SUCCEEDED(rv)) {
int32_t sizeMode = nsSizeMode_Normal;
/* ignore request to minimize, to not confuse novices
Expand Down Expand Up @@ -1202,7 +1202,7 @@ bool nsXULWindow::LoadMiscPersistentAttributesFromXUL()
}

// zlevel
rv = windowElement->GetAttribute(NS_LITERAL_STRING("zlevel"), stateString);
rv = windowElement->GetAttribute(ZLEVEL_ATTRIBUTE, stateString);
if (NS_SUCCEEDED(rv) && stateString.Length() > 0) {
nsresult errorCode;
uint32_t zLevel = stateString.ToInteger(&errorCode);
Expand Down Expand Up @@ -1365,7 +1365,7 @@ void nsXULWindow::SyncAttributesToWidget()
}

// "windowtype" attribute
rv = windowElement->GetAttribute(NS_LITERAL_STRING("windowtype"), attr);
rv = windowElement->GetAttribute(WINDOWTYPE_ATTRIBUTE, attr);
if (NS_SUCCEEDED(rv) && !attr.IsEmpty()) {
mWindow->SetWindowClass(attr);
}
Expand Down

0 comments on commit 49b40a7

Please sign in to comment.