Merge "Minor robustness improvement of text code"
This commit is contained in:
commit
57dd386d42
@ -240,9 +240,11 @@ QString QTextDocumentWriter::fileName () const
|
|||||||
*/
|
*/
|
||||||
bool QTextDocumentWriter::write(const QTextDocument *document)
|
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
|
// if there's no format, see if device is a file, and if so, find
|
||||||
// the file suffix
|
// the file suffix
|
||||||
if (QFile *file = qobject_cast<QFile *>(d->device))
|
if (QFile *file = qobject_cast<QFile *>(d->device))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user