diff options
89 files changed, 382 insertions, 655 deletions
diff --git a/comphelper/source/xml/attributelist.cxx b/comphelper/source/xml/attributelist.cxx index a02c82f69465..69f8a2aca62c 100644 --- a/comphelper/source/xml/attributelist.cxx +++ b/comphelper/source/xml/attributelist.cxx @@ -19,23 +19,15 @@ #include <comphelper/attributelist.hxx> +#include <algorithm> +#include <cassert> + using namespace osl; using namespace com::sun::star; namespace comphelper { -OUString SAL_CALL AttributeList::getTypeByName( const OUString& sName ) -{ - for (auto const& attribute : mAttributes) - { - if( attribute.sName == sName ) { - return attribute.sType; - } - } - return OUString(); -} - OUString SAL_CALL AttributeList::getValueByName(const OUString& sName) { for (auto const& attribute : mAttributes) @@ -53,10 +45,12 @@ AttributeList::AttributeList() mAttributes.reserve(20); } -AttributeList::AttributeList(const AttributeList &r) - : cppu::WeakImplHelper<XAttributeList, XCloneable>(r) +AttributeList::AttributeList(const uno::Reference< xml::sax::XAttributeList>& rAttrList) { - mAttributes = r.mAttributes; + if (AttributeList* pImpl = dynamic_cast<AttributeList*>(rAttrList.get())) + mAttributes = pImpl->mAttributes; + else + AppendAttributeList(rAttrList); } AttributeList::~AttributeList() @@ -68,6 +62,66 @@ css::uno::Reference< css::util::XCloneable > AttributeList::createClone() return new AttributeList( *this ); } +void AttributeList::AddAttribute(const OUString& sName, const OUString& sValue) +{ + assert(!sName.isEmpty() && "empty attribute name is invalid"); + assert(std::count(sName.getStr(), sName.getStr() + sName.getLength(), u':') <= 1 + && "too many colons"); + // TODO: this assertion fails in tests! +// assert(std::none_of(mAttributes.begin(), mAttributes.end(), +// [&sName](const TagAttribute& a) { return a.sName == sName; })); + mAttributes.push_back({ sName, sValue }); +} + +void AttributeList::RemoveAttribute(const OUString& sName) +{ + auto ii = std::find_if(mAttributes.begin(), mAttributes.end(), + [&sName](const TagAttribute& rAttr) { return rAttr.sName == sName; }); + + if (ii != mAttributes.end()) + mAttributes.erase(ii); +} + +void AttributeList::AppendAttributeList(const uno::Reference<css::xml::sax::XAttributeList>& r) +{ + assert(r.is()); + + sal_Int16 nMax = r->getLength(); + sal_Int16 nTotalSize = mAttributes.size() + nMax; + mAttributes.reserve(nTotalSize); + + for (sal_Int16 i = 0; i < nMax; ++i) + AddAttribute(r->getNameByIndex(i), r->getValueByIndex(i)); + + assert(nTotalSize == getLength()); +} + +void AttributeList::SetValueByIndex(sal_Int16 i, const OUString& rValue) +{ + mAttributes[i].sValue = rValue; +} + +void AttributeList::RemoveAttributeByIndex(sal_Int16 i) +{ + mAttributes.erase(mAttributes.begin() + i); +} + +void AttributeList::RenameAttributeByIndex(sal_Int16 i, const OUString& rNewName) +{ + mAttributes[i].sName = rNewName; +} + +sal_Int16 AttributeList::GetIndexByName(const OUString& rName) const +{ + auto ii = std::find_if(mAttributes.begin(), mAttributes.end(), + [&rName](const TagAttribute& rAttr) { return rAttr.sName == rName; }); + + if (ii != mAttributes.end()) + return static_cast<sal_Int16>(std::distance(mAttributes.begin(), ii)); + + return -1; +} + } // namespace comphelper /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/comphelper/source/xml/ofopxmlhelper.cxx b/comphelper/source/xml/ofopxmlhelper.cxx index 52f6c63568a9..a2797ef3a49b 100644 --- a/comphelper/source/xml/ofopxmlhelper.cxx +++ b/comphelper/source/xml/ofopxmlhelper.cxx @@ -142,14 +142,12 @@ void WriteRelationsInfoSequence( OUString aRelListElement( "Relationships" ); OUString aRelElement( "Relationship" ); - OUString aCDATAString( "CDATA" ); OUString aWhiteSpace( " " ); // write the namespace rtl::Reference<AttributeList> pRootAttrList = new AttributeList; pRootAttrList->AddAttribute( "xmlns", - aCDATAString, "http://schemas.openxmlformats.org/package/2006/relationships" ); xWriter->startDocument(); @@ -168,7 +166,7 @@ void WriteRelationsInfoSequence( // TODO/LATER: should the extensions be allowed? throw lang::IllegalArgumentException(); } - pAttrList->AddAttribute( pair.First, aCDATAString, pair.Second ); + pAttrList->AddAttribute( pair.First, pair.Second ); } xWriter->startElement( aRelElement, pAttrList ); @@ -199,14 +197,12 @@ void WriteContentSequence( static constexpr OUStringLiteral aDefaultElement(u"Default"); static constexpr OUStringLiteral aOverrideElement(u"Override"); static constexpr OUStringLiteral aContentTypeAttr(u"ContentType"); - static constexpr OUStringLiteral aCDATAString(u"CDATA"); static constexpr OUStringLiteral aWhiteSpace(u" "); // write the namespace rtl::Reference<AttributeList> pRootAttrList = new AttributeList; pRootAttrList->AddAttribute( "xmlns", - aCDATAString, "http://schemas.openxmlformats.org/package/2006/content-types" ); xWriter->startDocument(); @@ -215,8 +211,8 @@ void WriteContentSequence( for ( const beans::StringPair & pair : aDefaultsSequence ) { rtl::Reference<AttributeList> pAttrList = new AttributeList; - pAttrList->AddAttribute( "Extension", aCDATAString, pair.First ); - pAttrList->AddAttribute( aContentTypeAttr, aCDATAString, pair.Second ); + pAttrList->AddAttribute( "Extension", pair.First ); + pAttrList->AddAttribute( aContentTypeAttr, pair.Second ); xWriter->startElement( aDefaultElement, pAttrList ); xWriter->ignorableWhitespace( aWhiteSpace ); @@ -226,8 +222,8 @@ void WriteContentSequence( for ( const beans::StringPair & pair : aOverridesSequence ) { rtl::Reference<AttributeList> pAttrList = new AttributeList; - pAttrList->AddAttribute( "PartName", aCDATAString, pair.First ); - pAttrList->AddAttribute( aContentTypeAttr, aCDATAString, pair.Second ); + pAttrList->AddAttribute( "PartName", pair.First ); + pAttrList->AddAttribute( aContentTypeAttr, pair.Second ); xWriter->startElement( aOverrideElement, pAttrList ); xWriter->ignorableWhitespace( aWhiteSpace ); diff --git a/dbaccess/source/core/recovery/storagexmlstream.cxx b/dbaccess/source/core/recovery/storagexmlstream.cxx index a4a88fa0df8f..98e238265b99 100644 --- a/dbaccess/source/core/recovery/storagexmlstream.cxx +++ b/dbaccess/source/core/recovery/storagexmlstream.cxx @@ -25,8 +25,8 @@ #include <com/sun/star/xml/sax/Writer.hpp> #include <rtl/ref.hxx> +#include <comphelper/attributelist.hxx> #include <comphelper/diagnose_ex.hxx> -#include <xmloff/attrlist.hxx> #include <stack> @@ -48,7 +48,7 @@ namespace dbaccess { Reference< XDocumentHandler > xHandler; std::stack< OUString > aElements; - ::rtl::Reference< SvXMLAttributeList > xAttributes; + ::rtl::Reference<comphelper::AttributeList> xAttributes; }; // StorageXMLOutputStream @@ -64,7 +64,7 @@ namespace dbaccess m_pData->xHandler.set( xSaxWriter, UNO_QUERY_THROW ); m_pData->xHandler->startDocument(); - m_pData->xAttributes = new SvXMLAttributeList; + m_pData->xAttributes = new comphelper::AttributeList; } StorageXMLOutputStream::~StorageXMLOutputStream() @@ -89,7 +89,7 @@ namespace dbaccess ENSURE_OR_RETURN_VOID( m_pData->xHandler.is(), "no document handler" ); m_pData->xHandler->startElement( i_rElementName, m_pData->xAttributes ); - m_pData->xAttributes = new SvXMLAttributeList; + m_pData->xAttributes = new comphelper::AttributeList; m_pData->aElements.push( i_rElementName ); } diff --git a/dbaccess/source/filter/xml/xmlAutoStyle.cxx b/dbaccess/source/filter/xml/xmlAutoStyle.cxx index 99101567111a..f55e620ec1d6 100644 --- a/dbaccess/source/filter/xml/xmlAutoStyle.cxx +++ b/dbaccess/source/filter/xml/xmlAutoStyle.cxx @@ -27,7 +27,7 @@ namespace dbaxml using namespace ::com::sun::star::xml::sax; void OXMLAutoStylePoolP::exportStyleAttributes( - SvXMLAttributeList& rAttrList, + comphelper::AttributeList& rAttrList, XmlStyleFamily nFamily, const std::vector< XMLPropertyState >& rProperties, const SvXMLExportPropertyMapper& rPropExp diff --git a/dbaccess/source/filter/xml/xmlAutoStyle.hxx b/dbaccess/source/filter/xml/xmlAutoStyle.hxx index 54748a22c307..d358b50f7230 100644 --- a/dbaccess/source/filter/xml/xmlAutoStyle.hxx +++ b/dbaccess/source/filter/xml/xmlAutoStyle.hxx @@ -28,7 +28,7 @@ namespace dbaxml ODBExport& rODBExport; virtual void exportStyleAttributes( - SvXMLAttributeList& rAttrList, + comphelper::AttributeList& rAttrList, XmlStyleFamily nFamily, const std::vector< XMLPropertyState >& rProperties, const SvXMLExportPropertyMapper& rPropExp, diff --git a/dbaccess/source/filter/xml/xmlExport.cxx b/dbaccess/source/filter/xml/xmlExport.cxx index 48e3051cb694..aeb2d82bbd03 100644 --- a/dbaccess/source/filter/xml/xmlExport.cxx +++ b/dbaccess/source/filter/xml/xmlExport.cxx @@ -127,7 +127,7 @@ namespace dbaxml /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set */ virtual void handleSpecialItem( - SvXMLAttributeList& /*rAttrList*/, + comphelper::AttributeList& /*rAttrList*/, const XMLPropertyState& /*rProperty*/, const SvXMLUnitConverter& /*rUnitConverter*/, const SvXMLNamespaceMap& /*rNamespaceMap*/, @@ -840,7 +840,7 @@ void ODBExport::exportTable(XPropertySet* _xProp) exportFilter(_xProp,PROPERTY_ORDER,XML_ORDER_STATEMENT); } -void ODBExport::exportStyleName(XPropertySet* _xProp,SvXMLAttributeList& _rAtt) +void ODBExport::exportStyleName(XPropertySet* _xProp,comphelper::AttributeList& _rAtt) { Reference<XPropertySet> xFind(_xProp); exportStyleName(XML_STYLE_NAME,xFind,_rAtt,m_aAutoStyleNames); @@ -848,7 +848,7 @@ void ODBExport::exportStyleName(XPropertySet* _xProp,SvXMLAttributeList& _rAtt) exportStyleName(XML_DEFAULT_ROW_STYLE_NAME,xFind,_rAtt,m_aRowAutoStyleNames); } -void ODBExport::exportStyleName(const ::xmloff::token::XMLTokenEnum _eToken,const uno::Reference<beans::XPropertySet>& _xProp,SvXMLAttributeList& _rAtt,TPropertyStyleMap& _rMap) +void ODBExport::exportStyleName(const ::xmloff::token::XMLTokenEnum _eToken,const uno::Reference<beans::XPropertySet>& _xProp,comphelper::AttributeList& _rAtt,TPropertyStyleMap& _rMap) { TPropertyStyleMap::const_iterator aFind = _rMap.find(_xProp); if ( aFind != _rMap.end() ) @@ -911,7 +911,7 @@ void ODBExport::exportColumns(const Reference<XColumnsSupplier>& _xColSup) if ( aFind != m_aTableDummyColumns.end() ) { SvXMLElementExport aColumns(*this,XML_NAMESPACE_DB, XML_COLUMNS, true, true); - rtl::Reference<SvXMLAttributeList> pAtt = new SvXMLAttributeList; + rtl::Reference<comphelper::AttributeList> pAtt = new comphelper::AttributeList; exportStyleName(aFind->second.get(),*pAtt); AddAttributeList(pAtt); SvXMLElementExport aColumn(*this,XML_NAMESPACE_DB, XML_COLUMN, true, true); @@ -929,7 +929,7 @@ void ODBExport::exportColumns(const Reference<XColumnsSupplier>& _xColSup) Reference<XPropertySet> xProp(xNameAccess->getByName(*pIter),UNO_QUERY); if ( xProp.is() ) { - rtl::Reference<SvXMLAttributeList> pAtt = new SvXMLAttributeList; + rtl::Reference<comphelper::AttributeList> pAtt = new comphelper::AttributeList; exportStyleName(xProp.get(),*pAtt); bool bHidden = getBOOL(xProp->getPropertyValue(PROPERTY_HIDDEN)); diff --git a/dbaccess/source/filter/xml/xmlExport.hxx b/dbaccess/source/filter/xml/xmlExport.hxx index f852e39fba43..4cded949d419 100644 --- a/dbaccess/source/filter/xml/xmlExport.hxx +++ b/dbaccess/source/filter/xml/xmlExport.hxx @@ -123,8 +123,8 @@ class ODBExport : public SvXMLExport void exportReports(); void exportQueries(bool _bExportContext); void exportTables(bool _bExportContext); - void exportStyleName(XPropertySet* _xProp,SvXMLAttributeList& _rAtt); - void exportStyleName(const ::xmloff::token::XMLTokenEnum _eToken,const Reference<XPropertySet>& _xProp,SvXMLAttributeList& _rAtt,TPropertyStyleMap& _rMap); + void exportStyleName(XPropertySet* _xProp,comphelper::AttributeList& _rAtt); + void exportStyleName(const ::xmloff::token::XMLTokenEnum _eToken,const Reference<XPropertySet>& _xProp,comphelper::AttributeList& _rAtt,TPropertyStyleMap& _rMap); void exportCollection(const Reference< XNameAccess >& _xCollection ,enum ::xmloff::token::XMLTokenEnum _eComponents ,enum ::xmloff::token::XMLTokenEnum _eSubComponents diff --git a/filter/Library_t602filter.mk b/filter/Library_t602filter.mk index f8ad92b9680e..027709c4c6e2 100644 --- a/filter/Library_t602filter.mk +++ b/filter/Library_t602filter.mk @@ -34,6 +34,7 @@ $(eval $(call gb_Library_use_libraries,t602filter,\ xo \ tl \ utl \ + comphelper \ cppuhelper \ cppu \ sal \ diff --git a/filter/source/t602/t602filter.cxx b/filter/source/t602/t602filter.cxx index f26875347023..17acea9d966b 100644 --- a/filter/source/t602/t602filter.cxx +++ b/filter/source/t602/t602filter.cxx @@ -248,7 +248,7 @@ bool T602ImportFilter::importImpl( const Sequence< css::beans::PropertyValue >& auto const fs = OUString(OUString::number(inistruct::fontsize) + "pt"); auto const fs2 = OUString(OUString::number(2*inistruct::fontsize) + "pt"); - mpAttrList = new SvXMLAttributeList; + mpAttrList = new comphelper::AttributeList; Reference < XAttributeList > xAttrList ( mpAttrList ); diff --git a/filter/source/t602/t602filter.hxx b/filter/source/t602/t602filter.hxx index cd92a22fdf3c..93efc45c28ed 100644 --- a/filter/source/t602/t602filter.hxx +++ b/filter/source/t602/t602filter.hxx @@ -29,8 +29,8 @@ #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> #include <com/sun/star/xml/sax/XDocumentHandler.hpp> #include <com/sun/star/uno/XComponentContext.hpp> +#include <comphelper/attributelist.hxx> #include <cppuhelper/implbase.hxx> -#include <xmloff/attrlist.hxx> #include <rtl/ref.hxx> namespace T602ImportFilter { @@ -118,7 +118,7 @@ private: css::uno::Reference< css::lang::XComponent > mxDoc; css::uno::Reference < css::io::XInputStream > mxInputStream; - rtl::Reference<SvXMLAttributeList> mpAttrList; + rtl::Reference<comphelper::AttributeList> mpAttrList; tnode node; // START diff --git a/filter/source/xsltdialog/typedetectionexport.cxx b/filter/source/xsltdialog/typedetectionexport.cxx index 0f86af1cbc5a..af367ec8a483 100644 --- a/filter/source/xsltdialog/typedetectionexport.cxx +++ b/filter/source/xsltdialog/typedetectionexport.cxx @@ -90,7 +90,6 @@ void TypeDetectionExporter::doExport( const Reference< XOutputStream >& xOS, co static const OUStringLiteral sDocTypePrefix ( u"doctype:" ); static const OUStringLiteral sFilterAdaptorService( u"com.sun.star.comp.Writer.XmlFilterAdaptor" ); static const OUStringLiteral sXSLTFilterService ( u"com.sun.star.documentconversion.XSLTFilter" ); - static const OUStringLiteral sCdataAttribute ( u"CDATA" ); // set up sax writer and connect to given output stream @@ -98,10 +97,10 @@ void TypeDetectionExporter::doExport( const Reference< XOutputStream >& xOS, co xHandler->setOutputStream( xOS ); rtl::Reference<::comphelper::AttributeList> pAttrList = new ::comphelper::AttributeList; - pAttrList->AddAttribute ( "xmlns:oor", sCdataAttribute, "http://openoffice.org/2001/registry" ); - pAttrList->AddAttribute ( "xmlns:xs", sCdataAttribute, "http://www.w3.org/2001/XMLSchema" ); - pAttrList->AddAttribute ( sName, sCdataAttribute, "TypeDetection" ); - pAttrList->AddAttribute ( "oor:package", sCdataAttribute, "org.openoffice.Office" ); + pAttrList->AddAttribute ( "xmlns:oor", "http://openoffice.org/2001/registry" ); + pAttrList->AddAttribute ( "xmlns:xs", "http://www.w3.org/2001/XMLSchema" ); + pAttrList->AddAttribute ( sName, "TypeDetection" ); + pAttrList->AddAttribute ( "oor:package", "org.openoffice.Office" ); xHandler->startDocument(); xHandler->ignorableWhitespace ( sWhiteSpace ); @@ -110,14 +109,14 @@ void TypeDetectionExporter::doExport( const Reference< XOutputStream >& xOS, co // export types { pAttrList = new ::comphelper::AttributeList; - pAttrList->AddAttribute ( sName, sCdataAttribute, "Types" ); + pAttrList->AddAttribute ( sName, "Types" ); xHandler->ignorableWhitespace ( sWhiteSpace ); xHandler->startElement( sNode, pAttrList ); for (auto const& filter : rFilters) { pAttrList = new ::comphelper::AttributeList; - pAttrList->AddAttribute( sName, sCdataAttribute, filter->maType ); + pAttrList->AddAttribute( sName, filter->maType ); xHandler->ignorableWhitespace ( sWhiteSpace ); xHandler->startElement( sNode, pAttrList ); OUString sValue = "0" + sComma + sComma; @@ -141,14 +140,14 @@ void TypeDetectionExporter::doExport( const Reference< XOutputStream >& xOS, co // export filters { pAttrList = new ::comphelper::AttributeList; - pAttrList->AddAttribute ( sName, sCdataAttribute, "Filters" ); + pAttrList->AddAttribute ( sName, "Filters" ); xHandler->ignorableWhitespace ( sWhiteSpace ); xHandler->startElement( sNode, pAttrList ); for (auto const& filter : rFilters) { pAttrList = new ::comphelper::AttributeList; - pAttrList->AddAttribute( sName, sCdataAttribute, filter->maFilterName ); + pAttrList->AddAttribute( sName, filter->maFilterName ); xHandler->ignorableWhitespace ( sWhiteSpace ); xHandler->startElement( sNode, pAttrList ); addLocaleProperty( xHandler, sUIName, filter->maInterfaceName ); @@ -207,14 +206,13 @@ void TypeDetectionExporter::addProperty( const Reference< XWriter >& xHandler, c { try { - static const OUStringLiteral sCdataAttribute( u"CDATA" ); static const OUStringLiteral sProp( u"prop" ); static const OUStringLiteral sValue( u"value" ); static const OUStringLiteral sWhiteSpace ( u" " ); rtl::Reference<::comphelper::AttributeList>pAttrList = new ::comphelper::AttributeList; - pAttrList->AddAttribute ( "oor:name", sCdataAttribute, rName ); - pAttrList->AddAttribute ( "oor:type", sCdataAttribute, "xs:string" ); + pAttrList->AddAttribute ( "oor:name", rName ); + pAttrList->AddAttribute ( "oor:type", "xs:string" ); xHandler->ignorableWhitespace ( sWhiteSpace ); xHandler->startElement( sProp, pAttrList ); @@ -235,19 +233,18 @@ void TypeDetectionExporter::addLocaleProperty( const Reference< XWriter >& xHand { try { - static const OUStringLiteral sCdataAttribute( u"CDATA" ); static const OUStringLiteral sProp( u"prop" ); static const OUStringLiteral sValue( u"value" ); static const OUStringLiteral sWhiteSpace ( u" " ); rtl::Reference<::comphelper::AttributeList> pAttrList = new ::comphelper::AttributeList; - pAttrList->AddAttribute ( "oor:name", sCdataAttribute, rName ); - pAttrList->AddAttribute ( "oor:type", sCdataAttribute, "xs:string" ); + pAttrList->AddAttribute ( "oor:name", rName ); + pAttrList->AddAttribute ( "oor:type", "xs:string" ); xHandler->ignorableWhitespace ( sWhiteSpace ); xHandler->startElement( sProp, pAttrList ); pAttrList = new ::comphelper::AttributeList; - pAttrList->AddAttribute ( "xml:lang", sCdataAttribute, "en-US" ); + pAttrList->AddAttribute ( "xml:lang", "en-US" ); xHandler->ignorableWhitespace ( sWhiteSpace ); xHandler->startElement( sValue, pAttrList ); xHandler->characters( rValue ); diff --git a/framework/inc/acceleratorconst.h b/framework/inc/acceleratorconst.h index 55f9435ffa51..ee45f8ef55a1 100644 --- a/framework/inc/acceleratorconst.h +++ b/framework/inc/acceleratorconst.h @@ -23,8 +23,6 @@ namespace framework{ -inline constexpr OUStringLiteral ATTRIBUTE_TYPE_CDATA = u"CDATA"; - // same items with a name space alias inline constexpr OUStringLiteral AL_ELEMENT_ACCELERATORLIST = u"accel:acceleratorlist"; inline constexpr OUStringLiteral AL_ELEMENT_ITEM = u"accel:item"; diff --git a/framework/inc/xml/imagesdocumenthandler.hxx b/framework/inc/xml/imagesdocumenthandler.hxx index d8cd84f4dfe4..ccdbe0e5b4cf 100644 --- a/framework/inc/xml/imagesdocumenthandler.hxx +++ b/framework/inc/xml/imagesdocumenthandler.hxx @@ -123,7 +123,6 @@ class OWriteImagesDocumentHandler final css::uno::Reference< css::xml::sax::XDocumentHandler > m_xWriteDocumentHandler; css::uno::Reference< css::xml::sax::XAttributeList > m_xEmptyList; OUString m_aXMLImageNS; - OUString m_aAttributeType; OUString m_aAttributeXlinkType; OUString m_aAttributeValueSimple; }; diff --git a/framework/inc/xml/menudocumenthandler.hxx b/framework/inc/xml/menudocumenthandler.hxx index f3a0238d0bd7..db72eb9171c2 100644 --- a/framework/inc/xml/menudocumenthandler.hxx +++ b/framework/inc/xml/menudocumenthandler.hxx @@ -213,7 +213,6 @@ class OWriteMenuDocumentHandler final css::uno::Reference< css::container::XIndexAccess > m_xMenuBarContainer; css::uno::Reference< css::xml::sax::XDocumentHandler > m_xWriteDocumentHandler; css::uno::Reference< css::xml::sax::XAttributeList > m_xEmptyList; - OUString m_aAttributeType; bool m_bIsMenuBar; }; diff --git a/framework/inc/xml/statusbardocumenthandler.hxx b/framework/inc/xml/statusbardocumenthandler.hxx index 829cd0b9745a..ba1ef7c364f8 100644 --- a/framework/inc/xml/statusbardocumenthandler.hxx +++ b/framework/inc/xml/statusbardocumenthandler.hxx @@ -125,7 +125,6 @@ class OWriteStatusBarDocumentHandler final css::uno::Reference< css::xml::sax::XAttributeList > m_xEmptyList; OUString m_aXMLStatusBarNS; OUString m_aXMLXlinkNS; - OUString m_aAttributeType; OUString m_aAttributeURL; }; diff --git a/framework/inc/xml/toolboxconfigurationdefines.hxx b/framework/inc/xml/toolboxconfigurationdefines.hxx index 399693044ec3..95a9c9802bc1 100644 --- a/framework/inc/xml/toolboxconfigurationdefines.hxx +++ b/framework/inc/xml/toolboxconfigurationdefines.hxx @@ -49,8 +49,6 @@ inline constexpr OUStringLiteral ELEMENT_NS_TOOLBARSEPARATOR = u"toolbar:toolbar inline constexpr OUStringLiteral ATTRIBUTE_XMLNS_TOOLBAR = u"xmlns:toolbar"; inline constexpr OUStringLiteral ATTRIBUTE_XMLNS_XLINK = u"xmlns:xlink"; -inline constexpr OUStringLiteral ATTRIBUTE_TYPE_CDATA = u"CDATA"; - #define ATTRIBUTE_BOOLEAN_TRUE "true" inline constexpr OUStringLiteral ATTRIBUTE_BOOLEAN_FALSE = u"false"; diff --git a/framework/inc/xml/toolboxdocumenthandler.hxx b/framework/inc/xml/toolboxdocumenthandler.hxx index 79657e5324e4..721d02936616 100644 --- a/framework/inc/xml/toolboxdocumenthandler.hxx +++ b/framework/inc/xml/toolboxdocumenthandler.hxx @@ -149,7 +149,6 @@ class OWriteToolBoxDocumentHandler final css::uno::Reference< css::container::XIndexAccess > m_rItemAccess; OUString m_aXMLToolbarNS; OUString m_aXMLXlinkNS; - OUString m_aAttributeType; OUString m_aAttributeURL; }; diff --git a/framework/source/fwe/xml/menudocumenthandler.cxx b/framework/source/fwe/xml/menudocumenthandler.cxx index cfb4e9f971c7..05b8d6257eff 100644 --- a/framework/source/fwe/xml/menudocumenthandler.cxx +++ b/framework/source/fwe/xml/menudocumenthandler.cxx @@ -64,8 +64,6 @@ constexpr OUStringLiteral ATTRIBUTE_NS_STYLE = u"menu:style"; constexpr OUStringLiteral ATTRIBUTE_XMLNS_MENU = u"xmlns:menu"; -constexpr OUStringLiteral ATTRIBUTE_TYPE_CDATA = u"CDATA"; - constexpr OUStringLiteral MENUBAR_DOCTYPE = u"<!DOCTYPE menu:menubar PUBLIC \"-//OpenOffice.org//DTD OfficeDocument 1.0//EN\" \"menubar.dtd\">"; #define ATTRIBUTE_ITEMSTYLE_TEXT "text" @@ -720,7 +718,6 @@ OWriteMenuDocumentHandler::OWriteMenuDocumentHandler( m_bIsMenuBar( bIsMenuBar ) { m_xEmptyList = new ::comphelper::AttributeList; - m_aAttributeType = ATTRIBUTE_TYPE_CDATA; } OWriteMenuDocumentHandler::~OWriteMenuDocumentHandler() @@ -742,12 +739,10 @@ void OWriteMenuDocumentHandler::WriteMenuDocument() } pList->AddAttribute( ATTRIBUTE_XMLNS_MENU, - m_aAttributeType, XMLNS_MENU ); if ( m_bIsMenuBar ) //FIXME pList->AddAttribute( ATTRIBUTE_NS_ID, - m_aAttributeType, "menubar" ); OUString aRootElement; @@ -793,12 +788,10 @@ void OWriteMenuDocumentHandler::WriteMenu( const Reference< XIndexAccess >& rMen rtl::Reference<::comphelper::AttributeList> pListMenu = new ::comphelper::AttributeList; pListMenu->AddAttribute( ATTRIBUTE_NS_ID, - m_aAttributeType, aCommandURL ); if ( !aLabel.isEmpty() ) pListMenu->AddAttribute( ATTRIBUTE_NS_LABEL, - m_aAttributeType, aLabel ); m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); @@ -843,20 +836,17 @@ void OWriteMenuDocumentHandler::WriteMenuItem( const OUString& aCommandURL, cons rtl::Reference<::comphelper::AttributeList> pList = new ::comphelper::AttributeList; pList->AddAttribute( ATTRIBUTE_NS_ID, - m_aAttributeType, aCommandURL ); if ( !aHelpURL.isEmpty() ) { pList->AddAttribute( ATTRIBUTE_NS_HELPID, - m_aAttributeType, aHelpURL ); } if ( !aLabel.isEmpty() ) { pList->AddAttribute( ATTRIBUTE_NS_LABEL, - m_aAttributeType, aLabel ); } if ( nStyle > 0 ) @@ -874,7 +864,6 @@ void OWriteMenuDocumentHandler::WriteMenuItem( const OUString& aCommandURL, cons } } pList->AddAttribute( ATTRIBUTE_NS_STYLE, - m_aAttributeType, aValue.makeStringAndClear() ); } diff --git a/framework/source/fwe/xml/saxnamespacefilter.cxx b/framework/source/fwe/xml/saxnamespacefilter.cxx index ac1ff571c26a..b5349eb4887d 100644 --- a/framework/source/fwe/xml/saxnamespacefilter.cxx +++ b/framework/source/fwe/xml/saxnamespacefilter.cxx @@ -84,7 +84,7 @@ void SAL_CALL SaxNamespaceFilter::startElement( OUString aAttributeName = xAttribs->getNameByIndex(attributeIndex); OUString aValue = xAttribs->getValueByIndex(attributeIndex); OUString aNamespaceAttributeName = aXMLNamespaces.applyNSToAttributeName( aAttributeName ); - pNewList->AddAttribute( aNamespaceAttributeName, "CDATA", aValue ); + pNewList->AddAttribute(aNamespaceAttributeName, aValue); } } catch ( SAXException& e ) diff --git a/framework/source/fwe/xml/statusbardocumenthandler.cxx b/framework/source/fwe/xml/statusbardocumenthandler.cxx index 3786e2fbd298..09d42e9257f3 100644 --- a/framework/source/fwe/xml/statusbardocumenthandler.cxx +++ b/framework/source/fwe/xml/statusbardocumenthandler.cxx @@ -64,8 +64,6 @@ constexpr OUStringLiteral ELEMENT_NS_STATUSBARITEM = u"statusbar:statusbaritem"; constexpr OUStringLiteral ATTRIBUTE_XMLNS_STATUSBAR = u"xmlns:statusbar"; constexpr OUStringLiteral ATTRIBUTE_XMLNS_XLINK = u"xmlns:xlink"; -constexpr OUStringLiteral ATTRIBUTE_TYPE_CDATA = u"CDATA"; - constexpr OUStringLiteral ATTRIBUTE_BOOLEAN_TRUE = u"true"; constexpr OUStringLiteral ATTRIBUTE_BOOLEAN_FALSE = u"false"; @@ -461,7 +459,6 @@ OWriteStatusBarDocumentHandler::OWriteStatusBarDocumentHandler( m_xWriteDocumentHandler( rWriteDocumentHandler ) { m_xEmptyList = new ::comphelper::AttributeList; - m_aAttributeType = ATTRIBUTE_TYPE_CDATA; m_aXMLXlinkNS = XMLNS_XLINK_PREFIX; m_aXMLStatusBarNS = XMLNS_STATUSBAR_PREFIX; } @@ -485,11 +482,9 @@ void OWriteStatusBarDocumentHandler::WriteStatusBarDocument() rtl::Reference<::comphelper::AttributeList> pList = new ::comphelper::AttributeList; pList->AddAttribute( ATTRIBUTE_XMLNS_STATUSBAR, - m_aAttributeType, XMLNS_STATUSBAR ); pList->AddAttribute( ATTRIBUTE_XMLNS_XLINK, - m_aAttributeType, XMLNS_XLINK ); m_xWriteDocumentHandler->startElement( ELEMENT_NS_STATUSBAR, pList ); @@ -545,25 +540,22 @@ void OWriteStatusBarDocumentHandler::WriteStatusBarItem( } // save required attribute (URL) - pList->AddAttribute( m_aAttributeURL, m_aAttributeType, rCommandURL ); + pList->AddAttribute( m_aAttributeURL, rCommandURL ); // alignment if ( nStyle & ItemStyle::ALIGN_RIGHT ) { pList->AddAttribute( m_aXMLStatusBarNS + ATTRIBUTE_ALIGN, - m_aAttributeType, ATTRIBUTE_ALIGN_RIGHT ); } else if ( nStyle & ItemStyle::ALIGN_CENTER ) { pList->AddAttribute( m_aXMLStatusBarNS + ATTRIBUTE_ALIGN, - m_aAttributeType, ATTRIBUTE_ALIGN_CENTER ); } else { pList->AddAttribute( m_aXMLStatusBarNS + ATTRIBUTE_ALIGN, - m_aAttributeType, ATTRIBUTE_ALIGN_LEFT ); } @@ -571,13 +563,11 @@ void OWriteStatusBarDocumentHandler::WriteStatusBarItem( if ( nStyle & ItemStyle::DRAW_FLAT ) { pList->AddAttribute( m_aXMLStatusBarNS + ATTRIBUTE_STYLE, - m_aAttributeType, ATTRIBUTE_STYLE_FLAT ); } else if ( nStyle & ItemStyle::DRAW_OUT3D ) { pList->AddAttribute( m_aXMLStatusBarNS + ATTRIBUTE_STYLE, - m_aAttributeType, ATTRIBUTE_STYLE_OUT ); } @@ -585,7 +575,6 @@ void OWriteStatusBarDocumentHandler::WriteStatusBarItem( if ( nStyle & ItemStyle::AUTO_SIZE ) { pList->AddAttribute( m_aXMLStatusBarNS + ATTRIBUTE_AUTOSIZE, - m_aAttributeType, ATTRIBUTE_BOOLEAN_TRUE ); } @@ -593,7 +582,6 @@ void OWriteStatusBarDocumentHandler::WriteStatusBarItem( if ( nStyle & ItemStyle::OWNER_DRAW ) { pList->AddAttribute( m_aXMLStatusBarNS + ATTRIBUTE_OWNERDRAW, - m_aAttributeType, ATTRIBUTE_BOOLEAN_TRUE ); } @@ -601,7 +589,6 @@ void OWriteStatusBarDocumentHandler::WriteStatusBarItem( if ( nWidth > 0 ) { pList->AddAttribute( m_aXMLStatusBarNS + ATTRIBUTE_WIDTH, - m_aAttributeType, OUString::number( nWidth ) ); } @@ -609,7 +596,6 @@ void OWriteStatusBarDocumentHandler::WriteStatusBarItem( if ( nOffset != STATUSBAR_OFFSET ) { pList->AddAttribute( m_aXMLStatusBarNS + ATTRIBUTE_OFFSET, - m_aAttributeType, OUString::number( nOffset ) ); } @@ -617,7 +603,6 @@ void OWriteStatusBarDocumentHandler::WriteStatusBarItem( if ( !( nStyle & ItemStyle::MANDATORY ) ) { pList->AddAttribute( m_aXMLStatusBarNS + ATTRIBUTE_MANDATORY, - m_aAttributeType, ATTRIBUTE_BOOLEAN_FALSE ); } diff --git a/framework/source/fwe/xml/toolboxdocumenthandler.cxx b/framework/source/fwe/xml/toolboxdocumenthandler.cxx index 62202dea611f..28005b3172ff 100644 --- a/framework/source/fwe/xml/toolboxdocumenthandler.cxx +++ b/framework/source/fwe/xml/toolboxdocumenthandler.cxx @@ -563,7 +563,6 @@ OWriteToolBoxDocumentHandler::OWriteToolBoxDocumentHandler( m_rItemAccess( rItemAccess ) { m_xEmptyList = new ::comphelper::AttributeList; - m_aAttributeType = ATTRIBUTE_TYPE_CDATA; m_aXMLXlinkNS = XMLNS_XLINK_PREFIX; m_aXMLToolbarNS = XMLNS_TOOLBAR_PREFIX; } @@ -600,16 +599,13 @@ void OWriteToolBoxDocumentHandler::WriteToolBoxDocument() rtl::Reference<::comphelper::AttributeList> pList = new ::comphelper::AttributeList; pList->AddAttribute( ATTRIBUTE_XMLNS_TOOLBAR, - m_aAttributeType, XMLNS_TOOLBAR ); pList->AddAttribute( ATTRIBUTE_XMLNS_XLINK, - m_aAttributeType, XMLNS_XLINK ); if ( !aUIName.isEmpty() ) pList->AddAttribute( m_aXMLToolbarNS + ATTRIBUTE_UINAME, - m_aAttributeType, aUIName ); m_xWriteDocumentHandler->startElement( ELEMENT_NS_TOOLBAR, pList ); @@ -664,19 +660,17 @@ void OWriteToolBoxDocumentHandler::WriteToolBoxItem( } // save required attribute (URL) - pList->AddAttribute( m_aAttributeURL, m_aAttributeType, rCommandURL ); + pList->AddAttribute( m_aAttributeURL, rCommandURL ); if ( !rLabel.isEmpty() ) { pList->AddAttribute( m_aXMLToolbarNS + ATTRIBUTE_TEXT, - m_aAttributeType, rLabel ); } if ( !bVisible ) { pList->AddAttribute( m_aXMLToolbarNS + ATTRIBUTE_VISIBLE, - m_aAttributeType, ATTRIBUTE_BOOLEAN_FALSE ); } @@ -695,7 +689,6 @@ void OWriteToolBoxDocumentHandler::WriteToolBoxItem( } } pList->AddAttribute( m_aXMLToolbarNS + ATTRIBUTE_ITEMSTYLE, - m_aAttributeType, aValue.makeStringAndClear() ); } diff --git a/framework/source/xml/acceleratorconfigurationwriter.cxx b/framework/source/xml/acceleratorconfigurationwriter.cxx index 04e50f5ae6a7..645fd479c329 100644 --- a/framework/source/xml/acceleratorconfigurationwriter.cxx +++ b/framework/source/xml/acceleratorconfigurationwriter.cxx @@ -52,10 +52,10 @@ void AcceleratorConfigurationWriter::flush() rtl::Reference<::comphelper::AttributeList> pAttribs = new ::comphelper::AttributeList; pAttribs->AddAttribute( - "xmlns:accel", ATTRIBUTE_TYPE_CDATA, + "xmlns:accel", "http://openoffice.org/2001/accel"); pAttribs->AddAttribute( - "xmlns:xlink", ATTRIBUTE_TYPE_CDATA, "http://www.w3.org/1999/xlink"); + "xmlns:xlink", "http://www.w3.org/1999/xlink"); // generate xml xExtendedCFG->startDocument(); @@ -96,20 +96,20 @@ void AcceleratorConfigurationWriter::impl_ts_writeKeyCommandPair(const css::awt: OUString sKey = KeyMapping::get().mapCodeToIdentifier(aKey.KeyCode); // TODO check if key is empty! - pAttribs->AddAttribute("accel:code", ATTRIBUTE_TYPE_CDATA, sKey ); - pAttribs->AddAttribute("xlink:href", ATTRIBUTE_TYPE_CDATA, sCommand); + pAttribs->AddAttribute("accel:code", sKey ); + pAttribs->AddAttribute("xlink:href", sCommand); if ((aKey.Modifiers & css::awt::KeyModifier::SHIFT) == css::awt::KeyModifier::SHIFT) - pAttribs->AddAttribute("accel:shift", ATTRIBUTE_TYPE_CDATA, "true"); + pAttribs->AddAttribute("accel:shift", "true"); if ((aKey.Modifiers & css::awt::KeyModifier::MOD1) == css::awt::KeyModifier::MOD1) - pAttribs->AddAttribute("accel:mod1", ATTRIBUTE_TYPE_CDATA, "true"); + pAttribs->AddAttribute("accel:mod1", "true"); if ((aKey.Modifiers & css::awt::KeyModifier::MOD2) == css::awt::KeyModifier::MOD2) - pAttribs->AddAttribute("accel:mod2", ATTRIBUTE_TYPE_CDATA, "true"); + pAttribs->AddAttribute("accel:mod2", "true"); if ((aKey.Modifiers & css::awt::KeyModifier::MOD3) == css::awt::KeyModifier::MOD3) - pAttribs->AddAttribute("accel:mod3", ATTRIBUTE_TYPE_CDATA, "true"); + pAttribs->AddAttribute("accel:mod3", "true"); xConfig->ignorableWhitespace(OUString()); xConfig->startElement(AL_ELEMENT_ITEM, pAttribs); diff --git a/framework/source/xml/imagesdocumenthandler.cxx b/framework/source/xml/imagesdocumenthandler.cxx index ebdd5366f240..962c0a8bbd0e 100644 --- a/framework/source/xml/imagesdocumenthandler.cxx +++ b/framework/source/xml/imagesdocumenthandler.cxx @@ -48,7 +48,6 @@ constexpr OUStringLiteral ELEMENT_NS_ENTRY = u"image:entry"; #define ATTRIBUTE_MASKMODE "maskmode" #define ATTRIBUTE_HIGHCONTRASTURL "highcontrasturl" #define ATTRIBUTE_HIGHCONTRASTMASKURL "highcontrastmaskurl" -constexpr OUStringLiteral ATTRIBUTE_TYPE_CDATA = u"CDATA"; constexpr OUStringLiteral ATTRIBUTE_XMLNS_IMAGE = u"xmlns:image"; constexpr OUStringLiteral ATTRIBUTE_XMLNS_XLINK = u"xmlns:xlink"; @@ -288,7 +287,6 @@ OWriteImagesDocumentHandler::OWriteImagesDocumentHandler( m_xWriteDocumentHandler( rWriteDocumentHandler ) { m_xEmptyList = new ::comphelper::AttributeList; - m_aAttributeType = ATTRIBUTE_TYPE_CDATA; m_aXMLImageNS = XMLNS_IMAGE_PREFIX; m_aAttributeXlinkType = ATTRIBUTE_XLINK_TYPE; m_aAttributeValueSimple = ATTRIBUTE_XLINK_TYPE_VALUE; @@ -313,11 +311,9 @@ void OWriteImagesDocumentHandler::WriteImagesDocument() rtl::Reference<::comphelper::AttributeList> pList = new ::comphelper::AttributeList; pList->AddAttribute( ATTRIBUTE_XMLNS_IMAGE, - m_aAttributeType, XMLNS_IMAGE ); pList->AddAttribute( ATTRIBUTE_XMLNS_XLINK, - m_aAttributeType, XMLNS_XLINK ); m_xWriteDocumentHandler->startElement( ELEMENT_NS_IMAGESCONTAINER, pList ); @@ -339,7 +335,6 @@ void OWriteImagesDocumentHandler::WriteImageList( const ImageItemDescriptorList* // save required attributes pList->AddAttribute( m_aAttributeXlinkType, - m_aAttributeType, m_aAttributeValueSimple ); m_xWriteDocumentHandler->startElement( ELEMENT_NS_IMAGES, pList ); @@ -357,7 +352,6 @@ void OWriteImagesDocumentHandler::WriteImage( const ImageItemDescriptor* pImage rtl::Reference<::comphelper::AttributeList> pList = new ::comphelper::AttributeList; pList->AddAttribute( m_aXMLImageNS + ATTRIBUTE_COMMAND, - m_aAttributeType, pImage->aCommandURL ); m_xWriteDocumentHandler->startElement( ELEMENT_NS_ENTRY, pList ); diff --git a/include/comphelper/attributelist.hxx b/include/comphelper/attributelist.hxx index 0309ab60855e..35f9de82b590 100644 --- a/include/comphelper/attributelist.hxx +++ b/include/comphelper/attributelist.hxx @@ -22,7 +22,6 @@ #include <sal/config.h> -#include <memory> #include <vector> #include <com/sun/star/util/XCloneable.hpp> @@ -33,32 +32,35 @@ namespace comphelper { -struct TagAttribute -{ - OUString sName; - OUString sType; - OUString sValue; -}; - class COMPHELPER_DLLPUBLIC AttributeList final : public ::cppu::WeakImplHelper<css::xml::sax::XAttributeList, css::util::XCloneable> { + struct TagAttribute + { + OUString sName; + OUString sValue; + }; std::vector<TagAttribute> mAttributes; public: AttributeList(); - AttributeList(const AttributeList &r); + AttributeList(const AttributeList &r) = default; + AttributeList(const css::uno::Reference<css::xml::sax::XAttributeList>& rAttrList); + AttributeList(AttributeList&&) = delete; virtual ~AttributeList() override; // methods that are not contained in any interface - void AddAttribute(const OUString &sName , const OUString &sType , const OUString &sValue) - { - mAttributes.push_back({sName, sType, sValue}); - } + void AddAttribute(const OUString &sName, const OUString &sValue); void Clear() { mAttributes.clear(); } + void RemoveAttribute(const OUString& sName); + void AppendAttributeList(const css::uno::Reference< css::xml::sax::XAttributeList >&); + void SetValueByIndex(sal_Int16 i, const OUString& rValue); + void RemoveAttributeByIndex(sal_Int16 i); + void RenameAttributeByIndex(sal_Int16 i, const OUString& rNewName); + sal_Int16 GetIndexByName(const OUString& rName) const; // css::xml::sax::XAttributeList virtual sal_Int16 SAL_CALL getLength() override @@ -69,11 +71,8 @@ public: { return mAttributes[i].sName; } - virtual OUString SAL_CALL getTypeByIndex(sal_Int16 i) override - { - return mAttributes[i].sType; - } - virtual OUString SAL_CALL getTypeByName(const OUString& aName) override; + virtual OUString SAL_CALL getTypeByIndex(sal_Int16) override { return "CDATA"; } + virtual OUString SAL_CALL getTypeByName(const OUString&) override { return "CDATA"; } virtual OUString SAL_CALL getValueByIndex(sal_Int16 i) override { return mAttributes[i].sValue; diff --git a/include/xmloff/attrlist.hxx b/include/xmloff/attrlist.hxx deleted file mode 100644 index 1261dd5c2ac9..000000000000 --- a/include/xmloff/attrlist.hxx +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_XMLOFF_ATTRLIST_HXX -#define INCLUDED_XMLOFF_ATTRLIST_HXX - -#include <sal/config.h> -#include <xmloff/dllapi.h> -#include <com/sun/star/util/XCloneable.hpp> -#include <com/sun/star/xml/sax/XAttributeList.hpp> - -#include <comphelper/servicehelper.hxx> -#include <cppuhelper/implbase.hxx> -#include <vector> - -class XMLOFF_DLLPUBLIC SvXMLAttributeList final : public ::cppu::WeakImplHelper< - css::xml::sax::XAttributeList, - css::util::XCloneable> -{ - struct SvXMLTagAttribute_Impl - { - OUString sName; - OUString sValue; - }; - std::vector<SvXMLTagAttribute_Impl> vecAttribute; -public: - SvXMLAttributeList(); - SvXMLAttributeList( const SvXMLAttributeList& ); - SvXMLAttributeList( const css::uno::Reference< - css::xml::sax::XAttributeList> & rAttrList ); - virtual ~SvXMLAttributeList() override; - - // css::xml::sax::XAttributeList - virtual sal_Int16 SAL_CALL getLength() override; - virtual OUString SAL_CALL getNameByIndex(sal_Int16 i) override; - virtual OUString SAL_CALL getTypeByIndex(sal_Int16 i) override; - virtual OUString SAL_CALL getTypeByName(const OUString& aName) override; - virtual OUString SAL_CALL getValueByIndex(sal_Int16 i) override; - virtual OUString SAL_CALL getValueByName(const OUString& aName) override; - - // css::util::XCloneable - virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override; - - // methods that are not contained in any interface - void AddAttribute( const OUString &sName , const OUString &sValue ); - void Clear(); - void RemoveAttribute( const OUString& sName ); - void AppendAttributeList( const css::uno::Reference< css::xml::sax::XAttributeList > & ); - void SetValueByIndex( sal_Int16 i, const OUString& rValue ); - void RemoveAttributeByIndex( sal_Int16 i ); - void RenameAttributeByIndex( sal_Int16 i, const OUString& rNewName ); - sal_Int16 GetIndexByName( const OUString& rName ) const; -}; - - -#endif // INCLUDED_XMLOFF_ATTRLIST_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/xmloff/shapeexport.hxx b/include/xmloff/shapeexport.hxx index 8398bb937837..34abaf37547e 100644 --- a/include/xmloff/shapeexport.hxx +++ b/include/xmloff/shapeexport.hxx @@ -41,7 +41,7 @@ namespace com::sun::star::drawing { class XShape; } namespace com::sun::star::drawing { class XShapes; } class XMLTableExport; -class SvXMLAttributeList; +namespace comphelper { class AttributeList; } class XMLPropertyHandlerFactory; // shape export features are bits used for the nFeature @@ -203,11 +203,11 @@ private: SAL_DLLPRIVATE void ImpExportPolygonShape(const css::uno::Reference< css::drawing::XShape >& xShape, XmlShapeType eShapeType, XMLShapeExportFlags nFeatures = SEF_DEFAULT, css::awt::Point* pRefPoint = nullptr ); SAL_DLLPRIVATE void ImpExportTextBoxShape(const css::uno::Reference< css::drawing::XShape >& xShape, XmlShapeType eShapeType, XMLShapeExportFlags nFeatures = SEF_DEFAULT, css::awt::Point* pRefPoint = nullptr ); SAL_DLLPRIVATE void ImpExportGraphicObjectShape(const css::uno::Reference< css::drawing::XShape >& xShape, XmlShapeType eShapeType, XMLShapeExportFlags nFeatures = SEF_DEFAULT, css::awt::Point* pRefPoint = nullptr ); - SAL_DLLPRIVATE void ImpExportChartShape(const css::uno::Reference< css::drawing::XShape >& xShape, XmlShapeType eShapeType, XMLShapeExportFlags nFeatures = SEF_DEFAULT, css::awt::Point* pRefPoint = nullptr, SvXMLAttributeList* pAttrList = nullptr ); + SAL_DLLPRIVATE void ImpExportChartShape(const css::uno::Reference< css::drawing::XShape >& xShape, XmlShapeType eShapeType, XMLShapeExportFlags nFeatures = SEF_DEFAULT, css::awt::Point* pRefPoint = nullptr, comphelper::AttributeList* pAttrList = nullptr ); SAL_DLLPRIVATE void ImpExportControlShape(const css::uno::Reference< css::drawing::XShape >& xShape, XMLShapeExportFlags nFeatures = SEF_DEFAULT, css::awt::Point* pRefPoint = nullptr ); SAL_DLLPRIVATE void ImpExportConnectorShape(const css::uno::Reference< css::drawing::XShape >& xShape, XMLShapeExportFlags nFeatures = SEF_DEFAULT, css::awt::Point* pRefPoint = nullptr ); SAL_DLLPRIVATE void ImpExportMeasureShape(const css::uno::Reference< css::drawing::XShape >& xShape, XMLShapeExportFlags nFeatures = SEF_DEFAULT, css::awt::Point const * pRefPoint = nullptr ); - SAL_DLLPRIVATE void ImpExportOLE2Shape(const css::uno::Reference< css::drawing::XShape >& xShape, XmlShapeType eShapeType, XMLShapeExportFlags nFeatures = SEF_DEFAULT, css::awt::Point* pRefPoint = nullptr, SvXMLAttributeList* pAttrList = nullptr ); + SAL_DLLPRIVATE void ImpExportOLE2Shape(const css::uno::Reference< css::drawing::XShape >& xShape, XmlShapeType eShapeType, XMLShapeExportFlags nFeatures = SEF_DEFAULT, css::awt::Point* pRefPoint = nullptr, comphelper::AttributeList* pAttrList = nullptr ); SAL_DLLPRIVATE void ImpExportPageShape(const css::uno::Reference< css::drawing::XShape >& xShape, XmlShapeType eShapeType, XMLShapeExportFlags nFeatures = SEF_DEFAULT, css::awt::Point* pRefPoint = nullptr ); SAL_DLLPRIVATE void ImpExportCaptionShape(const css::uno::Reference< css::drawing::XShape >& xShape, XMLShapeExportFlags nFeatures = SEF_DEFAULT, css::awt::Point* pRefPoint = nullptr ); SAL_DLLPRIVATE void ImpExport3DShape(const css::uno::Reference< css::drawing::XShape >& xShape, XmlShapeType eShapeType ); @@ -231,7 +231,7 @@ public: const css::uno::Reference < css::drawing::XShape >& xShape, XMLShapeExportFlags nFeatures = SEF_DEFAULT, css::awt::Point* pRefPoint = nullptr, - SvXMLAttributeList* pAttrList = nullptr + comphelper::AttributeList* pAttrList = nullptr ); // This method collects all automatic styles for the shapes inside the given XShapes collection diff --git a/include/xmloff/xmlaustp.hxx b/include/xmloff/xmlaustp.hxx index a77e3fe0a570..bc21450eef65 100644 --- a/include/xmloff/xmlaustp.hxx +++ b/include/xmloff/xmlaustp.hxx @@ -30,7 +30,7 @@ class SvXMLExportPropertyMapper; class SvXMLNamespaceMap; class SvXMLAutoStylePoolP_Impl; -class SvXMLAttributeList; +namespace comphelper { class AttributeList; } class SvXMLExport; class SvXMLUnitConverter; struct XMLPropertyState; @@ -56,7 +56,7 @@ class XMLOFF_DLLPUBLIC SvXMLAutoStylePoolP : public salhelper::SimpleReferenceOb protected: virtual void exportStyleAttributes( - SvXMLAttributeList& rAttrList, + comphelper::AttributeList& rAttrList, XmlStyleFamily nFamily, const ::std::vector< XMLPropertyState >& rProperties, const SvXMLExportPropertyMapper& rPropExp, diff --git a/include/xmloff/xmlexp.hxx b/include/xmloff/xmlexp.hxx index 818f524ad545..8fd763438e81 100644 --- a/include/xmloff/xmlexp.hxx +++ b/include/xmloff/xmlexp.hxx @@ -25,7 +25,6 @@ #include <sal/types.h> #include <rtl/ustring.hxx> -#include <xmloff/attrlist.hxx> #include <xmloff/txtparae.hxx> #include <xmloff/formlayerexport.hxx> #include <xmloff/xmlnumfe.hxx> @@ -45,6 +44,7 @@ #include <unotools/securityoptions.hxx> #include <xmloff/XMLPageExport.hxx> +#include <comphelper/attributelist.hxx> #include <comphelper/servicehelper.hxx> #include <cppuhelper/implbase.hxx> #include <tools/fldunit.hxx> @@ -129,7 +129,7 @@ class XMLOFF_DLLPUBLIC SvXMLExport : public cppu::WeakImplHelper< css::uno::Reference< css::beans::XPropertySet > mxExportInfo; css::uno::Reference< css::lang::XEventListener > mxEventListener; - rtl::Reference<SvXMLAttributeList> mxAttrList; // a common attribute list + rtl::Reference<comphelper::AttributeList> mxAttrList; // a common attribute list OUString msOrigFileName; // the original URL OUString msFilterName; @@ -371,7 +371,7 @@ public: css::xml::sax::XAttributeList >& xAttrList ); // Get common attribute list as implementation or interface. - SvXMLAttributeList &GetAttrList() { return *mxAttrList; } + comphelper::AttributeList &GetAttrList() { return *mxAttrList; } css::uno::Reference< css::xml::sax::XAttributeList > GetXAttrList() const { return mxAttrList; } // Get document handler. This methods are not const, because the diff --git a/include/xmloff/xmlexppr.hxx b/include/xmloff/xmlexppr.hxx index a968d70e247d..53f6c558257d 100644 --- a/include/xmloff/xmlexppr.hxx +++ b/include/xmloff/xmlexppr.hxx @@ -48,7 +48,7 @@ namespace o3tl } class SvXMLUnitConverter; -class SvXMLAttributeList; +namespace comphelper { class AttributeList; } class SvXMLNamespaceMap; class SvXMLExport; @@ -79,14 +79,14 @@ protected: /** fills the given attribute list with the items in the given set */ void _exportXML( sal_uInt16 nPropType, sal_uInt16& rPropTypeFlags, - SvXMLAttributeList& rAttrList, + comphelper::AttributeList& rAttrList, const ::std::vector< XMLPropertyState >& rProperties, const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap, std::vector<sal_uInt16>* pIndexArray, sal_Int32 nPropMapStartIdx, sal_Int32 nPropMapEndIdx ) const; - void _exportXML( SvXMLAttributeList& rAttrList, + void _exportXML( comphelper::AttributeList& rAttrList, const XMLPropertyState& rProperty, const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap, @@ -169,7 +169,7 @@ public: /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set */ virtual void handleSpecialItem( - SvXMLAttributeList& rAttrList, + comphelper::AttributeList& rAttrList, const XMLPropertyState& rProperty, const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap, diff --git a/lotuswordpro/source/filter/xfilter/xfsaxattrlist.cxx b/lotuswordpro/source/filter/xfilter/xfsaxattrlist.cxx index aa175d8490ff..7c87d33404ea 100644 --- a/lotuswordpro/source/filter/xfilter/xfsaxattrlist.cxx +++ b/lotuswordpro/source/filter/xfilter/xfsaxattrlist.cxx @@ -58,10 +58,10 @@ * Document object of the xml filter framework. ************************************************************************/ #include "xfsaxattrlist.hxx" -#include <xmloff/attrlist.hxx> +#include <comphelper/attributelist.hxx> XFSaxAttrList::XFSaxAttrList() - : m_xSvAttrList(new SvXMLAttributeList()) + : m_xSvAttrList(new comphelper::AttributeList()) { } diff --git a/lotuswordpro/source/filter/xfilter/xfsaxattrlist.hxx b/lotuswordpro/source/filter/xfilter/xfsaxattrlist.hxx index 4a727727d353..81e820d80d1e 100644 --- a/lotuswordpro/source/filter/xfilter/xfsaxattrlist.hxx +++ b/lotuswordpro/source/filter/xfilter/xfsaxattrlist.hxx @@ -60,9 +60,17 @@ #ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_XFILTER_XFSAXATTRLIST_HXX #define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_XFILTER_XFSAXATTRLIST_HXX +#include <sal/config.h> + +#include <com/sun/star/xml/sax/XAttributeList.hpp> + #include <xfilter/ixfattrlist.hxx> #include <rtl/ref.hxx> -#include <xmloff/attrlist.hxx> + +namespace comphelper +{ +class AttributeList; +} class XFSaxAttrList : public IXFAttrList { @@ -82,7 +90,7 @@ public: friend class XFSaxStream; private: - rtl::Reference<SvXMLAttributeList> m_xSvAttrList; + rtl::Reference<comphelper::AttributeList> m_xSvAttrList; }; #endif //XFSAXATTRLIST_INC diff --git a/package/source/manifest/ManifestDefines.hxx b/package/source/manifest/ManifestDefines.hxx index b5006f2d1c08..f491e4cb4cf4 100644 --- a/package/source/manifest/ManifestDefines.hxx +++ b/package/source/manifest/ManifestDefines.hxx @@ -28,7 +28,6 @@ inline constexpr OUStringLiteral MANIFEST_NAMESPACE = u"http://openoffice.org/20 inline constexpr OUStringLiteral MANIFEST_OASIS_NAMESPACE = u"urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"; inline constexpr OUStringLiteral MANIFEST_LOEXT_NAMESPACE = u"urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"; inline constexpr OUStringLiteral MANIFEST_DOCTYPE = u"<!DOCTYPE manifest:manifest PUBLIC \"-//OpenOffice.org//DTD Manifest 1.0//EN\" \"Manifest.dtd\">"; -inline constexpr OUStringLiteral ATTRIBUTE_CDATA = u"CDATA"; inline constexpr OUStringLiteral ELEMENT_FILE_ENTRY = u"manifest:file-entry"; inline constexpr OUStringLiteral ATTRIBUTE_FULL_PATH = u"manifest:full-path"; diff --git a/package/source/manifest/ManifestExport.cxx b/package/source/manifest/ManifestExport.cxx index 7e7f22a3adfd..938a33526d3c 100644 --- a/package/source/manifest/ManifestExport.cxx +++ b/package/source/manifest/ManifestExport.cxx @@ -141,7 +141,6 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con { // oasis format pRootAttrList->AddAttribute ( ATTRIBUTE_XMLNS, - ATTRIBUTE_CDATA, MANIFEST_OASIS_NAMESPACE ); bAcceptNonemptyVersion = true; if ( aDocVersion.compareTo( ODFVER_012_TEXT ) >= 0 ) @@ -149,10 +148,9 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con // this is ODF12 or later generation, let encrypted // streams contain start-key-generation entry bStoreStartKeyGeneration = true; - pRootAttrList->AddAttribute ( ATTRIBUTE_VERSION, ATTRIBUTE_CDATA, aDocVersion ); + pRootAttrList->AddAttribute ( ATTRIBUTE_VERSION, aDocVersion ); // plus gpg4libre extensions - loext NS for that pRootAttrList->AddAttribute ( ATTRIBUTE_XMLNS_LOEXT, - ATTRIBUTE_CDATA, MANIFEST_LOEXT_NAMESPACE ); } } @@ -161,7 +159,6 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con // even if it is no SO6 format the namespace must be specified // thus SO6 format is used as default one pRootAttrList->AddAttribute ( ATTRIBUTE_XMLNS, - ATTRIBUTE_CDATA, MANIFEST_NAMESPACE ); bProvideDTD = true; @@ -230,7 +227,6 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con // TODO: the algorithm should rather be configurable pNewAttrList->AddAttribute( isODF13 ? OUString(ATTRIBUTE_ALGORITHM13) : OUString(ATTRIBUTE_ALGORITHM), - ATTRIBUTE_CDATA, "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p" ); xHandler->startElement(isODF13 ? OUString(ELEMENT_ENCRYPTIONMETHOD13) : OUString(ELEMENT_ENCRYPTIONMETHOD), pNewAttrList); xHandler->endElement(isODF13 ? OUString(ELEMENT_ENCRYPTIONMETHOD13) : OUString(ELEMENT_ENCRYPTIONMETHOD)); @@ -301,25 +297,25 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con if (rValue.Name == sMediaTypeProperty ) { rValue.Value >>= aString; - pAttrList->AddAttribute ( ATTRIBUTE_MEDIA_TYPE, ATTRIBUTE_CDATA, aString ); + pAttrList->AddAttribute ( ATTRIBUTE_MEDIA_TYPE, aString ); } else if (rValue.Name == sVersionProperty ) { rValue.Value >>= aString; // the version is stored only if it is not empty if ( bAcceptNonemptyVersion && !aString.isEmpty() ) - pAttrList->AddAttribute ( ATTRIBUTE_VERSION, ATTRIBUTE_CDATA, aString ); + pAttrList->AddAttribute ( ATTRIBUTE_VERSION, aString ); } else if (rValue.Name == sFullPathProperty ) { rValue.Value >>= aString; - pAttrList->AddAttribute ( ATTRIBUTE_FULL_PATH, ATTRIBUTE_CDATA, aString ); + pAttrList->AddAttribute ( ATTRIBUTE_FULL_PATH, aString ); } else if (rValue.Name == sSizeProperty ) { sal_Int64 nSize = 0; rValue.Value >>= nSize; - pAttrList->AddAttribute ( ATTRIBUTE_SIZE, ATTRIBUTE_CDATA, OUString::number( nSize ) ); + pAttrList->AddAttribute ( ATTRIBUTE_SIZE, OUString::number( nSize ) ); } else if (rValue.Name == sInitialisationVectorProperty ) pVector = &rValue.Value; @@ -361,10 +357,10 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con else throw uno::RuntimeException( THROW_WHERE "Unexpected digest algorithm is provided!" ); - pNewAttrList->AddAttribute ( ATTRIBUTE_CHECKSUM_TYPE, ATTRIBUTE_CDATA, sChecksumType ); + pNewAttrList->AddAttribute ( ATTRIBUTE_CHECKSUM_TYPE, sChecksumType ); *pDigest >>= aSequence; ::comphelper::Base64::encode(aBuffer, aSequence); - pNewAttrList->AddAttribute ( ATTRIBUTE_CHECKSUM, ATTRIBUTE_CDATA, aBuffer.makeStringAndClear() ); + pNewAttrList->AddAttribute ( ATTRIBUTE_CHECKSUM, aBuffer.makeStringAndClear() ); xHandler->startElement( ELEMENT_ENCRYPTION_DATA , pNewAttrList); @@ -392,11 +388,11 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con else throw uno::RuntimeException( THROW_WHERE "Unexpected encryption algorithm is provided!" ); - pNewAttrList->AddAttribute ( ATTRIBUTE_ALGORITHM_NAME, ATTRIBUTE_CDATA, sEncAlgName ); + pNewAttrList->AddAttribute ( ATTRIBUTE_ALGORITHM_NAME, sEncAlgName ); *pVector >>= aSequence; ::comphelper::Base64::encode(aBuffer, aSequence); - pNewAttrList->AddAttribute ( ATTRIBUTE_INITIALISATION_VECTOR, ATTRIBUTE_CDATA, aBuffer.makeStringAndClear() ); + pNewAttrList->AddAttribute ( ATTRIBUTE_INITIALISATION_VECTOR, aBuffer.makeStringAndClear() ); xHandler->ignorableWhitespace ( sWhiteSpace ); xHandler->startElement( ELEMENT_ALGORITHM , pNewAttrList); @@ -427,8 +423,8 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con else throw uno::RuntimeException( THROW_WHERE "Unexpected start key algorithm is provided!" ); - pNewAttrList->AddAttribute ( ATTRIBUTE_START_KEY_GENERATION_NAME, ATTRIBUTE_CDATA, sStartKeyAlg ); - pNewAttrList->AddAttribute ( ATTRIBUTE_KEY_SIZE, ATTRIBUTE_CDATA, sStartKeySize ); + pNewAttrList->AddAttribute ( ATTRIBUTE_START_KEY_GENERATION_NAME, sStartKeyAlg ); + pNewAttrList->AddAttribute ( ATTRIBUTE_KEY_SIZE, sStartKeySize ); xHandler->ignorableWhitespace ( sWhiteSpace ); xHandler->startElement( ELEMENT_START_KEY_GENERATION , pNewAttrList); @@ -442,7 +438,6 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con if (pKeyInfoProperty) { pNewAttrList->AddAttribute(ATTRIBUTE_KEY_DERIVATION_NAME, - ATTRIBUTE_CDATA, sPGP_Name); // no start-key-generation needed, our session key has // max size already @@ -451,23 +446,22 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con else { pNewAttrList->AddAttribute(ATTRIBUTE_KEY_DERIVATION_NAME, - ATTRIBUTE_CDATA, sPBKDF2_Name); if (bStoreStartKeyGeneration) { aBuffer.append(nDerivedKeySize); - pNewAttrList->AddAttribute(ATTRIBUTE_KEY_SIZE, ATTRIBUTE_CDATA, aBuffer.makeStringAndClear()); + pNewAttrList->AddAttribute ( ATTRIBUTE_KEY_SIZE, aBuffer.makeStringAndClear() ); } sal_Int32 nCount = 0; *pIterationCount >>= nCount; aBuffer.append(nCount); - pNewAttrList->AddAttribute(ATTRIBUTE_ITERATION_COUNT, ATTRIBUTE_CDATA, aBuffer.makeStringAndClear()); + pNewAttrList->AddAttribute ( ATTRIBUTE_ITERATION_COUNT, aBuffer.makeStringAndClear() ); *pSalt >>= aSequence; ::comphelper::Base64::encode(aBuffer, aSequence); - pNewAttrList->AddAttribute(ATTRIBUTE_SALT, ATTRIBUTE_CDATA, aBuffer.makeStringAndClear()); + pNewAttrList->AddAttribute ( ATTRIBUTE_SALT, aBuffer.makeStringAndClear() ); } xHandler->ignorableWhitespace(sWhiteSpace); diff --git a/reportdesign/inc/pch/precompiled_rptxml.hxx b/reportdesign/inc/pch/precompiled_rptxml.hxx index 6f130bdce3b8..5879739fa19b 100644 --- a/reportdesign/inc/pch/precompiled_rptxml.hxx +++ b/reportdesign/inc/pch/precompiled_rptxml.hxx @@ -93,7 +93,6 @@ #include <unotools/saveopt.hxx> #include <unotools/unotoolsdllapi.h> #include <xmloff/ProgressBarHelper.hxx> -#include <xmloff/attrlist.hxx> #include <xmloff/dllapi.h> #include <xmloff/families.hxx> #include <xmloff/maptype.hxx> diff --git a/reportdesign/source/filter/xml/xmlAutoStyle.cxx b/reportdesign/source/filter/xml/xmlAutoStyle.cxx index 0e2fbb5a4f78..d292b84bd4be 100644 --- a/reportdesign/source/filter/xml/xmlAutoStyle.cxx +++ b/reportdesign/source/filter/xml/xmlAutoStyle.cxx @@ -27,7 +27,7 @@ namespace rptxml using namespace ::com::sun::star::xml::sax; void OXMLAutoStylePoolP::exportStyleAttributes( - SvXMLAttributeList& rAttrList, + comphelper::AttributeList& rAttrList, XmlStyleFamily nFamily, const ::std::vector< XMLPropertyState >& rProperties, const SvXMLExportPropertyMapper& rPropExp diff --git a/reportdesign/source/filter/xml/xmlAutoStyle.hxx b/reportdesign/source/filter/xml/xmlAutoStyle.hxx index 4f0643878d6a..448ec2362bf3 100644 --- a/reportdesign/source/filter/xml/xmlAutoStyle.hxx +++ b/reportdesign/source/filter/xml/xmlAutoStyle.hxx @@ -30,7 +30,7 @@ namespace rptxml ORptExport& rORptExport; virtual void exportStyleAttributes( - SvXMLAttributeList& rAttrList, + comphelper::AttributeList& rAttrList, XmlStyleFamily nFamily, const ::std::vector< XMLPropertyState >& rProperties, const SvXMLExportPropertyMapper& rPropExp, diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx index e3bf45249a44..a6be49961a8d 100644 --- a/reportdesign/source/filter/xml/xmlExport.cxx +++ b/reportdesign/source/filter/xml/xmlExport.cxx @@ -136,7 +136,7 @@ namespace rptxml /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set */ virtual void handleSpecialItem( - SvXMLAttributeList& /*rAttrList*/, + comphelper::AttributeList& /*rAttrList*/, const XMLPropertyState& /*rProperty*/, const SvXMLUnitConverter& /*rUnitConverter*/, const SvXMLNamespaceMap& /*rNamespaceMap*/, @@ -992,7 +992,7 @@ bool ORptExport::exportFormula(enum ::xmloff::token::XMLTokenEnum eName,const OU return bRet; } -void ORptExport::exportStyleName(XPropertySet* _xProp,SvXMLAttributeList& _rAtt,const OUString& _sName) +void ORptExport::exportStyleName(XPropertySet* _xProp,comphelper::AttributeList& _rAtt,const OUString& _sName) { Reference<XPropertySet> xFind(_xProp); TPropertyStyleMap::const_iterator aFind = m_aAutoStyleNames.find(xFind); diff --git a/reportdesign/source/filter/xml/xmlExport.hxx b/reportdesign/source/filter/xml/xmlExport.hxx index f82d85aa7e11..130ad0b7788d 100644 --- a/reportdesign/source/filter/xml/xmlExport.hxx +++ b/reportdesign/source/filter/xml/xmlExport.hxx @@ -109,7 +109,7 @@ private: void exportMasterDetailFields(const Reference<XReportComponent>& _xReportComponent); void exportComponent(const Reference<XReportComponent>& _xReportComponent); void exportGroup(const Reference<XReportDefinition>& _xReportDefinition,sal_Int32 _nPos,bool _bExportAutoStyle = false); - void exportStyleName(XPropertySet* _xProp,SvXMLAttributeList& _rAtt,const OUString& _sName); + void exportStyleName(XPropertySet* _xProp,comphelper::AttributeList& _rAtt,const OUString& _sName); void exportSection(const Reference<XSection>& _xProp,bool bHeader = false); void exportContainer(const Reference< XSection>& _xSection); void exportShapes(const Reference< XSection>& _xSection,bool _bAddParagraph = true); diff --git a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx index 95cc0ffca589..3e9d2582c171 100644 --- a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx +++ b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx @@ -23,11 +23,11 @@ #include <com/sun/star/chart2/data/XDatabaseDataProvider.hpp> #include <com/sun/star/chart/XComplexDescriptionAccess.hpp> #include <com/sun/star/reflection/ProxyFactory.hpp> +#include <comphelper/attributelist.hxx> #include <comphelper/sequenceashashmap.hxx> #include <comphelper/documentconstants.hxx> #include <cppuhelper/supportsservice.hxx> #include <utility> -#include <xmloff/attrlist.hxx> #include <xmloff/xmltoken.hxx> #include <xmloff/xmlement.hxx> #include <xmloff/xmluconv.hxx> @@ -58,7 +58,7 @@ OUString lcl_createAttribute(const xmloff::token::XMLTokenEnum& _eNamespace,cons static void lcl_correctCellAddress(const OUString & _sName, const uno::Reference< xml::sax::XAttributeList > & xAttribs) { - SvXMLAttributeList* pList = dynamic_cast<SvXMLAttributeList*>(xAttribs.get()); + comphelper::AttributeList* pList = dynamic_cast<comphelper::AttributeList*>(xAttribs.get()); OUString sCellAddress = pList->getValueByName(_sName); const sal_Int32 nPos = sCellAddress.lastIndexOf('$'); if ( nPos != -1 ) @@ -122,7 +122,7 @@ void SAL_CALL ExportDocumentHandler::startElement(const OUString & _sName, const bool bExport = true; if ( _sName == "office:chart" ) { - rtl::Reference<SvXMLAttributeList> pList = new SvXMLAttributeList(); + rtl::Reference<comphelper::AttributeList> pList = new comphelper::AttributeList(); OUStringBuffer sValue; static const SvXMLEnumMapEntry<sal_uInt16> aXML_CommandTypeEnumMap[] = { @@ -152,7 +152,7 @@ void SAL_CALL ExportDocumentHandler::startElement(const OUString & _sName, const const OUString sTableCalc = lcl_createAttribute(XML_NP_TABLE,XML_CALCULATION_SETTINGS); m_xDelegatee->startElement(sTableCalc,nullptr); - pList = new SvXMLAttributeList(); + pList = new comphelper::AttributeList(); pList->AddAttribute(lcl_createAttribute(XML_NP_TABLE,XML_DATE_VALUE),"1899-12-30"); const OUString sNullDate = lcl_createAttribute(XML_NP_TABLE,XML_NULL_DATE); @@ -186,7 +186,7 @@ void SAL_CALL ExportDocumentHandler::startElement(const OUString & _sName, const bExport = false; else if ( _sName == "chart:plot-area" ) { - SvXMLAttributeList* pList = dynamic_cast<SvXMLAttributeList*>(xAttribs.get()); + comphelper::AttributeList* pList = dynamic_cast<comphelper::AttributeList*>(xAttribs.get()); pList->RemoveAttribute("table:cell-range-address"); } else if ( _sName == "chart:categories" ) @@ -201,7 +201,7 @@ void SAL_CALL ExportDocumentHandler::startElement(const OUString & _sName, const } else if ( m_bTableRowsStarted && !m_bFirstRowExported && _sName == "table:table-cell" ) { - SvXMLAttributeList* pList = dynamic_cast<SvXMLAttributeList*>(xAttribs.get()); + comphelper::AttributeList* pList = dynamic_cast<comphelper::AttributeList*>(xAttribs.get()); static OUString s_sValue(lcl_createAttribute(XML_NP_OFFICE,XML_VALUE)); pList->RemoveAttribute(s_sValue); } @@ -345,7 +345,7 @@ void ExportDocumentHandler::exportTableRows() const OUString sFormulaAttrib( lcl_createAttribute(XML_NP_RPT,XML_FORMULA) ); static constexpr OUStringLiteral s_sFloat = u"float"; - rtl::Reference<SvXMLAttributeList> pCellAtt = new SvXMLAttributeList(); + rtl::Reference<comphelper::AttributeList> pCellAtt = new comphelper::AttributeList(); pCellAtt->AddAttribute(sValueType, "string"); bool bRemoveString = true; @@ -370,7 +370,7 @@ void ExportDocumentHandler::exportTableRows() for(const auto& rColumn : std::as_const(m_aColumns)) { OUString sFormula = "field:[" + rColumn + "]"; - rtl::Reference<SvXMLAttributeList> pList = new SvXMLAttributeList(); + rtl::Reference<comphelper::AttributeList> pList = new comphelper::AttributeList(); pList->AddAttribute(sFormulaAttrib,sFormula); m_xDelegatee->startElement(sCell,pCellAtt); diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx index eb3da46309f8..02607a302af3 100644 --- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx +++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx @@ -26,11 +26,11 @@ #include <com/sun/star/chart/XComplexDescriptionAccess.hpp> #include <com/sun/star/chart/ChartDataRowSource.hpp> #include <com/sun/star/reflection/ProxyFactory.hpp> +#include <comphelper/attributelist.hxx> #include <comphelper/sequenceashashmap.hxx> #include <comphelper/namedvaluecollection.hxx> #include <cppuhelper/supportsservice.hxx> #include <utility> -#include <xmloff/attrlist.hxx> #include <xmloff/xmltoken.hxx> #include <xmloff/xmlement.hxx> #include <xmloff/xmluconv.hxx> @@ -271,7 +271,7 @@ void SAL_CALL ImportDocumentHandler::startElement(const OUString & _sName, const } } - rtl::Reference<SvXMLAttributeList> pList = new SvXMLAttributeList(); + rtl::Reference<comphelper::AttributeList> pList = new comphelper::AttributeList(); xNewAttribs = pList; pList->AppendAttributeList(_xAttrList); pList->AddAttribute("table:cell-range-address","local-table.$A$1:.$Z$65536"); diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx index 78b7e2252da0..146a8c4193db 100644 --- a/sax/source/expatwrap/sax_expat.cxx +++ b/sax/source/expatwrap/sax_expat.cxx @@ -142,8 +142,6 @@ struct Entity }; -constexpr OUStringLiteral gsCDATA = u"CDATA"; - class SaxExpatParser_Impl { public: // module scope @@ -711,7 +709,6 @@ void SaxExpatParser_Impl::callbackStartElement( void *pvThis , assert(awAttributes[i+1]); pImpl->rAttrList->AddAttribute( XML_CHAR_TO_OUSTRING( awAttributes[i] ) , - gsCDATA, // expat doesn't know types XML_CHAR_TO_OUSTRING( awAttributes[i+1] ) ); i +=2; } diff --git a/sax/source/fastparser/legacyfastparser.cxx b/sax/source/fastparser/legacyfastparser.cxx index e4c425bd07d3..62e7b8a57a88 100644 --- a/sax/source/fastparser/legacyfastparser.cxx +++ b/sax/source/fastparser/legacyfastparser.cxx @@ -75,7 +75,7 @@ void NamespaceHandler::addNSDeclAttributes( rtl::Reference < comphelper::Attribu sDecl = "xmlns"; else sDecl = "xmlns:" + rPrefix; - rAttrList->AddAttribute( sDecl, "CDATA", rNamespaceURI ); + rAttrList->AddAttribute( sDecl, rNamespaceURI ); } m_aNamespaceDefines.clear(); } @@ -233,7 +233,7 @@ void SAL_CALL CallbackDocumentHandler::startUnknownElement( const OUString& /*Na if ( !rAttrNamespacePrefix.isEmpty() ) sAttrName = rAttrNamespacePrefix + aNamespaceSeparator + sAttrName; - rAttrList->AddAttribute( sAttrName, "CDATA", rAttrValue ); + rAttrList->AddAttribute( sAttrName, rAttrValue ); } const Sequence< xml::Attribute > unknownAttribs = Attribs->getUnknownAttributes(); @@ -242,7 +242,7 @@ void SAL_CALL CallbackDocumentHandler::startUnknownElement( const OUString& /*Na const OUString& rAttrValue = rAttr.Value; const OUString& rAttrName = rAttr.Name; - rAttrList->AddAttribute( rAttrName, "CDATA", rAttrValue ); + rAttrList->AddAttribute( rAttrName, rAttrValue ); } m_xDocumentHandler->startElement( Name, rAttrList ); } diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index e164766fa677..2e35f05367ca 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -3407,7 +3407,7 @@ void ScXMLExport::ExportShape(const uno::Reference < drawing::XShape >& xShape, if ( !sRanges.isEmpty() ) { bIsChart = true; - rtl::Reference<SvXMLAttributeList> pAttrList = new SvXMLAttributeList(); + rtl::Reference<comphelper::AttributeList> pAttrList = new comphelper::AttributeList(); pAttrList->AddAttribute( GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_DRAW, GetXMLToken( XML_NOTIFY_ON_UPDATE_OF_RANGES ) ), sRanges ); GetShapeExport()->exportShape( xShape, SEF_DEFAULT, pPoint, pAttrList.get() ); @@ -3432,7 +3432,7 @@ void ScXMLExport::ExportShape(const uno::Reference < drawing::XShape >& xShape, bIsChart = true; uno::Sequence< OUString > aRepresentations( xReceiver->getUsedRangeRepresentations()); - rtl::Reference<SvXMLAttributeList> pAttrList; + rtl::Reference<comphelper::AttributeList> pAttrList; try { if (aRepresentations.hasElements()) @@ -3442,7 +3442,7 @@ void ScXMLExport::ExportShape(const uno::Reference < drawing::XShape >& xShape, // load (when the chart is not yet loaded) uno::Reference< chart2::data::XRangeXMLConversion > xRangeConverter( xChartDoc->getDataProvider(), uno::UNO_QUERY ); sRanges = lcl_RangeSequenceToString( aRepresentations, xRangeConverter ); - pAttrList = new SvXMLAttributeList(); + pAttrList = new comphelper::AttributeList(); pAttrList->AddAttribute( GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_DRAW, GetXMLToken(XML_NOTIFY_ON_UPDATE_OF_RANGES) ), sRanges ); } diff --git a/sc/source/filter/xml/xmlstyle.cxx b/sc/source/filter/xml/xmlstyle.cxx index 2c4993778870..f434432c7671 100644 --- a/sc/source/filter/xml/xmlstyle.cxx +++ b/sc/source/filter/xml/xmlstyle.cxx @@ -511,7 +511,7 @@ void ScXMLCellExportPropertyMapper::ContextFilter( /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set */ void ScXMLCellExportPropertyMapper::handleSpecialItem( - SvXMLAttributeList& /* rAttrList */, + comphelper::AttributeList& /* rAttrList */, const XMLPropertyState& /* rProperty */, const SvXMLUnitConverter& /* rUnitConverter */, const SvXMLNamespaceMap& /* rNamespaceMap */, @@ -575,7 +575,7 @@ ScXMLColumnExportPropertyMapper::~ScXMLColumnExportPropertyMapper() /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set */ void ScXMLColumnExportPropertyMapper::handleSpecialItem( - SvXMLAttributeList& /* rAttrList */, + comphelper::AttributeList& /* rAttrList */, const XMLPropertyState& /* rProperty */, const SvXMLUnitConverter& /* rUnitConverter */, const SvXMLNamespaceMap& /* rNamespaceMap */, @@ -597,7 +597,7 @@ ScXMLTableExportPropertyMapper::~ScXMLTableExportPropertyMapper() /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set */ void ScXMLTableExportPropertyMapper::handleSpecialItem( - SvXMLAttributeList& /* rAttrList */, + comphelper::AttributeList& /* rAttrList */, const XMLPropertyState& /* rProperty */, const SvXMLUnitConverter& /* rUnitConverter */, const SvXMLNamespaceMap& /* rNamespaceMap */, @@ -608,7 +608,7 @@ void ScXMLTableExportPropertyMapper::handleSpecialItem( } void ScXMLAutoStylePoolP::exportStyleAttributes( - SvXMLAttributeList& rAttrList, + comphelper::AttributeList& rAttrList, XmlStyleFamily nFamily, const ::std::vector< XMLPropertyState >& rProperties, const SvXMLExportPropertyMapper& rPropExp diff --git a/sc/source/filter/xml/xmlstyle.hxx b/sc/source/filter/xml/xmlstyle.hxx index 4636ff4c4cf6..ed7c569b3862 100644 --- a/sc/source/filter/xml/xmlstyle.hxx +++ b/sc/source/filter/xml/xmlstyle.hxx @@ -120,7 +120,7 @@ public: /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set */ virtual void handleSpecialItem( - SvXMLAttributeList& rAttrList, + comphelper::AttributeList& rAttrList, const XMLPropertyState& rProperty, const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap, @@ -151,7 +151,7 @@ public: /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set */ virtual void handleSpecialItem( - SvXMLAttributeList& rAttrList, + comphelper::AttributeList& rAttrList, const XMLPropertyState& rProperty, const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap, @@ -169,7 +169,7 @@ public: /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set */ virtual void handleSpecialItem( - SvXMLAttributeList& rAttrList, + comphelper::AttributeList& rAttrList, const XMLPropertyState& rProperty, const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap, @@ -182,7 +182,7 @@ class ScXMLAutoStylePoolP : public SvXMLAutoStylePoolP ScXMLExport& rScXMLExport; virtual void exportStyleAttributes( - SvXMLAttributeList& rAttrList, + comphelper::AttributeList& rAttrList, XmlStyleFamily nFamily, const ::std::vector< XMLPropertyState >& rProperties, const SvXMLExportPropertyMapper& rPropExp, diff --git a/sfx2/source/doc/doctemplateslocal.cxx b/sfx2/source/doc/doctemplateslocal.cxx index 5a55df72a45a..fa83d1f4ccf4 100644 --- a/sfx2/source/doc/doctemplateslocal.cxx +++ b/sfx2/source/doc/doctemplateslocal.cxx @@ -58,14 +58,12 @@ void DocTemplLocaleHelper::WriteGroupLocalizationSequence( const uno::Reference< xWriterHandler->setOutputStream( xOutStream ); - static const OUStringLiteral aCDATAString( u"CDATA" ); static const OUStringLiteral aWhiteSpace( u" " ); // write the namespace rtl::Reference<::comphelper::AttributeList> pRootAttrList = new ::comphelper::AttributeList; pRootAttrList->AddAttribute( "xmlns:groupuinames", - aCDATAString, "http://openoffice.org/2006/groupuinames" ); xWriterHandler->startDocument(); @@ -74,8 +72,8 @@ void DocTemplLocaleHelper::WriteGroupLocalizationSequence( const uno::Reference< for (const auto & i : aSequence) { rtl::Reference<::comphelper::AttributeList> pAttrList = new ::comphelper::AttributeList; - pAttrList->AddAttribute( g_sNameAttr, aCDATAString, i.First ); - pAttrList->AddAttribute( g_sUINameAttr, aCDATAString, i.Second ); + pAttrList->AddAttribute( g_sNameAttr, i.First ); + pAttrList->AddAttribute( g_sUINameAttr, i.Second ); xWriterHandler->startElement( g_sGroupElement, pAttrList ); xWriterHandler->ignorableWhitespace( aWhiteSpace ); diff --git a/starmath/source/mathml/mathmlexport.cxx b/starmath/source/mathml/mathmlexport.cxx index 9a2c6cd2db8f..6382ade13a53 100644 --- a/starmath/source/mathml/mathmlexport.cxx +++ b/starmath/source/mathml/mathmlexport.cxx @@ -47,7 +47,6 @@ #include <xmloff/xmlnamespace.hxx> #include <xmloff/xmltoken.hxx> #include <xmloff/namespacemap.hxx> -#include <xmloff/attrlist.hxx> #include <comphelper/genericpropertyset.hxx> #include <comphelper/servicehelper.hxx> #include <comphelper/propertysetinfo.hxx> @@ -394,7 +393,7 @@ ErrCode SmXMLExport::exportDoc(enum XMLTokenEnum eClass) addChaffWhenEncryptedStorage(); /*Add xmlns line*/ - SvXMLAttributeList& rList = GetAttrList(); + comphelper::AttributeList& rList = GetAttrList(); // make use of a default namespace ResetNamespaceMap(); // Math doesn't need namespaces from xmloff, since it now uses default namespaces (because that is common with current MathML usage in the web) diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx index 3be82886d11a..c912d4c8c58f 100644 --- a/sw/source/filter/xml/xmlexpit.cxx +++ b/sw/source/filter/xml/xmlexpit.cxx @@ -26,7 +26,6 @@ #include <svl/itemset.hxx> #include <utility> #include <xmloff/xmluconv.hxx> -#include <xmloff/attrlist.hxx> #include <xmloff/namespacemap.hxx> #include <xmloff/xmlnamespace.hxx> #include <xmloff/prhdlfac.hxx> @@ -62,7 +61,7 @@ using uno::Any; // fills the given attribute list with the items in the given set void SvXMLExportItemMapper::exportXML( const SvXMLExport& rExport, - SvXMLAttributeList& rAttrList, + comphelper::AttributeList& rAttrList, const SfxItemSet& rSet, const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap, @@ -106,7 +105,7 @@ void SvXMLExportItemMapper::exportXML( const SvXMLExport& rExport, } void SvXMLExportItemMapper::exportXML(const SvXMLExport&, - SvXMLAttributeList& rAttrList, + comphelper::AttributeList& rAttrList, const SfxPoolItem& rItem, const SvXMLItemMapEntry& rEntry, const SvXMLUnitConverter& rUnitConverter, @@ -319,7 +318,7 @@ void SvXMLExportItemMapper::exportXML( SvXMLExport& rExport, /** this method is called for every item that has the MID_SW_FLAG_SPECIAL_ITEM_EXPORT flag set */ -void SvXMLExportItemMapper::handleSpecialItem( SvXMLAttributeList& /*rAttrList*/, +void SvXMLExportItemMapper::handleSpecialItem( comphelper::AttributeList& /*rAttrList*/, const SvXMLItemMapEntry& /*rEntry*/, const SfxPoolItem& /*rItem*/, const SvXMLUnitConverter& /*rUnitConverter*/, diff --git a/sw/source/filter/xml/xmlexpit.hxx b/sw/source/filter/xml/xmlexpit.hxx index 0ca39f024466..b0e10fb0ab86 100644 --- a/sw/source/filter/xml/xmlexpit.hxx +++ b/sw/source/filter/xml/xmlexpit.hxx @@ -27,7 +27,7 @@ class SvXMLUnitConverter; class SfxPoolItem; class SfxItemSet; -class SvXMLAttributeList; +namespace comphelper { class AttributeList; } class SvXMLNamespaceMap; class SvXMLExport; @@ -38,14 +38,14 @@ class SvXMLExportItemMapper protected: /** fills the given attribute list with the items in the given set */ void exportXML( const SvXMLExport& rExport, - SvXMLAttributeList& rAttrList, + comphelper::AttributeList& rAttrList, const SfxItemSet& rSet, const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap, std::vector<sal_uInt16> *pIndexArray ) const; void exportXML( const SvXMLExport& rExport, - SvXMLAttributeList& rAttrList, + comphelper::AttributeList& rAttrList, const SfxPoolItem& rItem, const SvXMLItemMapEntry &rEntry, const SvXMLUnitConverter& rUnitConverter, @@ -70,7 +70,7 @@ public: /** this method is called for every item that has the MID_SW_FLAG_SPECIAL_ITEM_EXPORT flag set */ - virtual void handleSpecialItem( SvXMLAttributeList& rAttrList, + virtual void handleSpecialItem( comphelper::AttributeList& rAttrList, const SvXMLItemMapEntry& rEntry, const SfxPoolItem& rItem, const SvXMLUnitConverter& rUnitConverter, diff --git a/sw/source/filter/xml/xmlfmte.cxx b/sw/source/filter/xml/xmlfmte.cxx index f98e4ae3fb28..7dc23bb11b54 100644 --- a/sw/source/filter/xml/xmlfmte.cxx +++ b/sw/source/filter/xml/xmlfmte.cxx @@ -19,7 +19,6 @@ #include <com/sun/star/text/XTextDocument.hpp> #include <xmloff/xmlnamespace.hxx> -#include <xmloff/attrlist.hxx> #include "xmlexpit.hxx" #include <xmloff/namespacemap.hxx> #include <xmloff/XMLTextListAutoStylePool.hxx> @@ -270,7 +269,7 @@ class SwXMLAutoStylePoolP : public SvXMLAutoStylePoolP protected: virtual void exportStyleAttributes( - SvXMLAttributeList& rAttrList, + comphelper::AttributeList& rAttrList, XmlStyleFamily nFamily, const std::vector< XMLPropertyState >& rProperties, const SvXMLExportPropertyMapper& rPropExp @@ -285,7 +284,7 @@ public: } void SwXMLAutoStylePoolP::exportStyleAttributes( - SvXMLAttributeList& rAttrList, + comphelper::AttributeList& rAttrList, XmlStyleFamily nFamily, const std::vector< XMLPropertyState >& rProperties, const SvXMLExportPropertyMapper& rPropExp diff --git a/sw/source/filter/xml/xmliteme.cxx b/sw/source/filter/xml/xmliteme.cxx index a8fbc712ac90..3d19a9d6dc96 100644 --- a/sw/source/filter/xml/xmliteme.cxx +++ b/sw/source/filter/xml/xmliteme.cxx @@ -52,7 +52,7 @@ protected: static void AddAttribute( sal_uInt16 nPrefix, enum XMLTokenEnum eLName, const OUString& rValue, const SvXMLNamespaceMap& rNamespaceMap, - SvXMLAttributeList& rAttrList ); + comphelper::AttributeList& rAttrList ); public: @@ -60,7 +60,7 @@ public: SvXMLItemMapEntriesRef rMapEntries, SwXMLExport& rExp ); - virtual void handleSpecialItem( SvXMLAttributeList& rAttrList, + virtual void handleSpecialItem( comphelper::AttributeList& rAttrList, const SvXMLItemMapEntry& rEntry, const SfxPoolItem& rItem, const SvXMLUnitConverter& rUnitConverter, @@ -89,7 +89,7 @@ void SwXMLTableItemMapper_Impl::AddAttribute( sal_uInt16 nPrefix, enum XMLTokenEnum eLName, const OUString& rValue, const SvXMLNamespaceMap& rNamespaceMap, - SvXMLAttributeList& rAttrList ) + comphelper::AttributeList& rAttrList ) { OUString sName( rNamespaceMap.GetQNameByKey( nPrefix, GetXMLToken(eLName) ) ); @@ -97,7 +97,7 @@ void SwXMLTableItemMapper_Impl::AddAttribute( sal_uInt16 nPrefix, } void SwXMLTableItemMapper_Impl::handleSpecialItem( - SvXMLAttributeList& rAttrList, + comphelper::AttributeList& rAttrList, const SvXMLItemMapEntry& rEntry, const SfxPoolItem& rItem, const SvXMLUnitConverter& rUnitConverter, diff --git a/ucb/source/ucp/webdav-curl/CurlSession.cxx b/ucb/source/ucp/webdav-curl/CurlSession.cxx index 25804dbacc4f..7353c8c9fa7e 100644 --- a/ucb/source/ucp/webdav-curl/CurlSession.cxx +++ b/ucb/source/ucp/webdav-curl/CurlSession.cxx @@ -1598,7 +1598,7 @@ auto CurlProcessor::PropFind( xWriter->setOutputStream(xRequestOutStream); xWriter->startDocument(); rtl::Reference<::comphelper::AttributeList> const pAttrList(new ::comphelper::AttributeList); - pAttrList->AddAttribute("xmlns", "CDATA", "DAV:"); + pAttrList->AddAttribute("xmlns", "DAV:"); xWriter->startElement("propfind", pAttrList); if (o_pResourceInfos) { @@ -1620,7 +1620,7 @@ auto CurlProcessor::PropFind( SerfPropName name; DAVProperties::createSerfPropName(rName, name); pAttrList->Clear(); - pAttrList->AddAttribute("xmlns", "CDATA", OUString::createFromAscii(name.nspace)); + pAttrList->AddAttribute("xmlns", OUString::createFromAscii(name.nspace)); xWriter->startElement(OUString::createFromAscii(name.name), pAttrList); xWriter->endElement(OUString::createFromAscii(name.name)); } @@ -1738,7 +1738,7 @@ auto CurlSession::PROPPATCH(OUString const& rURIReference, xWriter->setOutputStream(xRequestOutStream); xWriter->startDocument(); rtl::Reference<::comphelper::AttributeList> const pAttrList(new ::comphelper::AttributeList); - pAttrList->AddAttribute("xmlns", "CDATA", "DAV:"); + pAttrList->AddAttribute("xmlns", "DAV:"); xWriter->startElement("propertyupdate", pAttrList); for (ProppatchValue const& rPropValue : rValues) { @@ -1750,7 +1750,7 @@ auto CurlSession::PROPPATCH(OUString const& rURIReference, SerfPropName name; DAVProperties::createSerfPropName(rPropValue.name, name); pAttrList->Clear(); - pAttrList->AddAttribute("xmlns", "CDATA", OUString::createFromAscii(name.nspace)); + pAttrList->AddAttribute("xmlns", OUString::createFromAscii(name.nspace)); xWriter->startElement(OUString::createFromAscii(name.name), pAttrList); if (rPropValue.operation == PROPSET) { @@ -2205,7 +2205,7 @@ auto CurlSession::LOCK(OUString const& rURIReference, ucb::Lock /*const*/& rLock xWriter->setOutputStream(xRequestOutStream); xWriter->startDocument(); rtl::Reference<::comphelper::AttributeList> const pAttrList(new ::comphelper::AttributeList); - pAttrList->AddAttribute("xmlns", "CDATA", "DAV:"); + pAttrList->AddAttribute("xmlns", "DAV:"); xWriter->startElement("lockinfo", pAttrList); xWriter->startElement("lockscope", nullptr); switch (rLock.Scope) diff --git a/unoxml/source/dom/element.cxx b/unoxml/source/dom/element.cxx index 481b071e62e5..757ac1c17de4 100644 --- a/unoxml/source/dom/element.cxx +++ b/unoxml/source/dom/element.cxx @@ -58,7 +58,6 @@ namespace DOM if (!i_xHandler.is()) throw RuntimeException(); rtl::Reference<comphelper::AttributeList> pAttrs = new comphelper::AttributeList(); - OUString type = ""; // add namespace definitions to attributes for (xmlNsPtr pNs = m_aNodePtr->nsDef; pNs != nullptr; pNs = pNs->next) { const xmlChar *pPrefix = pNs->prefix ? pNs->prefix : reinterpret_cast<const xmlChar*>(""); @@ -71,7 +70,7 @@ namespace DOM OUString val(reinterpret_cast<const char*>(pHref), strlen(reinterpret_cast<const char*>(pHref)), RTL_TEXTENCODING_UTF8); - pAttrs->AddAttribute(name, type, val); + pAttrs->AddAttribute(name, val); } // add attributes for (xmlAttrPtr pAttr = m_aNodePtr->properties; @@ -84,7 +83,7 @@ namespace DOM ? pNode->getLocalName() : prefix + ":" + pNode->getLocalName(); OUString val = pNode->getNodeValue(); - pAttrs->AddAttribute(name, type, val); + pAttrs->AddAttribute(name, val); } OUString prefix = getPrefix(); OUString name = (prefix.isEmpty()) diff --git a/writerperfect/source/common/DocumentHandler.cxx b/writerperfect/source/common/DocumentHandler.cxx index 6b5ffe58ad9e..bfa9bb53a5d2 100644 --- a/writerperfect/source/common/DocumentHandler.cxx +++ b/writerperfect/source/common/DocumentHandler.cxx @@ -14,8 +14,7 @@ #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/xml/sax/XDocumentHandler.hpp> #include <com/sun/star/xml/sax/XAttributeList.hpp> - -#include <xmloff/attrlist.hxx> +#include <comphelper/attributelist.hxx> #include <xmloff/xmlimp.hxx> namespace writerperfect @@ -126,7 +125,7 @@ void DocumentHandler::endDocument() { mxHandler->endDocument(); } void DocumentHandler::startElement(const char* psName, const librevenge::RVNGPropertyList& xPropList) { - rtl::Reference<SvXMLAttributeList> pAttrList = new SvXMLAttributeList(); + rtl::Reference<comphelper::AttributeList> pAttrList = new comphelper::AttributeList(); librevenge::RVNGPropertyList::Iter i(xPropList); for (i.rewind(); i.next();) { diff --git a/writerperfect/source/writer/EPUBPackage.cxx b/writerperfect/source/writer/EPUBPackage.cxx index 727a8ed7e3de..c08b60ad70ed 100644 --- a/writerperfect/source/writer/EPUBPackage.cxx +++ b/writerperfect/source/writer/EPUBPackage.cxx @@ -18,9 +18,9 @@ #include <com/sun/star/embed/XHierarchicalStorageAccess.hpp> #include <sal/log.hxx> +#include <comphelper/attributelist.hxx> #include <comphelper/storagehelper.hxx> #include <unotools/mediadescriptor.hxx> -#include <xmloff/attrlist.hxx> using namespace com::sun::star; @@ -80,7 +80,7 @@ void EPUBPackage::openElement(const char* pName, const librevenge::RVNGPropertyL { assert(mxOutputWriter.is()); - rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); + rtl::Reference<comphelper::AttributeList> pAttributeList(new comphelper::AttributeList()); librevenge::RVNGPropertyList::Iter it(rAttributes); for (it.rewind(); it.next();) diff --git a/xmloff/Library_xo.mk b/xmloff/Library_xo.mk index 19c9db439e62..6a52570c6b9c 100644 --- a/xmloff/Library_xo.mk +++ b/xmloff/Library_xo.mk @@ -120,7 +120,6 @@ $(eval $(call gb_Library_add_exception_objects,xo,\ xmloff/source/core/XMLBasicExportFilter \ xmloff/source/core/XMLEmbeddedObjectExportFilter \ xmloff/source/core/XMLEmbeddedObjectImportContext \ - xmloff/source/core/attrlist \ xmloff/source/core/i18nmap \ xmloff/source/core/namespacemap \ xmloff/source/core/unoatrcn \ diff --git a/xmloff/inc/SchXMLAutoStylePoolP.hxx b/xmloff/inc/SchXMLAutoStylePoolP.hxx index 50f511eae1f8..c349a0905604 100644 --- a/xmloff/inc/SchXMLAutoStylePoolP.hxx +++ b/xmloff/inc/SchXMLAutoStylePoolP.hxx @@ -27,7 +27,7 @@ class SchXMLAutoStylePoolP final : public SvXMLAutoStylePoolP SchXMLExport& mrSchXMLExport; virtual void exportStyleAttributes( - SvXMLAttributeList& rAttrList, + comphelper::AttributeList& rAttrList, XmlStyleFamily nFamily, const ::std::vector< XMLPropertyState >& rProperties, const SvXMLExportPropertyMapper& rPropExp diff --git a/xmloff/inc/XMLChartPropertySetMapper.hxx b/xmloff/inc/XMLChartPropertySetMapper.hxx index 8b3d72d3e19d..835dd3cc9a6c 100644 --- a/xmloff/inc/XMLChartPropertySetMapper.hxx +++ b/xmloff/inc/XMLChartPropertySetMapper.hxx @@ -64,7 +64,7 @@ private: /// this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set virtual void handleSpecialItem( - SvXMLAttributeList& rAttrList, const XMLPropertyState& rProperty, + comphelper::AttributeList& rAttrList, const XMLPropertyState& rProperty, const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap, const ::std::vector< XMLPropertyState > *pProperties, sal_uInt32 nIdx ) const override; diff --git a/xmloff/inc/pch/precompiled_xo.hxx b/xmloff/inc/pch/precompiled_xo.hxx index a88a03364c9b..712f227fb41c 100644 --- a/xmloff/inc/pch/precompiled_xo.hxx +++ b/xmloff/inc/pch/precompiled_xo.hxx @@ -219,7 +219,6 @@ #include <xmloff/ProgressBarHelper.hxx> #include <xmloff/XMLBase64ImportContext.hxx> #include <xmloff/XMLEventsImportContext.hxx> -#include <xmloff/attrlist.hxx> #include <xmloff/dllapi.h> #include <xmloff/families.hxx> #include <xmloff/maptype.hxx> diff --git a/xmloff/inc/pch/precompiled_xof.hxx b/xmloff/inc/pch/precompiled_xof.hxx index 684dfc584b0e..293b041f066c 100644 --- a/xmloff/inc/pch/precompiled_xof.hxx +++ b/xmloff/inc/pch/precompiled_xof.hxx @@ -56,7 +56,6 @@ #include <comphelper/diagnose_ex.hxx> #endif // PCH_LEVEL >= 3 #if PCH_LEVEL >= 4 -#include <xmloff/attrlist.hxx> #include <xmloff/namespacemap.hxx> #include <xmloff/xmlimp.hxx> #include <xmloff/xmlnamespace.hxx> diff --git a/xmloff/source/chart/PropertyMaps.cxx b/xmloff/source/chart/PropertyMaps.cxx index 1b6d54ad1090..ea40bd4c7e6b 100644 --- a/xmloff/source/chart/PropertyMaps.cxx +++ b/xmloff/source/chart/PropertyMaps.cxx @@ -31,7 +31,7 @@ #include <propimp0.hxx> #include <xmloff/EnumPropertyHdl.hxx> -#include <xmloff/attrlist.hxx> +#include <comphelper/attributelist.hxx> #include <xmloff/namespacemap.hxx> #include <xmloff/xmluconv.hxx> #include <xmloff/shapeimport.hxx> @@ -683,7 +683,7 @@ OUString convertRange( const OUString & rRange, const uno::Reference< chart2::XC } void XMLChartExportPropertyMapper::handleSpecialItem( - SvXMLAttributeList& rAttrList, const XMLPropertyState& rProperty, + comphelper::AttributeList& rAttrList, const XMLPropertyState& rProperty, const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap, const ::std::vector< XMLPropertyState > *pProperties, diff --git a/xmloff/source/chart/SchXMLAutoStylePoolP.cxx b/xmloff/source/chart/SchXMLAutoStylePoolP.cxx index d60b3de72f9e..c893408ec3c0 100644 --- a/xmloff/source/chart/SchXMLAutoStylePoolP.cxx +++ b/xmloff/source/chart/SchXMLAutoStylePoolP.cxx @@ -33,7 +33,7 @@ SchXMLAutoStylePoolP::~SchXMLAutoStylePoolP() {} void SchXMLAutoStylePoolP::exportStyleAttributes( - SvXMLAttributeList& rAttrList, + comphelper::AttributeList& rAttrList, XmlStyleFamily nFamily, const ::std::vector< XMLPropertyState >& rProperties, const SvXMLExportPropertyMapper& rPropExp diff --git a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx index 29c9f67c1274..7f68a11fed20 100644 --- a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx +++ b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx @@ -32,7 +32,6 @@ #include <xmloff/xmlimp.hxx> #include <xmloff/xmlnamespace.hxx> #include <xmloff/xmltoken.hxx> -#include <xmloff/attrlist.hxx> #include <xmloff/XMLFilterServiceNames.h> #include <XMLEmbeddedObjectImportContext.hxx> diff --git a/xmloff/source/core/attrlist.cxx b/xmloff/source/core/attrlist.cxx deleted file mode 100644 index 5d02d074bc9e..000000000000 --- a/xmloff/source/core/attrlist.cxx +++ /dev/null @@ -1,187 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - - -#include <vector> - -#include <o3tl/safeint.hxx> -#include <osl/diagnose.h> -#include <xmloff/xmltoken.hxx> -#include <cppuhelper/implbase.hxx> - -#include <xmloff/attrlist.hxx> - - -using namespace ::com::sun::star; -using namespace ::xmloff::token; - -sal_Int16 SAL_CALL SvXMLAttributeList::getLength() -{ - return sal::static_int_cast< sal_Int16 >(vecAttribute.size()); -} - - -SvXMLAttributeList::SvXMLAttributeList( const SvXMLAttributeList &r ) : - cppu::WeakImplHelper<css::xml::sax::XAttributeList, css::util::XCloneable>(r), - vecAttribute( r.vecAttribute ) -{ -} - -SvXMLAttributeList::SvXMLAttributeList( const uno::Reference< xml::sax::XAttributeList> & rAttrList ) -{ - SvXMLAttributeList* pImpl = dynamic_cast<SvXMLAttributeList*>( rAttrList.get() ); - - if( pImpl ) - vecAttribute = pImpl->vecAttribute; - else - AppendAttributeList( rAttrList ); -} - -OUString SAL_CALL SvXMLAttributeList::getNameByIndex(sal_Int16 i) -{ - assert( o3tl::make_unsigned(i) < vecAttribute.size() ); - return ( o3tl::make_unsigned( i ) < vecAttribute.size() ) ? vecAttribute[i].sName : OUString(); -} - - -OUString SAL_CALL SvXMLAttributeList::getTypeByIndex(sal_Int16) -{ - return "CDATA"; -} - -OUString SAL_CALL SvXMLAttributeList::getValueByIndex(sal_Int16 i) -{ - assert( o3tl::make_unsigned(i) < vecAttribute.size() ); - return ( o3tl::make_unsigned( i ) < vecAttribute.size() ) ? vecAttribute[i].sValue : OUString(); -} - -OUString SAL_CALL SvXMLAttributeList::getTypeByName( const OUString& ) -{ - return "CDATA"; -} - -OUString SAL_CALL SvXMLAttributeList::getValueByName(const OUString& sName) -{ - auto ii = std::find_if(vecAttribute.begin(), vecAttribute.end(), - [&sName](SvXMLTagAttribute_Impl& rAttr) { return rAttr.sName == sName; }); - - if (ii != vecAttribute.end()) - return (*ii).sValue; - - return OUString(); -} - - -uno::Reference< css::util::XCloneable > SvXMLAttributeList::createClone() -{ - uno::Reference< css::util::XCloneable > r = new SvXMLAttributeList( *this ); - return r; -} - - -SvXMLAttributeList::SvXMLAttributeList() -{ - vecAttribute.reserve(20); // performance improvement during adding -} - - -SvXMLAttributeList::~SvXMLAttributeList() -{ -} - - -void SvXMLAttributeList::AddAttribute( const OUString &sName , - const OUString &sValue ) -{ - assert( !sName.isEmpty() && "empty attribute name is invalid"); - assert( std::count(sName.getStr(), sName.getStr() + sName.getLength(), u':') <= 1 && "too many colons"); - vecAttribute.emplace_back( SvXMLTagAttribute_Impl { sName , sValue } ); -} - -void SvXMLAttributeList::Clear() -{ - vecAttribute.clear(); -} - -void SvXMLAttributeList::RemoveAttribute( const OUString& sName ) -{ - auto ii = std::find_if(vecAttribute.begin(), vecAttribute.end(), - [&sName](SvXMLTagAttribute_Impl& rAttr) { return rAttr.sName == sName; }); - - if (ii != vecAttribute.end()) - vecAttribute.erase( ii ); -} - -void SvXMLAttributeList::AppendAttributeList( const uno::Reference< css::xml::sax::XAttributeList > &r ) -{ - OSL_ASSERT( r.is() ); - - sal_Int16 nMax = r->getLength(); - sal_Int16 nTotalSize = vecAttribute.size() + nMax; - vecAttribute.reserve( nTotalSize ); - - for( sal_Int16 i = 0 ; i < nMax ; ++i ) { - OUString sName = r->getNameByIndex( i ); - assert( !sName.isEmpty() && "empty attribute name is invalid"); - assert( std::count(sName.getStr(), sName.getStr() + sName.getLength(), u':') <= 1 && "too many colons"); - vecAttribute.emplace_back(SvXMLTagAttribute_Impl { sName, r->getValueByIndex( i ) }); - } - - OSL_ASSERT( nTotalSize == getLength() ); -} - -void SvXMLAttributeList::SetValueByIndex( sal_Int16 i, - const OUString& rValue ) -{ - assert( o3tl::make_unsigned(i) < vecAttribute.size() ); - if( o3tl::make_unsigned( i ) < vecAttribute.size() ) - { - vecAttribute[i].sValue = rValue; - } -} - -void SvXMLAttributeList::RemoveAttributeByIndex( sal_Int16 i ) -{ - assert( o3tl::make_unsigned(i) < vecAttribute.size() ); - if( o3tl::make_unsigned( i ) < vecAttribute.size() ) - vecAttribute.erase( vecAttribute.begin() + i ); -} - -void SvXMLAttributeList::RenameAttributeByIndex( sal_Int16 i, - const OUString& rNewName ) -{ - assert( o3tl::make_unsigned(i) < vecAttribute.size() ); - if( o3tl::make_unsigned( i ) < vecAttribute.size() ) - { - vecAttribute[i].sName = rNewName; - } -} - -sal_Int16 SvXMLAttributeList::GetIndexByName( const OUString& rName ) const -{ - auto ii = std::find_if(vecAttribute.begin(), vecAttribute.end(), - [&rName](const SvXMLTagAttribute_Impl& rAttr) { return rAttr.sName == rName; }); - - if (ii != vecAttribute.end()) - return static_cast<sal_Int16>(std::distance(vecAttribute.begin(), ii)); - - return -1; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index a6ae52092ec2..f98ad0540896 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -46,7 +46,6 @@ #include <comphelper/processfactory.hxx> #include <comphelper/propertysetinfo.hxx> #include <comphelper/propertyvalue.hxx> -#include <xmloff/attrlist.hxx> #include <xmloff/namespacemap.hxx> #include <xmloff/xmluconv.hxx> #include <xmloff/xmlnamespace.hxx> @@ -441,7 +440,7 @@ SvXMLExport::SvXMLExport( const enum XMLTokenEnum eClass, SvXMLExportFlags nExportFlags ) : mpImpl( new SvXMLExport_Impl ), m_xContext(xContext), m_implementationName(std::move(implementationName)), - mxAttrList( new SvXMLAttributeList ), + mxAttrList( new comphelper::AttributeList ), mpNamespaceMap( new SvXMLNamespaceMap ), mpAuthorIDs( new SvtSecurityMapPersonalInfo ), maUnitConv(xContext, util::MeasureUnit::MM_100TH, eDefaultMeasureUnit, getSaneDefaultVersion()), @@ -466,7 +465,7 @@ SvXMLExport::SvXMLExport( m_xContext(xContext), m_implementationName(std::move(implementationName)), mxHandler( rHandler ), mxExtHandler( rHandler, uno::UNO_QUERY ), - mxAttrList( new SvXMLAttributeList ), + mxAttrList( new comphelper::AttributeList ), msOrigFileName(std::move( fileName )), mpNamespaceMap( new SvXMLNamespaceMap ), mpAuthorIDs( new SvtSecurityMapPersonalInfo ), @@ -500,7 +499,7 @@ SvXMLExport::SvXMLExport( mxHandler( rHandler ), mxExtHandler( rHandler, uno::UNO_QUERY ), mxNumberFormatsSupplier (rModel, uno::UNO_QUERY), - mxAttrList( new SvXMLAttributeList ), + mxAttrList( new comphelper::AttributeList ), msOrigFileName(std::move( fileName )), mpNamespaceMap( new SvXMLNamespaceMap ), mpAuthorIDs( new SvtSecurityMapPersonalInfo ), diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 6d166def862b..3b6d79934a99 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -2124,7 +2124,7 @@ void SvXMLImportFastNamespaceHandler::addNSDeclAttributes( rtl::Reference < comp sDecl = "xmlns"; else sDecl = "xmlns:" + rPrefix; - rAttrList->AddAttribute( sDecl, "CDATA", rNamespaceURI ); + rAttrList->AddAttribute( sDecl, rNamespaceURI ); } m_aNamespaceDefines.clear(); } diff --git a/xmloff/source/draw/sdpropls.cxx b/xmloff/source/draw/sdpropls.cxx index 278e0c2bc179..de7030f8efff 100644 --- a/xmloff/source/draw/sdpropls.cxx +++ b/xmloff/source/draw/sdpropls.cxx @@ -1688,7 +1688,7 @@ void XMLShapeExportPropertyMapper::ContextFilter( } void XMLShapeExportPropertyMapper::handleSpecialItem( - SvXMLAttributeList& rAttrList, + comphelper::AttributeList& rAttrList, const XMLPropertyState& rProperty, const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap, diff --git a/xmloff/source/draw/sdpropls.hxx b/xmloff/source/draw/sdpropls.hxx index 2a2557a2b742..607fa3ace7a3 100644 --- a/xmloff/source/draw/sdpropls.hxx +++ b/xmloff/source/draw/sdpropls.hxx @@ -97,7 +97,7 @@ public: void SetAutoStyles( bool bIsInAutoStyles ) { mbIsInAutoStyles = bIsInAutoStyles; } virtual void handleSpecialItem( - SvXMLAttributeList& rAttrList, + comphelper::AttributeList& rAttrList, const XMLPropertyState& rProperty, const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap, diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 51ee4c894250..39d9eabb5971 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -559,7 +559,7 @@ namespace void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape, XMLShapeExportFlags nFeatures /* = SEF_DEFAULT */, css::awt::Point* pRefPoint /* = NULL */, - SvXMLAttributeList* pAttrList /* = NULL */ ) + comphelper::AttributeList* pAttrList /* = NULL */ ) { SAL_INFO("xmloff", xShape->getShapeType()); if( maCurrentShapesIter == maShapesInfos.end() ) @@ -583,7 +583,7 @@ void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape // Need to stash the attributes that are pre-loaded for the shape export // (otherwise they will become attributes of the draw:a element) uno::Reference<xml::sax::XAttributeList> xSaveAttribs( - new SvXMLAttributeList(GetExport().GetAttrList())); + new comphelper::AttributeList(GetExport().GetAttrList())); GetExport().ClearAttrList(); if( xSet.is() && (GetExport().GetModelType() == SvtModuleOptions::EFactory::DRAW) ) { @@ -2576,7 +2576,7 @@ void XMLShapeExport::ImpExportGraphicObjectShape( void XMLShapeExport::ImpExportChartShape( const uno::Reference< drawing::XShape >& xShape, XmlShapeType eShapeType, XMLShapeExportFlags nFeatures, awt::Point* pRefPoint, - SvXMLAttributeList* pAttrList ) + comphelper::AttributeList* pAttrList ) { ImpExportOLE2Shape( xShape, eShapeType, nFeatures, pRefPoint, pAttrList ); } @@ -2920,7 +2920,7 @@ void XMLShapeExport::ImpExportMeasureShape( void XMLShapeExport::ImpExportOLE2Shape( const uno::Reference< drawing::XShape >& xShape, XmlShapeType eShapeType, XMLShapeExportFlags nFeatures /* = SEF_DEFAULT */, awt::Point* pRefPoint /* = NULL */, - SvXMLAttributeList* pAttrList /* = NULL */ ) + comphelper::AttributeList* pAttrList /* = NULL */ ) { uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY); uno::Reference< container::XNamed > xNamed(xShape, uno::UNO_QUERY); diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx index d28b2b03843a..a89b1ca840f3 100644 --- a/xmloff/source/draw/shapeimport.cxx +++ b/xmloff/source/draw/shapeimport.cxx @@ -35,7 +35,6 @@ #include <xmloff/xmlnamespace.hxx> #include <xmloff/xmltoken.hxx> #include <xmloff/table/XMLTableImport.hxx> -#include <xmloff/attrlist.hxx> #include "eventimp.hxx" #include "ximpshap.hxx" #include "sdpropls.hxx" diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 8d6be9de1273..266135bad479 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -78,7 +78,6 @@ #include <xmloff/xmlerror.hxx> #include <xmloff/table/XMLTableImport.hxx> #include <xmloff/ProgressBarHelper.hxx> -#include <xmloff/attrlist.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <com/sun/star/drawing/XEnhancedCustomShapeDefaulter.hpp> #include <com/sun/star/container/XChild.hpp> diff --git a/xmloff/source/forms/controlpropertymap.cxx b/xmloff/source/forms/controlpropertymap.cxx index 2cbf621043bc..7e2bbdd5c5d5 100644 --- a/xmloff/source/forms/controlpropertymap.cxx +++ b/xmloff/source/forms/controlpropertymap.cxx @@ -106,7 +106,7 @@ namespace xmloff { } - void OFormComponentStyleExportMapper::handleSpecialItem( SvXMLAttributeList& _rAttrList, const XMLPropertyState& _rProperty, const SvXMLUnitConverter& _rUnitConverter, + void OFormComponentStyleExportMapper::handleSpecialItem( comphelper::AttributeList& _rAttrList, const XMLPropertyState& _rProperty, const SvXMLUnitConverter& _rUnitConverter, const SvXMLNamespaceMap& _rNamespaceMap, const ::std::vector< XMLPropertyState >* _pProperties, sal_uInt32 _nIdx ) const { diff --git a/xmloff/source/forms/controlpropertymap.hxx b/xmloff/source/forms/controlpropertymap.hxx index ff575c13797a..02bc81a078bf 100644 --- a/xmloff/source/forms/controlpropertymap.hxx +++ b/xmloff/source/forms/controlpropertymap.hxx @@ -37,7 +37,7 @@ namespace xmloff explicit OFormComponentStyleExportMapper( const rtl::Reference< XMLPropertySetMapper >& _rMapper ); void handleSpecialItem( - SvXMLAttributeList& _rAttrList, + comphelper::AttributeList& _rAttrList, const XMLPropertyState& _rProperty, const SvXMLUnitConverter& _rUnitConverter, const SvXMLNamespaceMap& _rNamespaceMap, diff --git a/xmloff/source/style/PageMasterExportPropMapper.cxx b/xmloff/source/style/PageMasterExportPropMapper.cxx index 725ad6f9e510..1da95f35cdb7 100644 --- a/xmloff/source/style/PageMasterExportPropMapper.cxx +++ b/xmloff/source/style/PageMasterExportPropMapper.cxx @@ -345,7 +345,7 @@ void XMLPageMasterExportPropMapper::handleElementItem( } void XMLPageMasterExportPropMapper::handleSpecialItem( - SvXMLAttributeList&, + comphelper::AttributeList&, const XMLPropertyState&, const SvXMLUnitConverter&, const SvXMLNamespaceMap&, diff --git a/xmloff/source/style/PageMasterExportPropMapper.hxx b/xmloff/source/style/PageMasterExportPropMapper.hxx index 8aa2debc8654..71550443faca 100644 --- a/xmloff/source/style/PageMasterExportPropMapper.hxx +++ b/xmloff/source/style/PageMasterExportPropMapper.hxx @@ -52,7 +52,7 @@ public: sal_uInt32 nIdx ) const override; virtual void handleSpecialItem( - SvXMLAttributeList& rAttrList, + comphelper::AttributeList& rAttrList, const XMLPropertyState& rProperty, const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap, diff --git a/xmloff/source/style/xmlaustp.cxx b/xmloff/source/style/xmlaustp.cxx index 0aca31aabdf3..20d639c3b121 100644 --- a/xmloff/source/style/xmlaustp.cxx +++ b/xmloff/source/style/xmlaustp.cxx @@ -58,7 +58,7 @@ namespace } void SvXMLAutoStylePoolP::exportStyleAttributes( - SvXMLAttributeList&, + comphelper::AttributeList&, XmlStyleFamily nFamily, const vector< XMLPropertyState >& rProperties, const SvXMLExportPropertyMapper& rPropExp, diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx index e81758bdce7c..b1a60aabb384 100644 --- a/xmloff/source/style/xmlexppr.cxx +++ b/xmloff/source/style/xmlexppr.cxx @@ -38,7 +38,6 @@ #include <utility> #include <xmloff/xmlexppr.hxx> #include <xmloff/xmltoken.hxx> -#include <xmloff/attrlist.hxx> #include <xmloff/namespacemap.hxx> #include <xmloff/xmlnamespace.hxx> #include <xmloff/xmlexp.hxx> @@ -856,7 +855,7 @@ void SvXMLExportPropertyMapper::exportXML( /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set */ void SvXMLExportPropertyMapper::handleSpecialItem( - SvXMLAttributeList& rAttrList, + comphelper::AttributeList& rAttrList, const XMLPropertyState& rProperty, const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap, @@ -888,7 +887,7 @@ void SvXMLExportPropertyMapper::handleElementItem( /** fills the given attribute list with the items in the given set */ void SvXMLExportPropertyMapper::_exportXML( sal_uInt16 nPropType, sal_uInt16& rPropTypeFlags, - SvXMLAttributeList& rAttrList, + comphelper::AttributeList& rAttrList, const ::std::vector< XMLPropertyState >& rProperties, const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap, @@ -958,7 +957,7 @@ sal_Int8 CheckExtendedNamespace(std::u16string_view sXMLAttributeName, std::u16s } void SvXMLExportPropertyMapper::_exportXML( - SvXMLAttributeList& rAttrList, + comphelper::AttributeList& rAttrList, const XMLPropertyState& rProperty, const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap, diff --git a/xmloff/source/table/XMLTableExport.cxx b/xmloff/source/table/XMLTableExport.cxx index 0b8fd95aadda..3bc2adba5cee 100644 --- a/xmloff/source/table/XMLTableExport.cxx +++ b/xmloff/source/table/XMLTableExport.cxx @@ -163,7 +163,7 @@ public: using SvXMLExportPropertyMapper::SvXMLExportPropertyMapper; /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set */ - virtual void handleSpecialItem(SvXMLAttributeList&, const XMLPropertyState&, const SvXMLUnitConverter&, + virtual void handleSpecialItem(comphelper::AttributeList&, const XMLPropertyState&, const SvXMLUnitConverter&, const SvXMLNamespaceMap&, const std::vector<XMLPropertyState>*, sal_uInt32) const override { // the SpecialItem NumberFormat must not be handled by this method diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx index ad7ca31254bc..ad0754acfca2 100644 --- a/xmloff/source/text/XMLTextFrameContext.cxx +++ b/xmloff/source/text/XMLTextFrameContext.cxx @@ -55,7 +55,6 @@ #include <xmloff/XMLEventsImportContext.hxx> #include <XMLImageMapContext.hxx> #include "XMLTextFrameContext.hxx" -#include <xmloff/attrlist.hxx> #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx> diff --git a/xmloff/source/text/txtexppr.cxx b/xmloff/source/text/txtexppr.cxx index 8d73fe303304..a5e0d94b74cd 100644 --- a/xmloff/source/text/txtexppr.cxx +++ b/xmloff/source/text/txtexppr.cxx @@ -143,7 +143,7 @@ void XMLTextExportPropertySetMapper::handleElementItem( } void XMLTextExportPropertySetMapper::handleSpecialItem( - SvXMLAttributeList& rAttrList, + comphelper::AttributeList& rAttrList, const XMLPropertyState& rProperty, const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap, diff --git a/xmloff/source/text/txtexppr.hxx b/xmloff/source/text/txtexppr.hxx index bb7e3c230a2c..878ca9a9389d 100644 --- a/xmloff/source/text/txtexppr.hxx +++ b/xmloff/source/text/txtexppr.hxx @@ -78,7 +78,7 @@ public: sal_uInt32 nIdx ) const override; virtual void handleSpecialItem( - SvXMLAttributeList& rAttrList, + comphelper::AttributeList& rAttrList, const XMLPropertyState& rProperty, const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap, diff --git a/xmloff/source/transform/MutableAttrList.cxx b/xmloff/source/transform/MutableAttrList.cxx index 65da52e91f9d..6798721b4cdc 100644 --- a/xmloff/source/transform/MutableAttrList.cxx +++ b/xmloff/source/transform/MutableAttrList.cxx @@ -17,7 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <xmloff/attrlist.hxx> +#include <sal/config.h> + +#include <comphelper/attributelist.hxx> #include <comphelper/servicehelper.hxx> #include "MutableAttrList.hxx" @@ -26,11 +28,11 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::util; -SvXMLAttributeList *XMLMutableAttributeList::GetMutableAttrList() +comphelper::AttributeList* XMLMutableAttributeList::GetMutableAttrList() { if( !m_pMutableAttrList ) { - m_pMutableAttrList = new SvXMLAttributeList( m_xAttrList ); + m_pMutableAttrList = new comphelper::AttributeList( m_xAttrList ); m_xAttrList = m_pMutableAttrList; } @@ -38,14 +40,14 @@ SvXMLAttributeList *XMLMutableAttributeList::GetMutableAttrList() } XMLMutableAttributeList::XMLMutableAttributeList() : - m_pMutableAttrList( new SvXMLAttributeList ) + m_pMutableAttrList( new comphelper::AttributeList ) { m_xAttrList = m_pMutableAttrList; } XMLMutableAttributeList::XMLMutableAttributeList( const Reference< XAttributeList> & rAttrList, bool bClone ) : - m_xAttrList( rAttrList.is() ? rAttrList : new SvXMLAttributeList ) + m_xAttrList( rAttrList.is() ? rAttrList : new comphelper::AttributeList ) { if( bClone ) GetMutableAttrList(); @@ -95,7 +97,7 @@ OUString SAL_CALL XMLMutableAttributeList::getValueByName( Reference< XCloneable > XMLMutableAttributeList::createClone() { // A cloned list will be a read only list! - Reference< XCloneable > r = new SvXMLAttributeList( m_xAttrList ); + Reference< XCloneable > r = new comphelper::AttributeList( m_xAttrList ); return r; } diff --git a/xmloff/source/transform/MutableAttrList.hxx b/xmloff/source/transform/MutableAttrList.hxx index d3405a3fe96a..79bf36bf9603 100644 --- a/xmloff/source/transform/MutableAttrList.hxx +++ b/xmloff/source/transform/MutableAttrList.hxx @@ -25,7 +25,7 @@ #include <cppuhelper/implbase.hxx> #include <rtl/ref.hxx> -class SvXMLAttributeList; +namespace comphelper { class AttributeList; } class XMLMutableAttributeList : public ::cppu::WeakImplHelper< css::xml::sax::XAttributeList, @@ -33,9 +33,9 @@ class XMLMutableAttributeList : public ::cppu::WeakImplHelper< { css::uno::Reference< css::xml::sax::XAttributeList> m_xAttrList; - rtl::Reference<SvXMLAttributeList> m_pMutableAttrList; + rtl::Reference<comphelper::AttributeList> m_pMutableAttrList; - SvXMLAttributeList *GetMutableAttrList(); + comphelper::AttributeList *GetMutableAttrList(); public: XMLMutableAttributeList(); diff --git a/xmloff/source/xforms/xformsexport.cxx b/xmloff/source/xforms/xformsexport.cxx index 75f6bc51027e..e88ac4b6e21a 100644 --- a/xmloff/source/xforms/xformsexport.cxx +++ b/xmloff/source/xforms/xformsexport.cxx @@ -347,7 +347,7 @@ void exportXFormsBinding( SvXMLExport& rExport, rMap.GetNameByKey( nKey ) != sURI ) { // add declaration if it doesn't already exist - SvXMLAttributeList& rAttrList = rExport.GetAttrList(); + comphelper::AttributeList& rAttrList = rExport.GetAttrList(); OUString sName = "xmlns:" + rPrefix; sal_Int16 nFound = rAttrList.GetIndexByName(sName); // duplicate xmlns:script, http://openoffice.org/2000/script seen diff --git a/xmlsecurity/source/helper/documentsignaturehelper.cxx b/xmlsecurity/source/helper/documentsignaturehelper.cxx index 8d5c0670c218..8e666b14ba6e 100644 --- a/xmlsecurity/source/helper/documentsignaturehelper.cxx +++ b/xmlsecurity/source/helper/documentsignaturehelper.cxx @@ -32,6 +32,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/xml/sax/XDocumentHandler.hpp> +#include <comphelper/attributelist.hxx> #include <comphelper/documentconstants.hxx> #include <comphelper/ofopxmlhelper.hxx> #include <comphelper/processfactory.hxx> @@ -41,7 +42,6 @@ #include <sal/log.hxx> #include <svx/xoutbmp.hxx> #include <comphelper/diagnose_ex.hxx> -#include <xmloff/attrlist.hxx> #include <o3tl/string_view.hxx> #include <xsecctl.hxx> @@ -521,7 +521,7 @@ OUString DocumentSignatureHelper::GetPackageSignatureDefaultStreamName() void DocumentSignatureHelper::writeDigestMethod( const uno::Reference<xml::sax::XDocumentHandler>& xDocumentHandler) { - rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); + rtl::Reference<comphelper::AttributeList> pAttributeList(new comphelper::AttributeList()); pAttributeList->AddAttribute("Algorithm", ALGO_XMLDSIGSHA256); xDocumentHandler->startElement("DigestMethod", uno::Reference<xml::sax::XAttributeList>(pAttributeList)); xDocumentHandler->endElement("DigestMethod"); @@ -531,19 +531,19 @@ static void WriteXadesCert( uno::Reference<xml::sax::XDocumentHandler> const& xDocumentHandler, SignatureInformation::X509CertInfo const& rCertInfo) { - xDocumentHandler->startElement("xd:Cert", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); - xDocumentHandler->startElement("xd:CertDigest", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + xDocumentHandler->startElement("xd:Cert", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); + xDocumentHandler->startElement("xd:CertDigest", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); DocumentSignatureHelper::writeDigestMethod(xDocumentHandler); - xDocumentHandler->startElement("DigestValue", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + xDocumentHandler->startElement("DigestValue", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); assert(!rCertInfo.CertDigest.isEmpty()); xDocumentHandler->characters(rCertInfo.CertDigest); xDocumentHandler->endElement("DigestValue"); xDocumentHandler->endElement("xd:CertDigest"); - xDocumentHandler->startElement("xd:IssuerSerial", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); - xDocumentHandler->startElement("X509IssuerName", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + xDocumentHandler->startElement("xd:IssuerSerial", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); + xDocumentHandler->startElement("X509IssuerName", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); xDocumentHandler->characters(rCertInfo.X509IssuerName); xDocumentHandler->endElement("X509IssuerName"); - xDocumentHandler->startElement("X509SerialNumber", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + xDocumentHandler->startElement("X509SerialNumber", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); xDocumentHandler->characters(rCertInfo.X509SerialNumber); xDocumentHandler->endElement("X509SerialNumber"); xDocumentHandler->endElement("xd:IssuerSerial"); @@ -556,16 +556,16 @@ void DocumentSignatureHelper::writeSignedProperties( const OUString& sDate, const bool bWriteSignatureLineData) { { - rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); + rtl::Reference<comphelper::AttributeList> pAttributeList(new comphelper::AttributeList()); pAttributeList->AddAttribute("Id", "idSignedProperties_" + signatureInfo.ouSignatureId); xDocumentHandler->startElement("xd:SignedProperties", uno::Reference<xml::sax::XAttributeList>(pAttributeList)); } - xDocumentHandler->startElement("xd:SignedSignatureProperties", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); - xDocumentHandler->startElement("xd:SigningTime", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + xDocumentHandler->startElement("xd:SignedSignatureProperties", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); + xDocumentHandler->startElement("xd:SigningTime", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); xDocumentHandler->characters(sDate); xDocumentHandler->endElement("xd:SigningTime"); - xDocumentHandler->startElement("xd:SigningCertificate", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + xDocumentHandler->startElement("xd:SigningCertificate", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); assert(signatureInfo.GetSigningCertificate() || !signatureInfo.ouGpgKeyID.isEmpty()); if (signatureInfo.GetSigningCertificate()) { @@ -587,15 +587,15 @@ void DocumentSignatureHelper::writeSignedProperties( WriteXadesCert(xDocumentHandler, temp); } xDocumentHandler->endElement("xd:SigningCertificate"); - xDocumentHandler->startElement("xd:SignaturePolicyIdentifier", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); - xDocumentHandler->startElement("xd:SignaturePolicyImplied", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + xDocumentHandler->startElement("xd:SignaturePolicyIdentifier", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); + xDocumentHandler->startElement("xd:SignaturePolicyImplied", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); xDocumentHandler->endElement("xd:SignaturePolicyImplied"); xDocumentHandler->endElement("xd:SignaturePolicyIdentifier"); if (bWriteSignatureLineData && !signatureInfo.ouSignatureLineId.isEmpty() && signatureInfo.aValidSignatureImage.is() && signatureInfo.aInvalidSignatureImage.is()) { - rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); + rtl::Reference<comphelper::AttributeList> pAttributeList(new comphelper::AttributeList()); pAttributeList->AddAttribute( "xmlns:loext", "urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"); xDocumentHandler->startElement( @@ -606,7 +606,7 @@ void DocumentSignatureHelper::writeSignedProperties( // Write SignatureLineId element xDocumentHandler->startElement( "loext:SignatureLineId", - Reference<XAttributeList>(new SvXMLAttributeList())); + Reference<XAttributeList>(new comphelper::AttributeList())); xDocumentHandler->characters(signatureInfo.ouSignatureLineId); xDocumentHandler->endElement("loext:SignatureLineId"); } @@ -615,7 +615,7 @@ void DocumentSignatureHelper::writeSignedProperties( // Write SignatureLineValidImage element xDocumentHandler->startElement( "loext:SignatureLineValidImage", - Reference<XAttributeList>(new SvXMLAttributeList())); + Reference<XAttributeList>(new comphelper::AttributeList())); OUString aGraphicInBase64; Graphic aGraphic(signatureInfo.aValidSignatureImage); @@ -630,7 +630,7 @@ void DocumentSignatureHelper::writeSignedProperties( // Write SignatureLineInvalidImage element xDocumentHandler->startElement( "loext:SignatureLineInvalidImage", - Reference<XAttributeList>(new SvXMLAttributeList())); + Reference<XAttributeList>(new comphelper::AttributeList())); OUString aGraphicInBase64; Graphic aGraphic(signatureInfo.aInvalidSignatureImage); if (!XOutBitmap::GraphicToBase64(aGraphic, aGraphicInBase64, false)) diff --git a/xmlsecurity/source/helper/ooxmlsecexporter.cxx b/xmlsecurity/source/helper/ooxmlsecexporter.cxx index 2294af680010..804cfd274802 100644 --- a/xmlsecurity/source/helper/ooxmlsecexporter.cxx +++ b/xmlsecurity/source/helper/ooxmlsecexporter.cxx @@ -19,6 +19,7 @@ #include <com/sun/star/beans/StringPair.hpp> #include <com/sun/star/xml/sax/XDocumentHandler.hpp> +#include <comphelper/attributelist.hxx> #include <comphelper/ofopxmlhelper.hxx> #include <o3tl/string_view.hxx> #include <rtl/ref.hxx> @@ -26,7 +27,6 @@ #include <svx/xoutbmp.hxx> #include <unotools/datetime.hxx> #include <vcl/salctype.hxx> -#include <xmloff/attrlist.hxx> #include <documentsignaturehelper.hxx> #include <xsecctl.hxx> @@ -113,7 +113,7 @@ bool OOXMLSecExporter::Impl::isOOXMLRelationDenylist(const OUString& rRelationNa void OOXMLSecExporter::Impl::writeSignedInfo() { m_xDocumentHandler->startElement( - "SignedInfo", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + "SignedInfo", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); writeCanonicalizationMethod(); writeSignatureMethod(); @@ -124,7 +124,7 @@ void OOXMLSecExporter::Impl::writeSignedInfo() void OOXMLSecExporter::Impl::writeCanonicalizationMethod() { - rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); + rtl::Reference<comphelper::AttributeList> pAttributeList(new comphelper::AttributeList()); pAttributeList->AddAttribute("Algorithm", ALGO_C14N); m_xDocumentHandler->startElement("CanonicalizationMethod", uno::Reference<xml::sax::XAttributeList>(pAttributeList)); @@ -133,7 +133,7 @@ void OOXMLSecExporter::Impl::writeCanonicalizationMethod() void OOXMLSecExporter::Impl::writeCanonicalizationTransform() { - rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); + rtl::Reference<comphelper::AttributeList> pAttributeList(new comphelper::AttributeList()); pAttributeList->AddAttribute("Algorithm", ALGO_C14N); m_xDocumentHandler->startElement("Transform", uno::Reference<xml::sax::XAttributeList>(pAttributeList)); @@ -142,7 +142,7 @@ void OOXMLSecExporter::Impl::writeCanonicalizationTransform() void OOXMLSecExporter::Impl::writeSignatureMethod() { - rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); + rtl::Reference<comphelper::AttributeList> pAttributeList(new comphelper::AttributeList()); if (m_rInformation.eAlgorithmID == svl::crypto::SignatureMethodAlgorithm::ECDSA) pAttributeList->AddAttribute("Algorithm", ALGO_ECDSASHA256); @@ -162,7 +162,8 @@ void OOXMLSecExporter::Impl::writeSignedInfoReferences() if (rReference.nType == SignatureReferenceType::SAMEDOCUMENT) { { - rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); + rtl::Reference<comphelper::AttributeList> pAttributeList( + new comphelper::AttributeList()); if (!rReference.ouURI.startsWith("idSignedProperties")) pAttributeList->AddAttribute("Type", "http://www.w3.org/2000/09/xmldsig#Object"); @@ -177,14 +178,15 @@ void OOXMLSecExporter::Impl::writeSignedInfoReferences() { m_xDocumentHandler->startElement( "Transforms", - uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); writeCanonicalizationTransform(); m_xDocumentHandler->endElement("Transforms"); } DocumentSignatureHelper::writeDigestMethod(m_xDocumentHandler); m_xDocumentHandler->startElement( - "DigestValue", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + "DigestValue", + uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); m_xDocumentHandler->characters(rReference.ouDigestValue); m_xDocumentHandler->endElement("DigestValue"); m_xDocumentHandler->endElement("Reference"); @@ -194,8 +196,8 @@ void OOXMLSecExporter::Impl::writeSignedInfoReferences() void OOXMLSecExporter::Impl::writeSignatureValue() { - m_xDocumentHandler->startElement( - "SignatureValue", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + m_xDocumentHandler->startElement("SignatureValue", uno::Reference<xml::sax::XAttributeList>( + new comphelper::AttributeList())); m_xDocumentHandler->characters(m_rInformation.ouSignatureValue); m_xDocumentHandler->endElement("SignatureValue"); } @@ -203,17 +205,17 @@ void OOXMLSecExporter::Impl::writeSignatureValue() void OOXMLSecExporter::Impl::writeKeyInfo() { m_xDocumentHandler->startElement( - "KeyInfo", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + "KeyInfo", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); assert(m_rInformation.GetSigningCertificate()); for (auto const& rData : m_rInformation.X509Datas) { m_xDocumentHandler->startElement( - "X509Data", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + "X509Data", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); for (auto const& it : rData) { m_xDocumentHandler->startElement( "X509Certificate", - uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); m_xDocumentHandler->characters(it.X509Certificate); m_xDocumentHandler->endElement("X509Certificate"); } @@ -224,7 +226,7 @@ void OOXMLSecExporter::Impl::writeKeyInfo() void OOXMLSecExporter::Impl::writePackageObject() { - rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); + rtl::Reference<comphelper::AttributeList> pAttributeList(new comphelper::AttributeList()); pAttributeList->AddAttribute("Id", "idPackageObject_" + m_rInformation.ouSignatureId); m_xDocumentHandler->startElement("Object", uno::Reference<xml::sax::XAttributeList>(pAttributeList)); @@ -238,7 +240,7 @@ void OOXMLSecExporter::Impl::writePackageObject() void OOXMLSecExporter::Impl::writeManifest() { m_xDocumentHandler->startElement( - "Manifest", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + "Manifest", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); const SignatureReferenceInformations& rReferences = m_rInformation.vSignatureReferenceInfors; for (const SignatureReferenceInformation& rReference : rReferences) { @@ -262,7 +264,7 @@ void OOXMLSecExporter::Impl::writeRelationshipTransform(const OUString& rURI) embed::ElementModes::READ), uno::UNO_QUERY); { - rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); + rtl::Reference<comphelper::AttributeList> pAttributeList(new comphelper::AttributeList()); pAttributeList->AddAttribute("Algorithm", ALGO_RELATIONSHIP); m_xDocumentHandler->startElement("Transform", uno::Reference<xml::sax::XAttributeList>(pAttributeList)); @@ -286,7 +288,7 @@ void OOXMLSecExporter::Impl::writeRelationshipTransform(const OUString& rURI) if (OOXMLSecExporter::Impl::isOOXMLRelationDenylist(aType)) continue; - rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); + rtl::Reference<comphelper::AttributeList> pAttributeList(new comphelper::AttributeList()); pAttributeList->AddAttribute("xmlns:mdssi", NS_MDSSI); pAttributeList->AddAttribute("SourceId", aId); m_xDocumentHandler->startElement("mdssi:RelationshipReference", @@ -300,27 +302,28 @@ void OOXMLSecExporter::Impl::writeRelationshipTransform(const OUString& rURI) void OOXMLSecExporter::Impl::writePackageObjectSignatureProperties() { m_xDocumentHandler->startElement( - "SignatureProperties", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + "SignatureProperties", + uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); { - rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); + rtl::Reference<comphelper::AttributeList> pAttributeList(new comphelper::AttributeList()); pAttributeList->AddAttribute("Id", "idSignatureTime_" + m_rInformation.ouSignatureId); pAttributeList->AddAttribute("Target", "#" + m_rInformation.ouSignatureId); m_xDocumentHandler->startElement("SignatureProperty", uno::Reference<xml::sax::XAttributeList>(pAttributeList)); } { - rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); + rtl::Reference<comphelper::AttributeList> pAttributeList(new comphelper::AttributeList()); pAttributeList->AddAttribute("xmlns:mdssi", NS_MDSSI); m_xDocumentHandler->startElement("mdssi:SignatureTime", uno::Reference<xml::sax::XAttributeList>(pAttributeList)); } m_xDocumentHandler->startElement( - "mdssi:Format", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + "mdssi:Format", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); m_xDocumentHandler->characters("YYYY-MM-DDThh:mm:ssTZD"); m_xDocumentHandler->endElement("mdssi:Format"); m_xDocumentHandler->startElement( - "mdssi:Value", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + "mdssi:Value", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); if (!m_rInformation.ouDateTime.isEmpty()) m_aSignatureTimeValue = m_rInformation.ouDateTime; else @@ -344,7 +347,7 @@ void OOXMLSecExporter::Impl::writePackageObjectSignatureProperties() void OOXMLSecExporter::Impl::writeManifestReference(const SignatureReferenceInformation& rReference) { - rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); + rtl::Reference<comphelper::AttributeList> pAttributeList(new comphelper::AttributeList()); pAttributeList->AddAttribute("URI", rReference.ouURI); m_xDocumentHandler->startElement("Reference", uno::Reference<xml::sax::XAttributeList>(pAttributeList)); @@ -362,8 +365,8 @@ void OOXMLSecExporter::Impl::writeManifestReference(const SignatureReferenceInfo if (nQueryPos != -1) aURI = aURI.copy(0, nQueryPos); - m_xDocumentHandler->startElement( - "Transforms", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + m_xDocumentHandler->startElement("Transforms", uno::Reference<xml::sax::XAttributeList>( + new comphelper::AttributeList())); writeRelationshipTransform(aURI); writeCanonicalizationTransform(); @@ -373,7 +376,7 @@ void OOXMLSecExporter::Impl::writeManifestReference(const SignatureReferenceInfo DocumentSignatureHelper::writeDigestMethod(m_xDocumentHandler); m_xDocumentHandler->startElement( - "DigestValue", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + "DigestValue", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); m_xDocumentHandler->characters(rReference.ouDigestValue); m_xDocumentHandler->endElement("DigestValue"); m_xDocumentHandler->endElement("Reference"); @@ -382,15 +385,16 @@ void OOXMLSecExporter::Impl::writeManifestReference(const SignatureReferenceInfo void OOXMLSecExporter::Impl::writeOfficeObject() { { - rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); + rtl::Reference<comphelper::AttributeList> pAttributeList(new comphelper::AttributeList()); pAttributeList->AddAttribute("Id", "idOfficeObject_" + m_rInformation.ouSignatureId); m_xDocumentHandler->startElement("Object", uno::Reference<xml::sax::XAttributeList>(pAttributeList)); } m_xDocumentHandler->startElement( - "SignatureProperties", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + "SignatureProperties", + uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); { - rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); + rtl::Reference<comphelper::AttributeList> pAttributeList(new comphelper::AttributeList()); pAttributeList->AddAttribute("Id", "idOfficeV1Details_" + m_rInformation.ouSignatureId); pAttributeList->AddAttribute("Target", "#" + m_rInformation.ouSignatureId); m_xDocumentHandler->startElement("SignatureProperty", @@ -404,69 +408,72 @@ void OOXMLSecExporter::Impl::writeOfficeObject() void OOXMLSecExporter::Impl::writeSignatureInfo() { - rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); + rtl::Reference<comphelper::AttributeList> pAttributeList(new comphelper::AttributeList()); pAttributeList->AddAttribute("xmlns", "http://schemas.microsoft.com/office/2006/digsig"); m_xDocumentHandler->startElement("SignatureInfoV1", uno::Reference<xml::sax::XAttributeList>(pAttributeList)); m_xDocumentHandler->startElement( - "SetupID", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + "SetupID", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); m_xDocumentHandler->characters(m_rInformation.ouSignatureLineId); m_xDocumentHandler->endElement("SetupID"); m_xDocumentHandler->startElement( - "SignatureText", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + "SignatureText", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); m_xDocumentHandler->endElement("SignatureText"); - m_xDocumentHandler->startElement( - "SignatureImage", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + m_xDocumentHandler->startElement("SignatureImage", uno::Reference<xml::sax::XAttributeList>( + new comphelper::AttributeList())); m_xDocumentHandler->endElement("SignatureImage"); - m_xDocumentHandler->startElement( - "SignatureComments", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + m_xDocumentHandler->startElement("SignatureComments", uno::Reference<xml::sax::XAttributeList>( + new comphelper::AttributeList())); m_xDocumentHandler->characters(m_rInformation.ouDescription); m_xDocumentHandler->endElement("SignatureComments"); // Just hardcode something valid according to [MS-OFFCRYPTO]. - m_xDocumentHandler->startElement( - "WindowsVersion", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + m_xDocumentHandler->startElement("WindowsVersion", uno::Reference<xml::sax::XAttributeList>( + new comphelper::AttributeList())); m_xDocumentHandler->characters("6.1"); m_xDocumentHandler->endElement("WindowsVersion"); m_xDocumentHandler->startElement( - "OfficeVersion", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + "OfficeVersion", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); m_xDocumentHandler->characters("16.0"); m_xDocumentHandler->endElement("OfficeVersion"); - m_xDocumentHandler->startElement( - "ApplicationVersion", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + m_xDocumentHandler->startElement("ApplicationVersion", uno::Reference<xml::sax::XAttributeList>( + new comphelper::AttributeList())); m_xDocumentHandler->characters("16.0"); m_xDocumentHandler->endElement("ApplicationVersion"); m_xDocumentHandler->startElement( - "Monitors", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + "Monitors", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); m_xDocumentHandler->characters("1"); m_xDocumentHandler->endElement("Monitors"); m_xDocumentHandler->startElement( - "HorizontalResolution", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + "HorizontalResolution", + uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); m_xDocumentHandler->characters("1280"); m_xDocumentHandler->endElement("HorizontalResolution"); - m_xDocumentHandler->startElement( - "VerticalResolution", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + m_xDocumentHandler->startElement("VerticalResolution", uno::Reference<xml::sax::XAttributeList>( + new comphelper::AttributeList())); m_xDocumentHandler->characters("800"); m_xDocumentHandler->endElement("VerticalResolution"); m_xDocumentHandler->startElement( - "ColorDepth", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + "ColorDepth", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); m_xDocumentHandler->characters("32"); m_xDocumentHandler->endElement("ColorDepth"); m_xDocumentHandler->startElement( - "SignatureProviderId", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + "SignatureProviderId", + uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); m_xDocumentHandler->characters("{00000000-0000-0000-0000-000000000000}"); m_xDocumentHandler->endElement("SignatureProviderId"); m_xDocumentHandler->startElement( - "SignatureProviderUrl", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + "SignatureProviderUrl", + uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); m_xDocumentHandler->endElement("SignatureProviderUrl"); m_xDocumentHandler->startElement( "SignatureProviderDetails", - uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); m_xDocumentHandler->characters( "9"); // This is what MSO 2016 writes, though [MS-OFFCRYPTO] doesn't document what the value means. m_xDocumentHandler->endElement("SignatureProviderDetails"); m_xDocumentHandler->startElement( - "SignatureType", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + "SignatureType", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); m_xDocumentHandler->characters("2"); m_xDocumentHandler->endElement("SignatureType"); @@ -476,9 +483,9 @@ void OOXMLSecExporter::Impl::writeSignatureInfo() void OOXMLSecExporter::Impl::writePackageSignature() { m_xDocumentHandler->startElement( - "Object", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + "Object", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); { - rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); + rtl::Reference<comphelper::AttributeList> pAttributeList(new comphelper::AttributeList()); pAttributeList->AddAttribute("xmlns:xd", NS_XD); pAttributeList->AddAttribute("Target", "#" + m_rInformation.ouSignatureId); m_xDocumentHandler->startElement("xd:QualifyingProperties", @@ -496,7 +503,7 @@ void OOXMLSecExporter::Impl::writeSignatureLineImages() { if (m_rInformation.aValidSignatureImage.is()) { - rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); + rtl::Reference<comphelper::AttributeList> pAttributeList(new comphelper::AttributeList()); pAttributeList->AddAttribute("Id", "idValidSigLnImg"); m_xDocumentHandler->startElement("Object", uno::Reference<xml::sax::XAttributeList>(pAttributeList)); @@ -510,7 +517,7 @@ void OOXMLSecExporter::Impl::writeSignatureLineImages() if (!m_rInformation.aInvalidSignatureImage.is()) return; - rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); + rtl::Reference<comphelper::AttributeList> pAttributeList(new comphelper::AttributeList()); pAttributeList->AddAttribute("Id", "idInvalidSigLnImg"); m_xDocumentHandler->startElement("Object", uno::Reference<xml::sax::XAttributeList>(pAttributeList)); @@ -524,7 +531,7 @@ void OOXMLSecExporter::Impl::writeSignatureLineImages() void OOXMLSecExporter::Impl::writeSignature() { - rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); + rtl::Reference<comphelper::AttributeList> pAttributeList(new comphelper::AttributeList()); pAttributeList->AddAttribute("xmlns", NS_XMLDSIG); pAttributeList->AddAttribute("Id", m_rInformation.ouSignatureId); getDocumentHandler()->startElement("Signature", diff --git a/xmlsecurity/source/helper/xmlsignaturehelper.cxx b/xmlsecurity/source/helper/xmlsignaturehelper.cxx index 70b2ed0a9eb8..fe363858522d 100644 --- a/xmlsecurity/source/helper/xmlsignaturehelper.cxx +++ b/xmlsecurity/source/helper/xmlsignaturehelper.cxx @@ -27,8 +27,6 @@ #include <tools/datetime.hxx> -#include <xmloff/attrlist.hxx> - #include <com/sun/star/io/XOutputStream.hpp> #include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/io/XTruncate.hpp> @@ -41,6 +39,7 @@ #include <com/sun/star/embed/StorageFormats.hpp> #include <com/sun/star/embed/XTransactedObject.hpp> +#include <comphelper/attributelist.hxx> #include <comphelper/ofopxmlhelper.hxx> #include <comphelper/sequence.hxx> #include <comphelper/diagnose_ex.hxx> @@ -188,7 +187,7 @@ uno::Reference<xml::sax::XWriter> XMLSignatureHelper::CreateDocumentHandlerWithH /* * write the xml context for signatures */ - rtl::Reference<SvXMLAttributeList> pAttributeList = new SvXMLAttributeList(); + rtl::Reference<comphelper::AttributeList> pAttributeList = new comphelper::AttributeList(); OUString sNamespace; if (mbODFPre1_2) sNamespace = NS_DOCUMENTSIGNATURES; diff --git a/xmlsecurity/source/helper/xsecctl.cxx b/xmlsecurity/source/helper/xsecctl.cxx index 5fcc5949b7e0..08b822f15757 100644 --- a/xmlsecurity/source/helper/xsecctl.cxx +++ b/xmlsecurity/source/helper/xsecctl.cxx @@ -34,7 +34,7 @@ #include <com/sun/star/xml/sax/XParser.hpp> #include <com/sun/star/xml/crypto/XXMLSignature.hpp> -#include <xmloff/attrlist.hxx> +#include <comphelper/attributelist.hxx> #include <rtl/ustrbuf.hxx> #include <rtl/ref.hxx> #include <sal/log.hxx> @@ -530,21 +530,21 @@ void writeUnsignedProperties( const SignatureInformation& signatureInfo) { { - rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); + rtl::Reference<comphelper::AttributeList> pAttributeList(new comphelper::AttributeList()); pAttributeList->AddAttribute("Id", "idUnsignedProperties_" + signatureInfo.ouSignatureId); xDocumentHandler->startElement("xd:UnsignedProperties", uno::Reference<xml::sax::XAttributeList>(pAttributeList)); } { - xDocumentHandler->startElement("xd:UnsignedSignatureProperties", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + xDocumentHandler->startElement("xd:UnsignedSignatureProperties", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); { - xDocumentHandler->startElement("xd:CertificateValues", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + xDocumentHandler->startElement("xd:CertificateValues", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); { for (const auto& i: signatureInfo.maEncapsulatedX509Certificates) { - xDocumentHandler->startElement("xd:EncapsulatedX509Certificate", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); + xDocumentHandler->startElement("xd:EncapsulatedX509Certificate", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList())); xDocumentHandler->characters(i); xDocumentHandler->endElement("xd:EncapsulatedX509Certificate"); } @@ -579,12 +579,12 @@ void XSecController::exportSignature( ******************************************************************************/ { const SignatureReferenceInformations& vReferenceInfors = signatureInfo.vSignatureReferenceInfors; - rtl::Reference<SvXMLAttributeList> pAttributeList; + rtl::Reference<comphelper::AttributeList> pAttributeList; /* * Write Signature element */ - pAttributeList = new SvXMLAttributeList(); + pAttributeList = new comphelper::AttributeList(); pAttributeList->AddAttribute( "xmlns", NS_XMLDSIG); @@ -601,10 +601,10 @@ void XSecController::exportSignature( /* Write SignedInfo element */ xDocumentHandler->startElement( "SignedInfo", - css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList())); + css::uno::Reference< css::xml::sax::XAttributeList > (new comphelper::AttributeList())); { /* Write CanonicalizationMethod element */ - pAttributeList = new SvXMLAttributeList(); + pAttributeList = new comphelper::AttributeList(); pAttributeList->AddAttribute( "Algorithm", ALGO_C14N); @@ -612,7 +612,7 @@ void XSecController::exportSignature( xDocumentHandler->endElement( "CanonicalizationMethod" ); /* Write SignatureMethod element */ - pAttributeList = new SvXMLAttributeList(); + pAttributeList = new comphelper::AttributeList(); // TODO: actually roundtrip this value from parsing documentsignatures.xml - entirely // broken to assume this would in any way relate to the 1st reference's digest algo @@ -633,7 +633,7 @@ void XSecController::exportSignature( { const SignatureReferenceInformation& refInfor = vReferenceInfors[j]; - pAttributeList = new SvXMLAttributeList(); + pAttributeList = new comphelper::AttributeList(); if ( refInfor.nType != SignatureReferenceType::SAMEDOCUMENT ) /* * stream reference @@ -676,9 +676,9 @@ void XSecController::exportSignature( { xDocumentHandler->startElement( "Transforms", - css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList())); + css::uno::Reference< css::xml::sax::XAttributeList > (new comphelper::AttributeList())); { - pAttributeList = new SvXMLAttributeList(); + pAttributeList = new comphelper::AttributeList(); pAttributeList->AddAttribute( "Algorithm", ALGO_C14N); @@ -691,7 +691,7 @@ void XSecController::exportSignature( } /* Write DigestMethod element */ - pAttributeList = new SvXMLAttributeList(); + pAttributeList = new comphelper::AttributeList(); pAttributeList->AddAttribute( "Algorithm", getDigestURI(refInfor.nDigestID)); @@ -703,7 +703,7 @@ void XSecController::exportSignature( /* Write DigestValue element */ xDocumentHandler->startElement( "DigestValue", - css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList())); + css::uno::Reference< css::xml::sax::XAttributeList > (new comphelper::AttributeList())); xDocumentHandler->characters( refInfor.ouDigestValue ); xDocumentHandler->endElement( "DigestValue" ); } @@ -715,19 +715,19 @@ void XSecController::exportSignature( /* Write SignatureValue element */ xDocumentHandler->startElement( "SignatureValue", - css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList())); + css::uno::Reference< css::xml::sax::XAttributeList > (new comphelper::AttributeList())); xDocumentHandler->characters( signatureInfo.ouSignatureValue ); xDocumentHandler->endElement( "SignatureValue" ); /* Write KeyInfo element */ xDocumentHandler->startElement( "KeyInfo", - css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList())); + css::uno::Reference< css::xml::sax::XAttributeList > (new comphelper::AttributeList())); { // GPG or X509 key? if (!signatureInfo.ouGpgCertificate.isEmpty()) { - pAttributeList = new SvXMLAttributeList(); + pAttributeList = new comphelper::AttributeList(); pAttributeList->AddAttribute("xmlns:loext", NS_LOEXT); /* Write PGPData element */ xDocumentHandler->startElement( @@ -737,7 +737,7 @@ void XSecController::exportSignature( /* Write keyid element */ xDocumentHandler->startElement( "PGPKeyID", - css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList())); + css::uno::Reference< css::xml::sax::XAttributeList > (new comphelper::AttributeList())); xDocumentHandler->characters(signatureInfo.ouGpgKeyID); xDocumentHandler->endElement( "PGPKeyID" ); @@ -746,7 +746,7 @@ void XSecController::exportSignature( { xDocumentHandler->startElement( "PGPKeyPacket", - css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList())); + css::uno::Reference< css::xml::sax::XAttributeList > (new comphelper::AttributeList())); xDocumentHandler->characters( signatureInfo.ouGpgCertificate ); xDocumentHandler->endElement( "PGPKeyPacket" ); } @@ -754,7 +754,7 @@ void XSecController::exportSignature( /* Write PGPOwner element */ xDocumentHandler->startElement( "loext:PGPOwner", - css::uno::Reference< css::xml::sax::XAttributeList >(new SvXMLAttributeList())); + css::uno::Reference< css::xml::sax::XAttributeList >(new comphelper::AttributeList())); xDocumentHandler->characters( signatureInfo.ouGpgOwner ); xDocumentHandler->endElement( "loext:PGPOwner" ); } @@ -768,26 +768,26 @@ void XSecController::exportSignature( /* Write X509Data element */ xDocumentHandler->startElement( "X509Data", - css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList())); + css::uno::Reference< css::xml::sax::XAttributeList > (new comphelper::AttributeList())); { for (auto const& it : rData) { /* Write X509IssuerSerial element */ xDocumentHandler->startElement( "X509IssuerSerial", - css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList())); + css::uno::Reference< css::xml::sax::XAttributeList > (new comphelper::AttributeList())); { /* Write X509IssuerName element */ xDocumentHandler->startElement( "X509IssuerName", - css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList())); + css::uno::Reference< css::xml::sax::XAttributeList > (new comphelper::AttributeList())); xDocumentHandler->characters(it.X509IssuerName); xDocumentHandler->endElement( "X509IssuerName" ); /* Write X509SerialNumber element */ xDocumentHandler->startElement( "X509SerialNumber", - css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList())); + css::uno::Reference< css::xml::sax::XAttributeList > (new comphelper::AttributeList())); xDocumentHandler->characters(it.X509SerialNumber); xDocumentHandler->endElement( "X509SerialNumber" ); } @@ -798,7 +798,7 @@ void XSecController::exportSignature( { xDocumentHandler->startElement( "X509Certificate", - css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList())); + css::uno::Reference< css::xml::sax::XAttributeList > (new comphelper::AttributeList())); xDocumentHandler->characters(it.X509Certificate); xDocumentHandler->endElement( "X509Certificate" ); } @@ -815,15 +815,15 @@ void XSecController::exportSignature( /* Write Object element */ xDocumentHandler->startElement( "Object", - css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList())); + css::uno::Reference< css::xml::sax::XAttributeList > (new comphelper::AttributeList())); { /* Write SignatureProperties element */ xDocumentHandler->startElement( "SignatureProperties", - css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList())); + css::uno::Reference< css::xml::sax::XAttributeList > (new comphelper::AttributeList())); { /* Write SignatureProperty element */ - pAttributeList = new SvXMLAttributeList(); + pAttributeList = new comphelper::AttributeList(); pAttributeList->AddAttribute( "Id", signatureInfo.ouDateTimePropertyId); @@ -836,7 +836,7 @@ void XSecController::exportSignature( { /* Write timestamp element */ - pAttributeList = new SvXMLAttributeList(); + pAttributeList = new comphelper::AttributeList(); pAttributeList->AddAttribute( "xmlns:dc", NS_DC); @@ -872,14 +872,14 @@ void XSecController::exportSignature( if (!signatureInfo.ouDescription.isEmpty()) { // SignatureProperty element. - pAttributeList = new SvXMLAttributeList(); + pAttributeList = new comphelper::AttributeList(); pAttributeList->AddAttribute("Id", signatureInfo.ouDescriptionPropertyId); pAttributeList->AddAttribute("Target", "#" + signatureInfo.ouSignatureId); xDocumentHandler->startElement("SignatureProperty", pAttributeList); { // Description element. - pAttributeList = new SvXMLAttributeList(); + pAttributeList = new comphelper::AttributeList(); pAttributeList->AddAttribute("xmlns:dc", NS_DC); xDocumentHandler->startElement("dc:description", pAttributeList); @@ -897,13 +897,13 @@ void XSecController::exportSignature( // In XAdES, write another Object element for the QualifyingProperties if (bXAdESCompliantIfODF) { - pAttributeList = new SvXMLAttributeList(); + pAttributeList = new comphelper::AttributeList(); pAttributeList->AddAttribute("xmlns:xd", NS_XD); xDocumentHandler->startElement( "Object", pAttributeList); { - pAttributeList = new SvXMLAttributeList(); + pAttributeList = new comphelper::AttributeList(); pAttributeList->AddAttribute("Target", "#" + signatureInfo.ouSignatureId); xDocumentHandler->startElement( "xd:QualifyingProperties", diff --git a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx index ccc3eb98f4e9..918735d3800b 100644 --- a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx +++ b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx @@ -25,8 +25,7 @@ #include <cppuhelper/supportsservice.hxx> #include <xmlsec/xmldocumentwrapper_xmlsecimpl.hxx> #include "xmlelementwrapper_xmlsecimpl.hxx" - -#include <xmloff/attrlist.hxx> +#include <comphelper/attributelist.hxx> #include <rtl/ref.hxx> #ifdef UNX @@ -174,7 +173,7 @@ void XMLDocumentWrapper_XmlSecImpl::sendStartElement( * This node must be an element type. ******************************************************************************/ { - rtl::Reference<SvXMLAttributeList> pAttributeList = new SvXMLAttributeList(); + rtl::Reference<comphelper::AttributeList> pAttributeList = new comphelper::AttributeList(); xmlNsPtr pNsDef = pNode->nsDef; |