summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authordante <dante19031999@gmail.com>2021-02-02 16:20:28 +0100
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-02-02 20:53:02 +0100
commit15a02261047cc60f3e080e74697bd88127124a03 (patch)
tree6436b56037f635dcf9e982c6e5f99fc8835736c1 /starmath
parent4c95b7415340b07fd94e8f374aa2dfbb070783f8 (diff)
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@collabora.co.uk>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/inc/node.hxx4
-rw-r--r--starmath/source/node.cxx14
2 files changed, 18 insertions, 0 deletions
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>