summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtexttable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/text/qtexttable.cpp')
-rw-r--r--src/gui/text/qtexttable.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/gui/text/qtexttable.cpp b/src/gui/text/qtexttable.cpp
index 11ea2a7..160eb35 100644
--- a/src/gui/text/qtexttable.cpp
+++ b/src/gui/text/qtexttable.cpp
@@ -446,9 +446,7 @@ void QTextTablePrivate::update() const
nRows = (cells.size() + nCols-1)/nCols;
// qDebug(">>>> QTextTablePrivate::update, nRows=%d, nCols=%d", nRows, nCols);
- int* newGrid = (int *)realloc(grid, nRows*nCols*sizeof(int));
- Q_CHECK_PTR(newGrid);
- grid = newGrid;
+ grid = q_check_ptr((int *)realloc(grid, nRows*nCols*sizeof(int)));
memset(grid, 0, nRows*nCols*sizeof(int));
QTextDocumentPrivate *p = pieceTable;
@@ -472,9 +470,7 @@ void QTextTablePrivate::update() const
cellIndices[i] = cell;
if (r + rowspan > nRows) {
- newGrid = (int *)realloc(grid, sizeof(int)*(r + rowspan)*nCols);
- Q_CHECK_PTR(newGrid);
- grid = newGrid;
+ grid = q_check_ptr((int *)realloc(grid, sizeof(int)*(r + rowspan)*nCols));
memset(grid + (nRows*nCols), 0, sizeof(int)*(r+rowspan-nRows)*nCols);
nRows = r + rowspan;
}