diff options
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/core/xmlexp.cxx | 67 |
1 files changed, 45 insertions, 22 deletions
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 8ae863ece4..5442a70a7e 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -4,9 +4,9 @@ * * $RCSfile: xmlexp.cxx,v $ * - * $Revision: 1.120 $ + * $Revision: 1.121 $ * - * last change: $Author: rt $ $Date: 2005-09-09 13:37:09 $ + * last change: $Author: obo $ $Date: 2006-03-27 10:04:05 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -293,7 +293,7 @@ void SAL_CALL SvXMLExportEventListener::disposing( const lang::EventObject& rEve class SvXMLExport_Impl { public: - ::comphelper::UnoInterfaceToUniqueIdentifierMapper maInterfaceToIdentifierMapper; + ::comphelper::UnoInterfaceToUniqueIdentifierMapper maInterfaceToIdentifierMapper; }; //============================================================================== @@ -377,13 +377,29 @@ void SvXMLExport::_InitCtor() mxEventListener.set( new SvXMLExportEventListener(this)); xModel->addEventListener(mxEventListener); } + + // --> OD 2006-03-10 #i51726# - determine model type + _DetermineModelType(); + // <-- +} + +// --> OD 2006-03-14 #i51726# +void SvXMLExport::_DetermineModelType() +{ + meModelType = SvtModuleOptions::E_UNKNOWN_FACTORY; + + if ( xModel.is() ) + { + meModelType = SvtModuleOptions::ClassifyFactoryByModel( xModel ); + } } +// <-- // #110680# SvXMLExport::SvXMLExport( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory, - MapUnit eDfltUnit, const enum XMLTokenEnum eClass, sal_uInt16 nExportFlags ) -: pImpl( new SvXMLExport_Impl ), + MapUnit eDfltUnit, const enum XMLTokenEnum eClass, sal_uInt16 nExportFlags ) +: pImpl( new SvXMLExport_Impl ), // #110680# mxServiceFactory(xServiceFactory), meClass( eClass ), @@ -414,8 +430,8 @@ SvXMLExport::SvXMLExport( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory, const OUString &rFileName, const uno::Reference< xml::sax::XDocumentHandler > & rHandler, - MapUnit eDfltUnit ) -: pImpl( new SvXMLExport_Impl ), + MapUnit eDfltUnit ) +: pImpl( new SvXMLExport_Impl ), // #110680# mxServiceFactory(xServiceFactory), meClass( XML_TOKEN_INVALID ), @@ -453,8 +469,8 @@ SvXMLExport::SvXMLExport( const OUString &rFileName, const uno::Reference< xml::sax::XDocumentHandler > & rHandler, const Reference< XModel >& rModel, - sal_Int16 eDfltUnit ) -: pImpl( new SvXMLExport_Impl ), + sal_Int16 eDfltUnit ) +: pImpl( new SvXMLExport_Impl ), // #110680# mxServiceFactory(xServiceFactory), meClass( XML_TOKEN_INVALID ), @@ -495,8 +511,8 @@ SvXMLExport::SvXMLExport( const uno::Reference< xml::sax::XDocumentHandler > & rHandler, const Reference< XModel >& rModel, const Reference< document::XGraphicObjectResolver >& rEmbeddedGraphicObjects, - sal_Int16 eDfltUnit ) -: pImpl( new SvXMLExport_Impl ), + sal_Int16 eDfltUnit ) +: pImpl( new SvXMLExport_Impl ), // #110680# mxServiceFactory(xServiceFactory), meClass( XML_TOKEN_INVALID ), @@ -672,6 +688,10 @@ void SAL_CALL SvXMLExport::setSourceDocument( const uno::Reference< lang::XCompo { } } + + // --> OD 2006-03-10 #i51726# - determine model type + _DetermineModelType(); + // <-- } // XInitialize @@ -727,9 +747,9 @@ void SAL_CALL SvXMLExport::initialize( const uno::Sequence< uno::Any >& aArgumen if( xExportInfo.is() ) { - uno::Reference< beans::XPropertySetInfo > xPropertySetInfo = + uno::Reference< beans::XPropertySetInfo > xPropertySetInfo = xExportInfo->getPropertySetInfo(); - OUString sPropName( + OUString sPropName( RTL_CONSTASCII_USTRINGPARAM("BaseURI" ) ); if( xPropertySetInfo->hasPropertyByName(sPropName) ) { @@ -759,7 +779,7 @@ void SAL_CALL SvXMLExport::initialize( const uno::Sequence< uno::Any >& aArgumen sOrigFileName = aBaseURL.GetMainURL(INetURLObject::DECODE_TO_IURI); } } - + } // XFilter @@ -774,7 +794,7 @@ sal_Bool SAL_CALL SvXMLExport::filter( const uno::Sequence< beans::PropertyValue try { - const sal_uInt32 nTest = + const sal_uInt32 nTest = EXPORT_META|EXPORT_STYLES|EXPORT_CONTENT|EXPORT_SETTINGS; if( (mnExportFlags & nTest) == nTest && !sOrigFileName.getLength() ) { @@ -1174,12 +1194,12 @@ sal_uInt32 SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass ) Any aAny; aAny <<= GetXMLToken( eClass ); - xConvPropSet->setPropertyValue( + xConvPropSet->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("Class")), aAny ); Reference< XPropertySet > xPropSet = - xExportInfo.is() - ? PropertySetMerger_CreateInstance( xExportInfo, + xExportInfo.is() + ? PropertySetMerger_CreateInstance( xExportInfo, xConvPropSet ) : xExportInfo; @@ -1388,7 +1408,7 @@ void SvXMLExport::_ExportScripts() AddAttribute( XML_NAMESPACE_SCRIPT, XML_LANGUAGE, aValue ); SvXMLElementExport aElem( *this, XML_NAMESPACE_OFFICE, XML_SCRIPT, sal_True, sal_True ); - + // initialize Basic if ( xModel.is() ) { @@ -1405,7 +1425,7 @@ void SvXMLExport::_ExportScripts() Sequence < Any > aArgs( 1 ); aArgs[0] <<= xHdl; xExporter.set( xMSF->createInstanceWithArguments( - OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.XMLOasisBasicExporter" ) ), aArgs ), + OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.XMLOasisBasicExporter" ) ), aArgs ), UNO_QUERY ); } @@ -1800,8 +1820,8 @@ sal_Bool SvXMLExport::AddEmbeddedObjectAsBase64( const OUString& rEmbeddedObject return bRet; } -OUString SvXMLExport::EncodeStyleName( - const OUString& rName, +OUString SvXMLExport::EncodeStyleName( + const OUString& rName, sal_Bool *pEncoded ) const { return GetMM100UnitConverter().encodeStyleName( rName, pEncoded ); @@ -2132,6 +2152,9 @@ XMLErrors* SvXMLExport::GetErrors() void SvXMLExport::DisposingModel() { xModel.clear(); + // --> OD 2006-03-13 #i51726# + meModelType = SvtModuleOptions::E_UNKNOWN_FACTORY;; + // <-- mxEventListener.clear(); } |