diff options
author | Oliver Bolte <obo@openoffice.org> | 2008-02-26 12:32:31 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2008-02-26 12:32:31 +0000 |
commit | 642382844d82675ade6150de105915173d159d2b (patch) | |
tree | ce2b4ddf827a402f7415a5358ded02a9038ec7e3 /xmloff/source/core/xmlexp.cxx | |
parent | 89d57160cc1cbf1adccbd9f380aab227de5545c9 (diff) |
INTEGRATION: CWS custommeta (1.132.56); FILE MERGED
2008/02/05 11:19:33 mst 1.132.56.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.132.56.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:42 mst 1.132.56.2: RESYNC: (1.132-1.133); FILE MERGED
2007/12/07 18:51:48 mst 1.132.56.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/core/xmlexp.cxx')
-rw-r--r-- | xmloff/source/core/xmlexp.cxx | 48 |
1 files changed, 37 insertions, 11 deletions
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index f8b880d6ba..1d7f2191d9 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -4,9 +4,9 @@ * * $RCSfile: xmlexp.cxx,v $ * - * $Revision: 1.133 $ + * $Revision: 1.134 $ * - * last change: $Author: hr $ $Date: 2007-11-01 13:39:22 $ + * last change: $Author: obo $ $Date: 2008-02-26 13:32:31 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -216,6 +216,13 @@ #include "xformsexport.hxx" #endif +#include <unotools/docinfohelper.hxx> +#include <unotools/bootstrap.hxx> +#include <unotools/configmgr.hxx> +#include <tools/inetdef.hxx> +#include <com/sun/star/document/XDocumentProperties.hpp> +#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> + using namespace ::rtl; using namespace ::osl; using namespace ::com::sun::star; @@ -231,6 +238,8 @@ using namespace ::xmloff::token; sal_Char __READONLY_DATA sXML_1_1[] = "1.1"; +const sal_Char *sOpenOfficeOrgProject ="OpenOffice.org_project"; + #define LOGFILE_AUTHOR "mb93740" #define XML_MODEL_SERVICE_WRITER "com.sun.star.text.TextDocument" @@ -1052,13 +1061,7 @@ void SvXMLExport::ImplExportMeta() { CheckAttrList(); - { - // <office:meta> - SvXMLElementExport aElem( *this, XML_NAMESPACE_OFFICE, XML_META, - sal_True, sal_True ); - - _ExportMeta(); - } + _ExportMeta(); } void SvXMLExport::ImplExportSettings() @@ -1430,10 +1433,33 @@ sal_uInt32 SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass ) return 0; } + void SvXMLExport::_ExportMeta() { - SfxXMLMetaExport aMeta( *this, mxModel ); - aMeta.Export(); + OUString generator( ::utl::DocInfoHelper::GetGeneratorString() ); + Reference< XDocumentPropertiesSupplier > xDocPropsSupplier(mxModel, + UNO_QUERY); + if (xDocPropsSupplier.is()) { + Reference<XDocumentProperties> xDocProps( + xDocPropsSupplier->getDocumentProperties()); + if (!xDocProps.is()) throw; + // update generator here + xDocProps->setGenerator(generator); + SvXMLMetaExport * pMeta = new SvXMLMetaExport(*this, xDocProps); + uno::Reference<xml::sax::XDocumentHandler> xMeta(pMeta); + pMeta->Export(); + } else { + // office:meta + SvXMLElementExport aElem( *this, XML_NAMESPACE_OFFICE, XML_META, + sal_True, sal_True ); + { + // BM: #i60323# export generator even if xInfoProp is empty (which is the + // case for charts). The generator does not depend on xInfoProp + SvXMLElementExport anElem( *this, XML_NAMESPACE_META, XML_GENERATOR, + sal_True, sal_True ); + Characters(generator); + } + } } void SvXMLExport::_ExportViewSettings(const XMLSettingsExportHelper& rSettingsExportHelper ) |