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

dante (via logerrit) logerrit at kemper.freedesktop.org
Tue Feb 2 19:53:45 UTC 2021


 starmath/inc/node.hxx    |    4 ++++
 starmath/source/node.cxx |   14 ++++++++++++++
 2 files changed, 18 insertions(+)

New commits:
commit 15a02261047cc60f3e080e74697bd88127124a03
Author:     dante <dante19031999 at gmail.com>
AuthorDate: Tue Feb 2 16:20:28 2021 +0100
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Feb 2 20:53:02 2021 +0100

    Support patch for starmath syntax hightlight
    
    Starmath syntax hightlight has dependences on node classes.
    But those classes are whidely used.
    So for avoiding future merge conflicts it should be merged separetely because syntax hightlight won't be merged soon.
    
    Change-Id: Ifaf33cd67c9ea0d5cfffaad787ce5fabc1447a65
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110325
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx
index 988a1024332a..d0b81737a31d 100644
--- a/starmath/inc/node.hxx
+++ b/starmath/inc/node.hxx
@@ -134,6 +134,10 @@ enum class SmNodeType
 /*25*/ Rectangle,   VerticalBrace, MathIdent
 };
 
+namespace starmathdatabase
+{
+bool isStructuralNode(SmNodeType ntype);
+}
 
 class SmNode : public SmRect
 {
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index 4de696dcabfa..e15d72312592 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -40,6 +40,20 @@
 #include <float.h>
 #include <vector>
 
+bool starmathdatabase::isStructuralNode(SmNodeType ntype)
+{
+// clang-format off
+return ntype==SmNodeType::Table || ntype==SmNodeType::Line        || ntype==SmNodeType::UnHor
+                                || ntype==SmNodeType::BinHor      || ntype==SmNodeType::BinVer
+                                || ntype==SmNodeType::BinDiagonal || ntype==SmNodeType::SubSup
+                                || ntype==SmNodeType::Matrix      || ntype==SmNodeType::Root
+                                || ntype==SmNodeType::Expression  || ntype==SmNodeType::Brace
+                                || ntype==SmNodeType::Bracebody   || ntype==SmNodeType::Oper
+                                || ntype==SmNodeType::Align       || ntype==SmNodeType::Attribut
+                                || ntype==SmNodeType::Font;
+// clang-format on
+}
+
 namespace {
 
 template<typename F>


More information about the Libreoffice-commits mailing list