mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Do not crash with uncodable character in math preview snippert (part of #11855)
This commit is contained in:
parent
924e74bd69
commit
e500dc19c1
@ -709,7 +709,20 @@ static docstring latexString(InsetMathHull const & inset)
|
|||||||
otexrowstream ots(ls);
|
otexrowstream ots(ls);
|
||||||
TeXMathStream wi(ots, false, true, TeXMathStream::wsPreview, encoding);
|
TeXMathStream wi(ots, false, true, TeXMathStream::wsPreview, encoding);
|
||||||
inset.write(wi);
|
inset.write(wi);
|
||||||
return ls.str();
|
docstring const s = ls.str();
|
||||||
|
docstring res;
|
||||||
|
for (char_type c : s) {
|
||||||
|
if (encoding->encodable(c))
|
||||||
|
res += c;
|
||||||
|
else {
|
||||||
|
// indicate the encoding error by a boxed '?'
|
||||||
|
res += "{\\fboxsep=1pt\\fbox{?}}";
|
||||||
|
LYXERR0("Uncodable character" << " '"
|
||||||
|
<< c
|
||||||
|
<< "'");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user