Commit 66649891 authored by hybrid's avatar hybrid

Break text into lines after changing RTL setting. Avoid null pointer access if...

Break text into lines after changing RTL setting. Avoid null pointer access if string is empty. Fixes sent in by Auria.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3668 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 20d2f925
......@@ -258,7 +258,11 @@ bool CGUIStaticText::isWordWrapEnabled() const
void CGUIStaticText::setRightToLeft(bool rtl)
{
RightToLeft = rtl;
if (RightToLeft != rtl)
{
RightToLeft = rtl;
breakText();
}
}
......@@ -460,7 +464,8 @@ void CGUIStaticText::breakText()
whitespace = L"";
}
whitespace = core::stringw(&c, 1) + whitespace;
if (c != 0)
whitespace = core::stringw(&c, 1) + whitespace;
// compute line break
if (lineBreak)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment