diff options
author | Noel Grandin <noel@peralex.com> | 2014-12-25 17:43:19 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-01-06 10:59:41 +0200 |
commit | ec5bf66d366cd42774a87465e1187271f48a4ab1 (patch) | |
tree | 753abf1bed73e17c23e3ff0bbfbca7ea27f3b31f /sw/source | |
parent | dc28e90d200a839d4017d548217ee5ce8a23f848 (diff) |
fdo#84938: convert XML_EXPORT_FLAG_ to 'enum class'
Change-Id: I43d778e0eee19a56ea37898ec1c4309d3407775e
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/filter/xml/xmlexpit.cxx | 22 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlexpit.hxx | 20 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlfmte.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/xml/xmliteme.cxx | 4 |
4 files changed, 21 insertions, 27 deletions
diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx index 40253feaeaf5..d8415d4ccf26 100644 --- a/sw/source/filter/xml/xmlexpit.cxx +++ b/sw/source/filter/xml/xmlexpit.cxx @@ -64,7 +64,7 @@ void SvXMLExportItemMapper::exportXML( const SvXMLExport& rExport, const SfxItemSet& rSet, const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap, - sal_uInt16 nFlags, + SvXmlExportFlags nFlags, std::vector<sal_uInt16> *pIndexArray ) const { const sal_uInt16 nCount = mrMapEntries->getCount(); @@ -112,7 +112,7 @@ void SvXMLExportItemMapper::exportXML( const SvXMLExport& rExport, const SvXMLItemMapEntry& rEntry, const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap, - sal_uInt16 /*nFlags*/, + SvXmlExportFlags /*nFlags*/, const SfxItemSet *pSet ) const { if( 0 != (rEntry.nMemberId & MID_SW_FLAG_SPECIAL_ITEM_EXPORT) ) @@ -219,7 +219,7 @@ void SvXMLExportItemMapper::exportElementItems( SvXMLExport& rExport, const SvXMLUnitConverter& rUnitConverter, const SfxItemSet &rSet, - sal_uInt16 nFlags, + SvXmlExportFlags nFlags, const std::vector<sal_uInt16> &rIndexArray ) const { const size_t nCount = rIndexArray.size(); @@ -248,25 +248,25 @@ void SvXMLExportItemMapper::exportElementItems( } /** returns the item with the given WhichId from the given ItemSet if its - set or its default item if its not set and the XML_EXPORT_FLAG_DEEP + set or its default item if its not set and the SvXmlExportFlags::DEEP is set in the flags */ const SfxPoolItem* SvXMLExportItemMapper::GetItem( const SfxItemSet& rSet, sal_uInt16 nWhichId, - sal_uInt16 nFlags ) + SvXmlExportFlags nFlags ) { // first get item from itemset const SfxPoolItem* pItem; SfxItemState eState = rSet.GetItemState( nWhichId, - ( nFlags & XML_EXPORT_FLAG_DEEP ) != 0, + bool( nFlags & SvXmlExportFlags::DEEP ), &pItem ); if( SfxItemState::SET == eState ) { return pItem; } - else if( (nFlags & XML_EXPORT_FLAG_DEFAULTS) != 0 && + else if( (nFlags & SvXmlExportFlags::DEFAULTS) && SFX_WHICH_MAX > nWhichId ) { // if its not set, try the pool if we export defaults @@ -291,7 +291,7 @@ void SvXMLExportItemMapper::exportXML( SvXMLExport& rExport, const SfxItemSet& rSet, const SvXMLUnitConverter& rUnitConverter, XMLTokenEnum ePropToken, - sal_uInt16 nFlags ) const + SvXmlExportFlags nFlags ) const { std::vector<sal_uInt16> aIndexArray; @@ -299,10 +299,10 @@ void SvXMLExportItemMapper::exportXML( SvXMLExport& rExport, rExport.GetNamespaceMap(), nFlags, &aIndexArray ); if( rExport.GetAttrList().getLength() > 0L || - (nFlags & XML_EXPORT_FLAG_EMPTY) != 0 || + (nFlags & SvXmlExportFlags::EMPTY) || !aIndexArray.empty() ) { - if( (nFlags & XML_EXPORT_FLAG_IGN_WS) != 0 ) + if( (nFlags & SvXmlExportFlags::IGN_WS) ) { rExport.IgnorableWhitespace(); } @@ -345,7 +345,7 @@ void SvXMLExportItemMapper::handleElementItem( const SfxPoolItem& /*rItem*/, const SvXMLUnitConverter& /*rUnitConverter*/, const SfxItemSet& /*rSet*/, - sal_uInt16 /*nFlags*/ ) const + SvXmlExportFlags /*nFlags*/ ) const { OSL_FAIL( "element item not handled in xml export" ); } diff --git a/sw/source/filter/xml/xmlexpit.hxx b/sw/source/filter/xml/xmlexpit.hxx index a017fffb19ef..d3c37d4d5a13 100644 --- a/sw/source/filter/xml/xmlexpit.hxx +++ b/sw/source/filter/xml/xmlexpit.hxx @@ -21,16 +21,10 @@ #define INCLUDED_SW_SOURCE_FILTER_XML_XMLEXPIT_HXX #include <tools/solar.h> +#include <xmloff/xmlexppr.hxx> #include "xmlitmap.hxx" #include <vector> -#define XML_EXPORT_FLAG_DEFAULTS 0x0001 // export also default items -#define XML_EXPORT_FLAG_DEEP 0x0002 // export also items from - // parent item sets -#define XML_EXPORT_FLAG_EMPTY 0x0004 // export attribs element - // even if its empty -#define XML_EXPORT_FLAG_IGN_WS 0x0008 - class SvXMLUnitConverter; class SfxPoolItem; class SfxItemSet; @@ -49,7 +43,7 @@ protected: const SfxItemSet& rSet, const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap, - sal_uInt16 nFlags, + SvXmlExportFlags nFlags, std::vector<sal_uInt16> *pIndexArray ) const; void exportXML( const SvXMLExport& rExport, @@ -58,18 +52,18 @@ protected: const SvXMLItemMapEntry &rEntry, const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap, - sal_uInt16 nFlags, + SvXmlExportFlags nFlags, const SfxItemSet *pSet ) const; void exportElementItems( SvXMLExport& rExport, const SvXMLUnitConverter& rUnitConverter, const SfxItemSet &rSet, - sal_uInt16 nFlags, + SvXmlExportFlags nFlags, const std::vector<sal_uInt16> &rIndexArray ) const; static const SfxPoolItem* GetItem( const SfxItemSet &rSet, sal_uInt16 nWhichId, - sal_uInt16 nFlags ); + SvXmlExportFlags nFlags ); public: SvXMLExportItemMapper( SvXMLItemMapEntriesRef rMapEntries ); @@ -79,7 +73,7 @@ public: const SfxItemSet& rSet, const SvXMLUnitConverter& rUnitConverter, ::xmloff::token::XMLTokenEnum ePropToken, - sal_uInt16 nFlags = 0 ) const; + SvXmlExportFlags nFlags = SvXmlExportFlags::NONE ) const; /** this method is called for every item that has the MID_SW_FLAG_SPECIAL_ITEM_EXPORT flag set */ @@ -105,7 +99,7 @@ public: const SfxPoolItem& rItem, const SvXMLUnitConverter& rUnitConverter, const SfxItemSet& rSet, - sal_uInt16 nFlags ) const; + SvXmlExportFlags nFlags ) const; inline void setMapEntries( SvXMLItemMapEntriesRef rMapEntries ); diff --git a/sw/source/filter/xml/xmlfmte.cxx b/sw/source/filter/xml/xmlfmte.cxx index d34ca353b6b7..df323eb743e3 100644 --- a/sw/source/filter/xml/xmlfmte.cxx +++ b/sw/source/filter/xml/xmlfmte.cxx @@ -155,7 +155,7 @@ void SwXMLExport::ExportFmt( const SwFmt& rFmt, enum XMLTokenEnum eFamily ) rFmt.GetAttrSet(), GetTwipUnitConverter(), ePropToken, - XML_EXPORT_FLAG_IGN_WS ); + SvXmlExportFlags::IGN_WS ); } } } diff --git a/sw/source/filter/xml/xmliteme.cxx b/sw/source/filter/xml/xmliteme.cxx index a740898ba094..eb3307f086b1 100644 --- a/sw/source/filter/xml/xmliteme.cxx +++ b/sw/source/filter/xml/xmliteme.cxx @@ -83,7 +83,7 @@ public: const SfxPoolItem& rItem, const SvXMLUnitConverter& rUnitConverter, const SfxItemSet& rSet, - sal_uInt16 nFlags ) const SAL_OVERRIDE; + SvXmlExportFlags nFlags ) const SAL_OVERRIDE; inline void SetAbsWidth( sal_uInt32 nAbs ); }; @@ -196,7 +196,7 @@ void SwXMLTableItemMapper_Impl::handleElementItem( const SfxPoolItem& rItem, const SvXMLUnitConverter& /*rUnitConverter*/, const SfxItemSet&, - sal_uInt16 ) const + SvXmlExportFlags ) const { switch( rEntry.nWhichId ) { |