diff options
Diffstat (limited to 'src/gui/text/qtextdocumentwriter.cpp')
-rw-r--r-- | src/gui/text/qtextdocumentwriter.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gui/text/qtextdocumentwriter.cpp b/src/gui/text/qtextdocumentwriter.cpp index 0bafa5d9ff..800b72ea9c 100644 --- a/src/gui/text/qtextdocumentwriter.cpp +++ b/src/gui/text/qtextdocumentwriter.cpp @@ -83,7 +83,6 @@ public: \inmodule QtGui \ingroup richtext-processing - \ingroup io To write a document, construct a QTextDocumentWriter object with either a file name or a device object, and specify the document format to be @@ -249,9 +248,11 @@ QString QTextDocumentWriter::fileName () const */ bool QTextDocumentWriter::write(const QTextDocument *document) { - QByteArray suffix; + if (!d->device) + return false; - if (d->device && d->format.isEmpty()) { + QByteArray suffix; + if (d->format.isEmpty()) { // if there's no format, see if device is a file, and if so, find // the file suffix if (QFile *file = qobject_cast<QFile *>(d->device)) |