summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2011-05-18 13:13:10 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2011-05-18 13:13:10 (GMT)
commit3b7b05ce8db881acfdcf193b3c8fb3d4919eb1c2 (patch)
treeb35fb5f723752378dd4fede93a6c35c0aeb85ad2 /tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp
parent1aeccd6bd14d7d9e098e333715f63e0225cd4a54 (diff)
parent2c07b5d2cba8d8e499bd0861eefef12d4e00d99a (diff)
downloadQt-3b7b05ce8db881acfdcf193b3c8fb3d4919eb1c2.zip
Qt-3b7b05ce8db881acfdcf193b3c8fb3d4919eb1c2.tar.gz
Qt-3b7b05ce8db881acfdcf193b3c8fb3d4919eb1c2.tar.bz2
Merge remote-tracking branch 'origin/4.8'
Diffstat (limited to 'tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp')
-rw-r--r--tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp b/tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp
index 997cd68..ffce9a2 100644
--- a/tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp
+++ b/tests/auto/qtextodfwriter/tst_qtextodfwriter.cpp
@@ -114,11 +114,14 @@ QString tst_QTextOdfWriter::getContentFromXml()
xmlWriter->writeEndDocument();
buffer->close();
QString stringContent = QString::fromUtf8(buffer->data());
+ QString ret;
int index = stringContent.indexOf("<dummy");
- Q_ASSERT(index);
- index = stringContent.indexOf('>', index);
- stringContent = stringContent.mid(index+1, stringContent.length() - index - 10);
- return stringContent;
+ if (index > 0) {
+ index = stringContent.indexOf('>', index);
+ if (index > 0)
+ ret = stringContent.mid(index+1, stringContent.length() - index - 10);
+ }
+ return ret;
}
void tst_QTextOdfWriter::testWriteParagraph_data()