diff options
43 files changed, 303 insertions, 256 deletions
diff --git a/dbaccess/source/filter/xml/xmlExport.cxx b/dbaccess/source/filter/xml/xmlExport.cxx index c6bc6e947c81..3949d89ffe85 100644 --- a/dbaccess/source/filter/xml/xmlExport.cxx +++ b/dbaccess/source/filter/xml/xmlExport.cxx @@ -104,7 +104,7 @@ namespace dbaxml Reference< XInterface > SAL_CALL ODBExportHelper::Create(const Reference< XMultiServiceFactory >& _rxORB) { - return static_cast< XServiceInfo* >(new ODBExport(comphelper::getComponentContext(_rxORB),EXPORT_SETTINGS | EXPORT_PRETTY )); + return static_cast< XServiceInfo* >(new ODBExport(comphelper::getComponentContext(_rxORB), SvXMLExportFlags::SETTINGS | SvXMLExportFlags::PRETTY )); } OUString SAL_CALL ODBExportHelper::getImplementationName_Static( ) throw (RuntimeException) @@ -121,7 +121,7 @@ namespace dbaxml Reference< XInterface > SAL_CALL ODBFullExportHelper::Create(const Reference< XMultiServiceFactory >& _rxORB) { - return static_cast< XServiceInfo* >(new ODBExport(comphelper::getComponentContext(_rxORB),EXPORT_ALL)); + return static_cast< XServiceInfo* >(new ODBExport(comphelper::getComponentContext(_rxORB), SvXMLExportFlags::ALL)); } OUString SAL_CALL ODBFullExportHelper::getImplementationName_Static( ) throw (RuntimeException) { @@ -183,9 +183,9 @@ namespace dbaxml // nothing to do here } }; -ODBExport::ODBExport(const Reference< XComponentContext >& _rxContext,sal_uInt16 nExportFlag) +ODBExport::ODBExport(const Reference< XComponentContext >& _rxContext, SvXMLExportFlags nExportFlag) : SvXMLExport( util::MeasureUnit::MM_10TH, _rxContext, getImplementationName_Static(), XML_DATABASE, - EXPORT_OASIS | nExportFlag) + SvXMLExportFlags::OASIS | nExportFlag) ,m_aTypeCollection(_rxContext) ,m_bAllreadyFilled(false) { @@ -198,19 +198,19 @@ ODBExport::ODBExport(const Reference< XComponentContext >& _rxContext,sal_uInt16 _GetNamespaceMap().Add( GetXMLToken(XML_NP_DB), GetXMLToken(XML_N_DB_OASIS), XML_NAMESPACE_DB ); - if( (nExportFlag & (EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_FONTDECLS) ) != 0 ) + if( nExportFlag & (SvXMLExportFlags::STYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::FONTDECLS) ) _GetNamespaceMap().Add( GetXMLToken(XML_NP_FO), GetXMLToken(XML_N_FO_COMPAT), XML_NAMESPACE_FO ); - if( (nExportFlag & (EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS) ) != 0 ) + if( nExportFlag & (SvXMLExportFlags::META|SvXMLExportFlags::STYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::SCRIPTS|SvXMLExportFlags::SETTINGS) ) { _GetNamespaceMap().Add( GetXMLToken(XML_NP_XLINK), GetXMLToken(XML_N_XLINK), XML_NAMESPACE_XLINK ); } - if( (nExportFlag & EXPORT_SETTINGS) != 0 ) + if( nExportFlag & SvXMLExportFlags::SETTINGS ) { _GetNamespaceMap().Add( GetXMLToken(XML_NP_CONFIG), GetXMLToken(XML_N_CONFIG), XML_NAMESPACE_CONFIG ); } - if( (nExportFlag & (EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_FONTDECLS) ) != 0 ) + if( nExportFlag & (SvXMLExportFlags::STYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::FONTDECLS) ) { _GetNamespaceMap().Add( GetXMLToken(XML_NP_STYLE), GetXMLToken(XML_N_STYLE), XML_NAMESPACE_STYLE ); } @@ -1258,7 +1258,7 @@ void ODBExport::_ExportMasterStyles() void ODBExport::_ExportAutoStyles() { // there are no styles that require their own autostyles - if ( getExportFlags() & EXPORT_CONTENT ) + if ( getExportFlags() & SvXMLExportFlags::CONTENT ) { collectComponentStyles(); GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_TABLE_TABLE diff --git a/dbaccess/source/filter/xml/xmlExport.hxx b/dbaccess/source/filter/xml/xmlExport.hxx index 95812555b59f..aa94e135e509 100644 --- a/dbaccess/source/filter/xml/xmlExport.hxx +++ b/dbaccess/source/filter/xml/xmlExport.hxx @@ -173,7 +173,7 @@ protected: virtual ~ODBExport(){}; public: - ODBExport(const Reference< XComponentContext >& _rxContext, sal_uInt16 nExportFlag = EXPORT_CONTENT | EXPORT_AUTOSTYLES | EXPORT_PRETTY | EXPORT_FONTDECLS | EXPORT_SCRIPTS ); + ODBExport(const Reference< XComponentContext >& _rxContext, SvXMLExportFlags nExportFlag = SvXMLExportFlags::CONTENT | SvXMLExportFlags::AUTOSTYLES | SvXMLExportFlags::PRETTY | SvXMLExportFlags::FONTDECLS | SvXMLExportFlags::SCRIPTS ); static OUString SAL_CALL getImplementationName_Static() throw (css::uno::RuntimeException); diff --git a/editeng/source/xml/xmltxtexp.cxx b/editeng/source/xml/xmltxtexp.cxx index be19be2bfc9c..85f1f76cc2a7 100644 --- a/editeng/source/xml/xmltxtexp.cxx +++ b/editeng/source/xml/xmltxtexp.cxx @@ -393,7 +393,7 @@ SvxXMLTextExportComponent::SvxXMLTextExportComponent( pUnoText->SetSelection( rSel ); mxText = pUnoText; - setExportFlags( EXPORT_AUTOSTYLES|EXPORT_CONTENT ); + setExportFlags( SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::CONTENT ); } SvxXMLTextExportComponent::~SvxXMLTextExportComponent() diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index 4b2676dfe2ac..9018cfcb052c 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -323,7 +323,7 @@ SVGExport::SVGExport( : SvXMLExport( util::MeasureUnit::MM_100TH, xContext, "", xmloff::token::XML_TOKEN_INVALID, - EXPORT_META|EXPORT_PRETTY ) + SvXMLExportFlags::META|SvXMLExportFlags::PRETTY ) { SetDocHandler( rxHandler ); GetDocHandler()->startDocument(); diff --git a/include/o3tl/typed_flags_set.hxx b/include/o3tl/typed_flags_set.hxx index 4622d41e19f8..501a09a0cc68 100644 --- a/include/o3tl/typed_flags_set.hxx +++ b/include/o3tl/typed_flags_set.hxx @@ -101,6 +101,45 @@ inline typename o3tl::typed_flags<E>::Wrap operator ~( } template<typename E> +inline typename o3tl::typed_flags<E>::Wrap operator ^(E lhs, E rhs) { + assert(static_cast<O3TL_STD_UNDERLYING_TYPE_E>(lhs) >= 0); + assert(static_cast<O3TL_STD_UNDERLYING_TYPE_E>(rhs) >= 0); + return static_cast<typename o3tl::typed_flags<E>::Wrap>( + static_cast<O3TL_STD_UNDERLYING_TYPE_E>(lhs) + ^ static_cast<O3TL_STD_UNDERLYING_TYPE_E>(rhs)); +} + +template<typename E> +inline typename o3tl::typed_flags<E>::Wrap operator ^( + E lhs, typename o3tl::typed_flags<E>::Wrap rhs) +{ + assert(static_cast<O3TL_STD_UNDERLYING_TYPE_E>(lhs) >= 0); + return static_cast<typename o3tl::typed_flags<E>::Wrap>( + static_cast<O3TL_STD_UNDERLYING_TYPE_E>(lhs) + ^ static_cast<O3TL_STD_UNDERLYING_TYPE_E>(rhs)); +} + +template<typename E> +inline typename o3tl::typed_flags<E>::Wrap operator ^( + typename o3tl::typed_flags<E>::Wrap lhs, E rhs) +{ + assert(static_cast<O3TL_STD_UNDERLYING_TYPE_E>(rhs) >= 0); + return static_cast<typename o3tl::typed_flags<E>::Wrap>( + static_cast<O3TL_STD_UNDERLYING_TYPE_E>(lhs) + ^ static_cast<O3TL_STD_UNDERLYING_TYPE_E>(rhs)); +} + +template<typename E> +inline typename o3tl::typed_flags<E>::Wrap operator ^( + typename o3tl::typed_flags<E>::Wrap lhs, + typename o3tl::typed_flags<E>::Wrap rhs) +{ + return static_cast<typename o3tl::typed_flags<E>::Wrap>( + static_cast<O3TL_STD_UNDERLYING_TYPE_E>(lhs) + ^ static_cast<O3TL_STD_UNDERLYING_TYPE_E>(rhs)); +} + +template<typename E> inline typename o3tl::typed_flags<E>::Wrap operator &(E lhs, E rhs) { assert(static_cast<O3TL_STD_UNDERLYING_TYPE_E>(lhs) >= 0); assert(static_cast<O3TL_STD_UNDERLYING_TYPE_E>(rhs) >= 0); diff --git a/include/xmloff/xmlexp.hxx b/include/xmloff/xmlexp.hxx index d149aed89c32..d53983ec62c7 100644 --- a/include/xmloff/xmlexp.hxx +++ b/include/xmloff/xmlexp.hxx @@ -61,6 +61,7 @@ #include <tools/fldunit.hxx> #include <list> +#include <o3tl/typed_flags_set.hxx> class SvXMLNamespaceMap; class SvXMLAttributeList; @@ -83,20 +84,27 @@ namespace com { namespace sun { namespace star { } } } namespace comphelper { class UnoInterfaceToUniqueIdentifierMapper; } -#define EXPORT_META 0x0001 -#define EXPORT_STYLES 0x0002 -#define EXPORT_MASTERSTYLES 0x0004 -#define EXPORT_AUTOSTYLES 0x0008 -#define EXPORT_CONTENT 0x0010 -#define EXPORT_SCRIPTS 0x0020 -#define EXPORT_SETTINGS 0x0040 -#define EXPORT_FONTDECLS 0x0080 -#define EXPORT_EMBEDDED 0x0100 -#define EXPORT_NODOCTYPE 0x0200 -#define EXPORT_PRETTY 0x0400 -#define EXPORT_SAVEBACKWARDCOMPATIBLE 0x0800 -#define EXPORT_OASIS 0x8000 -#define EXPORT_ALL 0x7fff +enum class SvXMLExportFlags { + NONE = 0, + META = 0x0001, + STYLES = 0x0002, + MASTERSTYLES = 0x0004, + AUTOSTYLES = 0x0008, + CONTENT = 0x0010, + SCRIPTS = 0x0020, + SETTINGS = 0x0040, + FONTDECLS = 0x0080, + EMBEDDED = 0x0100, + NODOCTYPE = 0x0200, + PRETTY = 0x0400, + SAVEBACKWARDCOMPATIBLE = 0x0800, + OASIS = 0x8000, + ALL = 0x0fff +}; +namespace o3tl +{ + template<> struct typed_flags<SvXMLExportFlags> : is_typed_flags<SvXMLExportFlags, 0x8fff> {}; +} class XMLOFF_DLLPUBLIC SvXMLExport : public ::cppu::WeakImplHelper6< ::com::sun::star::document::XFilter, @@ -149,8 +157,8 @@ class XMLOFF_DLLPUBLIC SvXMLExport : public ::cppu::WeakImplHelper6< const enum ::xmloff::token::XMLTokenEnum meClass; SAL_DLLPRIVATE void _InitCtor(); - sal_uInt16 mnExportFlags; - sal_uInt16 mnErrorFlags; + SvXMLExportFlags mnExportFlags; + sal_uInt16 mnErrorFlags; public: @@ -174,7 +182,7 @@ private: void GetViewSettingsAndViews(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& rProps); protected: - void setExportFlags( sal_uInt16 nExportFlags ) { mnExportFlags = nExportFlags; } + void setExportFlags( SvXMLExportFlags nExportFlags ) { mnExportFlags = nExportFlags; } // Get (modifyable) namespace map SvXMLNamespaceMap& _GetNamespaceMap() { return *mpNamespaceMap; } @@ -273,7 +281,7 @@ public: const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext, OUString const & implementationName, const enum ::xmloff::token::XMLTokenEnum eClass = xmloff::token::XML_TOKEN_INVALID, - sal_uInt16 nExportFlag = EXPORT_ALL ); + SvXMLExportFlags nExportFlag = SvXMLExportFlags::ALL ); SvXMLExport( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext, @@ -494,7 +502,7 @@ public: inline bool IsSaveLinkedSections() { return mbSaveLinkedSections; } // get export flags - sal_uInt16 getExportFlags() const { return mnExportFlags; } + SvXMLExportFlags getExportFlags() const { return mnExportFlags; } bool ExportEmbeddedOwnObject( ::com::sun::star::uno::Reference< diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx index 2ed89900efba..9aecd97d60db 100644 --- a/reportdesign/source/filter/xml/xmlExport.cxx +++ b/reportdesign/source/filter/xml/xmlExport.cxx @@ -72,7 +72,7 @@ namespace rptxml Reference< XInterface > ORptExportHelper::create(Reference< XComponentContext > const & xContext) { - return static_cast< XServiceInfo* >(new ORptExport(xContext, getImplementationName_Static(), EXPORT_SETTINGS )); + return static_cast< XServiceInfo* >(new ORptExport(xContext, getImplementationName_Static(), SvXMLExportFlags::SETTINGS )); } OUString ORptExportHelper::getImplementationName_Static( ) throw (RuntimeException) @@ -89,7 +89,7 @@ namespace rptxml Reference< XInterface > ORptContentExportHelper::create(Reference< XComponentContext > const & xContext) { - return static_cast< XServiceInfo* >(new ORptExport(xContext, getImplementationName_Static(), EXPORT_CONTENT )); + return static_cast< XServiceInfo* >(new ORptExport(xContext, getImplementationName_Static(), SvXMLExportFlags::CONTENT )); } OUString ORptContentExportHelper::getImplementationName_Static( ) throw (RuntimeException) @@ -107,8 +107,8 @@ namespace rptxml Reference< XInterface > ORptStylesExportHelper::create(Reference< XComponentContext > const & xContext) { - return static_cast< XServiceInfo* >(new ORptExport(xContext, getImplementationName_Static(), EXPORT_STYLES | EXPORT_MASTERSTYLES | EXPORT_AUTOSTYLES | - EXPORT_FONTDECLS|EXPORT_OASIS )); + return static_cast< XServiceInfo* >(new ORptExport(xContext, getImplementationName_Static(), SvXMLExportFlags::STYLES | SvXMLExportFlags::MASTERSTYLES | SvXMLExportFlags::AUTOSTYLES | + SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::OASIS )); } OUString ORptStylesExportHelper::getImplementationName_Static( ) throw (RuntimeException) @@ -126,7 +126,7 @@ namespace rptxml Reference< XInterface > ORptMetaExportHelper::create(Reference< XComponentContext > const & xContext) { - return static_cast< XServiceInfo* >(new ORptExport(xContext, getImplementationName_Static(), EXPORT_META )); + return static_cast< XServiceInfo* >(new ORptExport(xContext, getImplementationName_Static(), SvXMLExportFlags::META )); } OUString ORptMetaExportHelper::getImplementationName_Static( ) throw (RuntimeException) @@ -144,7 +144,7 @@ namespace rptxml Reference< XInterface > ODBFullExportHelper::create(Reference< XComponentContext > const & xContext) { - return static_cast< XServiceInfo* >(new ORptExport(xContext, getImplementationName_Static(), EXPORT_ALL)); + return static_cast< XServiceInfo* >(new ORptExport(xContext, getImplementationName_Static(), SvXMLExportFlags::ALL)); } OUString ODBFullExportHelper::getImplementationName_Static( ) throw (RuntimeException) @@ -212,11 +212,11 @@ void lcl_adjustColumnSpanOverRows(ORptExport::TSectionsGrid& _rGrid) } } -ORptExport::ORptExport(const Reference< XComponentContext >& _rxContext, OUString const & implementationName, sal_uInt16 nExportFlag) -: SvXMLExport( util::MeasureUnit::MM_100TH, _rxContext, implementationName, XML_REPORT, EXPORT_OASIS) +ORptExport::ORptExport(const Reference< XComponentContext >& _rxContext, OUString const & implementationName, SvXMLExportFlags nExportFlag) +: SvXMLExport( util::MeasureUnit::MM_100TH, _rxContext, implementationName, XML_REPORT, SvXMLExportFlags::OASIS) ,m_bAllreadyFilled(false) { - setExportFlags( EXPORT_OASIS | nExportFlag); + setExportFlags( SvXMLExportFlags::OASIS | nExportFlag); GetMM100UnitConverter().SetCoreMeasureUnit(css::util::MeasureUnit::MM_100TH); GetMM100UnitConverter().SetXMLMeasureUnit(css::util::MeasureUnit::CM); @@ -231,29 +231,29 @@ ORptExport::ORptExport(const Reference< XComponentContext >& _rxContext, OUStrin _GetNamespaceMap().Add( GetXMLToken(XML_NP_TEXT), GetXMLToken(XML_N_TEXT), XML_NAMESPACE_TEXT ); - if( (getExportFlags() & (EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_FONTDECLS) ) != 0 ) + if( getExportFlags() & (SvXMLExportFlags::STYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::FONTDECLS) ) _GetNamespaceMap().Add( GetXMLToken(XML_NP_FO), GetXMLToken(XML_N_FO_COMPAT), XML_NAMESPACE_FO ); - if( (getExportFlags() & (EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS) ) != 0 ) + if( getExportFlags() & (SvXMLExportFlags::META|SvXMLExportFlags::STYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::SCRIPTS|SvXMLExportFlags::SETTINGS) ) { _GetNamespaceMap().Add( GetXMLToken(XML_NP_XLINK), GetXMLToken(XML_N_XLINK), XML_NAMESPACE_XLINK ); } - if( (getExportFlags() & EXPORT_SETTINGS) != 0 ) + if( getExportFlags() & SvXMLExportFlags::SETTINGS ) { _GetNamespaceMap().Add( GetXMLToken(XML_NP_CONFIG), GetXMLToken(XML_N_CONFIG), XML_NAMESPACE_CONFIG ); } - if( (getExportFlags() & (EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_FONTDECLS) ) != 0 ) + if( getExportFlags() & (SvXMLExportFlags::STYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::FONTDECLS) ) { _GetNamespaceMap().Add( GetXMLToken(XML_NP_STYLE), GetXMLToken(XML_N_STYLE), XML_NAMESPACE_STYLE ); } // RDFa: needed for content and header/footer styles - if( (getExportFlags() & (EXPORT_STYLES|EXPORT_AUTOSTYLES|EXPORT_MASTERSTYLES|EXPORT_CONTENT) ) != 0 ) + if( getExportFlags() & (SvXMLExportFlags::STYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT) ) { _GetNamespaceMap().Add( GetXMLToken(XML_NP_XHTML),GetXMLToken(XML_N_XHTML), XML_NAMESPACE_XHTML ); } // GRDDL: to convert RDFa and meta.xml to RDF - if( (getExportFlags() & (EXPORT_META|EXPORT_STYLES|EXPORT_AUTOSTYLES|EXPORT_MASTERSTYLES|EXPORT_CONTENT) ) != 0 ) + if( getExportFlags() & (SvXMLExportFlags::META|SvXMLExportFlags::STYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT) ) { _GetNamespaceMap().Add( GetXMLToken(XML_NP_GRDDL),GetXMLToken(XML_N_GRDDL), XML_NAMESPACE_GRDDL ); } @@ -304,7 +304,7 @@ ORptExport::ORptExport(const Reference< XComponentContext >& _rxContext, OUStrin Reference< XInterface > ORptExport::create(Reference< XComponentContext > const & xContext) { - return *(new ORptExport(xContext, getImplementationName_Static(), EXPORT_CONTENT | EXPORT_AUTOSTYLES | EXPORT_FONTDECLS)); + return *(new ORptExport(xContext, getImplementationName_Static(), SvXMLExportFlags::CONTENT | SvXMLExportFlags::AUTOSTYLES | SvXMLExportFlags::FONTDECLS)); } @@ -1336,7 +1336,7 @@ void ORptExport::collectComponentStyles() void ORptExport::_ExportAutoStyles() { // there are no styles that require their own autostyles - if ( getExportFlags() & EXPORT_CONTENT ) + if ( getExportFlags() & SvXMLExportFlags::CONTENT ) { collectComponentStyles(); GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_TABLE_TABLE @@ -1365,9 +1365,9 @@ void ORptExport::_ExportAutoStyles() GetShapeExport()->exportAutoStyles(); } // exported in _ExportMasterStyles - if( (getExportFlags() & EXPORT_MASTERSTYLES) != 0 ) + if( getExportFlags() & SvXMLExportFlags::MASTERSTYLES ) GetPageExport()->collectAutoStyles( false ); - if( (getExportFlags() & EXPORT_MASTERSTYLES) != 0 ) + if( getExportFlags() & SvXMLExportFlags::MASTERSTYLES ) GetPageExport()->exportAutoStyles(); } diff --git a/reportdesign/source/filter/xml/xmlExport.hxx b/reportdesign/source/filter/xml/xmlExport.hxx index de94fcd988e4..2e0023d8e073 100644 --- a/reportdesign/source/filter/xml/xmlExport.hxx +++ b/reportdesign/source/filter/xml/xmlExport.hxx @@ -184,7 +184,7 @@ protected: virtual ~ORptExport(){}; public: - ORptExport(const Reference< XComponentContext >& _rxContext, OUString const & implementationName, sal_uInt16 nExportFlag); + ORptExport(const Reference< XComponentContext >& _rxContext, OUString const & implementationName, SvXMLExportFlags nExportFlag); static ::com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException ); static OUString getImplementationName_Static(void) throw( ::com::sun::star::uno::RuntimeException ); diff --git a/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx b/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx index 4330c970dc15..6b123383c386 100644 --- a/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx +++ b/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx @@ -195,7 +195,7 @@ void ScChangeTrackingExportHelper::WriteDepending(const ScChangeAction* pDependA // #i80033# save old "dependence" element if backward compatibility is requested, // correct "dependency" element otherwise - const bool bSaveBackwardsCompatible = ( rExport.getExportFlags() & EXPORT_SAVEBACKWARDCOMPATIBLE ); + const bool bSaveBackwardsCompatible = bool( rExport.getExportFlags() & SvXMLExportFlags::SAVEBACKWARDCOMPATIBLE ); SvXMLElementExport aDependElem(rExport, XML_NAMESPACE_TABLE, bSaveBackwardsCompatible ? XML_DEPENDENCE : XML_DEPENDENCY, true, true); diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index d731f23c967e..84f4de11da42 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -259,7 +259,7 @@ uno::Reference< uno::XInterface > SAL_CALL ScXMLOOoExport_createInstance( const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) throw(uno::Exception, std::exception) { - return (cppu::OWeakObject*)new ScXMLExport( comphelper::getComponentContext(rSMgr), ScXMLOOoExport_getImplementationName(), EXPORT_ALL ); + return (cppu::OWeakObject*)new ScXMLExport( comphelper::getComponentContext(rSMgr), ScXMLOOoExport_getImplementationName(), SvXMLExportFlags::ALL ); } OUString SAL_CALL ScXMLOOoExport_Meta_getImplementationName() throw() @@ -277,7 +277,7 @@ uno::Reference< uno::XInterface > SAL_CALL ScXMLOOoExport_Meta_createInstance( const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) throw (uno::Exception, std::exception) { - return (cppu::OWeakObject*)new ScXMLExport( comphelper::getComponentContext(rSMgr), ScXMLOOoExport_Meta_getImplementationName(), EXPORT_META ); + return (cppu::OWeakObject*)new ScXMLExport( comphelper::getComponentContext(rSMgr), ScXMLOOoExport_Meta_getImplementationName(), SvXMLExportFlags::META ); } OUString SAL_CALL ScXMLOOoExport_Styles_getImplementationName() throw() @@ -295,7 +295,7 @@ uno::Reference< uno::XInterface > SAL_CALL ScXMLOOoExport_Styles_createInstance( const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) throw (uno::Exception, std::exception) { - return (cppu::OWeakObject*)new ScXMLExport( comphelper::getComponentContext(rSMgr), ScXMLOOoExport_Styles_getImplementationName(), EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_FONTDECLS); + return (cppu::OWeakObject*)new ScXMLExport( comphelper::getComponentContext(rSMgr), ScXMLOOoExport_Styles_getImplementationName(), SvXMLExportFlags::STYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::FONTDECLS); } OUString SAL_CALL ScXMLOOoExport_Content_getImplementationName() throw() @@ -313,7 +313,7 @@ uno::Reference< uno::XInterface > SAL_CALL ScXMLOOoExport_Content_createInstance const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) throw (uno::Exception, std::exception) { - return (cppu::OWeakObject*)new ScXMLExport( comphelper::getComponentContext(rSMgr), ScXMLOOoExport_Content_getImplementationName(), EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS); + return (cppu::OWeakObject*)new ScXMLExport( comphelper::getComponentContext(rSMgr), ScXMLOOoExport_Content_getImplementationName(), SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::SCRIPTS|SvXMLExportFlags::FONTDECLS); } OUString SAL_CALL ScXMLOOoExport_Settings_getImplementationName() throw() @@ -331,7 +331,7 @@ uno::Reference< uno::XInterface > SAL_CALL ScXMLOOoExport_Settings_createInstanc const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) throw( uno::Exception, std::exception ) { - return (cppu::OWeakObject*)new ScXMLExport( comphelper::getComponentContext(rSMgr), ScXMLOOoExport_Settings_getImplementationName(), EXPORT_SETTINGS ); + return (cppu::OWeakObject*)new ScXMLExport( comphelper::getComponentContext(rSMgr), ScXMLOOoExport_Settings_getImplementationName(), SvXMLExportFlags::SETTINGS ); } // Oasis Filter @@ -352,7 +352,7 @@ uno::Reference< uno::XInterface > SAL_CALL ScXMLOasisExport_createInstance( const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) throw (uno::Exception, std::exception) { - return (cppu::OWeakObject*)new ScXMLExport(comphelper::getComponentContext(rSMgr), ScXMLOasisExport_getImplementationName(), EXPORT_ALL|EXPORT_OASIS); + return (cppu::OWeakObject*)new ScXMLExport(comphelper::getComponentContext(rSMgr), ScXMLOasisExport_getImplementationName(), SvXMLExportFlags::ALL|SvXMLExportFlags::OASIS); } OUString SAL_CALL ScXMLOasisExport_Meta_getImplementationName() throw() @@ -371,7 +371,7 @@ uno::Reference< uno::XInterface > SAL_CALL ScXMLOasisExport_Meta_createInstance( const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) throw (uno::Exception, std::exception) { - return (cppu::OWeakObject*)new ScXMLExport(comphelper::getComponentContext(rSMgr), ScXMLOasisExport_Meta_getImplementationName(), EXPORT_META|EXPORT_OASIS); + return (cppu::OWeakObject*)new ScXMLExport(comphelper::getComponentContext(rSMgr), ScXMLOasisExport_Meta_getImplementationName(), SvXMLExportFlags::META|SvXMLExportFlags::OASIS); } OUString SAL_CALL ScXMLOasisExport_Styles_getImplementationName() throw() @@ -390,7 +390,7 @@ uno::Reference< uno::XInterface > SAL_CALL ScXMLOasisExport_Styles_createInstanc const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) throw( uno::Exception, std::exception ) { - return (cppu::OWeakObject*)new ScXMLExport(comphelper::getComponentContext(rSMgr), ScXMLOasisExport_Styles_getImplementationName(), EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_FONTDECLS|EXPORT_OASIS); + return (cppu::OWeakObject*)new ScXMLExport(comphelper::getComponentContext(rSMgr), ScXMLOasisExport_Styles_getImplementationName(), SvXMLExportFlags::STYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::OASIS); } OUString SAL_CALL ScXMLOasisExport_Content_getImplementationName() throw() @@ -409,7 +409,7 @@ uno::Reference< uno::XInterface > SAL_CALL ScXMLOasisExport_Content_createInstan const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) throw (uno::Exception, std::exception) { - return (cppu::OWeakObject*)new ScXMLExport(comphelper::getComponentContext(rSMgr), ScXMLOasisExport_Content_getImplementationName(), EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS|EXPORT_OASIS); + return (cppu::OWeakObject*)new ScXMLExport(comphelper::getComponentContext(rSMgr), ScXMLOasisExport_Content_getImplementationName(), SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::SCRIPTS|SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::OASIS); } OUString SAL_CALL ScXMLOasisExport_Settings_getImplementationName() throw() @@ -428,7 +428,7 @@ uno::Reference< uno::XInterface > SAL_CALL ScXMLOasisExport_Settings_createInsta const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) throw (uno::Exception, std::exception) { - return (cppu::OWeakObject*)new ScXMLExport(comphelper::getComponentContext(rSMgr), ScXMLOasisExport_Settings_getImplementationName(), EXPORT_SETTINGS|EXPORT_OASIS); + return (cppu::OWeakObject*)new ScXMLExport(comphelper::getComponentContext(rSMgr), ScXMLOasisExport_Settings_getImplementationName(), SvXMLExportFlags::SETTINGS|SvXMLExportFlags::OASIS); } class ScXMLShapeExport : public XMLShapeExport @@ -466,7 +466,7 @@ sal_Int16 ScXMLExport::GetMeasureUnit() // #110680# ScXMLExport::ScXMLExport( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext, - OUString const & implementationName, sal_uInt16 nExportFlag) + OUString const & implementationName, SvXMLExportFlags nExportFlag) : SvXMLExport( GetMeasureUnit(), xContext, implementationName, XML_SPREADSHEET, nExportFlag ), pDoc(NULL), @@ -495,7 +495,7 @@ ScXMLExport::ScXMLExport( bRowHeaderOpen(false), mbShowProgress( false ) { - if (getExportFlags() & EXPORT_CONTENT) + if (getExportFlags() & SvXMLExportFlags::CONTENT) { pGroupColumns = new ScMyOpenCloseColumnRowGroup(*this, XML_TABLE_COLUMN_GROUP); pGroupRows = new ScMyOpenCloseColumnRowGroup(*this, XML_TABLE_ROW_GROUP); @@ -531,7 +531,7 @@ ScXMLExport::ScXMLExport( GetAutoStylePool()->AddFamily(XML_STYLE_FAMILY_TABLE_TABLE, OUString(XML_STYLE_FAMILY_TABLE_TABLE_STYLES_NAME), xTableStylesExportPropertySetMapper, OUString(XML_STYLE_FAMILY_TABLE_TABLE_STYLES_PREFIX)); - if( (getExportFlags() & (EXPORT_STYLES|EXPORT_AUTOSTYLES|EXPORT_MASTERSTYLES|EXPORT_CONTENT) ) != 0 ) + if( getExportFlags() & (SvXMLExportFlags::STYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT) ) { // This name is reserved for the external ref cache tables. This // should not conflict with user-defined styles since this name is @@ -1888,7 +1888,7 @@ void ScXMLExport::CopySourceStream( sal_Int32 nStartOffset, sal_Int32 nEndOffset // temporary: set same stream again to clear buffer xDestSource->setOutputStream( xDestStream ); - if ( getExportFlags() & EXPORT_PRETTY ) + if ( getExportFlags() & SvXMLExportFlags::PRETTY ) { const OString aOutStr("\n "); uno::Sequence<sal_Int8> aOutSeq( (sal_Int8*)aOutStr.getStr(), aOutStr.getLength() ); @@ -2322,7 +2322,7 @@ void ScXMLExport::_ExportAutoStyles() if (!xIndex.is()) return; - if (getExportFlags() & EXPORT_CONTENT) + if (getExportFlags() & SvXMLExportFlags::CONTENT) { // re-create automatic styles with old names from stored data ScSheetSaveData* pSheetData = ScModelObj::getImplementation(xSpreadDoc)->GetSheetSaveData(); @@ -2737,7 +2737,7 @@ void ScXMLExport::_ExportAutoStyles() } } - if (getExportFlags() & EXPORT_MASTERSTYLES) + if (getExportFlags() & SvXMLExportFlags::MASTERSTYLES) { GetPageExport()->collectAutoStyles(true); GetPageExport()->exportAutoStyles(); @@ -2745,7 +2745,7 @@ void ScXMLExport::_ExportAutoStyles() // #i30251#; only write Text Styles once - if ((getExportFlags() & EXPORT_CONTENT) || (getExportFlags() & EXPORT_MASTERSTYLES)) + if ((getExportFlags() & SvXMLExportFlags::CONTENT) || (getExportFlags() & SvXMLExportFlags::MASTERSTYLES)) GetTextParagraphExport()->exportTextAutoStyles(); } @@ -5021,8 +5021,8 @@ void ScXMLExport::IncrementProgressBar(bool bFlush, sal_Int32 nInc) sal_uInt32 ScXMLExport::exportDoc( enum XMLTokenEnum eClass ) { - if( (getExportFlags() & (EXPORT_FONTDECLS|EXPORT_STYLES| - EXPORT_MASTERSTYLES|EXPORT_CONTENT)) != 0 ) + if( getExportFlags() & (SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::STYLES| + SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT) ) { if (GetDocument()) { @@ -5052,7 +5052,7 @@ sal_uInt32 ScXMLExport::exportDoc( enum XMLTokenEnum eClass ) } // sheet events use officeooo namespace - if( (getExportFlags() & EXPORT_CONTENT) != 0 && + if( (getExportFlags() & SvXMLExportFlags::CONTENT) && getDefaultVersion() >= SvtSaveOptions::ODFVER_012 ) { bool bAnySheetEvents = false; diff --git a/sc/source/filter/xml/xmlexprt.hxx b/sc/source/filter/xml/xmlexprt.hxx index 135726fb5d08..44ac90a7d6f2 100644 --- a/sc/source/filter/xml/xmlexprt.hxx +++ b/sc/source/filter/xml/xmlexprt.hxx @@ -238,7 +238,7 @@ protected: public: ScXMLExport( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext, - OUString const & implementationName, sal_uInt16 nExportFlag); + OUString const & implementationName, SvXMLExportFlags nExportFlag); virtual ~ScXMLExport(); diff --git a/sc/source/filter/xml/xmlfonte.cxx b/sc/source/filter/xml/xmlfonte.cxx index a618ff399199..63e5d94ac455 100644 --- a/sc/source/filter/xml/xmlfonte.cxx +++ b/sc/source/filter/xml/xmlfonte.cxx @@ -156,7 +156,7 @@ XMLFontAutoStylePool* ScXMLExport::CreateFontAutoStylePool() // written by different ScXMLExport instance, and would therefore write each // font file twice without complicated checking for duplicates, so handle // the embedding only in one of them. - if(( getExportFlags() & EXPORT_CONTENT ) == 0 ) + if(!( getExportFlags() & SvXMLExportFlags::CONTENT )) blockFontEmbedding = true; if( !GetDocument()->IsUsingEmbededFonts()) blockFontEmbedding = true; diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx index f40b731620fa..97c986857b30 100644 --- a/sc/source/filter/xml/xmlwrap.cxx +++ b/sc/source/filter/xml/xmlwrap.cxx @@ -694,7 +694,7 @@ bool ScXMLImportWrapper::ExportToComponent(const uno::Reference<uno::XComponentC pExport->SetSharedData(pSharedData); // if there are sheets to copy, get the source stream - if ( sName == "content.xml" && lcl_HasValidStream(rDoc) && ( pExport->getExportFlags() & EXPORT_OASIS ) ) + if ( sName == "content.xml" && lcl_HasValidStream(rDoc) && ( pExport->getExportFlags() & SvXMLExportFlags::OASIS ) ) { // old stream is still in this file's storage - open read-only diff --git a/starmath/source/mathmlexport.cxx b/starmath/source/mathmlexport.cxx index ff48dc3b117c..b0cde9a1c828 100644 --- a/starmath/source/mathmlexport.cxx +++ b/starmath/source/mathmlexport.cxx @@ -363,7 +363,7 @@ bool SmXMLExportWrapper::WriteThroughComponent( SmXMLExport::SmXMLExport( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext, - OUString const & implementationName, sal_uInt16 nExportFlags) + OUString const & implementationName, SvXMLExportFlags nExportFlags) : SvXMLExport(util::MeasureUnit::INCH, xContext, implementationName, XML_MATH, nExportFlags) , pTree(0) , @@ -413,7 +413,7 @@ uno::Reference< uno::XInterface > SAL_CALL SmXMLExport_createInstance( // EXPORT_OASIS is required here although there is no difference between // OOo and OASIS, because without the flag, a transformation to OOo would // be chained in. - return (cppu::OWeakObject*)new SmXMLExport( comphelper::getComponentContext(rSMgr), SmXMLExport_getImplementationName(), EXPORT_OASIS|EXPORT_ALL ); + return (cppu::OWeakObject*)new SmXMLExport( comphelper::getComponentContext(rSMgr), SmXMLExport_getImplementationName(), SvXMLExportFlags::OASIS|SvXMLExportFlags::ALL ); } OUString SAL_CALL SmXMLExportMetaOOO_getImplementationName() throw() @@ -433,7 +433,7 @@ uno::Reference< uno::XInterface > SAL_CALL SmXMLExportMetaOOO_createInstance( const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception ) { - return (cppu::OWeakObject*)new SmXMLExport( comphelper::getComponentContext(rSMgr), SmXMLExportMetaOOO_getImplementationName(), EXPORT_META ); + return (cppu::OWeakObject*)new SmXMLExport( comphelper::getComponentContext(rSMgr), SmXMLExportMetaOOO_getImplementationName(), SvXMLExportFlags::META ); } OUString SAL_CALL SmXMLExportMeta_getImplementationName() throw() @@ -453,7 +453,7 @@ uno::Reference< uno::XInterface > SAL_CALL SmXMLExportMeta_createInstance( const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception ) { - return (cppu::OWeakObject*)new SmXMLExport( comphelper::getComponentContext(rSMgr), SmXMLExportMeta_getImplementationName(), EXPORT_OASIS|EXPORT_META ); + return (cppu::OWeakObject*)new SmXMLExport( comphelper::getComponentContext(rSMgr), SmXMLExportMeta_getImplementationName(), SvXMLExportFlags::OASIS|SvXMLExportFlags::META ); } OUString SAL_CALL SmXMLExportSettingsOOO_getImplementationName() throw() @@ -473,7 +473,7 @@ uno::Reference< uno::XInterface > SAL_CALL SmXMLExportSettingsOOO_createInstance const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception ) { - return (cppu::OWeakObject*)new SmXMLExport( comphelper::getComponentContext(rSMgr), SmXMLExportSettingsOOO_getImplementationName(), EXPORT_SETTINGS ); + return (cppu::OWeakObject*)new SmXMLExport( comphelper::getComponentContext(rSMgr), SmXMLExportSettingsOOO_getImplementationName(), SvXMLExportFlags::SETTINGS ); } OUString SAL_CALL SmXMLExportSettings_getImplementationName() throw() @@ -493,7 +493,7 @@ uno::Reference< uno::XInterface > SAL_CALL SmXMLExportSettings_createInstance( const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception ) { - return (cppu::OWeakObject*)new SmXMLExport( comphelper::getComponentContext(rSMgr), SmXMLExportSettings_getImplementationName(), EXPORT_OASIS|EXPORT_SETTINGS ); + return (cppu::OWeakObject*)new SmXMLExport( comphelper::getComponentContext(rSMgr), SmXMLExportSettings_getImplementationName(), SvXMLExportFlags::OASIS|SvXMLExportFlags::SETTINGS ); } OUString SAL_CALL SmXMLExportContent_getImplementationName() throw() @@ -515,12 +515,12 @@ throw( uno::Exception ) { // The EXPORT_OASIS flag is only required to avoid that a transformer is // chanied in - return (cppu::OWeakObject*)new SmXMLExport( comphelper::getComponentContext(rSMgr), SmXMLExportContent_getImplementationName(), EXPORT_OASIS|EXPORT_CONTENT ); + return (cppu::OWeakObject*)new SmXMLExport( comphelper::getComponentContext(rSMgr), SmXMLExportContent_getImplementationName(), SvXMLExportFlags::OASIS|SvXMLExportFlags::CONTENT ); } sal_uInt32 SmXMLExport::exportDoc(enum XMLTokenEnum eClass) { - if ( (getExportFlags() & EXPORT_CONTENT) == 0 ) + if ( !(getExportFlags() & SvXMLExportFlags::CONTENT) ) { SvXMLExport::exportDoc( eClass ); } diff --git a/starmath/source/mathmlexport.hxx b/starmath/source/mathmlexport.hxx index e547840d2e16..a5e0360c8d58 100644 --- a/starmath/source/mathmlexport.hxx +++ b/starmath/source/mathmlexport.hxx @@ -106,7 +106,7 @@ protected: public: SmXMLExport( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext, - OUString const & implementationName, sal_uInt16 nExportFlags); + OUString const & implementationName, SvXMLExportFlags nExportFlags); virtual ~SmXMLExport() {}; // XUnoTunnel diff --git a/svx/source/xml/xmlxtexp.cxx b/svx/source/xml/xmlxtexp.cxx index c035adc13c22..810e1eede204 100644 --- a/svx/source/xml/xmlxtexp.cxx +++ b/svx/source/xml/xmlxtexp.cxx @@ -160,7 +160,7 @@ SvxXMLXTableExportComponent::SvxXMLXTableExportComponent( _GetNamespaceMap().Add( GetXMLToken(XML_NP_XLINK), GetXMLToken(XML_N_XLINK), XML_NAMESPACE_XLINK ); _GetNamespaceMap().Add( GetXMLToken(XML_NP_SVG), GetXMLToken(XML_N_SVG), XML_NAMESPACE_SVG ); SetGraphicResolver( xGrfResolver ); - setExportFlags( 0 ); + setExportFlags( SvXMLExportFlags::NONE ); } SvxXMLXTableExportComponent::~SvxXMLXTableExportComponent() diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx index f43b8cb46289..1af695cc928f 100644 --- a/sw/source/filter/xml/xmlexp.cxx +++ b/sw/source/filter/xml/xmlexp.cxx @@ -84,7 +84,7 @@ using namespace ::xmloff::token; SwXMLExport::SwXMLExport( const uno::Reference< uno::XComponentContext > xContext, - OUString const & implementationName, sal_uInt16 nExportFlags) + OUString const & implementationName, SvXMLExportFlags nExportFlags) : SvXMLExport( util::MeasureUnit::INCH, xContext, implementationName, XML_TEXT, nExportFlags ), pTableItemMapper( 0 ), @@ -135,8 +135,8 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass ) SwDoc *pDoc = getDoc(); bool bExtended = false; - if( (getExportFlags() & (EXPORT_FONTDECLS|EXPORT_STYLES| - EXPORT_MASTERSTYLES|EXPORT_CONTENT)) != 0 ) + if( getExportFlags() & (SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::STYLES| + SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT)) { if( getDefaultVersion() > SvtSaveOptions::ODFVER_012 ) { @@ -195,7 +195,7 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass ) SetExtended( bExtended ); - if( (getExportFlags() & EXPORT_META) != 0 ) + if( getExportFlags() & SvXMLExportFlags::META) { // Update doc stat, so that correct values are exported and // the progress works correctly. @@ -231,7 +231,7 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass ) } } - if( (getExportFlags() & (EXPORT_MASTERSTYLES|EXPORT_CONTENT)) != 0 ) + if( getExportFlags() & (SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT)) { //Auf die Korrektheit der OrdNums sind wir schon angewiesen. SwDrawModel* pModel = pDoc->getIDocumentDrawModelAccess().GetDrawModel(); @@ -276,7 +276,7 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass ) // set redline mode if we export STYLES or CONTENT, unless redline // mode is taken care of outside (through info XPropertySet) bool bSaveRedline = - ( (getExportFlags() & (EXPORT_CONTENT|EXPORT_STYLES)) != 0 ); + bool( getExportFlags() & (SvXMLExportFlags::CONTENT|SvXMLExportFlags::STYLES) ); if( bSaveRedline ) { // if the info property set has a ShowChanges property, @@ -522,7 +522,7 @@ Reference< XInterface > SAL_CALL SwXMLExportOOO_createInstance( const Reference< XMultiServiceFactory > & rSMgr) throw( Exception ) { - return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportOOO_getImplementationName(), EXPORT_ALL); + return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportOOO_getImplementationName(), SvXMLExportFlags::ALL); } OUString SAL_CALL SwXMLExportStylesOOO_getImplementationName() throw() @@ -544,8 +544,8 @@ Reference< XInterface > SAL_CALL SwXMLExportStylesOOO_createInstance( throw( Exception ) { return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportStylesOOO_getImplementationName(), - EXPORT_STYLES | EXPORT_MASTERSTYLES | EXPORT_AUTOSTYLES | - EXPORT_FONTDECLS ); + SvXMLExportFlags::STYLES | SvXMLExportFlags::MASTERSTYLES | SvXMLExportFlags::AUTOSTYLES | + SvXMLExportFlags::FONTDECLS ); } OUString SAL_CALL SwXMLExportContentOOO_getImplementationName() throw() @@ -567,8 +567,8 @@ Reference< XInterface > SAL_CALL SwXMLExportContentOOO_createInstance( throw( Exception ) { return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportContentOOO_getImplementationName(), - EXPORT_AUTOSTYLES | EXPORT_CONTENT | EXPORT_SCRIPTS | - EXPORT_FONTDECLS ); + SvXMLExportFlags::AUTOSTYLES | SvXMLExportFlags::CONTENT | SvXMLExportFlags::SCRIPTS | + SvXMLExportFlags::FONTDECLS ); } OUString SAL_CALL SwXMLExportMetaOOO_getImplementationName() throw() @@ -589,7 +589,7 @@ Reference< XInterface > SAL_CALL SwXMLExportMetaOOO_createInstance( const Reference< XMultiServiceFactory > & rSMgr) throw( Exception ) { - return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportMetaOOO_getImplementationName(), EXPORT_META); + return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportMetaOOO_getImplementationName(), SvXMLExportFlags::META); } OUString SAL_CALL SwXMLExportSettingsOOO_getImplementationName() throw() @@ -610,7 +610,7 @@ Reference< XInterface > SAL_CALL SwXMLExportSettingsOOO_createInstance( const Reference< XMultiServiceFactory > & rSMgr) throw( Exception ) { - return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportSettingsOOO_getImplementationName(), EXPORT_SETTINGS); + return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportSettingsOOO_getImplementationName(), SvXMLExportFlags::SETTINGS); } // OASIS @@ -632,7 +632,7 @@ Reference< XInterface > SAL_CALL SwXMLExport_createInstance( const Reference< XMultiServiceFactory > & rSMgr) throw( Exception ) { - return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExport_getImplementationName(), EXPORT_ALL|EXPORT_OASIS); + return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExport_getImplementationName(), SvXMLExportFlags::ALL|SvXMLExportFlags::OASIS); } OUString SAL_CALL SwXMLExportStyles_getImplementationName() throw() @@ -654,8 +654,8 @@ Reference< XInterface > SAL_CALL SwXMLExportStyles_createInstance( throw( Exception ) { return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportStyles_getImplementationName(), - EXPORT_STYLES | EXPORT_MASTERSTYLES | EXPORT_AUTOSTYLES | - EXPORT_FONTDECLS|EXPORT_OASIS ); + SvXMLExportFlags::STYLES | SvXMLExportFlags::MASTERSTYLES | SvXMLExportFlags::AUTOSTYLES | + SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::OASIS ); } OUString SAL_CALL SwXMLExportContent_getImplementationName() throw() @@ -678,8 +678,8 @@ Reference< XInterface > SAL_CALL SwXMLExportContent_createInstance( { return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportContent_getImplementationName(), - EXPORT_AUTOSTYLES | EXPORT_CONTENT | EXPORT_SCRIPTS | - EXPORT_FONTDECLS|EXPORT_OASIS ); + SvXMLExportFlags::AUTOSTYLES | SvXMLExportFlags::CONTENT | SvXMLExportFlags::SCRIPTS | + SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::OASIS ); } OUString SAL_CALL SwXMLExportMeta_getImplementationName() throw() @@ -700,7 +700,7 @@ Reference< XInterface > SAL_CALL SwXMLExportMeta_createInstance( const Reference< XMultiServiceFactory > & rSMgr) throw( Exception ) { - return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportMeta_getImplementationName(), EXPORT_META|EXPORT_OASIS); + return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportMeta_getImplementationName(), SvXMLExportFlags::META|SvXMLExportFlags::OASIS); } OUString SAL_CALL SwXMLExportSettings_getImplementationName() throw() @@ -721,7 +721,7 @@ Reference< XInterface > SAL_CALL SwXMLExportSettings_createInstance( const Reference< XMultiServiceFactory > & rSMgr) throw( Exception ) { - return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportSettings_getImplementationName(), EXPORT_SETTINGS|EXPORT_OASIS); + return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportSettings_getImplementationName(), SvXMLExportFlags::SETTINGS|SvXMLExportFlags::OASIS); } namespace diff --git a/sw/source/filter/xml/xmlexp.hxx b/sw/source/filter/xml/xmlexp.hxx index 99cf7a5b54d1..08f86a4e3172 100644 --- a/sw/source/filter/xml/xmlexp.hxx +++ b/sw/source/filter/xml/xmlexp.hxx @@ -117,7 +117,7 @@ protected: public: SwXMLExport( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext, - OUString const & implementationName, sal_uInt16 nExportFlags); + OUString const & implementationName, SvXMLExportFlags nExportFlags); virtual ~SwXMLExport(); diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx index d8415d4ccf26..ba5aeef44a21 100644 --- a/sw/source/filter/xml/xmlexpit.cxx +++ b/sw/source/filter/xml/xmlexpit.cxx @@ -123,7 +123,7 @@ void SvXMLExportItemMapper::exportXML( const SvXMLExport& rExport, bool bAddAttribute = true; if( rEntry.nNameSpace == XML_NAMESPACE_STYLE ) { - if( (rExport.getExportFlags() & EXPORT_SAVEBACKWARDCOMPATIBLE ) == 0 || + if( !(rExport.getExportFlags() & SvXMLExportFlags::SAVEBACKWARDCOMPATIBLE ) || !QueryXMLValue(rItem, aValue, static_cast< sal_uInt16 >( rEntry.nMemberId & MID_SW_FLAG_MASK ), rUnitConverter ) ) diff --git a/sw/source/filter/xml/xmlfmte.cxx b/sw/source/filter/xml/xmlfmte.cxx index df323eb743e3..634da16cf838 100644 --- a/sw/source/filter/xml/xmlfmte.cxx +++ b/sw/source/filter/xml/xmlfmte.cxx @@ -180,9 +180,9 @@ void SwXMLExport::_ExportAutoStyles() // the order in which they are exported. Otherwise, caching will // fail. - if( (getExportFlags() & (EXPORT_MASTERSTYLES|EXPORT_CONTENT)) != 0 ) + if( getExportFlags() & (SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT) ) { - if( (getExportFlags() & EXPORT_CONTENT) == 0 ) + if( !(getExportFlags() & SvXMLExportFlags::CONTENT) ) { // only master pages are exported => styles for frames bound // to frames (but none for frames bound to pages) need to be @@ -192,17 +192,17 @@ void SwXMLExport::_ExportAutoStyles() } // exported in _ExportMasterStyles - if( (getExportFlags() & EXPORT_MASTERSTYLES) != 0 ) + if( getExportFlags() & SvXMLExportFlags::MASTERSTYLES ) GetPageExport()->collectAutoStyles( false ); // if we don't export styles (i.e. in content stream only, but not // in single-stream case), then we can save ourselves a bit of // work and memory by not collecting field masters - if( (getExportFlags() & EXPORT_STYLES ) == 0 ) + if( !(getExportFlags() & SvXMLExportFlags::STYLES) ) GetTextParagraphExport()->exportUsedDeclarations( false ); // exported in _ExportContent - if( (getExportFlags() & EXPORT_CONTENT) != 0 ) + if( getExportFlags() & SvXMLExportFlags::CONTENT ) { GetTextParagraphExport()->exportTrackedChanges( true ); Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY ); @@ -224,14 +224,14 @@ void SwXMLExport::_ExportAutoStyles() GetTextParagraphExport()->exportTextAutoStyles(); GetShapeExport()->exportAutoStyles(); - if( (getExportFlags() & EXPORT_MASTERSTYLES) != 0 ) + if( getExportFlags() & SvXMLExportFlags::MASTERSTYLES ) GetPageExport()->exportAutoStyles(); // we rely on data styles being written after cell styles in the // ExportFmt() method; so be careful when changing order. exportAutoDataStyles(); - sal_uInt16 nContentAutostyles = EXPORT_CONTENT | EXPORT_AUTOSTYLES; + SvXMLExportFlags nContentAutostyles = SvXMLExportFlags::CONTENT | SvXMLExportFlags::AUTOSTYLES; if ( ( getExportFlags() & nContentAutostyles ) == nContentAutostyles ) GetFormExport()->exportAutoStyles(); } diff --git a/sw/source/filter/xml/xmlfonte.cxx b/sw/source/filter/xml/xmlfonte.cxx index 8574cd7ddcd7..fbe6263d6b10 100644 --- a/sw/source/filter/xml/xmlfonte.cxx +++ b/sw/source/filter/xml/xmlfonte.cxx @@ -77,7 +77,7 @@ XMLFontAutoStylePool* SwXMLExport::CreateFontAutoStylePool() // written by different SwXMLExport instance, and would therefore write each // font file twice without complicated checking for duplicates, so handle // the embedding only in one of them. - if(( getExportFlags() & EXPORT_CONTENT ) == 0 ) + if( !( getExportFlags() & SvXMLExportFlags::CONTENT) ) blockFontEmbedding = true; if( !getDoc()->getIDocumentSettingAccess().get( IDocumentSettingAccess::EMBED_FONTS )) blockFontEmbedding = true; diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx index c92a55ef728c..de682f256edb 100644 --- a/sw/source/filter/xml/xmltble.cxx +++ b/sw/source/filter/xml/xmltble.cxx @@ -666,7 +666,7 @@ void SwXMLExport::ExportTableLinesAutoStyles( const SwTableLines& rLines, rTblInfo.SetBaseSection( xTextSection ); } - const bool bExportContent = (getExportFlags() & EXPORT_CONTENT ) != 0; + const bool bExportContent = bool(getExportFlags() & SvXMLExportFlags::CONTENT ); if ( !bExportContent ) { // AUTOSTYLES - not needed anymore if we are currently exporting content.xml @@ -1153,7 +1153,7 @@ void SwXMLTextParagraphExport::exportTable( // the table is located in header/footer: // During the flat XML export (used e.g. by .sdw-export) // ALL flags are set at the same time. - const bool bExportStyles = ( GetExport().getExportFlags() & EXPORT_STYLES ) != 0; + const bool bExportStyles = bool( GetExport().getExportFlags() & SvXMLExportFlags::STYLES ); if ( bExportStyles || !pFmt->GetDoc()->IsInHeaderFooter( aIdx ) ) static_cast<SwXMLExport&>(GetExport()).ExportTableAutoStyles( *pTblNd ); } diff --git a/sw/source/filter/xml/xmltexte.cxx b/sw/source/filter/xml/xmltexte.cxx index e5eb86c057af..4b7d506a5af2 100644 --- a/sw/source/filter/xml/xmltexte.cxx +++ b/sw/source/filter/xml/xmltexte.cxx @@ -436,7 +436,7 @@ void SwXMLTextParagraphExport::_exportTextEmbedded( { case SV_EMBEDDED_OUTPLACE: case SV_EMBEDDED_OWN: - if( (rXMLExport.getExportFlags() & EXPORT_EMBEDDED) == 0 ) + if( !(rXMLExport.getExportFlags() & SvXMLExportFlags::EMBEDDED) ) { OUString sURL; @@ -600,7 +600,7 @@ void SwXMLTextParagraphExport::_exportTextEmbedded( switch( nType ) { case SV_EMBEDDED_OWN: - if( (rXMLExport.getExportFlags() & EXPORT_EMBEDDED) != 0 ) + if( rXMLExport.getExportFlags() & SvXMLExportFlags::EMBEDDED ) { Reference < XEmbeddedObjectSupplier > xEOS( rPropSet, UNO_QUERY ); OSL_ENSURE( xEOS.is(), "no embedded object supplier for own object" ); @@ -609,11 +609,11 @@ void SwXMLTextParagraphExport::_exportTextEmbedded( } break; case SV_EMBEDDED_OUTPLACE: - if( (rXMLExport.getExportFlags() & EXPORT_EMBEDDED) != 0 ) + if( rXMLExport.getExportFlags() & SvXMLExportFlags::EMBEDDED ) { OUString sURL( sEmbeddedObjectProtocol + rOLEObj.GetCurrentPersistName() ); - if ( ( rXMLExport.getExportFlags() & EXPORT_OASIS ) == 0 ) + if ( !( rXMLExport.getExportFlags() & SvXMLExportFlags::OASIS ) ) sURL += "?oasis=false"; rXMLExport.AddEmbeddedObjectAsBase64( sURL ); @@ -678,7 +678,7 @@ void SwXMLTextParagraphExport::_exportTextEmbedded( if( SV_EMBEDDED_OUTPLACE==nType || SV_EMBEDDED_OWN==nType ) { OUString sURL( sGraphicObjectProtocol + rOLEObj.GetCurrentPersistName() ); - if( (rXMLExport.getExportFlags() & EXPORT_EMBEDDED) == 0 ) + if( !(rXMLExport.getExportFlags() & SvXMLExportFlags::EMBEDDED) ) { sURL = GetExport().AddEmbeddedObject( sURL ); lcl_addURL( rXMLExport, sURL, false ); @@ -687,7 +687,7 @@ void SwXMLTextParagraphExport::_exportTextEmbedded( SvXMLElementExport aElementExport( GetExport(), XML_NAMESPACE_DRAW, XML_IMAGE, false, true ); - if( (rXMLExport.getExportFlags() & EXPORT_EMBEDDED) != 0 ) + if( rXMLExport.getExportFlags() & SvXMLExportFlags::EMBEDDED ) GetExport().AddEmbeddedObjectAsBase64( sURL ); } diff --git a/xmloff/inc/MetaExportComponent.hxx b/xmloff/inc/MetaExportComponent.hxx index 749d414d17ef..95bcf8a1ae7e 100644 --- a/xmloff/inc/MetaExportComponent.hxx +++ b/xmloff/inc/MetaExportComponent.hxx @@ -32,7 +32,7 @@ class XMLMetaExportComponent : public SvXMLExport public: XMLMetaExportComponent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext, - OUString const & implementationName, sal_uInt16 nFlags + OUString const & implementationName, SvXMLExportFlags nFlags ); virtual ~XMLMetaExportComponent(); diff --git a/xmloff/inc/SchXMLExport.hxx b/xmloff/inc/SchXMLExport.hxx index 5ef7645da79e..e9e215912c45 100644 --- a/xmloff/inc/SchXMLExport.hxx +++ b/xmloff/inc/SchXMLExport.hxx @@ -54,7 +54,7 @@ public: SchXMLExport( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext, OUString const & implementationName, - sal_uInt16 nExportFlags = EXPORT_ALL ); + SvXMLExportFlags nExportFlags = SvXMLExportFlags::ALL ); virtual ~SchXMLExport(); rtl::Reference< XMLPropertySetMapper > GetPropertySetMapper() const; diff --git a/xmloff/qa/unit/uxmloff.cxx b/xmloff/qa/unit/uxmloff.cxx index 9ca27fdce217..8b3cb66a010c 100644 --- a/xmloff/qa/unit/uxmloff.cxx +++ b/xmloff/qa/unit/uxmloff.cxx @@ -49,7 +49,7 @@ void Test::setUp() pExport = new SchXMLExport( comphelper::getProcessComponentContext(), "SchXMLExport.Compact", - EXPORT_ALL); + SvXMLExportFlags::ALL); } void Test::tearDown() diff --git a/xmloff/source/chart/PropertyMaps.cxx b/xmloff/source/chart/PropertyMaps.cxx index 6784a4cf68bb..2abcc132a11c 100644 --- a/xmloff/source/chart/PropertyMaps.cxx +++ b/xmloff/source/chart/PropertyMaps.cxx @@ -262,7 +262,7 @@ void XMLChartExportPropertyMapper::ContextFilter( // but also for the OOo XML Flat format (used by binfilter), // because there, the transformation to OOo is done after the // complete export of the chart in OASIS format. - if( mrExport.getExportFlags() & EXPORT_OASIS ) + if( mrExport.getExportFlags() & SvXMLExportFlags::OASIS ) property->mnIndex = -1; break; } diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index 74ea3ba16914..5ab0b165f873 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -3557,7 +3557,7 @@ void SchXMLExportHelper_Impl::exportText( const OUString& rText, bool bConvertTa SchXMLExport::SchXMLExport( const Reference< uno::XComponentContext >& xContext, - OUString const & implementationName, sal_uInt16 nExportFlags ) + OUString const & implementationName, SvXMLExportFlags nExportFlags ) : SvXMLExport( util::MeasureUnit::CM, xContext, implementationName, ::xmloff::token::XML_CHART, nExportFlags ), maAutoStylePool( *this ), @@ -3601,7 +3601,7 @@ void SchXMLExport::_ExportMasterStyles() void SchXMLExport::_ExportAutoStyles() { // there are no styles that require their own autostyles - if( getExportFlags() & EXPORT_CONTENT ) + if( getExportFlags() & SvXMLExportFlags::CONTENT ) { Reference< chart::XChartDocument > xChartDoc( GetModel(), uno::UNO_QUERY ); if( xChartDoc.is()) @@ -3759,7 +3759,7 @@ Reference< uno::XInterface > SAL_CALL SchXMLExport_createInstance(const Referenc { // #110680# // #103997# removed some flags from EXPORT_ALL - return (cppu::OWeakObject*)new SchXMLExport( comphelper::getComponentContext(rSMgr), SchXMLExport_getImplementationName(), EXPORT_ALL ^ ( EXPORT_SETTINGS | EXPORT_MASTERSTYLES | EXPORT_SCRIPTS )); + return (cppu::OWeakObject*)new SchXMLExport( comphelper::getComponentContext(rSMgr), SchXMLExport_getImplementationName(), SvXMLExportFlags::ALL ^ ( SvXMLExportFlags::SETTINGS | SvXMLExportFlags::MASTERSTYLES | SvXMLExportFlags::SCRIPTS )); } // Oasis format @@ -3780,7 +3780,7 @@ Reference< uno::XInterface > SAL_CALL SchXMLExport_Oasis_createInstance(const Re // #103997# removed some flags from EXPORT_ALL return (cppu::OWeakObject*)new SchXMLExport( comphelper::getComponentContext(rSMgr), SchXMLExport_Oasis_getImplementationName(), - (EXPORT_ALL ^ ( EXPORT_SETTINGS | EXPORT_MASTERSTYLES | EXPORT_SCRIPTS )) | EXPORT_OASIS ); + (SvXMLExportFlags::ALL ^ ( SvXMLExportFlags::SETTINGS | SvXMLExportFlags::MASTERSTYLES | SvXMLExportFlags::SCRIPTS )) | SvXMLExportFlags::OASIS ); } // multiple storage version: one for content / styles / meta @@ -3800,7 +3800,7 @@ OUString SAL_CALL SchXMLExport_Styles_getImplementationName() throw() Reference< uno::XInterface > SAL_CALL SchXMLExport_Styles_createInstance(const Reference< lang::XMultiServiceFactory >& rSMgr) throw( uno::Exception ) { // #110680# - return (cppu::OWeakObject*)new SchXMLExport( comphelper::getComponentContext(rSMgr), SchXMLExport_Styles_getImplementationName(), EXPORT_STYLES ); + return (cppu::OWeakObject*)new SchXMLExport( comphelper::getComponentContext(rSMgr), SchXMLExport_Styles_getImplementationName(), SvXMLExportFlags::STYLES ); } // Oasis format @@ -3818,7 +3818,7 @@ OUString SAL_CALL SchXMLExport_Oasis_Styles_getImplementationName() throw() Reference< uno::XInterface > SAL_CALL SchXMLExport_Oasis_Styles_createInstance(const Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception ) { - return (cppu::OWeakObject*)new SchXMLExport( comphelper::getComponentContext(rSMgr), SchXMLExport_Oasis_Styles_getImplementationName(), EXPORT_STYLES | EXPORT_OASIS ); + return (cppu::OWeakObject*)new SchXMLExport( comphelper::getComponentContext(rSMgr), SchXMLExport_Oasis_Styles_getImplementationName(), SvXMLExportFlags::STYLES | SvXMLExportFlags::OASIS ); } Sequence< OUString > SAL_CALL SchXMLExport_Content_getSupportedServiceNames() throw() @@ -3836,7 +3836,7 @@ OUString SAL_CALL SchXMLExport_Content_getImplementationName() throw() Reference< uno::XInterface > SAL_CALL SchXMLExport_Content_createInstance(const Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception ) { // #110680# - return (cppu::OWeakObject*)new SchXMLExport( comphelper::getComponentContext(rSMgr), SchXMLExport_Content_getImplementationName(), EXPORT_AUTOSTYLES | EXPORT_CONTENT | EXPORT_FONTDECLS ); + return (cppu::OWeakObject*)new SchXMLExport( comphelper::getComponentContext(rSMgr), SchXMLExport_Content_getImplementationName(), SvXMLExportFlags::AUTOSTYLES | SvXMLExportFlags::CONTENT | SvXMLExportFlags::FONTDECLS ); } // Oasis format @@ -3854,7 +3854,7 @@ OUString SAL_CALL SchXMLExport_Oasis_Content_getImplementationName() throw() Reference< uno::XInterface > SAL_CALL SchXMLExport_Oasis_Content_createInstance(const Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception ) { - return (cppu::OWeakObject*)new SchXMLExport( comphelper::getComponentContext(rSMgr), SchXMLExport_Oasis_Content_getImplementationName(), EXPORT_AUTOSTYLES | EXPORT_CONTENT | EXPORT_FONTDECLS | EXPORT_OASIS ); + return (cppu::OWeakObject*)new SchXMLExport( comphelper::getComponentContext(rSMgr), SchXMLExport_Oasis_Content_getImplementationName(), SvXMLExportFlags::AUTOSTYLES | SvXMLExportFlags::CONTENT | SvXMLExportFlags::FONTDECLS | SvXMLExportFlags::OASIS ); } // Oasis format @@ -3872,7 +3872,7 @@ OUString SAL_CALL SchXMLExport_Oasis_Meta_getImplementationName() throw() Reference< uno::XInterface > SAL_CALL SchXMLExport_Oasis_Meta_createInstance(const Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception ) { - return (cppu::OWeakObject*)new SchXMLExport( comphelper::getComponentContext(rSMgr), SchXMLExport_Oasis_Meta_getImplementationName(), EXPORT_META | EXPORT_OASIS ); + return (cppu::OWeakObject*)new SchXMLExport( comphelper::getComponentContext(rSMgr), SchXMLExport_Oasis_Meta_getImplementationName(), SvXMLExportFlags::META | SvXMLExportFlags::OASIS ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 3de55bf763e7..b37878466a88 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -308,36 +308,36 @@ void SvXMLExport::SetDocHandler( const uno::Reference< xml::sax::XDocumentHandle void SvXMLExport::_InitCtor() { // note: it is not necessary to add XML_NP_XML (it is declared implicitly) - if( (getExportFlags() & ~EXPORT_OASIS) != 0 ) + if( getExportFlags() & ~SvXMLExportFlags::OASIS ) { mpNamespaceMap->Add( GetXMLToken(XML_NP_OFFICE), GetXMLToken(XML_N_OFFICE), XML_NAMESPACE_OFFICE ); mpNamespaceMap->Add( GetXMLToken(XML_NP_OOO), GetXMLToken(XML_N_OOO), XML_NAMESPACE_OOO ); } - if( (getExportFlags() & (EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_FONTDECLS) ) != 0 ) + if( getExportFlags() & (SvXMLExportFlags::STYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::FONTDECLS) ) { mpNamespaceMap->Add( GetXMLToken(XML_NP_FO), GetXMLToken(XML_N_FO_COMPAT), XML_NAMESPACE_FO ); } - if( (getExportFlags() & (EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS) ) != 0 ) + if( getExportFlags() & (SvXMLExportFlags::META|SvXMLExportFlags::STYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::SCRIPTS|SvXMLExportFlags::SETTINGS) ) { mpNamespaceMap->Add( GetXMLToken(XML_NP_XLINK), GetXMLToken(XML_N_XLINK), XML_NAMESPACE_XLINK ); } - if( (getExportFlags() & EXPORT_SETTINGS) != 0 ) + if( getExportFlags() & SvXMLExportFlags::SETTINGS ) { mpNamespaceMap->Add( GetXMLToken(XML_NP_CONFIG), GetXMLToken(XML_N_CONFIG), XML_NAMESPACE_CONFIG ); } - if( (getExportFlags() & (EXPORT_META|EXPORT_MASTERSTYLES|EXPORT_CONTENT) ) != 0 ) + if( getExportFlags() & (SvXMLExportFlags::META|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT) ) { mpNamespaceMap->Add( GetXMLToken(XML_NP_DC), GetXMLToken(XML_N_DC), XML_NAMESPACE_DC ); mpNamespaceMap->Add( GetXMLToken(XML_NP_META), GetXMLToken(XML_N_META), XML_NAMESPACE_META ); } - if( (getExportFlags() & (EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_FONTDECLS) ) != 0 ) + if( getExportFlags() & (SvXMLExportFlags::STYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::FONTDECLS) ) { mpNamespaceMap->Add( GetXMLToken(XML_NP_STYLE), GetXMLToken(XML_N_STYLE), XML_NAMESPACE_STYLE ); } // namespaces for documents - if( (getExportFlags() & (EXPORT_STYLES|EXPORT_AUTOSTYLES|EXPORT_MASTERSTYLES|EXPORT_CONTENT) ) != 0 ) + if( getExportFlags() & (SvXMLExportFlags::STYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT) ) { mpNamespaceMap->Add( GetXMLToken(XML_NP_DC), GetXMLToken(XML_N_DC), XML_NAMESPACE_DC ); mpNamespaceMap->Add( GetXMLToken(XML_NP_TEXT), GetXMLToken(XML_N_TEXT), XML_NAMESPACE_TEXT ); @@ -365,17 +365,17 @@ void SvXMLExport::_InitCtor() XML_NAMESPACE_LO_EXT); } } - if( (getExportFlags() & (EXPORT_MASTERSTYLES|EXPORT_CONTENT) ) != 0 ) + if( getExportFlags() & (SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT) ) { mpNamespaceMap->Add( GetXMLToken(XML_NP_MATH), GetXMLToken(XML_N_MATH), XML_NAMESPACE_MATH ); mpNamespaceMap->Add( GetXMLToken(XML_NP_FORM), GetXMLToken(XML_N_FORM), XML_NAMESPACE_FORM ); } - if( (getExportFlags() & (EXPORT_STYLES|EXPORT_AUTOSTYLES|EXPORT_MASTERSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS) ) != 0 ) + if( getExportFlags() & (SvXMLExportFlags::STYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::SCRIPTS) ) { mpNamespaceMap->Add( GetXMLToken(XML_NP_SCRIPT), GetXMLToken(XML_N_SCRIPT), XML_NAMESPACE_SCRIPT ); mpNamespaceMap->Add( GetXMLToken(XML_NP_DOM), GetXMLToken(XML_N_DOM), XML_NAMESPACE_DOM ); } - if( (getExportFlags() & EXPORT_CONTENT ) != 0 ) + if( getExportFlags() & SvXMLExportFlags::CONTENT ) { mpNamespaceMap->Add( GetXMLToken(XML_NP_XFORMS_1_0), GetXMLToken(XML_N_XFORMS_1_0), XML_NAMESPACE_XFORMS ); mpNamespaceMap->Add( GetXMLToken(XML_NP_XSD), GetXMLToken(XML_N_XSD), XML_NAMESPACE_XSD ); @@ -384,19 +384,19 @@ void SvXMLExport::_InitCtor() mpNamespaceMap->Add( GetXMLToken(XML_NP_FORMX), GetXMLToken(XML_N_FORMX), XML_NAMESPACE_FORMX ); } // RDFa: needed for content and header/footer styles - if( (getExportFlags() & (EXPORT_STYLES|EXPORT_AUTOSTYLES|EXPORT_MASTERSTYLES|EXPORT_CONTENT) ) != 0 ) + if( getExportFlags() & (SvXMLExportFlags::STYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT) ) { mpNamespaceMap->Add( GetXMLToken(XML_NP_XHTML), GetXMLToken(XML_N_XHTML), XML_NAMESPACE_XHTML ); } // GRDDL: to convert RDFa and meta.xml to RDF - if( (getExportFlags() & (EXPORT_META|EXPORT_STYLES|EXPORT_AUTOSTYLES|EXPORT_MASTERSTYLES|EXPORT_CONTENT) ) != 0 ) + if( getExportFlags() & (SvXMLExportFlags::META|SvXMLExportFlags::STYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT) ) { mpNamespaceMap->Add( GetXMLToken(XML_NP_GRDDL), GetXMLToken(XML_N_GRDDL), XML_NAMESPACE_GRDDL ); } // CSS Text Level 3 for distributed text justification. - if ( (getExportFlags() & (EXPORT_STYLES|EXPORT_AUTOSTYLES|EXPORT_MASTERSTYLES)) != 0 ) + if ( getExportFlags() & (SvXMLExportFlags::STYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::MASTERSTYLES) ) { mpNamespaceMap->Add( GetXMLToken(XML_NP_CSS3TEXT), GetXMLToken(XML_N_CSS3TEXT), XML_NAMESPACE_CSS3TEXT ); @@ -417,7 +417,7 @@ void SvXMLExport::_InitCtor() _DetermineModelType(); // cl: but only if we do export to current oasis format, old openoffice format *must* always be compatible - if( (getExportFlags() & EXPORT_OASIS) != 0 ) + if( getExportFlags() & SvXMLExportFlags::OASIS ) { mpImpl->mbSaveBackwardCompatibleODF = officecfg::Office::Common::Save::Document:: @@ -440,7 +440,7 @@ SvXMLExport::SvXMLExport( sal_Int16 const eDefaultMeasureUnit /*css::util::MeasureUnit*/, const uno::Reference< uno::XComponentContext >& xContext, OUString const & implementationName, - const enum XMLTokenEnum eClass, sal_uInt16 nExportFlags ) + const enum XMLTokenEnum eClass, SvXMLExportFlags nExportFlags ) : mpImpl( new SvXMLExport_Impl ), m_xContext(xContext), m_implementationName(implementationName), mpAttrList( new SvXMLAttributeList ), @@ -485,7 +485,7 @@ SvXMLExport::SvXMLExport( mpXMLErrors( NULL ), mbExtended( false ), meClass( XML_TOKEN_INVALID ), - mnExportFlags( 0 ), + mnExportFlags( SvXMLExportFlags::NONE ), mnErrorFlags( ERROR_NO ), msWS( GetXMLToken(XML_WS) ), mbSaveLinkedSections(true) @@ -524,7 +524,7 @@ SvXMLExport::SvXMLExport( mpXMLErrors( NULL ), mbExtended( false ), meClass( XML_TOKEN_INVALID ), - mnExportFlags( 0 ), + mnExportFlags( SvXMLExportFlags::NONE ), mnErrorFlags( ERROR_NO ), msWS( GetXMLToken(XML_WS) ), mbSaveLinkedSections(true) @@ -570,7 +570,7 @@ SvXMLExport::~SvXMLExport() if (xPropertySetInfo->hasPropertyByName(sRepeat)) mxExportInfo->setPropertyValue(sRepeat, css::uno::makeAny(mpProgressBarHelper->GetRepeat())); } - if (mpNumExport && (mnExportFlags & (EXPORT_AUTOSTYLES | EXPORT_STYLES))) + if (mpNumExport && (mnExportFlags & (SvXMLExportFlags::AUTOSTYLES | SvXMLExportFlags::STYLES))) { OUString sWrittenNumberFormats(XML_WRITTENNUMBERSTYLES); if (xPropertySetInfo->hasPropertyByName(sWrittenNumberFormats)) @@ -623,12 +623,12 @@ void SAL_CALL SvXMLExport::setSourceDocument( const uno::Reference< lang::XCompo { uno::Any aAny = mxExportInfo->getPropertyValue(sUsePrettyPrinting); if (::cppu::any2bool(aAny)) - mnExportFlags |= EXPORT_PRETTY; + mnExportFlags |= SvXMLExportFlags::PRETTY; else - mnExportFlags &= ~EXPORT_PRETTY; + mnExportFlags &= ~SvXMLExportFlags::PRETTY; } - if (mpNumExport && (mnExportFlags & (EXPORT_AUTOSTYLES | EXPORT_STYLES))) + if (mpNumExport && (mnExportFlags & (SvXMLExportFlags::AUTOSTYLES | SvXMLExportFlags::STYLES))) { OUString sWrittenNumberFormats(XML_WRITTENNUMBERSTYLES); if (xPropertySetInfo->hasPropertyByName(sWrittenNumberFormats)) @@ -643,9 +643,9 @@ void SAL_CALL SvXMLExport::setSourceDocument( const uno::Reference< lang::XCompo } if ( mpImpl->mbSaveBackwardCompatibleODF ) - mnExportFlags |= EXPORT_SAVEBACKWARDCOMPATIBLE; + mnExportFlags |= SvXMLExportFlags::SAVEBACKWARDCOMPATIBLE; else - mnExportFlags &= ~EXPORT_SAVEBACKWARDCOMPATIBLE; + mnExportFlags &= ~SvXMLExportFlags::SAVEBACKWARDCOMPATIBLE; // namespaces for user defined attributes Reference< XMultiServiceFactory > xFactory( mxModel, UNO_QUERY ); @@ -806,8 +806,8 @@ sal_Bool SAL_CALL SvXMLExport::filter( const uno::Sequence< beans::PropertyValue { const sal_Int32 nPropCount = aDescriptor.getLength(); - const sal_uInt32 nTest = - EXPORT_META|EXPORT_STYLES|EXPORT_CONTENT|EXPORT_SETTINGS; + const SvXMLExportFlags nTest = + SvXMLExportFlags::META|SvXMLExportFlags::STYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::SETTINGS; if( (mnExportFlags & nTest) == nTest && msOrigFileName.isEmpty() ) { // evaluate descriptor only for flat files and if a base URI @@ -1202,7 +1202,7 @@ void SvXMLExport::ImplExportStyles( bool ) } // transfer style names (+ families) TO other components (if appropriate) - if( ( ( mnExportFlags & EXPORT_CONTENT ) == 0 ) && mxExportInfo.is() ) + if( ( !( mnExportFlags & SvXMLExportFlags::CONTENT ) ) && mxExportInfo.is() ) { static OUString sStyleNames( "StyleNames" ); static OUString sStyleFamilies( "StyleFamilies" ); @@ -1224,7 +1224,7 @@ void SvXMLExport::ImplExportAutoStyles( bool ) // transfer style names (+ families) FROM other components (if appropriate) OUString sStyleNames( "StyleNames" ); OUString sStyleFamilies( "StyleFamilies" ); - if( ( ( mnExportFlags & EXPORT_STYLES ) == 0 ) + if( ( !( mnExportFlags & SvXMLExportFlags::STYLES ) ) && mxExportInfo.is() && mxExportInfo->getPropertySetInfo()->hasPropertyByName( sStyleNames ) && mxExportInfo->getPropertySetInfo()->hasPropertyByName( sStyleFamilies ) ) @@ -1292,7 +1292,7 @@ void SvXMLExport::SetBodyAttributes() } static void -lcl_AddGrddl(SvXMLExport & rExport, const sal_Int32 /*nExportMode*/) +lcl_AddGrddl(SvXMLExport & rExport, const SvXMLExportFlags /*nExportMode*/) { // check version >= 1.2 switch (rExport.getDefaultVersion()) { @@ -1303,7 +1303,7 @@ lcl_AddGrddl(SvXMLExport & rExport, const sal_Int32 /*nExportMode*/) // #i115030#: disabled, the XSLT is not finished, and not available via HTTP #if 0 - if (EXPORT_SETTINGS != nExportMode) // meta, content, styles + if (SvXMLExportFlags::SETTINGS != nExportMode) // meta, content, styles { rExport.AddAttribute( XML_NAMESPACE_GRDDL, XML_TRANSFORMATION, OUString("http://FIXME") ); @@ -1354,7 +1354,7 @@ sal_uInt32 SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass ) } } } - if( (getExportFlags() & EXPORT_OASIS) == 0 ) + if( (getExportFlags() & SvXMLExportFlags::OASIS) == SvXMLExportFlags::NONE ) { try { @@ -1443,26 +1443,26 @@ sal_uInt32 SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass ) { enum XMLTokenEnum eRootService = XML_TOKEN_INVALID; - const sal_Int32 nExportMode = mnExportFlags & (EXPORT_META|EXPORT_STYLES|EXPORT_CONTENT|EXPORT_SETTINGS); + const SvXMLExportFlags nExportMode = mnExportFlags & (SvXMLExportFlags::META|SvXMLExportFlags::STYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::SETTINGS); lcl_AddGrddl(*this, nExportMode); - if( EXPORT_META == nExportMode ) + if( SvXMLExportFlags::META == nExportMode ) { // export only meta eRootService = XML_DOCUMENT_META; } - else if ( EXPORT_SETTINGS == nExportMode ) + else if ( SvXMLExportFlags::SETTINGS == nExportMode ) { // export only settings eRootService = XML_DOCUMENT_SETTINGS; } - else if( EXPORT_STYLES == nExportMode ) + else if( SvXMLExportFlags::STYLES == nExportMode ) { // export only styles eRootService = XML_DOCUMENT_STYLES; } - else if( EXPORT_CONTENT == nExportMode ) + else if( SvXMLExportFlags::CONTENT == nExportMode ) { // export only content eRootService = XML_DOCUMENT_CONTENT; @@ -1483,35 +1483,35 @@ sal_uInt32 SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass ) SvXMLElementExport aElem( *this, XML_NAMESPACE_OFFICE, eRootService, true, true ); // meta information - if( mnExportFlags & EXPORT_META ) + if( mnExportFlags & SvXMLExportFlags::META ) ImplExportMeta(); // settings - if( mnExportFlags & EXPORT_SETTINGS ) + if( mnExportFlags & SvXMLExportFlags::SETTINGS ) ImplExportSettings(); // scripts - if( mnExportFlags & EXPORT_SCRIPTS ) + if( mnExportFlags & SvXMLExportFlags::SCRIPTS ) _ExportScripts(); // font declerations - if( mnExportFlags & EXPORT_FONTDECLS ) + if( mnExportFlags & SvXMLExportFlags::FONTDECLS ) _ExportFontDecls(); // styles - if( mnExportFlags & EXPORT_STYLES ) + if( mnExportFlags & SvXMLExportFlags::STYLES ) ImplExportStyles( false ); // autostyles - if( mnExportFlags & EXPORT_AUTOSTYLES ) + if( mnExportFlags & SvXMLExportFlags::AUTOSTYLES ) ImplExportAutoStyles( false ); // masterstyles - if( mnExportFlags & EXPORT_MASTERSTYLES ) + if( mnExportFlags & SvXMLExportFlags::MASTERSTYLES ) ImplExportMasterStyles( false ); // contnt - if( mnExportFlags & EXPORT_CONTENT ) + if( mnExportFlags & SvXMLExportFlags::CONTENT ) ImplExportContent(); } @@ -1580,7 +1580,7 @@ void SvXMLExport::_ExportScripts() SvXMLElementExport aElement( *this, XML_NAMESPACE_OFFICE, XML_SCRIPTS, true, true ); // export Basic macros (only for FlatXML) - if ( mnExportFlags & EXPORT_EMBEDDED ) + if ( mnExportFlags & SvXMLExportFlags::EMBEDDED ) { OUString aValue( GetNamespaceMap().GetPrefixByKey( XML_NAMESPACE_OOO ) ); aValue += ":Basic"; @@ -1955,7 +1955,7 @@ OUString SvXMLExport::AddEmbeddedGraphicObject( const OUString& rGraphicObjectUR if( rGraphicObjectURL.startsWith( msGraphicObjectProtocol ) && mxGraphicResolver.is() ) { - if( (getExportFlags() & EXPORT_EMBEDDED) == 0 ) + if( !(getExportFlags() & SvXMLExportFlags::EMBEDDED) ) sRet = mxGraphicResolver->resolveGraphicObjectURL( rGraphicObjectURL ); else sRet.clear(); @@ -1970,7 +1970,7 @@ bool SvXMLExport::AddEmbeddedGraphicObjectAsBase64( const OUString& rGraphicObje { bool bRet = false; - if( (getExportFlags() & EXPORT_EMBEDDED) != 0 && + if( (getExportFlags() & SvXMLExportFlags::EMBEDDED) && rGraphicObjectURL.startsWith( msGraphicObjectProtocol ) && mxGraphicResolver.is() ) { @@ -2252,7 +2252,7 @@ void SvXMLExport::StartElement(const OUString& rName, { try { - if( bIgnWSOutside && ((mnExportFlags & EXPORT_PRETTY) == EXPORT_PRETTY)) + if( bIgnWSOutside && ((mnExportFlags & SvXMLExportFlags::PRETTY) == SvXMLExportFlags::PRETTY)) mxHandler->ignorableWhitespace( msWS ); mxHandler->startElement( rName, GetXAttrList() ); } @@ -2325,7 +2325,7 @@ void SvXMLExport::EndElement(const OUString& rName, { try { - if( bIgnWSInside && ((mnExportFlags & EXPORT_PRETTY) == EXPORT_PRETTY)) + if( bIgnWSInside && ((mnExportFlags & SvXMLExportFlags::PRETTY) == SvXMLExportFlags::PRETTY)) mxHandler->ignorableWhitespace( msWS ); mxHandler->endElement( rName ); } @@ -2341,7 +2341,7 @@ void SvXMLExport::EndElement(const OUString& rName, void SvXMLExport::IgnorableWhitespace() { - if ((mnExportFlags & EXPORT_PRETTY) != EXPORT_PRETTY) + if ((mnExportFlags & SvXMLExportFlags::PRETTY) != SvXMLExportFlags::PRETTY) return; if ((mnErrorFlags & ERROR_DO_NOTHING) != ERROR_DO_NOTHING) diff --git a/xmloff/source/draw/animationexport.cxx b/xmloff/source/draw/animationexport.cxx index 11ed567aa65a..b1e3ae7573fc 100644 --- a/xmloff/source/draw/animationexport.cxx +++ b/xmloff/source/draw/animationexport.cxx @@ -1049,7 +1049,7 @@ void AnimationsExporterImpl::exportContainer( const Reference< XTimeContainer >& double fTemp = xIter->getIterateInterval(); if( fTemp ) { - if( 0 == ( mrExport.getExportFlags() & EXPORT_SAVEBACKWARDCOMPATIBLE ) ) + if( !( mrExport.getExportFlags() & SvXMLExportFlags::SAVEBACKWARDCOMPATIBLE ) ) { // issue 146582 OUStringBuffer buf; diff --git a/xmloff/source/draw/sdpropls.cxx b/xmloff/source/draw/sdpropls.cxx index 04d579811750..009c2ec67c16 100644 --- a/xmloff/source/draw/sdpropls.cxx +++ b/xmloff/source/draw/sdpropls.cxx @@ -1605,12 +1605,12 @@ void XMLPageExportPropertyMapper::ContextFilter( pTransType = property; break; case CTF_PAGE_TRANS_STYLE: - if( mrExport.getExportFlags() & EXPORT_OASIS ) + if( mrExport.getExportFlags() & SvXMLExportFlags::OASIS ) (*property).mnIndex = -1; break; case CTF_PAGE_TRANSITION_TYPE: { - if( ((mrExport.getExportFlags() & EXPORT_OASIS) == 0) || + if( (!(mrExport.getExportFlags() & SvXMLExportFlags::OASIS)) || (((*property).maValue >>= nTransitionType) && (nTransitionType == 0)) ) (*property).mnIndex = -1; } @@ -1618,7 +1618,7 @@ void XMLPageExportPropertyMapper::ContextFilter( case CTF_PAGE_TRANSITION_SUBTYPE: { sal_Int16 nTransitionSubtype = sal_Int16(); - if( ((mrExport.getExportFlags() & EXPORT_OASIS) == 0) || + if( (!(mrExport.getExportFlags() & SvXMLExportFlags::OASIS)) || (((*property).maValue >>= nTransitionSubtype) && (nTransitionSubtype == 0)) ) (*property).mnIndex = -1; @@ -1627,13 +1627,13 @@ void XMLPageExportPropertyMapper::ContextFilter( case CTF_PAGE_TRANSITION_DIRECTION: { bool bDirection; - if( ((mrExport.getExportFlags() & EXPORT_OASIS) == 0) || + if( (!(mrExport.getExportFlags() & SvXMLExportFlags::OASIS)) || (((*property).maValue >>= bDirection) && bDirection) ) (*property).mnIndex = -1; } break; case CTF_PAGE_TRANSITION_FADECOLOR: - if( ((mrExport.getExportFlags() & EXPORT_OASIS) == 0) ) + if( (!(mrExport.getExportFlags() & SvXMLExportFlags::OASIS)) ) (*property).mnIndex = -1; else pTransitionFadeColor = property; diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx index 142f1e68a845..723542bc48ec 100644 --- a/xmloff/source/draw/sdxmlexp.cxx +++ b/xmloff/source/draw/sdxmlexp.cxx @@ -393,7 +393,7 @@ ImpXMLAutoLayoutInfo::ImpXMLAutoLayoutInfo(sal_uInt16 nTyp, ImpXMLEXPPageMasterI SdXMLExport::SdXMLExport( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext, OUString const & implementationName, - bool bIsDraw, sal_uInt16 nExportFlags ) + bool bIsDraw, SvXMLExportFlags nExportFlags ) : SvXMLExport( util::MeasureUnit::CM, xContext, implementationName, (bIsDraw) ? XML_GRAPHICS : XML_PRESENTATION, nExportFlags ), mnDocMasterPageCount(0L), @@ -1867,7 +1867,7 @@ void SdXMLExport::_ExportContent() // prepare animation export if(IsImpress()) { - if( getExportFlags() & EXPORT_OASIS ) + if( getExportFlags() & SvXMLExportFlags::OASIS ) { // export new animations for oasis format xAnimNodeSupplier.set( xDrawPage, UNO_QUERY ); @@ -2196,7 +2196,7 @@ void SdXMLExport::_ExportAutoStyles() GetPropertySetMapper()->SetAutoStyles( true ); - if( getExportFlags() & EXPORT_STYLES ) + if( getExportFlags() & SvXMLExportFlags::STYLES ) { // #80012# PageMaster export moved from _ExportStyles // prepare page-master infos @@ -2209,7 +2209,7 @@ void SdXMLExport::_ExportAutoStyles() ImpPrepMasterPageInfos(); } - if( getExportFlags() & EXPORT_CONTENT ) + if( getExportFlags() & SvXMLExportFlags::CONTENT ) { // prepare draw:style-name for page export ImpPrepDrawPageInfos(); @@ -2223,7 +2223,7 @@ void SdXMLExport::_ExportAutoStyles() GetNamespaceMap() ); - if( getExportFlags() & EXPORT_STYLES ) + if( getExportFlags() & SvXMLExportFlags::STYLES ) { // create auto style infos for shapes on master handout page if( IsImpress() ) @@ -2290,10 +2290,10 @@ void SdXMLExport::_ExportAutoStyles() } } - if( getExportFlags() & EXPORT_CONTENT ) + if( getExportFlags() & SvXMLExportFlags::CONTENT ) { // prepare animations exporter if impress - if(IsImpress() && ((getExportFlags() & EXPORT_OASIS) == 0) ) + if(IsImpress() && (!(getExportFlags() & SvXMLExportFlags::OASIS)) ) { rtl::Reference< XMLAnimationsExporter > xAnimExport = new XMLAnimationsExporter( GetShapeExport().get() ); GetShapeExport()->setAnimationsExporter( xAnimExport ); @@ -2368,7 +2368,7 @@ void SdXMLExport::_ExportAutoStyles() GetShapeExport()->exportAutoStyles(); - sal_uInt16 nContentAutostyles = EXPORT_CONTENT | EXPORT_AUTOSTYLES; + SvXMLExportFlags nContentAutostyles = SvXMLExportFlags::CONTENT | SvXMLExportFlags::AUTOSTYLES; if ( ( getExportFlags() & nContentAutostyles ) == nContentAutostyles ) GetFormExport()->exportAutoStyles( ); @@ -2757,37 +2757,37 @@ uno::Reference< uno::XInterface > SAL_CALL classname##_createInstance(const uno: return (cppu::OWeakObject*)new SdXMLExport( comphelper::getComponentContext(rSMgr), implementationname, draw, flags ); \ } -SERVICE( XMLImpressExportOasis, "com.sun.star.comp.Impress.XMLOasisExporter", "XMLImpressExportOasis", false, EXPORT_OASIS|EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS|EXPORT_FONTDECLS|EXPORT_EMBEDDED ); -SERVICE( XMLImpressStylesExportOasis, "com.sun.star.comp.Impress.XMLOasisStylesExporter", "XMLImpressStylesExportOasis", false, EXPORT_OASIS|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_FONTDECLS ); -SERVICE( XMLImpressContentExportOasis, "com.sun.star.comp.Impress.XMLOasisContentExporter", "XMLImpressContentExportOasis", false, EXPORT_OASIS|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS ); -SERVICE( XMLImpressMetaExportOasis, "com.sun.star.comp.Impress.XMLOasisMetaExporter", "XMLImpressMetaExportOasis", false, EXPORT_OASIS|EXPORT_META ); -SERVICE( XMLImpressSettingsExportOasis, "com.sun.star.comp.Impress.XMLOasisSettingsExporter", "XMLImpressSettingsExportOasis", false, EXPORT_OASIS|EXPORT_SETTINGS ); - -SERVICE( XMLImpressExportOOO, "com.sun.star.comp.Impress.XMLExporter", "XMLImpressExportOOO", false, EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS|EXPORT_FONTDECLS|EXPORT_EMBEDDED ); -SERVICE( XMLImpressStylesExportOOO, "com.sun.star.comp.Impress.XMLStylesExporter", "XMLImpressStylesExportOOO", false, EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_FONTDECLS ); -SERVICE( XMLImpressContentExportOOO, "com.sun.star.comp.Impress.XMLContentExporter", "XMLImpressContentExportOOO", false, EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS ); -SERVICE( XMLImpressMetaExportOOO, "com.sun.star.comp.Impress.XMLMetaExporter", "XMLImpressMetaExportOOO", false, EXPORT_META ); -SERVICE( XMLImpressSettingsExportOOO, "com.sun.star.comp.Impress.XMLSettingsExporter", "XMLImpressSettingsExportOOO", false, EXPORT_SETTINGS ); - -SERVICE( XMLDrawExportOasis, "com.sun.star.comp.Draw.XMLOasisExporter", "XMLDrawExportOasis", true, EXPORT_OASIS|EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS|EXPORT_FONTDECLS|EXPORT_EMBEDDED ); -SERVICE( XMLDrawStylesExportOasis, "com.sun.star.comp.Draw.XMLOasisStylesExporter", "XMLDrawStylesExportOasis", true, EXPORT_OASIS|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_FONTDECLS ); -SERVICE( XMLDrawContentExportOasis, "com.sun.star.comp.Draw.XMLOasisContentExporter", "XMLDrawContentExportOasis", true, EXPORT_OASIS|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS ); -SERVICE( XMLDrawMetaExportOasis, "com.sun.star.comp.Draw.XMLOasisMetaExporter", "XMLDrawMetaExportOasis", true, EXPORT_OASIS|EXPORT_META ); -SERVICE( XMLDrawSettingsExportOasis, "com.sun.star.comp.Draw.XMLOasisSettingsExporter", "XMLDrawSettingsExportOasis", true, EXPORT_OASIS|EXPORT_SETTINGS ); - -SERVICE( XMLDrawExportOOO, "com.sun.star.comp.Draw.XMLExporter", "XMLDrawExportOOO", true, EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS|EXPORT_FONTDECLS|EXPORT_EMBEDDED ); -SERVICE( XMLDrawStylesExportOOO, "com.sun.star.comp.Draw.XMLStylesExporter", "XMLDrawStylesExportOOO", true, EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_FONTDECLS ); -SERVICE( XMLDrawContentExportOOO, "com.sun.star.comp.Draw.XMLContentExporter", "XMLDrawContentExportOOO", true, EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS ); -SERVICE( XMLDrawMetaExportOOO, "com.sun.star.comp.Draw.XMLMetaExporter", "XMLDrawMetaExportOOO", true, EXPORT_META ); -SERVICE( XMLDrawSettingsExportOOO, "com.sun.star.comp.Draw.XMLSettingsExporter", "XMLDrawSettingsExportOOO", true, EXPORT_SETTINGS ); - -SERVICE( XMLDrawingLayerExport, "com.sun.star.comp.DrawingLayer.XMLExporter", "XMLDrawingLayerExport", true, EXPORT_OASIS|EXPORT_STYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_FONTDECLS|EXPORT_EMBEDDED ); -SERVICE( XMLImpressClipboardExport, "com.sun.star.comp.Impress.XMLClipboardExporter", "XMLImpressClipboardExport", false, EXPORT_OASIS|EXPORT_STYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_FONTDECLS|EXPORT_EMBEDDED ); +SERVICE( XMLImpressExportOasis, "com.sun.star.comp.Impress.XMLOasisExporter", "XMLImpressExportOasis", false, SvXMLExportFlags::OASIS|SvXMLExportFlags::META|SvXMLExportFlags::STYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::SCRIPTS|SvXMLExportFlags::SETTINGS|SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::EMBEDDED ); +SERVICE( XMLImpressStylesExportOasis, "com.sun.star.comp.Impress.XMLOasisStylesExporter", "XMLImpressStylesExportOasis", false, SvXMLExportFlags::OASIS|SvXMLExportFlags::STYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::FONTDECLS ); +SERVICE( XMLImpressContentExportOasis, "com.sun.star.comp.Impress.XMLOasisContentExporter", "XMLImpressContentExportOasis", false, SvXMLExportFlags::OASIS|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::SCRIPTS|SvXMLExportFlags::FONTDECLS ); +SERVICE( XMLImpressMetaExportOasis, "com.sun.star.comp.Impress.XMLOasisMetaExporter", "XMLImpressMetaExportOasis", false, SvXMLExportFlags::OASIS|SvXMLExportFlags::META ); +SERVICE( XMLImpressSettingsExportOasis, "com.sun.star.comp.Impress.XMLOasisSettingsExporter", "XMLImpressSettingsExportOasis", false, SvXMLExportFlags::OASIS|SvXMLExportFlags::SETTINGS ); + +SERVICE( XMLImpressExportOOO, "com.sun.star.comp.Impress.XMLExporter", "XMLImpressExportOOO", false, SvXMLExportFlags::META|SvXMLExportFlags::STYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::SCRIPTS|SvXMLExportFlags::SETTINGS|SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::EMBEDDED ); +SERVICE( XMLImpressStylesExportOOO, "com.sun.star.comp.Impress.XMLStylesExporter", "XMLImpressStylesExportOOO", false, SvXMLExportFlags::STYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::FONTDECLS ); +SERVICE( XMLImpressContentExportOOO, "com.sun.star.comp.Impress.XMLContentExporter", "XMLImpressContentExportOOO", false, SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::SCRIPTS|SvXMLExportFlags::FONTDECLS ); +SERVICE( XMLImpressMetaExportOOO, "com.sun.star.comp.Impress.XMLMetaExporter", "XMLImpressMetaExportOOO", false, SvXMLExportFlags::META ); +SERVICE( XMLImpressSettingsExportOOO, "com.sun.star.comp.Impress.XMLSettingsExporter", "XMLImpressSettingsExportOOO", false, SvXMLExportFlags::SETTINGS ); + +SERVICE( XMLDrawExportOasis, "com.sun.star.comp.Draw.XMLOasisExporter", "XMLDrawExportOasis", true, SvXMLExportFlags::OASIS|SvXMLExportFlags::META|SvXMLExportFlags::STYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::SCRIPTS|SvXMLExportFlags::SETTINGS|SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::EMBEDDED ); +SERVICE( XMLDrawStylesExportOasis, "com.sun.star.comp.Draw.XMLOasisStylesExporter", "XMLDrawStylesExportOasis", true, SvXMLExportFlags::OASIS|SvXMLExportFlags::STYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::FONTDECLS ); +SERVICE( XMLDrawContentExportOasis, "com.sun.star.comp.Draw.XMLOasisContentExporter", "XMLDrawContentExportOasis", true, SvXMLExportFlags::OASIS|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::SCRIPTS|SvXMLExportFlags::FONTDECLS ); +SERVICE( XMLDrawMetaExportOasis, "com.sun.star.comp.Draw.XMLOasisMetaExporter", "XMLDrawMetaExportOasis", true, SvXMLExportFlags::OASIS|SvXMLExportFlags::META ); +SERVICE( XMLDrawSettingsExportOasis, "com.sun.star.comp.Draw.XMLOasisSettingsExporter", "XMLDrawSettingsExportOasis", true, SvXMLExportFlags::OASIS|SvXMLExportFlags::SETTINGS ); + +SERVICE( XMLDrawExportOOO, "com.sun.star.comp.Draw.XMLExporter", "XMLDrawExportOOO", true, SvXMLExportFlags::META|SvXMLExportFlags::STYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::SCRIPTS|SvXMLExportFlags::SETTINGS|SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::EMBEDDED ); +SERVICE( XMLDrawStylesExportOOO, "com.sun.star.comp.Draw.XMLStylesExporter", "XMLDrawStylesExportOOO", true, SvXMLExportFlags::STYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::FONTDECLS ); +SERVICE( XMLDrawContentExportOOO, "com.sun.star.comp.Draw.XMLContentExporter", "XMLDrawContentExportOOO", true, SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::SCRIPTS|SvXMLExportFlags::FONTDECLS ); +SERVICE( XMLDrawMetaExportOOO, "com.sun.star.comp.Draw.XMLMetaExporter", "XMLDrawMetaExportOOO", true, SvXMLExportFlags::META ); +SERVICE( XMLDrawSettingsExportOOO, "com.sun.star.comp.Draw.XMLSettingsExporter", "XMLDrawSettingsExportOOO", true, SvXMLExportFlags::SETTINGS ); + +SERVICE( XMLDrawingLayerExport, "com.sun.star.comp.DrawingLayer.XMLExporter", "XMLDrawingLayerExport", true, SvXMLExportFlags::OASIS|SvXMLExportFlags::STYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::EMBEDDED ); +SERVICE( XMLImpressClipboardExport, "com.sun.star.comp.Impress.XMLClipboardExporter", "XMLImpressClipboardExport", false, SvXMLExportFlags::OASIS|SvXMLExportFlags::STYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::EMBEDDED ); XMLFontAutoStylePool* SdXMLExport::CreateFontAutoStylePool() { bool bEmbedFonts = false; - if (getExportFlags() & EXPORT_CONTENT) + if (getExportFlags() & SvXMLExportFlags::CONTENT) { Reference< lang::XMultiServiceFactory > xFac( GetModel(), UNO_QUERY ); if( xFac.is() ) diff --git a/xmloff/source/draw/sdxmlexp_impl.hxx b/xmloff/source/draw/sdxmlexp_impl.hxx index 6b7dcd163c96..cff480cb0a8f 100644 --- a/xmloff/source/draw/sdxmlexp_impl.hxx +++ b/xmloff/source/draw/sdxmlexp_impl.hxx @@ -172,7 +172,7 @@ public: SdXMLExport( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext, OUString const & implementationName, - bool bIsDraw, sal_uInt16 nExportFlags = EXPORT_ALL ); + bool bIsDraw, SvXMLExportFlags nExportFlags = SvXMLExportFlags::ALL ); virtual ~SdXMLExport(); void SetProgress(sal_Int32 nProg); diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 4981626aa273..f812badef54b 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -192,7 +192,7 @@ uno::Reference< drawing::XShape > XMLShapeExport::checkForCustomShapeReplacement { uno::Reference< drawing::XShape > xCustomShapeReplacement; - if( ( GetExport().getExportFlags() & EXPORT_OASIS ) == 0 ) + if( !( GetExport().getExportFlags() & SvXMLExportFlags::OASIS ) ) { OUString aType( xShape->getShapeType() ); if( aType == "com.sun.star.drawing.CustomShape" ) @@ -661,7 +661,7 @@ void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape if ( ( GetExport().GetModelType() != SvtModuleOptions::E_WRITER && GetExport().GetModelType() != SvtModuleOptions::E_WRITERWEB && GetExport().GetModelType() != SvtModuleOptions::E_WRITERGLOBAL ) || - ( GetExport().getExportFlags() & EXPORT_OASIS ) != 0 || + !( GetExport().getExportFlags() & SvXMLExportFlags::OASIS ) || aShapeInfo.meShapeType == XmlShapeTypeDrawGroupShape || ( aShapeInfo.meShapeType == XmlShapeTypeDrawCustomShape && aShapeInfo.xCustomShapeReplacement.is() ) ) @@ -1330,7 +1330,7 @@ void XMLShapeExport::ImpExportNewTrans_GetB2DHomMatrix(::basegfx::B2DHomMatrix& the OASIS Open Office file format to the OpenOffice.org file format. (#i28749#) */ uno::Any aAny; - if ( ( GetExport().getExportFlags() & EXPORT_OASIS ) == 0 && + if ( !( GetExport().getExportFlags() & SvXMLExportFlags::OASIS ) && xPropSet->getPropertySetInfo()->hasPropertyByName("TransformationInHoriL2R") ) { aAny = xPropSet->getPropertyValue("TransformationInHoriL2R"); @@ -2262,7 +2262,7 @@ void XMLShapeExport::ImpExportGraphicObjectShape( SvXMLElementExport aElem( mrExport, XML_NAMESPACE_DRAW, XML_FRAME, bCreateNewline, true ); - const bool bSaveBackwardsCompatible = ( mrExport.getExportFlags() & EXPORT_SAVEBACKWARDCOMPATIBLE ); + const bool bSaveBackwardsCompatible = bool( mrExport.getExportFlags() & SvXMLExportFlags::SAVEBACKWARDCOMPATIBLE ); if( !bIsEmptyPresObj || bSaveBackwardsCompatible ) { @@ -2488,7 +2488,7 @@ void XMLShapeExport::ImpExportConnectorShape( direction the shape is in. Thus, this code provides the conversion from the OASIS Open Office file format to the OpenOffice.org file format. (#i36248#) */ - if ( ( GetExport().getExportFlags() & EXPORT_OASIS ) == 0 && + if ( !( GetExport().getExportFlags() & SvXMLExportFlags::OASIS ) && xProps->getPropertySetInfo()->hasPropertyByName("StartPositionInHoriL2R") && xProps->getPropertySetInfo()->hasPropertyByName("EndPositionInHoriL2R") ) { @@ -2660,7 +2660,7 @@ void XMLShapeExport::ImpExportMeasureShape( direction the shape is in. Thus, this code provides the conversion from the OASIS Open Office file format to the OpenOffice.org file format. (#i36248#) */ - if ( ( GetExport().getExportFlags() & EXPORT_OASIS ) == 0 && + if ( !( GetExport().getExportFlags() & SvXMLExportFlags::OASIS ) && xProps->getPropertySetInfo()->hasPropertyByName("StartPositionInHoriL2R") && xProps->getPropertySetInfo()->hasPropertyByName("EndPositionInHoriL2R") ) { @@ -2755,12 +2755,12 @@ void XMLShapeExport::ImpExportOLE2Shape( bIsEmptyPresObj = ImpExportPresentationAttributes( xPropSet, GetXMLToken(XML_PRESENTATION_TABLE) ); bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); // #86116#/#92210# - bool bExportEmbedded(0 != (mrExport.getExportFlags() & EXPORT_EMBEDDED)); + bool bExportEmbedded(mrExport.getExportFlags() & SvXMLExportFlags::EMBEDDED); OUString sPersistName; SvXMLElementExport aElement( mrExport, XML_NAMESPACE_DRAW, XML_FRAME, bCreateNewline, true ); - const bool bSaveBackwardsCompatible = ( mrExport.getExportFlags() & EXPORT_SAVEBACKWARDCOMPATIBLE ); + const bool bSaveBackwardsCompatible = bool( mrExport.getExportFlags() & SvXMLExportFlags::SAVEBACKWARDCOMPATIBLE ); if( !bIsEmptyPresObj || bSaveBackwardsCompatible ) { @@ -2855,7 +2855,7 @@ void XMLShapeExport::ImpExportOLE2Shape( // in case it is not an OASIS format the object should be asked to store replacement image if possible OUString sURLRequest( sURL ); - if ( ( mrExport.getExportFlags() & EXPORT_OASIS ) == 0 ) + if ( !( mrExport.getExportFlags() & SvXMLExportFlags::OASIS ) ) sURLRequest += "?oasis=false"; mrExport.AddEmbeddedObjectAsBase64( sURLRequest ); } @@ -4896,7 +4896,7 @@ void XMLShapeExport::ImpExportTableShape( const uno::Reference< drawing::XShape bIsEmptyPresObj = ImpExportPresentationAttributes( xPropSet, GetXMLToken(XML_PRESENTATION_TABLE) ); const bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); - const bool bExportEmbedded(0 != (mrExport.getExportFlags() & EXPORT_EMBEDDED)); + const bool bExportEmbedded(mrExport.getExportFlags() & SvXMLExportFlags::EMBEDDED); SvXMLElementExport aElement( mrExport, XML_NAMESPACE_DRAW, XML_FRAME, bCreateNewline, true ); diff --git a/xmloff/source/meta/MetaExportComponent.cxx b/xmloff/source/meta/MetaExportComponent.cxx index f4117f84f52e..e67f3ba38671 100644 --- a/xmloff/source/meta/MetaExportComponent.cxx +++ b/xmloff/source/meta/MetaExportComponent.cxx @@ -44,7 +44,7 @@ using namespace ::xmloff::token; XMLMetaExportComponent::XMLMetaExportComponent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext, - OUString const & implementationName, sal_uInt16 nFlags ) + OUString const & implementationName, SvXMLExportFlags nFlags ) : SvXMLExport( util::MeasureUnit::CM, xContext, implementationName, XML_TEXT, nFlags ) { } @@ -74,7 +74,7 @@ sal_uInt32 XMLMetaExportComponent::exportDoc( enum XMLTokenEnum ) { uno::Reference< xml::sax::XDocumentHandler > xDocHandler = GetDocHandler(); - if( (getExportFlags() & EXPORT_OASIS) == 0 ) + if( !(getExportFlags() & SvXMLExportFlags::OASIS) ) { uno::Reference< uno::XComponentContext > xContext = getComponentContext(); try @@ -200,7 +200,7 @@ uno::Reference< uno::XInterface > SAL_CALL XMLMetaExportComponent_createInstance const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception ) { - return (cppu::OWeakObject*)new XMLMetaExportComponent( comphelper::getComponentContext(rSMgr), XMLMetaExportComponent_getImplementationName(), EXPORT_META|EXPORT_OASIS); + return (cppu::OWeakObject*)new XMLMetaExportComponent( comphelper::getComponentContext(rSMgr), XMLMetaExportComponent_getImplementationName(), SvXMLExportFlags::META|SvXMLExportFlags::OASIS); } uno::Sequence< OUString > SAL_CALL XMLMetaExportOOO_getSupportedServiceNames() @@ -221,7 +221,7 @@ uno::Reference< uno::XInterface > SAL_CALL XMLMetaExportOOO_createInstance( const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception ) { - return (cppu::OWeakObject*)new XMLMetaExportComponent( comphelper::getComponentContext(rSMgr), XMLMetaExportOOO_getImplementationName(), EXPORT_META); + return (cppu::OWeakObject*)new XMLMetaExportComponent( comphelper::getComponentContext(rSMgr), XMLMetaExportOOO_getImplementationName(), SvXMLExportFlags::META); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/impastpl.cxx b/xmloff/source/style/impastpl.cxx index b3dd0f648de9..5a54f78d0d04 100644 --- a/xmloff/source/style/impastpl.cxx +++ b/xmloff/source/style/impastpl.cxx @@ -409,8 +409,8 @@ void SvXMLAutoStylePoolP_Impl::AddFamily( bool bAsFamily ) { // store family in a list if not already stored - sal_uInt16 nExportFlags = GetExport().getExportFlags(); - bool bStylesOnly = (nExportFlags & EXPORT_STYLES) != 0 && (nExportFlags & EXPORT_CONTENT) == 0; + SvXMLExportFlags nExportFlags = GetExport().getExportFlags(); + bool bStylesOnly = (nExportFlags & SvXMLExportFlags::STYLES) && !(nExportFlags & SvXMLExportFlags::CONTENT); OUString aPrefix( rStrPrefix ); if( bStylesOnly ) diff --git a/xmloff/source/style/styleexp.cxx b/xmloff/source/style/styleexp.cxx index 6396e1644d9c..2089fb08748c 100644 --- a/xmloff/source/style/styleexp.cxx +++ b/xmloff/source/style/styleexp.cxx @@ -191,7 +191,7 @@ bool XMLStyleExport::exportStyle( /* Empty value for style:default-outline-level does exist since ODF 1.2. Thus, suppress its export for former versions. (#i104889#) */ - if ( ( GetExport().getExportFlags() & EXPORT_OASIS ) != 0 && + if ( ( GetExport().getExportFlags() & SvXMLExportFlags::OASIS ) && GetExport().getDefaultVersion() >= SvtSaveOptions::ODFVER_012 ) { GetExport().AddAttribute( XML_NAMESPACE_STYLE, diff --git a/xmloff/source/text/XMLAutoTextEventExport.cxx b/xmloff/source/text/XMLAutoTextEventExport.cxx index 19ee4a6642d6..d0c3ff8de74a 100644 --- a/xmloff/source/text/XMLAutoTextEventExport.cxx +++ b/xmloff/source/text/XMLAutoTextEventExport.cxx @@ -61,7 +61,7 @@ using ::com::sun::star::xml::sax::XDocumentHandler; XMLAutoTextEventExport::XMLAutoTextEventExport( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext, - OUString const & implementationName, sal_uInt16 nFlags + OUString const & implementationName, SvXMLExportFlags nFlags ) : SvXMLExport(util::MeasureUnit::INCH, xContext, implementationName, XML_AUTO_TEXT, nFlags) { @@ -106,7 +106,7 @@ void XMLAutoTextEventExport::initialize( sal_uInt32 XMLAutoTextEventExport::exportDoc( enum XMLTokenEnum ) { - if( (getExportFlags() & EXPORT_OASIS) == 0 ) + if( !(getExportFlags() & SvXMLExportFlags::OASIS) ) { Reference< uno::XComponentContext> xContext = getComponentContext(); try @@ -226,7 +226,7 @@ Reference< XInterface > SAL_CALL XMLAutoTextEventExport_createInstance( const Reference< XMultiServiceFactory > & rSMgr) throw( Exception ) { - return (cppu::OWeakObject*)new XMLAutoTextEventExport( comphelper::getComponentContext(rSMgr), XMLAutoTextEventExport_getImplementationName(), EXPORT_ALL|EXPORT_OASIS); + return (cppu::OWeakObject*)new XMLAutoTextEventExport( comphelper::getComponentContext(rSMgr), XMLAutoTextEventExport_getImplementationName(), SvXMLExportFlags::ALL|SvXMLExportFlags::OASIS); } // methods to support the component registration @@ -248,7 +248,7 @@ Reference< XInterface > SAL_CALL XMLAutoTextEventExportOOO_createInstance( const Reference< XMultiServiceFactory > & rSMgr) throw( Exception ) { - return (cppu::OWeakObject*)new XMLAutoTextEventExport( comphelper::getComponentContext(rSMgr), XMLAutoTextEventExportOOO_getImplementationName(), EXPORT_ALL); + return (cppu::OWeakObject*)new XMLAutoTextEventExport( comphelper::getComponentContext(rSMgr), XMLAutoTextEventExportOOO_getImplementationName(), SvXMLExportFlags::ALL); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/text/XMLAutoTextEventExport.hxx b/xmloff/source/text/XMLAutoTextEventExport.hxx index 39cc9a103133..61206832d91d 100644 --- a/xmloff/source/text/XMLAutoTextEventExport.hxx +++ b/xmloff/source/text/XMLAutoTextEventExport.hxx @@ -52,7 +52,7 @@ class XMLAutoTextEventExport : public SvXMLExport public: XMLAutoTextEventExport( - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext, OUString const & implementationName, sal_uInt16 nFlags + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext, OUString const & implementationName, SvXMLExportFlags nFlags ); virtual ~XMLAutoTextEventExport(); diff --git a/xmloff/source/text/XMLTextListAutoStylePool.cxx b/xmloff/source/text/XMLTextListAutoStylePool.cxx index 2ffe6887b8b5..fd976361e866 100644 --- a/xmloff/source/text/XMLTextListAutoStylePool.cxx +++ b/xmloff/source/text/XMLTextListAutoStylePool.cxx @@ -146,8 +146,8 @@ XMLTextListAutoStylePool::XMLTextListAutoStylePool( SvXMLExport& rExp ) : Reference<ucb::XAnyCompareFactory> xCompareFac( rExp.GetModel(), uno::UNO_QUERY ); if( xCompareFac.is() ) mxNumRuleCompare = xCompareFac->createAnyCompareByName( OUString( "NumberingRules" ) ); - sal_uInt16 nExportFlags = rExport.getExportFlags(); - bool bStylesOnly = (nExportFlags & EXPORT_STYLES) != 0 && (nExportFlags & EXPORT_CONTENT) == 0; + SvXMLExportFlags nExportFlags = rExport.getExportFlags(); + bool bStylesOnly = (nExportFlags & SvXMLExportFlags::STYLES) && !(nExportFlags & SvXMLExportFlags::CONTENT); if( bStylesOnly ) sPrefix = "ML"; diff --git a/xmloff/source/text/txtexppr.cxx b/xmloff/source/text/txtexppr.cxx index 2b969cfc3451..dbe9f0c2825f 100644 --- a/xmloff/source/text/txtexppr.cxx +++ b/xmloff/source/text/txtexppr.cxx @@ -1048,7 +1048,7 @@ void XMLTextExportPropertySetMapper::ContextFilter( // States for shape positioning properties (#i28749#) if ( eAnchor != TextContentAnchorType_AS_CHARACTER && - ( GetExport().getExportFlags() & EXPORT_OASIS ) == 0 ) + !( GetExport().getExportFlags() & SvXMLExportFlags::OASIS ) ) { // no export of shape positioning properties, // if shape isn't anchored as-character and diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx index 805e0e6ab399..837ebe65ffec 100644 --- a/xmloff/source/text/txtflde.cxx +++ b/xmloff/source/text/txtflde.cxx @@ -1118,7 +1118,7 @@ void XMLTextFieldExport::ExportFieldHelper( bool bCmd = GetBoolProperty(sPropertyIsShowFormula, rPropSet); ProcessDisplay(true, bCmd); // #i81766# for older versions export of the value-type - bool bExportValueType = !bCmd && ( GetExport().getExportFlags() & EXPORT_SAVEBACKWARDCOMPATIBLE ); + bool bExportValueType = !bCmd && ( GetExport().getExportFlags() & SvXMLExportFlags::SAVEBACKWARDCOMPATIBLE ); // show style, unless name will be shown ProcessValueAndType(IsStringField(nToken, rPropSet), GetIntProperty(sPropertyNumberFormat, rPropSet), @@ -1358,7 +1358,7 @@ void XMLTextFieldExport::ExportFieldHelper( sPresentation); sal_Int32 nDummy = 0; // MapPageNumberName need int ProcessString(XML_SELECT_PAGE, MapPageNumberName(rPropSet, nDummy)); - if( 0 == ( GetExport().getExportFlags() & EXPORT_SAVEBACKWARDCOMPATIBLE ) ) + if( !( GetExport().getExportFlags() & SvXMLExportFlags::SAVEBACKWARDCOMPATIBLE ) ) ExportElement(XML_PAGE_CONTINUATION, sPresentation); else ExportElement(XML_PAGE_CONTINUATION_STRING, sPresentation); diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 4ab4c30d8f06..f23a34051430 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -836,7 +836,7 @@ void XMLTextParagraphExport::exportListChange( } const bool bExportODF = - ( GetExport().getExportFlags() & EXPORT_OASIS ) != 0; + bool( GetExport().getExportFlags() & SvXMLExportFlags::OASIS ); const SvtSaveOptions::ODFDefaultVersion eODFDefaultVersion = GetExport().getDefaultVersion(); @@ -1097,7 +1097,7 @@ void XMLTextParagraphExport::exportListChange( GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_START_VALUE, aBuffer.makeStringAndClear() ); } - if ( ( GetExport().getExportFlags() & EXPORT_OASIS ) != 0 && + if ( ( GetExport().getExportFlags() & SvXMLExportFlags::OASIS ) && GetExport().getDefaultVersion() >= SvtSaveOptions::ODFVER_012 ) { const OUString sListStyleName( rNextInfo.GetNumRulesName() ); |