summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authordante <dante19031999@gmail.com>2022-05-11 12:08:52 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-09-05 18:22:01 +0200
commit9b7600f547cec9ed1bacca3a1b995b3c33fd5723 (patch)
treea79c48c2361f7f051600d8f6b4a9b3d33e833f98 /starmath
parent35a7e40d372d3211061465346825cf543a095f6d (diff)
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.grandin@collabora.co.uk>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/document.cxx27
-rw-r--r--starmath/util/sm.component24
2 files changed, 37 insertions, 14 deletions
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>