Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Private Member Functions
BCMapBorderIterator Class Reference
Collaboration diagram for BCMapBorderIterator:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 BCMapBorderIterator (nsTableFrame &aTableFrame, nsTableRowGroupFrame &aRowGroupFrame, nsTableRowFrame &aRowFrame, const nsRect &aDamageArea)
void Reset (nsTableFrame &aTableFrame, nsTableRowGroupFrame &aRowGroupFrame, nsTableRowFrame &aRowFrame, const nsRect &aDamageArea)
void First ()
void Next ()
PRBool IsTopMostTable ()
PRBool IsRightMostTable ()
PRBool IsBottomMostTable ()
PRBool IsLeftMostTable ()
PRBool IsTopMost ()
PRBool IsRightMost ()
PRBool IsBottomMost ()
PRBool IsLeftMost ()

Public Attributes

nsTableFrametable
nsTableCellMaptableCellMap
nsCellMapcellMap
nsVoidArray rowGroups
nsTableRowGroupFrameprevRg
nsTableRowGroupFramerg
PRInt32 rowGroupIndex
PRInt32 fifRowGroupStart
PRInt32 rowGroupStart
PRInt32 rowGroupEnd
PRInt32 numRows
nsTableRowFrameprevRow
nsTableRowFramerow
PRInt32 numCols
PRInt32 x
PRInt32 y
nsTableCellFrameprevCell
nsTableCellFramecell
BCCellDataprevCellData
BCCellDatacellData
BCDatabcData
PRBool isNewRow
PRInt32 startX
PRInt32 startY
PRInt32 endX
PRInt32 endY
PRBool isRepeatedHeader
PRBool isRepeatedFooter
PRBool atEnd

Private Member Functions

PRBool SetNewRow (nsTableRowFrame *aRow=nsnull)
PRBool SetNewRowGroup ()
void SetNewData (PRInt32 aY, PRInt32 aX)

Detailed Description

Definition at line 6418 of file nsTableFrame.cpp.


Constructor & Destructor Documentation

BCMapBorderIterator::BCMapBorderIterator ( nsTableFrame aTableFrame,
nsTableRowGroupFrame aRowGroupFrame,
nsTableRowFrame aRowFrame,
const nsRect aDamageArea 
)

Definition at line 6483 of file nsTableFrame.cpp.

{
  Reset(aTable, aRowGroup, aRow, aDamageArea);
}

Here is the call graph for this function:


Member Function Documentation

Definition at line 6634 of file nsTableFrame.cpp.

{
  if (!table || (startX >= numCols) || (startY >= numRows)) ABORT0();

  atEnd = PR_FALSE;

  PRUint32 numRowGroups = rowGroups.Count();
  for (PRUint32 rgX = 0; rgX < numRowGroups; rgX++) { 
    nsIFrame* frame = (nsIFrame*)rowGroups.ElementAt(rgX);
    nsTableRowGroupFrame* rowG = table->GetRowGroupFrame(frame);
    if (rowG) {
      PRInt32 start = rowG->GetStartRowIndex();
      PRInt32 end   = start + rowG->GetRowCount() - 1;
      if ((startY >= start) && (startY <= end)) {
        rowGroupIndex = rgX - 1; // SetNewRowGroup increments rowGroupIndex
        if (SetNewRowGroup()) { 
          while ((y < startY) && !atEnd) {
            SetNewRow();
          }
          if (!atEnd) {
            SetNewData(startY, startX);
          }
        }
        return;
      }
    }
  }
  atEnd = PR_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 6463 of file nsTableFrame.cpp.

{ return (y >= endY); }

Here is the caller graph for this function:

Definition at line 6459 of file nsTableFrame.cpp.

{ return (y >= numRows) && !table->GetNextInFlow(); }

Here is the caller graph for this function:

Definition at line 6464 of file nsTableFrame.cpp.

{ return (x == startX); }

Here is the caller graph for this function:

Definition at line 6460 of file nsTableFrame.cpp.

{ return (x == 0); }

Here is the caller graph for this function:

Definition at line 6462 of file nsTableFrame.cpp.

{ return (x >= endX); }

Here is the caller graph for this function:

Definition at line 6458 of file nsTableFrame.cpp.

{ return (x >= numCols); }

Here is the caller graph for this function:

Definition at line 6461 of file nsTableFrame.cpp.

{ return (y == startY); }

Here is the caller graph for this function:

Definition at line 6457 of file nsTableFrame.cpp.

{ return (y == 0) && !table->GetPrevInFlow(); }

Here is the caller graph for this function:

Definition at line 6665 of file nsTableFrame.cpp.

{
  if (atEnd) ABORT0();
  isNewRow = PR_FALSE;

  x++;
  if (x > endX) {
    y++;
    if (y == endY) {
      x = startX;
    }
    else if (y < endY) {
      if (y <= rowGroupEnd) {
        SetNewRow();
      }
      else {
        SetNewRowGroup();
      }
    }
    else {
      atEnd = PR_TRUE;
    }
  }
  if (!atEnd) {
    SetNewData(y, x);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void BCMapBorderIterator::Reset ( nsTableFrame aTableFrame,
nsTableRowGroupFrame aRowGroupFrame,
nsTableRowFrame aRowFrame,
const nsRect aDamageArea 
)

Definition at line 6492 of file nsTableFrame.cpp.

{
  atEnd = PR_TRUE; // gets reset when First() is called

  table   = &aTable;
  rg      = &aRowGroup; 
  prevRow = nsnull;
  row     = &aRow;                     

  nsTableFrame* tableFif = (nsTableFrame*)table->GetFirstInFlow(); if (!tableFif) ABORT0();
  tableCellMap = tableFif->GetCellMap();

  startX   = aDamageArea.x;
  startY   = aDamageArea.y;
  endY     = aDamageArea.y + aDamageArea.height;
  endX     = aDamageArea.x + aDamageArea.width;

  numRows       = tableFif->GetRowCount();
  y             = 0;
  numCols       = tableFif->GetColCount();
  x             = 0;
  rowGroupIndex = -1;
  prevCell      = nsnull;
  cell          = nsnull;
  prevCellData  = nsnull;
  cellData      = nsnull;
  bcData        = nsnull;

  // Get the ordered row groups 
  PRUint32 numRowGroups;
  table->OrderRowGroups(rowGroups, numRowGroups, nsnull);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 6529 of file nsTableFrame.cpp.

{
  if (!tableCellMap || !tableCellMap->mBCInfo) ABORT0();

  x            = aX;
  y            = aY;
  prevCellData = cellData;
  if (IsRightMost() && IsBottomMost()) {
    cell = nsnull;
    bcData = &tableCellMap->mBCInfo->mLowerRightCorner;
  }
  else if (IsRightMost()) {
    cellData = nsnull;
    bcData = (BCData*)tableCellMap->mBCInfo->mRightBorders.ElementAt(aY);
  }
  else if (IsBottomMost()) {
    cellData = nsnull;
    bcData = (BCData*)tableCellMap->mBCInfo->mBottomBorders.ElementAt(aX);
  }
  else {
    bcData = nsnull;
    nsVoidArray* row = (nsVoidArray*)cellMap->mRows.ElementAt(y - fifRowGroupStart);
    if (row) {
      cellData = (row->Count() > x) ? (BCCellData*)row->ElementAt(x) : nsnull;
      if (cellData) {
        bcData = &cellData->mData;
        if (!cellData->IsOrig()) {
          if (cellData->IsRowSpan()) {
            aY -= cellData->GetRowSpanOffset();
          }
          if (cellData->IsColSpan()) {
            aX -= cellData->GetColSpanOffset();
          }
          if ((aX >= 0) && (aY >= 0)) {
            row = (nsVoidArray*)cellMap->mRows.ElementAt(aY - fifRowGroupStart);
            if (row) {
              cellData = (BCCellData*)row->ElementAt(aX);
            }
          }
        }
        if (cellData->IsOrig()) {
          prevCell = cell;
          cell = cellData->GetCellFrame();
        }
      }
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 6580 of file nsTableFrame.cpp.

{
  prevRow = row;
  row      = (aRow) ? aRow : row->GetNextRow();
 
  if (row) {
    isNewRow = PR_TRUE;
    y = row->GetRowIndex();
    x = startX;
  }
  else {
    atEnd = PR_TRUE;
  }
  return !atEnd;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 6598 of file nsTableFrame.cpp.

{
  rowGroupIndex++;

  isRepeatedHeader = PR_FALSE;
  isRepeatedFooter = PR_FALSE;

  if (rowGroupIndex < rowGroups.Count()) {
    prevRg = rg;
    nsIFrame* frame = (nsTableRowGroupFrame*)rowGroups.ElementAt(rowGroupIndex); if (!frame) ABORT1(PR_FALSE);
    rg = table->GetRowGroupFrame(frame); if (!rg) ABORT1(PR_FALSE);
    fifRowGroupStart = ((nsTableRowGroupFrame*)rg->GetFirstInFlow())->GetStartRowIndex();
    rowGroupStart    = rg->GetStartRowIndex(); 
    rowGroupEnd      = rowGroupStart + rg->GetRowCount() - 1;

    if (SetNewRow(rg->GetFirstRow())) {
      cellMap = tableCellMap->GetMapFor(*(nsTableRowGroupFrame*)rg->GetFirstInFlow()); if (!cellMap) ABORT1(PR_FALSE);
    }
    if (rg && table->GetPrevInFlow() && !rg->GetPrevInFlow()) {
      // if rg doesn't have a prev in flow, then it may be a repeated header or footer
      const nsStyleDisplay* display = rg->GetStyleDisplay();
      if (y == startY) {
        isRepeatedHeader = (NS_STYLE_DISPLAY_TABLE_HEADER_GROUP == display->mDisplay);
      }
      else {
        isRepeatedFooter = (NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP == display->mDisplay);
      }
    }
  }
  else {
    atEnd = PR_TRUE;
  }
  return !atEnd;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 6473 of file nsTableFrame.cpp.

Definition at line 6455 of file nsTableFrame.cpp.

Definition at line 6452 of file nsTableFrame.cpp.

Definition at line 6454 of file nsTableFrame.cpp.

Definition at line 6434 of file nsTableFrame.cpp.

Definition at line 6469 of file nsTableFrame.cpp.

Definition at line 6470 of file nsTableFrame.cpp.

Definition at line 6440 of file nsTableFrame.cpp.

Definition at line 6465 of file nsTableFrame.cpp.

Definition at line 6472 of file nsTableFrame.cpp.

Definition at line 6471 of file nsTableFrame.cpp.

Definition at line 6447 of file nsTableFrame.cpp.

Definition at line 6443 of file nsTableFrame.cpp.

Definition at line 6451 of file nsTableFrame.cpp.

Definition at line 6453 of file nsTableFrame.cpp.

Definition at line 6437 of file nsTableFrame.cpp.

Definition at line 6445 of file nsTableFrame.cpp.

Definition at line 6438 of file nsTableFrame.cpp.

Definition at line 6446 of file nsTableFrame.cpp.

Definition at line 6442 of file nsTableFrame.cpp.

Definition at line 6439 of file nsTableFrame.cpp.

Definition at line 6436 of file nsTableFrame.cpp.

Definition at line 6441 of file nsTableFrame.cpp.

Definition at line 6467 of file nsTableFrame.cpp.

Definition at line 6468 of file nsTableFrame.cpp.

Definition at line 6432 of file nsTableFrame.cpp.

Definition at line 6433 of file nsTableFrame.cpp.

Definition at line 6448 of file nsTableFrame.cpp.

Definition at line 6449 of file nsTableFrame.cpp.


The documentation for this class was generated from the following file: