diff options
author | Harald Fernengel <harald@trolltech.com> | 2009-08-03 13:12:46 (GMT) |
---|---|---|
committer | Harald Fernengel <harald@trolltech.com> | 2009-08-03 13:12:46 (GMT) |
commit | 41a83e1ff19ad1396e6001e6b0ac003c701ba55a (patch) | |
tree | 609e40eda10418bbf925002c36552074796b96b6 /src/gui/text/qtextformat.cpp | |
parent | d1f3b9df2bc5c57d414da73a7d4f9ed7b25df3db (diff) | |
download | Qt-41a83e1ff19ad1396e6001e6b0ac003c701ba55a.zip Qt-41a83e1ff19ad1396e6001e6b0ac003c701ba55a.tar.gz Qt-41a83e1ff19ad1396e6001e6b0ac003c701ba55a.tar.bz2 |
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/qtextformat.cpp')
-rw-r--r-- | src/gui/text/qtextformat.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp index 9bc62b1..9b91f7e 100644 --- a/src/gui/text/qtextformat.cpp +++ b/src/gui/text/qtextformat.cpp @@ -2996,12 +2996,18 @@ int QTextFormatCollection::indexForFormat(const QTextFormat &format) int idx = formats.size(); formats.append(format); - QTextFormat &f = formats.last(); - if (!f.d) - f.d = new QTextFormatPrivate; - f.d->resolveFont(defaultFnt); + QT_TRY{ + QTextFormat &f = formats.last(); + if (!f.d) + f.d = new QTextFormatPrivate; + f.d->resolveFont(defaultFnt); - hashes.insert(hash); + hashes.insert(hash); + + } QT_CATCH(...) { + formats.pop_back(); + QT_RETHROW; + } return idx; } |