diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2025-02-17 11:06:55 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2025-02-26 16:56:56 +0100 |
commit | 09e2627a83d4769983c39fb2cb260e11fce354f3 (patch) | |
tree | c070d53da0092ef3826a2511d4ae875143576253 /starmath/source | |
parent | a4ab140ec079b86857145f5370d083b5e2c38440 (diff) |
use more concrete UNO types in some local vars
found by a little plugin I created.
Plugin parked into store/ folder because it needs hand-holding
when run.
Change-Id: I2b4da7378f0becbc5f020ac9e78cd765aa0119b4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181768
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Diffstat (limited to 'starmath/source')
-rw-r--r-- | starmath/source/mathml/export.cxx | 6 | ||||
-rw-r--r-- | starmath/source/mathml/import.cxx | 11 |
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) |