From: Stéphane MOTTELET Date: Wed, 18 Sep 2019 17:18:03 +0000 (+0200) Subject: * Bug 16191 fixed: now mode(0) and mode(1) are really compact. X-Git-Tag: 6.1.0~409 X-Git-Url: http://gitweb.scilab.org/?p=scilab.git;a=commitdiff_plain;h=603f3ba125eaae68c7019bf97ad24bc45befe6c8 * Bug 16191 fixed: now mode(0) and mode(1) are really compact. https://bugzilla.scilab.org/show_bug.cgi?id=16191 Change-Id: Ib69a6d17d2da00c64be28fa0ca79b6ba319c0efe --- diff --git a/scilab/modules/ast/src/cpp/ast/run_AssignExp.hpp b/scilab/modules/ast/src/cpp/ast/run_AssignExp.hpp index c278e2d..b139878 100644 --- a/scilab/modules/ast/src/cpp/ast/run_AssignExp.hpp +++ b/scilab/modules/ast/src/cpp/ast/run_AssignExp.hpp @@ -137,7 +137,11 @@ void RunVisitorT::visitprivate(const AssignExp &e) { std::wstring wstrName = pVar->getSymbol().getName(); std::wostringstream ostr; - ostr << L" " << wstrName << L" = " << std::endl << std::endl; + ostr << L" " << wstrName << L" = " << std::endl; + if (ConfigVariable::isPrintCompact() == false) + { + ostr << std::endl; + } scilabWriteW(ostr.str().c_str()); std::wostringstream ostrName; ostrName << wstrName; diff --git a/scilab/modules/ast/src/cpp/ast/run_SeqExp.hpp b/scilab/modules/ast/src/cpp/ast/run_SeqExp.hpp index 1af4664..b04f4bf 100644 --- a/scilab/modules/ast/src/cpp/ast/run_SeqExp.hpp +++ b/scilab/modules/ast/src/cpp/ast/run_SeqExp.hpp @@ -191,7 +191,11 @@ void RunVisitorT::visitprivate(const SeqExp &e) if ((*it)->isVerbose() && ConfigVariable::isPrintOutput()) { //TODO manage multiple returns - scilabWriteW(L" ans =\n\n"); + scilabWriteW(L" ans =\n"); + if (ConfigVariable::isPrintCompact() == false) + { + scilabWriteW(L"\n"); + } std::wostringstream ostrName; ostrName << L"ans"; VariableToString(pITAns, ostrName.str().c_str()); diff --git a/scilab/modules/ast/src/cpp/ast/runvisitor.cpp b/scilab/modules/ast/src/cpp/ast/runvisitor.cpp index 24ec1f7..dc7d63d 100644 --- a/scilab/modules/ast/src/cpp/ast/runvisitor.cpp +++ b/scilab/modules/ast/src/cpp/ast/runvisitor.cpp @@ -126,7 +126,10 @@ void RunVisitorT::visitprivate(const SimpleVar & e) ostr << L"(" << pI->getRef() << L")"; #endif ostr << std::endl; - ostr << std::endl; + if (ConfigVariable::isPrintCompact() == false) + { + ostr << std::endl; + } scilabWriteW(ostr.str().c_str()); std::wostringstream ostrName; ostrName << e.getSymbol().getName(); diff --git a/scilab/modules/ast/src/cpp/types/tostring_common.cpp b/scilab/modules/ast/src/cpp/types/tostring_common.cpp index 38361d1..1084e74 100644 --- a/scilab/modules/ast/src/cpp/types/tostring_common.cpp +++ b/scilab/modules/ast/src/cpp/types/tostring_common.cpp @@ -473,13 +473,21 @@ void configureStream(std::wostringstream * _postr, int _iWidth, int _iPrec, char void addColumnString(std::wostringstream& ostr, int _iFrom, int _iTo) { + if (ConfigVariable::isPrintCompact() == false) + { + ostr << std::endl; + } if (_iFrom == _iTo) { - ostr << std::endl << L" column " << _iFrom << std::endl << std::endl; + ostr << L" column " << _iFrom << std::endl; } else { - ostr << std::endl << L" column " << _iFrom << L" to " << _iTo << std::endl << std::endl; + ostr << L" column " << _iFrom << L" to " << _iTo << std::endl; + } + if (ConfigVariable::isPrintCompact() == false) + { + ostr << std::endl; } } diff --git a/scilab/modules/ast/src/cpp/types/types_tools.cpp b/scilab/modules/ast/src/cpp/types/types_tools.cpp index 023cce5..c98fb9e 100644 --- a/scilab/modules/ast/src/cpp/types/types_tools.cpp +++ b/scilab/modules/ast/src/cpp/types/types_tools.cpp @@ -988,11 +988,6 @@ types::Function::ReturnValue VariableToString(types::InternalType* pIT, const wc bFinish = linesmore() == 1; } - if (ConfigVariable::isPrintCompact() == false && ConfigVariable::isPrintInput() == false) - { - ostr << std::endl; - } - scilabForcedWriteW(ostr.str().c_str()); ostr.str(L""); }