diff --git a/src/mathed/math_mathmlstream.C b/src/mathed/math_mathmlstream.C index 4829f80bf9..b440fdb39d 100644 --- a/src/mathed/math_mathmlstream.C +++ b/src/mathed/math_mathmlstream.C @@ -72,6 +72,11 @@ WriteStream & operator<<(WriteStream & ws, MathArray const & ar) WriteStream & operator<<(WriteStream & ws, char const * s) { + if (ws.pendingSpace() && strlen(s) > 0) { + if (isAlpha(s[0])) + ws.os() << ' '; + ws.pendingSpace(false); + } ws.os() << s; ws.addlines(int(lyx::count(s, s + strlen(s), '\n'))); return ws; diff --git a/src/mathed/math_streamstr.C b/src/mathed/math_streamstr.C index 974a7913b8..c2c8062b33 100644 --- a/src/mathed/math_streamstr.C +++ b/src/mathed/math_streamstr.C @@ -13,12 +13,7 @@ WriteStream & operator<<(WriteStream & ws, string const & s) { - if (ws.pendingSpace()) { - ws.os() << ' '; - ws.pendingSpace(false); - } - ws.os() << s; - ws.addlines(int(lyx::count(s.begin(), s.end(), '\n'))); + ws << s.c_str(); return ws; }