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

New commits:
commit 4ea561aa56208c63938fbc4dbf1e1e509de456ec
Author:     Noel Grandin <[email protected]>
AuthorDate: Fri Sep 20 09:41:41 2019 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Mon Sep 23 12:48:48 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 <[email protected]>
    Tested-by: Noel Grandin <[email protected]>
    (cherry picked from commit ea4f3099d6e0cf30d80caa8b2121c7a358f80fdd)
    Reviewed-on: https://gerrit.libreoffice.org/79378
    Tested-by: Jenkins

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;
 };
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to