diff options
author | Noel Grandin <noel@peralex.com> | 2021-04-30 13:00:35 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-04-30 16:03:35 +0200 |
commit | 857caa5fc69b92e781457a1b67a89aa051c2d70f (patch) | |
tree | 7437d7f6345f9dea81f4203517549c48fa971eae /framework | |
parent | b9097800f4f997de2325bc9e588e6caea7a563c7 (diff) |
tdf#79049 speed up OOXML workbook load
we spend a lot of time in ScAttrArray::GetLastVisibleAttr
which appears to be very expensive for this worksheet.
This is re-computed every time we enter SfxBaseModel::getArgs
Reduce the recomputation by introducing a new method which
only retrieves specific SfxBaseModel arguments.
This takes the load time from 5m9 to 1m9 for me.
Change-Id: I605fae0faa94760c7d6993877c9559ea5dc813cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114905
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/fwe/helper/titlehelper.cxx | 7 | ||||
-rw-r--r-- | framework/source/services/autorecovery.cxx | 14 |
2 files changed, 11 insertions, 10 deletions
diff --git a/framework/source/fwe/helper/titlehelper.cxx b/framework/source/fwe/helper/titlehelper.cxx index 24d1eb3bf898..ae9c1f348b0e 100644 --- a/framework/source/fwe/helper/titlehelper.cxx +++ b/framework/source/fwe/helper/titlehelper.cxx @@ -28,6 +28,7 @@ #include <com/sun/star/frame/XStorable.hpp> #include <com/sun/star/frame/ModuleManager.hpp> #include <com/sun/star/frame/XUntitledNumbers.hpp> +#include <com/sun/star/frame/XModel3.hpp> #include <com/sun/star/document/XDocumentEventBroadcaster.hpp> #include <unotools/configmgr.hxx> @@ -302,7 +303,7 @@ void TitleHelper::impl_sendTitleChangedEvent () void TitleHelper::impl_updateTitle (bool init) { - css::uno::Reference< css::frame::XModel > xModel; + css::uno::Reference< css::frame::XModel3 > xModel; css::uno::Reference< css::frame::XController > xController; css::uno::Reference< css::frame::XFrame > xFrame; // SYNCHRONIZED -> @@ -329,7 +330,7 @@ void TitleHelper::impl_updateTitle (bool init) } } -void TitleHelper::impl_updateTitleForModel (const css::uno::Reference< css::frame::XModel >& xModel, bool init) +void TitleHelper::impl_updateTitleForModel (const css::uno::Reference< css::frame::XModel3 >& xModel, bool init) { css::uno::Reference< css::uno::XInterface > xOwner; css::uno::Reference< css::frame::XUntitledNumbers > xNumbers; @@ -363,7 +364,7 @@ void TitleHelper::impl_updateTitleForModel (const css::uno::Reference< css::fram if (xURLProvider.is()) sURL = xURLProvider->getLocation (); - utl::MediaDescriptor aDescriptor(xModel->getArgs()); + utl::MediaDescriptor aDescriptor(xModel->getArgs2( { utl::MediaDescriptor::PROP_SUGGESTEDSAVEASNAME() } )); const OUString sSuggestedSaveAsName = aDescriptor.getUnpackedValueOrDefault( utl::MediaDescriptor::PROP_SUGGESTEDSAVEASNAME(), OUString()); diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index 085b627f5794..3fdf6c0af01c 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -34,7 +34,7 @@ #include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/frame/theGlobalEventBroadcaster.hpp> #include <com/sun/star/frame/XLoadable.hpp> -#include <com/sun/star/frame/XModel2.hpp> +#include <com/sun/star/frame/XModel3.hpp> #include <com/sun/star/frame/ModuleManager.hpp> #include <com/sun/star/frame/XTitle.hpp> #include <com/sun/star/frame/XFrame.hpp> @@ -636,7 +636,7 @@ private: @threadsafe */ - void implts_registerDocument(const css::uno::Reference< css::frame::XModel >& xDocument); + void implts_registerDocument(const css::uno::Reference< css::frame::XModel3 >& xDocument); /** @short remove the specified document from our internal document list. @@ -1537,7 +1537,7 @@ void SAL_CALL AutoRecovery::removeStatusListener(const css::uno::Reference< css: void SAL_CALL AutoRecovery::documentEventOccured(const css::document::DocumentEvent& aEvent) { - css::uno::Reference< css::frame::XModel > xDocument(aEvent.Source, css::uno::UNO_QUERY); + css::uno::Reference< css::frame::XModel3 > xDocument(aEvent.Source, css::uno::UNO_QUERY); // new document => put it into the internal list if ( @@ -2361,7 +2361,7 @@ IMPL_LINK_NOARG(AutoRecovery, implts_asyncDispatch, LinkParamNone*, void) } } -void AutoRecovery::implts_registerDocument(const css::uno::Reference< css::frame::XModel >& xDocument) +void AutoRecovery::implts_registerDocument(const css::uno::Reference< css::frame::XModel3 > & xDocument) { // ignore corrupted events, where no document is given ... Runtime Error ?! if (!xDocument.is()) @@ -2386,7 +2386,7 @@ void AutoRecovery::implts_registerDocument(const css::uno::Reference< css::frame aCacheLock.unlock(); - utl::MediaDescriptor lDescriptor(xDocument->getArgs()); + utl::MediaDescriptor lDescriptor(xDocument->getArgs2( { utl::MediaDescriptor::PROP_FILTERNAME(), utl::MediaDescriptor::PROP_NOAUTOSAVE() } )); // check if this document must be ignored for recovery ! // Some use cases don't wish support for AutoSave/Recovery ... as e.g. OLE-Server / ActiveX Control etcpp. @@ -4004,11 +4004,11 @@ void AutoRecovery::implts_verifyCacheAgainstDesktopDocumentList() // extract the model from the frame. // Ignore "view only" frames, which does not have a model. css::uno::Reference< css::frame::XController > xController; - css::uno::Reference< css::frame::XModel > xModel; + css::uno::Reference< css::frame::XModel3 > xModel; xController = xFrame->getController(); if (xController.is()) - xModel = xController->getModel(); + xModel.set( xController->getModel(), UNO_QUERY_THROW ); if (!xModel.is()) continue; |