diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-02-14 16:53:39 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-02-15 07:02:36 +0100 |
commit | aa58c380894dd384f6ce1efc62b3932136f2f477 (patch) | |
tree | ca6af6905afd398da0541c71733393540ab8be2e /reportdesign | |
parent | 0cb4f304abf6f8dd6b40eb800788d2fe80581813 (diff) |
convert XML_STYLE_FAMILY to scoped enum
Change-Id: I5335b0190a2f5a8111993c0c9c224c8a6a8f0cfb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88723
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'reportdesign')
-rw-r--r-- | reportdesign/source/filter/xml/xmlAutoStyle.cxx | 4 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlAutoStyle.hxx | 2 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlCell.cxx | 2 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlColumn.cxx | 4 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlExport.cxx | 32 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlExport.hxx | 4 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlHelper.cxx | 2 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlRow.cxx | 4 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlStyleImport.cxx | 64 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlStyleImport.hxx | 12 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlTable.cxx | 2 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlfilter.cxx | 2 |
12 files changed, 67 insertions, 67 deletions
diff --git a/reportdesign/source/filter/xml/xmlAutoStyle.cxx b/reportdesign/source/filter/xml/xmlAutoStyle.cxx index f3855b704df8..0c4ad550a3f4 100644 --- a/reportdesign/source/filter/xml/xmlAutoStyle.cxx +++ b/reportdesign/source/filter/xml/xmlAutoStyle.cxx @@ -28,7 +28,7 @@ namespace rptxml void OXMLAutoStylePoolP::exportStyleAttributes( SvXMLAttributeList& rAttrList, - sal_Int32 nFamily, + XmlStyleFamily nFamily, const ::std::vector< XMLPropertyState >& rProperties, const SvXMLExportPropertyMapper& rPropExp , const SvXMLUnitConverter& rUnitConverter, @@ -36,7 +36,7 @@ void OXMLAutoStylePoolP::exportStyleAttributes( ) const { SvXMLAutoStylePoolP::exportStyleAttributes( rAttrList, nFamily, rProperties, rPropExp, rUnitConverter, rNamespaceMap ); - if ( nFamily == XML_STYLE_FAMILY_TABLE_CELL ) + if ( nFamily == XmlStyleFamily::TABLE_CELL ) { rtl::Reference< XMLPropertySetMapper > aPropMapper = rORptExport.GetCellStylePropertyMapper(); for (const auto& rProp : rProperties) diff --git a/reportdesign/source/filter/xml/xmlAutoStyle.hxx b/reportdesign/source/filter/xml/xmlAutoStyle.hxx index bb4b25f699ef..0a52a2233466 100644 --- a/reportdesign/source/filter/xml/xmlAutoStyle.hxx +++ b/reportdesign/source/filter/xml/xmlAutoStyle.hxx @@ -33,7 +33,7 @@ namespace rptxml virtual void exportStyleAttributes( SvXMLAttributeList& rAttrList, - sal_Int32 nFamily, + XmlStyleFamily nFamily, const ::std::vector< XMLPropertyState >& rProperties, const SvXMLExportPropertyMapper& rPropExp, const SvXMLUnitConverter& rUnitConverter, diff --git a/reportdesign/source/filter/xml/xmlCell.cxx b/reportdesign/source/filter/xml/xmlCell.cxx index 74a23667863f..395c3afbd610 100644 --- a/reportdesign/source/filter/xml/xmlCell.cxx +++ b/reportdesign/source/filter/xml/xmlCell.cxx @@ -216,7 +216,7 @@ void OXMLCell::endFastElement(sal_Int32) m_xComponent = xFixedLine.get(); m_pContainer->getSection()->add(m_xComponent.get()); m_pContainer->addCell(m_xComponent); - XMLPropStyleContext* pAutoStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext* >(GetImport().GetAutoStyles()->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_CELL,m_sStyleName))); + XMLPropStyleContext* pAutoStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext* >(GetImport().GetAutoStyles()->FindStyleChildContext(XmlStyleFamily::TABLE_CELL,m_sStyleName))); if ( pAutoStyle ) { uno::Reference<beans::XPropertySet> xBorderProp = OXMLHelper::createBorderPropertySet(); diff --git a/reportdesign/source/filter/xml/xmlColumn.cxx b/reportdesign/source/filter/xml/xmlColumn.cxx index 13e6b0767578..8796c3c66bad 100644 --- a/reportdesign/source/filter/xml/xmlColumn.cxx +++ b/reportdesign/source/filter/xml/xmlColumn.cxx @@ -125,7 +125,7 @@ void OXMLRowColumn::fillStyle(const OUString& _sStyleName) }; pInfo->add(pMap); Reference<XPropertySet> xProp = GenericPropertySet_CreateInstance(pInfo); - XMLPropStyleContext* pAutoStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext*>(pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_COLUMN,_sStyleName))); + XMLPropStyleContext* pAutoStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext*>(pAutoStyles->FindStyleChildContext(XmlStyleFamily::TABLE_COLUMN,_sStyleName))); if ( pAutoStyle ) { pAutoStyle->FillPropertySet(xProp); @@ -135,7 +135,7 @@ void OXMLRowColumn::fillStyle(const OUString& _sStyleName) } else { - pAutoStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext* >(pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_ROW,_sStyleName))); + pAutoStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext* >(pAutoStyles->FindStyleChildContext(XmlStyleFamily::TABLE_ROW,_sStyleName))); if ( pAutoStyle ) { pAutoStyle->FillPropertySet(xProp); diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx index 0c3ad1e70ce3..a980e05d90ac 100644 --- a/reportdesign/source/filter/xml/xmlExport.cxx +++ b/reportdesign/source/filter/xml/xmlExport.cxx @@ -289,16 +289,16 @@ ORptExport::ORptExport(const Reference< XComponentContext >& _rxContext, OUStrin const OUString& sFamily( GetXMLToken(XML_PARAGRAPH) ); OUString aPrefix( 'P'); - GetAutoStylePool()->AddFamily( XML_STYLE_FAMILY_TEXT_PARAGRAPH, sFamily, + GetAutoStylePool()->AddFamily( XmlStyleFamily::TEXT_PARAGRAPH, sFamily, m_xParaPropMapper, aPrefix ); - GetAutoStylePool()->AddFamily(XML_STYLE_FAMILY_TABLE_CELL, XML_STYLE_FAMILY_TABLE_CELL_STYLES_NAME, + GetAutoStylePool()->AddFamily(XmlStyleFamily::TABLE_CELL, XML_STYLE_FAMILY_TABLE_CELL_STYLES_NAME, m_xCellStylesExportPropertySetMapper, XML_STYLE_FAMILY_TABLE_CELL_STYLES_PREFIX); - GetAutoStylePool()->AddFamily(XML_STYLE_FAMILY_TABLE_COLUMN, XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_NAME, + GetAutoStylePool()->AddFamily(XmlStyleFamily::TABLE_COLUMN, XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_NAME, m_xColumnStylesExportPropertySetMapper, XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_PREFIX); - GetAutoStylePool()->AddFamily(XML_STYLE_FAMILY_TABLE_ROW, XML_STYLE_FAMILY_TABLE_ROW_STYLES_NAME, + GetAutoStylePool()->AddFamily(XmlStyleFamily::TABLE_ROW, XML_STYLE_FAMILY_TABLE_ROW_STYLES_NAME, m_xRowStylesExportPropertySetMapper, XML_STYLE_FAMILY_TABLE_ROW_STYLES_PREFIX); - GetAutoStylePool()->AddFamily(XML_STYLE_FAMILY_TABLE_TABLE, XML_STYLE_FAMILY_TABLE_TABLE_STYLES_NAME, + GetAutoStylePool()->AddFamily(XmlStyleFamily::TABLE_TABLE, XML_STYLE_FAMILY_TABLE_TABLE_STYLES_NAME, m_xTableStylesExportPropertySetMapper, XML_STYLE_FAMILY_TABLE_TABLE_STYLES_PREFIX); } @@ -492,7 +492,7 @@ static void lcl_calculate(const ::std::vector<sal_Int32>& _aPosX,const ::std::ve } } -void ORptExport::collectStyleNames(sal_Int32 _nFamily,const ::std::vector< sal_Int32>& _aSize, std::vector<OUString>& _rStyleNames) +void ORptExport::collectStyleNames(XmlStyleFamily _nFamily,const ::std::vector< sal_Int32>& _aSize, std::vector<OUString>& _rStyleNames) { ::std::vector< XMLPropertyState > aPropertyStates; aPropertyStates.emplace_back(0); @@ -507,7 +507,7 @@ void ORptExport::collectStyleNames(sal_Int32 _nFamily,const ::std::vector< sal_I } } -void ORptExport::collectStyleNames(sal_Int32 _nFamily, const ::std::vector< sal_Int32>& _aSize, const ::std::vector< sal_Int32>& _aSizeAutoGrow, std::vector<OUString>& _rStyleNames) +void ORptExport::collectStyleNames(XmlStyleFamily _nFamily, const ::std::vector< sal_Int32>& _aSize, const ::std::vector< sal_Int32>& _aSizeAutoGrow, std::vector<OUString>& _rStyleNames) { ::std::vector< XMLPropertyState > aPropertyStates; aPropertyStates.emplace_back(0); @@ -607,9 +607,9 @@ void ORptExport::exportSectionAutoStyle(const Reference<XSection>& _xProp) lcl_calculate(aColumnPos,aRowPos,aInsert->second); TGridStyleMap::iterator aPos = m_aColumnStyleNames.emplace(_xProp.get(),std::vector<OUString>()).first; - collectStyleNames(XML_STYLE_FAMILY_TABLE_COLUMN,aColumnPos,aPos->second); + collectStyleNames(XmlStyleFamily::TABLE_COLUMN,aColumnPos,aPos->second); aPos = m_aRowStyleNames.emplace(_xProp.get(),std::vector<OUString>()).first; - collectStyleNames(XML_STYLE_FAMILY_TABLE_ROW, aRowPos, aRowPosAutoGrow, aPos->second); + collectStyleNames(XmlStyleFamily::TABLE_ROW, aRowPos, aRowPosAutoGrow, aPos->second); sal_Int32 x1 = 0; sal_Int32 y1 = 0; @@ -1155,7 +1155,7 @@ void ORptExport::exportAutoStyle(XPropertySet* _xProp,const Reference<XFormatted { ::std::vector< XMLPropertyState > aPropertyStates( m_xParaPropMapper->Filter(_xProp) ); if ( !aPropertyStates.empty() ) - m_aAutoStyleNames.emplace( _xProp,GetAutoStylePool()->Add( XML_STYLE_FAMILY_TEXT_PARAGRAPH, aPropertyStates )); + m_aAutoStyleNames.emplace( _xProp,GetAutoStylePool()->Add( XmlStyleFamily::TEXT_PARAGRAPH, aPropertyStates )); } ::std::vector< XMLPropertyState > aPropertyStates( m_xCellStylesExportPropertySetMapper->Filter(_xProp) ); Reference<XFixedLine> xFixedLine(_xProp,uno::UNO_QUERY); @@ -1255,14 +1255,14 @@ void ORptExport::exportAutoStyle(XPropertySet* _xProp,const Reference<XFormatted } if ( !aPropertyStates.empty() ) - m_aAutoStyleNames.emplace( _xProp,GetAutoStylePool()->Add( XML_STYLE_FAMILY_TABLE_CELL, aPropertyStates )); + m_aAutoStyleNames.emplace( _xProp,GetAutoStylePool()->Add( XmlStyleFamily::TABLE_CELL, aPropertyStates )); } void ORptExport::exportAutoStyle(const Reference<XSection>& _xProp) { ::std::vector< XMLPropertyState > aPropertyStates( m_xTableStylesExportPropertySetMapper->Filter(_xProp.get()) ); if ( !aPropertyStates.empty() ) - m_aAutoStyleNames.emplace( _xProp.get(),GetAutoStylePool()->Add( XML_STYLE_FAMILY_TABLE_TABLE, aPropertyStates )); + m_aAutoStyleNames.emplace( _xProp.get(),GetAutoStylePool()->Add( XmlStyleFamily::TABLE_TABLE, aPropertyStates )); } void ORptExport::SetBodyAttributes() @@ -1346,10 +1346,10 @@ void ORptExport::ExportAutoStyles_() if ( getExportFlags() & SvXMLExportFlags::CONTENT ) { collectComponentStyles(); - GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_TABLE_TABLE); - GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_TABLE_COLUMN); - GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_TABLE_ROW); - GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_TABLE_CELL); + GetAutoStylePool()->exportXML(XmlStyleFamily::TABLE_TABLE); + GetAutoStylePool()->exportXML(XmlStyleFamily::TABLE_COLUMN); + GetAutoStylePool()->exportXML(XmlStyleFamily::TABLE_ROW); + GetAutoStylePool()->exportXML(XmlStyleFamily::TABLE_CELL); exportDataStyles(); GetShapeExport()->exportAutoStyles(); } diff --git a/reportdesign/source/filter/xml/xmlExport.hxx b/reportdesign/source/filter/xml/xmlExport.hxx index f45b8e65171d..363910bf6cec 100644 --- a/reportdesign/source/filter/xml/xmlExport.hxx +++ b/reportdesign/source/filter/xml/xmlExport.hxx @@ -128,8 +128,8 @@ private: void exportAutoStyle(const Reference<XSection>& _xProp); void exportReportComponentAutoStyles(const Reference<XSection>& _xProp); void collectComponentStyles(); - void collectStyleNames(sal_Int32 _nFamily,const ::std::vector< sal_Int32>& _aSize, std::vector<OUString>& _rStyleNames); - void collectStyleNames(sal_Int32 _nFamily,const ::std::vector< sal_Int32>& _aSize, const ::std::vector< sal_Int32>& _aSizeAutoGrow, std::vector<OUString>& _rStyleNames); + void collectStyleNames(XmlStyleFamily _nFamily,const ::std::vector< sal_Int32>& _aSize, std::vector<OUString>& _rStyleNames); + void collectStyleNames(XmlStyleFamily _nFamily,const ::std::vector< sal_Int32>& _aSize, const ::std::vector< sal_Int32>& _aSizeAutoGrow, std::vector<OUString>& _rStyleNames); void exportParagraph(const Reference< XReportControlModel >& _xReportElement); bool exportFormula(enum ::xmloff::token::XMLTokenEnum eName,const OUString& _sFormula); void exportGroupsExpressionAsFunction(const Reference< XGroups>& _xGroups); diff --git a/reportdesign/source/filter/xml/xmlHelper.cxx b/reportdesign/source/filter/xml/xmlHelper.cxx index 9aee4a698f94..2372db278137 100644 --- a/reportdesign/source/filter/xml/xmlHelper.cxx +++ b/reportdesign/source/filter/xml/xmlHelper.cxx @@ -255,7 +255,7 @@ void OXMLHelper::copyStyleElements(const bool _bOld,const OUString& _sStyleName, { if ( !_xProp.is() || _sStyleName.isEmpty() || !_pAutoStyles ) return; - XMLPropStyleContext* pAutoStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext *>(_pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_CELL,_sStyleName))); + XMLPropStyleContext* pAutoStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext *>(_pAutoStyles->FindStyleChildContext(XmlStyleFamily::TABLE_CELL,_sStyleName))); if ( pAutoStyle ) { css::awt::FontDescriptor aFont; diff --git a/reportdesign/source/filter/xml/xmlRow.cxx b/reportdesign/source/filter/xml/xmlRow.cxx index 72a4a69cec55..7183f7062f56 100644 --- a/reportdesign/source/filter/xml/xmlRow.cxx +++ b/reportdesign/source/filter/xml/xmlRow.cxx @@ -132,7 +132,7 @@ void OXMLRow::EndElement() }; pInfo->add(pMap); Reference<XPropertySet> xProp = GenericPropertySet_CreateInstance(pInfo); - XMLPropStyleContext* pAutoStyle = dynamic_cast< const XMLPropStyleContext *>(pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_COLUMN,m_sStyleName)); + XMLPropStyleContext* pAutoStyle = dynamic_cast< const XMLPropStyleContext *>(pAutoStyles->FindStyleChildContext(XmlStyleFamily::TABLE_COLUMN,m_sStyleName)); if ( pAutoStyle ) { pAutoStyle->FillPropertySet(xProp); @@ -142,7 +142,7 @@ void OXMLRow::EndElement() } else { - pAutoStyle = dynamic_cast< const XMLPropStyleContext *>(pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_ROW,m_sStyleName)); + pAutoStyle = dynamic_cast< const XMLPropStyleContext *>(pAutoStyles->FindStyleChildContext(XmlStyleFamily::TABLE_ROW,m_sStyleName)); if ( pAutoStyle ) { pAutoStyle->FillPropertySet(xProp); diff --git a/reportdesign/source/filter/xml/xmlStyleImport.cxx b/reportdesign/source/filter/xml/xmlStyleImport.cxx index cf22621347bf..0d8ad1e260a5 100644 --- a/reportdesign/source/filter/xml/xmlStyleImport.cxx +++ b/reportdesign/source/filter/xml/xmlStyleImport.cxx @@ -70,7 +70,7 @@ public: OControlStyleContext::OControlStyleContext( ORptFilter& rImport, sal_uInt16 nPrfx, const OUString& rLName, const Reference< XAttributeList > & xAttrList, - SvXMLStylesContext& rStyles, sal_uInt16 nFamily ) : + SvXMLStylesContext& rStyles, XmlStyleFamily nFamily ) : XMLPropStyleContext( rImport, nPrfx, rLName, xAttrList, rStyles, nFamily, false/*bDefaultStyle*/ ), pStyles(&rStyles), m_nNumberFormat(-1), @@ -90,18 +90,18 @@ void OControlStyleContext::FillPropertySet(const Reference< XPropertySet > & rPr { if ( !IsDefaultStyle() ) { - if ( GetFamily() == XML_STYLE_FAMILY_TABLE_CELL ) + if ( GetFamily() == XmlStyleFamily::TABLE_CELL ) { if ((m_nNumberFormat == -1) && !m_sDataStyleName.isEmpty()) { SvXMLNumFormatContext* pStyle = const_cast< SvXMLNumFormatContext*>(dynamic_cast<const SvXMLNumFormatContext*>(pStyles->FindStyleChildContext( - XML_STYLE_FAMILY_DATA_STYLE, m_sDataStyleName))); + XmlStyleFamily::DATA_STYLE, m_sDataStyleName))); if ( !pStyle ) { OReportStylesContext* pMyStyles = dynamic_cast< OReportStylesContext *>(m_rImport.GetAutoStyles()); if ( pMyStyles ) pStyle = const_cast<SvXMLNumFormatContext*>(dynamic_cast< const SvXMLNumFormatContext *>(pMyStyles-> - FindStyleChildContext(XML_STYLE_FAMILY_DATA_STYLE, m_sDataStyleName, true))); + FindStyleChildContext(XmlStyleFamily::DATA_STYLE, m_sDataStyleName, true))); else { OSL_FAIL("not possible to get style"); } @@ -181,7 +181,7 @@ void OReportStylesContext::EndElement() rtl::Reference < SvXMLImportPropertyMapper > OReportStylesContext::GetImportPropertyMapper( - sal_uInt16 nFamily ) const + XmlStyleFamily nFamily ) const { rtl::Reference < SvXMLImportPropertyMapper > xMapper(SvXMLStylesContext::GetImportPropertyMapper(nFamily)); @@ -190,7 +190,7 @@ rtl::Reference < SvXMLImportPropertyMapper > ORptFilter& rImport = GetOwnImport(); switch( nFamily ) { - case XML_STYLE_FAMILY_TABLE_CELL: + case XmlStyleFamily::TABLE_CELL: { if( !m_xCellImpPropMapper.is() ) { @@ -202,7 +202,7 @@ rtl::Reference < SvXMLImportPropertyMapper > xMapper = m_xCellImpPropMapper; } break; - case XML_STYLE_FAMILY_TABLE_COLUMN: + case XmlStyleFamily::TABLE_COLUMN: { if( !m_xColumnImpPropMapper.is() ) m_xColumnImpPropMapper = @@ -211,14 +211,14 @@ rtl::Reference < SvXMLImportPropertyMapper > xMapper = m_xColumnImpPropMapper; } break; - case XML_STYLE_FAMILY_TABLE_ROW: + case XmlStyleFamily::TABLE_ROW: { if( !m_xRowImpPropMapper.is() ) m_xRowImpPropMapper =new OSpecialHanldeXMLImportPropertyMapper( rImport.GetRowStylesPropertySetMapper(), m_rImport ); xMapper = m_xRowImpPropMapper; } break; - case XML_STYLE_FAMILY_TABLE_TABLE: + case XmlStyleFamily::TABLE_TABLE: { if( !m_xTableImpPropMapper.is() ) { @@ -237,14 +237,14 @@ rtl::Reference < SvXMLImportPropertyMapper > } SvXMLStyleContext *OReportStylesContext::CreateDefaultStyleStyleChildContext( - sal_uInt16 nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, + XmlStyleFamily nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > & xAttrList ) { SvXMLStyleContext *pStyle = nullptr; switch( nFamily ) { - case XML_STYLE_FAMILY_SD_GRAPHICS_ID: + case XmlStyleFamily::SD_GRAPHICS_ID: // There are no writer specific defaults for graphic styles! pStyle = new XMLGraphicsDefaultStyle( GetImport(), nPrefix, rLocalName, xAttrList, *this ); @@ -260,7 +260,7 @@ SvXMLStyleContext *OReportStylesContext::CreateDefaultStyleStyleChildContext( } SvXMLStyleContext *OReportStylesContext::CreateStyleStyleChildContext( - sal_uInt16 nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, + XmlStyleFamily nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< xml::sax::XAttributeList > & xAttrList ) { SvXMLStyleContext *pStyle = SvXMLStylesContext::CreateStyleStyleChildContext( nFamily, nPrefix, @@ -270,10 +270,10 @@ SvXMLStyleContext *OReportStylesContext::CreateStyleStyleChildContext( { switch( nFamily ) { - case XML_STYLE_FAMILY_TABLE_TABLE: - case XML_STYLE_FAMILY_TABLE_COLUMN: - case XML_STYLE_FAMILY_TABLE_ROW: - case XML_STYLE_FAMILY_TABLE_CELL: + case XmlStyleFamily::TABLE_TABLE: + case XmlStyleFamily::TABLE_COLUMN: + case XmlStyleFamily::TABLE_ROW: + case XmlStyleFamily::TABLE_CELL: pStyle = new OControlStyleContext( GetOwnImport(), nPrefix, rLocalName, xAttrList, *this, nFamily ); break; @@ -287,7 +287,7 @@ SvXMLStyleContext *OReportStylesContext::CreateStyleStyleChildContext( } Reference < XNameContainer > - OReportStylesContext::GetStylesContainer( sal_uInt16 nFamily ) const + OReportStylesContext::GetStylesContainer( XmlStyleFamily nFamily ) const { Reference < XNameContainer > xStyles(SvXMLStylesContext::GetStylesContainer(nFamily)); if (!xStyles.is()) @@ -295,7 +295,7 @@ Reference < XNameContainer > OUString sName; switch( nFamily ) { - case XML_STYLE_FAMILY_TABLE_TABLE: + case XmlStyleFamily::TABLE_TABLE: { if( m_xTableStyles.is() ) xStyles.set(m_xTableStyles); @@ -303,7 +303,7 @@ Reference < XNameContainer > sName = "TableStyles"; } break; - case XML_STYLE_FAMILY_TABLE_CELL: + case XmlStyleFamily::TABLE_CELL: { if( m_xCellStyles.is() ) xStyles.set(m_xCellStyles); @@ -311,7 +311,7 @@ Reference < XNameContainer > sName = "CellStyles"; } break; - case XML_STYLE_FAMILY_TABLE_COLUMN: + case XmlStyleFamily::TABLE_COLUMN: { if( m_xColumnStyles.is() ) xStyles.set(m_xColumnStyles); @@ -319,7 +319,7 @@ Reference < XNameContainer > sName = "ColumnStyles"; } break; - case XML_STYLE_FAMILY_TABLE_ROW: + case XmlStyleFamily::TABLE_ROW: { if( m_xRowStyles.is() ) xStyles.set(m_xRowStyles); @@ -327,7 +327,7 @@ Reference < XNameContainer > sName = "RowStyles"; } break; - case XML_STYLE_FAMILY_SD_GRAPHICS_ID: + case XmlStyleFamily::SD_GRAPHICS_ID: xStyles = const_cast<SvXMLImport *>(&GetImport())->GetTextImport()->GetFrameStyles(); break; default: @@ -345,16 +345,16 @@ Reference < XNameContainer > xStyles.set(xFamilies->getByName( sName ), uno::UNO_QUERY); switch( nFamily ) { - case XML_STYLE_FAMILY_TABLE_TABLE: + case XmlStyleFamily::TABLE_TABLE: m_xTableStyles.set(xStyles); break; - case XML_STYLE_FAMILY_TABLE_CELL: + case XmlStyleFamily::TABLE_CELL: m_xCellStyles.set(xStyles); break; - case XML_STYLE_FAMILY_TABLE_COLUMN: + case XmlStyleFamily::TABLE_COLUMN: m_xColumnStyles.set(xStyles); break; - case XML_STYLE_FAMILY_TABLE_ROW: + case XmlStyleFamily::TABLE_ROW: m_xRowStyles.set(xStyles); break; default: @@ -368,23 +368,23 @@ Reference < XNameContainer > } -OUString OReportStylesContext::GetServiceName( sal_uInt16 nFamily ) const +OUString OReportStylesContext::GetServiceName( XmlStyleFamily nFamily ) const { OUString sServiceName = SvXMLStylesContext::GetServiceName(nFamily); if (sServiceName.isEmpty()) { switch( nFamily ) { - case XML_STYLE_FAMILY_TABLE_TABLE: + case XmlStyleFamily::TABLE_TABLE: sServiceName = g_sTableStyleFamilyName; break; - case XML_STYLE_FAMILY_TABLE_COLUMN: + case XmlStyleFamily::TABLE_COLUMN: sServiceName = g_sColumnStyleFamilyName; break; - case XML_STYLE_FAMILY_TABLE_ROW: + case XmlStyleFamily::TABLE_ROW: sServiceName = g_sRowStyleFamilyName; break; - case XML_STYLE_FAMILY_TABLE_CELL: + case XmlStyleFamily::TABLE_CELL: sServiceName = g_sCellStyleFamilyName; break; default: @@ -401,7 +401,7 @@ sal_Int32 OReportStylesContext::GetIndex(const sal_Int16 nContextID) { if (m_nNumberFormatIndex == -1) m_nNumberFormatIndex = - GetImportPropertyMapper(XML_STYLE_FAMILY_TABLE_CELL)->getPropertySetMapper()->FindEntryIndex(nContextID); + GetImportPropertyMapper(XmlStyleFamily::TABLE_CELL)->getPropertySetMapper()->FindEntryIndex(nContextID); return m_nNumberFormatIndex; } return -1; diff --git a/reportdesign/source/filter/xml/xmlStyleImport.hxx b/reportdesign/source/filter/xml/xmlStyleImport.hxx index a75f290fd4cb..8b8cf3781e92 100644 --- a/reportdesign/source/filter/xml/xmlStyleImport.hxx +++ b/reportdesign/source/filter/xml/xmlStyleImport.hxx @@ -57,7 +57,7 @@ namespace rptxml OControlStyleContext( ORptFilter& rImport, sal_uInt16 nPrfx, const OUString& rLName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList, - SvXMLStylesContext& rStyles, sal_uInt16 nFamily ); + SvXMLStylesContext& rStyles, XmlStyleFamily nFamily ); virtual ~OControlStyleContext() override; @@ -95,13 +95,13 @@ namespace rptxml // Create a style context. virtual SvXMLStyleContext *CreateStyleStyleChildContext( - sal_uInt16 nFamily, + XmlStyleFamily nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ) override; virtual SvXMLStyleContext *CreateDefaultStyleStyleChildContext( - sal_uInt16 nFamily, sal_uInt16 nPrefix, + XmlStyleFamily nFamily, sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ) override; @@ -117,10 +117,10 @@ namespace rptxml virtual void EndElement() override; virtual rtl::Reference < SvXMLImportPropertyMapper > GetImportPropertyMapper( - sal_uInt16 nFamily ) const override; + XmlStyleFamily nFamily ) const override; virtual css::uno::Reference< css::container::XNameContainer > - GetStylesContainer( sal_uInt16 nFamily ) const override; - virtual OUString GetServiceName( sal_uInt16 nFamily ) const override; + GetStylesContainer( XmlStyleFamily nFamily ) const override; + virtual OUString GetServiceName( XmlStyleFamily nFamily ) const override; sal_Int32 GetIndex(const sal_Int16 nContextID); }; diff --git a/reportdesign/source/filter/xml/xmlTable.cxx b/reportdesign/source/filter/xml/xmlTable.cxx index a960beaf442e..a2f0ab6d7e81 100644 --- a/reportdesign/source/filter/xml/xmlTable.cxx +++ b/reportdesign/source/filter/xml/xmlTable.cxx @@ -163,7 +163,7 @@ void OXMLTable::endFastElement(sal_Int32 ) const SvXMLStylesContext* pAutoStyles = GetImport().GetAutoStyles(); if ( pAutoStyles ) { - XMLPropStyleContext* pAutoStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext *>(pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_TABLE,m_sStyleName))); + XMLPropStyleContext* pAutoStyle = const_cast<XMLPropStyleContext*>(dynamic_cast< const XMLPropStyleContext *>(pAutoStyles->FindStyleChildContext(XmlStyleFamily::TABLE_TABLE,m_sStyleName))); if ( pAutoStyle ) { pAutoStyle->FillPropertySet(m_xSection.get()); diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx index f7160a765014..b9d6827620b7 100644 --- a/reportdesign/source/filter/xml/xmlfilter.cxx +++ b/reportdesign/source/filter/xml/xmlfilter.cxx @@ -674,7 +674,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > RptXMLDocumentBodyCont const SvXMLStylesContext* pAutoStyles = rImport.GetAutoStyles(); if (pAutoStyles) { - XMLPropStyleContext* pAutoStyle = const_cast<XMLPropStyleContext*>(dynamic_cast<const XMLPropStyleContext *>(pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_PAGE_MASTER, "pm1"))); + XMLPropStyleContext* pAutoStyle = const_cast<XMLPropStyleContext*>(dynamic_cast<const XMLPropStyleContext *>(pAutoStyles->FindStyleChildContext(XmlStyleFamily::PAGE_MASTER, "pm1"))); if (pAutoStyle) { pAutoStyle->FillPropertySet(rImport.getReportDefinition().get()); |