A few more SimpleVector changes.
Some checks failed
CI / ubuntu-latest-html-tests (push) Has been cancelled
CI / ubuntu-latest-no-tls (push) Has been cancelled
CI / ubuntu-latest-mbedtls2 (push) Has been cancelled
CI / ubuntu-latest-openssl-3 (push) Has been cancelled
CI / ubuntu-latest-with-old-std (push) Has been cancelled
CI / ubuntu-20-04-openssl-1-1 (push) Has been cancelled
CI / alpine-mbedtls-3_6_0 (push) Has been cancelled
CI / macOS-13-openssl-1-1 (push) Has been cancelled
CI / macOS-13-openssl-3 (push) Has been cancelled
CI / freebsd-14-openssl-3 (push) Has been cancelled
CI / windows-mbedtls (push) Has been cancelled
Some checks failed
CI / ubuntu-latest-html-tests (push) Has been cancelled
CI / ubuntu-latest-no-tls (push) Has been cancelled
CI / ubuntu-latest-mbedtls2 (push) Has been cancelled
CI / ubuntu-latest-openssl-3 (push) Has been cancelled
CI / ubuntu-latest-with-old-std (push) Has been cancelled
CI / ubuntu-20-04-openssl-1-1 (push) Has been cancelled
CI / alpine-mbedtls-3_6_0 (push) Has been cancelled
CI / macOS-13-openssl-1-1 (push) Has been cancelled
CI / macOS-13-openssl-3 (push) Has been cancelled
CI / freebsd-14-openssl-3 (push) Has been cancelled
CI / windows-mbedtls (push) Has been cancelled
This commit is contained in:
20
dw/table.cc
20
dw/table.cc
@ -52,7 +52,6 @@ Table::Table(bool limitTextWidth)
|
||||
colExtremes = new misc::SimpleVector<core::Extremes> (8);
|
||||
colWidthSpecified = new misc::SimpleVector<bool> (8);
|
||||
colWidthPercentage = new misc::SimpleVector<bool> (8);
|
||||
cumHeight = new misc::SimpleVector <int> (8);
|
||||
rowSpanCells = new misc::SimpleVector <int> (8);
|
||||
baseline = new misc::SimpleVector <int> (8);
|
||||
rowStyle = new misc::SimpleVector <core::style::Style*> (8);
|
||||
@ -92,7 +91,6 @@ Table::~Table()
|
||||
delete colExtremes;
|
||||
delete colWidthSpecified;
|
||||
delete colWidthPercentage;
|
||||
delete cumHeight;
|
||||
delete rowSpanCells;
|
||||
delete baseline;
|
||||
delete rowStyle;
|
||||
@ -115,7 +113,7 @@ void Table::sizeRequestSimpl (core::Requisition *requisition)
|
||||
requisition->width += colWidths.at (col);
|
||||
|
||||
requisition->ascent =
|
||||
boxDiffHeight () + cumHeight->get (numRows) + getStyle()->vBorderSpacing;
|
||||
boxDiffHeight () + cumHeight.at (numRows) + getStyle()->vBorderSpacing;
|
||||
requisition->descent = 0;
|
||||
|
||||
correctRequisition (requisition, core::splitHeightPreserveDescent, true,
|
||||
@ -192,12 +190,12 @@ void Table::sizeAllocateImpl (core::Allocation *allocation)
|
||||
children->get(n)->cell.widget->sizeRequest (&childRequisition);
|
||||
|
||||
childAllocation.x = x;
|
||||
childAllocation.y = cumHeight->get (row) + offy;
|
||||
childAllocation.y = cumHeight.at (row) + offy;
|
||||
childAllocation.width = width;
|
||||
childAllocation.ascent = childRequisition.ascent;
|
||||
childAllocation.descent =
|
||||
cumHeight->get (row + children->get(n)->cell.rowspan)
|
||||
- cumHeight->get (row) - getStyle()->vBorderSpacing
|
||||
cumHeight.at (row + children->get(n)->cell.rowspan)
|
||||
- cumHeight.at (row) - getStyle()->vBorderSpacing
|
||||
- childRequisition.ascent;
|
||||
children->get(n)->cell.widget->sizeAllocate (&childAllocation);
|
||||
}
|
||||
@ -920,7 +918,7 @@ void Table::actuallyCalcCellSizes (bool calcHeights)
|
||||
boxDiffWidth (), totalWidth);
|
||||
|
||||
assert (colWidths.size () == numCols); // This is set in addCell.
|
||||
cumHeight->setSize (numRows + 1, 0);
|
||||
cumHeight.resize (numRows + 1, 0);
|
||||
rowSpanCells->setSize (0);
|
||||
baseline->setSize (numRows);
|
||||
|
||||
@ -1213,7 +1211,7 @@ void Table::actuallyCalcCellSizes (bool calcHeights)
|
||||
} // for col
|
||||
|
||||
setCumHeight (row + 1,
|
||||
cumHeight->get (row) + rowHeight + getStyle()->vBorderSpacing);
|
||||
cumHeight.at (row) + rowHeight + getStyle()->vBorderSpacing);
|
||||
} // for row
|
||||
|
||||
apportionRowSpan ();
|
||||
@ -1232,7 +1230,7 @@ void Table::apportionRowSpan ()
|
||||
int n = rowSpanCells->get(c);
|
||||
int row = n / numCols;
|
||||
int rs = children->get(n)->cell.rowspan;
|
||||
int sumRows = cumHeight->get(row+rs) - cumHeight->get(row);
|
||||
int sumRows = cumHeight.at(row+rs) - cumHeight.at(row);
|
||||
core::Requisition childRequisition;
|
||||
children->get(n)->cell.widget->sizeRequest (&childRequisition);
|
||||
int spanHeight = childRequisition.ascent + childRequisition.descent
|
||||
@ -1248,7 +1246,7 @@ void Table::apportionRowSpan ()
|
||||
if (!rowHeight) {
|
||||
rowHeight = new int[numRows];
|
||||
for (int i = 0; i < numRows; i++)
|
||||
rowHeight[i] = cumHeight->get(i+1) - cumHeight->get(i);
|
||||
rowHeight[i] = cumHeight.at(i+1) - cumHeight.at(i);
|
||||
}
|
||||
#ifdef DBG
|
||||
MSG(" rowHeight { ");
|
||||
@ -1276,7 +1274,7 @@ void Table::apportionRowSpan ()
|
||||
}
|
||||
// Update cumHeight
|
||||
for (int i = 0; i < numRows; ++i)
|
||||
setCumHeight (i+1, cumHeight->get(i) + rowHeight[i]);
|
||||
setCumHeight (i+1, cumHeight.at(i) + rowHeight[i]);
|
||||
}
|
||||
delete[] rowHeight;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user