fixing return value checks for utf8 strings
This commit is contained in:
parent
db2904e144
commit
008685a90e
1 changed files with 3 additions and 2 deletions
|
@ -465,7 +465,7 @@ void FbWindow::reparent(const FbWindow &parent, int x, int y, bool continuing) {
|
|||
std::string FbWindow::textProperty(Atom property) const {
|
||||
XTextProperty text_prop;
|
||||
char ** stringlist = 0;
|
||||
int count;
|
||||
int count = 0;
|
||||
std::string ret;
|
||||
|
||||
static Atom m_utf8string = XInternAtom(display(), "UTF8_STRING", False);
|
||||
|
@ -492,7 +492,8 @@ std::string FbWindow::textProperty(Atom property) const {
|
|||
ret = stringlist[0];
|
||||
} else {
|
||||
// still returns a "StringList" despite the different name
|
||||
if (XmbTextPropertyToTextList(display(), &text_prop, &stringlist, &count) == 0 || count == 0)
|
||||
XmbTextPropertyToTextList(display(), &text_prop, &stringlist, &count);
|
||||
if (count == 0)
|
||||
return "";
|
||||
|
||||
ret = FbStringUtil::LocaleStrToFb(stringlist[0]);
|
||||
|
|
Loading…
Reference in a new issue