[Libreoffice-commits] core.git: Branch 'feature/cib_contract136' - filter/source

Thorsten Behrens Thorsten.Behrens at CIB.de
Mon Feb 19 12:54:31 UTC 2018


 filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx |   11 +++++++++++
 1 file changed, 11 insertions(+)

New commits:
commit 45d4f88ec66e9341783b1aeea1f1589570cf773b
Author: Thorsten Behrens <Thorsten.Behrens at CIB.de>
Date:   Fri Feb 16 11:01:10 2018 +0100

    filter: speedup nested importers by not notifying constantly
    
    For example the PDF import into Draw would otherwise waste many
    cycles on needlessly notifying several times per shape loaded.
    
    (cherry picked from commit b7d9b1fe9edab1e250dc9d52e75db8880ac79cbb)
    
    Conflicts:
            filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx
    
    Change-Id: I7d28abb7886b5c1728726b7d42578459e56e7f62

diff --git a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx
index 88d829dead0b..f650ce7c365c 100644
--- a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx
+++ b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx
@@ -40,6 +40,7 @@
 #include <com/sun/star/task/XStatusIndicatorFactory.hpp>
 #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
 #include <com/sun/star/style/XStyleLoader.hpp>
+#include <com/sun/star/frame/XModel.hpp>
 #include <com/sun/star/container/XNameAccess.hpp>
 #include <comphelper/fileurl.hxx>
 #include <comphelper/processfactory.hxx>
@@ -48,6 +49,7 @@
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 #include <comphelper/genericpropertyset.hxx>
 #include <comphelper/propertysetinfo.hxx>
+#include <comphelper/scopeguard.hxx>
 #include <cppuhelper/supportsservice.hxx>
 #include <unotools/pathoptions.hxx>
 
@@ -130,6 +132,15 @@ bool SAL_CALL XmlFilterAdaptor::importImpl( const Sequence< css::beans::Property
 
     Reference< XImportFilter > xConverter( xConvBridge, UNO_QUERY );
 
+    // prevent unnecessary broadcasting when loading
+    Reference< XModel > xModel( mxDoc, UNO_QUERY );
+    if( xModel.is() )
+        xModel->lockControllers();
+    comphelper::ScopeGuard guard([&]() {
+        // cleanup when leaving
+        if( xModel.is() )
+            xModel->unlockControllers();
+    });
 
     //Template Loading if Required
 


More information about the Libreoffice-commits mailing list