diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-03-07 13:46:09 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-03-07 20:14:37 +0100 |
commit | 87d3f768f3ecded1e1392442181edb287aed9e2e (patch) | |
tree | 64de544f05fbae96f466d9c8dc024a8e7d5aae73 /starmath/source | |
parent | b117f7d42c7c8bce12d61c01b92b8af4e9aa70b1 (diff) |
add sm to --enable-mergelibs=more
Which means
(1) We need to extend the weak linkage magic for the sfx2 SFX_TYPEMAP
stuff. Just make it unconditional, since it makes no difference for the
individual items.
(2) The initialisation of global const Sequence data in starmath stops
working, because it runs too early. Use function-local static to
initialise it on-demand
Change-Id: Idc397515cd1d9621a06d237606c19acee600081a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164532
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'starmath/source')
-rw-r--r-- | starmath/source/mathml/export.cxx | 2 | ||||
-rw-r--r-- | starmath/source/mathml/import.cxx | 4 | ||||
-rw-r--r-- | starmath/source/mathml/mathmlexport.cxx | 2 | ||||
-rw-r--r-- | starmath/source/mathml/mathmlimport.cxx | 4 | ||||
-rw-r--r-- | starmath/source/mathml/xparsmlbase.cxx | 17 |
5 files changed, 19 insertions, 10 deletions
diff --git a/starmath/source/mathml/export.cxx b/starmath/source/mathml/export.cxx index 60328c89dabf..001a31434eaf 100644 --- a/starmath/source/mathml/export.cxx +++ b/starmath/source/mathml/export.cxx @@ -299,7 +299,7 @@ bool SmMLExportWrapper::WriteThroughComponentOS(const Reference<io::XOutputStrea // connect XML writer to output stream xSaxWriter->setOutputStream(xOutputStream); if (m_bUseHTMLMLEntities) - xSaxWriter->setCustomEntityNames(starmathdatabase::icustomMathmlHtmlEntitiesExport); + xSaxWriter->setCustomEntityNames(starmathdatabase::getCustomMathmlHtmlEntitiesExport()); // prepare arguments (prepend doc handler to given arguments) Sequence<Any> aArgs{ Any(xSaxWriter), Any(rPropSet) }; diff --git a/starmath/source/mathml/import.cxx b/starmath/source/mathml/import.cxx index d857e56930d6..ba1f59fa74f9 100644 --- a/starmath/source/mathml/import.cxx +++ b/starmath/source/mathml/import.cxx @@ -390,14 +390,14 @@ ErrCode SmMLImportWrapper::ReadThroughComponentIS( Reference<css::xml::sax::XFastDocumentHandler> xFastDocHandler(xFilter, UNO_QUERY); if (xFastParser) { - xFastParser->setCustomEntityNames(starmathdatabase::icustomMathmlHtmlEntities); + xFastParser->setCustomEntityNames(starmathdatabase::getCustomMathmlHtmlEntities()); xFastParser->parseStream(aParserInput); } else if (xFastDocHandler) { Reference<css::xml::sax::XFastParser> xParser = css::xml::sax::FastParser::create(rxContext); - xParser->setCustomEntityNames(starmathdatabase::icustomMathmlHtmlEntities); + xParser->setCustomEntityNames(starmathdatabase::getCustomMathmlHtmlEntities()); xParser->setFastDocumentHandler(xFastDocHandler); xParser->parseStream(aParserInput); } diff --git a/starmath/source/mathml/mathmlexport.cxx b/starmath/source/mathml/mathmlexport.cxx index 1c18e716e7d6..2f0a6f40f2b2 100644 --- a/starmath/source/mathml/mathmlexport.cxx +++ b/starmath/source/mathml/mathmlexport.cxx @@ -234,7 +234,7 @@ bool SmXMLExportWrapper::WriteThroughComponent(const Reference<io::XOutputStream // connect XML writer to output stream xSaxWriter->setOutputStream(xOutputStream); if (m_bUseHTMLMLEntities) - xSaxWriter->setCustomEntityNames(starmathdatabase::icustomMathmlHtmlEntitiesExport); + xSaxWriter->setCustomEntityNames(starmathdatabase::getCustomMathmlHtmlEntitiesExport()); // prepare arguments (prepend doc handler to given arguments) Sequence<Any> aArgs{ Any(xSaxWriter), Any(rPropSet) }; diff --git a/starmath/source/mathml/mathmlimport.cxx b/starmath/source/mathml/mathmlimport.cxx index 7bc3e5b913e3..d93e31a14e60 100644 --- a/starmath/source/mathml/mathmlimport.cxx +++ b/starmath/source/mathml/mathmlimport.cxx @@ -264,7 +264,7 @@ ErrCode SmXMLImportWrapper::ReadThroughComponent(const Reference<io::XInputStrea if (xFastParser) { if (bUseHTMLMLEntities) - xFastParser->setCustomEntityNames(starmathdatabase::icustomMathmlHtmlEntities); + xFastParser->setCustomEntityNames(starmathdatabase::getCustomMathmlHtmlEntities()); xFastParser->parseStream(aParserInput); } else if (xFastDocHandler) @@ -272,7 +272,7 @@ ErrCode SmXMLImportWrapper::ReadThroughComponent(const Reference<io::XInputStrea Reference<css::xml::sax::XFastParser> xParser = css::xml::sax::FastParser::create(rxContext); if (bUseHTMLMLEntities) - xParser->setCustomEntityNames(starmathdatabase::icustomMathmlHtmlEntities); + xParser->setCustomEntityNames(starmathdatabase::getCustomMathmlHtmlEntities()); xParser->setFastDocumentHandler(xFastDocHandler); xParser->parseStream(aParserInput); } diff --git a/starmath/source/mathml/xparsmlbase.cxx b/starmath/source/mathml/xparsmlbase.cxx index ccfcf0049e77..418126c68b23 100644 --- a/starmath/source/mathml/xparsmlbase.cxx +++ b/starmath/source/mathml/xparsmlbase.cxx @@ -2149,9 +2149,13 @@ static ::css::beans::Pair<::rtl::OUString, ::rtl::OUString> // clang-format on }; -const ::css::uno::Sequence<::css::beans::Pair<OUString, OUString>> - starmathdatabase::icustomMathmlHtmlEntities( +const css::uno::Sequence<::css::beans::Pair<OUString, OUString>>& +starmathdatabase::getCustomMathmlHtmlEntities() +{ + static css::uno::Sequence<::css::beans::Pair<OUString, OUString>> data( icustomMathmlHtmlEntitiesData, starmathdatabase::STARMATH_MATHMLHTML_ENTITY_NUMBER); + return data; +} static ::css::beans::Pair<::rtl::OUString, ::rtl::OUString> icustomMathmlHtmlEntitiesNamesExportData[2] = { @@ -2160,7 +2164,12 @@ static ::css::beans::Pair<::rtl::OUString, ::rtl::OUString> { u"∞"_ustr, u"\u221E"_ustr} // clang-format on }; -const ::css::uno::Sequence<::css::beans::Pair<::rtl::OUString, ::rtl::OUString>> - starmathdatabase::icustomMathmlHtmlEntitiesExport(icustomMathmlHtmlEntitiesNamesExportData, 2); +const css::uno::Sequence<::css::beans::Pair<::rtl::OUString, ::rtl::OUString>>& +starmathdatabase::getCustomMathmlHtmlEntitiesExport() +{ + static css::uno::Sequence<::css::beans::Pair<::rtl::OUString, ::rtl::OUString>> data( + icustomMathmlHtmlEntitiesNamesExportData, 2); + return data; +}; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |