From a1ecca2ca43cfbe43b650b0330accac0e2d82e7e Mon Sep 17 00:00:00 2001 From: "dbaron%fas.harvard.edu" Date: Tue, 20 Feb 2001 13:44:43 +0000 Subject: [PATCH] Remove static constructor for nsStyleColor. r=disttsc@bart.nl sr=brendan@mozilla.org b=67341 git-svn-id: svn://10.0.0.236/trunk@87446 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/base/src/nsSelection.cpp | 26 +++++++++++++----------- mozilla/layout/generic/nsSelection.cpp | 26 +++++++++++++----------- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/mozilla/content/base/src/nsSelection.cpp b/mozilla/content/base/src/nsSelection.cpp index 7e134bfaf3a..d45948da788 100644 --- a/mozilla/content/base/src/nsSelection.cpp +++ b/mozilla/content/base/src/nsSelection.cpp @@ -437,7 +437,7 @@ public: static nsIAtom *sCellAtom; static nsIAtom *sTbodyAtom; static PRInt32 sInstanceCount; - static nsStyleColor sTableStyleColor; + static nsStyleColor *sTableStyleColor; }; class nsSelectionIterator : public nsIBidirectionalEnumerator @@ -620,7 +620,7 @@ nsIAtom *nsSelection::sRowAtom = 0; nsIAtom *nsSelection::sCellAtom = 0; nsIAtom *nsSelection::sTbodyAtom = 0; PRInt32 nsSelection::sInstanceCount = 0; -nsStyleColor nsSelection::sTableStyleColor; +nsStyleColor *nsSelection::sTableStyleColor = 0; static PRInt8 GetIndexFromSelectionType(SelectionType aType) @@ -843,15 +843,16 @@ nsSelection::nsSelection() sRowAtom = NS_NewAtom("tr"); sCellAtom = NS_NewAtom("td"); sTbodyAtom = NS_NewAtom("tbody"); - sTableStyleColor.mColor = NS_RGB(128,0,0); - sTableStyleColor.mBackgroundColor = NS_RGB(128,0,0); - sTableStyleColor.mOpacity= (float)1; - sTableStyleColor.mBackgroundAttachment=0; - sTableStyleColor.mBackgroundFlags=NS_STYLE_BG_IMAGE_NONE; - sTableStyleColor.mBackgroundRepeat=1; - sTableStyleColor.mBackgroundXPosition=0; - sTableStyleColor.mBackgroundYPosition=0; - sTableStyleColor.mCursor=1; + sTableStyleColor = new nsStyleColor(); + sTableStyleColor->mColor = NS_RGB(128,0,0); + sTableStyleColor->mBackgroundColor = NS_RGB(128,0,0); + sTableStyleColor->mOpacity= (float)1; + sTableStyleColor->mBackgroundAttachment=0; + sTableStyleColor->mBackgroundFlags=NS_STYLE_BG_IMAGE_NONE; + sTableStyleColor->mBackgroundRepeat=1; + sTableStyleColor->mBackgroundXPosition=0; + sTableStyleColor->mBackgroundYPosition=0; + sTableStyleColor->mCursor=1; } mHint = HINTLEFT; sInstanceCount ++; @@ -898,6 +899,7 @@ nsSelection::~nsSelection() NS_IF_RELEASE(sRowAtom); NS_IF_RELEASE(sCellAtom); NS_IF_RELEASE(sTbodyAtom); + delete sTableStyleColor; } PRInt32 i; for (i = 0;imColor = NS_RGB(128,0,0); + sTableStyleColor->mBackgroundColor = NS_RGB(128,0,0); + sTableStyleColor->mOpacity= (float)1; + sTableStyleColor->mBackgroundAttachment=0; + sTableStyleColor->mBackgroundFlags=NS_STYLE_BG_IMAGE_NONE; + sTableStyleColor->mBackgroundRepeat=1; + sTableStyleColor->mBackgroundXPosition=0; + sTableStyleColor->mBackgroundYPosition=0; + sTableStyleColor->mCursor=1; } mHint = HINTLEFT; sInstanceCount ++; @@ -898,6 +899,7 @@ nsSelection::~nsSelection() NS_IF_RELEASE(sRowAtom); NS_IF_RELEASE(sCellAtom); NS_IF_RELEASE(sTbodyAtom); + delete sTableStyleColor; } PRInt32 i; for (i = 0;i