mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 05:10:49 +00:00
change color name lookup api to use nsString
This commit is contained in:
parent
023143a55b
commit
b76f16233c
@ -828,12 +828,9 @@ NS_IMETHODIMP nsRenderingContextOS2::GetColor( nsString &aColor)
|
||||
NS_IMETHODIMP nsRenderingContextOS2::SetColor(const nsString& aColor)
|
||||
{
|
||||
nscolor rgb;
|
||||
char cbuf[40];
|
||||
|
||||
aColor.ToCString( cbuf, sizeof(cbuf));
|
||||
if( NS_ColorNameToRGB( cbuf, &rgb))
|
||||
if( NS_ColorNameToRGB(aColor, &rgb))
|
||||
SetColor(rgb);
|
||||
else if( NS_HexToRGB( cbuf, &rgb))
|
||||
else if( NS_HexToRGB(aColor, &rgb))
|
||||
SetColor(rgb);
|
||||
|
||||
return NS_OK;
|
||||
|
@ -1328,12 +1328,10 @@ NS_IMETHODIMP
|
||||
nsRenderingContextPS::SetColor(const nsString& aColor)
|
||||
{
|
||||
nscolor rgb;
|
||||
char cbuf[40];
|
||||
aColor.ToCString(cbuf, sizeof(cbuf));
|
||||
if (NS_ColorNameToRGB(cbuf, &rgb)) {
|
||||
if (NS_ColorNameToRGB(aColor, &rgb)) {
|
||||
SetColor(rgb);
|
||||
}
|
||||
else if (NS_HexToRGB(cbuf, &rgb)) {
|
||||
else if (NS_HexToRGB(aColor, &rgb)) {
|
||||
SetColor(rgb);
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -1990,12 +1990,10 @@ NS_IMETHODIMP
|
||||
nsRenderingContextWin::SetColor(const nsString& aColor)
|
||||
{
|
||||
nscolor rgb;
|
||||
char cbuf[40];
|
||||
aColor.ToCString(cbuf, sizeof(cbuf));
|
||||
if (NS_ColorNameToRGB(cbuf, &rgb)) {
|
||||
if (NS_ColorNameToRGB(aColor, &rgb)) {
|
||||
SetColor(rgb);
|
||||
}
|
||||
else if (NS_HexToRGB(cbuf, &rgb)) {
|
||||
else if (NS_HexToRGB(aColor, &rgb)) {
|
||||
SetColor(rgb);
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -570,12 +570,10 @@ NS_IMETHODIMP
|
||||
nsRenderingContextXlib::SetColor(const nsString &aColor)
|
||||
{
|
||||
nscolor rgb;
|
||||
char cbuf[40];
|
||||
aColor.ToCString(cbuf, sizeof(cbuf));
|
||||
if (NS_ColorNameToRGB(cbuf, &rgb)) {
|
||||
if (NS_ColorNameToRGB(aColor, &rgb)) {
|
||||
SetColor(rgb);
|
||||
}
|
||||
else if (NS_HexToRGB(cbuf, &rgb)) {
|
||||
else if (NS_HexToRGB(aColor, &rgb)) {
|
||||
SetColor(rgb);
|
||||
}
|
||||
return NS_OK;
|
||||
|
Loading…
x
Reference in New Issue
Block a user