From 62cd20de05e2542c485b30e45cd79968b35e90e9 Mon Sep 17 00:00:00 2001 From: "peterl%netscape.com" Date: Tue, 12 Oct 1999 01:31:33 +0000 Subject: [PATCH] store system colors as int rather than enums return proper result code when setting system color r=rods --- content/html/style/src/nsCSSParser.cpp | 2 +- content/html/style/src/nsCSSStyleRule.cpp | 6 ++++-- layout/html/style/src/nsCSSParser.cpp | 2 +- layout/html/style/src/nsCSSStyleRule.cpp | 6 ++++-- layout/style/nsCSSParser.cpp | 2 +- layout/style/nsCSSStyleRule.cpp | 6 ++++-- 6 files changed, 15 insertions(+), 9 deletions(-) diff --git a/content/html/style/src/nsCSSParser.cpp b/content/html/style/src/nsCSSParser.cpp index edd7a2ec46b..68d1041b2d3 100644 --- a/content/html/style/src/nsCSSParser.cpp +++ b/content/html/style/src/nsCSSParser.cpp @@ -1844,7 +1844,7 @@ PRBool CSSParserImpl::ParseColor(PRInt32& aErrorCode, nsCSSValue& aValue) if (eCSSKeyword_UNKNOWN < keyword) { // known keyword PRInt32 index = SearchKeywordTable(keyword, nsCSSProps::kColorKTable); if (0 < index) { - aValue.SetIntValue(nsCSSProps::kColorKTable[index], eCSSUnit_Enumerated); + aValue.SetIntValue(nsCSSProps::kColorKTable[index], eCSSUnit_Integer); return PR_TRUE; } } diff --git a/content/html/style/src/nsCSSStyleRule.cpp b/content/html/style/src/nsCSSStyleRule.cpp index 3f7d329117e..ee743a1c542 100644 --- a/content/html/style/src/nsCSSStyleRule.cpp +++ b/content/html/style/src/nsCSSStyleRule.cpp @@ -1178,11 +1178,13 @@ static PRBool SetColor(const nsCSSValue& aValue, const nscolor aParentColor, result = PR_TRUE; } } - else if (eCSSUnit_Enumerated == unit) { + else if (eCSSUnit_Integer == unit) { nsILookAndFeel* look = nsnull; if (NS_SUCCEEDED(aPresContext->GetLookAndFeel(&look)) && look) { nsILookAndFeel::nsColorID colorID = (nsILookAndFeel::nsColorID)aValue.GetIntValue(); - look->GetColor(colorID, aResult); + if (NS_SUCCEEDED(look->GetColor(colorID, aResult))) { + result = PR_TRUE; + } NS_RELEASE(look); } } diff --git a/layout/html/style/src/nsCSSParser.cpp b/layout/html/style/src/nsCSSParser.cpp index edd7a2ec46b..68d1041b2d3 100644 --- a/layout/html/style/src/nsCSSParser.cpp +++ b/layout/html/style/src/nsCSSParser.cpp @@ -1844,7 +1844,7 @@ PRBool CSSParserImpl::ParseColor(PRInt32& aErrorCode, nsCSSValue& aValue) if (eCSSKeyword_UNKNOWN < keyword) { // known keyword PRInt32 index = SearchKeywordTable(keyword, nsCSSProps::kColorKTable); if (0 < index) { - aValue.SetIntValue(nsCSSProps::kColorKTable[index], eCSSUnit_Enumerated); + aValue.SetIntValue(nsCSSProps::kColorKTable[index], eCSSUnit_Integer); return PR_TRUE; } } diff --git a/layout/html/style/src/nsCSSStyleRule.cpp b/layout/html/style/src/nsCSSStyleRule.cpp index 3f7d329117e..ee743a1c542 100644 --- a/layout/html/style/src/nsCSSStyleRule.cpp +++ b/layout/html/style/src/nsCSSStyleRule.cpp @@ -1178,11 +1178,13 @@ static PRBool SetColor(const nsCSSValue& aValue, const nscolor aParentColor, result = PR_TRUE; } } - else if (eCSSUnit_Enumerated == unit) { + else if (eCSSUnit_Integer == unit) { nsILookAndFeel* look = nsnull; if (NS_SUCCEEDED(aPresContext->GetLookAndFeel(&look)) && look) { nsILookAndFeel::nsColorID colorID = (nsILookAndFeel::nsColorID)aValue.GetIntValue(); - look->GetColor(colorID, aResult); + if (NS_SUCCEEDED(look->GetColor(colorID, aResult))) { + result = PR_TRUE; + } NS_RELEASE(look); } } diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp index edd7a2ec46b..68d1041b2d3 100644 --- a/layout/style/nsCSSParser.cpp +++ b/layout/style/nsCSSParser.cpp @@ -1844,7 +1844,7 @@ PRBool CSSParserImpl::ParseColor(PRInt32& aErrorCode, nsCSSValue& aValue) if (eCSSKeyword_UNKNOWN < keyword) { // known keyword PRInt32 index = SearchKeywordTable(keyword, nsCSSProps::kColorKTable); if (0 < index) { - aValue.SetIntValue(nsCSSProps::kColorKTable[index], eCSSUnit_Enumerated); + aValue.SetIntValue(nsCSSProps::kColorKTable[index], eCSSUnit_Integer); return PR_TRUE; } } diff --git a/layout/style/nsCSSStyleRule.cpp b/layout/style/nsCSSStyleRule.cpp index 3f7d329117e..ee743a1c542 100644 --- a/layout/style/nsCSSStyleRule.cpp +++ b/layout/style/nsCSSStyleRule.cpp @@ -1178,11 +1178,13 @@ static PRBool SetColor(const nsCSSValue& aValue, const nscolor aParentColor, result = PR_TRUE; } } - else if (eCSSUnit_Enumerated == unit) { + else if (eCSSUnit_Integer == unit) { nsILookAndFeel* look = nsnull; if (NS_SUCCEEDED(aPresContext->GetLookAndFeel(&look)) && look) { nsILookAndFeel::nsColorID colorID = (nsILookAndFeel::nsColorID)aValue.GetIntValue(); - look->GetColor(colorID, aResult); + if (NS_SUCCEEDED(look->GetColor(colorID, aResult))) { + result = PR_TRUE; + } NS_RELEASE(look); } }