From 3d248b601b2d4d21dd9517214cb7a4679d69562a Mon Sep 17 00:00:00 2001 From: "bmlk%gmx.de" Date: Wed, 21 Apr 2004 15:49:29 +0000 Subject: [PATCH] Remove unused functions bug 240559 r/sr =bzbarsky git-svn-id: svn://10.0.0.236/trunk@155289 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/html/content/src/Makefile.in | 5 --- .../content/src/nsHTMLTableCellElement.cpp | 24 -------------- .../content/src/nsHTMLTableColElement.cpp | 24 +------------- mozilla/layout/html/table/src/nsCellMap.cpp | 4 +-- .../html/table/src/nsTableCellFrame.cpp | 31 ++----------------- .../layout/html/table/src/nsTableCellFrame.h | 5 +-- .../layout/html/table/src/nsTableRowFrame.cpp | 3 -- .../html/table/src/nsTableRowGroupFrame.cpp | 2 +- mozilla/layout/tables/nsCellMap.cpp | 4 +-- mozilla/layout/tables/nsTableCellFrame.cpp | 31 ++----------------- mozilla/layout/tables/nsTableCellFrame.h | 5 +-- mozilla/layout/tables/nsTableRowFrame.cpp | 3 -- .../layout/tables/nsTableRowGroupFrame.cpp | 2 +- 13 files changed, 13 insertions(+), 130 deletions(-) diff --git a/mozilla/content/html/content/src/Makefile.in b/mozilla/content/html/content/src/Makefile.in index 57b60b505de..d031e908d0e 100644 --- a/mozilla/content/html/content/src/Makefile.in +++ b/mozilla/content/html/content/src/Makefile.in @@ -122,11 +122,6 @@ CPPSRCS = \ nsHTMLTitleElement.cpp \ $(NULL) -EXPORTS = \ -nsIHTMLTableCellElement.h \ -nsIHTMLTableColElement.h \ -$(NULL) - # we don't want the shared lib, but we want to force the creation of a static lib. FORCE_STATIC_LIB = 1 diff --git a/mozilla/content/html/content/src/nsHTMLTableCellElement.cpp b/mozilla/content/html/content/src/nsHTMLTableCellElement.cpp index ced9c44a997..9124fb5520a 100644 --- a/mozilla/content/html/content/src/nsHTMLTableCellElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLTableCellElement.cpp @@ -34,7 +34,6 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "nsIHTMLTableCellElement.h" #include "nsIDOMHTMLTableCellElement.h" #include "nsIDOMHTMLTableRowElement.h" #include "nsIDOMHTMLCollection.h" @@ -49,7 +48,6 @@ #include "nsIDocument.h" class nsHTMLTableCellElement : public nsGenericHTMLElement, - public nsIHTMLTableCellElement, public nsIDOMHTMLTableCellElement { public: @@ -71,10 +69,6 @@ public: // nsIDOMHTMLTableCellElement NS_DECL_NSIDOMHTMLTABLECELLELEMENT - // nsIHTMLTableCellElement - NS_METHOD GetColIndex (PRInt32* aColIndex); - NS_METHOD SetColIndex (PRInt32 aColIndex); - virtual PRBool ParseAttribute(nsIAtom* aAttribute, const nsAString& aValue, nsAttrValue& aResult); @@ -90,8 +84,6 @@ protected: // found the row element that this cell is in or not. void GetRow(nsIDOMHTMLTableRowElement** aRow); nsIContent * GetTable(); - - PRInt32 mColIndex; }; nsresult @@ -123,7 +115,6 @@ NS_NewHTMLTableCellElement(nsIHTMLContent** aInstancePtrResult, nsHTMLTableCellElement::nsHTMLTableCellElement() { - mColIndex=0; } nsHTMLTableCellElement::~nsHTMLTableCellElement() @@ -138,7 +129,6 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLTableCellElement, nsGenericElement) // QueryInterface implementation for nsHTMLTableCellElement NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLTableCellElement, nsGenericHTMLElement) NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLTableCellElement) - NS_INTERFACE_MAP_ENTRY(nsIHTMLTableCellElement) NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLTableCellElement) NS_HTML_CONTENT_INTERFACE_MAP_END @@ -171,20 +161,6 @@ nsHTMLTableCellElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn) return NS_OK; } -/** @return the starting column for this cell in aColIndex. Always >= 1 */ -NS_METHOD nsHTMLTableCellElement::GetColIndex (PRInt32* aColIndex) -{ - *aColIndex = mColIndex; - return NS_OK; -} - -/** set the starting column for this cell. Always >= 1 */ -NS_METHOD nsHTMLTableCellElement::SetColIndex (PRInt32 aColIndex) -{ - mColIndex = aColIndex; - return NS_OK; -} - // protected method void nsHTMLTableCellElement::GetRow(nsIDOMHTMLTableRowElement** aRow) diff --git a/mozilla/content/html/content/src/nsHTMLTableColElement.cpp b/mozilla/content/html/content/src/nsHTMLTableColElement.cpp index cfd642ce171..6cdf7940981 100644 --- a/mozilla/content/html/content/src/nsHTMLTableColElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLTableColElement.cpp @@ -35,7 +35,6 @@ * * ***** END LICENSE BLOCK ***** */ #include "nsIDOMHTMLTableColElement.h" -#include "nsIHTMLTableColElement.h" #include "nsIDOMEventReceiver.h" #include "nsIHTMLContent.h" #include "nsMappedAttributes.h" @@ -50,8 +49,7 @@ #define MAX_COLSPAN 1000 class nsHTMLTableColElement : public nsGenericHTMLElement, - public nsIDOMHTMLTableColElement, - public nsIHTMLTableColElement + public nsIDOMHTMLTableColElement { public: nsHTMLTableColElement(); @@ -72,9 +70,6 @@ public: // nsIDOMHTMLTableColElement NS_DECL_NSIDOMHTMLTABLECOLELEMENT - // nsIHTMLTableColElement - NS_IMETHOD GetSpanValue(PRInt32* aSpan); - virtual PRBool ParseAttribute(nsIAtom* aAttribute, const nsAString& aValue, nsAttrValue& aResult); @@ -129,7 +124,6 @@ NS_IMPL_RELEASE_INHERITED(nsHTMLTableColElement, nsGenericElement) NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(nsHTMLTableColElement, nsGenericHTMLElement) NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLTableColElement) - NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIHTMLTableColElement, col) // for col only NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(HTMLTableColElement) NS_HTML_CONTENT_INTERFACE_MAP_END @@ -331,19 +325,3 @@ nsHTMLTableColElement::GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aM return NS_OK; } - - -NS_METHOD nsHTMLTableColElement::GetSpanValue(PRInt32* aSpan) -{ - if (nsnull!=aSpan) { - PRInt32 span=-1; - GetSpan(&span); - - if (-1==span) - span=1; // the default; - - *aSpan = span; - } - - return NS_OK; -} diff --git a/mozilla/layout/html/table/src/nsCellMap.cpp b/mozilla/layout/html/table/src/nsCellMap.cpp index 82b1c1a0e06..badb9a475c7 100644 --- a/mozilla/layout/html/table/src/nsCellMap.cpp +++ b/mozilla/layout/html/table/src/nsCellMap.cpp @@ -1302,7 +1302,7 @@ nsCellMap::AppendCell(nsTableCellMap& aMap, } // initialize the cell frame - aCellFrame->InitCellFrame(startColIndex); + aCellFrame->SetColIndex(startColIndex); // Create CellData objects for the rows that this cell spans. Set // their mOrigCell to nsnull and their mSpanData to point to data. @@ -1586,7 +1586,7 @@ void nsCellMap::ExpandWithCells(nsTableCellMap& aMap, SetDataAt(aMap, *data, rowX, colX, (colX == aColIndex + 1)); } } - cellFrame->InitCellFrame(startColIndex); + cellFrame->SetColIndex(startColIndex); } PRInt32 damageHeight = (aRowSpanIsZero) ? aMap.GetColCount() - aRowIndex : aRowSpan; SetDamageArea(aColIndex, aRowIndex, 1 + endColIndex - aColIndex, damageHeight, aDamageArea); diff --git a/mozilla/layout/html/table/src/nsTableCellFrame.cpp b/mozilla/layout/html/table/src/nsTableCellFrame.cpp index b15a7a2b7b6..f24d13a14a9 100644 --- a/mozilla/layout/html/table/src/nsTableCellFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableCellFrame.cpp @@ -57,7 +57,6 @@ #include "nsLayoutAtoms.h" #include "nsIPresShell.h" #include "nsCOMPtr.h" -#include "nsIHTMLTableCellElement.h" #include "nsIDOMHTMLTableCellElement.h" #ifdef ACCESSIBILITY #include "nsIAccessibilityService.h" @@ -127,7 +126,7 @@ nsTableCellFrame::Init(nsIPresContext* aPresContext, nsTableCellFrame* cellFrame = (nsTableCellFrame*)aPrevInFlow; PRInt32 colIndex; cellFrame->GetColIndex(colIndex); - InitCellFrame(colIndex); + SetColIndex(colIndex); } return rv; @@ -274,35 +273,9 @@ nsTableCellFrame::RemoveFrame(nsIPresContext* aPresContext, return NS_ERROR_NOT_IMPLEMENTED; } -void nsTableCellFrame::InitCellFrame(PRInt32 aColIndex) -{ - nsTableFrame* tableFrame=nsnull; // I should be checking my own style context, but border-collapse isn't inheriting correctly - nsresult rv = nsTableFrame::GetTableFrame(this, tableFrame); - if ((NS_SUCCEEDED(rv)) && tableFrame) { - SetColIndex(aColIndex); - } -} - -nsresult nsTableCellFrame::SetColIndex(PRInt32 aColIndex) +void nsTableCellFrame::SetColIndex(PRInt32 aColIndex) { mBits.mColIndex = aColIndex; - // for style context optimization, set the content's column index if possible. - // this can only be done if we really have an nsTableCell. - // other tags mapped to table cell display won't benefit from this optimization - // see nsHTMLStyleSheet::RulesMatching - - //nsIContent* cell = kidFrame->GetContent(); - nsIContent* cell = GetContent(); - if (!cell) - return NS_OK; - - nsIHTMLTableCellElement* cellContent = nsnull; - nsresult rv = CallQueryInterface(cell, &cellContent); // cellContent: REFCNT++ - if (cellContent && NS_SUCCEEDED(rv)) { // it's a table cell - cellContent->SetColIndex(aColIndex); - NS_RELEASE(cellContent); - } - return rv; } diff --git a/mozilla/layout/html/table/src/nsTableCellFrame.h b/mozilla/layout/html/table/src/nsTableCellFrame.h index f571598248d..53e15b5eeee 100644 --- a/mozilla/layout/html/table/src/nsTableCellFrame.h +++ b/mozilla/layout/html/table/src/nsTableCellFrame.h @@ -119,9 +119,6 @@ public: virtual void NotifyPercentHeight(const nsHTMLReflowState& aReflowState); virtual PRBool NeedsToObserve(const nsHTMLReflowState& aReflowState); - - void InitCellFrame(PRInt32 aColIndex); - /** instantiate a new instance of nsTableCellFrame. * @param aResult the new object is returned in this out-param @@ -213,7 +210,7 @@ public: /** return the cell's column index (starting at 0 for the first column) */ virtual nsresult GetColIndex(PRInt32 &aColIndex) const; - virtual nsresult SetColIndex(PRInt32 aColIndex); + void SetColIndex(PRInt32 aColIndex); /** return the available width given to this frame during its last reflow */ virtual nscoord GetPriorAvailWidth(); diff --git a/mozilla/layout/html/table/src/nsTableRowFrame.cpp b/mozilla/layout/html/table/src/nsTableRowFrame.cpp index e9bf36f1b44..433828295da 100644 --- a/mozilla/layout/html/table/src/nsTableRowFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableRowFrame.cpp @@ -53,9 +53,6 @@ #include "nsTableColGroupFrame.h" #include "nsTableColFrame.h" #include "nsCOMPtr.h" -// the following header files are required for style optimizations that work only when the child content is really a cell -#include "nsIHTMLTableCellElement.h" -// end includes for style optimizations that require real content knowledge struct nsTableCellReflowState : public nsHTMLReflowState diff --git a/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp b/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp index 9294e02cdd3..9dcef3f7c75 100644 --- a/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp @@ -170,7 +170,7 @@ nsTableRowGroupFrame::InitRepeatedFrame(nsIPresContext* aPresContext, "cell frames have different content"); PRInt32 colIndex; originalCellFrame->GetColIndex(colIndex); - copyCellFrame->InitCellFrame(colIndex); + copyCellFrame->SetColIndex(colIndex); // Move to the next cell frame copyCellFrame = copyCellFrame->GetNextCell(); diff --git a/mozilla/layout/tables/nsCellMap.cpp b/mozilla/layout/tables/nsCellMap.cpp index 82b1c1a0e06..badb9a475c7 100644 --- a/mozilla/layout/tables/nsCellMap.cpp +++ b/mozilla/layout/tables/nsCellMap.cpp @@ -1302,7 +1302,7 @@ nsCellMap::AppendCell(nsTableCellMap& aMap, } // initialize the cell frame - aCellFrame->InitCellFrame(startColIndex); + aCellFrame->SetColIndex(startColIndex); // Create CellData objects for the rows that this cell spans. Set // their mOrigCell to nsnull and their mSpanData to point to data. @@ -1586,7 +1586,7 @@ void nsCellMap::ExpandWithCells(nsTableCellMap& aMap, SetDataAt(aMap, *data, rowX, colX, (colX == aColIndex + 1)); } } - cellFrame->InitCellFrame(startColIndex); + cellFrame->SetColIndex(startColIndex); } PRInt32 damageHeight = (aRowSpanIsZero) ? aMap.GetColCount() - aRowIndex : aRowSpan; SetDamageArea(aColIndex, aRowIndex, 1 + endColIndex - aColIndex, damageHeight, aDamageArea); diff --git a/mozilla/layout/tables/nsTableCellFrame.cpp b/mozilla/layout/tables/nsTableCellFrame.cpp index b15a7a2b7b6..f24d13a14a9 100644 --- a/mozilla/layout/tables/nsTableCellFrame.cpp +++ b/mozilla/layout/tables/nsTableCellFrame.cpp @@ -57,7 +57,6 @@ #include "nsLayoutAtoms.h" #include "nsIPresShell.h" #include "nsCOMPtr.h" -#include "nsIHTMLTableCellElement.h" #include "nsIDOMHTMLTableCellElement.h" #ifdef ACCESSIBILITY #include "nsIAccessibilityService.h" @@ -127,7 +126,7 @@ nsTableCellFrame::Init(nsIPresContext* aPresContext, nsTableCellFrame* cellFrame = (nsTableCellFrame*)aPrevInFlow; PRInt32 colIndex; cellFrame->GetColIndex(colIndex); - InitCellFrame(colIndex); + SetColIndex(colIndex); } return rv; @@ -274,35 +273,9 @@ nsTableCellFrame::RemoveFrame(nsIPresContext* aPresContext, return NS_ERROR_NOT_IMPLEMENTED; } -void nsTableCellFrame::InitCellFrame(PRInt32 aColIndex) -{ - nsTableFrame* tableFrame=nsnull; // I should be checking my own style context, but border-collapse isn't inheriting correctly - nsresult rv = nsTableFrame::GetTableFrame(this, tableFrame); - if ((NS_SUCCEEDED(rv)) && tableFrame) { - SetColIndex(aColIndex); - } -} - -nsresult nsTableCellFrame::SetColIndex(PRInt32 aColIndex) +void nsTableCellFrame::SetColIndex(PRInt32 aColIndex) { mBits.mColIndex = aColIndex; - // for style context optimization, set the content's column index if possible. - // this can only be done if we really have an nsTableCell. - // other tags mapped to table cell display won't benefit from this optimization - // see nsHTMLStyleSheet::RulesMatching - - //nsIContent* cell = kidFrame->GetContent(); - nsIContent* cell = GetContent(); - if (!cell) - return NS_OK; - - nsIHTMLTableCellElement* cellContent = nsnull; - nsresult rv = CallQueryInterface(cell, &cellContent); // cellContent: REFCNT++ - if (cellContent && NS_SUCCEEDED(rv)) { // it's a table cell - cellContent->SetColIndex(aColIndex); - NS_RELEASE(cellContent); - } - return rv; } diff --git a/mozilla/layout/tables/nsTableCellFrame.h b/mozilla/layout/tables/nsTableCellFrame.h index f571598248d..53e15b5eeee 100644 --- a/mozilla/layout/tables/nsTableCellFrame.h +++ b/mozilla/layout/tables/nsTableCellFrame.h @@ -119,9 +119,6 @@ public: virtual void NotifyPercentHeight(const nsHTMLReflowState& aReflowState); virtual PRBool NeedsToObserve(const nsHTMLReflowState& aReflowState); - - void InitCellFrame(PRInt32 aColIndex); - /** instantiate a new instance of nsTableCellFrame. * @param aResult the new object is returned in this out-param @@ -213,7 +210,7 @@ public: /** return the cell's column index (starting at 0 for the first column) */ virtual nsresult GetColIndex(PRInt32 &aColIndex) const; - virtual nsresult SetColIndex(PRInt32 aColIndex); + void SetColIndex(PRInt32 aColIndex); /** return the available width given to this frame during its last reflow */ virtual nscoord GetPriorAvailWidth(); diff --git a/mozilla/layout/tables/nsTableRowFrame.cpp b/mozilla/layout/tables/nsTableRowFrame.cpp index e9bf36f1b44..433828295da 100644 --- a/mozilla/layout/tables/nsTableRowFrame.cpp +++ b/mozilla/layout/tables/nsTableRowFrame.cpp @@ -53,9 +53,6 @@ #include "nsTableColGroupFrame.h" #include "nsTableColFrame.h" #include "nsCOMPtr.h" -// the following header files are required for style optimizations that work only when the child content is really a cell -#include "nsIHTMLTableCellElement.h" -// end includes for style optimizations that require real content knowledge struct nsTableCellReflowState : public nsHTMLReflowState diff --git a/mozilla/layout/tables/nsTableRowGroupFrame.cpp b/mozilla/layout/tables/nsTableRowGroupFrame.cpp index 9294e02cdd3..9dcef3f7c75 100644 --- a/mozilla/layout/tables/nsTableRowGroupFrame.cpp +++ b/mozilla/layout/tables/nsTableRowGroupFrame.cpp @@ -170,7 +170,7 @@ nsTableRowGroupFrame::InitRepeatedFrame(nsIPresContext* aPresContext, "cell frames have different content"); PRInt32 colIndex; originalCellFrame->GetColIndex(colIndex); - copyCellFrame->InitCellFrame(colIndex); + copyCellFrame->SetColIndex(colIndex); // Move to the next cell frame copyCellFrame = copyCellFrame->GetNextCell();