diff options
author | Oliver Bolte <obo@openoffice.org> | 2008-02-26 12:37:31 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2008-02-26 12:37:31 +0000 |
commit | 11c0f5ae8b3d3460082d795d6f488f20a2c1adb5 (patch) | |
tree | 7f1236f04c73bd8c8cad81b8fc3436314c3e3023 /xmloff/source/meta | |
parent | de4025a6f3d2174a812254dc14335c2bcb0ad2fc (diff) |
INTEGRATION: CWS custommeta (1.16.82); FILE MERGED
2008/02/05 11:19:33 mst 1.16.82.4: interface change: SvXMLExport
- xmloff/inc/xmloff/xmlexp.hxx, xmloff/source/core/xmlexp.cxx,
xmloff/source/meta/MetaExportComponent.cxx:
+ remove SvXMLExport::GetProductName (now in unotools)
+ use DocInfoHelper instead
2007/12/11 17:47:29 mst 1.16.82.3: - xmloff/source/core/xmlexp.cxx,
xmloff/source/meta/{xmlmetae.cxx,MetaExportComponent.cxx}:
note to self: do not allocate uno objects on the stack, idiot!
2007/12/10 10:27:49 mst 1.16.82.2: RESYNC: (1.16-1.17); FILE MERGED
2007/12/07 18:51:48 mst 1.16.82.1: refactoring to use XDocumentProperties instead of XDocumentInfo
on document export:
- xmloff/inc/xmloff/xmlexp.hxx, xmloff/source/core/xmlexp.cxx:
+ turn lcl_GetProductName into static method SvXMLExport::GetProductName
+ updating of Generator string is now done in _ExportMeta
- xmloff/inc/MetaExportComponent.hxx, source/meta/MetaExportComponent.cxx:
+ use XDocumentProperties instead of XDocumentInfo
+ override _ExportMeta
- xmloff/inc/xmloff/xmlmetae.hxx, source/meta/xmlmetae.cxx:
+ new class SvXMLMetaExport, to eventually replace SfxXMLMetaExport
+ move lcl_GetProductName to xmlexp.cxx
Diffstat (limited to 'xmloff/source/meta')
-rw-r--r-- | xmloff/source/meta/MetaExportComponent.cxx | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/xmloff/source/meta/MetaExportComponent.cxx b/xmloff/source/meta/MetaExportComponent.cxx index 533fc2ae6809..82d660d0a5b0 100644 --- a/xmloff/source/meta/MetaExportComponent.cxx +++ b/xmloff/source/meta/MetaExportComponent.cxx @@ -4,9 +4,9 @@ * * $RCSfile: MetaExportComponent.cxx,v $ * - * $Revision: 1.17 $ + * $Revision: 1.18 $ * - * last change: $Author: hr $ $Date: 2007-11-01 13:39:39 $ + * last change: $Author: obo $ $Date: 2008-02-26 13:37:31 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -105,6 +105,8 @@ #include <tools/debug.hxx> #endif +#include <unotools/docinfohelper.hxx> + using namespace ::com::sun::star; using namespace ::xmloff::token; @@ -129,10 +131,11 @@ void SAL_CALL XMLMetaExportComponent::setSourceDocument( const ::com::sun::star: } catch( lang::IllegalArgumentException& ) { - // allow to use document info service without model access - // this is required for standalone document info exporter - xDocInfo = uno::Reference< document::XDocumentInfo >::query( xDoc ); - if( !xDocInfo.is() ) + // allow to use document properties service without model access + // this is required for document properties exporter + mxDocProps = + uno::Reference< document::XDocumentProperties >::query( xDoc ); + if( !mxDocProps.is() ) throw lang::IllegalArgumentException(); } } @@ -152,7 +155,7 @@ sal_uInt32 XMLMetaExportComponent::exportDoc( enum XMLTokenEnum ) { { "Class", sizeof("Class")-1, 0, &::getCppuType((::rtl::OUString*)0), - beans::PropertyAttribute::MAYBEVOID, 0}, + beans::PropertyAttribute::MAYBEVOID, 0}, { NULL, 0, 0, NULL, 0, 0 } }; uno::Reference< beans::XPropertySet > xConvPropSet( @@ -186,7 +189,7 @@ sal_uInt32 XMLMetaExportComponent::exportDoc( enum XMLTokenEnum ) } catch( com::sun::star::uno::Exception& ) { - OSL_ENSURE( sal_False, "Can not intantiate com.sun.star.comp.Oasis2OOoTransformer!\n"); + OSL_ENSURE( sal_False, "Cannot instantiate com.sun.star.comp.Oasis2OOoTransformer!\n"); } } } @@ -218,27 +221,27 @@ sal_uInt32 XMLMetaExportComponent::exportDoc( enum XMLTokenEnum ) SvXMLElementExport aDocElem( *this, XML_NAMESPACE_OFFICE, XML_DOCUMENT_META, sal_True, sal_True ); - { - SvXMLElementExport aElem( *this, XML_NAMESPACE_OFFICE, XML_META, - sal_True, sal_True ); - - if ( xDocInfo.is() ) - { - // standalone document exporter case - SfxXMLMetaExport aMeta( *this, xDocInfo ); - aMeta.Export(); - } - else - { - SfxXMLMetaExport aMeta( *this, GetModel() ); - aMeta.Export(); - } - } + // NB: office:meta is now written by _ExportMeta + _ExportMeta(); } xDocHandler->endDocument(); return 0; } +void XMLMetaExportComponent::_ExportMeta() +{ + if (mxDocProps.is()) { + ::rtl::OUString generator( ::utl::DocInfoHelper::GetGeneratorString() ); + // update generator here + mxDocProps->setGenerator(generator); + SvXMLMetaExport * pMeta = new SvXMLMetaExport(*this, mxDocProps); + uno::Reference<xml::sax::XDocumentHandler> xMeta(pMeta); + pMeta->Export(); + } else { + SvXMLExport::_ExportMeta(); + } +} + // methods without content: void XMLMetaExportComponent::_ExportAutoStyles() {} void XMLMetaExportComponent::_ExportMasterStyles() {} |