diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-02-14 16:53:39 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2021-01-07 16:32:55 +0100 |
commit | fdb94a92ffcee585cc059223ab2cb354eb475d51 (patch) | |
tree | 517c904f6a2c072f2fa22c751ee66935132ca8a7 /reportdesign | |
parent | 00aad6a4887642879fb3b7be9a87414655fbc94f (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 9e22dd5a346d..09a84d0dd0bf 100644 --- a/reportdesign/source/filter/xml/xmlCell.cxx +++ b/reportdesign/source/filter/xml/xmlCell.cxx @@ -215,7 +215,7 @@ void OXMLCell::EndElement() 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 f2e949356053..671340996258 100644 --- a/reportdesign/source/filter/xml/xmlColumn.cxx +++ b/reportdesign/source/filter/xml/xmlColumn.cxx @@ -138,7 +138,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); @@ -148,7 +148,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 ea9909fe715f..3662e979be63 100644 --- a/reportdesign/source/filter/xml/xmlExport.cxx +++ b/reportdesign/source/filter/xml/xmlExport.cxx @@ -286,16 +286,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); } @@ -489,7 +489,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); @@ -504,7 +504,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); @@ -604,9 +604,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; @@ -1152,7 +1152,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); @@ -1252,14 +1252,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() @@ -1343,10 +1343,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 97355c888158..2c61ddfd68d7 100644 --- a/reportdesign/source/filter/xml/xmlExport.hxx +++ b/reportdesign/source/filter/xml/xmlExport.hxx @@ -130,8 +130,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 f84005d16a96..8617a4239008 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 430d9cdeee8b..b767f650301e 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 092f928b22a1..4717799c3876 100644 --- a/reportdesign/source/filter/xml/xmlStyleImport.cxx +++ b/reportdesign/source/filter/xml/xmlStyleImport.cxx @@ -68,7 +68,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), @@ -88,18 +88,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 *>(GetOwnImport().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"); } @@ -179,7 +179,7 @@ void OReportStylesContext::EndElement() rtl::Reference < SvXMLImportPropertyMapper > OReportStylesContext::GetImportPropertyMapper( - sal_uInt16 nFamily ) const + XmlStyleFamily nFamily ) const { rtl::Reference < SvXMLImportPropertyMapper > xMapper(SvXMLStylesContext::GetImportPropertyMapper(nFamily)); @@ -188,7 +188,7 @@ rtl::Reference < SvXMLImportPropertyMapper > ORptFilter& rImport = GetOwnImport(); switch( nFamily ) { - case XML_STYLE_FAMILY_TABLE_CELL: + case XmlStyleFamily::TABLE_CELL: { if( !m_xCellImpPropMapper.is() ) { @@ -200,7 +200,7 @@ rtl::Reference < SvXMLImportPropertyMapper > xMapper = m_xCellImpPropMapper; } break; - case XML_STYLE_FAMILY_TABLE_COLUMN: + case XmlStyleFamily::TABLE_COLUMN: { if( !m_xColumnImpPropMapper.is() ) m_xColumnImpPropMapper = @@ -209,14 +209,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() ) { @@ -235,14 +235,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 ); @@ -258,7 +258,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, @@ -268,10 +268,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; @@ -285,7 +285,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()) @@ -293,7 +293,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); @@ -301,7 +301,7 @@ Reference < XNameContainer > sName = "TableStyles"; } break; - case XML_STYLE_FAMILY_TABLE_CELL: + case XmlStyleFamily::TABLE_CELL: { if( m_xCellStyles.is() ) xStyles.set(m_xCellStyles); @@ -309,7 +309,7 @@ Reference < XNameContainer > sName = "CellStyles"; } break; - case XML_STYLE_FAMILY_TABLE_COLUMN: + case XmlStyleFamily::TABLE_COLUMN: { if( m_xColumnStyles.is() ) xStyles.set(m_xColumnStyles); @@ -317,7 +317,7 @@ Reference < XNameContainer > sName = "ColumnStyles"; } break; - case XML_STYLE_FAMILY_TABLE_ROW: + case XmlStyleFamily::TABLE_ROW: { if( m_xRowStyles.is() ) xStyles.set(m_xRowStyles); @@ -325,7 +325,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: @@ -343,16 +343,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: @@ -366,23 +366,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: @@ -399,7 +399,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 e5fce77c154a..13320b6d23c2 100644 --- a/reportdesign/source/filter/xml/xmlStyleImport.hxx +++ b/reportdesign/source/filter/xml/xmlStyleImport.hxx @@ -59,7 +59,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; @@ -97,13 +97,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; @@ -119,10 +119,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 af7272437ba4..796a224efee6 100644 --- a/reportdesign/source/filter/xml/xmlTable.cxx +++ b/reportdesign/source/filter/xml/xmlTable.cxx @@ -172,7 +172,7 @@ void OXMLTable::EndElement() 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 e4df625cacce..9d109745c009 100644 --- a/reportdesign/source/filter/xml/xmlfilter.cxx +++ b/reportdesign/source/filter/xml/xmlfilter.cxx @@ -664,7 +664,7 @@ SvXMLImportContextRef RptXMLDocumentBodyContext::CreateChildContext( 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()); |