From ce50d36a6c04d76f98c8b1ba66ea735bcb30a8b8 Mon Sep 17 00:00:00 2001 From: "kipp%netscape.com" Date: Thu, 10 Sep 1998 23:42:18 +0000 Subject: [PATCH] Fixed a bug with percent values being converted to strings git-svn-id: svn://10.0.0.236/trunk@9786 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/html/style/src/nsCSSDeclaration.cpp | 5 +++-- mozilla/content/html/style/src/nsCSSStruct.cpp | 5 +++-- mozilla/layout/html/style/src/nsCSSDeclaration.cpp | 5 +++-- mozilla/layout/style/nsCSSDeclaration.cpp | 5 +++-- mozilla/layout/style/nsCSSStruct.cpp | 5 +++-- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/mozilla/content/html/style/src/nsCSSDeclaration.cpp b/mozilla/content/html/style/src/nsCSSDeclaration.cpp index 7f5102b624f..bfa2f6cb389 100644 --- a/mozilla/content/html/style/src/nsCSSDeclaration.cpp +++ b/mozilla/content/html/style/src/nsCSSDeclaration.cpp @@ -2196,7 +2196,8 @@ static const char* RGBToCSSString(nscolor aColor) } -void ValueToString(const nsCSSValue& aValue, PRInt32 aPropID, nsString& aBuffer) +static void +ValueToString(const nsCSSValue& aValue, PRInt32 aPropID, nsString& aBuffer) { nsCSSUnit unit = aValue.GetUnit(); @@ -2236,7 +2237,7 @@ void ValueToString(const nsCSSValue& aValue, PRInt32 aPropID, nsString& aBuffer) } } else if (eCSSUnit_Percent == unit) { - aBuffer.Append(aValue.GetFloatValue() * 100.0f); + aBuffer.Append(aValue.GetPercentValue() * 100.0f); } else if (eCSSUnit_Percent < unit) { // length unit aBuffer.Append(aValue.GetFloatValue()); diff --git a/mozilla/content/html/style/src/nsCSSStruct.cpp b/mozilla/content/html/style/src/nsCSSStruct.cpp index 7f5102b624f..bfa2f6cb389 100644 --- a/mozilla/content/html/style/src/nsCSSStruct.cpp +++ b/mozilla/content/html/style/src/nsCSSStruct.cpp @@ -2196,7 +2196,8 @@ static const char* RGBToCSSString(nscolor aColor) } -void ValueToString(const nsCSSValue& aValue, PRInt32 aPropID, nsString& aBuffer) +static void +ValueToString(const nsCSSValue& aValue, PRInt32 aPropID, nsString& aBuffer) { nsCSSUnit unit = aValue.GetUnit(); @@ -2236,7 +2237,7 @@ void ValueToString(const nsCSSValue& aValue, PRInt32 aPropID, nsString& aBuffer) } } else if (eCSSUnit_Percent == unit) { - aBuffer.Append(aValue.GetFloatValue() * 100.0f); + aBuffer.Append(aValue.GetPercentValue() * 100.0f); } else if (eCSSUnit_Percent < unit) { // length unit aBuffer.Append(aValue.GetFloatValue()); diff --git a/mozilla/layout/html/style/src/nsCSSDeclaration.cpp b/mozilla/layout/html/style/src/nsCSSDeclaration.cpp index 7f5102b624f..bfa2f6cb389 100644 --- a/mozilla/layout/html/style/src/nsCSSDeclaration.cpp +++ b/mozilla/layout/html/style/src/nsCSSDeclaration.cpp @@ -2196,7 +2196,8 @@ static const char* RGBToCSSString(nscolor aColor) } -void ValueToString(const nsCSSValue& aValue, PRInt32 aPropID, nsString& aBuffer) +static void +ValueToString(const nsCSSValue& aValue, PRInt32 aPropID, nsString& aBuffer) { nsCSSUnit unit = aValue.GetUnit(); @@ -2236,7 +2237,7 @@ void ValueToString(const nsCSSValue& aValue, PRInt32 aPropID, nsString& aBuffer) } } else if (eCSSUnit_Percent == unit) { - aBuffer.Append(aValue.GetFloatValue() * 100.0f); + aBuffer.Append(aValue.GetPercentValue() * 100.0f); } else if (eCSSUnit_Percent < unit) { // length unit aBuffer.Append(aValue.GetFloatValue()); diff --git a/mozilla/layout/style/nsCSSDeclaration.cpp b/mozilla/layout/style/nsCSSDeclaration.cpp index 7f5102b624f..bfa2f6cb389 100644 --- a/mozilla/layout/style/nsCSSDeclaration.cpp +++ b/mozilla/layout/style/nsCSSDeclaration.cpp @@ -2196,7 +2196,8 @@ static const char* RGBToCSSString(nscolor aColor) } -void ValueToString(const nsCSSValue& aValue, PRInt32 aPropID, nsString& aBuffer) +static void +ValueToString(const nsCSSValue& aValue, PRInt32 aPropID, nsString& aBuffer) { nsCSSUnit unit = aValue.GetUnit(); @@ -2236,7 +2237,7 @@ void ValueToString(const nsCSSValue& aValue, PRInt32 aPropID, nsString& aBuffer) } } else if (eCSSUnit_Percent == unit) { - aBuffer.Append(aValue.GetFloatValue() * 100.0f); + aBuffer.Append(aValue.GetPercentValue() * 100.0f); } else if (eCSSUnit_Percent < unit) { // length unit aBuffer.Append(aValue.GetFloatValue()); diff --git a/mozilla/layout/style/nsCSSStruct.cpp b/mozilla/layout/style/nsCSSStruct.cpp index 7f5102b624f..bfa2f6cb389 100644 --- a/mozilla/layout/style/nsCSSStruct.cpp +++ b/mozilla/layout/style/nsCSSStruct.cpp @@ -2196,7 +2196,8 @@ static const char* RGBToCSSString(nscolor aColor) } -void ValueToString(const nsCSSValue& aValue, PRInt32 aPropID, nsString& aBuffer) +static void +ValueToString(const nsCSSValue& aValue, PRInt32 aPropID, nsString& aBuffer) { nsCSSUnit unit = aValue.GetUnit(); @@ -2236,7 +2237,7 @@ void ValueToString(const nsCSSValue& aValue, PRInt32 aPropID, nsString& aBuffer) } } else if (eCSSUnit_Percent == unit) { - aBuffer.Append(aValue.GetFloatValue() * 100.0f); + aBuffer.Append(aValue.GetPercentValue() * 100.0f); } else if (eCSSUnit_Percent < unit) { // length unit aBuffer.Append(aValue.GetFloatValue());