diff options
author | Mitch Curtis <mitch.curtis@digia.com> | 2013-05-23 15:30:21 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-23 16:55:30 +0200 |
commit | 964be004033ea84dd4b8cbef53c4660b714dde09 (patch) | |
tree | 3808d233c943dd5d7e29d12e0007f4a534f7291c /src/corelib/codecs/qtextcodec.cpp | |
parent | 26ae24e20b47d327508cae77751f677248cb4a32 (diff) |
Fix regression when pasting into QTextEdit from Firefox.
Return the codec if one was found by QTextCodec::codecForUtfText,
instead of returning the default (UTF-8).
Task-number: QTBUG-31293
Change-Id: I95e3260376c00537006b7fbfdc3df5850e1ba657
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/codecs/qtextcodec.cpp')
-rw-r--r-- | src/corelib/codecs/qtextcodec.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp index 1a5c9f6766..1cedd3a28d 100644 --- a/src/corelib/codecs/qtextcodec.cpp +++ b/src/corelib/codecs/qtextcodec.cpp @@ -1065,8 +1065,10 @@ QTextCodec *QTextCodec::codecForHtml(const QByteArray &ba, QTextCodec *defaultCo } } } + if (!c) + c = defaultCodec; - return defaultCodec; + return c; } /*! |