sw/source/writerfilter/dmapper/StyleSheetTable.cxx | 42 ++++----- sw/source/writerfilter/dmapper/TblStylePrHandler.cxx | 54 +++++------ sw/source/writerfilter/dmapper/TblStylePrHandler.hxx | 30 +++--- sw/source/writerfilter/filter/WriterFilter.cxx | 4 sw/source/writerfilter/inc/ooxml/OOXMLDocument.hxx | 2 sw/source/writerfilter/ooxml/OOXMLDocumentImpl.cxx | 86 +++++++++---------- sw/source/writerfilter/ooxml/OOXMLStreamImpl.cxx | 54 +++++------ 7 files changed, 136 insertions(+), 136 deletions(-)
New commits: commit f50186e55f7a351c14dde37c1ed3bfcbb7f6f10c Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Jul 10 16:21:51 2025 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Jul 11 09:20:50 2025 +0200 convert TblStyleType to scoped enum Change-Id: Ia58b5cb0cbe2500a92c013d16ff960c4324c7712 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187644 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/source/writerfilter/dmapper/StyleSheetTable.cxx b/sw/source/writerfilter/dmapper/StyleSheetTable.cxx index f459cfce15bd..cb017b663aa4 100644 --- a/sw/source/writerfilter/dmapper/StyleSheetTable.cxx +++ b/sw/source/writerfilter/dmapper/StyleSheetTable.cxx @@ -101,10 +101,10 @@ void TableStyleSheetEntry::AddTblStylePr( TblStyleType nType, const PropertyMapP static const int nTypesProps = 4; static const TblStyleType pTypesToFix[nTypesProps] = { - TBL_STYLE_FIRSTROW, - TBL_STYLE_LASTROW, - TBL_STYLE_FIRSTCOL, - TBL_STYLE_LASTCOL + TblStyleType::FirstRow, + TblStyleType::LastRow, + TblStyleType::FirstCol, + TblStyleType::LastCol }; static const PropertyIds pPropsToCheck[nTypesProps] = @@ -199,10 +199,10 @@ static void lcl_mergeProps( const PropertyMapPtr& pToFill, const PropertyMapPtr& bool pRemoveInside[] = { - ( nStyleId == TBL_STYLE_FIRSTROW ), - ( nStyleId == TBL_STYLE_LASTROW ), - ( nStyleId == TBL_STYLE_LASTCOL ), - ( nStyleId == TBL_STYLE_FIRSTCOL ) + ( nStyleId == TblStyleType::FirstRow ), + ( nStyleId == TblStyleType::LastRow ), + ( nStyleId == TblStyleType::LastCol ), + ( nStyleId == TblStyleType::FirstCol ) }; for ( unsigned i = 0 ; i != SAL_N_ELEMENTS(pPropsToCheck); i++ ) @@ -234,18 +234,18 @@ PropertyMapPtr TableStyleSheetEntry::GetLocalPropertiesFromMask( sal_Int32 nMask static const TblStyleTypeAndMask aOrderedStyleTable[] = { - { 0x010, TBL_STYLE_BAND2HORZ }, - { 0x020, TBL_STYLE_BAND1HORZ }, - { 0x040, TBL_STYLE_BAND2VERT }, - { 0x080, TBL_STYLE_BAND1VERT }, - { 0x100, TBL_STYLE_LASTCOL }, - { 0x200, TBL_STYLE_FIRSTCOL }, - { 0x400, TBL_STYLE_LASTROW }, - { 0x800, TBL_STYLE_FIRSTROW }, - { 0x001, TBL_STYLE_SWCELL }, - { 0x002, TBL_STYLE_SECELL }, - { 0x004, TBL_STYLE_NWCELL }, - { 0x008, TBL_STYLE_NECELL } + { 0x010, TblStyleType::Band2Horz }, + { 0x020, TblStyleType::Band1Horz }, + { 0x040, TblStyleType::Band2Vert }, + { 0x080, TblStyleType::Band1Vert }, + { 0x100, TblStyleType::LastCol }, + { 0x200, TblStyleType::FirstCol }, + { 0x400, TblStyleType::LastRow }, + { 0x800, TblStyleType::FirstRow }, + { 0x001, TblStyleType::SWCell }, + { 0x002, TblStyleType::SECell }, + { 0x004, TblStyleType::NWCell }, + { 0x008, TblStyleType::NECell } }; // Get the properties applying according to the mask @@ -620,7 +620,7 @@ void StyleSheetTable::lcl_sprm(Sprm & rSprm) StyleSheetEntry * pEntry = m_pCurrentEntry.get(); TableStyleSheetEntry * pTableEntry = dynamic_cast<TableStyleSheetEntry*>( pEntry ); - if (nType == TBL_STYLE_UNKNOWN) + if (nType == TblStyleType::Unknown) { pEntry->m_pProperties->InsertProps(pProps); } diff --git a/sw/source/writerfilter/dmapper/TblStylePrHandler.cxx b/sw/source/writerfilter/dmapper/TblStylePrHandler.cxx index 37c9b1b6c139..3ad0375381af 100644 --- a/sw/source/writerfilter/dmapper/TblStylePrHandler.cxx +++ b/sw/source/writerfilter/dmapper/TblStylePrHandler.cxx @@ -34,7 +34,7 @@ TblStylePrHandler::TblStylePrHandler( DomainMapper & rDMapper ) : LoggedProperties("TblStylePrHandler"), m_rDMapper( rDMapper ), m_pTablePropsHandler(new TablePropertiesHandler()), -m_nType( TBL_STYLE_UNKNOWN ), +m_nType( TblStyleType::Unknown ), m_pProperties( new PropertyMap ) { } @@ -47,19 +47,19 @@ OUString TblStylePrHandler::getTypeString() const { switch (m_nType) { - case TBL_STYLE_WHOLETABLE: return u"wholeTable"_ustr; - case TBL_STYLE_FIRSTROW: return u"firstRow"_ustr; - case TBL_STYLE_LASTROW: return u"lastRow"_ustr; - case TBL_STYLE_FIRSTCOL: return u"firstCol"_ustr; - case TBL_STYLE_LASTCOL: return u"lastCol"_ustr; - case TBL_STYLE_BAND1VERT: return u"band1Vert"_ustr; - case TBL_STYLE_BAND2VERT: return u"band2Vert"_ustr; - case TBL_STYLE_BAND1HORZ: return u"band1Horz"_ustr; - case TBL_STYLE_BAND2HORZ: return u"band2Horz"_ustr; - case TBL_STYLE_NECELL: return u"neCell"_ustr; - case TBL_STYLE_NWCELL: return u"nwCell"_ustr; - case TBL_STYLE_SECELL: return u"seCell"_ustr; - case TBL_STYLE_SWCELL: return u"swCell"_ustr; + case TblStyleType::WholeTable: return u"wholeTable"_ustr; + case TblStyleType::FirstRow: return u"firstRow"_ustr; + case TblStyleType::LastRow: return u"lastRow"_ustr; + case TblStyleType::FirstCol: return u"firstCol"_ustr; + case TblStyleType::LastCol: return u"lastCol"_ustr; + case TblStyleType::Band1Vert: return u"band1Vert"_ustr; + case TblStyleType::Band2Vert: return u"band2Vert"_ustr; + case TblStyleType::Band1Horz: return u"band1Horz"_ustr; + case TblStyleType::Band2Horz: return u"band2Horz"_ustr; + case TblStyleType::NECell: return u"neCell"_ustr; + case TblStyleType::NWCell: return u"nwCell"_ustr; + case TblStyleType::SECell: return u"seCell"_ustr; + case TblStyleType::SWCell: return u"swCell"_ustr; default: break; } return OUString(); @@ -75,43 +75,43 @@ void TblStylePrHandler::lcl_attribute(Id rName, const Value & rVal) switch (rVal.getInt()) { case NS_ooxml::LN_Value_ST_TblStyleOverrideType_wholeTable: - m_nType = TBL_STYLE_WHOLETABLE; + m_nType = TblStyleType::WholeTable; break; case NS_ooxml::LN_Value_ST_TblStyleOverrideType_firstRow: - m_nType = TBL_STYLE_FIRSTROW; + m_nType = TblStyleType::FirstRow; break; case NS_ooxml::LN_Value_ST_TblStyleOverrideType_lastRow: - m_nType = TBL_STYLE_LASTROW; + m_nType = TblStyleType::LastRow; break; case NS_ooxml::LN_Value_ST_TblStyleOverrideType_firstCol: - m_nType = TBL_STYLE_FIRSTCOL; + m_nType = TblStyleType::FirstCol; break; case NS_ooxml::LN_Value_ST_TblStyleOverrideType_lastCol: - m_nType = TBL_STYLE_LASTCOL; + m_nType = TblStyleType::LastCol; break; case NS_ooxml::LN_Value_ST_TblStyleOverrideType_band1Vert: - m_nType = TBL_STYLE_BAND1VERT; + m_nType = TblStyleType::Band1Vert; break; case NS_ooxml::LN_Value_ST_TblStyleOverrideType_band2Vert: - m_nType = TBL_STYLE_BAND2VERT; + m_nType = TblStyleType::Band2Vert; break; case NS_ooxml::LN_Value_ST_TblStyleOverrideType_band1Horz: - m_nType = TBL_STYLE_BAND1HORZ; + m_nType = TblStyleType::Band1Horz; break; case NS_ooxml::LN_Value_ST_TblStyleOverrideType_band2Horz: - m_nType = TBL_STYLE_BAND2HORZ; + m_nType = TblStyleType::Band2Horz; break; case NS_ooxml::LN_Value_ST_TblStyleOverrideType_neCell: - m_nType = TBL_STYLE_NECELL; + m_nType = TblStyleType::NECell; break; case NS_ooxml::LN_Value_ST_TblStyleOverrideType_nwCell: - m_nType = TBL_STYLE_NWCELL; + m_nType = TblStyleType::NWCell; break; case NS_ooxml::LN_Value_ST_TblStyleOverrideType_seCell: - m_nType = TBL_STYLE_SECELL; + m_nType = TblStyleType::SECell; break; case NS_ooxml::LN_Value_ST_TblStyleOverrideType_swCell: - m_nType = TBL_STYLE_SWCELL; + m_nType = TblStyleType::SWCell; break; } } diff --git a/sw/source/writerfilter/dmapper/TblStylePrHandler.hxx b/sw/source/writerfilter/dmapper/TblStylePrHandler.hxx index fb3c4926a490..89958c7464d3 100644 --- a/sw/source/writerfilter/dmapper/TblStylePrHandler.hxx +++ b/sw/source/writerfilter/dmapper/TblStylePrHandler.hxx @@ -30,22 +30,22 @@ namespace writerfilter::dmapper { class DomainMapper; -enum TblStyleType +enum class TblStyleType { - TBL_STYLE_UNKNOWN, - TBL_STYLE_WHOLETABLE, - TBL_STYLE_FIRSTROW, - TBL_STYLE_LASTROW, - TBL_STYLE_FIRSTCOL, - TBL_STYLE_LASTCOL, - TBL_STYLE_BAND1VERT, - TBL_STYLE_BAND2VERT, - TBL_STYLE_BAND1HORZ, - TBL_STYLE_BAND2HORZ, - TBL_STYLE_NECELL, - TBL_STYLE_NWCELL, - TBL_STYLE_SECELL, - TBL_STYLE_SWCELL + Unknown, + WholeTable, + FirstRow, + LastRow, + FirstCol, + LastCol, + Band1Vert, + Band2Vert, + Band1Horz, + Band2Horz, + NECell, + NWCell, + SECell, + SWCell }; class TblStylePrHandler : public LoggedProperties commit 1081b9ddb3e4d06801eb0d2425fb334f5604a689 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Jul 10 16:17:25 2025 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Jul 11 09:20:42 2025 +0200 convert StreamType_t to scoped enum Change-Id: I59d7bcf1fb034e1d1ef0e2eda4c155939fc0e825 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187643 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/source/writerfilter/filter/WriterFilter.cxx b/sw/source/writerfilter/filter/WriterFilter.cxx index 17883d5d8b40..f0c26c738ce9 100644 --- a/sw/source/writerfilter/filter/WriterFilter.cxx +++ b/sw/source/writerfilter/filter/WriterFilter.cxx @@ -255,7 +255,7 @@ sal_Bool WriterFilter::filter(const uno::Sequence<beans::PropertyValue>& rDescri writerfilter::ooxml::OOXMLStream::Pointer_t pVBAProjectStream( writerfilter::ooxml::OOXMLDocumentFactory::createStream( - pDocStream, writerfilter::ooxml::OOXMLStream::VBAPROJECT)); + pDocStream, writerfilter::ooxml::OOXMLStream::StreamType_t::VBAPROJECT)); oox::StorageRef xVbaPrjStrg = std::make_shared<::oox::ole::OleStorage>( m_xContext, pVBAProjectStream->getDocumentStream(), false); if (xVbaPrjStrg && xVbaPrjStrg->isStorage()) @@ -276,7 +276,7 @@ sal_Bool WriterFilter::filter(const uno::Sequence<beans::PropertyValue>& rDescri writerfilter::ooxml::OOXMLStream::Pointer_t pVBADataStream( writerfilter::ooxml::OOXMLDocumentFactory::createStream( - pDocStream, writerfilter::ooxml::OOXMLStream::VBADATA)); + pDocStream, writerfilter::ooxml::OOXMLStream::StreamType_t::VBADATA)); if (pVBADataStream) { uno::Reference<io::XInputStream> xDataStream = pVBADataStream->getDocumentStream(); diff --git a/sw/source/writerfilter/inc/ooxml/OOXMLDocument.hxx b/sw/source/writerfilter/inc/ooxml/OOXMLDocument.hxx index 2b43069cde96..21c8fb98d925 100644 --- a/sw/source/writerfilter/inc/ooxml/OOXMLDocument.hxx +++ b/sw/source/writerfilter/inc/ooxml/OOXMLDocument.hxx @@ -75,7 +75,7 @@ namespace writerfilter::ooxml class OOXMLStream : public virtual SvRefBase { public: - enum StreamType_t { UNKNOWN, DOCUMENT, STYLES, WEBSETTINGS, FONTTABLE, NUMBERING, + enum class StreamType_t { UNKNOWN, DOCUMENT, STYLES, WEBSETTINGS, FONTTABLE, NUMBERING, FOOTNOTES, ENDNOTES, COMMENTS, COMMENTS_EXTENDED, THEME, CUSTOMXML, CUSTOMXMLPROPS, GLOSSARY, CHARTS, EMBEDDINGS, SETTINGS, VBAPROJECT, FOOTER, HEADER, VBADATA }; typedef tools::SvRef<OOXMLStream> Pointer_t; diff --git a/sw/source/writerfilter/ooxml/OOXMLDocumentImpl.cxx b/sw/source/writerfilter/ooxml/OOXMLDocumentImpl.cxx index 8caaddbc1e6a..cedaae79adb0 100644 --- a/sw/source/writerfilter/ooxml/OOXMLDocumentImpl.cxx +++ b/sw/source/writerfilter/ooxml/OOXMLDocumentImpl.cxx @@ -86,7 +86,7 @@ void OOXMLDocumentImpl::resolveFastSubStream(Stream & rStreamHandler, catch (uno::Exception const&) { TOOLS_INFO_EXCEPTION("writerfilter.ooxml", "resolveFastSubStream: exception while " - "resolving stream " << nType); + "resolving stream " << static_cast<int>(nType)); return; } OOXMLStream::Pointer_t savedStream = mpStream; @@ -139,7 +139,7 @@ uno::Reference<xml::dom::XDocument> OOXMLDocumentImpl::importSubStream(OOXMLStre catch (uno::Exception const&) { TOOLS_INFO_EXCEPTION("writerfilter.ooxml", "importSubStream: exception while " - "importing stream " << nType); + "importing stream " << static_cast<int>(nType)); return xRet; } @@ -155,18 +155,18 @@ uno::Reference<xml::dom::XDocument> OOXMLDocumentImpl::importSubStream(OOXMLStre catch (uno::Exception const&) { TOOLS_INFO_EXCEPTION("writerfilter.ooxml", "importSubStream: exception while " - "parsing stream " << nType); + "parsing stream " << static_cast<int>(nType)); return xRet; } } - if (OOXMLStream::CUSTOMXML == nType) + if (OOXMLStream::StreamType_t::CUSTOMXML == nType) { - importSubStreamRelations(pStream, OOXMLStream::CUSTOMXMLPROPS); + importSubStreamRelations(pStream, OOXMLStream::StreamType_t::CUSTOMXMLPROPS); } - else if (OOXMLStream::CHARTS == nType) + else if (OOXMLStream::StreamType_t::CHARTS == nType) { - importSubStreamRelations(pStream, OOXMLStream::EMBEDDINGS); + importSubStreamRelations(pStream, OOXMLStream::StreamType_t::EMBEDDINGS); } return xRet; @@ -184,7 +184,7 @@ void OOXMLDocumentImpl::importSubStreamRelations(const OOXMLStream::Pointer_t& p catch (uno::Exception const&) { TOOLS_WARN_EXCEPTION("writerfilter.ooxml", "importSubStreamRelations: exception while " - "importing stream " << nType); + "importing stream " << static_cast<int>(nType)); return; } @@ -194,7 +194,7 @@ void OOXMLDocumentImpl::importSubStreamRelations(const OOXMLStream::Pointer_t& p return; // importing itemprops files for item.xml from customXml. - if (OOXMLStream::CUSTOMXMLPROPS == nType) + if (OOXMLStream::StreamType_t::CUSTOMXMLPROPS == nType) { try { @@ -205,7 +205,7 @@ void OOXMLDocumentImpl::importSubStreamRelations(const OOXMLStream::Pointer_t& p catch (uno::Exception const&) { TOOLS_WARN_EXCEPTION("writerfilter.ooxml", "importSubStream: exception while " - "parsing stream " << nType); + "parsing stream " << static_cast<int>(nType)); mxCustomXmlProsDom = xRelation; } @@ -214,13 +214,13 @@ void OOXMLDocumentImpl::importSubStreamRelations(const OOXMLStream::Pointer_t& p mxCustomXmlProsDom = std::move(xRelation); } } - else if(OOXMLStream::EMBEDDINGS == nType) + else if(OOXMLStream::StreamType_t::EMBEDDINGS == nType) { mxEmbeddings = std::move(xcpInputStream); } - else if(OOXMLStream::CHARTS == nType) + else if(OOXMLStream::StreamType_t::CHARTS == nType) { - importSubStreamRelations(cStream, OOXMLStream::EMBEDDINGS); + importSubStreamRelations(cStream, OOXMLStream::StreamType_t::EMBEDDINGS); } } @@ -273,7 +273,7 @@ void OOXMLDocumentImpl::resolveFootnote(Stream & rStream, const sal_Int32 nNoteId) { if (!mpXFootnoteStream) - mpXFootnoteStream = getXNoteStream(OOXMLStream::FOOTNOTES, nNoteId); + mpXFootnoteStream = getXNoteStream(OOXMLStream::StreamType_t::FOOTNOTES, nNoteId); Id nId; switch (aType) @@ -295,7 +295,7 @@ void OOXMLDocumentImpl::resolveEndnote(Stream & rStream, const sal_Int32 nNoteId) { if (!mpXEndnoteStream) - mpXEndnoteStream = getXNoteStream(OOXMLStream::ENDNOTES, nNoteId); + mpXEndnoteStream = getXNoteStream(OOXMLStream::StreamType_t::ENDNOTES, nNoteId); Id nId; switch (aType) @@ -314,7 +314,7 @@ void OOXMLDocumentImpl::resolveEndnote(Stream & rStream, void OOXMLDocumentImpl::resolveCommentsExtendedStream(Stream& rStream) { - resolveFastSubStream(rStream, OOXMLStream::COMMENTS_EXTENDED); + resolveFastSubStream(rStream, OOXMLStream::StreamType_t::COMMENTS_EXTENDED); } void OOXMLDocumentImpl::resolveComment(Stream & rStream, @@ -327,7 +327,7 @@ void OOXMLDocumentImpl::resolveComment(Stream & rStream, } writerfilter::Reference<Stream>::Pointer_t pStream = - getXNoteStream(OOXMLStream::COMMENTS, nId); + getXNoteStream(OOXMLStream::StreamType_t::COMMENTS, nId); resolveFastSubStreamWithId(rStream, pStream, NS_ooxml::LN_annotation); } @@ -440,7 +440,7 @@ void OOXMLDocumentImpl::resolve(Stream & rStream) if (utl::MediaDescriptor(maMediaDescriptor).getUnpackedValueOrDefault(u"ReadGlossaries"_ustr, false)) { - resolveFastSubStream(rStream, OOXMLStream::GLOSSARY); + resolveFastSubStream(rStream, OOXMLStream::StreamType_t::GLOSSARY); return; } @@ -481,16 +481,16 @@ void OOXMLDocumentImpl::resolve(Stream & rStream) pDocHandler->setIsSubstream( mbIsSubstream ); uno::Reference < xml::sax::XFastTokenHandler > xTokenHandler(mpStream->getFastTokenHandler()); - resolveFastSubStream(rStream, OOXMLStream::SETTINGS); - mxThemeDom = importSubStream(OOXMLStream::THEME); - resolveFastSubStream(rStream, OOXMLStream::THEME); + resolveFastSubStream(rStream, OOXMLStream::StreamType_t::SETTINGS); + mxThemeDom = importSubStream(OOXMLStream::StreamType_t::THEME); + resolveFastSubStream(rStream, OOXMLStream::StreamType_t::THEME); // Convert the oox::Theme to the draw page { auto pThemePtr = getTheme(); if (pThemePtr) pThemePtr->addTheme(getDrawPage()); } - mxGlossaryDocDom = importSubStream(OOXMLStream::GLOSSARY); + mxGlossaryDocDom = importSubStream(OOXMLStream::StreamType_t::GLOSSARY); if (mxGlossaryDocDom.is()) resolveGlossaryStream(rStream); @@ -499,9 +499,9 @@ void OOXMLDocumentImpl::resolve(Stream & rStream) // Custom xml's are handled as part of grab bag. resolveCustomXmlStream(rStream); - resolveFastSubStream(rStream, OOXMLStream::FONTTABLE); - resolveFastSubStream(rStream, OOXMLStream::STYLES); - resolveFastSubStream(rStream, OOXMLStream::NUMBERING); + resolveFastSubStream(rStream, OOXMLStream::StreamType_t::FONTTABLE); + resolveFastSubStream(rStream, OOXMLStream::StreamType_t::STYLES); + resolveFastSubStream(rStream, OOXMLStream::StreamType_t::NUMBERING); xParser->setFastDocumentHandler( pDocHandler ); xParser->setTokenHandler( xTokenHandler ); @@ -587,14 +587,14 @@ void OOXMLDocumentImpl::resolveCustomXmlStream(Stream & rStream) if (bFound) { - uno::Reference<xml::dom::XDocument> customXmlTemp = importSubStream(OOXMLStream::CUSTOMXML); + uno::Reference<xml::dom::XDocument> customXmlTemp = importSubStream(OOXMLStream::StreamType_t::CUSTOMXML); // This will add all item[n].xml with its relationship file i.e itemprops.xml to // grabbag list. if (mxCustomXmlProsDom.is() && customXmlTemp.is()) { aCustomXmlDomList.push_back(customXmlTemp); aCustomXmlDomPropsList.push_back(mxCustomXmlProsDom); - resolveFastSubStream(rStream, OOXMLStream::CUSTOMXML); + resolveFastSubStream(rStream, OOXMLStream::StreamType_t::CUSTOMXML); } bFound = false; @@ -640,12 +640,12 @@ void OOXMLDocumentImpl::resolveGlossaryStream(Stream & /*rStream*/) OOXMLStream::Pointer_t pStream; try { - pStream = OOXMLDocumentFactory::createStream(mpStream, OOXMLStream::GLOSSARY); + pStream = OOXMLDocumentFactory::createStream(mpStream, OOXMLStream::StreamType_t::GLOSSARY); } catch (uno::Exception const&) { TOOLS_INFO_EXCEPTION("writerfilter.ooxml", "resolveGlossaryStream: exception while " - "createStream for glossary" << OOXMLStream::GLOSSARY); + "createStream for glossary" << static_cast<int>(OOXMLStream::StreamType_t::GLOSSARY)); return; } uno::Reference<embed::XRelationshipAccess> xRelationshipAccess; @@ -663,35 +663,35 @@ void OOXMLDocumentImpl::resolveGlossaryStream(Stream & /*rStream*/) aRelDefinition.put(name, value); const OUString gType = aRelDefinition.getOrDefault(sType, OUString{}); - OOXMLStream::StreamType_t nType(OOXMLStream::UNKNOWN); + OOXMLStream::StreamType_t nType(OOXMLStream::StreamType_t::UNKNOWN); if (gType == sSettingsType || gType == sSettingsTypeStrict) { - nType = OOXMLStream::SETTINGS; + nType = OOXMLStream::StreamType_t::SETTINGS; aRelDefinition.put(sContentType, sSettingsContentType); } else if (gType == sEndnotesType || gType == sEndnoteTypeStrict) { - nType = OOXMLStream::ENDNOTES; + nType = OOXMLStream::StreamType_t::ENDNOTES; aRelDefinition.put(sContentType, sEndnotesContentType); } else if (gType == sFootnotesType || gType == sFootnoteTypeStrict) { - nType = OOXMLStream::FOOTNOTES; + nType = OOXMLStream::StreamType_t::FOOTNOTES; aRelDefinition.put(sContentType, sFootnotesContentType); } else if (gType == sStylesType || gType == sStylesTypeStrict) { - nType = OOXMLStream::STYLES; + nType = OOXMLStream::StreamType_t::STYLES; aRelDefinition.put(sContentType, sStylesContentType); } else if (gType == sWebSettings || gType == sWebSettingsStrict) { - nType = OOXMLStream::WEBSETTINGS; + nType = OOXMLStream::StreamType_t::WEBSETTINGS; aRelDefinition.put(sContentType, sWebsettingsContentType); } else if (gType == sFonttableType || gType == sFonttableTypeStrict) { - nType = OOXMLStream::FONTTABLE; + nType = OOXMLStream::StreamType_t::FONTTABLE; aRelDefinition.put(sContentType, sFonttableContentType); } else if (aRelDefinition.getOrDefault(sTargetMode, OUString{}) != "External") @@ -704,7 +704,7 @@ void OOXMLDocumentImpl::resolveGlossaryStream(Stream & /*rStream*/) continue; } - if (nType != OOXMLStream::UNKNOWN) + if (nType != OOXMLStream::StreamType_t::UNKNOWN) { try { @@ -718,7 +718,7 @@ void OOXMLDocumentImpl::resolveGlossaryStream(Stream & /*rStream*/) catch (uno::Exception const&) { TOOLS_INFO_EXCEPTION("writerfilter.ooxml", "importSubStream: exception while " - "parsing stream of Type" << nType); + "parsing stream of Type" << static_cast<int>(nType)); } } aGlossaryDomList.push_back(aRelDefinition.getNamedValues()); @@ -741,7 +741,7 @@ void OOXMLDocumentImpl::resolveEmbeddingsStream(const OOXMLStream::Pointer_t& pS bool bFound = false; bool bHeaderFooterFound = false; - OOXMLStream::StreamType_t streamType = OOXMLStream::UNKNOWN; + OOXMLStream::StreamType_t streamType = OOXMLStream::StreamType_t::UNKNOWN; const uno::Sequence< uno::Sequence< beans::StringPair > >aSeqs = xRelationshipAccess->getAllRelationships(); for (const uno::Sequence< beans::StringPair >& aSeq : aSeqs) { @@ -756,13 +756,13 @@ void OOXMLDocumentImpl::resolveEmbeddingsStream(const OOXMLStream::Pointer_t& pS aPair.Second == sFootersTypeStrict) { bHeaderFooterFound = true; - streamType = OOXMLStream::FOOTER; + streamType = OOXMLStream::StreamType_t::FOOTER; } else if(aPair.Second == sHeaderType || aPair.Second == sHeaderTypeStrict) { bHeaderFooterFound = true; - streamType = OOXMLStream::HEADER; + streamType = OOXMLStream::StreamType_t::HEADER; } else if(aPair.First == "Target" && ( bFound || bHeaderFooterFound )) { @@ -775,7 +775,7 @@ void OOXMLDocumentImpl::resolveEmbeddingsStream(const OOXMLStream::Pointer_t& pS { if(bFound) { - importSubStreamRelations(pStream, OOXMLStream::CHARTS); + importSubStreamRelations(pStream, OOXMLStream::StreamType_t::CHARTS); } if (bHeaderFooterFound && !maSeenStreams.contains(customTarget)) { @@ -789,7 +789,7 @@ void OOXMLDocumentImpl::resolveEmbeddingsStream(const OOXMLStream::Pointer_t& pS catch (uno::Exception const&) { TOOLS_INFO_EXCEPTION("writerfilter.ooxml", "resolveEmbeddingsStream: can't find header/footer whilst " - "resolving stream " << streamType); + "resolving stream " << static_cast<int>(streamType)); return; } } diff --git a/sw/source/writerfilter/ooxml/OOXMLStreamImpl.cxx b/sw/source/writerfilter/ooxml/OOXMLStreamImpl.cxx index ed9fbcfbeddd..bd8d81062f51 100644 --- a/sw/source/writerfilter/ooxml/OOXMLStreamImpl.cxx +++ b/sw/source/writerfilter/ooxml/OOXMLStreamImpl.cxx @@ -62,7 +62,7 @@ OOXMLStreamImpl::OOXMLStreamImpl : mxContext(rOOXMLStream.mxContext), mxStorageStream(rOOXMLStream.mxStorageStream), mxStorage(rOOXMLStream.mxStorage), - mnStreamType(UNKNOWN), + mnStreamType(StreamType_t::UNKNOWN), msId(std::move(sId)), msPath(rOOXMLStream.msPath) { @@ -174,83 +174,83 @@ bool OOXMLStreamImpl::lcl_getTarget(const uno::Reference<embed::XRelationshipAcc switch (nStreamType) { - case VBAPROJECT: + case StreamType_t::VBAPROJECT: sStreamType = sVBAProjectType; sStreamTypeStrict = sVBAProjectType; break; - case VBADATA: + case StreamType_t::VBADATA: sStreamType = sVBADataType; sStreamTypeStrict = sVBADataType; break; - case DOCUMENT: + case StreamType_t::DOCUMENT: sStreamType = sDocumentType; sStreamTypeStrict = sDocumentTypeStrict; break; - case STYLES: + case StreamType_t::STYLES: sStreamType = sStylesType; sStreamTypeStrict = sStylesTypeStrict; break; - case NUMBERING: + case StreamType_t::NUMBERING: sStreamType = sNumberingType; sStreamTypeStrict = sNumberingTypeStrict; break; - case FONTTABLE: + case StreamType_t::FONTTABLE: sStreamType = sFonttableType; sStreamTypeStrict = sFonttableTypeStrict; break; - case FOOTNOTES: + case StreamType_t::FOOTNOTES: sStreamType = sFootnotesType; sStreamTypeStrict = sFootnotesTypeStrict; break; - case ENDNOTES: + case StreamType_t::ENDNOTES: sStreamType = sEndnotesType; sStreamTypeStrict = sEndnotesTypeStrict; break; - case COMMENTS: + case StreamType_t::COMMENTS: sStreamType = sCommentsType; sStreamTypeStrict = sCommentsTypeStrict; break; - case THEME: + case StreamType_t::THEME: sStreamType = sThemeType; sStreamTypeStrict = sThemeTypeStrict; break; - case CUSTOMXML: + case StreamType_t::CUSTOMXML: sStreamType = sCustomType; sStreamTypeStrict = sCustomTypeStrict; break; - case CUSTOMXMLPROPS: + case StreamType_t::CUSTOMXMLPROPS: sStreamType = sCustomPropsType; sStreamTypeStrict = sCustomPropsTypeStrict; break; - case SETTINGS: + case StreamType_t::SETTINGS: sStreamType = sSettingsType; sStreamTypeStrict = sSettingsTypeStrict; break; - case GLOSSARY: + case StreamType_t::GLOSSARY: sStreamType = sGlossaryType; sStreamTypeStrict = sGlossaryTypeStrict; break; - case WEBSETTINGS: + case StreamType_t::WEBSETTINGS: sStreamType = sWebSettings; sStreamTypeStrict = sWebSettingsStrict; break; - case CHARTS: + case StreamType_t::CHARTS: sStreamType = sChartType; sStreamTypeStrict = sChartTypeStrict; break; - case EMBEDDINGS: + case StreamType_t::EMBEDDINGS: sStreamType = sEmbeddingsType; sStreamTypeStrict = sEmbeddingsTypeStrict; break; - case FOOTER: + case StreamType_t::FOOTER: sStreamType = sFooterType; sStreamTypeStrict = sFootersTypeStrict; break; - case HEADER: + case StreamType_t::HEADER: sStreamType = sHeaderType; sStreamTypeStrict = sHeaderTypeStrict; break; - case COMMENTS_EXTENDED: + case StreamType_t::COMMENTS_EXTENDED: sStreamType = sCommentsExtendedType; sStreamTypeStrict = sCommentsExtendedType; break; @@ -276,7 +276,7 @@ bool OOXMLStreamImpl::lcl_getTarget(const uno::Reference<embed::XRelationshipAcc else if(rPair.First == sType && ((rPair.Second == sOleObjectType || rPair.Second == sOleObjectTypeStrict) && - nStreamType == EMBEDDINGS)) + nStreamType == StreamType_t::EMBEDDINGS)) { bFound = true; } @@ -343,7 +343,7 @@ OUString OOXMLStreamImpl::getTargetForId(const OUString & rId) uno::Reference<embed::XRelationshipAccess> xRelationshipAccess (mxDocumentStream, uno::UNO_QUERY_THROW); - if (lcl_getTarget(xRelationshipAccess, UNKNOWN, rId, sTarget)) + if (lcl_getTarget(xRelationshipAccess, StreamType_t::UNKNOWN, rId, sTarget)) return sTarget; return OUString(); @@ -406,7 +406,7 @@ OOXMLDocumentFactory::createStream bool bRepairStorage) { OOXMLStreamImpl * pStream = new OOXMLStreamImpl(xContext, rStream, - OOXMLStream::DOCUMENT, bRepairStorage); + OOXMLStream::StreamType_t::DOCUMENT, bRepairStorage); return OOXMLStream::Pointer_t(pStream); } @@ -416,7 +416,7 @@ OOXMLDocumentFactory::createStream { OOXMLStream::Pointer_t pRet; - if (nStreamType != OOXMLStream::VBADATA) + if (nStreamType != OOXMLStream::StreamType_t::VBADATA) { if (OOXMLStreamImpl* pImpl = dynamic_cast<OOXMLStreamImpl *>(pStream.get())) pRet = new OOXMLStreamImpl(*pImpl, nStreamType); @@ -426,8 +426,8 @@ OOXMLDocumentFactory::createStream // VBADATA is not a relation of the document, but of the VBAPROJECT stream. if (OOXMLStreamImpl* pImpl = dynamic_cast<OOXMLStreamImpl *>(pStream.get())) { - OOXMLStreamImpl aProject(*pImpl, OOXMLStream::VBAPROJECT); - pRet = new OOXMLStreamImpl(aProject, OOXMLStream::VBADATA); + OOXMLStreamImpl aProject(*pImpl, OOXMLStream::StreamType_t::VBAPROJECT); + pRet = new OOXMLStreamImpl(aProject, OOXMLStream::StreamType_t::VBADATA); } }