本文整理汇总了C++中nsTableFrame::GetColCount方法的典型用法代码示例。如果您正苦于以下问题:C++ nsTableFrame::GetColCount方法的具体用法?C++ nsTableFrame::GetColCount怎么用?C++ nsTableFrame::GetColCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nsTableFrame
的用法示例。
在下文中一共展示了nsTableFrame::GetColCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: iter
nsresult
nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsTableFrame& aTableFrame,
nsReflowStatus& aStatus)
{
aStatus = NS_FRAME_COMPLETE;
// XXXldb Should we be checking constrained height instead?
const bool isPaginated = aPresContext->IsPaginated();
const bool borderCollapse = aTableFrame.IsBorderCollapse();
nsresult rv = NS_OK;
nscoord cellSpacingX = aTableFrame.GetCellSpacingX();
PRInt32 cellColSpan = 1; // must be defined here so it's set properly for non-cell kids
nsTableIterator iter(*this);
// remember the col index of the previous cell to handle rowspans into this row
PRInt32 firstPrevColIndex = (iter.IsLeftToRight()) ? -1 : aTableFrame.GetColCount();
PRInt32 prevColIndex = firstPrevColIndex;
nscoord x = 0; // running total of children x offset
// This computes the max of all cell heights
nscoord cellMaxHeight = 0;
// Reflow each of our existing cell frames
for (nsIFrame* kidFrame = iter.First(); kidFrame; kidFrame = iter.Next()) {
nsTableCellFrame *cellFrame = do_QueryFrame(kidFrame);
if (!cellFrame) {
// XXXldb nsCSSFrameConstructor needs to enforce this!
NS_NOTREACHED("yikes, a non-row child");
// it's an unknown frame type, give it a generic reflow and ignore the results
nsTableCellReflowState kidReflowState(aPresContext, aReflowState,
kidFrame, nsSize(0,0), false);
InitChildReflowState(*aPresContext, nsSize(0,0), false, kidReflowState);
nsHTMLReflowMetrics desiredSize;
nsReflowStatus status;
ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState, 0, 0, 0, status);
kidFrame->DidReflow(aPresContext, nullptr, NS_FRAME_REFLOW_FINISHED);
continue;
}
// See if we should only reflow the dirty child frames
bool doReflowChild = true;
if (!aReflowState.ShouldReflowAllKids() &&
!aTableFrame.IsGeometryDirty() &&
!NS_SUBTREE_DIRTY(kidFrame)) {
if (!aReflowState.mFlags.mSpecialHeightReflow)
doReflowChild = false;
}
else if ((NS_UNCONSTRAINEDSIZE != aReflowState.availableHeight)) {
// We don't reflow a rowspan >1 cell here with a constrained height.
// That happens in nsTableRowGroupFrame::SplitSpanningCells.
if (aTableFrame.GetEffectiveRowSpan(*cellFrame) > 1) {
doReflowChild = false;
}
}
if (aReflowState.mFlags.mSpecialHeightReflow) {
if (!isPaginated && !(cellFrame->GetStateBits() &
NS_FRAME_CONTAINS_RELATIVE_HEIGHT)) {
continue;
}
}
PRInt32 cellColIndex;
cellFrame->GetColIndex(cellColIndex);
cellColSpan = aTableFrame.GetEffectiveColSpan(*cellFrame);
// If the adjacent cell is in a prior row (because of a rowspan) add in the space
if ((iter.IsLeftToRight() && (prevColIndex != (cellColIndex - 1))) ||
(!iter.IsLeftToRight() && (prevColIndex != cellColIndex + cellColSpan))) {
x += GetSpaceBetween(prevColIndex, cellColIndex, cellColSpan, aTableFrame,
cellSpacingX, iter.IsLeftToRight(), false);
}
// remember the rightmost (ltr) or leftmost (rtl) column this cell spans into
prevColIndex = (iter.IsLeftToRight()) ? cellColIndex + (cellColSpan - 1) : cellColIndex;
// Reflow the child frame
nsRect kidRect = kidFrame->GetRect();
nsRect kidVisualOverflow = kidFrame->GetVisualOverflowRect();
bool firstReflow =
(kidFrame->GetStateBits() & NS_FRAME_FIRST_REFLOW) != 0;
if (doReflowChild) {
// Calculate the available width for the table cell using the known column widths
nscoord availCellWidth =
CalcAvailWidth(aTableFrame, *cellFrame, cellSpacingX);
nsHTMLReflowMetrics desiredSize;
// If the avail width is not the same as last time we reflowed the cell or
// the cell wants to be bigger than what was available last time or
// it is a style change reflow or we are printing, then we must reflow the
// cell. Otherwise we can skip the reflow.
// XXXldb Why is this condition distinct from doReflowChild above?
nsSize cellDesiredSize = cellFrame->GetDesiredSize();
if ((availCellWidth != cellFrame->GetPriorAvailWidth()) ||
//.........这里部分代码省略.........