Bug 537313: Disable MSVC warning C4355 ('this' used in init list) in SVG's consumers of nsReferencedElement. r=roc

This commit is contained in:
Daniel Holbert 2010-01-13 00:18:48 -08:00
parent 06b966053e
commit 4aa49ca63e
3 changed files with 30 additions and 0 deletions

View File

@ -71,10 +71,20 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
//----------------------------------------------------------------------
// Implementation
#ifdef _MSC_VER
// Disable "warning C4355: 'this' : used in base member initializer list".
// We can ignore that warning because we know that mHrefTarget's constructor
// doesn't dereference the pointer passed to it.
#pragma warning(push)
#pragma warning(disable:4355)
#endif
nsSVGAnimationElement::nsSVGAnimationElement(nsINodeInfo *aNodeInfo)
: nsSVGAnimationElementBase(aNodeInfo),
mHrefTarget(this),
mTimedDocumentRoot(nsnull)
#ifdef _MSC_VER
#pragma warning(pop)
#endif
{
}

View File

@ -95,8 +95,18 @@ NS_INTERFACE_MAP_END_INHERITING(nsSVGUseElementBase)
//----------------------------------------------------------------------
// Implementation
#ifdef _MSC_VER
// Disable "warning C4355: 'this' : used in base member initializer list".
// We can ignore that warning because we know that mSource's constructor
// doesn't dereference the pointer passed to it.
#pragma warning(push)
#pragma warning(disable:4355)
#endif
nsSVGUseElement::nsSVGUseElement(nsINodeInfo *aNodeInfo)
: nsSVGUseElementBase(aNodeInfo), mSource(this)
#ifdef _MSC_VER
#pragma warning(pop)
#endif
{
}

View File

@ -48,12 +48,22 @@
NS_IMPL_ISUPPORTS1(nsSVGRenderingObserver, nsIMutationObserver)
#ifdef _MSC_VER
// Disable "warning C4355: 'this' : used in base member initializer list".
// We can ignore that warning because we know that mElement's constructor
// doesn't dereference the pointer passed to it.
#pragma warning(push)
#pragma warning(disable:4355)
#endif
nsSVGRenderingObserver::nsSVGRenderingObserver(nsIURI *aURI,
nsIFrame *aFrame)
: mElement(this), mFrame(aFrame),
mFramePresShell(aFrame->PresContext()->PresShell()),
mReferencedFrame(nsnull),
mReferencedFramePresShell(nsnull)
#ifdef _MSC_VER
#pragma warning(pop)
#endif
{
// Start watching the target element
mElement.Reset(aFrame->GetContent(), aURI);