зеркало из https://github.com/mozilla/pjs.git
Bug 12599: Accept string as integer attribute to prevent assert, fix courtesy rickg r=self and harishd
This commit is contained in:
Родитель
21be882f53
Коммит
2f27c49438
|
@ -92,7 +92,8 @@ protected:
|
|||
|
||||
inline PRInt32 nsHTMLValue::GetIntValue(void) const
|
||||
{
|
||||
NS_ASSERTION((mUnit == eHTMLUnit_Integer) ||
|
||||
NS_ASSERTION((mUnit == eHTMLUnit_String) ||
|
||||
(mUnit == eHTMLUnit_Integer) ||
|
||||
(mUnit == eHTMLUnit_Enumerated) ||
|
||||
(mUnit == eHTMLUnit_Proportional), "not an int value");
|
||||
if ((mUnit == eHTMLUnit_Integer) ||
|
||||
|
@ -100,6 +101,10 @@ inline PRInt32 nsHTMLValue::GetIntValue(void) const
|
|||
(mUnit == eHTMLUnit_Proportional)) {
|
||||
return mValue.mInt;
|
||||
}
|
||||
else if (mUnit == eHTMLUnit_String) {
|
||||
PRInt32 err=0;
|
||||
return (mValue.mString) ? mValue.mString->ToInteger(&err):0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -92,7 +92,8 @@ protected:
|
|||
|
||||
inline PRInt32 nsHTMLValue::GetIntValue(void) const
|
||||
{
|
||||
NS_ASSERTION((mUnit == eHTMLUnit_Integer) ||
|
||||
NS_ASSERTION((mUnit == eHTMLUnit_String) ||
|
||||
(mUnit == eHTMLUnit_Integer) ||
|
||||
(mUnit == eHTMLUnit_Enumerated) ||
|
||||
(mUnit == eHTMLUnit_Proportional), "not an int value");
|
||||
if ((mUnit == eHTMLUnit_Integer) ||
|
||||
|
@ -100,6 +101,10 @@ inline PRInt32 nsHTMLValue::GetIntValue(void) const
|
|||
(mUnit == eHTMLUnit_Proportional)) {
|
||||
return mValue.mInt;
|
||||
}
|
||||
else if (mUnit == eHTMLUnit_String) {
|
||||
PRInt32 err=0;
|
||||
return (mValue.mString) ? mValue.mString->ToInteger(&err):0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -92,7 +92,8 @@ protected:
|
|||
|
||||
inline PRInt32 nsHTMLValue::GetIntValue(void) const
|
||||
{
|
||||
NS_ASSERTION((mUnit == eHTMLUnit_Integer) ||
|
||||
NS_ASSERTION((mUnit == eHTMLUnit_String) ||
|
||||
(mUnit == eHTMLUnit_Integer) ||
|
||||
(mUnit == eHTMLUnit_Enumerated) ||
|
||||
(mUnit == eHTMLUnit_Proportional), "not an int value");
|
||||
if ((mUnit == eHTMLUnit_Integer) ||
|
||||
|
@ -100,6 +101,10 @@ inline PRInt32 nsHTMLValue::GetIntValue(void) const
|
|||
(mUnit == eHTMLUnit_Proportional)) {
|
||||
return mValue.mInt;
|
||||
}
|
||||
else if (mUnit == eHTMLUnit_String) {
|
||||
PRInt32 err=0;
|
||||
return (mValue.mString) ? mValue.mString->ToInteger(&err):0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -92,7 +92,8 @@ protected:
|
|||
|
||||
inline PRInt32 nsHTMLValue::GetIntValue(void) const
|
||||
{
|
||||
NS_ASSERTION((mUnit == eHTMLUnit_Integer) ||
|
||||
NS_ASSERTION((mUnit == eHTMLUnit_String) ||
|
||||
(mUnit == eHTMLUnit_Integer) ||
|
||||
(mUnit == eHTMLUnit_Enumerated) ||
|
||||
(mUnit == eHTMLUnit_Proportional), "not an int value");
|
||||
if ((mUnit == eHTMLUnit_Integer) ||
|
||||
|
@ -100,6 +101,10 @@ inline PRInt32 nsHTMLValue::GetIntValue(void) const
|
|||
(mUnit == eHTMLUnit_Proportional)) {
|
||||
return mValue.mInt;
|
||||
}
|
||||
else if (mUnit == eHTMLUnit_String) {
|
||||
PRInt32 err=0;
|
||||
return (mValue.mString) ? mValue.mString->ToInteger(&err):0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче