From a40fd1bcfcecf1f4a48c926495600f50d62ae924 Mon Sep 17 00:00:00 2001 From: "longsonr%gmail.com" Date: Fri, 13 Jul 2007 09:32:37 +0000 Subject: [PATCH] Bug 387908 - Clean up nsSVGImageFrame.cpp: Remove an unused member variable, make constructor protected and report bad construction as an error. r+sr=tor --- layout/svg/base/src/nsSVGImageFrame.cpp | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/layout/svg/base/src/nsSVGImageFrame.cpp b/layout/svg/base/src/nsSVGImageFrame.cpp index 70baa62ee2c..e285c35f26e 100644 --- a/layout/svg/base/src/nsSVGImageFrame.cpp +++ b/layout/svg/base/src/nsSVGImageFrame.cpp @@ -37,7 +37,6 @@ #include "nsSVGPathGeometryFrame.h" #include "nsIDOMSVGMatrix.h" #include "nsIDOMSVGAnimPresAspRatio.h" -#include "nsIDOMSVGPresAspectRatio.h" #include "imgIContainer.h" #include "gfxIImageFrame.h" #include "nsStubImageDecoderObserver.h" @@ -77,16 +76,15 @@ private: class nsSVGImageFrame : public nsSVGPathGeometryFrame { -protected: friend nsIFrame* NS_NewSVGImageFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsStyleContext* aContext); +protected: + nsSVGImageFrame(nsStyleContext* aContext) : nsSVGPathGeometryFrame(aContext) {} virtual ~nsSVGImageFrame(); NS_IMETHOD InitSVG(); public: - nsSVGImageFrame(nsStyleContext* aContext) : nsSVGPathGeometryFrame(aContext) {} - // nsISVGChildFrame interface: NS_IMETHOD PaintSVG(nsSVGRenderState *aContext, nsRect *aDirtyRect); NS_IMETHOD GetFrameForPointSVG(float x, float y, nsIFrame** hit); @@ -121,8 +119,6 @@ public: private: already_AddRefed GetImageTransform(); - nsCOMPtr mPreserveAspectRatio; - nsCOMPtr mListener; nsCOMPtr mImageContainer; @@ -138,9 +134,7 @@ NS_NewSVGImageFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsStyleConte { nsCOMPtr Rect = do_QueryInterface(aContent); if (!Rect) { -#ifdef DEBUG - printf("warning: trying to construct an SVGImageFrame for a content element that doesn't support the right interfaces\n"); -#endif + NS_ERROR("Can't create frame! Content is not an SVG image!"); return nsnull; } @@ -169,14 +163,6 @@ nsSVGImageFrame::InitSVG() nsCOMPtr Rect = do_QueryInterface(mContent); NS_ASSERTION(Rect,"wrong content element"); - { - nsCOMPtr ratio; - Rect->GetPreserveAspectRatio(getter_AddRefs(ratio)); - ratio->GetAnimVal(getter_AddRefs(mPreserveAspectRatio)); - NS_ASSERTION(mPreserveAspectRatio, "no preserveAspectRatio"); - if (!mPreserveAspectRatio) return NS_ERROR_FAILURE; - } - mListener = new nsSVGImageListener(this); if (!mListener) return NS_ERROR_OUT_OF_MEMORY; nsCOMPtr imageLoader = do_QueryInterface(mContent);