From e67a834c5d1a14889ab97b79df5b579934f27c30 Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Wed, 18 Nov 2015 15:37:26 +0100 Subject: Resolves: tdf#93994 flush API objects at load time When importing SdrObjCustomShape for each an Outliner and a VirtualDevice as RefDevice are created and held. On 32bit systems this breaks the import with many such objects (in the bugdoc around 4300). On 64bit it works, but more memory as necessary is used. To avoid this, flush the UNO API implementations at these objects after one page is imported. Do not do this for each single object, that will break the connector import which does some processing later. Change-Id: I7296edd40f01c1a40258808d78bf39e6d4fe29bf Reviewed-on: https://gerrit.libreoffice.org/19990 Reviewed-by: Thorsten Behrens Tested-by: Thorsten Behrens --- sd/source/ui/unoidl/unopage.cxx | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'sd') diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 98a9aa34257a..8dbb921d1549 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -73,6 +73,7 @@ #include "unohelp.hxx" #include #include +#include using ::com::sun::star::animations::XAnimationNode; using ::com::sun::star::animations::XAnimationNodeSupplier; @@ -605,6 +606,32 @@ void SAL_CALL SdGenericDrawPage::setPropertyValue( const OUString& aPropertyName throwIfDisposed(); + // tdf#93994 Use a custom slot to have filter code flush the UNO + // API implementations of SdrObjCustomShape. Used e.g. by + // SdXMLDrawPageContext::EndElement(), see there for more + // information + if(SvxFmDrawPage::mpPage) + { + const OUString sFlushCustomShapeUnoApiObjects("FlushCustomShapeUnoApiObjects"); + + if(sFlushCustomShapeUnoApiObjects == aPropertyName) + { + SdrObjListIter aIter(static_cast< SdPage& >(*SvxFmDrawPage::mpPage), IM_DEEPWITHGROUPS); + + while(aIter.IsMore()) + { + SdrObjCustomShape* pCustomShape = dynamic_cast< SdrObjCustomShape* >(aIter.Next()); + + if(pCustomShape) + { + pCustomShape->setUnoShape(nullptr); + } + } + + return; + } + } + const SfxItemPropertySimpleEntry* pEntry = mpPropSet->getPropertyMapEntry(aPropertyName); switch( pEntry ? pEntry->nWID : -1 ) -- cgit