mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 554687 patch 1: Add Swap() method for nsSMILValue. r=roc
This commit is contained in:
parent
1dd4df88b2
commit
f2b8035cd9
@ -38,6 +38,7 @@
|
||||
|
||||
#include "nsSMILValue.h"
|
||||
#include "nsDebug.h"
|
||||
#include <string.h>
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Public methods
|
||||
@ -84,6 +85,19 @@ nsSMILValue::operator==(const nsSMILValue& aVal) const
|
||||
return mType == aVal.mType && mType->IsEqual(*this, aVal);
|
||||
}
|
||||
|
||||
void
|
||||
nsSMILValue::Swap(nsSMILValue& aOther)
|
||||
{
|
||||
nsSMILValue tmp;
|
||||
memcpy(&tmp, &aOther, sizeof(nsSMILValue)); // tmp = aOther
|
||||
memcpy(&aOther, this, sizeof(nsSMILValue)); // aOther = this
|
||||
memcpy(this, &tmp, sizeof(nsSMILValue)); // this = tmp
|
||||
|
||||
// |tmp| is about to die -- we need to clear its mType, so that its
|
||||
// destructor doesn't muck with the data we just transferred out of it.
|
||||
tmp.mType = &nsSMILNullType::sSingleton;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsSMILValue::Add(const nsSMILValue& aValueToAdd, PRUint32 aCount)
|
||||
{
|
||||
|
@ -68,6 +68,9 @@ public:
|
||||
return (mType == &nsSMILNullType::sSingleton);
|
||||
}
|
||||
|
||||
// Swaps the member data (mU & mPtr) of |this| with |aOther|
|
||||
void Swap(nsSMILValue& aOther);
|
||||
|
||||
nsresult Add(const nsSMILValue& aValueToAdd, PRUint32 aCount = 1);
|
||||
nsresult SandwichAdd(const nsSMILValue& aValueToAdd);
|
||||
nsresult ComputeDistance(const nsSMILValue& aTo, double& aDistance) const;
|
||||
|
Loading…
Reference in New Issue
Block a user