2001-09-29 00:14:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1998-04-14 00:24:54 +04:00
|
|
|
#ifndef nsCellMap_h__
|
|
|
|
#define nsCellMap_h__
|
|
|
|
|
|
|
|
#include "nscore.h"
|
1998-07-11 04:47:29 +04:00
|
|
|
#include "celldata.h"
|
2009-02-05 12:09:50 +03:00
|
|
|
#include "nsTArray.h"
|
2011-08-10 09:36:00 +04:00
|
|
|
#include "nsTArray.h"
|
2007-01-30 03:06:41 +03:00
|
|
|
#include "nsCOMPtr.h"
|
2009-09-16 19:01:36 +04:00
|
|
|
#include "nsAlgorithm.h"
|
2015-04-21 18:04:57 +03:00
|
|
|
#include "nsRect.h"
|
2013-01-15 16:22:03 +04:00
|
|
|
#include <algorithm>
|
2015-05-01 00:46:59 +03:00
|
|
|
#include "TableArea.h"
|
2002-02-19 18:48:28 +03:00
|
|
|
|
2004-03-03 20:45:50 +03:00
|
|
|
#undef DEBUG_TABLE_CELLMAP
|
|
|
|
|
1998-07-11 04:00:31 +04:00
|
|
|
class nsTableCellFrame;
|
2009-02-05 12:09:50 +03:00
|
|
|
class nsTableRowFrame;
|
2000-01-13 08:29:38 +03:00
|
|
|
class nsTableRowGroupFrame;
|
|
|
|
class nsTableFrame;
|
|
|
|
class nsCellMap;
|
2006-12-07 05:32:57 +03:00
|
|
|
class nsPresContext;
|
2007-01-22 07:32:33 +03:00
|
|
|
class nsCellMapColumnIterator;
|
1999-12-14 01:56:31 +03:00
|
|
|
|
|
|
|
struct nsColInfo
|
|
|
|
{
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t mNumCellsOrig; // number of cells originating in the col
|
|
|
|
int32_t mNumCellsSpan; // number of cells spanning into the col via colspans (not rowspans)
|
2006-10-20 11:37:24 +04:00
|
|
|
|
2010-04-27 20:15:01 +04:00
|
|
|
nsColInfo();
|
2012-08-22 19:56:38 +04:00
|
|
|
nsColInfo(int32_t aNumCellsOrig,
|
|
|
|
int32_t aNumCellsSpan);
|
1999-12-14 01:56:31 +03:00
|
|
|
};
|
1998-04-14 00:24:54 +04:00
|
|
|
|
2002-02-19 18:48:28 +03:00
|
|
|
struct BCInfo
|
|
|
|
{
|
2015-06-27 21:16:10 +03:00
|
|
|
nsTArray<BCData> mIEndBorders;
|
|
|
|
nsTArray<BCData> mBEndBorders;
|
|
|
|
BCData mBEndIEndCorner;
|
2002-02-19 18:48:28 +03:00
|
|
|
};
|
|
|
|
|
2000-01-13 08:29:38 +03:00
|
|
|
class nsTableCellMap
|
|
|
|
{
|
2015-05-01 00:46:59 +03:00
|
|
|
typedef mozilla::TableArea TableArea;
|
|
|
|
|
2000-01-13 08:29:38 +03:00
|
|
|
public:
|
2004-01-18 13:28:40 +03:00
|
|
|
nsTableCellMap(nsTableFrame& aTableFrame,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aBorderCollapse);
|
2000-01-13 08:29:38 +03:00
|
|
|
|
|
|
|
/** destructor
|
2010-04-27 20:15:01 +04:00
|
|
|
* NOT VIRTUAL BECAUSE THIS CLASS SHOULD **NEVER** BE SUBCLASSED
|
2006-01-14 00:08:17 +03:00
|
|
|
*/
|
2000-01-13 08:29:38 +03:00
|
|
|
~nsTableCellMap();
|
2010-04-27 20:15:01 +04:00
|
|
|
|
2000-01-13 08:29:38 +03:00
|
|
|
void RemoveGroupCellMap(nsTableRowGroupFrame* aRowGroup);
|
2002-02-19 18:48:28 +03:00
|
|
|
|
2010-01-16 19:05:46 +03:00
|
|
|
void InsertGroupCellMap(nsTableRowGroupFrame* aNewRowGroup,
|
2000-09-14 10:49:47 +04:00
|
|
|
nsTableRowGroupFrame*& aPrevRowGroup);
|
2000-01-13 08:29:38 +03:00
|
|
|
|
2007-01-22 07:35:25 +03:00
|
|
|
/**
|
|
|
|
* Get the nsCellMap for the given row group. If aStartHint is non-null,
|
|
|
|
* will start looking with that cellmap and only fall back to starting at the
|
|
|
|
* beginning of the list if that doesn't find us the right nsCellMap.
|
|
|
|
* Otherwise, just start at the beginning.
|
|
|
|
*
|
|
|
|
* aRowGroup must not be null.
|
|
|
|
*/
|
|
|
|
nsCellMap* GetMapFor(const nsTableRowGroupFrame* aRowGroup,
|
|
|
|
nsCellMap* aStartHint) const;
|
2002-02-19 18:48:28 +03:00
|
|
|
|
2006-06-22 08:19:36 +04:00
|
|
|
/** synchronize the cellmaps with the rowgroups again **/
|
|
|
|
void Synchronize(nsTableFrame* aTableFrame);
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
nsTableCellFrame* GetCellFrame(int32_t aRowIndex,
|
|
|
|
int32_t aColIndex,
|
2000-01-13 08:29:38 +03:00
|
|
|
CellData& aData,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aUseRowIfOverlap) const;
|
2000-01-13 08:29:38 +03:00
|
|
|
|
2006-10-20 11:37:24 +04:00
|
|
|
/** return the CellData for the cell at (aRowIndex, aColIndex) */
|
2012-08-22 19:56:38 +04:00
|
|
|
CellData* GetDataAt(int32_t aRowIndex,
|
|
|
|
int32_t aColIndex) const;
|
2000-01-13 08:29:38 +03:00
|
|
|
|
2006-10-20 11:37:24 +04:00
|
|
|
// this function creates a col if needed
|
2012-08-22 19:56:38 +04:00
|
|
|
nsColInfo* GetColInfoAt(int32_t aColIndex);
|
2000-01-13 08:29:38 +03:00
|
|
|
|
|
|
|
/** append the cellFrame at the end of the row at aRowIndex and return the col index
|
|
|
|
*/
|
2002-02-19 18:48:28 +03:00
|
|
|
CellData* AppendCell(nsTableCellFrame& aCellFrame,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aRowIndex,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aRebuildIfNecessary,
|
2015-05-01 00:46:59 +03:00
|
|
|
TableArea& aDamageArea);
|
2000-01-13 08:29:38 +03:00
|
|
|
|
2009-02-05 12:09:50 +03:00
|
|
|
void InsertCells(nsTArray<nsTableCellFrame*>& aCellFrames,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aRowIndex,
|
|
|
|
int32_t aColIndexBefore,
|
2015-05-01 00:46:59 +03:00
|
|
|
TableArea& aDamageArea);
|
2000-01-13 08:29:38 +03:00
|
|
|
|
|
|
|
void RemoveCell(nsTableCellFrame* aCellFrame,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aRowIndex,
|
2015-05-01 00:46:59 +03:00
|
|
|
TableArea& aDamageArea);
|
2006-06-28 22:56:10 +04:00
|
|
|
/** Remove the previously gathered column information */
|
|
|
|
void ClearCols();
|
2010-01-16 19:05:46 +03:00
|
|
|
void InsertRows(nsTableRowGroupFrame* aRowGroup,
|
2009-02-05 12:09:50 +03:00
|
|
|
nsTArray<nsTableRowFrame*>& aRows,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aFirstRowIndex,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aConsiderSpans,
|
2015-05-01 00:46:59 +03:00
|
|
|
TableArea& aDamageArea);
|
2000-01-13 08:29:38 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
void RemoveRows(int32_t aFirstRowIndex,
|
|
|
|
int32_t aNumRowsToRemove,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aConsiderSpans,
|
2015-05-01 00:46:59 +03:00
|
|
|
TableArea& aDamageArea);
|
2000-01-13 08:29:38 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t GetNumCellsOriginatingInRow(int32_t aRowIndex) const;
|
|
|
|
int32_t GetNumCellsOriginatingInCol(int32_t aColIndex) const;
|
2000-01-13 08:29:38 +03:00
|
|
|
|
2004-04-13 10:21:16 +04:00
|
|
|
/** indicate whether the row has more than one cell that either originates
|
|
|
|
* or is spanned from the rows above
|
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
bool HasMoreThanOneCell(int32_t aRowIndex) const;
|
2004-04-13 10:21:16 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t GetEffectiveRowSpan(int32_t aRowIndex,
|
|
|
|
int32_t aColIndex) const;
|
|
|
|
int32_t GetEffectiveColSpan(int32_t aRowIndex,
|
|
|
|
int32_t aColIndex) const;
|
2000-01-13 08:29:38 +03:00
|
|
|
|
|
|
|
/** return the total number of columns in the table represented by this CellMap */
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t GetColCount() const;
|
2000-01-13 08:29:38 +03:00
|
|
|
|
|
|
|
/** return the actual number of rows in the table represented by this CellMap */
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t GetRowCount() const;
|
2000-01-13 08:29:38 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
nsTableCellFrame* GetCellInfoAt(int32_t aRowX,
|
|
|
|
int32_t aColX,
|
2012-07-30 18:20:58 +04:00
|
|
|
bool* aOriginates = nullptr,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t* aColSpan = nullptr) const;
|
2000-01-13 08:29:38 +03:00
|
|
|
|
2008-02-07 10:03:26 +03:00
|
|
|
/**
|
|
|
|
* Returns the index at the given row and column coordinates.
|
|
|
|
*
|
|
|
|
* @see nsITableLayout::GetIndexByRowAndColumn()
|
|
|
|
*
|
|
|
|
* @param aRow [in] the row coordinate
|
|
|
|
* @param aColumn [in] the column coordinate
|
|
|
|
* @returns the index for the cell
|
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t GetIndexByRowAndColumn(int32_t aRow, int32_t aColumn) const;
|
2008-02-07 10:03:26 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieves the row and column coordinates for the given index.
|
|
|
|
*
|
|
|
|
* @see nsITableLayout::GetRowAndColumnByIndex()
|
|
|
|
*
|
|
|
|
* @param aIndex [in] the index for which coordinates are to be retrieved
|
|
|
|
* @param aRow [out] the row coordinate to be returned
|
|
|
|
* @param aColumn [out] the column coordinate to be returned
|
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
void GetRowAndColumnByIndex(int32_t aIndex,
|
|
|
|
int32_t *aRow, int32_t *aColumn) const;
|
2008-02-07 10:03:26 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
void AddColsAtEnd(uint32_t aNumCols);
|
2001-05-17 16:40:27 +04:00
|
|
|
void RemoveColsAtEnd();
|
2000-01-13 08:29:38 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
bool RowIsSpannedInto(int32_t aRowIndex, int32_t aNumEffCols) const;
|
|
|
|
bool RowHasSpanningCells(int32_t aRowIndex, int32_t aNumEffCols) const;
|
2009-02-05 12:09:50 +03:00
|
|
|
void RebuildConsideringCells(nsCellMap* aCellMap,
|
|
|
|
nsTArray<nsTableCellFrame*>* aCellFrames,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aRowIndex,
|
|
|
|
int32_t aColIndex,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aInsert,
|
2015-05-01 00:46:59 +03:00
|
|
|
TableArea& aDamageArea);
|
2006-12-07 05:32:57 +03:00
|
|
|
|
|
|
|
protected:
|
|
|
|
/**
|
|
|
|
* Rebuild due to rows being inserted or deleted with cells spanning
|
|
|
|
* into or out of the rows. This function can only handle insertion
|
|
|
|
* or deletion but NOT both. So either aRowsToInsert must be null
|
|
|
|
* or aNumRowsToRemove must be 0.
|
2010-04-27 20:15:01 +04:00
|
|
|
*
|
2006-12-07 05:32:57 +03:00
|
|
|
* // XXXbz are both allowed to happen? That'd be a no-op...
|
|
|
|
*/
|
2009-02-05 12:09:50 +03:00
|
|
|
void RebuildConsideringRows(nsCellMap* aCellMap,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aStartRowIndex,
|
2009-02-05 12:09:50 +03:00
|
|
|
nsTArray<nsTableRowFrame*>* aRowsToInsert,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aNumRowsToRemove,
|
2015-05-01 00:46:59 +03:00
|
|
|
TableArea& aDamageArea);
|
2006-06-28 22:56:10 +04:00
|
|
|
|
2006-12-07 05:32:57 +03:00
|
|
|
public:
|
2015-06-27 21:16:18 +03:00
|
|
|
void ResetBStartStart(mozilla::LogicalSide aSide,
|
|
|
|
nsCellMap& aCellMap,
|
2018-01-04 22:28:00 +03:00
|
|
|
uint32_t aRowGroupStart,
|
2015-06-27 21:16:18 +03:00
|
|
|
uint32_t aYPos,
|
|
|
|
uint32_t aXPos,
|
|
|
|
bool aIsBEndIEnd = false);
|
2002-02-19 18:48:28 +03:00
|
|
|
|
2015-06-27 21:16:03 +03:00
|
|
|
void SetBCBorderEdge(mozilla::LogicalSide aEdge,
|
2002-02-19 18:48:28 +03:00
|
|
|
nsCellMap& aCellMap,
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t aCellMapStart,
|
|
|
|
uint32_t aYPos,
|
|
|
|
uint32_t aXPos,
|
|
|
|
uint32_t aLength,
|
2002-02-19 18:48:28 +03:00
|
|
|
BCBorderOwner aOwner,
|
|
|
|
nscoord aSize,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aChanged);
|
2002-02-19 18:48:28 +03:00
|
|
|
|
2017-01-04 11:52:12 +03:00
|
|
|
void SetBCBorderCorner(mozilla::LogicalCorner aCorner,
|
2002-02-19 18:48:28 +03:00
|
|
|
nsCellMap& aCellMap,
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t aCellMapStart,
|
|
|
|
uint32_t aYPos,
|
|
|
|
uint32_t aXPos,
|
2015-06-27 21:16:03 +03:00
|
|
|
mozilla::LogicalSide aOwner,
|
2002-02-19 18:48:28 +03:00
|
|
|
nscoord aSubSize,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aBevel,
|
|
|
|
bool aIsBottomRight = false);
|
2002-02-19 18:48:28 +03:00
|
|
|
|
2000-01-13 08:29:38 +03:00
|
|
|
/** dump a representation of the cell map to stdout for debugging */
|
2012-06-25 23:59:42 +04:00
|
|
|
#ifdef DEBUG
|
2012-07-30 18:20:58 +04:00
|
|
|
void Dump(char* aString = nullptr) const;
|
2000-01-13 08:29:38 +03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
protected:
|
2015-06-27 21:16:18 +03:00
|
|
|
BCData* GetIEndMostBorder(int32_t aRowIndex);
|
|
|
|
BCData* GetBEndMostBorder(int32_t aColIndex);
|
2002-02-19 18:48:28 +03:00
|
|
|
|
2000-01-13 08:29:38 +03:00
|
|
|
friend class nsCellMap;
|
2002-02-19 18:48:28 +03:00
|
|
|
friend class BCMapCellIterator;
|
2009-11-05 12:26:00 +03:00
|
|
|
friend class BCPaintBorderIterator;
|
2007-01-22 07:32:33 +03:00
|
|
|
friend class nsCellMapColumnIterator;
|
2010-04-27 20:15:01 +04:00
|
|
|
|
2005-12-16 22:10:56 +03:00
|
|
|
/** Insert a row group cellmap after aPrevMap, if aPrefMap is null insert it
|
|
|
|
* at the beginning, the ordering of the cellmap corresponds to the ordering of
|
|
|
|
* rowgroups once OrderRowGroups has been called
|
|
|
|
*/
|
2000-01-13 08:29:38 +03:00
|
|
|
void InsertGroupCellMap(nsCellMap* aPrevMap,
|
|
|
|
nsCellMap& aNewMap);
|
2015-06-27 21:16:18 +03:00
|
|
|
void DeleteIEndBEndBorders();
|
2000-01-13 08:29:38 +03:00
|
|
|
|
2009-02-05 12:09:50 +03:00
|
|
|
nsTableFrame& mTableFrame;
|
2016-02-02 18:36:30 +03:00
|
|
|
AutoTArray<nsColInfo, 8> mCols;
|
2009-02-05 12:09:50 +03:00
|
|
|
nsCellMap* mFirstMap;
|
2002-02-19 18:48:28 +03:00
|
|
|
// border collapsing info
|
2009-02-05 12:09:50 +03:00
|
|
|
BCInfo* mBCInfo;
|
2000-01-13 08:29:38 +03:00
|
|
|
};
|
|
|
|
|
2010-04-27 20:15:01 +04:00
|
|
|
/** nsCellMap is a support class for nsTablePart.
|
1998-04-15 01:45:28 +04:00
|
|
|
* It maintains an Rows x Columns grid onto which the cells of the table are mapped.
|
|
|
|
* This makes processing of rowspan and colspan attributes much easier.
|
|
|
|
* Each cell is represented by a CellData object.
|
|
|
|
*
|
|
|
|
* @see CellData
|
1998-09-01 01:23:28 +04:00
|
|
|
* @see nsTableFrame::AddCellToMap
|
1998-06-17 20:38:24 +04:00
|
|
|
* @see nsTableFrame::GrowCellMap
|
|
|
|
* @see nsTableFrame::BuildCellIntoMap
|
1998-04-15 01:45:28 +04:00
|
|
|
*
|
2006-12-07 05:32:57 +03:00
|
|
|
* mRows is an array of rows. Each row is an array of cells. a cell
|
|
|
|
* can be null.
|
1998-04-14 00:24:54 +04:00
|
|
|
*/
|
|
|
|
class nsCellMap
|
|
|
|
{
|
2015-05-01 00:46:59 +03:00
|
|
|
typedef mozilla::TableArea TableArea;
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
public:
|
2010-04-27 20:15:01 +04:00
|
|
|
/** constructor
|
2006-01-14 00:08:17 +03:00
|
|
|
* @param aRowGroupFrame the row group frame this is a cellmap for
|
|
|
|
* @param aIsBC whether the table is doing border-collapse
|
|
|
|
*/
|
2011-09-29 10:19:26 +04:00
|
|
|
nsCellMap(nsTableRowGroupFrame* aRowGroupFrame, bool aIsBC);
|
1998-04-14 00:24:54 +04:00
|
|
|
|
1998-09-01 01:23:28 +04:00
|
|
|
/** destructor
|
2010-04-27 20:15:01 +04:00
|
|
|
* NOT VIRTUAL BECAUSE THIS CLASS SHOULD **NEVER** BE SUBCLASSED
|
2006-01-14 00:08:17 +03:00
|
|
|
*/
|
1998-04-14 00:24:54 +04:00
|
|
|
~nsCellMap();
|
|
|
|
|
2011-07-15 14:18:33 +04:00
|
|
|
static void Init();
|
2007-02-13 19:23:19 +03:00
|
|
|
static void Shutdown();
|
|
|
|
|
2000-01-13 08:29:38 +03:00
|
|
|
nsCellMap* GetNextSibling() const;
|
|
|
|
void SetNextSibling(nsCellMap* aSibling);
|
|
|
|
|
|
|
|
nsTableRowGroupFrame* GetRowGroup() const;
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
nsTableCellFrame* GetCellFrame(int32_t aRowIndex,
|
|
|
|
int32_t aColIndex,
|
2000-01-13 08:29:38 +03:00
|
|
|
CellData& aData,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aUseRowSpanIfOverlap) const;
|
2000-01-13 08:29:38 +03:00
|
|
|
|
2009-06-29 14:54:26 +04:00
|
|
|
/**
|
|
|
|
* Returns highest cell index within the cell map.
|
|
|
|
*
|
|
|
|
* @param aColCount [in] the number of columns in the table
|
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t GetHighestIndex(int32_t aColCount);
|
2009-06-29 14:54:26 +04:00
|
|
|
|
2008-02-07 10:03:26 +03:00
|
|
|
/**
|
|
|
|
* Returns the index of the given row and column coordinates.
|
|
|
|
*
|
|
|
|
* @see nsITableLayout::GetIndexByRowAndColumn()
|
|
|
|
*
|
2009-06-29 14:54:26 +04:00
|
|
|
* @param aColCount [in] the number of columns in the table
|
|
|
|
* @param aRow [in] the row coordinate
|
|
|
|
* @param aColumn [in] the column coordinate
|
2008-02-07 10:03:26 +03:00
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t GetIndexByRowAndColumn(int32_t aColCount,
|
|
|
|
int32_t aRow, int32_t aColumn) const;
|
2008-02-07 10:03:26 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the row and column coordinates at the given index.
|
|
|
|
*
|
|
|
|
* @see nsITableLayout::GetRowAndColumnByIndex()
|
|
|
|
*
|
2009-06-29 14:54:26 +04:00
|
|
|
* @param aColCount [in] the number of columns in the table
|
2008-02-07 10:03:26 +03:00
|
|
|
* @param aIndex [in] the index for which coordinates are to be retrieved
|
|
|
|
* @param aRow [out] the row coordinate to be returned
|
|
|
|
* @param aColumn [out] the column coordinate to be returned
|
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
void GetRowAndColumnByIndex(int32_t aColCount, int32_t aIndex,
|
|
|
|
int32_t *aRow, int32_t *aColumn) const;
|
2008-02-07 10:03:26 +03:00
|
|
|
|
2010-04-27 20:15:01 +04:00
|
|
|
/** append the cellFrame at an empty or dead cell or finally at the end of
|
|
|
|
* the row at aRowIndex and return a pointer to the celldata entry in the
|
2003-01-18 17:02:52 +03:00
|
|
|
* cellmap
|
|
|
|
*
|
|
|
|
* @param aMap - reference to the table cell map
|
2010-04-27 20:15:01 +04:00
|
|
|
* @param aCellFrame - a pointer to the cellframe which will be appended
|
2003-01-18 17:02:52 +03:00
|
|
|
* to the row
|
|
|
|
* @param aRowIndex - to this row the celldata entry will be added
|
2010-04-27 20:15:01 +04:00
|
|
|
* @param aRebuildIfNecessay - if a cell spans into a row below it might be
|
|
|
|
* necesserary to rebuild the cellmap as this rowspan
|
2003-01-18 17:02:52 +03:00
|
|
|
* might overlap another cell.
|
|
|
|
* @param aDamageArea - area in cellmap coordinates which have been updated.
|
2010-04-27 20:15:01 +04:00
|
|
|
* @param aColToBeginSearch - if not null contains the column number where
|
|
|
|
* the search for a empty or dead cell in the
|
2003-01-18 17:02:52 +03:00
|
|
|
* row should start
|
2010-04-27 20:15:01 +04:00
|
|
|
* @return - a pointer to the celldata entry inserted into
|
2003-01-18 17:02:52 +03:00
|
|
|
* the cellmap
|
1999-07-28 12:09:02 +04:00
|
|
|
*/
|
2002-02-19 18:48:28 +03:00
|
|
|
CellData* AppendCell(nsTableCellMap& aMap,
|
2010-04-27 20:15:01 +04:00
|
|
|
nsTableCellFrame* aCellFrame,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aRowIndex,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aRebuildIfNecessary,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aRgFirstRowIndex,
|
2015-05-01 00:46:59 +03:00
|
|
|
TableArea& aDamageArea,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t* aBeginSearchAtCol = nullptr);
|
1999-12-14 01:56:31 +03:00
|
|
|
|
2009-02-05 12:09:50 +03:00
|
|
|
void InsertCells(nsTableCellMap& aMap,
|
|
|
|
nsTArray<nsTableCellFrame*>& aCellFrames,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aRowIndex,
|
|
|
|
int32_t aColIndexBefore,
|
|
|
|
int32_t aRgFirstRowIndex,
|
2015-05-01 00:46:59 +03:00
|
|
|
TableArea& aDamageArea);
|
1998-04-14 00:24:54 +04:00
|
|
|
|
2000-01-13 08:29:38 +03:00
|
|
|
void RemoveCell(nsTableCellMap& aMap,
|
|
|
|
nsTableCellFrame* aCellFrame,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aRowIndex,
|
|
|
|
int32_t aRgFirstRowIndex,
|
2015-05-01 00:46:59 +03:00
|
|
|
TableArea& aDamageArea);
|
1999-12-14 01:56:31 +03:00
|
|
|
|
2009-02-05 12:09:50 +03:00
|
|
|
void InsertRows(nsTableCellMap& aMap,
|
|
|
|
nsTArray<nsTableRowFrame*>& aRows,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aFirstRowIndex,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aConsiderSpans,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aRgFirstRowIndex,
|
2015-05-01 00:46:59 +03:00
|
|
|
TableArea& aDamageArea);
|
1999-12-14 01:56:31 +03:00
|
|
|
|
2004-01-18 13:28:40 +03:00
|
|
|
void RemoveRows(nsTableCellMap& aMap,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aFirstRowIndex,
|
|
|
|
int32_t aNumRowsToRemove,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aConsiderSpans,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aRgFirstRowIndex,
|
2015-05-01 00:46:59 +03:00
|
|
|
TableArea& aDamageArea);
|
1999-02-11 09:22:33 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t GetNumCellsOriginatingInRow(int32_t aRowIndex) const;
|
|
|
|
int32_t GetNumCellsOriginatingInCol(int32_t aColIndex) const;
|
1999-02-11 09:22:33 +03:00
|
|
|
|
2001-03-29 01:25:13 +04:00
|
|
|
/** return the number of rows in the table represented by this CellMap */
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t GetRowCount(bool aConsiderDeadRowSpanRows = false) const;
|
1998-07-11 04:00:31 +04:00
|
|
|
|
2006-10-20 11:37:24 +04:00
|
|
|
nsTableCellFrame* GetCellInfoAt(const nsTableCellMap& aMap,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aRowX,
|
|
|
|
int32_t aColX,
|
2012-07-30 18:20:58 +04:00
|
|
|
bool* aOriginates = nullptr,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t* aColSpan = nullptr) const;
|
1998-09-19 02:37:14 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
bool RowIsSpannedInto(int32_t aRowIndex,
|
|
|
|
int32_t aNumEffCols) const;
|
2000-01-13 08:29:38 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
bool RowHasSpanningCells(int32_t aRowIndex,
|
|
|
|
int32_t aNumEffCols) const;
|
2000-01-13 08:29:38 +03:00
|
|
|
|
2004-04-13 10:21:16 +04:00
|
|
|
/** indicate whether the row has more than one cell that either originates
|
|
|
|
* or is spanned from the rows above
|
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
bool HasMoreThanOneCell(int32_t aRowIndex) const;
|
2004-04-13 10:21:16 +04:00
|
|
|
|
2010-04-27 20:15:01 +04:00
|
|
|
/* Get the rowspan for a cell starting at aRowIndex and aColIndex.
|
2007-01-01 21:18:53 +03:00
|
|
|
* If aGetEffective is true the size will not exceed the last content based
|
|
|
|
* row. Cells can have a specified rowspan that extends below the last
|
|
|
|
* content based row. This is legitimate considering incr. reflow where the
|
2010-04-27 20:15:01 +04:00
|
|
|
* content rows will arive later.
|
2007-01-01 21:18:53 +03:00
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t GetRowSpan(int32_t aRowIndex,
|
|
|
|
int32_t aColIndex,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aGetEffective) const;
|
2002-02-19 18:48:28 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t GetEffectiveColSpan(const nsTableCellMap& aMap,
|
|
|
|
int32_t aRowIndex,
|
2016-01-27 19:02:12 +03:00
|
|
|
int32_t aColIndex) const;
|
2002-02-19 18:48:28 +03:00
|
|
|
|
2011-08-10 09:36:00 +04:00
|
|
|
typedef nsTArray<CellData*> CellDataArray;
|
2006-12-07 05:32:57 +03:00
|
|
|
|
1998-09-19 02:37:14 +04:00
|
|
|
/** dump a representation of the cell map to stdout for debugging */
|
2012-06-25 23:59:42 +04:00
|
|
|
#ifdef DEBUG
|
2011-09-29 10:19:26 +04:00
|
|
|
void Dump(bool aIsBorderCollapse) const;
|
1999-07-28 12:09:02 +04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
protected:
|
2000-01-13 08:29:38 +03:00
|
|
|
friend class nsTableCellMap;
|
2002-02-19 18:48:28 +03:00
|
|
|
friend class BCMapCellIterator;
|
2009-11-05 12:26:00 +03:00
|
|
|
friend class BCPaintBorderIterator;
|
2002-02-19 18:48:28 +03:00
|
|
|
friend class nsTableFrame;
|
2007-01-22 07:32:33 +03:00
|
|
|
friend class nsCellMapColumnIterator;
|
2000-01-13 08:29:38 +03:00
|
|
|
|
2006-12-07 05:32:57 +03:00
|
|
|
/**
|
|
|
|
* Increase the number of rows in this cellmap by aNumRows. Put the
|
|
|
|
* new rows at aRowIndex. If aRowIndex is -1, put them at the end.
|
|
|
|
*/
|
2011-09-29 10:19:26 +04:00
|
|
|
bool Grow(nsTableCellMap& aMap,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aNumRows,
|
|
|
|
int32_t aRowIndex = -1);
|
2000-01-13 08:29:38 +03:00
|
|
|
|
2006-12-07 05:32:57 +03:00
|
|
|
void GrowRow(CellDataArray& aRow,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aNumCols);
|
1999-07-28 12:09:02 +04:00
|
|
|
|
|
|
|
/** assign aCellData to the cell at (aRow,aColumn) */
|
2002-02-19 18:48:28 +03:00
|
|
|
void SetDataAt(nsTableCellMap& aMap,
|
2010-04-27 20:15:01 +04:00
|
|
|
CellData& aCellData,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aMapRowIndex,
|
|
|
|
int32_t aColIndex);
|
1999-07-28 12:09:02 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
CellData* GetDataAt(int32_t aMapRowIndex,
|
|
|
|
int32_t aColIndex) const;
|
1999-07-28 12:09:02 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t GetNumCellsIn(int32_t aColIndex) const;
|
1999-12-14 01:56:31 +03:00
|
|
|
|
2009-02-05 12:09:50 +03:00
|
|
|
void ExpandWithRows(nsTableCellMap& aMap,
|
|
|
|
nsTArray<nsTableRowFrame*>& aRowFrames,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aStartRowIndex,
|
|
|
|
int32_t aRgFirstRowIndex,
|
2015-05-01 00:46:59 +03:00
|
|
|
TableArea& aDamageArea);
|
1999-07-28 12:09:02 +04:00
|
|
|
|
2009-02-05 12:09:50 +03:00
|
|
|
void ExpandWithCells(nsTableCellMap& aMap,
|
|
|
|
nsTArray<nsTableCellFrame*>& aCellFrames,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aRowIndex,
|
|
|
|
int32_t aColIndex,
|
|
|
|
int32_t aRowSpan,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aRowSpanIsZero,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aRgFirstRowIndex,
|
2015-05-01 00:46:59 +03:00
|
|
|
TableArea& aDamageArea);
|
1999-12-14 01:56:31 +03:00
|
|
|
|
2000-01-13 08:29:38 +03:00
|
|
|
void ShrinkWithoutRows(nsTableCellMap& aMap,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aFirstRowIndex,
|
|
|
|
int32_t aNumRowsToRemove,
|
|
|
|
int32_t aRgFirstRowIndex,
|
2015-05-01 00:46:59 +03:00
|
|
|
TableArea& aDamageArea);
|
1999-12-14 01:56:31 +03:00
|
|
|
|
2000-01-13 08:29:38 +03:00
|
|
|
void ShrinkWithoutCell(nsTableCellMap& aMap,
|
|
|
|
nsTableCellFrame& aCellFrame,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aRowIndex,
|
|
|
|
int32_t aColIndex,
|
|
|
|
int32_t aRgFirstRowIndex,
|
2015-05-01 00:46:59 +03:00
|
|
|
TableArea& aDamageArea);
|
1999-12-14 01:56:31 +03:00
|
|
|
|
2006-12-07 05:32:57 +03:00
|
|
|
/**
|
|
|
|
* Rebuild due to rows being inserted or deleted with cells spanning
|
|
|
|
* into or out of the rows. This function can only handle insertion
|
|
|
|
* or deletion but NOT both. So either aRowsToInsert must be null
|
|
|
|
* or aNumRowsToRemove must be 0.
|
|
|
|
*
|
|
|
|
* // XXXbz are both allowed to happen? That'd be a no-op...
|
|
|
|
*/
|
2009-02-05 12:09:50 +03:00
|
|
|
void RebuildConsideringRows(nsTableCellMap& aMap,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aStartRowIndex,
|
2009-02-05 12:09:50 +03:00
|
|
|
nsTArray<nsTableRowFrame*>* aRowsToInsert,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aNumRowsToRemove);
|
2009-02-05 12:09:50 +03:00
|
|
|
|
|
|
|
void RebuildConsideringCells(nsTableCellMap& aMap,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aNumOrigCols,
|
2009-02-05 12:09:50 +03:00
|
|
|
nsTArray<nsTableCellFrame*>* aCellFrames,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aRowIndex,
|
|
|
|
int32_t aColIndex,
|
2011-10-27 17:58:44 +04:00
|
|
|
bool aInsert);
|
2009-02-05 12:09:50 +03:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool CellsSpanOut(nsTArray<nsTableRowFrame*>& aNewRows) const;
|
2010-04-27 20:15:01 +04:00
|
|
|
|
2006-08-02 15:57:48 +04:00
|
|
|
/** If a cell spans out of the area defined by aStartRowIndex, aEndRowIndex
|
|
|
|
* and aStartColIndex, aEndColIndex the cellmap changes are more severe so
|
|
|
|
* the corresponding routines needs to be called. This is also necessary if
|
|
|
|
* cells outside spans into this region.
|
|
|
|
* @aStartRowIndex - y start index
|
|
|
|
* @aEndRowIndex - y end index
|
|
|
|
* @param aStartColIndex - x start index
|
|
|
|
* @param aEndColIndex - x end index
|
|
|
|
* @return - true if a cell span crosses the border of the
|
|
|
|
region
|
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
bool CellsSpanInOrOut(int32_t aStartRowIndex,
|
|
|
|
int32_t aEndRowIndex,
|
|
|
|
int32_t aStartColIndex,
|
|
|
|
int32_t aEndColIndex) const;
|
2000-01-13 08:29:38 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
bool CreateEmptyRow(int32_t aRowIndex,
|
|
|
|
int32_t aNumCols);
|
2000-01-04 08:31:56 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t GetRowSpanForNewCell(nsTableCellFrame* aCellFrameToAdd,
|
|
|
|
int32_t aRowIndex,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool& aIsZeroRowSpan) const;
|
2000-02-01 06:23:29 +03:00
|
|
|
|
2006-01-14 00:08:17 +03:00
|
|
|
// Destroy a CellData struct. This will handle the case of aData
|
|
|
|
// actually being a BCCellData properly.
|
|
|
|
void DestroyCellData(CellData* aData);
|
|
|
|
// Allocate a CellData struct. This will handle needing to create a
|
|
|
|
// BCCellData properly.
|
|
|
|
// @param aOrigCell the originating cell to pass to the celldata constructor
|
|
|
|
CellData* AllocCellData(nsTableCellFrame* aOrigCell);
|
|
|
|
|
2006-12-07 05:32:57 +03:00
|
|
|
/** an array containing, for each row, the CellDatas for the cells
|
2006-12-26 17:04:20 +03:00
|
|
|
* in that row. It can be larger than mContentRowCount due to row spans
|
2006-12-07 05:32:57 +03:00
|
|
|
* extending beyond the table */
|
|
|
|
// XXXbz once we have auto TArrays, we should probably use them here.
|
2010-04-27 20:15:01 +04:00
|
|
|
nsTArray<CellDataArray> mRows;
|
1999-07-28 12:09:02 +04:00
|
|
|
|
2006-08-02 15:57:48 +04:00
|
|
|
/** the number of rows in the table (content) which is not indentical to the
|
|
|
|
* number of rows in the cell map due to row spans extending beyond the end
|
2010-04-27 20:15:01 +04:00
|
|
|
* of thetable (dead rows) or empty tr tags
|
2006-08-02 15:57:48 +04:00
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t mContentRowCount;
|
1999-07-28 12:09:02 +04:00
|
|
|
|
2000-01-13 08:29:38 +03:00
|
|
|
// the row group that corresponds to this map
|
|
|
|
nsTableRowGroupFrame* mRowGroupFrame;
|
|
|
|
|
|
|
|
// the next row group cell map
|
|
|
|
nsCellMap* mNextSibling;
|
|
|
|
|
2006-01-14 00:08:17 +03:00
|
|
|
// Whether this is a BC cellmap or not
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mIsBC;
|
2006-12-07 05:32:57 +03:00
|
|
|
|
|
|
|
// Prescontext to deallocate and allocate celldata
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<nsPresContext> mPresContext;
|
1998-04-14 00:24:54 +04:00
|
|
|
};
|
|
|
|
|
2007-01-22 07:32:33 +03:00
|
|
|
/**
|
|
|
|
* A class for iterating the cells in a given column. Must be given a
|
|
|
|
* non-null nsTableCellMap and a column number valid for that cellmap.
|
|
|
|
*/
|
|
|
|
class nsCellMapColumnIterator
|
|
|
|
{
|
|
|
|
public:
|
2018-04-10 22:11:02 +03:00
|
|
|
nsCellMapColumnIterator(const nsTableCellMap* aMap, int32_t aCol)
|
|
|
|
: mMap(aMap)
|
|
|
|
, mCurMap(aMap->mFirstMap)
|
|
|
|
, mCurMapStart(0)
|
|
|
|
, mCurMapRow(0)
|
|
|
|
, mCol(aCol)
|
|
|
|
, mFoundCells(0)
|
|
|
|
, mCurMapContentRowCount{}
|
|
|
|
, mCurMapRelevantRowCount{}
|
2007-01-22 07:32:33 +03:00
|
|
|
{
|
|
|
|
NS_PRECONDITION(aMap, "Must have map");
|
|
|
|
NS_PRECONDITION(mCol < aMap->GetColCount(), "Invalid column");
|
|
|
|
mOrigCells = aMap->GetNumCellsOriginatingInCol(mCol);
|
|
|
|
if (mCurMap) {
|
2007-01-24 23:23:08 +03:00
|
|
|
mCurMapContentRowCount = mCurMap->GetRowCount();
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t rowArrayLength = mCurMap->mRows.Length();
|
2013-01-15 16:22:03 +04:00
|
|
|
mCurMapRelevantRowCount = std::min(mCurMapContentRowCount, rowArrayLength);
|
2007-01-28 19:49:26 +03:00
|
|
|
if (mCurMapRelevantRowCount == 0 && mOrigCells > 0) {
|
2007-01-24 23:18:04 +03:00
|
|
|
// This row group is useless; advance!
|
|
|
|
AdvanceRowGroup();
|
|
|
|
}
|
2007-01-22 07:32:33 +03:00
|
|
|
}
|
2007-01-28 19:49:26 +03:00
|
|
|
#ifdef DEBUG
|
|
|
|
else {
|
|
|
|
NS_ASSERTION(mOrigCells == 0, "Why no rowgroups?");
|
|
|
|
}
|
|
|
|
#endif
|
2007-01-22 07:32:33 +03:00
|
|
|
}
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
nsTableCellFrame* GetNextFrame(int32_t* aRow, int32_t* aColSpan);
|
2010-04-27 20:15:01 +04:00
|
|
|
|
2007-01-22 07:32:33 +03:00
|
|
|
private:
|
|
|
|
void AdvanceRowGroup();
|
|
|
|
|
|
|
|
// Advance the row; aIncrement is considered to be a cell's rowspan,
|
|
|
|
// so if 0 is passed in we'll advance to the next rowgroup.
|
2012-08-22 19:56:38 +04:00
|
|
|
void IncrementRow(int32_t aIncrement);
|
2007-01-22 07:32:33 +03:00
|
|
|
|
|
|
|
const nsTableCellMap* mMap;
|
|
|
|
const nsCellMap* mCurMap;
|
2007-01-24 23:18:04 +03:00
|
|
|
|
2007-01-28 19:49:26 +03:00
|
|
|
// mCurMapStart is the row in the entire nsTableCellMap where
|
|
|
|
// mCurMap starts. This is used to compute row indices to pass to
|
|
|
|
// nsTableCellMap::GetDataAt, so must be a _content_ row index.
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mCurMapStart;
|
2010-04-27 20:15:01 +04:00
|
|
|
|
2007-01-24 23:18:04 +03:00
|
|
|
// In steady-state mCurMapRow is the row in our current nsCellMap
|
|
|
|
// that we'll use the next time GetNextFrame() is called. Due to
|
|
|
|
// the way we skip over rowspans, the entry in mCurMapRow and mCol
|
|
|
|
// is either null, dead, originating, or a colspan. In particular,
|
|
|
|
// it cannot be a rowspan or overlap entry.
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mCurMapRow;
|
|
|
|
const int32_t mCol;
|
|
|
|
uint32_t mOrigCells;
|
|
|
|
uint32_t mFoundCells;
|
2007-01-28 19:49:26 +03:00
|
|
|
|
|
|
|
// The number of content rows in mCurMap. This may be bigger than the number
|
|
|
|
// of "relevant" rows, or it might be smaller.
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mCurMapContentRowCount;
|
2007-01-28 19:49:26 +03:00
|
|
|
|
|
|
|
// The number of "relevant" rows in mCurMap. That is, the number of rows
|
|
|
|
// which might have an originating cell in them. Once mCurMapRow reaches
|
|
|
|
// mCurMapRelevantRowCount, we should move to the next map.
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mCurMapRelevantRowCount;
|
2007-01-22 07:32:33 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
1998-07-11 04:00:31 +04:00
|
|
|
/* ----- inline methods ----- */
|
2012-08-22 19:56:38 +04:00
|
|
|
inline int32_t nsTableCellMap::GetColCount() const
|
1999-07-28 12:09:02 +04:00
|
|
|
{
|
2009-02-05 12:09:50 +03:00
|
|
|
return mCols.Length();
|
1999-07-28 12:09:02 +04:00
|
|
|
}
|
1998-07-11 04:00:31 +04:00
|
|
|
|
2000-01-13 08:29:38 +03:00
|
|
|
inline nsCellMap* nsCellMap::GetNextSibling() const
|
1998-06-08 23:57:04 +04:00
|
|
|
{
|
2000-01-13 08:29:38 +03:00
|
|
|
return mNextSibling;
|
1998-06-08 23:57:04 +04:00
|
|
|
}
|
|
|
|
|
2000-01-13 08:29:38 +03:00
|
|
|
inline void nsCellMap::SetNextSibling(nsCellMap* aSibling)
|
|
|
|
{
|
|
|
|
mNextSibling = aSibling;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline nsTableRowGroupFrame* nsCellMap::GetRowGroup() const
|
|
|
|
{
|
|
|
|
return mRowGroupFrame;
|
1998-06-08 23:57:04 +04:00
|
|
|
}
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
inline int32_t nsCellMap::GetRowCount(bool aConsiderDeadRowSpanRows) const
|
2010-04-27 20:15:01 +04:00
|
|
|
{
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t rowCount = (aConsiderDeadRowSpanRows) ? mRows.Length() : mContentRowCount;
|
2010-04-27 20:15:01 +04:00
|
|
|
return rowCount;
|
1998-06-08 23:57:04 +04:00
|
|
|
}
|
|
|
|
|
1999-12-14 01:56:31 +03:00
|
|
|
// nsColInfo
|
1998-07-11 04:00:31 +04:00
|
|
|
|
1999-12-14 01:56:31 +03:00
|
|
|
inline nsColInfo::nsColInfo()
|
2010-04-27 20:15:01 +04:00
|
|
|
:mNumCellsOrig(0), mNumCellsSpan(0)
|
1999-12-14 01:56:31 +03:00
|
|
|
{}
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
inline nsColInfo::nsColInfo(int32_t aNumCellsOrig,
|
|
|
|
int32_t aNumCellsSpan)
|
2010-04-27 20:15:01 +04:00
|
|
|
:mNumCellsOrig(aNumCellsOrig), mNumCellsSpan(aNumCellsSpan)
|
1999-12-14 01:56:31 +03:00
|
|
|
{}
|
1998-10-14 20:32:45 +04:00
|
|
|
|
1998-07-11 04:00:31 +04:00
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
#endif
|