[ast] fix polynom display after 0000af49 05/21305/2
St├ęphane Mottelet [Tue, 11 Feb 2020 12:52:29 +0000 (13:52 +0100)]
Change-Id: I5d9dee0cb6b642c606c70053e30fa67d740eae84

scilab/modules/ast/src/cpp/types/singlepoly.cpp

index db60925..77adbf6 100644 (file)
@@ -405,6 +405,8 @@ void SinglePoly::toStringInternal(double *_pdblR, double *_pdblI, const std::wst
         else if (dblR != 0 || dblI != 0)
         {
             DoubleFormat dfR, dfI;
+            getDoubleFormat(dblR, &dfR);
+            getDoubleFormat(dblI, &dfI);
             dfR.bPrintPoint = dfR.bExp;
             dfR.bPrintBlank = false;
             dfR.bPrintPlusSign = false;
@@ -415,7 +417,6 @@ void SinglePoly::toStringInternal(double *_pdblR, double *_pdblI, const std::wst
             dfI.bPrintOne = false;
             if (dblR != 0)
              {
-                 getDoubleFormat(dblR, &dfR);
                  dfR.bPaddSign = false;
                  dfI.bPrintPlusSign = true;
                  iLen += (i!= 0 ? iParenthLen : 0);
@@ -425,7 +426,6 @@ void SinglePoly::toStringInternal(double *_pdblR, double *_pdblI, const std::wst
                  dfI.bPrintPlusSign = ! bFirst;
                  dfI.bPaddSign = ! bFirst;
              }
-             getDoubleFormat(dblI, &dfI);
 
              if (iLen + dfR.iWidth + dfR.iSignLen + dfI.iWidth + dfI.iSignLen + _szVar.length() + iExponentsDigits.size() >= iLineLen - 1)
              {