diff options
author | Oliver Bolte <obo@openoffice.org> | 2005-07-18 12:05:07 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2005-07-18 12:05:07 +0000 |
commit | 435136e9430043e50e8d718840c9c5f23faf320a (patch) | |
tree | 9922cacf0ce76ff5a3db8431f1152eed664343f0 /sd | |
parent | 53d2fdb1624deedc3f7cdd2707dbd8c139c21479 (diff) |
INTEGRATION: CWS impress64 (1.54.118); FILE MERGED
2005/07/13 17:28:40 cl 1.54.118.1: #i50899# added a quickfix to remove unused items after import
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/filter/xml/sdxmlwrp.cxx | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx index 0b919bd05e27..2c642c181ffc 100644 --- a/sd/source/filter/xml/sdxmlwrp.cxx +++ b/sd/source/filter/xml/sdxmlwrp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: sdxmlwrp.cxx,v $ * - * $Revision: 1.54 $ + * $Revision: 1.55 $ * - * last change: $Author: obo $ $Date: 2005-03-15 11:21:13 $ + * last change: $Author: obo $ $Date: 2005-07-18 13:05:07 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -776,6 +776,45 @@ sal_Bool SdXMLFilter::Import( ErrCode& nError ) } } + + // clear unused named items from item pool + + uno::Reference< lang::XMultiServiceFactory> xModelFactory( mxModel, uno::UNO_QUERY ); + if( xModelFactory.is() ) + { + try + { + const OUString aName( RTL_CONSTASCII_USTRINGPARAM( "~clear~" ) ); + uno::Reference< container::XNameContainer > xGradient( xModelFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.GradientTable") ) ), uno::UNO_QUERY ); + if( xGradient.is() ) + xGradient->removeByName( aName ); + + uno::Reference< container::XNameContainer > xHatch( xModelFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.HatchTable") ) ), uno::UNO_QUERY ); + if( xHatch.is() ) + xHatch->removeByName( aName ); + + uno::Reference< container::XNameContainer > xBitmap( xModelFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.BitmapTable") ) ), uno::UNO_QUERY ); + if( xBitmap.is() ) + xBitmap->removeByName( aName ); + + uno::Reference< container::XNameContainer > xTransGradient( xModelFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.TransparencyGradientTable") ) ), uno::UNO_QUERY ); + if( xTransGradient.is() ) + xTransGradient->removeByName( aName ); + + uno::Reference< container::XNameContainer > xMarker( xModelFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.MarkerTable") ) ), uno::UNO_QUERY ); + if( xMarker.is() ) + xMarker->removeByName( aName ); + + uno::Reference< container::XNameContainer > xDashes( xModelFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.DashTable") ) ), uno::UNO_QUERY ); + if( xDashes.is() ) + xDashes->removeByName( aName ); + } + catch( Exception& ) + { + DBG_ERROR("sd::SdXMLFilter::Import(), exception during clearing of unused named items"); + } + } + return nRet == 0; } |