]> git.lyx.org Git - features.git/commitdiff
more robust. I get spurious crashes in this area... maybe c_str()
authorAndré Pönitz <poenitz@gmx.net>
Sat, 28 Jun 2008 18:34:19 +0000 (18:34 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Sat, 28 Jun 2008 18:34:19 +0000 (18:34 +0000)
instead of data() would be in order, too

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25402 a592a061-630c-0410-9148-cb99ea01b6c8

src/support/qstring_helpers.cpp

index ded445fc72992efb38f64486e2a7a9b5cc7da2a1..2211af8e4ec1c36645e15cdc179e855dce3f6f18 100644 (file)
@@ -34,6 +34,8 @@ QString toqstr(docstring const & ucs4)
 {
        // If possible we let qt do the work, since this version does not
        // need to be superfast.
+       if (ucs4.empty())
+               return QString();
        return QString::fromUcs4((uint const *)ucs4.data(), ucs4.length());
 }