Removed dependency on static constructors

This commit is contained in:
kipp%netscape.com 1999-02-26 17:12:16 +00:00
parent b476316084
commit cc779556f7
12 changed files with 59 additions and 39 deletions

@ -21,8 +21,6 @@
#include "nsCRT.h"
#include "nsISizeOfHandler.h"
const nsHTMLValue nsHTMLValue::kNull;
nsHTMLValue::nsHTMLValue(nsHTMLUnit aUnit)
: mUnit(aUnit)
{

@ -82,9 +82,6 @@ protected:
nsISupports* mISupports;
nscolor mColor;
} mValue;
public:
static const nsHTMLValue kNull;
};
inline PRInt32 nsHTMLValue::GetIntValue(void) const

@ -21,8 +21,6 @@
#include "nsCRT.h"
#include "nsISizeOfHandler.h"
const nsHTMLValue nsHTMLValue::kNull;
nsHTMLValue::nsHTMLValue(nsHTMLUnit aUnit)
: mUnit(aUnit)
{

@ -82,9 +82,6 @@ protected:
nsISupports* mISupports;
nscolor mColor;
} mValue;
public:
static const nsHTMLValue kNull;
};
inline PRInt32 nsHTMLValue::GetIntValue(void) const

@ -82,9 +82,6 @@ protected:
nsISupports* mISupports;
nscolor mColor;
} mValue;
public:
static const nsHTMLValue kNull;
};
inline PRInt32 nsHTMLValue::GetIntValue(void) const

@ -21,8 +21,6 @@
#include "nsCRT.h"
#include "nsISizeOfHandler.h"
const nsHTMLValue nsHTMLValue::kNull;
nsHTMLValue::nsHTMLValue(nsHTMLUnit aUnit)
: mUnit(aUnit)
{

@ -51,8 +51,10 @@
#define ALL_VIS 0x000F
#define NONE_VIS 0x0000
// Use these defines
#define NULL_POINT_X -1000000
#define NULL_POINT_Y 1000000
static nsPoint NULL_POINT(-1000000,1000000);
static PRInt32 LEFT_EDGE = -1;
static PRInt32 RIGHT_EDGE = 1000000;
@ -1338,7 +1340,10 @@ nsHTMLFramesetFrame::StartMouseDrag(nsIPresContext& aPresContext, nsHTMLFrameset
viewMan->GrabMouseEvents(view, ignore);
NS_RELEASE(viewMan);
mDragger = aBorder;
mLastDragPoint = NULL_POINT; // can't set it to this event's point - it is not in framesetframe coords
// can't set it to this event's point - it is not in framesetframe coords
mLastDragPoint.MoveTo(NULL_POINT_X, NULL_POINT_Y);
gDragInProgress = PR_TRUE;
}
}
@ -1348,7 +1353,8 @@ nsHTMLFramesetFrame::StartMouseDrag(nsIPresContext& aPresContext, nsHTMLFrameset
void
nsHTMLFramesetFrame::MouseDrag(nsIPresContext& aPresContext, nsGUIEvent* aEvent)
{
if (NULL_POINT == mLastDragPoint) {
if ((mLastDragPoint.x == NULL_POINT_X) &&
(mLastDragPoint.y == NULL_POINT_Y)) {
mLastDragPoint.x = aEvent->point.x;
mLastDragPoint.y = aEvent->point.y;
return;

@ -51,8 +51,10 @@
#define ALL_VIS 0x000F
#define NONE_VIS 0x0000
// Use these defines
#define NULL_POINT_X -1000000
#define NULL_POINT_Y 1000000
static nsPoint NULL_POINT(-1000000,1000000);
static PRInt32 LEFT_EDGE = -1;
static PRInt32 RIGHT_EDGE = 1000000;
@ -1338,7 +1340,10 @@ nsHTMLFramesetFrame::StartMouseDrag(nsIPresContext& aPresContext, nsHTMLFrameset
viewMan->GrabMouseEvents(view, ignore);
NS_RELEASE(viewMan);
mDragger = aBorder;
mLastDragPoint = NULL_POINT; // can't set it to this event's point - it is not in framesetframe coords
// can't set it to this event's point - it is not in framesetframe coords
mLastDragPoint.MoveTo(NULL_POINT_X, NULL_POINT_Y);
gDragInProgress = PR_TRUE;
}
}
@ -1348,7 +1353,8 @@ nsHTMLFramesetFrame::StartMouseDrag(nsIPresContext& aPresContext, nsHTMLFrameset
void
nsHTMLFramesetFrame::MouseDrag(nsIPresContext& aPresContext, nsGUIEvent* aEvent)
{
if (NULL_POINT == mLastDragPoint) {
if ((mLastDragPoint.x == NULL_POINT_X) &&
(mLastDragPoint.y == NULL_POINT_Y)) {
mLastDragPoint.x = aEvent->point.x;
mLastDragPoint.y = aEvent->point.y;
return;

@ -78,8 +78,41 @@ static NS_DEFINE_IID(kIDOMNSHTMLFormElementIID, NS_IDOMNSHTMLFORMELEMENT_IID);
static NS_DEFINE_IID(kIContentIID, NS_ICONTENT_IID);
static NS_DEFINE_IID(kIFrameIID, NS_IFRAME_IID);
// XXX This crud needs to go! The FindFrameWithContent *will* be using
// a hashtable so this code will be redundant. In addition,
// FindFrameWithContent will be connected to the frame construction
// and guaranteed to be kept properly up to date.
static nsFormFrameTable* gFormFrameTable;
nsFormFrameTable* nsFormFrame::gFormFrameTable = new nsFormFrameTable();
nsFormFrame*
nsFormFrame::GetFormFrame(nsIPresContext& aPresContext,
nsIDOMHTMLFormElement& aFormElem)
{
if (nsnull == gFormFrameTable) {
gFormFrameTable = new nsFormFrameTable();
}
return gFormFrameTable->Get(aPresContext, aFormElem);
}
void
nsFormFrame::PutFormFrame(nsIPresContext& aPresContext,
nsIDOMHTMLFormElement& aFormElem,
nsFormFrame& aFrame)
{
if (nsnull == gFormFrameTable) {
gFormFrameTable = new nsFormFrameTable();
}
gFormFrameTable->Put(aPresContext, aFormElem, aFrame);
}
void
nsFormFrame::RemoveFormFrame(nsFormFrame& aFrame)
{
if (nsnull == gFormFrameTable) {
gFormFrameTable = new nsFormFrameTable();
}
gFormFrameTable->Remove(aFrame);
}
nsFormFrameTableEntry::
nsFormFrameTableEntry(nsIPresContext& aPresContext,

@ -95,18 +95,15 @@ public:
NS_IMETHOD GetTarget(nsString* aTarget);
NS_IMETHOD GetAction(nsString* aAction);
static nsFormFrame* GetFormFrame(nsIPresContext& aPresContext, nsIDOMHTMLFormElement& aFormElem) {
return gFormFrameTable->Get(aPresContext, aFormElem);
}
static nsFormFrame* GetFormFrame(nsIPresContext& aPresContext,
nsIDOMHTMLFormElement& aFormElem);
static void PutFormFrame(nsIPresContext& aPresContext, nsIDOMHTMLFormElement& aFormElem,
nsFormFrame& aFrame) {
gFormFrameTable->Put(aPresContext, aFormElem, aFrame);
}
static void PutFormFrame(nsIPresContext& aPresContext,
nsIDOMHTMLFormElement& aFormElem,
nsFormFrame& aFrame);
static void RemoveFormFrame(nsFormFrame& aFrame);
static void RemoveFormFrame(nsFormFrame& aFrame) {
gFormFrameTable->Remove(aFrame);
}
// static helper functions for nsIFormControls
static PRBool GetDisabled(nsIFrame* aChildFrame, nsIContent* aContent = 0);
@ -132,8 +129,6 @@ protected:
static char* Temp_GenerateTempFileName(PRInt32 aMaxSize, char* aBuffer);
static void Temp_GetContentType(char* aPathName, char* aContentType);
static nsFormFrameTable* gFormFrameTable;
nsVoidArray mFormControls;
nsVoidArray mRadioGroups;
nsIFormControlFrame* mTextSubmitter;

@ -21,8 +21,6 @@
#include "nsCRT.h"
#include "nsISizeOfHandler.h"
const nsHTMLValue nsHTMLValue::kNull;
nsHTMLValue::nsHTMLValue(nsHTMLUnit aUnit)
: mUnit(aUnit)
{

@ -82,9 +82,6 @@ protected:
nsISupports* mISupports;
nscolor mColor;
} mValue;
public:
static const nsHTMLValue kNull;
};
inline PRInt32 nsHTMLValue::GetIntValue(void) const