[Libreoffice-commits] core.git: starmath/source

Caolán McNamara caolanm at redhat.com
Wed Dec 6 17:32:47 UTC 2017


 starmath/source/mathtype.cxx |   67 +++++++++++++++++++++----------------------
 1 file changed, 33 insertions(+), 34 deletions(-)

New commits:
commit 71c2a1d313263cd0d638ed754a85cb6a09c15b66
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Dec 6 11:58:52 2017 +0000

    ofz: reset sPush and sMainTerm once 'popped'
    
    Change-Id: Ib63dd132cb2055b76492f5d53e45c2a86dd8a131
    Reviewed-on: https://gerrit.libreoffice.org/45940
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx
index dba5c8494721..68e87a3db7de 100644
--- a/starmath/source/mathtype.cxx
+++ b/starmath/source/mathtype.cxx
@@ -1350,9 +1350,9 @@ bool MathType::HandleRecords(int nLevel, sal_uInt8 nSelector,
                                 }
                                 else if (nPart == 1)
                                 {
-                                    sPush += rRet;
-                                    rRet = sPush;
-                                    rRet += sMainTerm;
+                                    rRet = sPush + rRet + sMainTerm;
+                                    sPush.clear();
+                                    sMainTerm.clear();
                                 }
                             }
                             else
@@ -1463,10 +1463,9 @@ bool MathType::HandleRecords(int nLevel, sal_uInt8 nSelector,
                                 }
                                 else if (nPart == 1)
                                 {
-                                    sPush += rRet;
-                                    rRet = sPush;
-                                    rRet += " over ";
-                                    rRet += sMainTerm;
+                                    rRet = sPush + rRet + " over " + sMainTerm;
+                                    sPush.clear();
+                                    sMainTerm.clear();
                                 }
                             }
                             if (nPart == 0)
@@ -1512,18 +1511,18 @@ bool MathType::HandleRecords(int nLevel, sal_uInt8 nSelector,
                             }
                             else if ((nPart == 1) && (nVariation == 0))
                             {
-                                sPush += rRet;
-                                rRet = sPush;
-                                rRet += sMainTerm;
+                                rRet = sPush + rRet + sMainTerm;
+                                sPush.clear();
+                                sMainTerm.clear();
                                 newline--;
                             }
                             else if ((nPart == 1) && (nVariation == 1))
                                 newline--;
                             else if ((nPart == 2) && (nVariation == 1))
                             {
-                                sPush += rRet;
-                                rRet = sPush;
-                                rRet += sMainTerm;
+                                rRet = sPush + rRet + sMainTerm;
+                                sPush.clear();
+                                sMainTerm.clear();
                                 newline--;
                             }
                             nPart++;
@@ -1542,18 +1541,18 @@ bool MathType::HandleRecords(int nLevel, sal_uInt8 nSelector,
                             else if ((nPart == 1) &&
                                     ((nVariation == 1) || (nVariation==4)))
                             {
-                                sPush += rRet;
-                                rRet = sPush;
-                                rRet += sMainTerm;
+                                rRet = sPush + rRet + sMainTerm;
+                                sPush.clear();
+                                sMainTerm.clear();
                                 newline--;
                             }
                             else if ((nPart == 1) && (nVariation == 2))
                                 newline--;
                             else if ((nPart == 2) && (nVariation == 2))
                             {
-                                sPush += rRet;
-                                rRet = sPush;
-                                rRet += sMainTerm;
+                                rRet = sPush + rRet + sMainTerm;
+                                sPush.clear();
+                                sMainTerm.clear();
                                 newline--;
                             }
                             nPart++;
@@ -1573,9 +1572,9 @@ bool MathType::HandleRecords(int nLevel, sal_uInt8 nSelector,
                             else if ((nPart == 1) &&
                                     ((nVariation == 1) || (nVariation==3)))
                             {
-                                sPush += rRet;
-                                rRet = sPush;
-                                rRet += sMainTerm;
+                                rRet = sPush + rRet + sMainTerm;
+                                sPush.clear();
+                                sMainTerm.clear();
                                 newline--;
                             }
                             nPart++;
@@ -1591,18 +1590,18 @@ bool MathType::HandleRecords(int nLevel, sal_uInt8 nSelector,
                             else if ((nPart == 1) &&
                                     ((nVariation == 1) || (nVariation==2)))
                             {
-                                sPush += rRet;
-                                rRet = sPush;
-                                rRet += sMainTerm;
+                                rRet = sPush + rRet + sMainTerm;
+                                sPush.clear();
+                                sMainTerm.clear();
                                 newline--;
                             }
                             else if ((nPart == 1) && (nVariation == 0))
                                 newline--;
                             else if ((nPart == 2) && (nVariation == 0))
                             {
-                                sPush += rRet;
-                                rRet = sPush;
-                                rRet += sMainTerm;
+                                rRet = sPush + rRet + sMainTerm;
+                                sPush.clear();
+                                sMainTerm.clear();
                                 newline--;
                             }
                             nPart++;
@@ -1618,9 +1617,9 @@ bool MathType::HandleRecords(int nLevel, sal_uInt8 nSelector,
                             }
                             else if (nPart == 1)
                             {
-                                sPush += rRet;
-                                rRet = sPush;
-                                rRet += sMainTerm;
+                                rRet = sPush + rRet + sMainTerm;
+                                sPush.clear();
+                                sMainTerm.clear();
                                 newline--;
                             }
                             nPart++;
@@ -1647,9 +1646,9 @@ bool MathType::HandleRecords(int nLevel, sal_uInt8 nSelector,
                             else if ((nPart == 2) || ((nPart == 1) &&
                                     (nVariation == 0 || nVariation == 1)))
                             {
-                                sPush+=rRet;
-                                rRet = sPush;
-                                rRet += sMainTerm;
+                                rRet = sPush + rRet + sMainTerm;
+                                sPush.clear();
+                                sMainTerm.clear();
                             }
                             nPart++;
                             break;


More information about the Libreoffice-commits mailing list