1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_XMLOFF_XMLEXP_HXX
21 #define INCLUDED_XMLOFF_XMLEXP_HXX
23 #include <sal/config.h>
24 #include <xmloff/dllapi.h>
25 #include <sal/types.h>
27 #include <rtl/ustring.hxx>
28 #include <xmloff/txtparae.hxx>
29 #include <xmloff/formlayerexport.hxx>
30 #include <xmloff/xmlnumfe.hxx>
31 #include <xmloff/xmlaustp.hxx>
32 #include <xmloff/shapeexport.hxx>
33 #include <xmloff/xmltoken.hxx>
34 #include <xmloff/SchXMLExportHelper.hxx>
35 #include <xmloff/XMLFontAutoStylePool.hxx>
36 #include <xmloff/xmluconv.hxx>
37 #include <com/sun/star/document/XFilter.hpp>
38 #include <com/sun/star/lang/XServiceInfo.hpp>
39 #include <com/sun/star/document/XExporter.hpp>
40 #include <com/sun/star/lang/XInitialization.hpp>
41 #include <com/sun/star/container/XNamed.hpp>
43 #include <unotools/saveopt.hxx>
44 #include <unotools/securityoptions.hxx>
46 #include <xmloff/XMLPageExport.hxx>
47 #include <comphelper/attributelist.hxx>
48 #include <cppuhelper/implbase.hxx>
49 #include <tools/fldunit.hxx>
50 #include <comphelper/errcode.hxx>
54 #include <o3tl/typed_flags_set.hxx>
56 namespace com::sun::star::beans
{ class XPropertySet
; }
57 namespace com::sun::star::document
{ class XEmbeddedObjectResolver
; }
58 namespace com::sun::star::document
{ class XGraphicStorageHandler
; }
59 namespace com::sun::star::embed
{ class XStorage
; }
60 namespace com::sun::star::graphic
{ class XGraphic
; }
61 namespace com::sun::star::lang
{ class XEventListener
; }
62 namespace com::sun::star::task
{ class XStatusIndicator
; }
63 namespace com::sun::star::uno
{ class XComponentContext
; }
64 namespace com::sun::star::util
{ class XNumberFormatsSupplier
; }
65 namespace com::sun::star::xml::sax
{ class XAttributeList
; }
66 namespace com::sun::star::xml::sax
{ class XDocumentHandler
; }
67 namespace com::sun::star::xml::sax
{ class XExtendedDocumentHandler
; }
68 namespace com::sun::star::xml::sax
{ class XLocator
; }
70 class SvXMLNamespaceMap
;
71 class SvtSecurityMapPersonalInfo
;
72 class SvXMLExport_Impl
;
73 class ProgressBarHelper
;
75 class XMLImageMapExport
;
78 enum class SvXMLErrorFlags
;
80 // Shapes in Writer cannot be named via context menu (#i51726#)
81 #include <unotools/moduleoptions.hxx>
83 namespace com::sun::star
{
84 namespace frame
{ class XModel
; }
85 namespace lang
{ struct Locale
; }
87 namespace comphelper
{ class UnoInterfaceToUniqueIdentifierMapper
; }
89 namespace model
{ class Theme
; }
91 enum class SvXMLExportFlags
{
95 MASTERSTYLES
= 0x0004,
108 template<> struct typed_flags
<SvXMLExportFlags
> : is_typed_flags
<SvXMLExportFlags
, 0x85ff> {};
111 class XMLOFF_DLLPUBLIC SvXMLExport
: public cppu::WeakImplHelper
<
112 css::document::XFilter
,
113 css::lang::XServiceInfo
,
114 css::document::XExporter
,
115 css::lang::XInitialization
,
116 css::container::XNamed
>
118 std::unique_ptr
<SvXMLExport_Impl
> mpImpl
; // dummy
120 css::uno::Reference
< css::uno::XComponentContext
> m_xContext
;
121 OUString m_implementationName
;
123 css::uno::Reference
< css::frame::XModel
> mxModel
;
124 css::uno::Reference
< css::xml::sax::XDocumentHandler
> mxHandler
; // the handlers
125 css::uno::Reference
< css::xml::sax::XExtendedDocumentHandler
> mxExtHandler
;
126 css::uno::Reference
< css::util::XNumberFormatsSupplier
> mxNumberFormatsSupplier
;
127 css::uno::Reference
< css::document::XGraphicStorageHandler
> mxGraphicStorageHandler
;
128 css::uno::Reference
< css::document::XEmbeddedObjectResolver
> mxEmbeddedResolver
;
129 css::uno::Reference
< css::task::XStatusIndicator
> mxStatusIndicator
;
130 css::uno::Reference
< css::beans::XPropertySet
> mxExportInfo
;
131 css::uno::Reference
< css::lang::XEventListener
> mxEventListener
;
133 rtl::Reference
<comphelper::AttributeList
> mxAttrList
; // a common attribute list
135 OUString msOrigFileName
; // the original URL
136 OUString msFilterName
;
137 OUString msImgFilterName
;
138 std::unique_ptr
<SvXMLNamespaceMap
> mpNamespaceMap
; // the namespace map
139 std::unique_ptr
<SvtSecurityMapPersonalInfo
> mpAuthorIDs
; // map authors to remove personal info
140 SvXMLUnitConverter maUnitConv
; // the unit converter
141 std::unique_ptr
<SvXMLNumFmtExport
> mpNumExport
;
142 std::unique_ptr
<ProgressBarHelper
> mpProgressBarHelper
;
144 rtl::Reference
< XMLTextParagraphExport
> mxTextParagraphExport
;
145 rtl::Reference
< XMLShapeExport
> mxShapeExport
;
146 rtl::Reference
< SvXMLAutoStylePoolP
> mxAutoStylePool
;
147 rtl::Reference
< SchXMLExportHelper
> mxChartExport
;
148 rtl::Reference
< XMLPageExport
> mxPageExport
;
149 rtl::Reference
< XMLFontAutoStylePool
> mxFontAutoStylePool
;
150 rtl::Reference
< xmloff::OFormLayerXMLExport
> mxFormExport
;
151 std::unique_ptr
<XMLEventExport
> mpEventExport
;
152 std::unique_ptr
<XMLImageMapExport
> mpImageMapExport
;
153 std::unique_ptr
<XMLErrors
> mpXMLErrors
;
155 const enum ::xmloff::token::XMLTokenEnum meClass
;
156 SAL_DLLPRIVATE
void InitCtor_();
158 SvXMLExportFlags mnExportFlags
;
159 SvXMLErrorFlags mnErrorFlags
;
161 const OUString msWS
; // " "
163 // Shapes in Writer cannot be named via context menu (#i51726#)
164 SvtModuleOptions::EFactory meModelType
;
165 SAL_DLLPRIVATE
void DetermineModelType_();
167 SAL_DLLPRIVATE
void ImplExportMeta(); // <office:meta>
168 SAL_DLLPRIVATE
void ImplExportSettings(); // <office:settings>
169 SAL_DLLPRIVATE
void ImplExportStyles(); // <office:styles>
170 SAL_DLLPRIVATE
void ImplExportAutoStyles();
171 // <office:automatic-styles>
172 SAL_DLLPRIVATE
void ImplExportMasterStyles();
173 // <office:master-styles>
174 SAL_DLLPRIVATE
void ImplExportContent(); // <office:body>
175 virtual void SetBodyAttributes();
176 void GetViewSettingsAndViews(css::uno::Sequence
<css::beans::PropertyValue
>& rProps
);
179 void setExportFlags( SvXMLExportFlags nExportFlags
) { mnExportFlags
= nExportFlags
; }
181 // Get (modifiable) namespace map
182 SvXMLNamespaceMap
& GetNamespaceMap_() { return *mpNamespaceMap
; }
184 // get a new namespace map (used in starmath to have a default namespace)
185 void ResetNamespaceMap();
187 /// Override this method to export the content of <office:meta>.
188 /// There is a default implementation.
189 virtual void ExportMeta_();
191 /// Override this method to export the content of <office:scripts>.
192 /// There is a default implementation.
193 virtual void ExportScripts_();
195 /// Override this method to export the font declarations
196 /// The default implementation will export the contents of the
197 /// XMLFontAutoStylePool if it has been created.
198 virtual void ExportFontDecls_();
200 /// Override this method to export the content of <style:styles>.
201 /// If bUsed is set, used styles should be exported only.
202 /// Overriding Methods must call this method !
203 virtual void ExportStyles_( bool bUsed
);
205 /// Override this method to export the contents of <style:auto-styles>.
206 virtual void ExportAutoStyles_() = 0;
208 /// Override this method to export the contents of <style:master-styles>.
209 virtual void ExportMasterStyles_() = 0;
211 /// Override this method to export the content of <office:body>.
212 virtual void ExportContent_() = 0;
214 OUString
const & GetSourceShellID() const;
215 OUString
const & GetDestinationShellID() const;
217 // save linked sections? (may be false in global documents)
218 bool mbSaveLinkedSections
;
220 virtual XMLTextParagraphExport
* CreateTextParagraphExport();
221 virtual XMLShapeExport
* CreateShapeExport();
222 virtual SvXMLAutoStylePoolP
* CreateAutoStylePool();
223 SchXMLExportHelper
* CreateChartExport();
224 virtual XMLPageExport
* CreatePageExport();
225 virtual XMLFontAutoStylePool
* CreateFontAutoStylePool();
226 xmloff::OFormLayerXMLExport
* CreateFormExport();
227 virtual void GetViewSettings(css::uno::Sequence
<css::beans::PropertyValue
>& aProps
);
228 virtual void GetConfigurationSettings(css::uno::Sequence
<css::beans::PropertyValue
>& aProps
);
232 ::xmloff::token::XMLTokenEnum eGroupName
;
233 css::uno::Sequence
< css::beans::PropertyValue
> aSettings
;
236 const ::xmloff::token::XMLTokenEnum _eGroupName
,
237 const css::uno::Sequence
< css::beans::PropertyValue
>& _rSettings
)
238 :eGroupName( _eGroupName
)
239 ,aSettings( _rSettings
)
243 /** returns the current document settings
245 The default implementation will obtain the view settings by calling GetViewSettingsAndViews, and the
246 configuration settings by calling GetConfigurationSettings, and return them together with the proper XML token.
249 the accumulated count of all settings in all groups
251 virtual sal_Int32
GetDocumentSpecificSettings( ::std::vector
< SettingsGroup
>& _out_rSettings
);
253 const css::uno::Reference
< css::document::XEmbeddedObjectResolver
>& GetEmbeddedResolver() const { return mxEmbeddedResolver
; }
254 inline void SetEmbeddedResolver( css::uno::Reference
< css::document::XEmbeddedObjectResolver
> const & _xEmbeddedResolver
);
256 const css::uno::Reference
<css::document::XGraphicStorageHandler
> & GetGraphicStorageHandler() const
258 return mxGraphicStorageHandler
;
260 void SetGraphicStorageHandler(css::uno::Reference
<css::document::XGraphicStorageHandler
> const & rxGraphicStorageHandler
);
262 void SetDocHandler( const css::uno::Reference
< css::xml::sax::XDocumentHandler
> &rHandler
);
264 void ExportThemeElement(std::shared_ptr
<model::Theme
> const& pTheme
);
266 bool mbAutoStylesCollected
;
270 const css::uno::Reference
< css::uno::XComponentContext
>& xContext
,
271 OUString implementationName
,
272 sal_Int16
const eDefaultMeasureUnit
/*css::util::MeasureUnit*/,
273 const enum ::xmloff::token::XMLTokenEnum eClass
,
274 SvXMLExportFlags nExportFlag
);
277 const css::uno::Reference
< css::uno::XComponentContext
>& xContext
,
278 OUString implementationName
,
280 sal_Int16
const eDefaultMeasureUnit
/*css::util::MeasureUnit*/,
281 const css::uno::Reference
< css::xml::sax::XDocumentHandler
> & rHandler
);
284 const css::uno::Reference
< css::uno::XComponentContext
>& xContext
,
285 OUString implementationName
,
287 const css::uno::Reference
< css::xml::sax::XDocumentHandler
> & rHandler
,
288 const css::uno::Reference
< css::frame::XModel
> &,
289 FieldUnit
const eDefaultFieldUnit
,
290 SvXMLExportFlags nExportFlag
);
292 virtual ~SvXMLExport() override
;
294 virtual void collectAutoStyles();
297 virtual void SAL_CALL
setSourceDocument( const css::uno::Reference
< css::lang::XComponent
>& xDoc
) override
;
300 virtual sal_Bool SAL_CALL
filter( const css::uno::Sequence
< css::beans::PropertyValue
>& aDescriptor
) override
;
301 virtual void SAL_CALL
cancel() override
;
304 virtual void SAL_CALL
initialize( const css::uno::Sequence
< css::uno::Any
>& aArguments
) override
;
307 virtual OUString SAL_CALL
getName( ) override final
;
308 virtual void SAL_CALL
setName( const OUString
& aName
) override final
;
311 virtual OUString SAL_CALL
getImplementationName( ) final override
;
312 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) final override
;
313 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( ) final override
;
315 /** ensures that the given namespace is in scope at the next started
318 <p>If the namespace is not yet declared, the necessary attribute will
319 be added, as well.</p>
321 @param i_rNamespace the namespace to be declared
323 @returns the actual prefix that the namespace is associated with
325 OUString
EnsureNamespace(OUString
const & i_rNamespace
);
327 // Check if common attribute list is empty.
329 void CheckAttrList() { (void) this; /* avoid loplugin:staticmethods */ }
331 void CheckAttrList();
334 // Clear common attribute list.
335 void ClearAttrList();
337 // Add an attribute to the common attribute list.
338 void AddAttribute( sal_uInt16 nPrefix
, const OUString
& rName
,
339 const OUString
& rValue
);
340 void AddAttribute( sal_uInt16 nPrefix
,
341 enum ::xmloff::token::XMLTokenEnum eName
,
342 const OUString
& rValue
);
343 void AddAttribute( sal_uInt16 nPrefix
,
344 enum ::xmloff::token::XMLTokenEnum eName
,
345 enum ::xmloff::token::XMLTokenEnum eValue
);
346 void AddAttribute( const OUString
& rQName
,
347 const OUString
& rValue
);
348 void AddAttribute( const OUString
& rQName
,
349 enum ::xmloff::token::XMLTokenEnum eValue
);
351 /** Add language tag attributes, deciding which are necessary.
354 Namespace prefix for *:language, *:script and *:country
357 Namespace prefix for *:rfc-language-tag
360 Whether to write empty *:language and *:country attribute
361 values in case of an empty locale (denoting system).
363 void AddLanguageTagAttributes( sal_uInt16 nPrefix
, sal_uInt16 nPrefixRfc
,
364 const css::lang::Locale
& rLocale
, bool bWriteEmpty
);
366 /** Same as AddLanguageTagAttributes() but with LanguageTag parameter
369 void AddLanguageTagAttributes( sal_uInt16 nPrefix
, sal_uInt16 nPrefixRfc
,
370 const LanguageTag
& rLanguageTag
, bool bWriteEmpty
);
372 // add several attributes to the common attribute list
373 void AddAttributeList( const css::uno::Reference
<
374 css::xml::sax::XAttributeList
>& xAttrList
);
376 // Get common attribute list as implementation or interface.
377 comphelper::AttributeList
&GetAttrList() { return *mxAttrList
; }
378 css::uno::Reference
< css::xml::sax::XAttributeList
> GetXAttrList() const { return mxAttrList
; }
380 // Get document handler. This methods are not const, because the
381 // reference allows modifications through the handler.
382 const css::uno::Reference
< css::xml::sax::XDocumentHandler
> & GetDocHandler() const { return mxHandler
; }
385 const OUString
& GetOrigFileName() const { return msOrigFileName
; }
387 // Get (const) namespace map.
388 const SvXMLNamespaceMap
& GetNamespaceMap() const { return *mpNamespaceMap
; }
390 // Get author id to remove personal info
391 size_t GetInfoID( const OUString sPersonalInfo
) const { return mpAuthorIDs
->GetInfoID(sPersonalInfo
); }
393 // Get unit converter
394 const SvXMLUnitConverter
& GetMM100UnitConverter() const { return maUnitConv
; }
396 SvXMLUnitConverter
& GetMM100UnitConverter() { return maUnitConv
; }
398 void addChaffWhenEncryptedStorage();
400 // Export the document.
401 virtual ErrCode
exportDoc( enum ::xmloff::token::XMLTokenEnum eClass
= ::xmloff::token::XML_TOKEN_INVALID
);
403 void collectDataStyles(bool bFromUsedStyles
);
404 virtual void addDataStyle(const sal_Int32 nNumberFormat
, bool bTimeFormat
= false );
405 virtual void exportDataStyles();
406 virtual void exportAutoDataStyles();
407 virtual OUString
getDataStyleName(const sal_Int32 nNumberFormat
, bool bTimeFormat
= false ) const;
408 sal_Int32
dataStyleForceSystemLanguage(sal_Int32 nFormat
) const;
410 virtual void exportAnnotationMeta( const css::uno::Reference
< css::drawing::XShape
>& xShape
);
413 const css::uno::Reference
< css::frame::XModel
> &
414 GetModel() const { return mxModel
; }
415 // Get XNumberFormatsSupplier
416 css::uno::Reference
< css::util::XNumberFormatsSupplier
> & GetNumberFormatsSupplier() { return mxNumberFormatsSupplier
; }
417 void SetNumberFormatsSupplier(const css::uno::Reference
< css::util::XNumberFormatsSupplier
>& _xNumberFormatSupplier
)
419 mxNumberFormatsSupplier
= _xNumberFormatSupplier
;
420 if ( mxNumberFormatsSupplier
.is() && mxHandler
.is() )
421 mpNumExport
.reset( new SvXMLNumFmtExport(*this, mxNumberFormatsSupplier
) );
424 // get export helper for text
425 inline rtl::Reference
< XMLTextParagraphExport
> const & GetTextParagraphExport();
427 // get export helper for shapes
428 inline rtl::Reference
< XMLShapeExport
> const & GetShapeExport();
430 // get auto style pool
431 inline rtl::Reference
< SvXMLAutoStylePoolP
> const & GetAutoStylePool();
434 inline rtl::Reference
< XMLPageExport
> const & GetPageExport();
436 // get chart export helper
437 inline rtl::Reference
< SchXMLExportHelper
> const & GetChartExport();
439 // get font auto style pool
440 inline rtl::Reference
< XMLFontAutoStylePool
> const & GetFontAutoStylePool();
442 ProgressBarHelper
* GetProgressBarHelper();
444 // get Formlayer Export
445 inline rtl::Reference
< xmloff::OFormLayerXMLExport
> const & GetFormExport();
446 inline bool HasFormExport() const;
448 // get XPropertySet with export information
449 const css::uno::Reference
< css::beans::XPropertySet
>& getExportInfo() const { return mxExportInfo
; }
451 const css::uno::Reference
< css::task::XStatusIndicator
>& GetStatusIndicator() const { return mxStatusIndicator
; }
453 /// get Event export, with handlers for script types "None" and
454 /// "StarBasic" already registered; other handlers may be registered, too.
455 XMLEventExport
& GetEventExport();
457 /// get the export for image maps
458 XMLImageMapExport
& GetImageMapExport();
460 OUString
AddEmbeddedXGraphic(css::uno::Reference
<css::graphic::XGraphic
> const & rxGraphic
, OUString
& rOutMimeType
, OUString
const & rRequestedName
= OUString());
461 bool AddEmbeddedXGraphicAsBase64(css::uno::Reference
<css::graphic::XGraphic
> const & rxGraphic
);
462 bool GetGraphicMimeTypeFromStream(css::uno::Reference
<css::graphic::XGraphic
> const & rxGraphic
, OUString
& rOutMimeType
);
464 OUString
AddEmbeddedObject(
465 const OUString
& rEmbeddedObjectURL
);
466 bool AddEmbeddedObjectAsBase64(
467 const OUString
& rEmbeddedObjectURL
);
469 OUString
EncodeStyleName( const OUString
& rName
,
470 bool *pEncoded
=nullptr ) const;
472 // save linked sections?
473 bool IsSaveLinkedSections() const { return mbSaveLinkedSections
; }
476 SvXMLExportFlags
getExportFlags() const { return mnExportFlags
; }
478 void ExportEmbeddedOwnObject(
479 css::uno::Reference
<css::lang::XComponent
> const & rComp
);
481 OUString
GetRelativeReference(const OUString
& rValue
);
483 // methods for accessing the document handler and handling SAX errors
484 void StartElement(sal_uInt16 nPrefix
,
485 enum ::xmloff::token::XMLTokenEnum eName
,
486 bool bIgnWSOutside
);
487 void StartElement(const OUString
& rName
,
488 bool bIgnWSOutside
);
489 void Characters(const OUString
& rChars
);
490 void EndElement(sal_uInt16 nPrefix
,
491 enum ::xmloff::token::XMLTokenEnum eName
,
493 void EndElement(const OUString
& rName
,
495 void IgnorableWhitespace();
498 * Record an error condition that occurred during export. The
499 * behavior of SetError can be modified using the error flag
503 /// error ID, may contain an error flag
505 /// string parameters for the error message
506 const css::uno::Sequence
< OUString
> & rMsgParams
,
507 /// original exception message (if applicable)
508 const OUString
& rExceptionMessage
,
509 /// error location (if applicable)
510 const css::uno::Reference
<css::xml::sax::XLocator
> & rLocator
);
514 const css::uno::Sequence
< OUString
> & rMsgParams
);
516 virtual void DisposingModel();
518 ::comphelper::UnoInterfaceToUniqueIdentifierMapper
& getInterfaceToIdentifierMapper();
520 const css::uno::Reference
< css::uno::XComponentContext
>& getComponentContext() const { return m_xContext
;}
522 // Shapes in Writer cannot be named via context menu (#i51726#)
523 SvtModuleOptions::EFactory
GetModelType() const
528 // Written OpenDocument file format doesn't fit to the created text document (#i69627#)
529 bool writeOutlineStyleAsNormalListStyle() const;
531 css::uno::Reference
< css::embed::XStorage
> const & GetTargetStorage() const;
533 /// returns value of ODF version attribute
534 char const* GetODFVersionAttributeValue() const;
536 /// returns the deterministic version for odf export
537 SvtSaveOptions::ODFSaneDefaultVersion
getSaneDefaultVersion() const;
539 // FIXME: this is only for legacy stuff that has not yet been adapted
540 // to implement XMetadatable; this can write duplicate IDs!
541 /// add xml:id and legacy namespace id
542 void SAL_DLLPRIVATE
AddAttributeIdLegacy(
543 sal_uInt16
const nLegacyPrefix
, OUString
const& rValue
);
545 /// add xml:id attribute (for RDF metadata)
546 void AddAttributeXmlId(css::uno::Reference
<css::uno::XInterface
> const & i_xIfc
);
548 /// add RDFa attributes for a metadatable text content
549 void AddAttributesRDFa( css::uno::Reference
<css::text::XTextContent
> const & i_xTextContent
);
551 bool exportTextNumberElement() const;
553 /// set null date from model to unit converter, if not already done
554 bool SetNullDateOnUnitConverter();
556 /// Get clamped mimetype for image export (empty if none)
557 OUString
const & GetImageFilterName() const;
560 inline rtl::Reference
< XMLTextParagraphExport
> const & SvXMLExport::GetTextParagraphExport()
562 if( !mxTextParagraphExport
.is() )
563 mxTextParagraphExport
= CreateTextParagraphExport();
565 return mxTextParagraphExport
;
568 inline rtl::Reference
< XMLShapeExport
> const & SvXMLExport::GetShapeExport()
570 if( !mxShapeExport
.is() )
571 mxShapeExport
= CreateShapeExport();
573 return mxShapeExport
;
576 inline rtl::Reference
< SvXMLAutoStylePoolP
> const & SvXMLExport::GetAutoStylePool()
578 if( !mxAutoStylePool
.is() )
579 mxAutoStylePool
= CreateAutoStylePool();
581 return mxAutoStylePool
;
584 inline rtl::Reference
< SchXMLExportHelper
> const & SvXMLExport::GetChartExport()
586 if( !mxChartExport
.is() )
587 mxChartExport
= CreateChartExport();
589 return mxChartExport
;
592 inline rtl::Reference
< XMLPageExport
> const & SvXMLExport::GetPageExport()
594 if( !mxPageExport
.is() )
595 mxPageExport
= CreatePageExport();
600 inline rtl::Reference
< XMLFontAutoStylePool
> const & SvXMLExport::GetFontAutoStylePool()
602 if( !mxFontAutoStylePool
.is() )
603 mxFontAutoStylePool
= CreateFontAutoStylePool();
605 return mxFontAutoStylePool
;
608 inline rtl::Reference
< xmloff::OFormLayerXMLExport
> const & SvXMLExport::GetFormExport()
610 if( !mxFormExport
.is() )
611 mxFormExport
= CreateFormExport();
616 inline bool SvXMLExport::HasFormExport() const
618 return mxFormExport
.is();
621 inline void SvXMLExport::SetEmbeddedResolver(
622 css::uno::Reference
< css::document::XEmbeddedObjectResolver
> const & _xEmbeddedResolver
)
624 mxEmbeddedResolver
= _xEmbeddedResolver
;
627 inline void SvXMLExport::SetGraphicStorageHandler(
628 css::uno::Reference
<css::document::XGraphicStorageHandler
> const & rxGraphicStorageHandler
)
630 mxGraphicStorageHandler
= rxGraphicStorageHandler
;
633 // Helper class to export an element.
634 class XMLOFF_DLLPUBLIC SvXMLElementExport
636 SvXMLExport
& mrExport
;
637 OUString maElementName
;
638 const bool mbIgnoreWhitespaceInside
:1;
639 const bool mbDoSomething
:1;
643 const sal_uInt16 nPrefix
,
644 const OUString
& rName
,
645 const bool bIgnoreWhitespaceOutside
);
649 // The constructor prints a start tag that has the common attributes
650 // of the XMLExport instance attached.
651 SvXMLElementExport( SvXMLExport
& rExp
, sal_uInt16 nPrefix
,
652 const OUString
& rName
,
653 bool bIgnWSOutside
, bool bIgnWSInside
);
654 SvXMLElementExport( SvXMLExport
& rExp
, sal_uInt16 nPrefix
,
655 enum ::xmloff::token::XMLTokenEnum eName
,
656 bool bIgnWSOutside
, bool bIgnWSInside
);
657 SvXMLElementExport( SvXMLExport
& rExp
, const OUString
& rQName
,
658 bool bIgnWSOutside
, bool bIgnWSInside
);
660 // These constructors do nothing if bDoSomething is not set
661 SvXMLElementExport( SvXMLExport
& rExp
, bool bDoSomething
,
663 enum ::xmloff::token::XMLTokenEnum eName
,
664 bool bIgnWSOutside
, bool bIgnWSInside
);
666 // The destructor prints an end tag.
667 ~SvXMLElementExport();
670 #endif // _XMLOFF_SVXMLEXP_HXX
672 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */