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

New commits:
commit 15a02261047cc60f3e080e74697bd88127124a03
Author:     dante <[email protected]>
AuthorDate: Tue Feb 2 16:20:28 2021 +0100
Commit:     Noel Grandin <[email protected]>
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 <[email protected]>

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>
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to