[Libreoffice-commits] core.git: editeng/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Fri Sep 20 08:52:23 UTC 2019


 editeng/source/misc/SvXMLAutoCorrectImport.hxx |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit ea4f3099d6e0cf30d80caa8b2121c7a358f80fdd
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Sep 20 09:41:41 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Sep 20 10:51:12 2019 +0200

    tdf#109158 improve load time of autocorrect XML file
    
    Before, it seems to be doing a lot of unnecessary work because, by default,
    startFastElement will call startUnknownElement, which constructs various objects, etc.
    
    It seems to me that if the class already implements createFastChildContext,
    it is already using XFastParser, and so it should implement startFastElement to avoid that work.
    
    By avoiding going down the startUnknownElement path, reduces load time from
    1.7s to 1.4s
    
    Change-Id: Ifd745cf2cc22a8cb988a5668332cf6e70bb996da
    Reviewed-on: https://gerrit.libreoffice.org/79269
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/editeng/source/misc/SvXMLAutoCorrectImport.hxx b/editeng/source/misc/SvXMLAutoCorrectImport.hxx
index 34ec61ed323d..f61cd036b526 100644
--- a/editeng/source/misc/SvXMLAutoCorrectImport.hxx
+++ b/editeng/source/misc/SvXMLAutoCorrectImport.hxx
@@ -56,6 +56,7 @@ public:
 
     virtual css::uno::Reference<XFastContextHandler> SAL_CALL createFastChildContext( sal_Int32 Element,
         const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList ) override;
+    virtual void SAL_CALL startFastElement( sal_Int32 /*Element*/, const css::uno::Reference< css::xml::sax::XFastAttributeList >& /*Attribs*/ ) override {}
 
     virtual ~SvXMLWordListContext() override;
 };
@@ -65,6 +66,7 @@ class SvXMLWordContext : public SvXMLImportContext
 public:
     SvXMLWordContext ( SvXMLAutoCorrectImport& rImport,
         const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList );
+    virtual void SAL_CALL startFastElement( sal_Int32 /*Element*/, const css::uno::Reference< css::xml::sax::XFastAttributeList >& /*Attribs*/ ) override {}
 
     virtual ~SvXMLWordContext() override;
 };


More information about the Libreoffice-commits mailing list