diff options
Diffstat (limited to 'src/gui/text/qtexttable.cpp')
-rw-r--r-- | src/gui/text/qtexttable.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/gui/text/qtexttable.cpp b/src/gui/text/qtexttable.cpp index 39f26d5d42..0b656ce8a1 100644 --- a/src/gui/text/qtexttable.cpp +++ b/src/gui/text/qtexttable.cpp @@ -318,13 +318,6 @@ QTextFrame::iterator QTextTableCell::end() const Destroys the table cell. */ -QTextTablePrivate::~QTextTablePrivate() -{ - if (grid) - free(grid); -} - - QTextTable *QTextTablePrivate::createTable(QTextDocumentPrivate *pieceTable, int pos, int rows, int cols, const QTextTableFormat &tableFormat) { QTextTableFormat fmt = tableFormat; @@ -446,8 +439,7 @@ void QTextTablePrivate::update() const nRows = (cells.size() + nCols-1)/nCols; // qDebug(">>>> QTextTablePrivate::update, nRows=%d, nCols=%d", nRows, nCols); - grid = q_check_ptr((int *)realloc(grid, nRows*nCols*sizeof(int))); - memset(grid, 0, nRows*nCols*sizeof(int)); + grid.assign(nRows * nCols, 0); QTextDocumentPrivate *p = pieceTable; QTextFormatCollection *c = p->formatCollection(); @@ -470,8 +462,7 @@ void QTextTablePrivate::update() const cellIndices[i] = cell; if (r + rowspan > nRows) { - grid = q_check_ptr((int *)realloc(grid, sizeof(int)*(r + rowspan)*nCols)); - memset(grid + (nRows*nCols), 0, sizeof(int)*(r+rowspan-nRows)*nCols); + grid.resize((r + rowspan) * nCols, 0); nRows = r + rowspan; } @@ -1344,3 +1335,5 @@ void QTextTable::setFormat(const QTextTableFormat &format) */ QT_END_NAMESPACE + +#include "moc_qtexttable.cpp" |