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 _XMLOFF_XMLIMP_HXX
21 #define _XMLOFF_XMLIMP_HXX
23 #include "sal/config.h"
24 #include "xmloff/dllapi.h"
25 #include "sal/types.h"
26 #include <com/sun/star/embed/XStorage.hpp>
27 #include <com/sun/star/xml/sax/SAXParseException.hpp>
28 #include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
29 #include <com/sun/star/xml/sax/SAXException.hpp>
30 #include <com/sun/star/xml/sax/XAttributeList.hpp>
31 #include <com/sun/star/xml/sax/XLocator.hpp>
32 #include <com/sun/star/lang/XUnoTunnel.hpp>
33 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
34 #include <com/sun/star/container/XNameContainer.hpp>
35 #include <com/sun/star/lang/XInitialization.hpp>
36 #include <com/sun/star/lang/XServiceInfo.hpp>
37 #include <com/sun/star/document/XImporter.hpp>
38 #include <com/sun/star/document/XFilter.hpp>
39 #include <com/sun/star/document/XGraphicObjectResolver.hpp>
40 #include <com/sun/star/document/XEmbeddedObjectResolver.hpp>
41 #include <com/sun/star/beans/XPropertySet.hpp>
42 #include <com/sun/star/uno/XComponentContext.hpp>
43 #include <cppuhelper/weak.hxx>
44 #include <xmloff/txtimp.hxx>
45 #include <xmloff/shapeimport.hxx>
46 #include <xmloff/SchXMLImportHelper.hxx>
47 #include <xmloff/ProgressBarHelper.hxx>
48 #include <cppuhelper/implbase6.hxx>
49 #include <xmloff/formlayerimport.hxx>
51 #include <com/sun/star/beans/NamedValue.hpp>
53 namespace com
{ namespace sun
{ namespace star
{
54 namespace frame
{ class XModel
; }
55 namespace io
{ class XOutputStream
; }
56 namespace rdf
{ class XMetadatable
; }
58 namespace comphelper
{ class UnoInterfaceToUniqueIdentifierMapper
; }
60 class SvXMLNamespaceMap
;
61 class SvXMLImportContext
;
62 class SvXMLImportContexts_Impl
;
63 class SvXMLImport_Impl
;
64 class SvXMLUnitConverter
;
65 class SvXMLNumFmtHelper
;
66 class XMLFontStylesContext
;
67 class XMLEventImportHelper
;
72 class RDFaImportHelper
;
75 #define IMPORT_META 0x0001
76 #define IMPORT_STYLES 0x0002
77 #define IMPORT_MASTERSTYLES 0x0004
78 #define IMPORT_AUTOSTYLES 0x0008
79 #define IMPORT_CONTENT 0x0010
80 #define IMPORT_SCRIPTS 0x0020
81 #define IMPORT_SETTINGS 0x0040
82 #define IMPORT_FONTDECLS 0x0080
83 #define IMPORT_EMBEDDED 0x0100
84 #define IMPORT_OOO_NAMESPACES 0x0100
85 #define IMPORT_ALL 0xffff
89 class XMLOFF_DLLPUBLIC SvXMLImport
: public ::cppu::WeakImplHelper6
<
90 ::com::sun::star::xml::sax::XExtendedDocumentHandler
,
91 ::com::sun::star::lang::XServiceInfo
,
92 ::com::sun::star::lang::XInitialization
,
93 ::com::sun::star::document::XImporter
,
94 ::com::sun::star::document::XFilter
,
95 ::com::sun::star::lang::XUnoTunnel
>
97 friend class SvXMLImportContext
;
99 ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XLocator
> mxLocator
;
100 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
> mxModel
;
101 ::com::sun::star::uno::Reference
< ::com::sun::star::util::XNumberFormatsSupplier
> mxNumberFormatsSupplier
;
102 ::com::sun::star::uno::Reference
< ::com::sun::star::document::XGraphicObjectResolver
> mxGraphicResolver
;
103 ::com::sun::star::uno::Reference
< ::com::sun::star::document::XEmbeddedObjectResolver
> mxEmbeddedResolver
;
104 ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> mxImportInfo
;
106 UniReference
< XMLTextImportHelper
> mxTextImport
;
107 UniReference
< XMLShapeImportHelper
> mxShapeImport
;
108 UniReference
< SchXMLImportHelper
> mxChartImport
;
109 UniReference
< ::xmloff::OFormLayerXMLImport
> mxFormImport
;
111 SvXMLImportContextRef mxFontDecls
;
112 SvXMLImportContextRef mxStyles
;
113 SvXMLImportContextRef mxAutoStyles
;
114 SvXMLImportContextRef mxMasterStyles
;
116 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameContainer
> mxGradientHelper
;
117 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameContainer
> mxHatchHelper
;
118 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameContainer
> mxBitmapHelper
;
119 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameContainer
> mxTransGradientHelper
;
120 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameContainer
> mxMarkerHelper
;
121 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameContainer
> mxDashHelper
;
122 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameContainer
> mxNumberStyles
;
123 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
> mxEventListener
;
125 SvXMLImport_Impl
*mpImpl
; // dummy
127 SvXMLNamespaceMap
*mpNamespaceMap
;
128 SvXMLUnitConverter
*mpUnitConv
;
129 SvXMLImportContexts_Impl
*mpContexts
;
130 SvXMLNumFmtHelper
*mpNumImport
;
131 ProgressBarHelper
*mpProgressBarHelper
;
132 XMLEventImportHelper
*mpEventImportHelper
;
133 XMLErrors
*mpXMLErrors
;
134 StyleMap
*mpStyleMap
;
135 OUString msPackageProtocol
;
137 SAL_DLLPRIVATE
void _InitCtor();
139 sal_uInt16 mnImportFlags
;
140 sal_uInt16 mnErrorFlags
;
141 std::set
< OUString
> embeddedFontUrlsKnown
;
145 ::com::sun::star::uno::Reference
< com::sun::star::task::XStatusIndicator
> mxStatusIndicator
;
146 sal_Bool mbIsFormsSupported
;
147 bool mbIsTableShapeSupported
;
148 bool mbIsGraphicLoadOnDemandSupported
;
150 // This method is called after the namespace map has been updated, but
151 // before a context for the current element has been pushed.
152 virtual SvXMLImportContext
*CreateContext( sal_uInt16 nPrefix
,
153 const OUString
& rLocalName
,
154 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XAttributeList
>& xAttrList
);
156 virtual XMLTextImportHelper
* CreateTextImport();
157 inline void ClearTextImport() { mxTextImport
= 0; }
158 virtual XMLShapeImportHelper
* CreateShapeImport();
159 inline sal_Bool
HasShapeImport() const { return mxShapeImport
.is(); }
160 inline void ClearShapeImport() { mxShapeImport
= 0; }
162 virtual SchXMLImportHelper
* CreateChartImport();
163 virtual ::xmloff::OFormLayerXMLImport
* CreateFormImport();
165 void SetFontDecls( XMLFontStylesContext
*pFontDecls
);
166 void SetStyles( SvXMLStylesContext
*pStyles
);
167 void SetAutoStyles( SvXMLStylesContext
*pAutoStyles
);
168 void SetMasterStyles( SvXMLStylesContext
*pMasterStyles
);
170 sal_Bool
IsODFVersionConsistent( const OUString
& aODFVersion
);
172 const ::com::sun::star::uno::Reference
< ::com::sun::star::document::XEmbeddedObjectResolver
>& GetEmbeddedResolver() const { return mxEmbeddedResolver
; }
173 inline void SetEmbeddedResolver( com::sun::star::uno::Reference
< com::sun::star::document::XEmbeddedObjectResolver
>& _xEmbeddedResolver
);
175 const ::com::sun::star::uno::Reference
< ::com::sun::star::document::XGraphicObjectResolver
>& GetGraphicResolver() const { return mxGraphicResolver
; }
176 void SetGraphicResolver( com::sun::star::uno::Reference
< com::sun::star::document::XGraphicObjectResolver
>& _xGraphicResolver
);
179 void _CreateNumberFormatsSupplier();
180 void _CreateDataStylesImport();
184 // SvXMLImport( sal_uInt16 nImportFlags = IMPORT_ALL ) throw();
186 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>& xContext
,
187 sal_uInt16 nImportFlags
= IMPORT_ALL
) throw();
189 virtual ~SvXMLImport() throw();
191 static const ::com::sun::star::uno::Sequence
< sal_Int8
> & getUnoTunnelId() throw();
193 // ::com::sun::star::xml::sax::XDocumentHandler
194 virtual void SAL_CALL
startDocument(void)
195 throw( ::com::sun::star::xml::sax::SAXException
, ::com::sun::star::uno::RuntimeException
);
196 virtual void SAL_CALL
endDocument(void)
197 throw( ::com::sun::star::xml::sax::SAXException
, ::com::sun::star::uno::RuntimeException
);
198 virtual void SAL_CALL
startElement(const OUString
& aName
,
199 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XAttributeList
> & xAttribs
)
200 throw( ::com::sun::star::xml::sax::SAXException
, ::com::sun::star::uno::RuntimeException
);
201 virtual void SAL_CALL
endElement(const OUString
& aName
)
202 throw( ::com::sun::star::xml::sax::SAXException
, ::com::sun::star::uno::RuntimeException
);
203 virtual void SAL_CALL
characters(const OUString
& aChars
)
204 throw( ::com::sun::star::xml::sax::SAXException
, ::com::sun::star::uno::RuntimeException
);
205 virtual void SAL_CALL
ignorableWhitespace(const OUString
& aWhitespaces
)
206 throw( ::com::sun::star::xml::sax::SAXException
, ::com::sun::star::uno::RuntimeException
);
207 virtual void SAL_CALL
processingInstruction(const OUString
& aTarget
,
208 const OUString
& aData
)
209 throw( ::com::sun::star::xml::sax::SAXException
, ::com::sun::star::uno::RuntimeException
);
210 virtual void SAL_CALL
setDocumentLocator(const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XLocator
> & xLocator
)
211 throw( ::com::sun::star::xml::sax::SAXException
, ::com::sun::star::uno::RuntimeException
);
213 // ::com::sun::star::xml::sax::XExtendedDocumentHandler
214 virtual void SAL_CALL
startCDATA(void) throw( ::com::sun::star::xml::sax::SAXException
, ::com::sun::star::uno::RuntimeException
);
215 virtual void SAL_CALL
endCDATA(void) throw( ::com::sun::star::uno::RuntimeException
);
216 virtual void SAL_CALL
comment(const OUString
& sComment
)
217 throw( ::com::sun::star::xml::sax::SAXException
, ::com::sun::star::uno::RuntimeException
);
218 virtual void SAL_CALL
allowLineBreak(void)
219 throw( ::com::sun::star::xml::sax::SAXException
, ::com::sun::star::uno::RuntimeException
);
220 virtual void SAL_CALL
unknown(const OUString
& sString
)
221 throw( ::com::sun::star::xml::sax::SAXException
, ::com::sun::star::uno::RuntimeException
);
224 virtual void SAL_CALL
setTargetDocument( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XComponent
>& xDoc
) throw(::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::uno::RuntimeException
);
227 virtual sal_Bool SAL_CALL
filter( const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& aDescriptor
) throw (::com::sun::star::uno::RuntimeException
);
228 virtual void SAL_CALL
cancel( ) throw (::com::sun::star::uno::RuntimeException
);
231 virtual void SAL_CALL
initialize( const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& aArguments
) throw(::com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
);
234 virtual sal_Int64 SAL_CALL
getSomething( const ::com::sun::star::uno::Sequence
< sal_Int8
>& aIdentifier
) throw(::com::sun::star::uno::RuntimeException
);
237 virtual OUString SAL_CALL
getImplementationName( )
238 throw(::com::sun::star::uno::RuntimeException
);
239 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
)
240 throw(::com::sun::star::uno::RuntimeException
);
241 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( )
242 throw(::com::sun::star::uno::RuntimeException
);
244 // may be called by certain subclasses that handle document meta-data
245 // override to provide customized handling of document statistics
246 // the base class implementation initializes the progress bar and should
247 // be called by overriding methods
248 virtual void SetStatistics(const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::NamedValue
> & i_rStats
);
250 // get import helper for text
251 inline UniReference
< XMLTextImportHelper
> GetTextImport();
252 sal_Bool
HasTextImport() const { return mxTextImport
.is(); }
253 inline SvXMLNumFmtHelper
* GetDataStylesImport();
255 // get import helper for shapes
256 inline UniReference
< XMLShapeImportHelper
> GetShapeImport();
258 // get import helper for charts
259 inline UniReference
< SchXMLImportHelper
> GetChartImport();
261 // get import helper for form layer
262 inline UniReference
< ::xmloff::OFormLayerXMLImport
> GetFormImport();
264 // get XPropertySet with import information
265 inline ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> getImportInfo() const { return mxImportInfo
; }
267 // get import helper for events
268 XMLEventImportHelper
& GetEventImport();
270 SvXMLNamespaceMap
& GetNamespaceMap() { return *mpNamespaceMap
; }
271 const SvXMLNamespaceMap
& GetNamespaceMap() const { return *mpNamespaceMap
; }
272 const SvXMLUnitConverter
& GetMM100UnitConverter() const { return *mpUnitConv
; }
273 SvXMLUnitConverter
& GetMM100UnitConverter() { return *mpUnitConv
; }
274 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::sax::XLocator
> & GetLocator() const { return mxLocator
; }
275 const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
> &
276 GetModel() const { return mxModel
; }
278 const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameContainer
> & GetGradientHelper();
279 const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameContainer
> & GetHatchHelper();
280 const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameContainer
> & GetBitmapHelper();
281 const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameContainer
> & GetTransGradientHelper();
282 const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameContainer
> & GetMarkerHelper();
283 const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameContainer
> & GetDashHelper();
284 inline ::com::sun::star::uno::Reference
< ::com::sun::star::util::XNumberFormatsSupplier
> & GetNumberFormatsSupplier();
285 inline void SetNumberFormatsSupplier(const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XNumberFormatsSupplier
>& _xNumberFormatSupplier
)
287 mxNumberFormatsSupplier
= _xNumberFormatSupplier
;
290 // Convert a local packe URL into either a graphic manager or a
291 // internal package URL. The later one happens only if bLoadURL is true
292 OUString
ResolveGraphicObjectURL( const OUString
& rURL
, sal_Bool bLoadOnDemand
);
293 ::com::sun::star::uno::Reference
< ::com::sun::star::io::XOutputStream
>
294 GetStreamForGraphicObjectURLFromBase64();
295 OUString
ResolveGraphicObjectURLFromBase64(
296 const ::com::sun::star::uno::Reference
< ::com::sun::star::io::XOutputStream
>& rOut
);
298 sal_Bool
IsPackageURL( const OUString
& rURL
) const;
299 OUString
ResolveEmbeddedObjectURL( const OUString
& rURL
,
300 const OUString
& rClassId
);
301 ::com::sun::star::uno::Reference
< ::com::sun::star::io::XOutputStream
>
302 GetStreamForEmbeddedObjectURLFromBase64();
303 OUString
ResolveEmbeddedObjectURLFromBase64();
305 // get source storage we're importing from (if available)
306 ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
>
309 void AddStyleDisplayName( sal_uInt16 nFamily
,
310 const OUString
& rName
,
311 const OUString
& rDisplayName
);
312 OUString
GetStyleDisplayName( sal_uInt16 nFamily
,
313 const OUString
& rName
) const;
315 ProgressBarHelper
* GetProgressBarHelper();
317 void AddNumberStyle(sal_Int32 nKey
, const OUString
& sName
);
319 virtual void SetViewSettings(const com::sun::star::uno::Sequence
<com::sun::star::beans::PropertyValue
>& aViewProps
);
320 virtual void SetConfigurationSettings(const com::sun::star::uno::Sequence
<com::sun::star::beans::PropertyValue
>& aConfigProps
);
321 virtual void SetDocumentSpecificSettings(const OUString
& _rSettingsGroupName
,
322 const com::sun::star::uno::Sequence
<com::sun::star::beans::PropertyValue
>& _rSettings
);
324 XMLFontStylesContext
*GetFontDecls();
325 SvXMLStylesContext
*GetStyles();
326 SvXMLStylesContext
*GetAutoStyles();
327 const XMLFontStylesContext
*GetFontDecls() const;
328 const SvXMLStylesContext
*GetStyles() const;
329 const SvXMLStylesContext
*GetAutoStyles() const;
331 sal_uInt16
getImportFlags() const { return mnImportFlags
; }
332 sal_Bool
IsFormsSupported() const { return mbIsFormsSupported
; }
333 OUString
GetAbsoluteReference(const OUString
& rValue
) const;
335 sal_Unicode
ConvStarBatsCharToStarSymbol( sal_Unicode c
);
336 sal_Unicode
ConvStarMathCharToStarSymbol( sal_Unicode c
);
338 bool IsTableShapeSupported() const { return mbIsTableShapeSupported
; }
340 OUString
GetODFVersion() const;
341 bool IsOOoXML() const; // legacy non-ODF format?
344 * Record an error condition that occurred during import. The
345 * behavior of SetError can be modified using the error flag
349 /// error ID, may contain an error flag
351 /// string parameters for the error message
352 const ::com::sun::star::uno::Sequence
< OUString
> & rMsgParams
,
353 /// original exception message (if applicable)
354 const OUString
& rExceptionMessage
,
355 /// error location (if applicable)
356 const ::com::sun::star::uno::Reference
<
357 ::com::sun::star::xml::sax::XLocator
> & rLocator
);
361 const ::com::sun::star::uno::Sequence
< OUString
> & rMsgParams
);
363 void SetError( sal_Int32 nId
);
364 void SetError( sal_Int32 nId
, const OUString
& rMsg1
);
365 void SetError( sal_Int32 nId
, const OUString
& rMsg1
,
366 const OUString
& rMsg2
);
368 /** return current error flags */
369 sal_uInt16
GetErrorFlags() { return mnErrorFlags
; }
371 virtual void DisposingModel();
373 ::comphelper::UnoInterfaceToUniqueIdentifierMapper
& getInterfaceToIdentifierMapper();
375 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>
376 GetComponentContext() const;
378 // Convert drawing object positions from OOo file format to OASIS file format and vice versa (#i28749#)
379 sal_Bool
IsShapePositionInHoriL2R() const;
381 sal_Bool
IsTextDocInOOoFileFormat() const;
383 OUString
GetBaseURL() const;
384 OUString
GetDocumentBase() const;
386 /// name of stream in package, e.g., "content.xml"
387 OUString
GetStreamName() const;
389 /// set the XmlId attribute of given UNO object (for RDF metadata)
390 void SetXmlId(::com::sun::star::uno::Reference
<
391 ::com::sun::star::uno::XInterface
> const & i_xIfc
,
392 OUString
const & i_rXmlId
);
394 /// Add a RDFa statement; parameters are XML attribute values
395 void AddRDFa( ::com::sun::star::uno::Reference
< ::com::sun::star::rdf::XMetadatable
> i_xObject
,
396 OUString
const & i_rAbout
,
397 OUString
const & i_rProperty
,
398 OUString
const & i_rContent
,
399 OUString
const & i_rDatatype
);
401 /// do not dllexport this; only for advanced cases (bookmark-start)
402 SAL_DLLPRIVATE ::xmloff::RDFaImportHelper
& GetRDFaImportHelper();
404 // #i31958# XForms helper method
405 // (to be implemented by applications suporting XForms)
406 virtual void initXForms();
408 /** returns the upd and build id (f.e. "680m124$Build-8964" gives rMaster = 680 and rBuild = 8964)
410 this only works if the meta.xml was already imported and the
411 import propertyset contains the string property "BuildId".
412 If false is returned the build ids are not available (yet).
414 bool getBuildIds( sal_Int32
& rUPD
, sal_Int32
& rBuild
) const;
416 static const sal_uInt16 OOo_1x
= 10;
417 static const sal_uInt16 OOo_2x
= 20;
418 static const sal_uInt16 OOo_30x
= 30;
419 static const sal_uInt16 OOo_31x
= 31;
420 static const sal_uInt16 OOo_32x
= 32;
421 static const sal_uInt16 OOo_33x
= 33;
422 static const sal_uInt16 OOo_34x
= 34;
423 static const sal_uInt16 LO_flag
= 0x100;
424 static const sal_uInt16 LO_3x
= 30 | LO_flag
;
425 static const sal_uInt16 LO_4x
= 40 | LO_flag
;
426 static const sal_uInt16 ProductVersionUnknown
= SAL_MAX_UINT16
;
428 /** depending on whether the generator version indicates LO, compare
429 against either the given LO or given OOo version */
430 bool isGeneratorVersionOlderThan(
431 sal_uInt16
const nOOoVersion
, sal_uInt16
const nLOVersion
);
433 /** this checks the build ID and returns
435 * OOo_1x for files created with OpenOffice.org 1.x or StarOffice 7 (this also includes binary import over binfilter)
436 * OOo_2x for files created with OpenOffice.org 2.x or StarOffice 8
437 * OOo_30x for files created with OpenOffice.org 3.0/3.0.1 or StarOffice 9/9 PU01
438 * OOo_31x for files created with OpenOffice.org 3.1/3.1.1 or StarOffice 9 PU02/9 PU03
439 * OOo_32x for files created with OpenOffice.org 3.2/3.2.1 or StarOffice 9 PU04 or Oracle Open Office 3.2.1
440 * OOo_33x for files created with OpenOffice.org 3.3 (and minors) or Oracle Open Office 3.3 (and minors)
441 * OOo_34x for files created with OpenOffice.org 3.4 Beta or Oracle Open Office 3.4 Beta
442 * ProductVersionUnknown for files not created with OpenOffice.org, StarOffice or Oracle Open Office
444 sal_uInt16
getGeneratorVersion() const;
446 /** If true, the URL for graphic shapes may be stored as a package URL and
447 loaded later (on demand) by the application. Otherwise graphics are
448 loaded immediately and the graphic shape gets the graphic manager URL.
450 @see <member>mbIsGraphicLoadOnDemandSupported</member>
452 bool isGraphicLoadOnDemandSupported() const;
455 Returns true if the embedded font document URL has already been processed.
456 Otherwise returns false and consequent calls with the same URL will return true.
458 bool embeddedFontAlreadyProcessed( const OUString
& url
);
460 virtual void NotifyEmbeddedFontRead() {};
463 inline UniReference
< XMLTextImportHelper
> SvXMLImport::GetTextImport()
465 if( !mxTextImport
.is() )
466 mxTextImport
= CreateTextImport();
471 inline UniReference
< XMLShapeImportHelper
> SvXMLImport::GetShapeImport()
473 if( !mxShapeImport
.is() )
474 mxShapeImport
= CreateShapeImport();
476 return mxShapeImport
;
479 inline UniReference
< SchXMLImportHelper
> SvXMLImport::GetChartImport()
481 if( !mxChartImport
.is() )
482 mxChartImport
= CreateChartImport();
484 return mxChartImport
;
487 inline UniReference
< ::xmloff::OFormLayerXMLImport
> SvXMLImport::GetFormImport()
489 if( !mxFormImport
.is() )
490 mxFormImport
= CreateFormImport();
495 inline void SvXMLImport::SetEmbeddedResolver(
496 com::sun::star::uno::Reference
< com::sun::star::document::XEmbeddedObjectResolver
>& _xEmbeddedResolver
)
498 mxEmbeddedResolver
= _xEmbeddedResolver
;
501 inline void SvXMLImport::SetGraphicResolver(
502 com::sun::star::uno::Reference
< com::sun::star::document::XGraphicObjectResolver
>& _xGraphicResolver
)
504 mxGraphicResolver
= _xGraphicResolver
;
507 inline ::com::sun::star::uno::Reference
< ::com::sun::star::util::XNumberFormatsSupplier
> & SvXMLImport::GetNumberFormatsSupplier()
509 if ( ! mxNumberFormatsSupplier
.is() && mxModel
.is() )
510 _CreateNumberFormatsSupplier();
512 return mxNumberFormatsSupplier
;
515 inline SvXMLNumFmtHelper
* SvXMLImport::GetDataStylesImport()
517 if ( mpNumImport
== NULL
)
518 _CreateDataStylesImport();
524 #endif // _XMLOFF_XMLIMP_HXX
526 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */