Kaydet (Commit) b5b2628a authored tarafından Thorsten Behrens's avatar Thorsten Behrens

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.

Change-Id: I7d28abb7886b5c1728726b7d42578459e56e7f62
Reviewed-on: https://gerrit.libreoffice.org/49985Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
üst f0485ba2
......@@ -36,6 +36,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>
......@@ -44,6 +45,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>
......@@ -57,6 +59,7 @@ using namespace com::sun::star::document;
using namespace com::sun::star::style;
using namespace com::sun::star::xml;
using namespace com::sun::star::xml::sax;
using namespace com::sun::star::frame;
using namespace ::com::sun::star::task;
bool XmlFilterAdaptor::importImpl( const Sequence< css::beans::PropertyValue >& aDescriptor )
......@@ -121,6 +124,15 @@ bool XmlFilterAdaptor::importImpl( const Sequence< css::beans::PropertyValue >&
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment