From cb29a2d79097872822bb124b2fb67832eee7de4e Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sat, 28 Oct 2017 21:13:46 +0200 Subject: [PATCH] Fixed output of stdout to macro IDE log No additional newlines are inserted on flush - this enhances compatibility with unit test framework. --- src/lay/lay/layMacroEditorDialog.cc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/lay/lay/layMacroEditorDialog.cc b/src/lay/lay/layMacroEditorDialog.cc index 2dc366c0f..2c41953a2 100644 --- a/src/lay/lay/layMacroEditorDialog.cc +++ b/src/lay/lay/layMacroEditorDialog.cc @@ -1433,10 +1433,7 @@ MacroEditorDialog::eventFilter (QObject *obj, QEvent *event) void MacroEditorDialog::flush () { - if (! m_new_line) { - // insert a new line if the stream changes .. - write_str ("\n", m_os); - } + // .. no specific implementation required for flush() .. } bool @@ -1481,9 +1478,9 @@ MacroEditorDialog::write_str (const char *text, output_stream os) mp_console_text->setTextCursor (c); } - if (m_os != OS_none && os != m_os) { - // flush if the stream changes .. - flush (); + if (m_os != OS_none && os != m_os && ! m_new_line) { + // insert a new line if the stream changes .. + write_str ("\n", m_os); } if (m_os != os) {