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

dante (via logerrit) logerrit at kemper.freedesktop.org
Fri Aug 20 07:37:30 UTC 2021


 starmath/inc/document.hxx    |    8 ++++++++
 starmath/source/document.cxx |    3 +++
 2 files changed, 11 insertions(+)

New commits:
commit 3ad6d41c1c88b0549c9be0f41e02d83a582fcdfd
Author:     dante <dante19031999 at gmail.com>
AuthorDate: Fri Aug 20 04:17:34 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Aug 20 09:36:52 2021 +0200

    Add a SmMlElement tree to the sm document
    
    Change-Id: Ide764b512004198277baed60ac4e1a5ef0d1c2dc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120765
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/starmath/inc/document.hxx b/starmath/inc/document.hxx
index 588a8d93f1b0..77d13aa77d08 100644
--- a/starmath/inc/document.hxx
+++ b/starmath/inc/document.hxx
@@ -32,6 +32,7 @@
 #include "format.hxx"
 #include "parse.hxx"
 #include "smdllapi.hxx"
+#include "mathml/iterator.hxx"
 
 class SfxPrinter;
 class Printer;
@@ -82,6 +83,7 @@ class SM_DLLPUBLIC SmDocShell : public SfxObjectShell, public SfxListener
     OUString            maAccText;
     SvtLinguOptions     maLinguOptions;
     std::unique_ptr<SmTableNode> mpTree;
+    SmMlElement* m_pMlElementTree;
     rtl::Reference<SfxItemPool> mpEditEngineItemPool;
     std::unique_ptr<SmEditEngine> mpEditEngine;
     VclPtr<SfxPrinter>  mpPrinter;       //q.v. comment to SmPrinter Access!
@@ -212,6 +214,12 @@ public:
     void readFormulaOoxml( oox::formulaimport::XmlStream& stream );
 
     void UpdateEditEngineDefaultFonts();
+
+    SmMlElement* GetMlElementTree()  { return m_pMlElementTree; }
+    void SetMlElementTree(SmMlElement* pMlElementTree) {
+        mathml::SmMlIteratorFree(m_pMlElementTree);
+        m_pMlElementTree = pMlElementTree;
+    }
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index 23a0caf847fb..4acba208a61e 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -556,6 +556,7 @@ void SmDocShell::Repaint()
 
 SmDocShell::SmDocShell( SfxModelFlags i_nSfxCreationFlags )
     : SfxObjectShell(i_nSfxCreationFlags)
+    , m_pMlElementTree(nullptr)
     , mpPrinter(nullptr)
     , mpTmpPrinter(nullptr)
     , mnModifyCount(0)
@@ -587,6 +588,8 @@ SmDocShell::~SmDocShell()
     mpEditEngine.reset();
     mpEditEngineItemPool.clear();
     mpPrinter.disposeAndClear();
+
+    mathml::SmMlIteratorFree(m_pMlElementTree);
 }
 
 bool SmDocShell::ConvertFrom(SfxMedium &rMedium)


More information about the Libreoffice-commits mailing list