diff options
author | dante <dante19031999@gmail.com> | 2020-12-26 18:53:18 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-12-27 08:29:27 +0100 |
commit | 78552cb9b167a677952bf80eb0c7af62baaf015a (patch) | |
tree | f3f6a0fcd8168fc44091d258ec1b821fc017d4c8 /starmath | |
parent | a26504cb5790eff1ca8b932382f73ff3baaec50a (diff) |
Preparations for customized xml entities on export
Change-Id: I8ad4af7e27ae5f8908f4c932242cb96abbf3de90
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108354
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/source/mathmlexport.cxx | 2 | ||||
-rw-r--r-- | starmath/source/xparsmlbase.cxx | 10 | ||||
-rw-r--r-- | starmath/source/xparsmlbase.hxx | 10 |
3 files changed, 20 insertions, 2 deletions
diff --git a/starmath/source/mathmlexport.cxx b/starmath/source/mathmlexport.cxx index 9a8f700af2ec..953bfb87f062 100644 --- a/starmath/source/mathmlexport.cxx +++ b/starmath/source/mathmlexport.cxx @@ -58,6 +58,7 @@ #include <stack> #include "mathmlexport.hxx" +#include "xparsmlbase.hxx" #include <strings.hrc> #include <smmod.hxx> #include <unomodel.hxx> @@ -240,6 +241,7 @@ bool SmXMLExportWrapper::WriteThroughComponent(const Reference<io::XOutputStream // connect XML writer to output stream xSaxWriter->setOutputStream(xOutputStream); + xSaxWriter->setCustomEntityNames(starmathdatabase::icustomMathmlHtmlEntitiesExport); // prepare arguments (prepend doc handler to given arguments) Sequence<Any> aArgs(2); diff --git a/starmath/source/xparsmlbase.cxx b/starmath/source/xparsmlbase.cxx index 4c5651ae2c55..519fab844465 100644 --- a/starmath/source/xparsmlbase.cxx +++ b/starmath/source/xparsmlbase.cxx @@ -2153,4 +2153,14 @@ const ::css::uno::Sequence<::css::beans::Pair<OUString, OUString>> starmathdatabase::icustomMathmlHtmlEntities( icustomMathmlHtmlEntitiesData, starmathdatabase::STARMATH_MATHMLHTML_ENTITY_NUMBER); +static ::css::beans::Pair<::rtl::OUString, ::rtl::OUString> + icustomMathmlHtmlEntitiesNamesExportData[2] = { + // clang-format off + { u"σ", u"\u03C3"}, + { u"∞", u"\u221E"} + // clang-format on + }; +const ::css::uno::Sequence<::css::beans::Pair<::rtl::OUString, ::rtl::OUString>> + starmathdatabase::icustomMathmlHtmlEntitiesExport(icustomMathmlHtmlEntitiesNamesExportData, 2); + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/starmath/source/xparsmlbase.hxx b/starmath/source/xparsmlbase.hxx index 8ec7b48ccab4..83650382e31b 100644 --- a/starmath/source/xparsmlbase.hxx +++ b/starmath/source/xparsmlbase.hxx @@ -37,12 +37,18 @@ namespace starmathdatabase constexpr sal_Int32 STARMATH_MATHMLHTML_ENTITY_NUMBER = 2125; /** - * Entity names for mathml. Example: ∞ + * Entity names for mathml. Example: &infin -> \u221E; * These ones are to be used on import. - * Must be in sync with customMathmlHtmlEntitiesNames. */ const extern ::css::uno::Sequence<::css::beans::Pair<::rtl::OUString, ::rtl::OUString>> icustomMathmlHtmlEntities; + +/** + * Entity names for mathml. Example: "\u221E"; -> ∞ + * These ones are to be used on file export. + */ +const extern ::css::uno::Sequence<::css::beans::Pair<::rtl::OUString, ::rtl::OUString>> + icustomMathmlHtmlEntitiesExport; }; #endif /*XPARSEMLBASE*/ |