diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2016-05-10 12:51:46 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-05-11 12:54:21 +0000 |
commit | ea0951bcc0d66db288e4723e3147a04ef47eca50 (patch) | |
tree | 276a75a3b507bf249aef51b9faecb55c1cc907ce /xmloff | |
parent | 27db0b033235bb5379b5af4f530413750bee9f29 (diff) |
tdf#98163 Flush ressources at CustomShapes during import
During ODF import using API for CustomShapes Outliners and
VirtualDevioces get created and not destroyed due to referencing.
This makes the ressources blow up, even under 64bit windows.
Also see tdf#93994 where this was already fixed on page base,
but this is not sufficient for this case.
Reviewed-on: https://gerrit.libreoffice.org/24305
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
(cherry picked from commit e6adb3e8b4de3c0f78d249b83de19b849ef65b59)
Change-Id: If9b37d341fcfa4e65485c54054d47964ee2fff5f
Reviewed-on: https://gerrit.libreoffice.org/24843
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 | 23 | ||||
-rw-r--r-- | xmloff/source/draw/ximpshap.cxx | 23 |
2 files changed, 23 insertions, 23 deletions
diff --git a/xmloff/source/draw/ximpbody.cxx b/xmloff/source/draw/ximpbody.cxx index 227280e4d443..45c626d95c1e 100644 --- a/xmloff/source/draw/ximpbody.cxx +++ b/xmloff/source/draw/ximpbody.cxx @@ -278,29 +278,6 @@ 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, diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 91af3ee57478..5383b321651c 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -3898,6 +3898,29 @@ void SdXMLCustomShapeContext::EndElement() } SdXMLShapeContext::EndElement(); + + // tdf#98163 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(mxShape, 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"); + } } SvXMLImportContext* SdXMLCustomShapeContext::CreateChildContext( |