summaryrefslogtreecommitdiff
path: root/starmath/source
diff options
context:
space:
mode:
Diffstat (limited to 'starmath/source')
-rw-r--r--starmath/source/mathml/export.cxx6
-rw-r--r--starmath/source/mathml/import.cxx11
2 files changed, 4 insertions, 13 deletions
diff --git a/starmath/source/mathml/export.cxx b/starmath/source/mathml/export.cxx
index 80d9b4f79762..34f2394879ca 100644
--- a/starmath/source/mathml/export.cxx
+++ b/starmath/source/mathml/export.cxx
@@ -236,11 +236,9 @@ OUString SmMLExportWrapper::Export(SmMlElement* pElementTree)
return u""_ustr;
//Get model
- uno::Reference<lang::XComponent> xModelComp = m_xModel;
- SAL_WARN_IF(xModelComp == nullptr, "starmath", "Missing model component");
SmModel* pModel = m_xModel.get();
SAL_WARN_IF(pModel == nullptr, "starmath", "Failed to get threw uno tunnel");
- if (xModelComp == nullptr || pModel == nullptr)
+ if (pModel == nullptr)
return u""_ustr;
// Get doc shell
@@ -273,7 +271,7 @@ OUString SmMLExportWrapper::Export(SmMlElement* pElementTree)
// Write stuff
// Note: export through an XML exporter component (memory stream version)
- return WriteThroughComponentMS(xModelComp, xContext, xInfoSet);
+ return WriteThroughComponentMS(uno::Reference<lang::XComponent>(m_xModel), xContext, xInfoSet);
}
// export through an XML exporter component (output stream version)
diff --git a/starmath/source/mathml/import.cxx b/starmath/source/mathml/import.cxx
index b7d6699d1294..59d58ea0035d 100644
--- a/starmath/source/mathml/import.cxx
+++ b/starmath/source/mathml/import.cxx
@@ -300,14 +300,6 @@ ErrCode SmMLImportWrapper::Import(std::u16string_view aSource)
return ERRCODE_SFX_DOLOADFAILED;
}
- // Make a model component from our SmModel
- uno::Reference<lang::XComponent> xModelComp = m_xModel;
- if (!xModelComp.is())
- {
- SAL_WARN("starmath", "Failed to make model while file input");
- return ERRCODE_SFX_DOLOADFAILED;
- }
-
// Get model via uno
SmModel* pModel = m_xModel.get();
if (pModel == nullptr)
@@ -339,7 +331,8 @@ ErrCode SmMLImportWrapper::Import(std::u16string_view aSource)
// Read data
// read a component from text
- ErrCode nError = ReadThroughComponentMS(aSource, xModelComp, xContext, xInfoSet);
+ ErrCode nError = ReadThroughComponentMS(aSource, uno::Reference<lang::XComponent>(m_xModel),
+ xContext, xInfoSet);
// Declare any error
if (nError != ERRCODE_NONE)