starmath/source/document.cxx | 27 +++++++++++++-------------- starmath/util/sm.component | 24 ++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 14 deletions(-)
New commits: commit 9b7600f547cec9ed1bacca3a1b995b3c33fd5723 Author: dante <dante19031...@gmail.com> AuthorDate: Wed May 11 12:08:52 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon Sep 5 18:22:01 2022 +0200 Connect new import / export to starmath See: https://gerrit.libreoffice.org/c/core/+/120753 Change-Id: I9b02a4a7b4bc6c132220710573b7672b1a5b1c60 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134163 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index 8e8747d3c793..d13cd8218055 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -70,8 +70,8 @@ #include "ooxmlexport.hxx" #include "ooxmlimport.hxx" #include "rtfexport.hxx" -#include <mathmlimport.hxx> -#include <mathmlexport.hxx> +#include <import.hxx> +#include <export.hxx> #include <svx/svxids.hrc> #include <cursor.hxx> #include <comphelper/diagnose_ex.hxx> @@ -594,8 +594,7 @@ bool SmDocShell::ConvertFrom(SfxMedium &rMedium) InvalidateCursor(); } Reference<css::frame::XModel> xModel(GetModel()); - SmXMLImportWrapper aEquation(xModel); - aEquation.useHTMLMLEntities(true); + SmMLImportWrapper aEquation(xModel); bSuccess = ( ERRCODE_NONE == aEquation.Import(rMedium) ); } else @@ -655,7 +654,7 @@ bool SmDocShell::Load( SfxMedium& rMedium ) { // is this a fabulous math package ? Reference<css::frame::XModel> xModel(GetModel()); - SmXMLImportWrapper aEquation(xModel); + SmMLImportWrapper aEquation(xModel); auto nError = aEquation.Import(rMedium); bRet = ERRCODE_NONE == nError; SetError(nError); @@ -686,8 +685,8 @@ bool SmDocShell::Save() ArrangeFormula(); Reference<css::frame::XModel> xModel(GetModel()); - SmXMLExportWrapper aEquation(xModel); - aEquation.SetFlat(false); + SmMLExportWrapper aEquation(xModel); + aEquation.setFlat(false); return aEquation.Export(*GetMedium()); } @@ -746,8 +745,8 @@ bool SmDocShell::SaveAs( SfxMedium& rMedium ) ArrangeFormula(); Reference<css::frame::XModel> xModel(GetModel()); - SmXMLExportWrapper aEquation(xModel); - aEquation.SetFlat(false); + SmMLExportWrapper aEquation(xModel); + aEquation.setFlat(false); bRet = aEquation.Export(rMedium); } return bRet; @@ -768,16 +767,16 @@ bool SmDocShell::ConvertTo( SfxMedium &rMedium ) if(rFltName == STAROFFICE_XML) { Reference<css::frame::XModel> xModel(GetModel()); - SmXMLExportWrapper aEquation(xModel); - aEquation.SetFlat(false); + SmMLExportWrapper aEquation(xModel); + aEquation.setFlat(false); bRet = aEquation.Export(rMedium); } else if(rFltName == MATHML_XML) { Reference<css::frame::XModel> xModel(GetModel()); - SmXMLExportWrapper aEquation(xModel); - aEquation.SetFlat(true); - aEquation.SetUseHTMLMLEntities(true); + SmMLExportWrapper aEquation(xModel); + aEquation.setFlat(true); + aEquation.setUseHTMLMLEntities(true); bRet = aEquation.Export(rMedium); } else if (pFlt->GetFilterName() == "MathType 3.x") diff --git a/starmath/util/sm.component b/starmath/util/sm.component index 2b84a17c429c..29eb7c9b4168 100644 --- a/starmath/util/sm.component +++ b/starmath/util/sm.component @@ -67,4 +67,28 @@ constructor="org_libreoffice_comp_Math_sidebar_SmPanelFactory"> <service name="com.sun.star.ui.UIElementFactory"/> </implementation> + <implementation name="com.sun.star.comp.Math.MLImporter" + constructor="Math_MLImporter_get_implementation"> + <service name="com.sun.star.xml.MLImportFilter"/> + </implementation> + <implementation name="com.sun.star.comp.Math.MLOasisMetaImporter" + constructor="Math_MLOasisMetaImporter_get_implementation"> + <service name="com.sun.star.xml.MLImportFilter"/> + </implementation> + <implementation name="com.sun.star.comp.Math.MLOasisSettingsImporter" + constructor="Math_MLOasisSettingsImporter_get_implementation"> + <service name="com.sun.star.xml.MLImportFilter"/> + </implementation> + <implementation name="com.sun.star.comp.Math.MLContentExporter" + constructor="Math_MLContentExporter_get_implementation"> + <service name="com.sun.star.xml.MLExportFilter"/> + </implementation> + <implementation name="com.sun.star.comp.Math.MLOasisMetaExporter" + constructor="Math_MLOasisMetaExporter_get_implementation"> + <service name="com.sun.star.xml.MLExportFilter"/> + </implementation> + <implementation name="com.sun.star.comp.Math.MLOasisSettingsExporter" + constructor="Math_MLOasisSettingsExporter_get_implementation"> + <service name="com.sun.star.xml.MLExportFilter"/> + </implementation> </component>