Prevent invocation of std::string(0);

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_3_X@9390 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2004-12-16 16:04:47 +00:00
parent 540df2dd10
commit 383f1f180c
2 changed files with 8 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2004-12-16 Angus Leeming <leeming@lyx.org>
* qt_helpers.C (fromqstr): Don't use std::string(0) to construct
a string. Bad things will happen.
2004-12-14 Angus Leeming <leeming@lyx.org>
* qgridview.h (class QGridView): remove invalid Q_EXPORT declaration

View File

@ -111,8 +111,7 @@ QString const qt_(string const & str)
string const fromqstr(QString const & str)
{
QTextCodec * codec = QTextCodec::codecForLocale();
QCString tmpstr = codec->fromUnicode(str);
char const * tmpcstr = tmpstr;
return tmpcstr;
QTextCodec const * const codec = QTextCodec::codecForLocale();
QCString const tmpstr = codec->fromUnicode(str);
return tmpstr.isEmpty() ? string() : string(tmpstr);
}