Get rid of nsIFrameManager abstract interface to the frame manager. Bug 233972, r+sr=roc.

git-svn-id: svn://10.0.0.236/trunk@153111 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bryner%brianryner.com
2004-02-23 21:29:06 +00:00
parent ffcbd854ba
commit d956db112f
71 changed files with 2353 additions and 2837 deletions

View File

@@ -71,7 +71,7 @@
#include "nsIDOMHTMLBodyElement.h"
#include "nsIScrollableFrame.h"
#include "nsHTMLReflowCommand.h"
#include "nsIFrameManager.h"
#include "nsFrameManager.h"
#include "nsCSSRendering.h"
#include "nsLayoutErrors.h"
#include "nsAutoPtr.h"
@@ -7278,42 +7278,32 @@ nsTableFrame::GetProperty(nsIPresContext* aPresContext,
nsIAtom* aPropertyName,
PRBool aCreateIfNecessary)
{
nsIPresShell *presShell = aPresContext->GetPresShell();
nsFrameManager *frameManager = aPresContext->FrameManager();
if (presShell) {
nsCOMPtr<nsIFrameManager> frameManager;
presShell->GetFrameManager(getter_AddRefs(frameManager));
if (frameManager) {
void* value;
frameManager->GetFrameProperty(aFrame, aPropertyName, 0, &value);
if (value) {
return (nsPoint*)value; // the property already exists
} else if (aCreateIfNecessary) {
// The property isn't set yet, so allocate a new value, set the property,
// and return the newly allocated value
void* value = nsnull;
NSFramePropertyDtorFunc dtorFunc = nsnull;
if (aPropertyName == nsLayoutAtoms::collapseOffsetProperty) {
value = new nsPoint(0, 0);
dtorFunc = DestroyPointFunc;
}
else if (aPropertyName == nsLayoutAtoms::rowUnpaginatedHeightProperty) {
value = new nscoord;
dtorFunc = DestroyCoordFunc;
}
else if (aPropertyName == nsLayoutAtoms::tableBCProperty) {
value = new BCPropertyData;
dtorFunc = DestroyBCPropertyDataFunc;
}
if (!value) return nsnull;
frameManager->SetFrameProperty(aFrame, aPropertyName, value, dtorFunc);
return value;
}
void *value = frameManager->GetFrameProperty(aFrame, aPropertyName, 0);
if (value) {
return (nsPoint*)value; // the property already exists
} else if (aCreateIfNecessary) {
// The property isn't set yet, so allocate a new value, set the property,
// and return the newly allocated value
void* value = nsnull;
NSFramePropertyDtorFunc dtorFunc = nsnull;
if (aPropertyName == nsLayoutAtoms::collapseOffsetProperty) {
value = new nsPoint(0, 0);
dtorFunc = DestroyPointFunc;
}
else if (aPropertyName == nsLayoutAtoms::rowUnpaginatedHeightProperty) {
value = new nscoord;
dtorFunc = DestroyCoordFunc;
}
else if (aPropertyName == nsLayoutAtoms::tableBCProperty) {
value = new BCPropertyData;
dtorFunc = DestroyBCPropertyDataFunc;
}
if (!value) return nsnull;
frameManager->SetFrameProperty(aFrame, aPropertyName, value, dtorFunc);
return value;
}
return nsnull;