diff options
author | Noel Grandin <noel@peralex.com> | 2014-12-25 15:17:55 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-01-06 10:59:41 +0200 |
commit | dc28e90d200a839d4017d548217ee5ce8a23f848 (patch) | |
tree | a6ae872fb19a046292d96d280da286a20a397def | |
parent | 465356ecc81e23016b4289ab16e99084f2a7b84e (diff) |
fdo#84938: convert IMPORT_ constants to 'enum class'
Change-Id: Idaa8f07c62b3ba93c27ca5fe286720254baac10d
24 files changed, 119 insertions, 111 deletions
diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index 4c3e35f4647d..87eecf52d9cf 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -56,6 +56,7 @@ #include <com/sun/star/xml/sax/XFastDocumentHandler.hpp> #include <com/sun/star/xml/sax/XFastContextHandler.hpp> #include <com/sun/star/xml/sax/XFastAttributeList.hpp> +#include <o3tl/typed_flags_set.hxx> namespace com { namespace sun { namespace star { namespace frame { class XModel; } @@ -82,17 +83,24 @@ namespace xmloff { class RDFaImportHelper; } -#define IMPORT_META 0x0001 -#define IMPORT_STYLES 0x0002 -#define IMPORT_MASTERSTYLES 0x0004 -#define IMPORT_AUTOSTYLES 0x0008 -#define IMPORT_CONTENT 0x0010 -#define IMPORT_SCRIPTS 0x0020 -#define IMPORT_SETTINGS 0x0040 -#define IMPORT_FONTDECLS 0x0080 -#define IMPORT_EMBEDDED 0x0100 -#define IMPORT_OOO_NAMESPACES 0x0100 -#define IMPORT_ALL 0xffff +enum class SvXMLImportFlags { + NONE = 0x0000, + META = 0x0001, + STYLES = 0x0002, + MASTERSTYLES = 0x0004, + AUTOSTYLES = 0x0008, + CONTENT = 0x0010, + SCRIPTS = 0x0020, + SETTINGS = 0x0040, + FONTDECLS = 0x0080, + EMBEDDED = 0x0100, + OOO_NAMESPACES = 0x0100, + ALL = 0xffff +}; +namespace o3tl +{ + template<> struct typed_flags<SvXMLImportFlags> : is_typed_flags<SvXMLImportFlags, 0xffff> {}; +} @@ -148,7 +156,7 @@ class XMLOFF_DLLPUBLIC SvXMLImport : public ::cppu::WeakImplHelper7< SAL_DLLPRIVATE void _InitCtor(); - sal_uInt16 mnImportFlags; + SvXMLImportFlags mnImportFlags; sal_uInt16 mnErrorFlags; std::set< OUString > embeddedFontUrlsKnown; @@ -199,7 +207,7 @@ public: SvXMLImport( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext, OUString const & implementationName, - sal_uInt16 nImportFlags = IMPORT_ALL ) throw(); + SvXMLImportFlags nImportFlags = SvXMLImportFlags::ALL ) throw(); virtual ~SvXMLImport() throw(); @@ -369,7 +377,7 @@ public: const SvXMLStylesContext *GetStyles() const; const SvXMLStylesContext *GetAutoStyles() const; - sal_uInt16 getImportFlags() const { return mnImportFlags; } + SvXMLImportFlags getImportFlags() const { return mnImportFlags; } bool IsFormsSupported() const { return mbIsFormsSupported; } OUString GetAbsoluteReference(const OUString& rValue) const; diff --git a/linguistic/source/convdicxml.hxx b/linguistic/source/convdicxml.hxx index d8d155ccc76c..92824ca7989b 100644 --- a/linguistic/source/convdicxml.hxx +++ b/linguistic/source/convdicxml.hxx @@ -84,7 +84,7 @@ public: //!! see comment for pDic member ConvDicXMLImport( ConvDic *pConvDic ) : - SvXMLImport ( comphelper::getProcessComponentContext(), "com.sun.star.lingu2.ConvDicXMLImport", IMPORT_ALL ), + SvXMLImport ( comphelper::getProcessComponentContext(), "com.sun.star.lingu2.ConvDicXMLImport", SvXMLImportFlags::ALL ), pDic ( pConvDic ) { nLanguage = LANGUAGE_NONE; diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx index 776a60e000dd..84e53dca4be9 100644 --- a/reportdesign/source/filter/xml/xmlfilter.cxx +++ b/reportdesign/source/filter/xml/xmlfilter.cxx @@ -283,7 +283,7 @@ sal_Int32 ReadThroughComponent( uno::Reference< uno::XInterface > ORptImportHelper::create(uno::Reference< uno::XComponentContext > const & xContext) { - return static_cast< XServiceInfo* >(new ORptFilter(xContext, IMPORT_SETTINGS )); + return static_cast< XServiceInfo* >(new ORptFilter(xContext, SvXMLImportFlags::SETTINGS )); } OUString ORptImportHelper::getImplementationName_Static( ) throw (RuntimeException) @@ -300,8 +300,8 @@ Sequence< OUString > ORptImportHelper::getSupportedServiceNames_Static( ) throw Reference< XInterface > ORptContentImportHelper::create(const Reference< XComponentContext > & xContext) { - return static_cast< XServiceInfo* >(new ORptFilter(xContext,IMPORT_AUTOSTYLES | IMPORT_CONTENT | IMPORT_SCRIPTS | - IMPORT_FONTDECLS )); + return static_cast< XServiceInfo* >(new ORptFilter(xContext, SvXMLImportFlags::AUTOSTYLES | SvXMLImportFlags::CONTENT | SvXMLImportFlags::SCRIPTS | + SvXMLImportFlags::FONTDECLS )); } OUString ORptContentImportHelper::getImplementationName_Static( ) throw (RuntimeException) @@ -320,8 +320,8 @@ Sequence< OUString > ORptContentImportHelper::getSupportedServiceNames_Static( Reference< XInterface > ORptStylesImportHelper::create(Reference< XComponentContext > const & xContext) { return static_cast< XServiceInfo* >(new ORptFilter(xContext, - IMPORT_STYLES | IMPORT_MASTERSTYLES | IMPORT_AUTOSTYLES | - IMPORT_FONTDECLS )); + SvXMLImportFlags::STYLES | SvXMLImportFlags::MASTERSTYLES | SvXMLImportFlags::AUTOSTYLES | + SvXMLImportFlags::FONTDECLS )); } OUString ORptStylesImportHelper::getImplementationName_Static( ) throw (RuntimeException) @@ -340,7 +340,7 @@ Sequence< OUString > ORptStylesImportHelper::getSupportedServiceNames_Static( ) Reference< XInterface > ORptMetaImportHelper::create(Reference< XComponentContext > const & xContext) { return static_cast< XServiceInfo* >(new ORptFilter(xContext, - IMPORT_META)); + SvXMLImportFlags::META)); } OUString ORptMetaImportHelper::getImplementationName_Static( ) throw (RuntimeException) @@ -358,7 +358,7 @@ Sequence< OUString > ORptMetaImportHelper::getSupportedServiceNames_Static( ) t // - ORptFilter - -ORptFilter::ORptFilter( const uno::Reference< XComponentContext >& _rxContext,sal_uInt16 nImportFlags ) +ORptFilter::ORptFilter( const uno::Reference< XComponentContext >& _rxContext, SvXMLImportFlags nImportFlags ) :SvXMLImport(_rxContext, getImplementationName_Static(), nImportFlags) { GetMM100UnitConverter().SetCoreMeasureUnit(util::MeasureUnit::MM_100TH); @@ -1033,7 +1033,7 @@ SvXMLImportContext* ORptFilter::CreateMetaContext(const OUString& rLocalName,con { SvXMLImportContext* pContext = NULL; - if ( (getImportFlags() & IMPORT_META) ) + if ( (getImportFlags() & SvXMLImportFlags::META) ) { uno::Reference<document::XDocumentPropertiesSupplier> xDPS(GetModel(), uno::UNO_QUERY_THROW); pContext = new SvXMLMetaDocumentContext(*this,XML_NAMESPACE_OFFICE, rLocalName,xDPS->getDocumentProperties()); diff --git a/reportdesign/source/filter/xml/xmlfilter.hxx b/reportdesign/source/filter/xml/xmlfilter.hxx index e5448f86c5eb..662b01365df1 100644 --- a/reportdesign/source/filter/xml/xmlfilter.hxx +++ b/reportdesign/source/filter/xml/xmlfilter.hxx @@ -117,7 +117,7 @@ protected: virtual ~ORptFilter() throw(); public: - ORptFilter( const Reference< XComponentContext >& _rxContext, sal_uInt16 nImportFlags = IMPORT_ALL ); + ORptFilter( const Reference< XComponentContext >& _rxContext, SvXMLImportFlags nImportFlags = SvXMLImportFlags::ALL ); // XFilter virtual sal_Bool SAL_CALL filter( const Sequence< PropertyValue >& rDescriptor ) throw(RuntimeException, std::exception) SAL_OVERRIDE; diff --git a/sc/source/filter/xml/XMLTableShapeResizer.cxx b/sc/source/filter/xml/XMLTableShapeResizer.cxx index 7a839e9356ae..21f854c7944f 100644 --- a/sc/source/filter/xml/XMLTableShapeResizer.cxx +++ b/sc/source/filter/xml/XMLTableShapeResizer.cxx @@ -95,7 +95,7 @@ void ScMyOLEFixer::CreateChartListener(ScDocument* pDoc, //for loading binary files e.g. //if we have the flat filter we need to set the dirty flag thus the visible charts get repainted //otherwise the charts keep their first visual representation which was created at a moment where the calc itself was not loaded completely and is therefore incorrect - if( (rImport.getImportFlags() & IMPORT_ALL) == IMPORT_ALL ) + if( rImport.getImportFlags() & SvXMLImportFlags::ALL ) pCL->SetDirty( true ); else { diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index e990b665cbdc..7097819e7d72 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -127,7 +127,7 @@ uno::Reference< uno::XInterface > SAL_CALL ScXMLImport_createInstance( { // #110680# // return (cppu::OWeakObject*)new ScXMLImport(IMPORT_ALL); - return (cppu::OWeakObject*)new ScXMLImport( comphelper::getComponentContext(rSMgr), ScXMLImport_getImplementationName(), IMPORT_ALL ); + return (cppu::OWeakObject*)new ScXMLImport( comphelper::getComponentContext(rSMgr), ScXMLImport_getImplementationName(), SvXMLImportFlags::ALL ); } OUString SAL_CALL ScXMLImport_Meta_getImplementationName() throw() @@ -146,7 +146,7 @@ uno::Reference< uno::XInterface > SAL_CALL ScXMLImport_Meta_createInstance( { // #110680# // return (cppu::OWeakObject*)new ScXMLImport(IMPORT_META); - return (cppu::OWeakObject*)new ScXMLImport( comphelper::getComponentContext(rSMgr), ScXMLImport_Meta_getImplementationName(), IMPORT_META ); + return (cppu::OWeakObject*)new ScXMLImport( comphelper::getComponentContext(rSMgr), ScXMLImport_Meta_getImplementationName(), SvXMLImportFlags::META ); } OUString SAL_CALL ScXMLImport_Styles_getImplementationName() throw() @@ -164,8 +164,8 @@ uno::Reference< uno::XInterface > SAL_CALL ScXMLImport_Styles_createInstance( const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) throw( uno::Exception ) { // #110680# - // return (cppu::OWeakObject*)new ScXMLImport(IMPORT_STYLES|IMPORT_AUTOSTYLES|IMPORT_MASTERSTYLES|IMPORT_FONTDECLS); - return (cppu::OWeakObject*)new ScXMLImport( comphelper::getComponentContext(rSMgr), ScXMLImport_Styles_getImplementationName(), IMPORT_STYLES|IMPORT_AUTOSTYLES|IMPORT_MASTERSTYLES|IMPORT_FONTDECLS); + // return (cppu::OWeakObject*)new ScXMLImport(SvXMLImportFlagsSTYLES|SvXMLImportFlags::AUTOSTYLES|SvXMLImportFlags::MASTERSTYLES|SvXMLImportFlags::FONTDECLS); + return (cppu::OWeakObject*)new ScXMLImport( comphelper::getComponentContext(rSMgr), ScXMLImport_Styles_getImplementationName(), SvXMLImportFlags::STYLES|SvXMLImportFlags::AUTOSTYLES|SvXMLImportFlags::MASTERSTYLES|SvXMLImportFlags::FONTDECLS); } OUString SAL_CALL ScXMLImport_Content_getImplementationName() throw() @@ -183,8 +183,8 @@ uno::Reference< uno::XInterface > SAL_CALL ScXMLImport_Content_createInstance( const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) throw( uno::Exception ) { // #110680# - // return (cppu::OWeakObject*)new ScXMLImport(IMPORT_META|IMPORT_STYLES|IMPORT_MASTERSTYLES|IMPORT_AUTOSTYLES|IMPORT_CONTENT|IMPORT_SCRIPTS|IMPORT_SETTINGS|IMPORT_FONTDECLS); - return (cppu::OWeakObject*)new ScXMLImport( comphelper::getComponentContext(rSMgr), ScXMLImport_Content_getImplementationName(), IMPORT_AUTOSTYLES|IMPORT_CONTENT|IMPORT_SCRIPTS|IMPORT_FONTDECLS); + // return (cppu::OWeakObject*)new ScXMLImport(SvXMLImportFlags::META|SvXMLImportFlags::STYLES|SvXMLImportFlags::MASTERSTYLES|SvXMLImportFlags::AUTOSTYLES|SvXMLImportFlags::CONTENT|SvXMLImportFlags::SCRIPTS|SvXMLImportFlags::SETTINGS|SvXMLImportFlags::FONTDECLS); + return (cppu::OWeakObject*)new ScXMLImport( comphelper::getComponentContext(rSMgr), ScXMLImport_Content_getImplementationName(), SvXMLImportFlags::AUTOSTYLES|SvXMLImportFlags::CONTENT|SvXMLImportFlags::SCRIPTS|SvXMLImportFlags::FONTDECLS); } OUString SAL_CALL ScXMLImport_Settings_getImplementationName() throw() @@ -202,8 +202,8 @@ uno::Reference< uno::XInterface > SAL_CALL ScXMLImport_Settings_createInstance( const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) throw( uno::Exception ) { // #110680# - // return (cppu::OWeakObject*)new ScXMLImport(IMPORT_SETTINGS); - return (cppu::OWeakObject*)new ScXMLImport( comphelper::getComponentContext(rSMgr), ScXMLImport_Settings_getImplementationName(), IMPORT_SETTINGS ); + // return (cppu::OWeakObject*)new ScXMLImport(SvXMLImportFlags::SETTINGS); + return (cppu::OWeakObject*)new ScXMLImport( comphelper::getComponentContext(rSMgr), ScXMLImport_Settings_getImplementationName(), SvXMLImportFlags::SETTINGS ); } const SvXMLTokenMap& ScXMLImport::GetTableRowCellAttrTokenMap() @@ -356,19 +356,19 @@ SvXMLImportContext *ScXMLDocContext_Impl::CreateChildContext( sal_uInt16 nPrefix switch( rTokenMap.Get( nPrefix, rLocalName ) ) { case XML_TOK_DOC_FONTDECLS: - if (GetScImport().getImportFlags() & IMPORT_FONTDECLS) + if (GetScImport().getImportFlags() & SvXMLImportFlags::FONTDECLS) pContext = GetScImport().CreateFontDeclsContext(nPrefix, rLocalName, xAttrList); break; case XML_TOK_DOC_STYLES: - if (GetScImport().getImportFlags() & IMPORT_STYLES) + if (GetScImport().getImportFlags() & SvXMLImportFlags::STYLES) pContext = GetScImport().CreateStylesContext( rLocalName, xAttrList, false); break; case XML_TOK_DOC_AUTOSTYLES: - if (GetScImport().getImportFlags() & IMPORT_AUTOSTYLES) + if (GetScImport().getImportFlags() & SvXMLImportFlags::AUTOSTYLES) pContext = GetScImport().CreateStylesContext( rLocalName, xAttrList, true); break; case XML_TOK_DOC_MASTERSTYLES: - if (GetScImport().getImportFlags() & IMPORT_MASTERSTYLES) + if (GetScImport().getImportFlags() & SvXMLImportFlags::MASTERSTYLES) pContext = new ScXMLMasterStylesContext( GetImport(), nPrefix, rLocalName, xAttrList ); break; @@ -376,16 +376,16 @@ SvXMLImportContext *ScXMLDocContext_Impl::CreateChildContext( sal_uInt16 nPrefix DBG_WARNING("XML_TOK_DOC_META: should not have come here, maybe document is invalid?"); break; case XML_TOK_DOC_SCRIPTS: - if (GetScImport().getImportFlags() & IMPORT_SCRIPTS) + if (GetScImport().getImportFlags() & SvXMLImportFlags::SCRIPTS) pContext = GetScImport().CreateScriptContext( rLocalName ); break; case XML_TOK_DOC_BODY: - if (GetScImport().getImportFlags() & IMPORT_CONTENT) + if (GetScImport().getImportFlags() & SvXMLImportFlags::CONTENT) pContext = new ScXMLBodyContext_Impl( GetScImport(), nPrefix, rLocalName, xAttrList ); break; case XML_TOK_DOC_SETTINGS: - if (GetScImport().getImportFlags() & IMPORT_SETTINGS) + if (GetScImport().getImportFlags() & SvXMLImportFlags::SETTINGS) pContext = new XMLDocumentSettingsContext(GetScImport(), nPrefix, rLocalName, xAttrList ); break; } @@ -1980,7 +1980,7 @@ SvXMLImportContext *ScXMLImport::CreateContext( sal_uInt16 nPrefix, ScXMLImport::ScXMLImport( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext, - OUString const & implementationName, sal_uInt16 nImportFlag) + OUString const & implementationName, SvXMLImportFlags nImportFlag) : SvXMLImport( xContext, implementationName, nImportFlag ), pDoc( NULL ), pChangeTrackingImportHelper(NULL), @@ -2289,7 +2289,7 @@ SvXMLImportContext *ScXMLImport::CreateMetaContext( { SvXMLImportContext* pContext = NULL; - if (getImportFlags() & IMPORT_META) + if (getImportFlags() & SvXMLImportFlags::META) { uno::Reference<document::XDocumentPropertiesSupplier> xDPS( GetModel(), uno::UNO_QUERY_THROW); @@ -2431,7 +2431,7 @@ void ScXMLImport::InsertStyles() GetStyles()->CopyStylesToDoc(true); // if content is going to be loaded with the same import, set bLatinDefaultStyle flag now - if ( getImportFlags() & IMPORT_CONTENT ) + if ( getImportFlags() & SvXMLImportFlags::CONTENT ) ExamineDefaultStyle(); } @@ -2987,11 +2987,11 @@ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeE // if content and styles are loaded with separate imports, // set bLatinDefaultStyle flag at the start of the content import - sal_uInt16 nFlags = getImportFlags(); - if ( ( nFlags & IMPORT_CONTENT ) && !( nFlags & IMPORT_STYLES ) ) + SvXMLImportFlags nFlags = getImportFlags(); + if ( ( nFlags & SvXMLImportFlags::CONTENT ) && !( nFlags & SvXMLImportFlags::STYLES ) ) ExamineDefaultStyle(); - if (getImportFlags() & IMPORT_CONTENT) + if (getImportFlags() & SvXMLImportFlags::CONTENT) { if (GetModel().is()) { @@ -3178,7 +3178,7 @@ void SAL_CALL ScXMLImport::endDocument() std::exception) { ScXMLImport::MutexGuard aGuard(*this); - if (getImportFlags() & IMPORT_CONTENT) + if (getImportFlags() & SvXMLImportFlags::CONTENT) { if (GetModel().is()) { diff --git a/sc/source/filter/xml/xmlimprt.hxx b/sc/source/filter/xml/xmlimprt.hxx index 39d3a40a9cff..9576176f95ea 100644 --- a/sc/source/filter/xml/xmlimprt.hxx +++ b/sc/source/filter/xml/xmlimprt.hxx @@ -982,7 +982,7 @@ public: // #110680# ScXMLImport( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext, - OUString const & implementationName, sal_uInt16 nImportFlag); + OUString const & implementationName, SvXMLImportFlags nImportFlag); virtual ~ScXMLImport() throw(); diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx index 95a89b4c4f8d..45510c807448 100644 --- a/starmath/source/mathmlimport.cxx +++ b/starmath/source/mathmlimport.cxx @@ -397,7 +397,7 @@ sal_uLong SmXMLImportWrapper::ReadThroughComponent( SmXMLImport::SmXMLImport( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext, - OUString const & implementationName, sal_uInt16 nImportFlags) + OUString const & implementationName, SvXMLImportFlags nImportFlags) : SvXMLImport( xContext, implementationName, nImportFlags ), pPresLayoutElemTokenMap(0), pPresLayoutAttrTokenMap(0), @@ -439,7 +439,7 @@ uno::Reference< uno::XInterface > SAL_CALL SmXMLImport_createInstance( const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception ) { - return (cppu::OWeakObject*)new SmXMLImport(comphelper::getComponentContext(rSMgr), SmXMLImport_getImplementationName(), IMPORT_ALL); + return (cppu::OWeakObject*)new SmXMLImport(comphelper::getComponentContext(rSMgr), SmXMLImport_getImplementationName(), SvXMLImportFlags::ALL); } @@ -461,7 +461,7 @@ uno::Reference< uno::XInterface > SAL_CALL SmXMLImportMeta_createInstance( const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception ) { - return (cppu::OWeakObject*)new SmXMLImport( comphelper::getComponentContext(rSMgr), SmXMLImportMeta_getImplementationName(), IMPORT_META ); + return (cppu::OWeakObject*)new SmXMLImport( comphelper::getComponentContext(rSMgr), SmXMLImportMeta_getImplementationName(), SvXMLImportFlags::META ); } @@ -483,7 +483,7 @@ uno::Reference< uno::XInterface > SAL_CALL SmXMLImportSettings_createInstance( const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception ) { - return (cppu::OWeakObject*)new SmXMLImport( comphelper::getComponentContext(rSMgr), SmXMLImportSettings_getImplementationName(), IMPORT_SETTINGS ); + return (cppu::OWeakObject*)new SmXMLImport( comphelper::getComponentContext(rSMgr), SmXMLImportSettings_getImplementationName(), SvXMLImportFlags::SETTINGS ); } sal_Int64 SAL_CALL SmXMLImport::getSomething( diff --git a/starmath/source/mathmlimport.hxx b/starmath/source/mathmlimport.hxx index 4bcf594c7827..0a1e700759c2 100644 --- a/starmath/source/mathmlimport.hxx +++ b/starmath/source/mathmlimport.hxx @@ -88,7 +88,7 @@ class SmXMLImport : public SvXMLImport public: SmXMLImport( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext, - OUString const & implementationName, sal_uInt16 nImportFlags); + OUString const & implementationName, SvXMLImportFlags nImportFlags); virtual ~SmXMLImport() throw (); // XUnoTunnel diff --git a/svx/source/xml/xmlxtimp.cxx b/svx/source/xml/xmlxtimp.cxx index f6d0216dfb8d..995bc189ffe7 100644 --- a/svx/source/xml/xmlxtimp.cxx +++ b/svx/source/xml/xmlxtimp.cxx @@ -328,7 +328,7 @@ SvxXMLXTableImport::SvxXMLXTableImport( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext, const uno::Reference< XNameContainer > & rTable, uno::Reference< XGraphicObjectResolver >& xGrfResolver ) -: SvXMLImport(xContext, "", 0), +: SvXMLImport(xContext, "", SvXMLImportFlags::NONE), mrTable( rTable ) { SetGraphicResolver( xGrfResolver ); diff --git a/sw/source/core/swg/SwXMLBlockImport.cxx b/sw/source/core/swg/SwXMLBlockImport.cxx index dcc69095a5e0..69e93c553926 100644 --- a/sw/source/core/swg/SwXMLBlockImport.cxx +++ b/sw/source/core/swg/SwXMLBlockImport.cxx @@ -349,7 +349,7 @@ SwXMLTextBlockParContext::~SwXMLTextBlockParContext ( void ) SwXMLBlockListImport::SwXMLBlockListImport( const uno::Reference< uno::XComponentContext > xContext, SwXMLTextBlocks &rBlocks ) -: SvXMLImport( xContext, "", 0 ), +: SvXMLImport( xContext, "", SvXMLImportFlags::NONE ), rBlockList (rBlocks) { } @@ -373,7 +373,7 @@ SwXMLTextBlockImport::SwXMLTextBlockImport( SwXMLTextBlocks &rBlocks, OUString & rNewText, bool bNewTextOnly ) -: SvXMLImport(xContext, "", IMPORT_ALL ), +: SvXMLImport(xContext, "", SvXMLImportFlags::ALL ), rBlockList ( rBlocks ), bTextOnly ( bNewTextOnly ), m_rText ( rNewText ) diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index ae2cbc3e4798..dfd3266064eb 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -404,7 +404,7 @@ SvXMLImportContext *SwXMLImport::CreateContext( SwXMLImport::SwXMLImport( const uno::Reference< uno::XComponentContext > xContext, - OUString const & implementationName, sal_uInt16 nImportFlags) + OUString const & implementationName, SvXMLImportFlags nImportFlags) : SvXMLImport( xContext, implementationName, nImportFlags ), pSttNdIdx( 0 ), pTableItemMapper( 0 ), @@ -607,7 +607,7 @@ void SwXMLImport::startDocument() xTextCursor = xText->createTextCursor(); SwCrsrShell *pCrsrSh = 0; SwDoc *pDoc = 0; - if( IMPORT_ALL == getImportFlags() ) + if( SvXMLImportFlags::ALL == getImportFlags() ) { pTxtCrsr = lcl_xml_GetSwXTextCursor( xTextCursor ); OSL_ENSURE( pTxtCrsr, "SwXTextCursor missing" ); @@ -638,7 +638,7 @@ void SwXMLImport::startDocument() GetTextImport()->SetCursor( xTextCursor ); } - if( (getImportFlags() & (IMPORT_CONTENT|IMPORT_MASTERSTYLES)) == 0 ) + if( (!(getImportFlags() & (SvXMLImportFlags::CONTENT|SvXMLImportFlags::MASTERSTYLES)))) return; if( !pTxtCrsr ) @@ -652,7 +652,7 @@ void SwXMLImport::startDocument() if( !pDoc ) return; - if( (getImportFlags() & IMPORT_CONTENT) != 0 && !IsStylesOnlyMode() ) + if( (getImportFlags() & SvXMLImportFlags::CONTENT) && !IsStylesOnlyMode() ) { pSttNdIdx = new SwNodeIndex( pDoc->GetNodes() ); if( IsInsertMode() ) @@ -724,7 +724,7 @@ void SwXMLImport::endDocument( void ) ClearShapeImport(); SwDoc *pDoc = 0; - if( (getImportFlags() & IMPORT_CONTENT) != 0 && !IsStylesOnlyMode() ) + if( (getImportFlags() & SvXMLImportFlags::CONTENT) && !IsStylesOnlyMode() ) { Reference<XUnoTunnel> xCrsrTunnel( GetTextImport()->GetCursor(), UNO_QUERY); @@ -852,8 +852,8 @@ void SwXMLImport::endDocument( void ) GetTextImport()->RedlineAdjustStartNodeCursor( false ); - if( (getImportFlags() & IMPORT_CONTENT) != 0 || - ((getImportFlags() & IMPORT_MASTERSTYLES) != 0 && IsStylesOnlyMode()) ) + if( (getImportFlags() & SvXMLImportFlags::CONTENT) || + ((getImportFlags() & SvXMLImportFlags::MASTERSTYLES) && IsStylesOnlyMode()) ) { // pDoc might be 0. In this case UpdateTxtCollCondition is looking // for it itself. @@ -868,7 +868,7 @@ void SwXMLImport::endDocument( void ) // SJ: #i49801# -> now permitting repaints if ( pDoc ) { - if( (getImportFlags() == IMPORT_ALL ) ) + if( (getImportFlags() == SvXMLImportFlags::ALL ) ) { // Notify math objects. If we are in the package filter this will // be done by the filter object itself @@ -1507,7 +1507,7 @@ uno::Reference< uno::XInterface > SAL_CALL SwXMLImport_createInstance( const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception ) { - return (cppu::OWeakObject*)new SwXMLImport( comphelper::getComponentContext(rSMgr), SwXMLImport_getImplementationName(), IMPORT_ALL ); + return (cppu::OWeakObject*)new SwXMLImport( comphelper::getComponentContext(rSMgr), SwXMLImport_getImplementationName(), SvXMLImportFlags::ALL ); } OUString SAL_CALL SwXMLImportStyles_getImplementationName() throw() @@ -1531,8 +1531,8 @@ uno::Reference< uno::XInterface > SAL_CALL SwXMLImportStyles_createInstance( return (cppu::OWeakObject*)new SwXMLImport( comphelper::getComponentContext(rSMgr), SwXMLImportStyles_getImplementationName(), - IMPORT_STYLES | IMPORT_MASTERSTYLES | IMPORT_AUTOSTYLES | - IMPORT_FONTDECLS ); + SvXMLImportFlags::STYLES | SvXMLImportFlags::MASTERSTYLES | SvXMLImportFlags::AUTOSTYLES | + SvXMLImportFlags::FONTDECLS ); } OUString SAL_CALL SwXMLImportContent_getImplementationName() throw() @@ -1556,8 +1556,8 @@ uno::Reference< uno::XInterface > SAL_CALL SwXMLImportContent_createInstance( return (cppu::OWeakObject*)new SwXMLImport( comphelper::getComponentContext(rSMgr), SwXMLImportContent_getImplementationName(), - IMPORT_AUTOSTYLES | IMPORT_CONTENT | IMPORT_SCRIPTS | - IMPORT_FONTDECLS ); + SvXMLImportFlags::AUTOSTYLES | SvXMLImportFlags::CONTENT | SvXMLImportFlags::SCRIPTS | + SvXMLImportFlags::FONTDECLS ); } OUString SAL_CALL SwXMLImportMeta_getImplementationName() throw() @@ -1578,7 +1578,7 @@ uno::Reference< uno::XInterface > SAL_CALL SwXMLImportMeta_createInstance( const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception ) { - return (cppu::OWeakObject*)new SwXMLImport( comphelper::getComponentContext(rSMgr), SwXMLImportMeta_getImplementationName(), IMPORT_META ); + return (cppu::OWeakObject*)new SwXMLImport( comphelper::getComponentContext(rSMgr), SwXMLImportMeta_getImplementationName(), SvXMLImportFlags::META ); } OUString SAL_CALL SwXMLImportSettings_getImplementationName() throw() @@ -1599,7 +1599,7 @@ uno::Reference< uno::XInterface > SAL_CALL SwXMLImportSettings_createInstance( const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception ) { - return (cppu::OWeakObject*)new SwXMLImport( comphelper::getComponentContext(rSMgr), SwXMLImportSettings_getImplementationName(), IMPORT_SETTINGS ); + return (cppu::OWeakObject*)new SwXMLImport( comphelper::getComponentContext(rSMgr), SwXMLImportSettings_getImplementationName(), SvXMLImportFlags::SETTINGS ); } SwDoc* SwImport::GetDocFromXMLImport( SvXMLImport& rImport ) diff --git a/sw/source/filter/xml/xmlimp.hxx b/sw/source/filter/xml/xmlimp.hxx index 1b7a3d469d20..2e04a0a4a9e2 100644 --- a/sw/source/filter/xml/xmlimp.hxx +++ b/sw/source/filter/xml/xmlimp.hxx @@ -109,7 +109,7 @@ protected: public: SwXMLImport( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext, - OUString const & implementationName, sal_uInt16 nImportFlags); + OUString const & implementationName, SvXMLImportFlags nImportFlags); virtual ~SwXMLImport() throw(); diff --git a/sw/source/filter/xml/xmlmeta.cxx b/sw/source/filter/xml/xmlmeta.cxx index 77e48f829774..ef4d17cf5010 100644 --- a/sw/source/filter/xml/xmlmeta.cxx +++ b/sw/source/filter/xml/xmlmeta.cxx @@ -58,7 +58,7 @@ SvXMLImportContext *SwXMLImport::CreateMetaContext( { SvXMLImportContext *pContext = 0; - if (getImportFlags() & IMPORT_META) + if (getImportFlags() & SvXMLImportFlags::META) { uno::Reference<document::XDocumentProperties> const xDocProps( GetDocumentProperties()); diff --git a/sw/source/uibase/config/StoredChapterNumbering.cxx b/sw/source/uibase/config/StoredChapterNumbering.cxx index 646676ca1e70..6f3a8e8ef3a9 100644 --- a/sw/source/uibase/config/StoredChapterNumbering.cxx +++ b/sw/source/uibase/config/StoredChapterNumbering.cxx @@ -390,7 +390,7 @@ public: StoredChapterNumberingImport( uno::Reference<uno::XComponentContext> const& xContext, SwChapterNumRules & rNumRules) - : SvXMLImport(xContext, "sw::StoredChapterNumberingImport", IMPORT_ALL) + : SvXMLImport(xContext, "sw::StoredChapterNumberingImport", SvXMLImportFlags::ALL) , m_rNumRules(rNumRules) { } diff --git a/xmloff/inc/SchXMLImport.hxx b/xmloff/inc/SchXMLImport.hxx index 8b6286dfedef..6535faacfe80 100644 --- a/xmloff/inc/SchXMLImport.hxx +++ b/xmloff/inc/SchXMLImport.hxx @@ -172,7 +172,7 @@ public: // #110680# SchXMLImport( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext, - OUString const & implementationName, sal_uInt16 nImportFlags ); + OUString const & implementationName, SvXMLImportFlags nImportFlags ); virtual ~SchXMLImport() throw (); diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx index 52a09d550e3e..ce11bea12497 100644 --- a/xmloff/source/chart/SchXMLImport.cxx +++ b/xmloff/source/chart/SchXMLImport.cxx @@ -515,7 +515,7 @@ Reference< chart2::XDataSeries > SchXMLImportHelper::GetNewDataSeries( // #110680# SchXMLImport::SchXMLImport( const Reference< uno::XComponentContext >& xContext, - OUString const & implementationName, sal_uInt16 nImportFlags ) : + OUString const & implementationName, SvXMLImportFlags nImportFlags ) : SvXMLImport( xContext, implementationName, nImportFlags ) { GetNamespaceMap().Add( GetXMLToken(XML_NP_XLINK), GetXMLToken(XML_N_XLINK), XML_NAMESPACE_XLINK ); @@ -554,7 +554,7 @@ SvXMLImportContext *SchXMLImport::CreateContext( sal_uInt16 nPrefix, const OUStr } else if ( (XML_NAMESPACE_OFFICE == nPrefix) && ( IsXMLToken(rLocalName, XML_DOCUMENT) || (IsXMLToken(rLocalName, XML_DOCUMENT_META) - && (getImportFlags() & IMPORT_META) )) ) + && (getImportFlags() & SvXMLImportFlags::META) )) ) { uno::Reference<document::XDocumentPropertiesSupplier> xDPS( GetModel(), uno::UNO_QUERY); @@ -680,7 +680,7 @@ OUString SAL_CALL SchXMLImport_getImplementationName() throw() Reference< uno::XInterface > SAL_CALL SchXMLImport_createInstance(const Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception ) { // #110680# - return (cppu::OWeakObject*)new SchXMLImport( comphelper::getComponentContext(rSMgr), SchXMLImport_getImplementationName(), IMPORT_ALL); + return (cppu::OWeakObject*)new SchXMLImport( comphelper::getComponentContext(rSMgr), SchXMLImport_getImplementationName(), SvXMLImportFlags::ALL); } // multiple storage version: one for content / styles / meta @@ -700,7 +700,7 @@ OUString SAL_CALL SchXMLImport_Styles_getImplementationName() throw() Reference< uno::XInterface > SAL_CALL SchXMLImport_Styles_createInstance(const Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception ) { // #110680# - return (cppu::OWeakObject*)new SchXMLImport( comphelper::getComponentContext(rSMgr), SchXMLImport_Styles_getImplementationName(), IMPORT_STYLES ); + return (cppu::OWeakObject*)new SchXMLImport( comphelper::getComponentContext(rSMgr), SchXMLImport_Styles_getImplementationName(), SvXMLImportFlags::STYLES ); } Sequence< OUString > SAL_CALL SchXMLImport_Content_getSupportedServiceNames() throw() @@ -718,7 +718,7 @@ OUString SAL_CALL SchXMLImport_Content_getImplementationName() throw() Reference< uno::XInterface > SAL_CALL SchXMLImport_Content_createInstance(const Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception ) { // #110680# - return (cppu::OWeakObject*)new SchXMLImport( comphelper::getComponentContext(rSMgr), SchXMLImport_Content_getImplementationName(), IMPORT_CONTENT | IMPORT_AUTOSTYLES | IMPORT_FONTDECLS ); + return (cppu::OWeakObject*)new SchXMLImport( comphelper::getComponentContext(rSMgr), SchXMLImport_Content_getImplementationName(), SvXMLImportFlags::CONTENT | SvXMLImportFlags::AUTOSTYLES | SvXMLImportFlags::FONTDECLS ); } Sequence< OUString > SAL_CALL SchXMLImport_Meta_getSupportedServiceNames() throw() @@ -736,7 +736,7 @@ OUString SAL_CALL SchXMLImport_Meta_getImplementationName() throw() Reference< uno::XInterface > SAL_CALL SchXMLImport_Meta_createInstance(const Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception ) { // #110680# - return (cppu::OWeakObject*)new SchXMLImport( comphelper::getComponentContext(rSMgr), SchXMLImport_Meta_getImplementationName(), IMPORT_META ); + return (cppu::OWeakObject*)new SchXMLImport( comphelper::getComponentContext(rSMgr), SchXMLImport_Meta_getImplementationName(), SvXMLImportFlags::META ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/chart/contexts.cxx b/xmloff/source/chart/contexts.cxx index e6fff5f1788f..7c212e56aab8 100644 --- a/xmloff/source/chart/contexts.cxx +++ b/xmloff/source/chart/contexts.cxx @@ -95,12 +95,12 @@ SvXMLImportContext* SchXMLDocContext::CreateChildContext( { SvXMLImportContext* pContext = 0; const SvXMLTokenMap& rTokenMap = mrImportHelper.GetDocElemTokenMap(); - sal_uInt16 nFlags = GetImport().getImportFlags(); + SvXMLImportFlags nFlags = GetImport().getImportFlags(); switch( rTokenMap.Get( nPrefix, rLocalName )) { case XML_TOK_DOC_AUTOSTYLES: - if( nFlags & IMPORT_AUTOSTYLES ) + if( nFlags & SvXMLImportFlags::AUTOSTYLES ) // not nice, but this is safe, as the SchXMLDocContext class can only by // instantiated by the chart import class SchXMLImport (header is not exported) pContext = @@ -108,7 +108,7 @@ SvXMLImportContext* SchXMLDocContext::CreateChildContext( break; case XML_TOK_DOC_STYLES: // for draw styles containing gradients/hatches/markers and dashes - if( nFlags & IMPORT_STYLES ) + if( nFlags & SvXMLImportFlags::STYLES ) pContext = new SvXMLStylesContext( GetImport(), nPrefix, rLocalName, xAttrList ); break; case XML_TOK_DOC_META: @@ -118,7 +118,7 @@ SvXMLImportContext* SchXMLDocContext::CreateChildContext( pContext = SvXMLImportContext::CreateChildContext( nPrefix, rLocalName, xAttrList ); break; case XML_TOK_DOC_BODY: - if( nFlags & IMPORT_CONTENT ) + if( nFlags & SvXMLImportFlags::CONTENT ) pContext = new SchXMLBodyContext_Impl( mrImportHelper, GetImport(), nPrefix, rLocalName ); break; } diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index d688e8fe837b..56cf1f6e1784 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -354,7 +354,7 @@ SvXMLImportContext *SvXMLImport::CreateFastContext( sal_Int32 /*Element*/, void SvXMLImport::_InitCtor() { - if( mnImportFlags != 0 ) + if( mnImportFlags != SvXMLImportFlags::NONE ) { // implicit "xml" namespace prefix mpNamespaceMap->Add( GetXMLToken(XML_XML), GetXMLToken(XML_N_XML), XML_NAMESPACE_XML ); @@ -413,7 +413,7 @@ void SvXMLImport::_InitCtor() SvXMLImport::SvXMLImport( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext, - OUString const & implementationName, sal_uInt16 nImportFlags ) throw () + OUString const & implementationName, SvXMLImportFlags nImportFlags ) throw () : mpImpl( new SvXMLImport_Impl(xContext, implementationName) ), mpNamespaceMap( new SvXMLNamespaceMap ), @@ -1253,7 +1253,7 @@ bool SvXMLImport::IsPackageURL( const OUString& rURL ) const { // if, and only if, only parts are imported, then we're in a package - const sal_uInt32 nTest = IMPORT_META|IMPORT_STYLES|IMPORT_CONTENT|IMPORT_SETTINGS; + const SvXMLImportFlags nTest = SvXMLImportFlags::META|SvXMLImportFlags::STYLES|SvXMLImportFlags::CONTENT|SvXMLImportFlags::SETTINGS; if( (mnImportFlags & nTest) == nTest ) return false; @@ -1575,7 +1575,7 @@ void SvXMLImport::SetStyles( SvXMLStylesContext *pStyles ) void SvXMLImport::SetAutoStyles( SvXMLStylesContext *pAutoStyles ) { - if (pAutoStyles && mxNumberStyles.is() && (mnImportFlags & IMPORT_CONTENT) ) + if (pAutoStyles && mxNumberStyles.is() && (mnImportFlags & SvXMLImportFlags::CONTENT) ) { uno::Reference<xml::sax::XAttributeList> xAttrList; uno::Sequence< OUString > aNames = mxNumberStyles->getElementNames(); diff --git a/xmloff/source/draw/animationimport.cxx b/xmloff/source/draw/animationimport.cxx index 0cbbd29432f6..a72dcedc6fb0 100644 --- a/xmloff/source/draw/animationimport.cxx +++ b/xmloff/source/draw/animationimport.cxx @@ -1275,7 +1275,7 @@ private: }; AnimationsImport::AnimationsImport( const Reference< XComponentContext > & rxContext ) -: SvXMLImport( rxContext, AnimationsImport_getImplementationName(), IMPORT_META ) +: SvXMLImport( rxContext, AnimationsImport_getImplementationName(), SvXMLImportFlags::META ) //FIXME: the above "IMPORT_META" used to be a nonsensical "true", question // remainst whether this should be IMPORT_META (same numerical value as // true) or default IMPORT_ALL diff --git a/xmloff/source/draw/sdxmlimp.cxx b/xmloff/source/draw/sdxmlimp.cxx index 06df8eca4403..aa2172656889 100644 --- a/xmloff/source/draw/sdxmlimp.cxx +++ b/xmloff/source/draw/sdxmlimp.cxx @@ -140,7 +140,7 @@ SvXMLImportContext *SdXMLDocContext_Impl::CreateChildContext( } case XML_TOK_DOC_SETTINGS: { - if( GetImport().getImportFlags() & IMPORT_SETTINGS ) + if( GetImport().getImportFlags() & SvXMLImportFlags::SETTINGS ) { pContext = new XMLDocumentSettingsContext(GetImport(), nPrefix, rLocalName, xAttrList ); } @@ -148,7 +148,7 @@ SvXMLImportContext *SdXMLDocContext_Impl::CreateChildContext( } case XML_TOK_DOC_STYLES: { - if( GetImport().getImportFlags() & IMPORT_STYLES ) + if( GetImport().getImportFlags() & SvXMLImportFlags::STYLES ) { // office:styles inside office:document pContext = GetSdImport().CreateStylesContext(rLocalName, xAttrList); @@ -157,7 +157,7 @@ SvXMLImportContext *SdXMLDocContext_Impl::CreateChildContext( } case XML_TOK_DOC_AUTOSTYLES: { - if( GetImport().getImportFlags() & IMPORT_AUTOSTYLES ) + if( GetImport().getImportFlags() & SvXMLImportFlags::AUTOSTYLES ) { // office:automatic-styles inside office:document pContext = GetSdImport().CreateAutoStylesContext(rLocalName, xAttrList); @@ -166,7 +166,7 @@ SvXMLImportContext *SdXMLDocContext_Impl::CreateChildContext( } case XML_TOK_DOC_MASTERSTYLES: { - if( GetImport().getImportFlags() & IMPORT_MASTERSTYLES ) + if( GetImport().getImportFlags() & SvXMLImportFlags::MASTERSTYLES ) { // office:master-styles inside office:document pContext = GetSdImport().CreateMasterStylesContext(rLocalName, xAttrList); @@ -180,7 +180,7 @@ SvXMLImportContext *SdXMLDocContext_Impl::CreateChildContext( } case XML_TOK_DOC_SCRIPT: { - if( GetImport().getImportFlags() & IMPORT_SCRIPTS ) + if( GetImport().getImportFlags() & SvXMLImportFlags::SCRIPTS ) { // office:script inside office:document pContext = GetSdImport().CreateScriptContext( rLocalName ); @@ -189,7 +189,7 @@ SvXMLImportContext *SdXMLDocContext_Impl::CreateChildContext( } case XML_TOK_DOC_BODY: { - if( GetImport().getImportFlags() & IMPORT_CONTENT ) + if( GetImport().getImportFlags() & SvXMLImportFlags::CONTENT ) { // office:body inside office:document pContext = new SdXMLBodyContext_Impl(GetSdImport(),nPrefix, @@ -267,26 +267,26 @@ uno::Reference< uno::XInterface > SAL_CALL classname##_createInstance(const uno: return (cppu::OWeakObject*)new SdXMLImport( comphelper::getComponentContext(rSMgr), implementationname, draw, flags ); \ } -SERVICE( XMLImpressImportOasis, "com.sun.star.comp.Impress.XMLOasisImporter", "XMLImpressImportOasis", false, IMPORT_ALL ) -SERVICE( XMLDrawImportOasis, "com.sun.star.comp.Draw.XMLOasisImporter", "XMLDrawImportOasis", true, IMPORT_ALL ) +SERVICE( XMLImpressImportOasis, "com.sun.star.comp.Impress.XMLOasisImporter", "XMLImpressImportOasis", false, SvXMLImportFlags::ALL ) +SERVICE( XMLDrawImportOasis, "com.sun.star.comp.Draw.XMLOasisImporter", "XMLDrawImportOasis", true, SvXMLImportFlags::ALL ) -SERVICE( XMLImpressStylesImportOasis, "com.sun.star.comp.Impress.XMLOasisStylesImporter", "XMLImpressStylesImportOasis", false, IMPORT_STYLES|IMPORT_AUTOSTYLES|IMPORT_MASTERSTYLES ) -SERVICE( XMLDrawStylesImportOasis, "com.sun.star.comp.Draw.XMLOasisStylesImporter", "XMLImpressStylesImportOasis", true, IMPORT_STYLES|IMPORT_AUTOSTYLES|IMPORT_MASTERSTYLES ) +SERVICE( XMLImpressStylesImportOasis, "com.sun.star.comp.Impress.XMLOasisStylesImporter", "XMLImpressStylesImportOasis", false, SvXMLImportFlags::STYLES|SvXMLImportFlags::AUTOSTYLES|SvXMLImportFlags::MASTERSTYLES ) +SERVICE( XMLDrawStylesImportOasis, "com.sun.star.comp.Draw.XMLOasisStylesImporter", "XMLImpressStylesImportOasis", true, SvXMLImportFlags::STYLES|SvXMLImportFlags::AUTOSTYLES|SvXMLImportFlags::MASTERSTYLES ) -SERVICE( XMLImpressContentImportOasis, "com.sun.star.comp.Impress.XMLOasisContentImporter", "XMLImpressContentImportOasis", false, IMPORT_AUTOSTYLES|IMPORT_CONTENT|IMPORT_SCRIPTS|IMPORT_FONTDECLS ) -SERVICE( XMLDrawContentImportOasis, "com.sun.star.comp.Draw.XMLOasisContentImporter", "XMLImpressContentImportOasis", true, IMPORT_AUTOSTYLES|IMPORT_CONTENT|IMPORT_SCRIPTS|IMPORT_FONTDECLS ) +SERVICE( XMLImpressContentImportOasis, "com.sun.star.comp.Impress.XMLOasisContentImporter", "XMLImpressContentImportOasis", false, SvXMLImportFlags::AUTOSTYLES|SvXMLImportFlags::CONTENT|SvXMLImportFlags::SCRIPTS|SvXMLImportFlags::FONTDECLS ) +SERVICE( XMLDrawContentImportOasis, "com.sun.star.comp.Draw.XMLOasisContentImporter", "XMLImpressContentImportOasis", true, SvXMLImportFlags::AUTOSTYLES|SvXMLImportFlags::CONTENT|SvXMLImportFlags::SCRIPTS|SvXMLImportFlags::FONTDECLS ) -SERVICE( XMLImpressMetaImportOasis, "com.sun.star.comp.Impress.XMLOasisMetaImporter", "XMLImpressMetaImportOasis", false, IMPORT_META ) -SERVICE( XMLDrawMetaImportOasis, "com.sun.star.comp.Draw.XMLOasisMetaImporter", "XMLImpressMetaImportOasis", true, IMPORT_META ) +SERVICE( XMLImpressMetaImportOasis, "com.sun.star.comp.Impress.XMLOasisMetaImporter", "XMLImpressMetaImportOasis", false, SvXMLImportFlags::META ) +SERVICE( XMLDrawMetaImportOasis, "com.sun.star.comp.Draw.XMLOasisMetaImporter", "XMLImpressMetaImportOasis", true, SvXMLImportFlags::META ) -SERVICE( XMLImpressSettingsImportOasis, "com.sun.star.comp.Impress.XMLOasisSettingsImporter", "XMLImpressSettingsImportOasis", false, IMPORT_SETTINGS ) -SERVICE( XMLDrawSettingsImportOasis, "com.sun.star.comp.Draw.XMLOasisSettingsImporter", "XMLImpressSettingsImportOasis", true, IMPORT_SETTINGS ) +SERVICE( XMLImpressSettingsImportOasis, "com.sun.star.comp.Impress.XMLOasisSettingsImporter", "XMLImpressSettingsImportOasis", false, SvXMLImportFlags::SETTINGS ) +SERVICE( XMLDrawSettingsImportOasis, "com.sun.star.comp.Draw.XMLOasisSettingsImporter", "XMLImpressSettingsImportOasis", true, SvXMLImportFlags::SETTINGS ) // #110680# SdXMLImport::SdXMLImport( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext, OUString const & implementationName, - bool bIsDraw, sal_uInt16 nImportFlags ) + bool bIsDraw, SvXMLImportFlags nImportFlags ) : SvXMLImport( xContext, implementationName, nImportFlags ), mpMasterStylesContext(0L), mpDocElemTokenMap(0L), @@ -681,7 +681,7 @@ SvXMLImportContext *SdXMLImport::CreateMetaContext(const OUString& rLocalName, { SvXMLImportContext* pContext = 0L; - if (getImportFlags() & IMPORT_META) + if (getImportFlags() & SvXMLImportFlags::META) { uno::Reference<document::XDocumentPropertiesSupplier> xDPS( GetModel(), uno::UNO_QUERY_THROW); diff --git a/xmloff/source/draw/sdxmlimp_impl.hxx b/xmloff/source/draw/sdxmlimp_impl.hxx index 2f15ee467953..23e192903495 100644 --- a/xmloff/source/draw/sdxmlimp_impl.hxx +++ b/xmloff/source/draw/sdxmlimp_impl.hxx @@ -221,7 +221,7 @@ public: SdXMLImport( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext, OUString const & implementationName, - bool bIsDraw, sal_uInt16 nImportFlags ); + bool bIsDraw, SvXMLImportFlags nImportFlags ); virtual ~SdXMLImport() throw (); // XImporter diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index eb3bab44f9be..316b37912a00 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -2692,7 +2692,7 @@ void SdXMLObjectShapeContext::StartElement( const ::com::sun::star::uno::Referen // #i13140# Check for more than empty string in maHref, there are // other possibilities that maHref results in empty container // storage names - if( !(GetImport().getImportFlags() & IMPORT_EMBEDDED) && !mbIsPlaceholder && ImpIsEmptyURL(maHref) ) + if( !(GetImport().getImportFlags() & SvXMLImportFlags::EMBEDDED) && !mbIsPlaceholder && ImpIsEmptyURL(maHref) ) return; OUString service("com.sun.star.drawing.OLE2Shape"); diff --git a/xmloff/source/forms/layerimport.cxx b/xmloff/source/forms/layerimport.cxx index 47f62fc00300..aa5f578d69c7 100644 --- a/xmloff/source/forms/layerimport.cxx +++ b/xmloff/source/forms/layerimport.cxx @@ -509,7 +509,7 @@ SvXMLImportContext* OFormLayerXMLImport_Impl::createContext(const sal_uInt16 _nP void OFormLayerXMLImport_Impl::documentDone( ) { SvXMLImport& rImport = getGlobalContext(); - if ( ( rImport.getImportFlags() & IMPORT_CONTENT ) == 0 ) + if ( !( rImport.getImportFlags() & SvXMLImportFlags::CONTENT ) ) return; // create (and bind) the spreadsheet cell bindings |