diff options
author | dante <dante19031999@gmail.com> | 2020-12-09 17:14:17 +0100 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2020-12-11 07:40:00 +0100 |
commit | b9ffc3591189c54885094fefe477241418f67996 (patch) | |
tree | fc0640accc1ec56922c0bc2914c9aa060b2beb45 | |
parent | 61d07657caab5e0fb8ec4446f67a7044e14dae4b (diff) |
FastParser.cxx changes
If custom entity list is empty, custon entities by unicode value have to keep working.
Succefully loaded:
<?xml version="1.0" encoding="UTF-8"?>
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<semantics>
<mi>σ</mi>
<mi>∞</mi>
<mi>σ</mi>
<mi>∞</mi>
</semantics>
</math>
Change-Id: I46cc5b04bd91d1aaadf3f99cb2079325bb0d08cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107498
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r-- | sax/source/fastparser/fastparser.cxx | 18 | ||||
-rw-r--r-- | starmath/source/mathmlattr.hxx | 1 | ||||
-rw-r--r-- | starmath/source/mathmlimport.cxx | 1 |
3 files changed, 10 insertions, 10 deletions
diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx index 04bf69a1705b..05288a4ef5f3 100644 --- a/sax/source/fastparser/fastparser.cxx +++ b/sax/source/fastparser/fastparser.cxx @@ -933,7 +933,6 @@ void FastSaxParserImpl::setNamespaceHandler( const Reference< XFastNamespaceHand maData.mxNamespaceHandler = Handler; } -#include <stdio.h> void FastSaxParserImpl::setCustomEntityNames( const ::css::uno::Sequence< ::rtl::OUString >& names, const ::css::uno::Sequence< ::rtl::OUString >& replacements ) { mEntityNames = names; @@ -1372,16 +1371,17 @@ xmlEntityPtr FastSaxParserImpl::callbackGetEntity( const xmlChar *name ) int lname = strlen(dname); if( lname == 0 ) return xmlGetPredefinedEntity(name); - if( !mEntityNames.hasElements() ) - return xmlGetPredefinedEntity(name); - for( size_t i = 0; i < mEntityNames.size(); ++i ) + if (mEntityNames.hasElements()) { - if( mEntityNames[i].compareToAscii(dname) == 0 ) + for (size_t i = 0; i < mEntityNames.size(); ++i) { - return xmlNewEntity( nullptr, - name, - XML_INTERNAL_GENERAL_ENTITY, nullptr, nullptr, - BAD_CAST(OUStringToOString(mEntityReplacements[i],RTL_TEXTENCODING_UTF8).getStr())); + if (mEntityNames[i].compareToAscii(dname) == 0) + { + return xmlNewEntity( + nullptr, name, XML_INTERNAL_GENERAL_ENTITY, nullptr, nullptr, + BAD_CAST( + OUStringToOString(mEntityReplacements[i], RTL_TEXTENCODING_UTF8).getStr())); + } } } if( lname < 2 ) diff --git a/starmath/source/mathmlattr.hxx b/starmath/source/mathmlattr.hxx index fba6f3bc4195..104495d2c878 100644 --- a/starmath/source/mathmlattr.hxx +++ b/starmath/source/mathmlattr.hxx @@ -13,7 +13,6 @@ #include <rtl/ustring.hxx> #include <sal/types.h> #include <tools/fract.hxx> -#include "xparsmlbase.hxx" // MathML 3: 2.1.5.1 Syntax notation used in the MathML specification // <https://www.w3.org/TR/MathML/chapter2.html#id.2.1.5.1> diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx index c06d0043dee7..e68184660850 100644 --- a/starmath/source/mathmlimport.cxx +++ b/starmath/source/mathmlimport.cxx @@ -63,6 +63,7 @@ one go*/ #include <memory> #include "mathmlattr.hxx" +#include "xparsmlbase.hxx" #include "mathmlimport.hxx" #include <document.hxx> #include <smdll.hxx> |