summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-06-29 08:19:12 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-06-29 11:29:48 +0200
commit97123add76b743013fc5c222387feb4b9c13daf2 (patch)
treec2cfddbe8d2aad611adef65cbbb33899cada7eac /oox
parent19fa853ce12136b5c14e0c5a0aa906c296b75388 (diff)
tdf#135316 share themePtr and ShapeFilterBase across all shapes
.. in a document. Shavves 20% off my load time. Change-Id: I8101b4d229485ebdef0c1f72f856e7cda43559d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118045 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/shape/ShapeContextHandler.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx
index 3a0ed5a3a306..0d03d322d011 100644
--- a/oox/source/shape/ShapeContextHandler.cxx
+++ b/oox/source/shape/ShapeContextHandler.cxx
@@ -37,6 +37,7 @@
#include <oox/drawingml/themefragmenthandler.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <memory>
+#include <sal/log.hxx>
using namespace ::com::sun::star;
@@ -44,9 +45,9 @@ namespace oox::shape {
using namespace core;
using namespace drawingml;
-ShapeContextHandler::ShapeContextHandler(uno::Reference< uno::XComponentContext > const & context) :
+ShapeContextHandler::ShapeContextHandler(const rtl::Reference<ShapeFilterBase>& xFilterBase) :
mnStartToken(0),
- mxShapeFilterBase( new ShapeFilterBase(context) )
+ mxShapeFilterBase(xFilterBase)
{
}
@@ -257,14 +258,13 @@ void SAL_CALL ShapeContextHandler::startFastElement
{
mxShapeFilterBase->filter(maMediaDescriptor);
- mpThemePtr = std::make_shared<Theme>();
-
if (Element == DGM_TOKEN(relIds) || Element == LC_TOKEN(lockedCanvas) || Element == C_TOKEN(chart) ||
Element == WPS_TOKEN(wsp) || Element == WPG_TOKEN(wgp) || Element == OOX_TOKEN(dmlPicture, pic))
{
// Parse the theme relation, if available; the diagram won't have colors without it.
- if (!msRelationFragmentPath.isEmpty())
+ if (!mpThemePtr && !msRelationFragmentPath.isEmpty())
{
+ mpThemePtr = std::make_shared<Theme>();
// Get Target for Type = "officeDocument" from _rels/.rels file
// aOfficeDocumentFragmentPath is pointing to "word/document.xml" for docx & to "ppt/presentation.xml" for pptx
FragmentHandlerRef rFragmentHandlerRef(new ShapeFragmentHandler(*mxShapeFilterBase, "/"));