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

This commit is contained in:
2025-08-11 02:30:11 -04:00
parent 214a4a62fe
commit fad69219ad
3 changed files with 17 additions and 20 deletions

View File

@ -140,7 +140,7 @@ void Hyphenator::insertPattern (TrieBuilder *trieBuilder, char *s)
// Convert the a pattern like 'a1bc3d4' into a string of chars 'abcd'
// and a list of points [ 0, 1, 0, 3, 4 ].
std::string chars;
SimpleVector<char> points (1);
std::vector< char > points;
// TODO numbers consisting of multiple digits?
// TODO Encoding: This implementation works exactly like the Python
@ -148,8 +148,7 @@ void Hyphenator::insertPattern (TrieBuilder *trieBuilder, char *s)
int numChars = 0;
for (int i = 0; s[i]; i++) {
if (s[i] >= '0' && s[i] <= '9') {
points.setSize(numChars + 1, '0');
points.set(numChars, s[i]);
points.push_back( s[ i ] );
} else {
numChars++;
chars+= s[i];
@ -157,8 +156,8 @@ void Hyphenator::insertPattern (TrieBuilder *trieBuilder, char *s)
}
chars[numChars] = 0;
points.setSize(numChars + 2, '0');
points.set(numChars + 1, '\0');
points.resize( numChars + 2, '0' );
points.at( numChars + 1 )= '\0';
// Insert the pattern into the tree. Each character finds a dict
// another level down in the tree, and leaf nodes have the list of
@ -166,7 +165,7 @@ void Hyphenator::insertPattern (TrieBuilder *trieBuilder, char *s)
//printf("insertPattern %s\n", chars);
trieBuilder->insert (chars.c_str(), points.getArray ());
trieBuilder->insert (chars.c_str(), points.data());
}
void Hyphenator::insertException (char *s)

View File

@ -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;

View File

@ -409,7 +409,7 @@ private:
* cumHeight->get(0) is 0, cumHeight->get(numRows) is the total table
* height.
*/
lout::misc::SimpleVector<int> *cumHeight;
std::vector< int > cumHeight;
/**
* If a Cell has rowspan > 1, it goes into this array
*/
@ -457,9 +457,9 @@ private:
void setCumHeight (int row, int value)
{
if (value != cumHeight->get (row)) {
if (value != cumHeight.at (row)) {
redrawY = std::min ( redrawY, value );
cumHeight->set (row, value);
cumHeight[ row ]= value;
}
}