[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - starmath/qa starmath/source

Caolán McNamara caolanm at redhat.com
Tue May 27 03:29:27 PDT 2014


 starmath/qa/cppunit/test_nodetotextvisitors.cxx |    1 +
 starmath/source/parse.cxx                       |    8 +++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 9b1378387a0e67e8196e46ee56f7c82b1e08f40a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue May 27 11:26:54 2014 +0100

    Resolves: fdo#77831 use classic token rules for user-defined char (%foo)
    
    Change-Id: Iebae064986ad722d445c8d654e39e338e104f021
    (cherry picked from commit 501e5b98ad39156cac465a161709ad38b89e3d63)

diff --git a/starmath/qa/cppunit/test_nodetotextvisitors.cxx b/starmath/qa/cppunit/test_nodetotextvisitors.cxx
index e5c8626..09d1d6c 100644
--- a/starmath/qa/cppunit/test_nodetotextvisitors.cxx
+++ b/starmath/qa/cppunit/test_nodetotextvisitors.cxx
@@ -232,6 +232,7 @@ void Test::SimpleOperators()
     parseandparseagain("llint a", "Double curved integral");
     parseandparseagain("lllint a", "Triple curved integral");
     parseandparseagain("prod from {i=1} to {n} {(i+1)}", "Product with range");
+    ParseAndCheck("%Ux2135", "%Ux2135", "fdo#77831");
 }
 
 void Test::SimpleAttributes()
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index a1338e9..2a3fba1 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -375,6 +375,12 @@ const sal_Int32 coContFlags =
     (coStartFlags & ~KParseTokens::IGNORE_LEADING_WS)
     | KParseTokens::TWO_DOUBLE_QUOTES_BREAK_STRING;
 
+// user-defined char continuing characters may be any alphanumeric or dot.
+const sal_Int32 coUserDefinedCharContFlags =
+    ((KParseTokens::ANY_LETTER_OR_NUMBER | KParseTokens::IGNORE_LEADING_WS | KParseTokens::ASC_DOT)
+        & ~KParseTokens::IGNORE_LEADING_WS)
+    | KParseTokens::TWO_DOUBLE_QUOTES_BREAK_STRING;
+
 // First character for numbers, may be any numeric or dot
 const sal_Int32 coNumStartFlags =
         KParseTokens::ASC_DIGIT |
@@ -644,7 +650,7 @@ void SmParser::NextToken()
                                 m_aBufferString, rnEndPos,
                                 KParseTokens::ANY_LETTER,
                                 aEmptyStr,
-                                coContFlags,
+                                coUserDefinedCharContFlags,
                                 aEmptyStr );
 
                         sal_Int32 nTmpStart = rnEndPos + aTmpRes.LeadingWhiteSpace;


More information about the Libreoffice-commits mailing list