summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtexttable.cpp
diff options
context:
space:
mode:
authorHarald Fernengel <harald@trolltech.com>2009-08-03 15:12:46 +0200
committerHarald Fernengel <harald@trolltech.com>2009-08-03 15:12:46 +0200
commit41a83e1ff19ad1396e6001e6b0ac003c701ba55a (patch)
tree609e40eda10418bbf925002c36552074796b96b6 /src/gui/text/qtexttable.cpp
parentd1f3b9df2bc5c57d414da73a7d4f9ed7b25df3db (diff)
Squashed commit of the topic/exceptions branch.
Contains some smaller fixes and renaming of macros. Looks big, but isn't scary at all ;)
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 11ea2a72f7..160eb35021 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;
}