From 8f6a9ee2922750ab0ffaccfd4d3c4b56bc039f71 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Wed, 16 Oct 2002 15:32:34 +0000 Subject: [PATCH] fix writing of some spaces. Sorry for not discussing this on the list, this has the potential of corrupting files... git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5425 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/math_mathmlstream.C | 5 +++++ src/mathed/math_streamstr.C | 7 +------ 2 files changed, 6 insertions(+), 6 deletions(-) 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; } -- 2.39.5