diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2015-11-18 15:37:26 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-05-11 12:53:51 +0000 |
commit | 67755e4a3b0634d123ad68b107381bf90b6d6487 (patch) | |
tree | b08646ea9d21c6015c4c12c57210bb65195c5417 /xmloff | |
parent | 5d7badd2f2341171733c5fabf111ecf9674bc3d4 (diff) |
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 <Thorsten.Behrens@CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
(cherry picked from commit e67a834c5d1a14889ab97b79df5b579934f27c30)
Reviewed-on: https://gerrit.libreoffice.org/24841
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/draw/ximpbody.cxx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/xmloff/source/draw/ximpbody.cxx b/xmloff/source/draw/ximpbody.cxx index 2fea4682020f..227280e4d443 100644 --- a/xmloff/source/draw/ximpbody.cxx +++ b/xmloff/source/draw/ximpbody.cxx @@ -37,6 +37,7 @@ #include "PropertySetMerger.hxx" #include "animationimport.hxx" #include <tools/debug.hxx> +#include <osl/diagnose.hxx> using namespace ::com::sun::star; @@ -277,6 +278,29 @@ void SdXMLDrawPageContext::EndElement() if(xNodeSupplier.is()) xmloff::AnimationNodeContext::postProcessRootNode( GetSdImport(), xNodeSupplier->getAnimationNode(), xPageProps ); } + + // tdf#93994 call a custom slot to be able to reset the UNO API + // implementations held on the SdrObjects of type + // SdrObjCustomShape - those tend to linger until the entire file + // is loaded. For large files with a lot of these 32bit systems + // may crash due to being out of ressources after ca. 4200 + // Outliners and VirtualDevices used there as RefDevice + try + { + uno::Reference< beans::XPropertySet > xPropSet(GetLocalShapesContext(), uno::UNO_QUERY); + + if(xPropSet.is()) + { + const OUString sFlushCustomShapeUnoApiObjects("FlushCustomShapeUnoApiObjects"); + uno::Any aAny; + aAny <<= sal_True; + xPropSet->setPropertyValue(sFlushCustomShapeUnoApiObjects, aAny); + } + } + catch(const uno::Exception&) + { + OSL_FAIL("could not flush after load"); + } } SdXMLBodyContext::SdXMLBodyContext( SdXMLImport& rImport, |