diff options
author | Oliver Bolte <obo@openoffice.org> | 2008-02-26 12:35:27 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2008-02-26 12:35:27 +0000 |
commit | c0e7fa526f67ee0e717476f7d43e0c707c4317f8 (patch) | |
tree | 10c74e3a9049a57b216d9b3e1a529ea09dc596cd /xmloff/source/draw | |
parent | a294f08b818ec781579e75b51f86327f9a84653d (diff) |
INTEGRATION: CWS custommeta (1.114.40); FILE MERGED
2007/12/21 12:20:14 mst 1.114.40.1: refactoring for XDocumentProperties import/export: draw
- xmloff/source/draw/sdxmlimp.{hxx,cxx}:
+ SdXMLDocContext_Impl virtually inherits from SvXMLImportContext
+ new class SdXMLFlatDocContext_Impl for flat file ODF;
multiply inherits from SdXMLDocContext_Impl and SvXMLMetaDocumentContext
+ refactor SdXMLImport::CreateContext to use SvXMLMetaDocumentContext
+ replace method SetStatisticAttributes with SetStatistics
- xmloff/source/draw/sdxmlexp.cxx:
+ remove the statistics export in _ExportMeta;
this is done in SvXMLMetaExport::Export
+ call XDocumentProperties::setDocumentStatistics in _ExportMeta
Diffstat (limited to 'xmloff/source/draw')
-rw-r--r-- | xmloff/source/draw/sdxmlexp.cxx | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx index f0cffe96e99b..4dc8ecd072bc 100644 --- a/xmloff/source/draw/sdxmlexp.cxx +++ b/xmloff/source/draw/sdxmlexp.cxx @@ -4,9 +4,9 @@ * * $RCSfile: sdxmlexp.cxx,v $ * - * $Revision: 1.114 $ + * $Revision: 1.115 $ * - * last change: $Author: vg $ $Date: 2007-08-28 13:34:22 $ + * last change: $Author: obo $ $Date: 2008-02-26 13:35:27 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -72,10 +72,6 @@ #include <com/sun/star/presentation/XCustomPresentationSupplier.hpp> #endif -#ifndef _COM_SUN_STAR_DOCUMENT_XDOCUMENTINFOSUPPLIER_HPP_ -#include <com/sun/star/document/XDocumentInfoSupplier.hpp> -#endif - #ifndef _COM_SUN_STAR_TASK_XSTATUSINDICATORSUPPLIER_HPP_ #include <com/sun/star/task/XStatusIndicatorSupplier.hpp> #endif @@ -227,6 +223,9 @@ #include "animationexport.hxx" +#include <com/sun/star/document/XDocumentProperties.hpp> +#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> + using namespace ::rtl; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -1942,24 +1941,21 @@ void SdXMLExport::SetProgress(sal_Int32 nProg) void SdXMLExport::_ExportMeta() { - // call parent - SvXMLExport::_ExportMeta(); + uno::Sequence<beans::NamedValue> stats(1); + stats[0] = beans::NamedValue(::rtl::OUString::createFromAscii("ObjectCount"), + uno::makeAny(mnObjectCount)); - // prepare export statistic info (mainly for progress bar at reload) - sal_Bool bContentUsed(FALSE); - rtl::OUStringBuffer sBuffer; - - // export shape count info - if(mnObjectCount) - { - GetMM100UnitConverter().convertNumber(sBuffer, mnObjectCount); - AddAttribute(XML_NAMESPACE_META, XML_OBJECT_COUNT, sBuffer.makeStringAndClear()); - bContentUsed = TRUE; + // update document statistics at the model + uno::Reference<document::XDocumentPropertiesSupplier> xPropSup(GetModel(), + uno::UNO_QUERY_THROW); + uno::Reference<document::XDocumentProperties> xDocProps( + xPropSup->getDocumentProperties()); + if (xDocProps.is()) { + xDocProps->setDocumentStatistics(stats); } - // when there is data, export it - if(bContentUsed) - SvXMLElementExport aElemStat(*this, XML_NAMESPACE_META, XML_DOCUMENT_STATISTIC, sal_True, sal_True); + // call parent + SvXMLExport::_ExportMeta(); } ////////////////////////////////////////////////////////////////////////////// |