Bug 636750 (4/4) - s/float/double/g on few methods/enums/variables. r=bz sr=sicking

This commit is contained in:
Mounir Lamouri 2011-03-25 15:43:53 +01:00
Родитель eedfa58901
Коммит f14dd68f32
5 изменённых файлов: 35 добавлений и 35 удалений

Просмотреть файл

@ -262,9 +262,9 @@ nsAttrValue::SetTo(const nsAttrValue& aOther)
break;
}
#endif
case eFloatValue:
case eDoubleValue:
{
cont->mFloatValue = otherCont->mFloatValue;
cont->mDoubleValue = otherCont->mDoubleValue;
break;
}
case eIntMarginValue:
@ -443,10 +443,10 @@ nsAttrValue::ToString(nsAString& aResult) const
break;
}
#endif
case eFloatValue:
case eDoubleValue:
{
aResult.Truncate();
aResult.AppendFloat(GetFloatValue());
aResult.AppendFloat(GetDoubleValue());
break;
}
default:
@ -607,10 +607,10 @@ nsAttrValue::HashValue() const
return NS_PTR_TO_INT32(cont->mSVGValue);
}
#endif
case eFloatValue:
case eDoubleValue:
{
// XXX this is crappy, but oh well
return cont->mFloatValue;
return cont->mDoubleValue;
}
case eIntMarginValue:
{
@ -706,9 +706,9 @@ nsAttrValue::Equals(const nsAttrValue& aOther) const
return thisCont->mSVGValue == otherCont->mSVGValue;
}
#endif
case eFloatValue:
case eDoubleValue:
{
return thisCont->mFloatValue == otherCont->mFloatValue;
return thisCont->mDoubleValue == otherCont->mDoubleValue;
}
case eIntMarginValue:
{
@ -1206,7 +1206,7 @@ nsAttrValue::ParseColor(const nsAString& aString)
return PR_FALSE;
}
PRBool nsAttrValue::ParseFloatValue(const nsAString& aString)
PRBool nsAttrValue::ParseDoubleValue(const nsAString& aString)
{
ResetIfSet();
@ -1217,8 +1217,8 @@ PRBool nsAttrValue::ParseFloatValue(const nsAString& aString)
}
if (EnsureEmptyMiscContainer()) {
MiscContainer* cont = GetMiscContainer();
cont->mFloatValue = val;
cont->mType = eFloatValue;
cont->mDoubleValue = val;
cont->mType = eDoubleValue;
nsAutoString serializedFloat;
serializedFloat.AppendFloat(val);
SetMiscAtomOrString(serializedFloat.Equals(aString) ? nsnull : &aString);

Просмотреть файл

@ -130,7 +130,7 @@ public:
#ifdef MOZ_SVG
,eSVGValue = 0x12
#endif
,eFloatValue = 0x13
,eDoubleValue = 0x13
,eIntMarginValue = 0x14
};
@ -165,7 +165,7 @@ public:
#ifdef MOZ_SVG
inline nsISVGValue* GetSVGValue() const;
#endif
inline double GetFloatValue() const;
inline double GetDoubleValue() const;
PRBool GetIntMarginValue(nsIntMargin& aMargin) const;
/**
@ -302,7 +302,7 @@ public:
* @param aString the string to parse
* @return whether the value could be parsed
*/
PRBool ParseFloatValue(const nsAString& aString);
PRBool ParseDoubleValue(const nsAString& aString);
/**
* Parse a lazy URI. This just sets up the storage for the URI; it
@ -346,7 +346,7 @@ private:
#ifdef MOZ_SVG
nsISVGValue* mSVGValue;
#endif
double mFloatValue;
double mDoubleValue;
nsIntMargin* mIntMargin;
};
};
@ -459,10 +459,10 @@ nsAttrValue::GetSVGValue() const
#endif
inline double
nsAttrValue::GetFloatValue() const
nsAttrValue::GetDoubleValue() const
{
NS_PRECONDITION(Type() == eFloatValue, "wrong type");
return GetMiscContainer()->mFloatValue;
NS_PRECONDITION(Type() == eDoubleValue, "wrong type");
return GetMiscContainer()->mDoubleValue;
}
inline PRBool

Просмотреть файл

@ -2177,11 +2177,11 @@ nsGenericHTMLElement::SetUnsignedIntAttr(nsIAtom* aAttr, PRUint32 aValue)
}
nsresult
nsGenericHTMLElement::GetFloatAttr(nsIAtom* aAttr, double aDefault, double* aResult)
nsGenericHTMLElement::GetDoubleAttr(nsIAtom* aAttr, double aDefault, double* aResult)
{
const nsAttrValue* attrVal = mAttrsAndChildren.GetAttr(aAttr);
if (attrVal && attrVal->Type() == nsAttrValue::eFloatValue) {
*aResult = attrVal->GetFloatValue();
if (attrVal && attrVal->Type() == nsAttrValue::eDoubleValue) {
*aResult = attrVal->GetDoubleValue();
}
else {
*aResult = aDefault;
@ -2190,7 +2190,7 @@ nsGenericHTMLElement::GetFloatAttr(nsIAtom* aAttr, double aDefault, double* aRes
}
nsresult
nsGenericHTMLElement::SetFloatAttr(nsIAtom* aAttr, double aValue)
nsGenericHTMLElement::SetDoubleAttr(nsIAtom* aAttr, double aValue)
{
nsAutoString value;
value.AppendFloat(aValue);

Просмотреть файл

@ -686,26 +686,26 @@ protected:
NS_HIDDEN_(nsresult) SetUnsignedIntAttr(nsIAtom* aAttr, PRUint32 aValue);
/**
* Helper method for NS_IMPL_FLOAT_ATTR macro.
* Gets the float-value of an attribute, returns specified default value
* if the attribute isn't set or isn't set to a float. Only works for
* Helper method for NS_IMPL_DOUBLE_ATTR macro.
* Gets the double-value of an attribute, returns specified default value
* if the attribute isn't set or isn't set to a double. Only works for
* attributes in null namespace.
*
* @param aAttr name of attribute.
* @param aDefault default-value to return if attribute isn't set.
* @param aResult result value [out]
*/
NS_HIDDEN_(nsresult) GetFloatAttr(nsIAtom* aAttr, double aDefault, double* aValue);
NS_HIDDEN_(nsresult) GetDoubleAttr(nsIAtom* aAttr, double aDefault, double* aValue);
/**
* Helper method for NS_IMPL_FLOAT_ATTR macro.
* Sets value of attribute to specified float. Only works for attributes
* Helper method for NS_IMPL_DOUBLE_ATTR macro.
* Sets value of attribute to specified double. Only works for attributes
* in null namespace.
*
* @param aAttr name of attribute.
* @param aValue Float value of attribute.
* @param aValue Double value of attribute.
*/
NS_HIDDEN_(nsresult) SetFloatAttr(nsIAtom* aAttr, double aValue);
NS_HIDDEN_(nsresult) SetDoubleAttr(nsIAtom* aAttr, double aValue);
/**
* Helper for GetURIAttr and GetHrefURIForAnchors which returns an
@ -1190,8 +1190,8 @@ protected:
/**
* A macro to implement the getter and setter for a given double-precision
* floating point valued content property. The method uses GetFloatAttr and
* SetFloatAttr methods.
* floating point valued content property. The method uses GetDoubleAttr and
* SetDoubleAttr methods.
*/
#define NS_IMPL_DOUBLE_ATTR(_class, _method, _atom) \
NS_IMPL_DOUBLE_ATTR_DEFAULT_VALUE(_class, _method, _atom, 0.0)
@ -1200,12 +1200,12 @@ protected:
NS_IMETHODIMP \
_class::Get##_method(double* aValue) \
{ \
return GetFloatAttr(nsGkAtoms::_atom, _default, aValue); \
return GetDoubleAttr(nsGkAtoms::_atom, _default, aValue); \
} \
NS_IMETHODIMP \
_class::Set##_method(double aValue) \
{ \
return SetFloatAttr(nsGkAtoms::_atom, aValue); \
return SetDoubleAttr(nsGkAtoms::_atom, aValue); \
}
/**

Просмотреть файл

@ -1426,7 +1426,7 @@ PRBool nsHTMLMediaElement::ParseAttribute(PRInt32 aNamespaceID,
|| aAttribute == nsGkAtoms::loopend
|| aAttribute == nsGkAtoms::start
|| aAttribute == nsGkAtoms::end) {
return aResult.ParseFloatValue(aValue);
return aResult.ParseDoubleValue(aValue);
}
else if (ParseImageAttribute(aAttribute, aValue, aResult)) {
return PR_TRUE;