diff options
author | Noel Grandin <noel@peralex.com> | 2014-12-20 21:23:34 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-01-06 10:59:40 +0200 |
commit | d1ce6effb62745e9f9c85badd44a1be0aa4a1d8f (patch) | |
tree | 76d1a74cb1f86ab42a9e2841776ba1f1bc705e86 | |
parent | bae855e667993ea6cddd551452c6e2fa60bdc2f3 (diff) |
fdo#84938: convert TEXT_PROP_MAP #defines to 'enum class'
Change-Id: Ia8c5913c60e3d509a906965d813c8d1380396dc6
-rw-r--r-- | include/xmloff/txtprmap.hxx | 28 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlExport.cxx | 4 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlfilter.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/forms/elementexport.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/text/txtimp.cxx | 22 | ||||
-rw-r--r-- | xmloff/source/text/txtparae.cxx | 20 | ||||
-rw-r--r-- | xmloff/source/text/txtprmap.cxx | 30 | ||||
-rw-r--r-- | xmloff/source/text/txtstyle.cxx | 4 |
8 files changed, 58 insertions, 56 deletions
diff --git a/include/xmloff/txtprmap.hxx b/include/xmloff/txtprmap.hxx index dc8de7026395..a08915f92597 100644 --- a/include/xmloff/txtprmap.hxx +++ b/include/xmloff/txtprmap.hxx @@ -198,25 +198,27 @@ #define CTF_RELHEIGHTREL (XML_TEXT_CTF_START + 169) -#define TEXT_PROP_MAP_TEXT 0 -#define TEXT_PROP_MAP_PARA 1 -#define TEXT_PROP_MAP_FRAME 2 -#define TEXT_PROP_MAP_AUTO_FRAME 3 -#define TEXT_PROP_MAP_SECTION 4 -#define TEXT_PROP_MAP_SHAPE 5 -#define TEXT_PROP_MAP_RUBY 6 -#define TEXT_PROP_MAP_SHAPE_PARA 7 -#define TEXT_PROP_MAP_TEXT_ADDITIONAL_DEFAULTS 8 -#define TEXT_PROP_MAP_TABLE_DEFAULTS 9 -#define TEXT_PROP_MAP_TABLE_ROW_DEFAULTS 10 +enum class TextPropMap { + TEXT = 0, + PARA = 1, + FRAME = 2, + AUTO_FRAME = 3, + SECTION = 4, + SHAPE = 5, + RUBY = 6, + SHAPE_PARA = 7, + TEXT_ADDITIONAL_DEFAULTS = 8, + TABLE_DEFAULTS = 9, + TABLE_ROW_DEFAULTS = 10 +}; class XMLOFF_DLLPUBLIC XMLTextPropertySetMapper : public XMLPropertySetMapper { public: - XMLTextPropertySetMapper( sal_uInt16 nType, bool bForExport ); + XMLTextPropertySetMapper( TextPropMap nType, bool bForExport ); virtual ~XMLTextPropertySetMapper(); - static const XMLPropertyMapEntry* getPropertyMapForType( sal_uInt16 _nType ); + static const XMLPropertyMapEntry* getPropertyMapForType( TextPropMap _nType ); }; #endif diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx index 227b9d84e983..2ed89900efba 100644 --- a/reportdesign/source/filter/xml/xmlExport.cxx +++ b/reportdesign/source/filter/xml/xmlExport.cxx @@ -269,7 +269,7 @@ ORptExport::ORptExport(const Reference< XComponentContext >& _rxContext, OUStrin m_xPropHdlFactory = new OXMLRptPropHdlFactory(); rtl::Reference < XMLPropertyHandlerFactory> xFac = new ::xmloff::OControlPropertyHandlerFactory(); rtl::Reference < XMLPropertySetMapper > xTableStylesPropertySetMapper1 = new XMLPropertySetMapper(OXMLHelper::GetTableStyleProps(),xFac, true); - rtl::Reference < XMLPropertySetMapper > xTableStylesPropertySetMapper2 = new XMLTextPropertySetMapper(TEXT_PROP_MAP_TABLE_DEFAULTS, true ); + rtl::Reference < XMLPropertySetMapper > xTableStylesPropertySetMapper2 = new XMLTextPropertySetMapper(TextPropMap::TABLE_DEFAULTS, true ); xTableStylesPropertySetMapper1->AddMapperEntry(xTableStylesPropertySetMapper2); m_xTableStylesExportPropertySetMapper = new SvXMLExportPropertyMapper(xTableStylesPropertySetMapper1); @@ -284,7 +284,7 @@ ORptExport::ORptExport(const Reference< XComponentContext >& _rxContext, OUStrin rtl::Reference < XMLPropertySetMapper > xRowStylesPropertySetMapper = new XMLPropertySetMapper(OXMLHelper::GetRowStyleProps(), m_xPropHdlFactory, true); m_xRowStylesExportPropertySetMapper = new OSpecialHandleXMLExportPropertyMapper(xRowStylesPropertySetMapper); - rtl::Reference < XMLPropertySetMapper > xPropMapper(new XMLTextPropertySetMapper( TEXT_PROP_MAP_PARA, true )); + rtl::Reference < XMLPropertySetMapper > xPropMapper(new XMLTextPropertySetMapper( TextPropMap::PARA, true )); m_xParaPropMapper = new OSpecialHandleXMLExportPropertyMapper( xPropMapper); OUString sFamily( GetXMLToken(XML_PARAGRAPH) ); diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx index f5786f70d2de..776a60e000dd 100644 --- a/reportdesign/source/filter/xml/xmlfilter.cxx +++ b/reportdesign/source/filter/xml/xmlfilter.cxx @@ -375,7 +375,7 @@ ORptFilter::ORptFilter( const uno::Reference< XComponentContext >& _rxContext,sa m_xCellStylesPropertySetMapper = OXMLHelper::GetCellStylePropertyMap(true, false); m_xColumnStylesPropertySetMapper = new XMLPropertySetMapper(OXMLHelper::GetColumnStyleProps(), m_xPropHdlFactory, false); m_xRowStylesPropertySetMapper = new XMLPropertySetMapper(OXMLHelper::GetRowStyleProps(), m_xPropHdlFactory, false); - m_xTableStylesPropertySetMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_TABLE_DEFAULTS, false ); + m_xTableStylesPropertySetMapper = new XMLTextPropertySetMapper( TextPropMap::TABLE_DEFAULTS, false ); } diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx index ff7335783843..7ac919139dd1 100644 --- a/xmloff/source/forms/elementexport.cxx +++ b/xmloff/source/forms/elementexport.cxx @@ -334,14 +334,14 @@ namespace xmloff Reference< XText > xControlText( m_xProps, UNO_QUERY ); if ( xControlText.is() ) { - const XMLPropertyMapEntry* pCharAttributeProperties = XMLTextPropertySetMapper::getPropertyMapForType( TEXT_PROP_MAP_TEXT ); + const XMLPropertyMapEntry* pCharAttributeProperties = XMLTextPropertySetMapper::getPropertyMapForType( TextPropMap::TEXT ); while ( pCharAttributeProperties->msApiName ) { exportedProperty( OUString::createFromAscii( pCharAttributeProperties->msApiName ) ); ++pCharAttributeProperties; } - const XMLPropertyMapEntry* pParaAttributeProperties = XMLTextPropertySetMapper::getPropertyMapForType( TEXT_PROP_MAP_SHAPE_PARA ); + const XMLPropertyMapEntry* pParaAttributeProperties = XMLTextPropertySetMapper::getPropertyMapForType( TextPropMap::SHAPE_PARA ); while ( pParaAttributeProperties->msApiName ) { exportedProperty( OUString::createFromAscii( pParaAttributeProperties->msApiName ) ); diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index 6649327cba77..a7e781bcbc47 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -1001,23 +1001,23 @@ XMLTextImportHelper::XMLTextImportHelper( } XMLPropertySetMapper *pPropMapper = - new XMLTextPropertySetMapper( TEXT_PROP_MAP_PARA, false ); + new XMLTextPropertySetMapper( TextPropMap::PARA, false ); m_pImpl->m_xParaImpPrMap = new XMLTextImportPropertyMapper( pPropMapper, rImport ); - pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT, false ); + pPropMapper = new XMLTextPropertySetMapper( TextPropMap::TEXT, false ); m_pImpl->m_xTextImpPrMap = new XMLTextImportPropertyMapper( pPropMapper, rImport ); - pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_FRAME, false ); + pPropMapper = new XMLTextPropertySetMapper( TextPropMap::FRAME, false ); m_pImpl->m_xFrameImpPrMap = new XMLTextImportPropertyMapper( pPropMapper, rImport ); - pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_SECTION, false ); + pPropMapper = new XMLTextPropertySetMapper( TextPropMap::SECTION, false ); m_pImpl->m_xSectionImpPrMap = new XMLTextImportPropertyMapper( pPropMapper, rImport ); - pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_RUBY, false ); + pPropMapper = new XMLTextPropertySetMapper( TextPropMap::RUBY, false ); m_pImpl->m_xRubyImpPrMap = new SvXMLImportPropertyMapper( pPropMapper, rImport ); } @@ -1029,25 +1029,25 @@ XMLTextImportHelper::~XMLTextImportHelper() SvXMLImportPropertyMapper *XMLTextImportHelper::CreateShapeExtPropMapper(SvXMLImport& rImport) { XMLPropertySetMapper *pPropMapper = - new XMLTextPropertySetMapper( TEXT_PROP_MAP_FRAME, false ); + new XMLTextPropertySetMapper( TextPropMap::FRAME, false ); return new XMLTextImportPropertyMapper( pPropMapper, rImport ); } SvXMLImportPropertyMapper *XMLTextImportHelper::CreateParaExtPropMapper(SvXMLImport& rImport) { XMLPropertySetMapper *pPropMapper = - new XMLTextPropertySetMapper( TEXT_PROP_MAP_SHAPE_PARA, false ); + new XMLTextPropertySetMapper( TextPropMap::SHAPE_PARA, false ); return new XMLTextImportPropertyMapper( pPropMapper, rImport ); } SvXMLImportPropertyMapper *XMLTextImportHelper::CreateParaDefaultExtPropMapper(SvXMLImport& rImport) { XMLPropertySetMapper* pPropMapper = - new XMLTextPropertySetMapper( TEXT_PROP_MAP_SHAPE_PARA, false ); + new XMLTextPropertySetMapper( TextPropMap::SHAPE_PARA, false ); SvXMLImportPropertyMapper* pImportMapper = new XMLTextImportPropertyMapper( pPropMapper, rImport ); pPropMapper = - new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT_ADDITIONAL_DEFAULTS, false ); + new XMLTextPropertySetMapper( TextPropMap::TEXT_ADDITIONAL_DEFAULTS, false ); pImportMapper->ChainImportMapper( new XMLTextImportPropertyMapper( pPropMapper, rImport ) ); return pImportMapper; @@ -1058,7 +1058,7 @@ SvXMLImportPropertyMapper* SvXMLImport& rImport ) { XMLPropertySetMapper *pPropMapper = - new XMLTextPropertySetMapper( TEXT_PROP_MAP_TABLE_DEFAULTS, false ); + new XMLTextPropertySetMapper( TextPropMap::TABLE_DEFAULTS, false ); return new SvXMLImportPropertyMapper( pPropMapper, rImport ); } @@ -1067,7 +1067,7 @@ SvXMLImportPropertyMapper* SvXMLImport& rImport ) { XMLPropertySetMapper *pPropMapper = - new XMLTextPropertySetMapper( TEXT_PROP_MAP_TABLE_ROW_DEFAULTS, false ); + new XMLTextPropertySetMapper( TextPropMap::TABLE_ROW_DEFAULTS, false ); return new SvXMLImportPropertyMapper( pPropMapper, rImport ); } diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index c73c802c73ee..4ab4c30d8f06 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -1263,7 +1263,7 @@ XMLTextParagraphExport::XMLTextParagraphExport( sTextFieldStartEnd( "TextFieldStartEnd" ), aCharStyleNamesPropInfoCache( sCharStyleNames ) { - rtl::Reference < XMLPropertySetMapper > xPropMapper(new XMLTextPropertySetMapper( TEXT_PROP_MAP_PARA, true )); + rtl::Reference < XMLPropertySetMapper > xPropMapper(new XMLTextPropertySetMapper( TextPropMap::PARA, true )); xParaPropMapper = new XMLTextExportPropertySetMapper( xPropMapper, GetExport() ); @@ -1272,7 +1272,7 @@ XMLTextParagraphExport::XMLTextParagraphExport( rAutoStylePool.AddFamily( XML_STYLE_FAMILY_TEXT_PARAGRAPH, sFamily, xParaPropMapper, aPrefix ); - xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT, true ); + xPropMapper = new XMLTextPropertySetMapper( TextPropMap::TEXT, true ); xTextPropMapper = new XMLTextExportPropertySetMapper( xPropMapper, GetExport() ); sFamily = GetXMLToken(XML_TEXT); @@ -1280,7 +1280,7 @@ XMLTextParagraphExport::XMLTextParagraphExport( rAutoStylePool.AddFamily( XML_STYLE_FAMILY_TEXT_TEXT, sFamily, xTextPropMapper, aPrefix ); - xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_AUTO_FRAME, true ); + xPropMapper = new XMLTextPropertySetMapper( TextPropMap::AUTO_FRAME, true ); xAutoFramePropMapper = new XMLTextExportPropertySetMapper( xPropMapper, GetExport() ); sFamily = XML_STYLE_FAMILY_SD_GRAPHICS_NAME; @@ -1288,7 +1288,7 @@ XMLTextParagraphExport::XMLTextParagraphExport( rAutoStylePool.AddFamily( XML_STYLE_FAMILY_TEXT_FRAME, sFamily, xAutoFramePropMapper, aPrefix ); - xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_SECTION, true ); + xPropMapper = new XMLTextPropertySetMapper( TextPropMap::SECTION, true ); xSectionPropMapper = new XMLTextExportPropertySetMapper( xPropMapper, GetExport() ); sFamily = GetXMLToken( XML_SECTION ); @@ -1296,14 +1296,14 @@ XMLTextParagraphExport::XMLTextParagraphExport( rAutoStylePool.AddFamily( XML_STYLE_FAMILY_TEXT_SECTION, sFamily, xSectionPropMapper, aPrefix ); - xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_RUBY, true ); + xPropMapper = new XMLTextPropertySetMapper( TextPropMap::RUBY, true ); xRubyPropMapper = new SvXMLExportPropertyMapper( xPropMapper ); sFamily = GetXMLToken( XML_RUBY ); aPrefix = "Ru"; rAutoStylePool.AddFamily( XML_STYLE_FAMILY_TEXT_RUBY, sFamily, xRubyPropMapper, aPrefix ); - xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_FRAME, true ); + xPropMapper = new XMLTextPropertySetMapper( TextPropMap::FRAME, true ); xFramePropMapper = new XMLTextExportPropertySetMapper( xPropMapper, GetExport() ); @@ -1347,7 +1347,7 @@ SvXMLExportPropertyMapper *XMLTextParagraphExport::CreateShapeExtPropMapper( SvXMLExport& rExport ) { rtl::Reference < XMLPropertySetMapper > xPropMapper = - new XMLTextPropertySetMapper( TEXT_PROP_MAP_SHAPE, true ); + new XMLTextPropertySetMapper( TextPropMap::SHAPE, true ); return new XMLTextExportPropertySetMapper( xPropMapper, rExport ); } @@ -1355,7 +1355,7 @@ SvXMLExportPropertyMapper *XMLTextParagraphExport::CreateCharExtPropMapper( SvXMLExport& rExport) { XMLPropertySetMapper *pPropMapper = - new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT, true ); + new XMLTextPropertySetMapper( TextPropMap::TEXT, true ); return new XMLTextExportPropertySetMapper( pPropMapper, rExport ); } @@ -1363,7 +1363,7 @@ SvXMLExportPropertyMapper *XMLTextParagraphExport::CreateParaExtPropMapper( SvXMLExport& rExport) { XMLPropertySetMapper *pPropMapper = - new XMLTextPropertySetMapper( TEXT_PROP_MAP_SHAPE_PARA, true ); + new XMLTextPropertySetMapper( TextPropMap::SHAPE_PARA, true ); return new XMLTextExportPropertySetMapper( pPropMapper, rExport ); } @@ -1371,7 +1371,7 @@ SvXMLExportPropertyMapper *XMLTextParagraphExport::CreateParaDefaultExtPropMappe SvXMLExport& rExport) { XMLPropertySetMapper *pPropMapper = - new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT_ADDITIONAL_DEFAULTS, true ); + new XMLTextPropertySetMapper( TextPropMap::TEXT_ADDITIONAL_DEFAULTS, true ); return new XMLTextExportPropertySetMapper( pPropMapper, rExport ); } diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx index 5b596cd1b82c..fb72d6a48c1d 100644 --- a/xmloff/source/text/txtprmap.cxx +++ b/xmloff/source/text/txtprmap.cxx @@ -91,7 +91,7 @@ XMLPropertyMapEntry aXMLParaPropMap[] = //UUUU fill attributes for paragraph backgrounds // #i125045# moved to the front to be able to exclude these in lcl_txtprmap_getMap - // for TEXT_PROP_MAP_SHAPE_PARA to not have these double for Shapes (which already have these) + // for TextPropMap::SHAPE_PARA to not have these double for Shapes (which already have these) GMAP( "FillStyle", XML_NAMESPACE_DRAW, XML_FILL, XML_SW_TYPE_FILLSTYLE, 0 ), GMAP( "FillColor", XML_NAMESPACE_DRAW, XML_FILL_COLOR, XML_TYPE_COLOR, 0 ), GMAP( "FillColor2", XML_NAMESPACE_DRAW, XML_SECONDARY_FILL_COLOR, XML_TYPE_COLOR, 0 ), @@ -955,15 +955,15 @@ XMLPropertyMapEntry aXMLTableRowDefaultsMap[] = M_END() }; -static XMLPropertyMapEntry *lcl_txtprmap_getMap( sal_uInt16 nType ) +static XMLPropertyMapEntry *lcl_txtprmap_getMap( TextPropMap nType ) { XMLPropertyMapEntry *pMap = 0; switch( nType ) { - case TEXT_PROP_MAP_TEXT: + case TextPropMap::TEXT: pMap = aXMLTextPropMap; break; - case TEXT_PROP_MAP_SHAPE_PARA: + case TextPropMap::SHAPE_PARA: // #i125045# use [21] instead of [1] for text props for Shapes, idices // [1..20] contain the DrawingLayer FillStyle attributes corresponding to // [XATTR_FILL_FIRST .. XATTR_FILL_LAST] and would be double since Shapes @@ -971,32 +971,32 @@ static XMLPropertyMapEntry *lcl_txtprmap_getMap( sal_uInt16 nType ) pMap = &(aXMLParaPropMap[21]); OSL_ENSURE( pMap->meXMLName == XML_MARGIN, "shape para map changed" ); break; - case TEXT_PROP_MAP_PARA: + case TextPropMap::PARA: pMap = aXMLParaPropMap; break; - case TEXT_PROP_MAP_FRAME: + case TextPropMap::FRAME: pMap = aXMLFramePropMap; break; - case TEXT_PROP_MAP_AUTO_FRAME: + case TextPropMap::AUTO_FRAME: pMap = &(aXMLFramePropMap[13]); OSL_ENSURE( pMap->meXMLName == XML_MARGIN, "frame map changed" ); break; - case TEXT_PROP_MAP_SHAPE: + case TextPropMap::SHAPE: pMap = aXMLShapePropMap; break; - case TEXT_PROP_MAP_SECTION: + case TextPropMap::SECTION: pMap = aXMLSectionPropMap; break; - case TEXT_PROP_MAP_RUBY: + case TextPropMap::RUBY: pMap = aXMLRubyPropMap; break; - case TEXT_PROP_MAP_TEXT_ADDITIONAL_DEFAULTS: + case TextPropMap::TEXT_ADDITIONAL_DEFAULTS: pMap = aXMLAdditionalTextDefaultsMap; break; - case TEXT_PROP_MAP_TABLE_DEFAULTS: + case TextPropMap::TABLE_DEFAULTS: pMap = aXMLTableDefaultsMap; break; - case TEXT_PROP_MAP_TABLE_ROW_DEFAULTS: + case TextPropMap::TABLE_ROW_DEFAULTS: pMap = aXMLTableRowDefaultsMap; break; } @@ -1004,12 +1004,12 @@ static XMLPropertyMapEntry *lcl_txtprmap_getMap( sal_uInt16 nType ) return pMap; } -const XMLPropertyMapEntry* XMLTextPropertySetMapper::getPropertyMapForType( sal_uInt16 _nType ) +const XMLPropertyMapEntry* XMLTextPropertySetMapper::getPropertyMapForType( TextPropMap _nType ) { return lcl_txtprmap_getMap( _nType ); } -XMLTextPropertySetMapper::XMLTextPropertySetMapper( sal_uInt16 nType, bool bForExport ) : +XMLTextPropertySetMapper::XMLTextPropertySetMapper( TextPropMap nType, bool bForExport ) : XMLPropertySetMapper( lcl_txtprmap_getMap( nType ), new XMLTextPropertyHandlerFactory, bForExport ) { diff --git a/xmloff/source/text/txtstyle.cxx b/xmloff/source/text/txtstyle.cxx index e03d834a64c2..4ccef23b62af 100644 --- a/xmloff/source/text/txtstyle.cxx +++ b/xmloff/source/text/txtstyle.cxx @@ -128,7 +128,7 @@ void XMLTextParagraphExport::exportTextStyles( bool bUsed, bool bProg ) GetXMLToken(XML_TABLE), new XMLTextExportPropertySetMapper( new XMLTextPropertySetMapper( - TEXT_PROP_MAP_TABLE_DEFAULTS, true ), + TextPropMap::TABLE_DEFAULTS, true ), GetExport() ) ); exportDefaultStyle( @@ -136,7 +136,7 @@ void XMLTextParagraphExport::exportTextStyles( bool bUsed, bool bProg ) GetXMLToken(XML_TABLE_ROW), new XMLTextExportPropertySetMapper( new XMLTextPropertySetMapper( - TEXT_PROP_MAP_TABLE_ROW_DEFAULTS, true ), + TextPropMap::TABLE_ROW_DEFAULTS, true ), GetExport() ) ); } } |