[Libreoffice-commits] core.git: sax/source starmath/source

dante (via logerrit) logerrit at kemper.freedesktop.org
Fri Dec 11 06:40:35 UTC 2020


 sax/source/fastparser/fastparser.cxx |   18 +++++++++---------
 starmath/source/mathmlattr.hxx       |    1 -
 starmath/source/mathmlimport.cxx     |    1 +
 3 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit b9ffc3591189c54885094fefe477241418f67996
Author:     dante <dante19031999 at gmail.com>
AuthorDate: Wed Dec 9 17:14:17 2020 +0100
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Fri Dec 11 07:40:00 2020 +0100

    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>&#x3C3;</mi>
      <mi>&#x221E;</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 at collabora.com>

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>


More information about the Libreoffice-commits mailing list