diff options
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: */ |