Merge SvXMLAttributeList to comphelper::AttributeList

And simplify the latter, to always use "CDATA" type (as the former did).
"CDATA" was used in all cases but one, where an empty string was used.

Change-Id: I1b3bfae40e29628e4094d9a6e58a69a66865874c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145526
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
Mike Kaganski
2023-01-15 12:32:29 +00:00
parent 9d2355b674
commit f2f008c52a
89 changed files with 382 additions and 655 deletions
+68 -14
View File
@@ -19,23 +19,15 @@
#include <comphelper/attributelist.hxx> #include <comphelper/attributelist.hxx>
#include <algorithm>
#include <cassert>
using namespace osl; using namespace osl;
using namespace com::sun::star; using namespace com::sun::star;
namespace comphelper { 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) OUString SAL_CALL AttributeList::getValueByName(const OUString& sName)
{ {
for (auto const& attribute : mAttributes) for (auto const& attribute : mAttributes)
@@ -53,10 +45,12 @@ AttributeList::AttributeList()
mAttributes.reserve(20); mAttributes.reserve(20);
} }
AttributeList::AttributeList(const AttributeList &r) AttributeList::AttributeList(const uno::Reference< xml::sax::XAttributeList>& rAttrList)
: cppu::WeakImplHelper<XAttributeList, XCloneable>(r)
{ {
mAttributes = r.mAttributes; if (AttributeList* pImpl = dynamic_cast<AttributeList*>(rAttrList.get()))
mAttributes = pImpl->mAttributes;
else
AppendAttributeList(rAttrList);
} }
AttributeList::~AttributeList() AttributeList::~AttributeList()
@@ -68,6 +62,66 @@ css::uno::Reference< css::util::XCloneable > AttributeList::createClone()
return new AttributeList( *this ); 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 } // namespace comphelper
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+5 -9
View File
@@ -142,14 +142,12 @@ void WriteRelationsInfoSequence(
OUString aRelListElement( "Relationships" ); OUString aRelListElement( "Relationships" );
OUString aRelElement( "Relationship" ); OUString aRelElement( "Relationship" );
OUString aCDATAString( "CDATA" );
OUString aWhiteSpace( " " ); OUString aWhiteSpace( " " );
// write the namespace // write the namespace
rtl::Reference<AttributeList> pRootAttrList = new AttributeList; rtl::Reference<AttributeList> pRootAttrList = new AttributeList;
pRootAttrList->AddAttribute( pRootAttrList->AddAttribute(
"xmlns", "xmlns",
aCDATAString,
"http://schemas.openxmlformats.org/package/2006/relationships" ); "http://schemas.openxmlformats.org/package/2006/relationships" );
xWriter->startDocument(); xWriter->startDocument();
@@ -168,7 +166,7 @@ void WriteRelationsInfoSequence(
// TODO/LATER: should the extensions be allowed? // TODO/LATER: should the extensions be allowed?
throw lang::IllegalArgumentException(); throw lang::IllegalArgumentException();
} }
pAttrList->AddAttribute( pair.First, aCDATAString, pair.Second ); pAttrList->AddAttribute( pair.First, pair.Second );
} }
xWriter->startElement( aRelElement, pAttrList ); xWriter->startElement( aRelElement, pAttrList );
@@ -199,14 +197,12 @@ void WriteContentSequence(
static constexpr OUStringLiteral aDefaultElement(u"Default"); static constexpr OUStringLiteral aDefaultElement(u"Default");
static constexpr OUStringLiteral aOverrideElement(u"Override"); static constexpr OUStringLiteral aOverrideElement(u"Override");
static constexpr OUStringLiteral aContentTypeAttr(u"ContentType"); static constexpr OUStringLiteral aContentTypeAttr(u"ContentType");
static constexpr OUStringLiteral aCDATAString(u"CDATA");
static constexpr OUStringLiteral aWhiteSpace(u" "); static constexpr OUStringLiteral aWhiteSpace(u" ");
// write the namespace // write the namespace
rtl::Reference<AttributeList> pRootAttrList = new AttributeList; rtl::Reference<AttributeList> pRootAttrList = new AttributeList;
pRootAttrList->AddAttribute( pRootAttrList->AddAttribute(
"xmlns", "xmlns",
aCDATAString,
"http://schemas.openxmlformats.org/package/2006/content-types" ); "http://schemas.openxmlformats.org/package/2006/content-types" );
xWriter->startDocument(); xWriter->startDocument();
@@ -215,8 +211,8 @@ void WriteContentSequence(
for ( const beans::StringPair & pair : aDefaultsSequence ) for ( const beans::StringPair & pair : aDefaultsSequence )
{ {
rtl::Reference<AttributeList> pAttrList = new AttributeList; rtl::Reference<AttributeList> pAttrList = new AttributeList;
pAttrList->AddAttribute( "Extension", aCDATAString, pair.First ); pAttrList->AddAttribute( "Extension", pair.First );
pAttrList->AddAttribute( aContentTypeAttr, aCDATAString, pair.Second ); pAttrList->AddAttribute( aContentTypeAttr, pair.Second );
xWriter->startElement( aDefaultElement, pAttrList ); xWriter->startElement( aDefaultElement, pAttrList );
xWriter->ignorableWhitespace( aWhiteSpace ); xWriter->ignorableWhitespace( aWhiteSpace );
@@ -226,8 +222,8 @@ void WriteContentSequence(
for ( const beans::StringPair & pair : aOverridesSequence ) for ( const beans::StringPair & pair : aOverridesSequence )
{ {
rtl::Reference<AttributeList> pAttrList = new AttributeList; rtl::Reference<AttributeList> pAttrList = new AttributeList;
pAttrList->AddAttribute( "PartName", aCDATAString, pair.First ); pAttrList->AddAttribute( "PartName", pair.First );
pAttrList->AddAttribute( aContentTypeAttr, aCDATAString, pair.Second ); pAttrList->AddAttribute( aContentTypeAttr, pair.Second );
xWriter->startElement( aOverrideElement, pAttrList ); xWriter->startElement( aOverrideElement, pAttrList );
xWriter->ignorableWhitespace( aWhiteSpace ); xWriter->ignorableWhitespace( aWhiteSpace );
@@ -25,8 +25,8 @@
#include <com/sun/star/xml/sax/Writer.hpp> #include <com/sun/star/xml/sax/Writer.hpp>
#include <rtl/ref.hxx> #include <rtl/ref.hxx>
#include <comphelper/attributelist.hxx>
#include <comphelper/diagnose_ex.hxx> #include <comphelper/diagnose_ex.hxx>
#include <xmloff/attrlist.hxx>
#include <stack> #include <stack>
@@ -48,7 +48,7 @@ namespace dbaccess
{ {
Reference< XDocumentHandler > xHandler; Reference< XDocumentHandler > xHandler;
std::stack< OUString > aElements; std::stack< OUString > aElements;
::rtl::Reference< SvXMLAttributeList > xAttributes; ::rtl::Reference<comphelper::AttributeList> xAttributes;
}; };
// StorageXMLOutputStream // StorageXMLOutputStream
@@ -64,7 +64,7 @@ namespace dbaccess
m_pData->xHandler.set( xSaxWriter, UNO_QUERY_THROW ); m_pData->xHandler.set( xSaxWriter, UNO_QUERY_THROW );
m_pData->xHandler->startDocument(); m_pData->xHandler->startDocument();
m_pData->xAttributes = new SvXMLAttributeList; m_pData->xAttributes = new comphelper::AttributeList;
} }
StorageXMLOutputStream::~StorageXMLOutputStream() StorageXMLOutputStream::~StorageXMLOutputStream()
@@ -89,7 +89,7 @@ namespace dbaccess
ENSURE_OR_RETURN_VOID( m_pData->xHandler.is(), "no document handler" ); ENSURE_OR_RETURN_VOID( m_pData->xHandler.is(), "no document handler" );
m_pData->xHandler->startElement( i_rElementName, m_pData->xAttributes ); 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 ); m_pData->aElements.push( i_rElementName );
} }
+1 -1
View File
@@ -27,7 +27,7 @@ namespace dbaxml
using namespace ::com::sun::star::xml::sax; using namespace ::com::sun::star::xml::sax;
void OXMLAutoStylePoolP::exportStyleAttributes( void OXMLAutoStylePoolP::exportStyleAttributes(
SvXMLAttributeList& rAttrList, comphelper::AttributeList& rAttrList,
XmlStyleFamily nFamily, XmlStyleFamily nFamily,
const std::vector< XMLPropertyState >& rProperties, const std::vector< XMLPropertyState >& rProperties,
const SvXMLExportPropertyMapper& rPropExp const SvXMLExportPropertyMapper& rPropExp
+1 -1
View File
@@ -28,7 +28,7 @@ namespace dbaxml
ODBExport& rODBExport; ODBExport& rODBExport;
virtual void exportStyleAttributes( virtual void exportStyleAttributes(
SvXMLAttributeList& rAttrList, comphelper::AttributeList& rAttrList,
XmlStyleFamily nFamily, XmlStyleFamily nFamily,
const std::vector< XMLPropertyState >& rProperties, const std::vector< XMLPropertyState >& rProperties,
const SvXMLExportPropertyMapper& rPropExp, const SvXMLExportPropertyMapper& rPropExp,
+5 -5
View File
@@ -127,7 +127,7 @@ namespace dbaxml
/** this method is called for every item that has the /** this method is called for every item that has the
MID_FLAG_SPECIAL_ITEM_EXPORT flag set */ MID_FLAG_SPECIAL_ITEM_EXPORT flag set */
virtual void handleSpecialItem( virtual void handleSpecialItem(
SvXMLAttributeList& /*rAttrList*/, comphelper::AttributeList& /*rAttrList*/,
const XMLPropertyState& /*rProperty*/, const XMLPropertyState& /*rProperty*/,
const SvXMLUnitConverter& /*rUnitConverter*/, const SvXMLUnitConverter& /*rUnitConverter*/,
const SvXMLNamespaceMap& /*rNamespaceMap*/, const SvXMLNamespaceMap& /*rNamespaceMap*/,
@@ -840,7 +840,7 @@ void ODBExport::exportTable(XPropertySet* _xProp)
exportFilter(_xProp,PROPERTY_ORDER,XML_ORDER_STATEMENT); 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); Reference<XPropertySet> xFind(_xProp);
exportStyleName(XML_STYLE_NAME,xFind,_rAtt,m_aAutoStyleNames); 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); 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); TPropertyStyleMap::const_iterator aFind = _rMap.find(_xProp);
if ( aFind != _rMap.end() ) if ( aFind != _rMap.end() )
@@ -911,7 +911,7 @@ void ODBExport::exportColumns(const Reference<XColumnsSupplier>& _xColSup)
if ( aFind != m_aTableDummyColumns.end() ) if ( aFind != m_aTableDummyColumns.end() )
{ {
SvXMLElementExport aColumns(*this,XML_NAMESPACE_DB, XML_COLUMNS, true, true); 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); exportStyleName(aFind->second.get(),*pAtt);
AddAttributeList(pAtt); AddAttributeList(pAtt);
SvXMLElementExport aColumn(*this,XML_NAMESPACE_DB, XML_COLUMN, true, true); 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); Reference<XPropertySet> xProp(xNameAccess->getByName(*pIter),UNO_QUERY);
if ( xProp.is() ) if ( xProp.is() )
{ {
rtl::Reference<SvXMLAttributeList> pAtt = new SvXMLAttributeList; rtl::Reference<comphelper::AttributeList> pAtt = new comphelper::AttributeList;
exportStyleName(xProp.get(),*pAtt); exportStyleName(xProp.get(),*pAtt);
bool bHidden = getBOOL(xProp->getPropertyValue(PROPERTY_HIDDEN)); bool bHidden = getBOOL(xProp->getPropertyValue(PROPERTY_HIDDEN));
+2 -2
View File
@@ -123,8 +123,8 @@ class ODBExport : public SvXMLExport
void exportReports(); void exportReports();
void exportQueries(bool _bExportContext); void exportQueries(bool _bExportContext);
void exportTables(bool _bExportContext); void exportTables(bool _bExportContext);
void exportStyleName(XPropertySet* _xProp,SvXMLAttributeList& _rAtt); void exportStyleName(XPropertySet* _xProp,comphelper::AttributeList& _rAtt);
void exportStyleName(const ::xmloff::token::XMLTokenEnum _eToken,const Reference<XPropertySet>& _xProp,SvXMLAttributeList& _rAtt,TPropertyStyleMap& _rMap); void exportStyleName(const ::xmloff::token::XMLTokenEnum _eToken,const Reference<XPropertySet>& _xProp,comphelper::AttributeList& _rAtt,TPropertyStyleMap& _rMap);
void exportCollection(const Reference< XNameAccess >& _xCollection void exportCollection(const Reference< XNameAccess >& _xCollection
,enum ::xmloff::token::XMLTokenEnum _eComponents ,enum ::xmloff::token::XMLTokenEnum _eComponents
,enum ::xmloff::token::XMLTokenEnum _eSubComponents ,enum ::xmloff::token::XMLTokenEnum _eSubComponents
+1
View File
@@ -34,6 +34,7 @@ $(eval $(call gb_Library_use_libraries,t602filter,\
xo \ xo \
tl \ tl \
utl \ utl \
comphelper \
cppuhelper \ cppuhelper \
cppu \ cppu \
sal \ sal \
+1 -1
View File
@@ -248,7 +248,7 @@ bool T602ImportFilter::importImpl( const Sequence< css::beans::PropertyValue >&
auto const fs = OUString(OUString::number(inistruct::fontsize) + "pt"); auto const fs = OUString(OUString::number(inistruct::fontsize) + "pt");
auto const fs2 = OUString(OUString::number(2*inistruct::fontsize) + "pt"); auto const fs2 = OUString(OUString::number(2*inistruct::fontsize) + "pt");
mpAttrList = new SvXMLAttributeList; mpAttrList = new comphelper::AttributeList;
Reference < XAttributeList > xAttrList ( mpAttrList ); Reference < XAttributeList > xAttrList ( mpAttrList );
+2 -2
View File
@@ -29,8 +29,8 @@
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp> #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
#include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/uno/XComponentContext.hpp>
#include <comphelper/attributelist.hxx>
#include <cppuhelper/implbase.hxx> #include <cppuhelper/implbase.hxx>
#include <xmloff/attrlist.hxx>
#include <rtl/ref.hxx> #include <rtl/ref.hxx>
namespace T602ImportFilter { namespace T602ImportFilter {
@@ -118,7 +118,7 @@ private:
css::uno::Reference< css::lang::XComponent > mxDoc; css::uno::Reference< css::lang::XComponent > mxDoc;
css::uno::Reference < css::io::XInputStream > mxInputStream; css::uno::Reference < css::io::XInputStream > mxInputStream;
rtl::Reference<SvXMLAttributeList> mpAttrList; rtl::Reference<comphelper::AttributeList> mpAttrList;
tnode node; // START tnode node; // START
@@ -90,7 +90,6 @@ void TypeDetectionExporter::doExport( const Reference< XOutputStream >& xOS, co
static const OUStringLiteral sDocTypePrefix ( u"doctype:" ); static const OUStringLiteral sDocTypePrefix ( u"doctype:" );
static const OUStringLiteral sFilterAdaptorService( u"com.sun.star.comp.Writer.XmlFilterAdaptor" ); static const OUStringLiteral sFilterAdaptorService( u"com.sun.star.comp.Writer.XmlFilterAdaptor" );
static const OUStringLiteral sXSLTFilterService ( u"com.sun.star.documentconversion.XSLTFilter" ); 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 // 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 ); xHandler->setOutputStream( xOS );
rtl::Reference<::comphelper::AttributeList> pAttrList = new ::comphelper::AttributeList; rtl::Reference<::comphelper::AttributeList> pAttrList = new ::comphelper::AttributeList;
pAttrList->AddAttribute ( "xmlns:oor", sCdataAttribute, "http://openoffice.org/2001/registry" ); pAttrList->AddAttribute ( "xmlns:oor", "http://openoffice.org/2001/registry" );
pAttrList->AddAttribute ( "xmlns:xs", sCdataAttribute, "http://www.w3.org/2001/XMLSchema" ); pAttrList->AddAttribute ( "xmlns:xs", "http://www.w3.org/2001/XMLSchema" );
pAttrList->AddAttribute ( sName, sCdataAttribute, "TypeDetection" ); pAttrList->AddAttribute ( sName, "TypeDetection" );
pAttrList->AddAttribute ( "oor:package", sCdataAttribute, "org.openoffice.Office" ); pAttrList->AddAttribute ( "oor:package", "org.openoffice.Office" );
xHandler->startDocument(); xHandler->startDocument();
xHandler->ignorableWhitespace ( sWhiteSpace ); xHandler->ignorableWhitespace ( sWhiteSpace );
@@ -110,14 +109,14 @@ void TypeDetectionExporter::doExport( const Reference< XOutputStream >& xOS, co
// export types // export types
{ {
pAttrList = new ::comphelper::AttributeList; pAttrList = new ::comphelper::AttributeList;
pAttrList->AddAttribute ( sName, sCdataAttribute, "Types" ); pAttrList->AddAttribute ( sName, "Types" );
xHandler->ignorableWhitespace ( sWhiteSpace ); xHandler->ignorableWhitespace ( sWhiteSpace );
xHandler->startElement( sNode, pAttrList ); xHandler->startElement( sNode, pAttrList );
for (auto const& filter : rFilters) for (auto const& filter : rFilters)
{ {
pAttrList = new ::comphelper::AttributeList; pAttrList = new ::comphelper::AttributeList;
pAttrList->AddAttribute( sName, sCdataAttribute, filter->maType ); pAttrList->AddAttribute( sName, filter->maType );
xHandler->ignorableWhitespace ( sWhiteSpace ); xHandler->ignorableWhitespace ( sWhiteSpace );
xHandler->startElement( sNode, pAttrList ); xHandler->startElement( sNode, pAttrList );
OUString sValue = "0" + sComma + sComma; OUString sValue = "0" + sComma + sComma;
@@ -141,14 +140,14 @@ void TypeDetectionExporter::doExport( const Reference< XOutputStream >& xOS, co
// export filters // export filters
{ {
pAttrList = new ::comphelper::AttributeList; pAttrList = new ::comphelper::AttributeList;
pAttrList->AddAttribute ( sName, sCdataAttribute, "Filters" ); pAttrList->AddAttribute ( sName, "Filters" );
xHandler->ignorableWhitespace ( sWhiteSpace ); xHandler->ignorableWhitespace ( sWhiteSpace );
xHandler->startElement( sNode, pAttrList ); xHandler->startElement( sNode, pAttrList );
for (auto const& filter : rFilters) for (auto const& filter : rFilters)
{ {
pAttrList = new ::comphelper::AttributeList; pAttrList = new ::comphelper::AttributeList;
pAttrList->AddAttribute( sName, sCdataAttribute, filter->maFilterName ); pAttrList->AddAttribute( sName, filter->maFilterName );
xHandler->ignorableWhitespace ( sWhiteSpace ); xHandler->ignorableWhitespace ( sWhiteSpace );
xHandler->startElement( sNode, pAttrList ); xHandler->startElement( sNode, pAttrList );
addLocaleProperty( xHandler, sUIName, filter->maInterfaceName ); addLocaleProperty( xHandler, sUIName, filter->maInterfaceName );
@@ -207,14 +206,13 @@ void TypeDetectionExporter::addProperty( const Reference< XWriter >& xHandler, c
{ {
try try
{ {
static const OUStringLiteral sCdataAttribute( u"CDATA" );
static const OUStringLiteral sProp( u"prop" ); static const OUStringLiteral sProp( u"prop" );
static const OUStringLiteral sValue( u"value" ); static const OUStringLiteral sValue( u"value" );
static const OUStringLiteral sWhiteSpace ( u" " ); static const OUStringLiteral sWhiteSpace ( u" " );
rtl::Reference<::comphelper::AttributeList>pAttrList = new ::comphelper::AttributeList; rtl::Reference<::comphelper::AttributeList>pAttrList = new ::comphelper::AttributeList;
pAttrList->AddAttribute ( "oor:name", sCdataAttribute, rName ); pAttrList->AddAttribute ( "oor:name", rName );
pAttrList->AddAttribute ( "oor:type", sCdataAttribute, "xs:string" ); pAttrList->AddAttribute ( "oor:type", "xs:string" );
xHandler->ignorableWhitespace ( sWhiteSpace ); xHandler->ignorableWhitespace ( sWhiteSpace );
xHandler->startElement( sProp, pAttrList ); xHandler->startElement( sProp, pAttrList );
@@ -235,19 +233,18 @@ void TypeDetectionExporter::addLocaleProperty( const Reference< XWriter >& xHand
{ {
try try
{ {
static const OUStringLiteral sCdataAttribute( u"CDATA" );
static const OUStringLiteral sProp( u"prop" ); static const OUStringLiteral sProp( u"prop" );
static const OUStringLiteral sValue( u"value" ); static const OUStringLiteral sValue( u"value" );
static const OUStringLiteral sWhiteSpace ( u" " ); static const OUStringLiteral sWhiteSpace ( u" " );
rtl::Reference<::comphelper::AttributeList> pAttrList = new ::comphelper::AttributeList; rtl::Reference<::comphelper::AttributeList> pAttrList = new ::comphelper::AttributeList;
pAttrList->AddAttribute ( "oor:name", sCdataAttribute, rName ); pAttrList->AddAttribute ( "oor:name", rName );
pAttrList->AddAttribute ( "oor:type", sCdataAttribute, "xs:string" ); pAttrList->AddAttribute ( "oor:type", "xs:string" );
xHandler->ignorableWhitespace ( sWhiteSpace ); xHandler->ignorableWhitespace ( sWhiteSpace );
xHandler->startElement( sProp, pAttrList ); xHandler->startElement( sProp, pAttrList );
pAttrList = new ::comphelper::AttributeList; pAttrList = new ::comphelper::AttributeList;
pAttrList->AddAttribute ( "xml:lang", sCdataAttribute, "en-US" ); pAttrList->AddAttribute ( "xml:lang", "en-US" );
xHandler->ignorableWhitespace ( sWhiteSpace ); xHandler->ignorableWhitespace ( sWhiteSpace );
xHandler->startElement( sValue, pAttrList ); xHandler->startElement( sValue, pAttrList );
xHandler->characters( rValue ); xHandler->characters( rValue );
-2
View File
@@ -23,8 +23,6 @@
namespace framework{ namespace framework{
inline constexpr OUStringLiteral ATTRIBUTE_TYPE_CDATA = u"CDATA";
// same items with a name space alias // same items with a name space alias
inline constexpr OUStringLiteral AL_ELEMENT_ACCELERATORLIST = u"accel:acceleratorlist"; inline constexpr OUStringLiteral AL_ELEMENT_ACCELERATORLIST = u"accel:acceleratorlist";
inline constexpr OUStringLiteral AL_ELEMENT_ITEM = u"accel:item"; inline constexpr OUStringLiteral AL_ELEMENT_ITEM = u"accel:item";
@@ -123,7 +123,6 @@ class OWriteImagesDocumentHandler final
css::uno::Reference< css::xml::sax::XDocumentHandler > m_xWriteDocumentHandler; css::uno::Reference< css::xml::sax::XDocumentHandler > m_xWriteDocumentHandler;
css::uno::Reference< css::xml::sax::XAttributeList > m_xEmptyList; css::uno::Reference< css::xml::sax::XAttributeList > m_xEmptyList;
OUString m_aXMLImageNS; OUString m_aXMLImageNS;
OUString m_aAttributeType;
OUString m_aAttributeXlinkType; OUString m_aAttributeXlinkType;
OUString m_aAttributeValueSimple; OUString m_aAttributeValueSimple;
}; };
@@ -213,7 +213,6 @@ class OWriteMenuDocumentHandler final
css::uno::Reference< css::container::XIndexAccess > m_xMenuBarContainer; css::uno::Reference< css::container::XIndexAccess > m_xMenuBarContainer;
css::uno::Reference< css::xml::sax::XDocumentHandler > m_xWriteDocumentHandler; css::uno::Reference< css::xml::sax::XDocumentHandler > m_xWriteDocumentHandler;
css::uno::Reference< css::xml::sax::XAttributeList > m_xEmptyList; css::uno::Reference< css::xml::sax::XAttributeList > m_xEmptyList;
OUString m_aAttributeType;
bool m_bIsMenuBar; bool m_bIsMenuBar;
}; };
@@ -125,7 +125,6 @@ class OWriteStatusBarDocumentHandler final
css::uno::Reference< css::xml::sax::XAttributeList > m_xEmptyList; css::uno::Reference< css::xml::sax::XAttributeList > m_xEmptyList;
OUString m_aXMLStatusBarNS; OUString m_aXMLStatusBarNS;
OUString m_aXMLXlinkNS; OUString m_aXMLXlinkNS;
OUString m_aAttributeType;
OUString m_aAttributeURL; OUString m_aAttributeURL;
}; };
@@ -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_TOOLBAR = u"xmlns:toolbar";
inline constexpr OUStringLiteral ATTRIBUTE_XMLNS_XLINK = u"xmlns:xlink"; inline constexpr OUStringLiteral ATTRIBUTE_XMLNS_XLINK = u"xmlns:xlink";
inline constexpr OUStringLiteral ATTRIBUTE_TYPE_CDATA = u"CDATA";
#define ATTRIBUTE_BOOLEAN_TRUE "true" #define ATTRIBUTE_BOOLEAN_TRUE "true"
inline constexpr OUStringLiteral ATTRIBUTE_BOOLEAN_FALSE = u"false"; inline constexpr OUStringLiteral ATTRIBUTE_BOOLEAN_FALSE = u"false";
@@ -149,7 +149,6 @@ class OWriteToolBoxDocumentHandler final
css::uno::Reference< css::container::XIndexAccess > m_rItemAccess; css::uno::Reference< css::container::XIndexAccess > m_rItemAccess;
OUString m_aXMLToolbarNS; OUString m_aXMLToolbarNS;
OUString m_aXMLXlinkNS; OUString m_aXMLXlinkNS;
OUString m_aAttributeType;
OUString m_aAttributeURL; OUString m_aAttributeURL;
}; };
@@ -64,8 +64,6 @@ constexpr OUStringLiteral ATTRIBUTE_NS_STYLE = u"menu:style";
constexpr OUStringLiteral ATTRIBUTE_XMLNS_MENU = u"xmlns:menu"; 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\">"; constexpr OUStringLiteral MENUBAR_DOCTYPE = u"<!DOCTYPE menu:menubar PUBLIC \"-//OpenOffice.org//DTD OfficeDocument 1.0//EN\" \"menubar.dtd\">";
#define ATTRIBUTE_ITEMSTYLE_TEXT "text" #define ATTRIBUTE_ITEMSTYLE_TEXT "text"
@@ -720,7 +718,6 @@ OWriteMenuDocumentHandler::OWriteMenuDocumentHandler(
m_bIsMenuBar( bIsMenuBar ) m_bIsMenuBar( bIsMenuBar )
{ {
m_xEmptyList = new ::comphelper::AttributeList; m_xEmptyList = new ::comphelper::AttributeList;
m_aAttributeType = ATTRIBUTE_TYPE_CDATA;
} }
OWriteMenuDocumentHandler::~OWriteMenuDocumentHandler() OWriteMenuDocumentHandler::~OWriteMenuDocumentHandler()
@@ -742,12 +739,10 @@ void OWriteMenuDocumentHandler::WriteMenuDocument()
} }
pList->AddAttribute( ATTRIBUTE_XMLNS_MENU, pList->AddAttribute( ATTRIBUTE_XMLNS_MENU,
m_aAttributeType,
XMLNS_MENU ); XMLNS_MENU );
if ( m_bIsMenuBar ) //FIXME if ( m_bIsMenuBar ) //FIXME
pList->AddAttribute( ATTRIBUTE_NS_ID, pList->AddAttribute( ATTRIBUTE_NS_ID,
m_aAttributeType,
"menubar" ); "menubar" );
OUString aRootElement; OUString aRootElement;
@@ -793,12 +788,10 @@ void OWriteMenuDocumentHandler::WriteMenu( const Reference< XIndexAccess >& rMen
rtl::Reference<::comphelper::AttributeList> pListMenu = new ::comphelper::AttributeList; rtl::Reference<::comphelper::AttributeList> pListMenu = new ::comphelper::AttributeList;
pListMenu->AddAttribute( ATTRIBUTE_NS_ID, pListMenu->AddAttribute( ATTRIBUTE_NS_ID,
m_aAttributeType,
aCommandURL ); aCommandURL );
if ( !aLabel.isEmpty() ) if ( !aLabel.isEmpty() )
pListMenu->AddAttribute( ATTRIBUTE_NS_LABEL, pListMenu->AddAttribute( ATTRIBUTE_NS_LABEL,
m_aAttributeType,
aLabel ); aLabel );
m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); m_xWriteDocumentHandler->ignorableWhitespace( OUString() );
@@ -843,20 +836,17 @@ void OWriteMenuDocumentHandler::WriteMenuItem( const OUString& aCommandURL, cons
rtl::Reference<::comphelper::AttributeList> pList = new ::comphelper::AttributeList; rtl::Reference<::comphelper::AttributeList> pList = new ::comphelper::AttributeList;
pList->AddAttribute( ATTRIBUTE_NS_ID, pList->AddAttribute( ATTRIBUTE_NS_ID,
m_aAttributeType,
aCommandURL ); aCommandURL );
if ( !aHelpURL.isEmpty() ) if ( !aHelpURL.isEmpty() )
{ {
pList->AddAttribute( ATTRIBUTE_NS_HELPID, pList->AddAttribute( ATTRIBUTE_NS_HELPID,
m_aAttributeType,
aHelpURL ); aHelpURL );
} }
if ( !aLabel.isEmpty() ) if ( !aLabel.isEmpty() )
{ {
pList->AddAttribute( ATTRIBUTE_NS_LABEL, pList->AddAttribute( ATTRIBUTE_NS_LABEL,
m_aAttributeType,
aLabel ); aLabel );
} }
if ( nStyle > 0 ) if ( nStyle > 0 )
@@ -874,7 +864,6 @@ void OWriteMenuDocumentHandler::WriteMenuItem( const OUString& aCommandURL, cons
} }
} }
pList->AddAttribute( ATTRIBUTE_NS_STYLE, pList->AddAttribute( ATTRIBUTE_NS_STYLE,
m_aAttributeType,
aValue.makeStringAndClear() ); aValue.makeStringAndClear() );
} }
@@ -84,7 +84,7 @@ void SAL_CALL SaxNamespaceFilter::startElement(
OUString aAttributeName = xAttribs->getNameByIndex(attributeIndex); OUString aAttributeName = xAttribs->getNameByIndex(attributeIndex);
OUString aValue = xAttribs->getValueByIndex(attributeIndex); OUString aValue = xAttribs->getValueByIndex(attributeIndex);
OUString aNamespaceAttributeName = aXMLNamespaces.applyNSToAttributeName( aAttributeName ); OUString aNamespaceAttributeName = aXMLNamespaces.applyNSToAttributeName( aAttributeName );
pNewList->AddAttribute( aNamespaceAttributeName, "CDATA", aValue ); pNewList->AddAttribute(aNamespaceAttributeName, aValue);
} }
} }
catch ( SAXException& e ) catch ( SAXException& e )
@@ -64,8 +64,6 @@ constexpr OUStringLiteral ELEMENT_NS_STATUSBARITEM = u"statusbar:statusbaritem";
constexpr OUStringLiteral ATTRIBUTE_XMLNS_STATUSBAR = u"xmlns:statusbar"; constexpr OUStringLiteral ATTRIBUTE_XMLNS_STATUSBAR = u"xmlns:statusbar";
constexpr OUStringLiteral ATTRIBUTE_XMLNS_XLINK = u"xmlns:xlink"; 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_TRUE = u"true";
constexpr OUStringLiteral ATTRIBUTE_BOOLEAN_FALSE = u"false"; constexpr OUStringLiteral ATTRIBUTE_BOOLEAN_FALSE = u"false";
@@ -461,7 +459,6 @@ OWriteStatusBarDocumentHandler::OWriteStatusBarDocumentHandler(
m_xWriteDocumentHandler( rWriteDocumentHandler ) m_xWriteDocumentHandler( rWriteDocumentHandler )
{ {
m_xEmptyList = new ::comphelper::AttributeList; m_xEmptyList = new ::comphelper::AttributeList;
m_aAttributeType = ATTRIBUTE_TYPE_CDATA;
m_aXMLXlinkNS = XMLNS_XLINK_PREFIX; m_aXMLXlinkNS = XMLNS_XLINK_PREFIX;
m_aXMLStatusBarNS = XMLNS_STATUSBAR_PREFIX; m_aXMLStatusBarNS = XMLNS_STATUSBAR_PREFIX;
} }
@@ -485,11 +482,9 @@ void OWriteStatusBarDocumentHandler::WriteStatusBarDocument()
rtl::Reference<::comphelper::AttributeList> pList = new ::comphelper::AttributeList; rtl::Reference<::comphelper::AttributeList> pList = new ::comphelper::AttributeList;
pList->AddAttribute( ATTRIBUTE_XMLNS_STATUSBAR, pList->AddAttribute( ATTRIBUTE_XMLNS_STATUSBAR,
m_aAttributeType,
XMLNS_STATUSBAR ); XMLNS_STATUSBAR );
pList->AddAttribute( ATTRIBUTE_XMLNS_XLINK, pList->AddAttribute( ATTRIBUTE_XMLNS_XLINK,
m_aAttributeType,
XMLNS_XLINK ); XMLNS_XLINK );
m_xWriteDocumentHandler->startElement( ELEMENT_NS_STATUSBAR, pList ); m_xWriteDocumentHandler->startElement( ELEMENT_NS_STATUSBAR, pList );
@@ -545,25 +540,22 @@ void OWriteStatusBarDocumentHandler::WriteStatusBarItem(
} }
// save required attribute (URL) // save required attribute (URL)
pList->AddAttribute( m_aAttributeURL, m_aAttributeType, rCommandURL ); pList->AddAttribute( m_aAttributeURL, rCommandURL );
// alignment // alignment
if ( nStyle & ItemStyle::ALIGN_RIGHT ) if ( nStyle & ItemStyle::ALIGN_RIGHT )
{ {
pList->AddAttribute( m_aXMLStatusBarNS + ATTRIBUTE_ALIGN, pList->AddAttribute( m_aXMLStatusBarNS + ATTRIBUTE_ALIGN,
m_aAttributeType,
ATTRIBUTE_ALIGN_RIGHT ); ATTRIBUTE_ALIGN_RIGHT );
} }
else if ( nStyle & ItemStyle::ALIGN_CENTER ) else if ( nStyle & ItemStyle::ALIGN_CENTER )
{ {
pList->AddAttribute( m_aXMLStatusBarNS + ATTRIBUTE_ALIGN, pList->AddAttribute( m_aXMLStatusBarNS + ATTRIBUTE_ALIGN,
m_aAttributeType,
ATTRIBUTE_ALIGN_CENTER ); ATTRIBUTE_ALIGN_CENTER );
} }
else else
{ {
pList->AddAttribute( m_aXMLStatusBarNS + ATTRIBUTE_ALIGN, pList->AddAttribute( m_aXMLStatusBarNS + ATTRIBUTE_ALIGN,
m_aAttributeType,
ATTRIBUTE_ALIGN_LEFT ); ATTRIBUTE_ALIGN_LEFT );
} }
@@ -571,13 +563,11 @@ void OWriteStatusBarDocumentHandler::WriteStatusBarItem(
if ( nStyle & ItemStyle::DRAW_FLAT ) if ( nStyle & ItemStyle::DRAW_FLAT )
{ {
pList->AddAttribute( m_aXMLStatusBarNS + ATTRIBUTE_STYLE, pList->AddAttribute( m_aXMLStatusBarNS + ATTRIBUTE_STYLE,
m_aAttributeType,
ATTRIBUTE_STYLE_FLAT ); ATTRIBUTE_STYLE_FLAT );
} }
else if ( nStyle & ItemStyle::DRAW_OUT3D ) else if ( nStyle & ItemStyle::DRAW_OUT3D )
{ {
pList->AddAttribute( m_aXMLStatusBarNS + ATTRIBUTE_STYLE, pList->AddAttribute( m_aXMLStatusBarNS + ATTRIBUTE_STYLE,
m_aAttributeType,
ATTRIBUTE_STYLE_OUT ); ATTRIBUTE_STYLE_OUT );
} }
@@ -585,7 +575,6 @@ void OWriteStatusBarDocumentHandler::WriteStatusBarItem(
if ( nStyle & ItemStyle::AUTO_SIZE ) if ( nStyle & ItemStyle::AUTO_SIZE )
{ {
pList->AddAttribute( m_aXMLStatusBarNS + ATTRIBUTE_AUTOSIZE, pList->AddAttribute( m_aXMLStatusBarNS + ATTRIBUTE_AUTOSIZE,
m_aAttributeType,
ATTRIBUTE_BOOLEAN_TRUE ); ATTRIBUTE_BOOLEAN_TRUE );
} }
@@ -593,7 +582,6 @@ void OWriteStatusBarDocumentHandler::WriteStatusBarItem(
if ( nStyle & ItemStyle::OWNER_DRAW ) if ( nStyle & ItemStyle::OWNER_DRAW )
{ {
pList->AddAttribute( m_aXMLStatusBarNS + ATTRIBUTE_OWNERDRAW, pList->AddAttribute( m_aXMLStatusBarNS + ATTRIBUTE_OWNERDRAW,
m_aAttributeType,
ATTRIBUTE_BOOLEAN_TRUE ); ATTRIBUTE_BOOLEAN_TRUE );
} }
@@ -601,7 +589,6 @@ void OWriteStatusBarDocumentHandler::WriteStatusBarItem(
if ( nWidth > 0 ) if ( nWidth > 0 )
{ {
pList->AddAttribute( m_aXMLStatusBarNS + ATTRIBUTE_WIDTH, pList->AddAttribute( m_aXMLStatusBarNS + ATTRIBUTE_WIDTH,
m_aAttributeType,
OUString::number( nWidth ) ); OUString::number( nWidth ) );
} }
@@ -609,7 +596,6 @@ void OWriteStatusBarDocumentHandler::WriteStatusBarItem(
if ( nOffset != STATUSBAR_OFFSET ) if ( nOffset != STATUSBAR_OFFSET )
{ {
pList->AddAttribute( m_aXMLStatusBarNS + ATTRIBUTE_OFFSET, pList->AddAttribute( m_aXMLStatusBarNS + ATTRIBUTE_OFFSET,
m_aAttributeType,
OUString::number( nOffset ) ); OUString::number( nOffset ) );
} }
@@ -617,7 +603,6 @@ void OWriteStatusBarDocumentHandler::WriteStatusBarItem(
if ( !( nStyle & ItemStyle::MANDATORY ) ) if ( !( nStyle & ItemStyle::MANDATORY ) )
{ {
pList->AddAttribute( m_aXMLStatusBarNS + ATTRIBUTE_MANDATORY, pList->AddAttribute( m_aXMLStatusBarNS + ATTRIBUTE_MANDATORY,
m_aAttributeType,
ATTRIBUTE_BOOLEAN_FALSE ); ATTRIBUTE_BOOLEAN_FALSE );
} }
@@ -563,7 +563,6 @@ OWriteToolBoxDocumentHandler::OWriteToolBoxDocumentHandler(
m_rItemAccess( rItemAccess ) m_rItemAccess( rItemAccess )
{ {
m_xEmptyList = new ::comphelper::AttributeList; m_xEmptyList = new ::comphelper::AttributeList;
m_aAttributeType = ATTRIBUTE_TYPE_CDATA;
m_aXMLXlinkNS = XMLNS_XLINK_PREFIX; m_aXMLXlinkNS = XMLNS_XLINK_PREFIX;
m_aXMLToolbarNS = XMLNS_TOOLBAR_PREFIX; m_aXMLToolbarNS = XMLNS_TOOLBAR_PREFIX;
} }
@@ -600,16 +599,13 @@ void OWriteToolBoxDocumentHandler::WriteToolBoxDocument()
rtl::Reference<::comphelper::AttributeList> pList = new ::comphelper::AttributeList; rtl::Reference<::comphelper::AttributeList> pList = new ::comphelper::AttributeList;
pList->AddAttribute( ATTRIBUTE_XMLNS_TOOLBAR, pList->AddAttribute( ATTRIBUTE_XMLNS_TOOLBAR,
m_aAttributeType,
XMLNS_TOOLBAR ); XMLNS_TOOLBAR );
pList->AddAttribute( ATTRIBUTE_XMLNS_XLINK, pList->AddAttribute( ATTRIBUTE_XMLNS_XLINK,
m_aAttributeType,
XMLNS_XLINK ); XMLNS_XLINK );
if ( !aUIName.isEmpty() ) if ( !aUIName.isEmpty() )
pList->AddAttribute( m_aXMLToolbarNS + ATTRIBUTE_UINAME, pList->AddAttribute( m_aXMLToolbarNS + ATTRIBUTE_UINAME,
m_aAttributeType,
aUIName ); aUIName );
m_xWriteDocumentHandler->startElement( ELEMENT_NS_TOOLBAR, pList ); m_xWriteDocumentHandler->startElement( ELEMENT_NS_TOOLBAR, pList );
@@ -664,19 +660,17 @@ void OWriteToolBoxDocumentHandler::WriteToolBoxItem(
} }
// save required attribute (URL) // save required attribute (URL)
pList->AddAttribute( m_aAttributeURL, m_aAttributeType, rCommandURL ); pList->AddAttribute( m_aAttributeURL, rCommandURL );
if ( !rLabel.isEmpty() ) if ( !rLabel.isEmpty() )
{ {
pList->AddAttribute( m_aXMLToolbarNS + ATTRIBUTE_TEXT, pList->AddAttribute( m_aXMLToolbarNS + ATTRIBUTE_TEXT,
m_aAttributeType,
rLabel ); rLabel );
} }
if ( !bVisible ) if ( !bVisible )
{ {
pList->AddAttribute( m_aXMLToolbarNS + ATTRIBUTE_VISIBLE, pList->AddAttribute( m_aXMLToolbarNS + ATTRIBUTE_VISIBLE,
m_aAttributeType,
ATTRIBUTE_BOOLEAN_FALSE ); ATTRIBUTE_BOOLEAN_FALSE );
} }
@@ -695,7 +689,6 @@ void OWriteToolBoxDocumentHandler::WriteToolBoxItem(
} }
} }
pList->AddAttribute( m_aXMLToolbarNS + ATTRIBUTE_ITEMSTYLE, pList->AddAttribute( m_aXMLToolbarNS + ATTRIBUTE_ITEMSTYLE,
m_aAttributeType,
aValue.makeStringAndClear() ); aValue.makeStringAndClear() );
} }
@@ -52,10 +52,10 @@ void AcceleratorConfigurationWriter::flush()
rtl::Reference<::comphelper::AttributeList> pAttribs = new ::comphelper::AttributeList; rtl::Reference<::comphelper::AttributeList> pAttribs = new ::comphelper::AttributeList;
pAttribs->AddAttribute( pAttribs->AddAttribute(
"xmlns:accel", ATTRIBUTE_TYPE_CDATA, "xmlns:accel",
"http://openoffice.org/2001/accel"); "http://openoffice.org/2001/accel");
pAttribs->AddAttribute( pAttribs->AddAttribute(
"xmlns:xlink", ATTRIBUTE_TYPE_CDATA, "http://www.w3.org/1999/xlink"); "xmlns:xlink", "http://www.w3.org/1999/xlink");
// generate xml // generate xml
xExtendedCFG->startDocument(); xExtendedCFG->startDocument();
@@ -96,20 +96,20 @@ void AcceleratorConfigurationWriter::impl_ts_writeKeyCommandPair(const css::awt:
OUString sKey = KeyMapping::get().mapCodeToIdentifier(aKey.KeyCode); OUString sKey = KeyMapping::get().mapCodeToIdentifier(aKey.KeyCode);
// TODO check if key is empty! // TODO check if key is empty!
pAttribs->AddAttribute("accel:code", ATTRIBUTE_TYPE_CDATA, sKey ); pAttribs->AddAttribute("accel:code", sKey );
pAttribs->AddAttribute("xlink:href", ATTRIBUTE_TYPE_CDATA, sCommand); pAttribs->AddAttribute("xlink:href", sCommand);
if ((aKey.Modifiers & css::awt::KeyModifier::SHIFT) == css::awt::KeyModifier::SHIFT) 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) 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) 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) 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->ignorableWhitespace(OUString());
xConfig->startElement(AL_ELEMENT_ITEM, pAttribs); xConfig->startElement(AL_ELEMENT_ITEM, pAttribs);
@@ -48,7 +48,6 @@ constexpr OUStringLiteral ELEMENT_NS_ENTRY = u"image:entry";
#define ATTRIBUTE_MASKMODE "maskmode" #define ATTRIBUTE_MASKMODE "maskmode"
#define ATTRIBUTE_HIGHCONTRASTURL "highcontrasturl" #define ATTRIBUTE_HIGHCONTRASTURL "highcontrasturl"
#define ATTRIBUTE_HIGHCONTRASTMASKURL "highcontrastmaskurl" #define ATTRIBUTE_HIGHCONTRASTMASKURL "highcontrastmaskurl"
constexpr OUStringLiteral ATTRIBUTE_TYPE_CDATA = u"CDATA";
constexpr OUStringLiteral ATTRIBUTE_XMLNS_IMAGE = u"xmlns:image"; constexpr OUStringLiteral ATTRIBUTE_XMLNS_IMAGE = u"xmlns:image";
constexpr OUStringLiteral ATTRIBUTE_XMLNS_XLINK = u"xmlns:xlink"; constexpr OUStringLiteral ATTRIBUTE_XMLNS_XLINK = u"xmlns:xlink";
@@ -288,7 +287,6 @@ OWriteImagesDocumentHandler::OWriteImagesDocumentHandler(
m_xWriteDocumentHandler( rWriteDocumentHandler ) m_xWriteDocumentHandler( rWriteDocumentHandler )
{ {
m_xEmptyList = new ::comphelper::AttributeList; m_xEmptyList = new ::comphelper::AttributeList;
m_aAttributeType = ATTRIBUTE_TYPE_CDATA;
m_aXMLImageNS = XMLNS_IMAGE_PREFIX; m_aXMLImageNS = XMLNS_IMAGE_PREFIX;
m_aAttributeXlinkType = ATTRIBUTE_XLINK_TYPE; m_aAttributeXlinkType = ATTRIBUTE_XLINK_TYPE;
m_aAttributeValueSimple = ATTRIBUTE_XLINK_TYPE_VALUE; m_aAttributeValueSimple = ATTRIBUTE_XLINK_TYPE_VALUE;
@@ -313,11 +311,9 @@ void OWriteImagesDocumentHandler::WriteImagesDocument()
rtl::Reference<::comphelper::AttributeList> pList = new ::comphelper::AttributeList; rtl::Reference<::comphelper::AttributeList> pList = new ::comphelper::AttributeList;
pList->AddAttribute( ATTRIBUTE_XMLNS_IMAGE, pList->AddAttribute( ATTRIBUTE_XMLNS_IMAGE,
m_aAttributeType,
XMLNS_IMAGE ); XMLNS_IMAGE );
pList->AddAttribute( ATTRIBUTE_XMLNS_XLINK, pList->AddAttribute( ATTRIBUTE_XMLNS_XLINK,
m_aAttributeType,
XMLNS_XLINK ); XMLNS_XLINK );
m_xWriteDocumentHandler->startElement( ELEMENT_NS_IMAGESCONTAINER, pList ); m_xWriteDocumentHandler->startElement( ELEMENT_NS_IMAGESCONTAINER, pList );
@@ -339,7 +335,6 @@ void OWriteImagesDocumentHandler::WriteImageList( const ImageItemDescriptorList*
// save required attributes // save required attributes
pList->AddAttribute( m_aAttributeXlinkType, pList->AddAttribute( m_aAttributeXlinkType,
m_aAttributeType,
m_aAttributeValueSimple ); m_aAttributeValueSimple );
m_xWriteDocumentHandler->startElement( ELEMENT_NS_IMAGES, pList ); 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; rtl::Reference<::comphelper::AttributeList> pList = new ::comphelper::AttributeList;
pList->AddAttribute( m_aXMLImageNS + ATTRIBUTE_COMMAND, pList->AddAttribute( m_aXMLImageNS + ATTRIBUTE_COMMAND,
m_aAttributeType,
pImage->aCommandURL ); pImage->aCommandURL );
m_xWriteDocumentHandler->startElement( ELEMENT_NS_ENTRY, pList ); m_xWriteDocumentHandler->startElement( ELEMENT_NS_ENTRY, pList );
+17 -18
View File
@@ -22,7 +22,6 @@
#include <sal/config.h> #include <sal/config.h>
#include <memory>
#include <vector> #include <vector>
#include <com/sun/star/util/XCloneable.hpp> #include <com/sun/star/util/XCloneable.hpp>
@@ -33,32 +32,35 @@
namespace comphelper namespace comphelper
{ {
struct TagAttribute
{
OUString sName;
OUString sType;
OUString sValue;
};
class COMPHELPER_DLLPUBLIC AttributeList final : class COMPHELPER_DLLPUBLIC AttributeList final :
public ::cppu::WeakImplHelper<css::xml::sax::XAttributeList, css::util::XCloneable> public ::cppu::WeakImplHelper<css::xml::sax::XAttributeList, css::util::XCloneable>
{ {
struct TagAttribute
{
OUString sName;
OUString sValue;
};
std::vector<TagAttribute> mAttributes; std::vector<TagAttribute> mAttributes;
public: public:
AttributeList(); 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; virtual ~AttributeList() override;
// methods that are not contained in any interface // methods that are not contained in any interface
void AddAttribute(const OUString &sName , const OUString &sType , const OUString &sValue) void AddAttribute(const OUString &sName, const OUString &sValue);
{
mAttributes.push_back({sName, sType, sValue});
}
void Clear() void Clear()
{ {
mAttributes.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 // css::xml::sax::XAttributeList
virtual sal_Int16 SAL_CALL getLength() override virtual sal_Int16 SAL_CALL getLength() override
@@ -69,11 +71,8 @@ public:
{ {
return mAttributes[i].sName; return mAttributes[i].sName;
} }
virtual OUString SAL_CALL getTypeByIndex(sal_Int16 i) override virtual OUString SAL_CALL getTypeByIndex(sal_Int16) override { return "CDATA"; }
{ virtual OUString SAL_CALL getTypeByName(const OUString&) override { return "CDATA"; }
return mAttributes[i].sType;
}
virtual OUString SAL_CALL getTypeByName(const OUString& aName) override;
virtual OUString SAL_CALL getValueByIndex(sal_Int16 i) override virtual OUString SAL_CALL getValueByIndex(sal_Int16 i) override
{ {
return mAttributes[i].sValue; return mAttributes[i].sValue;
-74
View File
@@ -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: */
+4 -4
View File
@@ -41,7 +41,7 @@ namespace com::sun::star::drawing { class XShape; }
namespace com::sun::star::drawing { class XShapes; } namespace com::sun::star::drawing { class XShapes; }
class XMLTableExport; class XMLTableExport;
class SvXMLAttributeList; namespace comphelper { class AttributeList; }
class XMLPropertyHandlerFactory; class XMLPropertyHandlerFactory;
// shape export features are bits used for the nFeature // 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 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 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 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 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 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 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 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 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 ); 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, const css::uno::Reference < css::drawing::XShape >& xShape,
XMLShapeExportFlags nFeatures = SEF_DEFAULT, XMLShapeExportFlags nFeatures = SEF_DEFAULT,
css::awt::Point* pRefPoint = nullptr, 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 // This method collects all automatic styles for the shapes inside the given XShapes collection
+2 -2
View File
@@ -30,7 +30,7 @@
class SvXMLExportPropertyMapper; class SvXMLExportPropertyMapper;
class SvXMLNamespaceMap; class SvXMLNamespaceMap;
class SvXMLAutoStylePoolP_Impl; class SvXMLAutoStylePoolP_Impl;
class SvXMLAttributeList; namespace comphelper { class AttributeList; }
class SvXMLExport; class SvXMLExport;
class SvXMLUnitConverter; class SvXMLUnitConverter;
struct XMLPropertyState; struct XMLPropertyState;
@@ -56,7 +56,7 @@ class XMLOFF_DLLPUBLIC SvXMLAutoStylePoolP : public salhelper::SimpleReferenceOb
protected: protected:
virtual void exportStyleAttributes( virtual void exportStyleAttributes(
SvXMLAttributeList& rAttrList, comphelper::AttributeList& rAttrList,
XmlStyleFamily nFamily, XmlStyleFamily nFamily,
const ::std::vector< XMLPropertyState >& rProperties, const ::std::vector< XMLPropertyState >& rProperties,
const SvXMLExportPropertyMapper& rPropExp, const SvXMLExportPropertyMapper& rPropExp,
+3 -3
View File
@@ -25,7 +25,6 @@
#include <sal/types.h> #include <sal/types.h>
#include <rtl/ustring.hxx> #include <rtl/ustring.hxx>
#include <xmloff/attrlist.hxx>
#include <xmloff/txtparae.hxx> #include <xmloff/txtparae.hxx>
#include <xmloff/formlayerexport.hxx> #include <xmloff/formlayerexport.hxx>
#include <xmloff/xmlnumfe.hxx> #include <xmloff/xmlnumfe.hxx>
@@ -45,6 +44,7 @@
#include <unotools/securityoptions.hxx> #include <unotools/securityoptions.hxx>
#include <xmloff/XMLPageExport.hxx> #include <xmloff/XMLPageExport.hxx>
#include <comphelper/attributelist.hxx>
#include <comphelper/servicehelper.hxx> #include <comphelper/servicehelper.hxx>
#include <cppuhelper/implbase.hxx> #include <cppuhelper/implbase.hxx>
#include <tools/fldunit.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::beans::XPropertySet > mxExportInfo;
css::uno::Reference< css::lang::XEventListener > mxEventListener; 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 msOrigFileName; // the original URL
OUString msFilterName; OUString msFilterName;
@@ -371,7 +371,7 @@ public:
css::xml::sax::XAttributeList >& xAttrList ); css::xml::sax::XAttributeList >& xAttrList );
// Get common attribute list as implementation or interface. // 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; } css::uno::Reference< css::xml::sax::XAttributeList > GetXAttrList() const { return mxAttrList; }
// Get document handler. This methods are not const, because the // Get document handler. This methods are not const, because the
+4 -4
View File
@@ -48,7 +48,7 @@ namespace o3tl
} }
class SvXMLUnitConverter; class SvXMLUnitConverter;
class SvXMLAttributeList; namespace comphelper { class AttributeList; }
class SvXMLNamespaceMap; class SvXMLNamespaceMap;
class SvXMLExport; class SvXMLExport;
@@ -79,14 +79,14 @@ protected:
/** fills the given attribute list with the items in the given set */ /** fills the given attribute list with the items in the given set */
void _exportXML( sal_uInt16 nPropType, sal_uInt16& rPropTypeFlags, void _exportXML( sal_uInt16 nPropType, sal_uInt16& rPropTypeFlags,
SvXMLAttributeList& rAttrList, comphelper::AttributeList& rAttrList,
const ::std::vector< XMLPropertyState >& rProperties, const ::std::vector< XMLPropertyState >& rProperties,
const SvXMLUnitConverter& rUnitConverter, const SvXMLUnitConverter& rUnitConverter,
const SvXMLNamespaceMap& rNamespaceMap, const SvXMLNamespaceMap& rNamespaceMap,
std::vector<sal_uInt16>* pIndexArray, std::vector<sal_uInt16>* pIndexArray,
sal_Int32 nPropMapStartIdx, sal_Int32 nPropMapEndIdx ) const; sal_Int32 nPropMapStartIdx, sal_Int32 nPropMapEndIdx ) const;
void _exportXML( SvXMLAttributeList& rAttrList, void _exportXML( comphelper::AttributeList& rAttrList,
const XMLPropertyState& rProperty, const XMLPropertyState& rProperty,
const SvXMLUnitConverter& rUnitConverter, const SvXMLUnitConverter& rUnitConverter,
const SvXMLNamespaceMap& rNamespaceMap, const SvXMLNamespaceMap& rNamespaceMap,
@@ -169,7 +169,7 @@ public:
/** this method is called for every item that has the /** this method is called for every item that has the
MID_FLAG_SPECIAL_ITEM_EXPORT flag set */ MID_FLAG_SPECIAL_ITEM_EXPORT flag set */
virtual void handleSpecialItem( virtual void handleSpecialItem(
SvXMLAttributeList& rAttrList, comphelper::AttributeList& rAttrList,
const XMLPropertyState& rProperty, const XMLPropertyState& rProperty,
const SvXMLUnitConverter& rUnitConverter, const SvXMLUnitConverter& rUnitConverter,
const SvXMLNamespaceMap& rNamespaceMap, const SvXMLNamespaceMap& rNamespaceMap,
@@ -58,10 +58,10 @@
* Document object of the xml filter framework. * Document object of the xml filter framework.
************************************************************************/ ************************************************************************/
#include "xfsaxattrlist.hxx" #include "xfsaxattrlist.hxx"
#include <xmloff/attrlist.hxx> #include <comphelper/attributelist.hxx>
XFSaxAttrList::XFSaxAttrList() XFSaxAttrList::XFSaxAttrList()
: m_xSvAttrList(new SvXMLAttributeList()) : m_xSvAttrList(new comphelper::AttributeList())
{ {
} }
@@ -60,9 +60,17 @@
#ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_XFILTER_XFSAXATTRLIST_HXX #ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_XFILTER_XFSAXATTRLIST_HXX
#define 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 <xfilter/ixfattrlist.hxx>
#include <rtl/ref.hxx> #include <rtl/ref.hxx>
#include <xmloff/attrlist.hxx>
namespace comphelper
{
class AttributeList;
}
class XFSaxAttrList : public IXFAttrList class XFSaxAttrList : public IXFAttrList
{ {
@@ -82,7 +90,7 @@ public:
friend class XFSaxStream; friend class XFSaxStream;
private: private:
rtl::Reference<SvXMLAttributeList> m_xSvAttrList; rtl::Reference<comphelper::AttributeList> m_xSvAttrList;
}; };
#endif //XFSAXATTRLIST_INC #endif //XFSAXATTRLIST_INC
@@ -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_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_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 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 ELEMENT_FILE_ENTRY = u"manifest:file-entry";
inline constexpr OUStringLiteral ATTRIBUTE_FULL_PATH = u"manifest:full-path"; inline constexpr OUStringLiteral ATTRIBUTE_FULL_PATH = u"manifest:full-path";
+14 -20
View File
@@ -141,7 +141,6 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con
{ {
// oasis format // oasis format
pRootAttrList->AddAttribute ( ATTRIBUTE_XMLNS, pRootAttrList->AddAttribute ( ATTRIBUTE_XMLNS,
ATTRIBUTE_CDATA,
MANIFEST_OASIS_NAMESPACE ); MANIFEST_OASIS_NAMESPACE );
bAcceptNonemptyVersion = true; bAcceptNonemptyVersion = true;
if ( aDocVersion.compareTo( ODFVER_012_TEXT ) >= 0 ) 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 // this is ODF12 or later generation, let encrypted
// streams contain start-key-generation entry // streams contain start-key-generation entry
bStoreStartKeyGeneration = true; bStoreStartKeyGeneration = true;
pRootAttrList->AddAttribute ( ATTRIBUTE_VERSION, ATTRIBUTE_CDATA, aDocVersion ); pRootAttrList->AddAttribute ( ATTRIBUTE_VERSION, aDocVersion );
// plus gpg4libre extensions - loext NS for that // plus gpg4libre extensions - loext NS for that
pRootAttrList->AddAttribute ( ATTRIBUTE_XMLNS_LOEXT, pRootAttrList->AddAttribute ( ATTRIBUTE_XMLNS_LOEXT,
ATTRIBUTE_CDATA,
MANIFEST_LOEXT_NAMESPACE ); 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 // even if it is no SO6 format the namespace must be specified
// thus SO6 format is used as default one // thus SO6 format is used as default one
pRootAttrList->AddAttribute ( ATTRIBUTE_XMLNS, pRootAttrList->AddAttribute ( ATTRIBUTE_XMLNS,
ATTRIBUTE_CDATA,
MANIFEST_NAMESPACE ); MANIFEST_NAMESPACE );
bProvideDTD = true; bProvideDTD = true;
@@ -230,7 +227,6 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con
// TODO: the algorithm should rather be configurable // TODO: the algorithm should rather be configurable
pNewAttrList->AddAttribute( pNewAttrList->AddAttribute(
isODF13 ? OUString(ATTRIBUTE_ALGORITHM13) : OUString(ATTRIBUTE_ALGORITHM), isODF13 ? OUString(ATTRIBUTE_ALGORITHM13) : OUString(ATTRIBUTE_ALGORITHM),
ATTRIBUTE_CDATA,
"http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p" ); "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p" );
xHandler->startElement(isODF13 ? OUString(ELEMENT_ENCRYPTIONMETHOD13) : OUString(ELEMENT_ENCRYPTIONMETHOD), pNewAttrList); xHandler->startElement(isODF13 ? OUString(ELEMENT_ENCRYPTIONMETHOD13) : OUString(ELEMENT_ENCRYPTIONMETHOD), pNewAttrList);
xHandler->endElement(isODF13 ? OUString(ELEMENT_ENCRYPTIONMETHOD13) : OUString(ELEMENT_ENCRYPTIONMETHOD)); 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 ) if (rValue.Name == sMediaTypeProperty )
{ {
rValue.Value >>= aString; rValue.Value >>= aString;
pAttrList->AddAttribute ( ATTRIBUTE_MEDIA_TYPE, ATTRIBUTE_CDATA, aString ); pAttrList->AddAttribute ( ATTRIBUTE_MEDIA_TYPE, aString );
} }
else if (rValue.Name == sVersionProperty ) else if (rValue.Name == sVersionProperty )
{ {
rValue.Value >>= aString; rValue.Value >>= aString;
// the version is stored only if it is not empty // the version is stored only if it is not empty
if ( bAcceptNonemptyVersion && !aString.isEmpty() ) if ( bAcceptNonemptyVersion && !aString.isEmpty() )
pAttrList->AddAttribute ( ATTRIBUTE_VERSION, ATTRIBUTE_CDATA, aString ); pAttrList->AddAttribute ( ATTRIBUTE_VERSION, aString );
} }
else if (rValue.Name == sFullPathProperty ) else if (rValue.Name == sFullPathProperty )
{ {
rValue.Value >>= aString; rValue.Value >>= aString;
pAttrList->AddAttribute ( ATTRIBUTE_FULL_PATH, ATTRIBUTE_CDATA, aString ); pAttrList->AddAttribute ( ATTRIBUTE_FULL_PATH, aString );
} }
else if (rValue.Name == sSizeProperty ) else if (rValue.Name == sSizeProperty )
{ {
sal_Int64 nSize = 0; sal_Int64 nSize = 0;
rValue.Value >>= nSize; rValue.Value >>= nSize;
pAttrList->AddAttribute ( ATTRIBUTE_SIZE, ATTRIBUTE_CDATA, OUString::number( nSize ) ); pAttrList->AddAttribute ( ATTRIBUTE_SIZE, OUString::number( nSize ) );
} }
else if (rValue.Name == sInitialisationVectorProperty ) else if (rValue.Name == sInitialisationVectorProperty )
pVector = &rValue.Value; pVector = &rValue.Value;
@@ -361,10 +357,10 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con
else else
throw uno::RuntimeException( THROW_WHERE "Unexpected digest algorithm is provided!" ); 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; *pDigest >>= aSequence;
::comphelper::Base64::encode(aBuffer, 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); xHandler->startElement( ELEMENT_ENCRYPTION_DATA , pNewAttrList);
@@ -392,11 +388,11 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con
else else
throw uno::RuntimeException( THROW_WHERE "Unexpected encryption algorithm is provided!" ); 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; *pVector >>= aSequence;
::comphelper::Base64::encode(aBuffer, 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->ignorableWhitespace ( sWhiteSpace );
xHandler->startElement( ELEMENT_ALGORITHM , pNewAttrList); xHandler->startElement( ELEMENT_ALGORITHM , pNewAttrList);
@@ -427,8 +423,8 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con
else else
throw uno::RuntimeException( THROW_WHERE "Unexpected start key algorithm is provided!" ); throw uno::RuntimeException( THROW_WHERE "Unexpected start key algorithm is provided!" );
pNewAttrList->AddAttribute ( ATTRIBUTE_START_KEY_GENERATION_NAME, ATTRIBUTE_CDATA, sStartKeyAlg ); pNewAttrList->AddAttribute ( ATTRIBUTE_START_KEY_GENERATION_NAME, sStartKeyAlg );
pNewAttrList->AddAttribute ( ATTRIBUTE_KEY_SIZE, ATTRIBUTE_CDATA, sStartKeySize ); pNewAttrList->AddAttribute ( ATTRIBUTE_KEY_SIZE, sStartKeySize );
xHandler->ignorableWhitespace ( sWhiteSpace ); xHandler->ignorableWhitespace ( sWhiteSpace );
xHandler->startElement( ELEMENT_START_KEY_GENERATION , pNewAttrList); xHandler->startElement( ELEMENT_START_KEY_GENERATION , pNewAttrList);
@@ -442,7 +438,6 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con
if (pKeyInfoProperty) if (pKeyInfoProperty)
{ {
pNewAttrList->AddAttribute(ATTRIBUTE_KEY_DERIVATION_NAME, pNewAttrList->AddAttribute(ATTRIBUTE_KEY_DERIVATION_NAME,
ATTRIBUTE_CDATA,
sPGP_Name); sPGP_Name);
// no start-key-generation needed, our session key has // no start-key-generation needed, our session key has
// max size already // max size already
@@ -451,23 +446,22 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > con
else else
{ {
pNewAttrList->AddAttribute(ATTRIBUTE_KEY_DERIVATION_NAME, pNewAttrList->AddAttribute(ATTRIBUTE_KEY_DERIVATION_NAME,
ATTRIBUTE_CDATA,
sPBKDF2_Name); sPBKDF2_Name);
if (bStoreStartKeyGeneration) if (bStoreStartKeyGeneration)
{ {
aBuffer.append(nDerivedKeySize); aBuffer.append(nDerivedKeySize);
pNewAttrList->AddAttribute(ATTRIBUTE_KEY_SIZE, ATTRIBUTE_CDATA, aBuffer.makeStringAndClear()); pNewAttrList->AddAttribute ( ATTRIBUTE_KEY_SIZE, aBuffer.makeStringAndClear() );
} }
sal_Int32 nCount = 0; sal_Int32 nCount = 0;
*pIterationCount >>= nCount; *pIterationCount >>= nCount;
aBuffer.append(nCount); aBuffer.append(nCount);
pNewAttrList->AddAttribute(ATTRIBUTE_ITERATION_COUNT, ATTRIBUTE_CDATA, aBuffer.makeStringAndClear()); pNewAttrList->AddAttribute ( ATTRIBUTE_ITERATION_COUNT, aBuffer.makeStringAndClear() );
*pSalt >>= aSequence; *pSalt >>= aSequence;
::comphelper::Base64::encode(aBuffer, aSequence); ::comphelper::Base64::encode(aBuffer, aSequence);
pNewAttrList->AddAttribute(ATTRIBUTE_SALT, ATTRIBUTE_CDATA, aBuffer.makeStringAndClear()); pNewAttrList->AddAttribute ( ATTRIBUTE_SALT, aBuffer.makeStringAndClear() );
} }
xHandler->ignorableWhitespace(sWhiteSpace); xHandler->ignorableWhitespace(sWhiteSpace);
@@ -93,7 +93,6 @@
#include <unotools/saveopt.hxx> #include <unotools/saveopt.hxx>
#include <unotools/unotoolsdllapi.h> #include <unotools/unotoolsdllapi.h>
#include <xmloff/ProgressBarHelper.hxx> #include <xmloff/ProgressBarHelper.hxx>
#include <xmloff/attrlist.hxx>
#include <xmloff/dllapi.h> #include <xmloff/dllapi.h>
#include <xmloff/families.hxx> #include <xmloff/families.hxx>
#include <xmloff/maptype.hxx> #include <xmloff/maptype.hxx>
@@ -27,7 +27,7 @@ namespace rptxml
using namespace ::com::sun::star::xml::sax; using namespace ::com::sun::star::xml::sax;
void OXMLAutoStylePoolP::exportStyleAttributes( void OXMLAutoStylePoolP::exportStyleAttributes(
SvXMLAttributeList& rAttrList, comphelper::AttributeList& rAttrList,
XmlStyleFamily nFamily, XmlStyleFamily nFamily,
const ::std::vector< XMLPropertyState >& rProperties, const ::std::vector< XMLPropertyState >& rProperties,
const SvXMLExportPropertyMapper& rPropExp const SvXMLExportPropertyMapper& rPropExp
@@ -30,7 +30,7 @@ namespace rptxml
ORptExport& rORptExport; ORptExport& rORptExport;
virtual void exportStyleAttributes( virtual void exportStyleAttributes(
SvXMLAttributeList& rAttrList, comphelper::AttributeList& rAttrList,
XmlStyleFamily nFamily, XmlStyleFamily nFamily,
const ::std::vector< XMLPropertyState >& rProperties, const ::std::vector< XMLPropertyState >& rProperties,
const SvXMLExportPropertyMapper& rPropExp, const SvXMLExportPropertyMapper& rPropExp,
+2 -2
View File
@@ -136,7 +136,7 @@ namespace rptxml
/** this method is called for every item that has the /** this method is called for every item that has the
MID_FLAG_SPECIAL_ITEM_EXPORT flag set */ MID_FLAG_SPECIAL_ITEM_EXPORT flag set */
virtual void handleSpecialItem( virtual void handleSpecialItem(
SvXMLAttributeList& /*rAttrList*/, comphelper::AttributeList& /*rAttrList*/,
const XMLPropertyState& /*rProperty*/, const XMLPropertyState& /*rProperty*/,
const SvXMLUnitConverter& /*rUnitConverter*/, const SvXMLUnitConverter& /*rUnitConverter*/,
const SvXMLNamespaceMap& /*rNamespaceMap*/, const SvXMLNamespaceMap& /*rNamespaceMap*/,
@@ -992,7 +992,7 @@ bool ORptExport::exportFormula(enum ::xmloff::token::XMLTokenEnum eName,const OU
return bRet; 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); Reference<XPropertySet> xFind(_xProp);
TPropertyStyleMap::const_iterator aFind = m_aAutoStyleNames.find(xFind); TPropertyStyleMap::const_iterator aFind = m_aAutoStyleNames.find(xFind);
+1 -1
View File
@@ -109,7 +109,7 @@ private:
void exportMasterDetailFields(const Reference<XReportComponent>& _xReportComponent); void exportMasterDetailFields(const Reference<XReportComponent>& _xReportComponent);
void exportComponent(const Reference<XReportComponent>& _xReportComponent); void exportComponent(const Reference<XReportComponent>& _xReportComponent);
void exportGroup(const Reference<XReportDefinition>& _xReportDefinition,sal_Int32 _nPos,bool _bExportAutoStyle = false); 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 exportSection(const Reference<XSection>& _xProp,bool bHeader = false);
void exportContainer(const Reference< XSection>& _xSection); void exportContainer(const Reference< XSection>& _xSection);
void exportShapes(const Reference< XSection>& _xSection,bool _bAddParagraph = true); void exportShapes(const Reference< XSection>& _xSection,bool _bAddParagraph = true);
@@ -23,11 +23,11 @@
#include <com/sun/star/chart2/data/XDatabaseDataProvider.hpp> #include <com/sun/star/chart2/data/XDatabaseDataProvider.hpp>
#include <com/sun/star/chart/XComplexDescriptionAccess.hpp> #include <com/sun/star/chart/XComplexDescriptionAccess.hpp>
#include <com/sun/star/reflection/ProxyFactory.hpp> #include <com/sun/star/reflection/ProxyFactory.hpp>
#include <comphelper/attributelist.hxx>
#include <comphelper/sequenceashashmap.hxx> #include <comphelper/sequenceashashmap.hxx>
#include <comphelper/documentconstants.hxx> #include <comphelper/documentconstants.hxx>
#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/supportsservice.hxx>
#include <utility> #include <utility>
#include <xmloff/attrlist.hxx>
#include <xmloff/xmltoken.hxx> #include <xmloff/xmltoken.hxx>
#include <xmloff/xmlement.hxx> #include <xmloff/xmlement.hxx>
#include <xmloff/xmluconv.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) 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); OUString sCellAddress = pList->getValueByName(_sName);
const sal_Int32 nPos = sCellAddress.lastIndexOf('$'); const sal_Int32 nPos = sCellAddress.lastIndexOf('$');
if ( nPos != -1 ) if ( nPos != -1 )
@@ -122,7 +122,7 @@ void SAL_CALL ExportDocumentHandler::startElement(const OUString & _sName, const
bool bExport = true; bool bExport = true;
if ( _sName == "office:chart" ) if ( _sName == "office:chart" )
{ {
rtl::Reference<SvXMLAttributeList> pList = new SvXMLAttributeList(); rtl::Reference<comphelper::AttributeList> pList = new comphelper::AttributeList();
OUStringBuffer sValue; OUStringBuffer sValue;
static const SvXMLEnumMapEntry<sal_uInt16> aXML_CommandTypeEnumMap[] = 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); const OUString sTableCalc = lcl_createAttribute(XML_NP_TABLE,XML_CALCULATION_SETTINGS);
m_xDelegatee->startElement(sTableCalc,nullptr); 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"); pList->AddAttribute(lcl_createAttribute(XML_NP_TABLE,XML_DATE_VALUE),"1899-12-30");
const OUString sNullDate = lcl_createAttribute(XML_NP_TABLE,XML_NULL_DATE); 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; bExport = false;
else if ( _sName == "chart:plot-area" ) 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"); pList->RemoveAttribute("table:cell-range-address");
} }
else if ( _sName == "chart:categories" ) 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" ) 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)); static OUString s_sValue(lcl_createAttribute(XML_NP_OFFICE,XML_VALUE));
pList->RemoveAttribute(s_sValue); pList->RemoveAttribute(s_sValue);
} }
@@ -345,7 +345,7 @@ void ExportDocumentHandler::exportTableRows()
const OUString sFormulaAttrib( lcl_createAttribute(XML_NP_RPT,XML_FORMULA) ); const OUString sFormulaAttrib( lcl_createAttribute(XML_NP_RPT,XML_FORMULA) );
static constexpr OUStringLiteral s_sFloat = u"float"; 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"); pCellAtt->AddAttribute(sValueType, "string");
bool bRemoveString = true; bool bRemoveString = true;
@@ -370,7 +370,7 @@ void ExportDocumentHandler::exportTableRows()
for(const auto& rColumn : std::as_const(m_aColumns)) for(const auto& rColumn : std::as_const(m_aColumns))
{ {
OUString sFormula = "field:[" + rColumn + "]"; OUString sFormula = "field:[" + rColumn + "]";
rtl::Reference<SvXMLAttributeList> pList = new SvXMLAttributeList(); rtl::Reference<comphelper::AttributeList> pList = new comphelper::AttributeList();
pList->AddAttribute(sFormulaAttrib,sFormula); pList->AddAttribute(sFormulaAttrib,sFormula);
m_xDelegatee->startElement(sCell,pCellAtt); m_xDelegatee->startElement(sCell,pCellAtt);
@@ -26,11 +26,11 @@
#include <com/sun/star/chart/XComplexDescriptionAccess.hpp> #include <com/sun/star/chart/XComplexDescriptionAccess.hpp>
#include <com/sun/star/chart/ChartDataRowSource.hpp> #include <com/sun/star/chart/ChartDataRowSource.hpp>
#include <com/sun/star/reflection/ProxyFactory.hpp> #include <com/sun/star/reflection/ProxyFactory.hpp>
#include <comphelper/attributelist.hxx>
#include <comphelper/sequenceashashmap.hxx> #include <comphelper/sequenceashashmap.hxx>
#include <comphelper/namedvaluecollection.hxx> #include <comphelper/namedvaluecollection.hxx>
#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/supportsservice.hxx>
#include <utility> #include <utility>
#include <xmloff/attrlist.hxx>
#include <xmloff/xmltoken.hxx> #include <xmloff/xmltoken.hxx>
#include <xmloff/xmlement.hxx> #include <xmloff/xmlement.hxx>
#include <xmloff/xmluconv.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; xNewAttribs = pList;
pList->AppendAttributeList(_xAttrList); pList->AppendAttributeList(_xAttrList);
pList->AddAttribute("table:cell-range-address","local-table.$A$1:.$Z$65536"); pList->AddAttribute("table:cell-range-address","local-table.$A$1:.$Z$65536");
-3
View File
@@ -142,8 +142,6 @@ struct Entity
}; };
constexpr OUStringLiteral gsCDATA = u"CDATA";
class SaxExpatParser_Impl class SaxExpatParser_Impl
{ {
public: // module scope public: // module scope
@@ -711,7 +709,6 @@ void SaxExpatParser_Impl::callbackStartElement( void *pvThis ,
assert(awAttributes[i+1]); assert(awAttributes[i+1]);
pImpl->rAttrList->AddAttribute( pImpl->rAttrList->AddAttribute(
XML_CHAR_TO_OUSTRING( awAttributes[i] ) , XML_CHAR_TO_OUSTRING( awAttributes[i] ) ,
gsCDATA, // expat doesn't know types
XML_CHAR_TO_OUSTRING( awAttributes[i+1] ) ); XML_CHAR_TO_OUSTRING( awAttributes[i+1] ) );
i +=2; i +=2;
} }
+3 -3
View File
@@ -75,7 +75,7 @@ void NamespaceHandler::addNSDeclAttributes( rtl::Reference < comphelper::Attribu
sDecl = "xmlns"; sDecl = "xmlns";
else else
sDecl = "xmlns:" + rPrefix; sDecl = "xmlns:" + rPrefix;
rAttrList->AddAttribute( sDecl, "CDATA", rNamespaceURI ); rAttrList->AddAttribute( sDecl, rNamespaceURI );
} }
m_aNamespaceDefines.clear(); m_aNamespaceDefines.clear();
} }
@@ -233,7 +233,7 @@ void SAL_CALL CallbackDocumentHandler::startUnknownElement( const OUString& /*Na
if ( !rAttrNamespacePrefix.isEmpty() ) if ( !rAttrNamespacePrefix.isEmpty() )
sAttrName = rAttrNamespacePrefix + aNamespaceSeparator + sAttrName; sAttrName = rAttrNamespacePrefix + aNamespaceSeparator + sAttrName;
rAttrList->AddAttribute( sAttrName, "CDATA", rAttrValue ); rAttrList->AddAttribute( sAttrName, rAttrValue );
} }
const Sequence< xml::Attribute > unknownAttribs = Attribs->getUnknownAttributes(); 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& rAttrValue = rAttr.Value;
const OUString& rAttrName = rAttr.Name; const OUString& rAttrName = rAttr.Name;
rAttrList->AddAttribute( rAttrName, "CDATA", rAttrValue ); rAttrList->AddAttribute( rAttrName, rAttrValue );
} }
m_xDocumentHandler->startElement( Name, rAttrList ); m_xDocumentHandler->startElement( Name, rAttrList );
} }
+3 -3
View File
@@ -3407,7 +3407,7 @@ void ScXMLExport::ExportShape(const uno::Reference < drawing::XShape >& xShape,
if ( !sRanges.isEmpty() ) if ( !sRanges.isEmpty() )
{ {
bIsChart = true; bIsChart = true;
rtl::Reference<SvXMLAttributeList> pAttrList = new SvXMLAttributeList(); rtl::Reference<comphelper::AttributeList> pAttrList = new comphelper::AttributeList();
pAttrList->AddAttribute( pAttrList->AddAttribute(
GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_DRAW, GetXMLToken( XML_NOTIFY_ON_UPDATE_OF_RANGES ) ), sRanges ); GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_DRAW, GetXMLToken( XML_NOTIFY_ON_UPDATE_OF_RANGES ) ), sRanges );
GetShapeExport()->exportShape( xShape, SEF_DEFAULT, pPoint, pAttrList.get() ); GetShapeExport()->exportShape( xShape, SEF_DEFAULT, pPoint, pAttrList.get() );
@@ -3432,7 +3432,7 @@ void ScXMLExport::ExportShape(const uno::Reference < drawing::XShape >& xShape,
bIsChart = true; bIsChart = true;
uno::Sequence< OUString > aRepresentations( uno::Sequence< OUString > aRepresentations(
xReceiver->getUsedRangeRepresentations()); xReceiver->getUsedRangeRepresentations());
rtl::Reference<SvXMLAttributeList> pAttrList; rtl::Reference<comphelper::AttributeList> pAttrList;
try try
{ {
if (aRepresentations.hasElements()) if (aRepresentations.hasElements())
@@ -3442,7 +3442,7 @@ void ScXMLExport::ExportShape(const uno::Reference < drawing::XShape >& xShape,
// load (when the chart is not yet loaded) // load (when the chart is not yet loaded)
uno::Reference< chart2::data::XRangeXMLConversion > xRangeConverter( xChartDoc->getDataProvider(), uno::UNO_QUERY ); uno::Reference< chart2::data::XRangeXMLConversion > xRangeConverter( xChartDoc->getDataProvider(), uno::UNO_QUERY );
sRanges = lcl_RangeSequenceToString( aRepresentations, xRangeConverter ); sRanges = lcl_RangeSequenceToString( aRepresentations, xRangeConverter );
pAttrList = new SvXMLAttributeList(); pAttrList = new comphelper::AttributeList();
pAttrList->AddAttribute( pAttrList->AddAttribute(
GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_DRAW, GetXMLToken(XML_NOTIFY_ON_UPDATE_OF_RANGES) ), sRanges ); GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_DRAW, GetXMLToken(XML_NOTIFY_ON_UPDATE_OF_RANGES) ), sRanges );
} }
+4 -4
View File
@@ -511,7 +511,7 @@ void ScXMLCellExportPropertyMapper::ContextFilter(
/** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set */ /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set */
void ScXMLCellExportPropertyMapper::handleSpecialItem( void ScXMLCellExportPropertyMapper::handleSpecialItem(
SvXMLAttributeList& /* rAttrList */, comphelper::AttributeList& /* rAttrList */,
const XMLPropertyState& /* rProperty */, const XMLPropertyState& /* rProperty */,
const SvXMLUnitConverter& /* rUnitConverter */, const SvXMLUnitConverter& /* rUnitConverter */,
const SvXMLNamespaceMap& /* rNamespaceMap */, 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 */ /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set */
void ScXMLColumnExportPropertyMapper::handleSpecialItem( void ScXMLColumnExportPropertyMapper::handleSpecialItem(
SvXMLAttributeList& /* rAttrList */, comphelper::AttributeList& /* rAttrList */,
const XMLPropertyState& /* rProperty */, const XMLPropertyState& /* rProperty */,
const SvXMLUnitConverter& /* rUnitConverter */, const SvXMLUnitConverter& /* rUnitConverter */,
const SvXMLNamespaceMap& /* rNamespaceMap */, 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 */ /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set */
void ScXMLTableExportPropertyMapper::handleSpecialItem( void ScXMLTableExportPropertyMapper::handleSpecialItem(
SvXMLAttributeList& /* rAttrList */, comphelper::AttributeList& /* rAttrList */,
const XMLPropertyState& /* rProperty */, const XMLPropertyState& /* rProperty */,
const SvXMLUnitConverter& /* rUnitConverter */, const SvXMLUnitConverter& /* rUnitConverter */,
const SvXMLNamespaceMap& /* rNamespaceMap */, const SvXMLNamespaceMap& /* rNamespaceMap */,
@@ -608,7 +608,7 @@ void ScXMLTableExportPropertyMapper::handleSpecialItem(
} }
void ScXMLAutoStylePoolP::exportStyleAttributes( void ScXMLAutoStylePoolP::exportStyleAttributes(
SvXMLAttributeList& rAttrList, comphelper::AttributeList& rAttrList,
XmlStyleFamily nFamily, XmlStyleFamily nFamily,
const ::std::vector< XMLPropertyState >& rProperties, const ::std::vector< XMLPropertyState >& rProperties,
const SvXMLExportPropertyMapper& rPropExp const SvXMLExportPropertyMapper& rPropExp
+4 -4
View File
@@ -120,7 +120,7 @@ public:
/** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set */ /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set */
virtual void handleSpecialItem( virtual void handleSpecialItem(
SvXMLAttributeList& rAttrList, comphelper::AttributeList& rAttrList,
const XMLPropertyState& rProperty, const XMLPropertyState& rProperty,
const SvXMLUnitConverter& rUnitConverter, const SvXMLUnitConverter& rUnitConverter,
const SvXMLNamespaceMap& rNamespaceMap, 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 */ /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set */
virtual void handleSpecialItem( virtual void handleSpecialItem(
SvXMLAttributeList& rAttrList, comphelper::AttributeList& rAttrList,
const XMLPropertyState& rProperty, const XMLPropertyState& rProperty,
const SvXMLUnitConverter& rUnitConverter, const SvXMLUnitConverter& rUnitConverter,
const SvXMLNamespaceMap& rNamespaceMap, 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 */ /** this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set */
virtual void handleSpecialItem( virtual void handleSpecialItem(
SvXMLAttributeList& rAttrList, comphelper::AttributeList& rAttrList,
const XMLPropertyState& rProperty, const XMLPropertyState& rProperty,
const SvXMLUnitConverter& rUnitConverter, const SvXMLUnitConverter& rUnitConverter,
const SvXMLNamespaceMap& rNamespaceMap, const SvXMLNamespaceMap& rNamespaceMap,
@@ -182,7 +182,7 @@ class ScXMLAutoStylePoolP : public SvXMLAutoStylePoolP
ScXMLExport& rScXMLExport; ScXMLExport& rScXMLExport;
virtual void exportStyleAttributes( virtual void exportStyleAttributes(
SvXMLAttributeList& rAttrList, comphelper::AttributeList& rAttrList,
XmlStyleFamily nFamily, XmlStyleFamily nFamily,
const ::std::vector< XMLPropertyState >& rProperties, const ::std::vector< XMLPropertyState >& rProperties,
const SvXMLExportPropertyMapper& rPropExp, const SvXMLExportPropertyMapper& rPropExp,
+2 -4
View File
@@ -58,14 +58,12 @@ void DocTemplLocaleHelper::WriteGroupLocalizationSequence( const uno::Reference<
xWriterHandler->setOutputStream( xOutStream ); xWriterHandler->setOutputStream( xOutStream );
static const OUStringLiteral aCDATAString( u"CDATA" );
static const OUStringLiteral aWhiteSpace( u" " ); static const OUStringLiteral aWhiteSpace( u" " );
// write the namespace // write the namespace
rtl::Reference<::comphelper::AttributeList> pRootAttrList = new ::comphelper::AttributeList; rtl::Reference<::comphelper::AttributeList> pRootAttrList = new ::comphelper::AttributeList;
pRootAttrList->AddAttribute( pRootAttrList->AddAttribute(
"xmlns:groupuinames", "xmlns:groupuinames",
aCDATAString,
"http://openoffice.org/2006/groupuinames" ); "http://openoffice.org/2006/groupuinames" );
xWriterHandler->startDocument(); xWriterHandler->startDocument();
@@ -74,8 +72,8 @@ void DocTemplLocaleHelper::WriteGroupLocalizationSequence( const uno::Reference<
for (const auto & i : aSequence) for (const auto & i : aSequence)
{ {
rtl::Reference<::comphelper::AttributeList> pAttrList = new ::comphelper::AttributeList; rtl::Reference<::comphelper::AttributeList> pAttrList = new ::comphelper::AttributeList;
pAttrList->AddAttribute( g_sNameAttr, aCDATAString, i.First ); pAttrList->AddAttribute( g_sNameAttr, i.First );
pAttrList->AddAttribute( g_sUINameAttr, aCDATAString, i.Second ); pAttrList->AddAttribute( g_sUINameAttr, i.Second );
xWriterHandler->startElement( g_sGroupElement, pAttrList ); xWriterHandler->startElement( g_sGroupElement, pAttrList );
xWriterHandler->ignorableWhitespace( aWhiteSpace ); xWriterHandler->ignorableWhitespace( aWhiteSpace );
+1 -2
View File
@@ -47,7 +47,6 @@
#include <xmloff/xmlnamespace.hxx> #include <xmloff/xmlnamespace.hxx>
#include <xmloff/xmltoken.hxx> #include <xmloff/xmltoken.hxx>
#include <xmloff/namespacemap.hxx> #include <xmloff/namespacemap.hxx>
#include <xmloff/attrlist.hxx>
#include <comphelper/genericpropertyset.hxx> #include <comphelper/genericpropertyset.hxx>
#include <comphelper/servicehelper.hxx> #include <comphelper/servicehelper.hxx>
#include <comphelper/propertysetinfo.hxx> #include <comphelper/propertysetinfo.hxx>
@@ -394,7 +393,7 @@ ErrCode SmXMLExport::exportDoc(enum XMLTokenEnum eClass)
addChaffWhenEncryptedStorage(); addChaffWhenEncryptedStorage();
/*Add xmlns line*/ /*Add xmlns line*/
SvXMLAttributeList& rList = GetAttrList(); comphelper::AttributeList& rList = GetAttrList();
// make use of a default namespace // 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) 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)
+3 -4
View File
@@ -26,7 +26,6 @@
#include <svl/itemset.hxx> #include <svl/itemset.hxx>
#include <utility> #include <utility>
#include <xmloff/xmluconv.hxx> #include <xmloff/xmluconv.hxx>
#include <xmloff/attrlist.hxx>
#include <xmloff/namespacemap.hxx> #include <xmloff/namespacemap.hxx>
#include <xmloff/xmlnamespace.hxx> #include <xmloff/xmlnamespace.hxx>
#include <xmloff/prhdlfac.hxx> #include <xmloff/prhdlfac.hxx>
@@ -62,7 +61,7 @@ using uno::Any;
// fills the given attribute list with the items in the given set // fills the given attribute list with the items in the given set
void SvXMLExportItemMapper::exportXML( const SvXMLExport& rExport, void SvXMLExportItemMapper::exportXML( const SvXMLExport& rExport,
SvXMLAttributeList& rAttrList, comphelper::AttributeList& rAttrList,
const SfxItemSet& rSet, const SfxItemSet& rSet,
const SvXMLUnitConverter& rUnitConverter, const SvXMLUnitConverter& rUnitConverter,
const SvXMLNamespaceMap& rNamespaceMap, const SvXMLNamespaceMap& rNamespaceMap,
@@ -106,7 +105,7 @@ void SvXMLExportItemMapper::exportXML( const SvXMLExport& rExport,
} }
void SvXMLExportItemMapper::exportXML(const SvXMLExport&, void SvXMLExportItemMapper::exportXML(const SvXMLExport&,
SvXMLAttributeList& rAttrList, comphelper::AttributeList& rAttrList,
const SfxPoolItem& rItem, const SfxPoolItem& rItem,
const SvXMLItemMapEntry& rEntry, const SvXMLItemMapEntry& rEntry,
const SvXMLUnitConverter& rUnitConverter, const SvXMLUnitConverter& rUnitConverter,
@@ -319,7 +318,7 @@ void SvXMLExportItemMapper::exportXML( SvXMLExport& rExport,
/** this method is called for every item that has the /** this method is called for every item that has the
MID_SW_FLAG_SPECIAL_ITEM_EXPORT flag set */ MID_SW_FLAG_SPECIAL_ITEM_EXPORT flag set */
void SvXMLExportItemMapper::handleSpecialItem( SvXMLAttributeList& /*rAttrList*/, void SvXMLExportItemMapper::handleSpecialItem( comphelper::AttributeList& /*rAttrList*/,
const SvXMLItemMapEntry& /*rEntry*/, const SvXMLItemMapEntry& /*rEntry*/,
const SfxPoolItem& /*rItem*/, const SfxPoolItem& /*rItem*/,
const SvXMLUnitConverter& /*rUnitConverter*/, const SvXMLUnitConverter& /*rUnitConverter*/,
+4 -4
View File
@@ -27,7 +27,7 @@
class SvXMLUnitConverter; class SvXMLUnitConverter;
class SfxPoolItem; class SfxPoolItem;
class SfxItemSet; class SfxItemSet;
class SvXMLAttributeList; namespace comphelper { class AttributeList; }
class SvXMLNamespaceMap; class SvXMLNamespaceMap;
class SvXMLExport; class SvXMLExport;
@@ -38,14 +38,14 @@ class SvXMLExportItemMapper
protected: protected:
/** fills the given attribute list with the items in the given set */ /** fills the given attribute list with the items in the given set */
void exportXML( const SvXMLExport& rExport, void exportXML( const SvXMLExport& rExport,
SvXMLAttributeList& rAttrList, comphelper::AttributeList& rAttrList,
const SfxItemSet& rSet, const SfxItemSet& rSet,
const SvXMLUnitConverter& rUnitConverter, const SvXMLUnitConverter& rUnitConverter,
const SvXMLNamespaceMap& rNamespaceMap, const SvXMLNamespaceMap& rNamespaceMap,
std::vector<sal_uInt16> *pIndexArray ) const; std::vector<sal_uInt16> *pIndexArray ) const;
void exportXML( const SvXMLExport& rExport, void exportXML( const SvXMLExport& rExport,
SvXMLAttributeList& rAttrList, comphelper::AttributeList& rAttrList,
const SfxPoolItem& rItem, const SfxPoolItem& rItem,
const SvXMLItemMapEntry &rEntry, const SvXMLItemMapEntry &rEntry,
const SvXMLUnitConverter& rUnitConverter, const SvXMLUnitConverter& rUnitConverter,
@@ -70,7 +70,7 @@ public:
/** this method is called for every item that has the /** this method is called for every item that has the
MID_SW_FLAG_SPECIAL_ITEM_EXPORT flag set */ MID_SW_FLAG_SPECIAL_ITEM_EXPORT flag set */
virtual void handleSpecialItem( SvXMLAttributeList& rAttrList, virtual void handleSpecialItem( comphelper::AttributeList& rAttrList,
const SvXMLItemMapEntry& rEntry, const SvXMLItemMapEntry& rEntry,
const SfxPoolItem& rItem, const SfxPoolItem& rItem,
const SvXMLUnitConverter& rUnitConverter, const SvXMLUnitConverter& rUnitConverter,
+2 -3
View File
@@ -19,7 +19,6 @@
#include <com/sun/star/text/XTextDocument.hpp> #include <com/sun/star/text/XTextDocument.hpp>
#include <xmloff/xmlnamespace.hxx> #include <xmloff/xmlnamespace.hxx>
#include <xmloff/attrlist.hxx>
#include "xmlexpit.hxx" #include "xmlexpit.hxx"
#include <xmloff/namespacemap.hxx> #include <xmloff/namespacemap.hxx>
#include <xmloff/XMLTextListAutoStylePool.hxx> #include <xmloff/XMLTextListAutoStylePool.hxx>
@@ -270,7 +269,7 @@ class SwXMLAutoStylePoolP : public SvXMLAutoStylePoolP
protected: protected:
virtual void exportStyleAttributes( virtual void exportStyleAttributes(
SvXMLAttributeList& rAttrList, comphelper::AttributeList& rAttrList,
XmlStyleFamily nFamily, XmlStyleFamily nFamily,
const std::vector< XMLPropertyState >& rProperties, const std::vector< XMLPropertyState >& rProperties,
const SvXMLExportPropertyMapper& rPropExp const SvXMLExportPropertyMapper& rPropExp
@@ -285,7 +284,7 @@ public:
} }
void SwXMLAutoStylePoolP::exportStyleAttributes( void SwXMLAutoStylePoolP::exportStyleAttributes(
SvXMLAttributeList& rAttrList, comphelper::AttributeList& rAttrList,
XmlStyleFamily nFamily, XmlStyleFamily nFamily,
const std::vector< XMLPropertyState >& rProperties, const std::vector< XMLPropertyState >& rProperties,
const SvXMLExportPropertyMapper& rPropExp const SvXMLExportPropertyMapper& rPropExp
+4 -4
View File
@@ -52,7 +52,7 @@ protected:
static void AddAttribute( sal_uInt16 nPrefix, enum XMLTokenEnum eLName, static void AddAttribute( sal_uInt16 nPrefix, enum XMLTokenEnum eLName,
const OUString& rValue, const OUString& rValue,
const SvXMLNamespaceMap& rNamespaceMap, const SvXMLNamespaceMap& rNamespaceMap,
SvXMLAttributeList& rAttrList ); comphelper::AttributeList& rAttrList );
public: public:
@@ -60,7 +60,7 @@ public:
SvXMLItemMapEntriesRef rMapEntries, SvXMLItemMapEntriesRef rMapEntries,
SwXMLExport& rExp ); SwXMLExport& rExp );
virtual void handleSpecialItem( SvXMLAttributeList& rAttrList, virtual void handleSpecialItem( comphelper::AttributeList& rAttrList,
const SvXMLItemMapEntry& rEntry, const SvXMLItemMapEntry& rEntry,
const SfxPoolItem& rItem, const SfxPoolItem& rItem,
const SvXMLUnitConverter& rUnitConverter, const SvXMLUnitConverter& rUnitConverter,
@@ -89,7 +89,7 @@ void SwXMLTableItemMapper_Impl::AddAttribute( sal_uInt16 nPrefix,
enum XMLTokenEnum eLName, enum XMLTokenEnum eLName,
const OUString& rValue, const OUString& rValue,
const SvXMLNamespaceMap& rNamespaceMap, const SvXMLNamespaceMap& rNamespaceMap,
SvXMLAttributeList& rAttrList ) comphelper::AttributeList& rAttrList )
{ {
OUString sName( rNamespaceMap.GetQNameByKey( nPrefix, OUString sName( rNamespaceMap.GetQNameByKey( nPrefix,
GetXMLToken(eLName) ) ); GetXMLToken(eLName) ) );
@@ -97,7 +97,7 @@ void SwXMLTableItemMapper_Impl::AddAttribute( sal_uInt16 nPrefix,
} }
void SwXMLTableItemMapper_Impl::handleSpecialItem( void SwXMLTableItemMapper_Impl::handleSpecialItem(
SvXMLAttributeList& rAttrList, comphelper::AttributeList& rAttrList,
const SvXMLItemMapEntry& rEntry, const SvXMLItemMapEntry& rEntry,
const SfxPoolItem& rItem, const SfxPoolItem& rItem,
const SvXMLUnitConverter& rUnitConverter, const SvXMLUnitConverter& rUnitConverter,
+5 -5
View File
@@ -1598,7 +1598,7 @@ auto CurlProcessor::PropFind(
xWriter->setOutputStream(xRequestOutStream); xWriter->setOutputStream(xRequestOutStream);
xWriter->startDocument(); xWriter->startDocument();
rtl::Reference<::comphelper::AttributeList> const pAttrList(new ::comphelper::AttributeList); rtl::Reference<::comphelper::AttributeList> const pAttrList(new ::comphelper::AttributeList);
pAttrList->AddAttribute("xmlns", "CDATA", "DAV:"); pAttrList->AddAttribute("xmlns", "DAV:");
xWriter->startElement("propfind", pAttrList); xWriter->startElement("propfind", pAttrList);
if (o_pResourceInfos) if (o_pResourceInfos)
{ {
@@ -1620,7 +1620,7 @@ auto CurlProcessor::PropFind(
SerfPropName name; SerfPropName name;
DAVProperties::createSerfPropName(rName, name); DAVProperties::createSerfPropName(rName, name);
pAttrList->Clear(); 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->startElement(OUString::createFromAscii(name.name), pAttrList);
xWriter->endElement(OUString::createFromAscii(name.name)); xWriter->endElement(OUString::createFromAscii(name.name));
} }
@@ -1738,7 +1738,7 @@ auto CurlSession::PROPPATCH(OUString const& rURIReference,
xWriter->setOutputStream(xRequestOutStream); xWriter->setOutputStream(xRequestOutStream);
xWriter->startDocument(); xWriter->startDocument();
rtl::Reference<::comphelper::AttributeList> const pAttrList(new ::comphelper::AttributeList); rtl::Reference<::comphelper::AttributeList> const pAttrList(new ::comphelper::AttributeList);
pAttrList->AddAttribute("xmlns", "CDATA", "DAV:"); pAttrList->AddAttribute("xmlns", "DAV:");
xWriter->startElement("propertyupdate", pAttrList); xWriter->startElement("propertyupdate", pAttrList);
for (ProppatchValue const& rPropValue : rValues) for (ProppatchValue const& rPropValue : rValues)
{ {
@@ -1750,7 +1750,7 @@ auto CurlSession::PROPPATCH(OUString const& rURIReference,
SerfPropName name; SerfPropName name;
DAVProperties::createSerfPropName(rPropValue.name, name); DAVProperties::createSerfPropName(rPropValue.name, name);
pAttrList->Clear(); 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->startElement(OUString::createFromAscii(name.name), pAttrList);
if (rPropValue.operation == PROPSET) if (rPropValue.operation == PROPSET)
{ {
@@ -2205,7 +2205,7 @@ auto CurlSession::LOCK(OUString const& rURIReference, ucb::Lock /*const*/& rLock
xWriter->setOutputStream(xRequestOutStream); xWriter->setOutputStream(xRequestOutStream);
xWriter->startDocument(); xWriter->startDocument();
rtl::Reference<::comphelper::AttributeList> const pAttrList(new ::comphelper::AttributeList); rtl::Reference<::comphelper::AttributeList> const pAttrList(new ::comphelper::AttributeList);
pAttrList->AddAttribute("xmlns", "CDATA", "DAV:"); pAttrList->AddAttribute("xmlns", "DAV:");
xWriter->startElement("lockinfo", pAttrList); xWriter->startElement("lockinfo", pAttrList);
xWriter->startElement("lockscope", nullptr); xWriter->startElement("lockscope", nullptr);
switch (rLock.Scope) switch (rLock.Scope)
+2 -3
View File
@@ -58,7 +58,6 @@ namespace DOM
if (!i_xHandler.is()) throw RuntimeException(); if (!i_xHandler.is()) throw RuntimeException();
rtl::Reference<comphelper::AttributeList> pAttrs = rtl::Reference<comphelper::AttributeList> pAttrs =
new comphelper::AttributeList(); new comphelper::AttributeList();
OUString type = "";
// add namespace definitions to attributes // add namespace definitions to attributes
for (xmlNsPtr pNs = m_aNodePtr->nsDef; pNs != nullptr; pNs = pNs->next) { for (xmlNsPtr pNs = m_aNodePtr->nsDef; pNs != nullptr; pNs = pNs->next) {
const xmlChar *pPrefix = pNs->prefix ? pNs->prefix : reinterpret_cast<const xmlChar*>(""); const xmlChar *pPrefix = pNs->prefix ? pNs->prefix : reinterpret_cast<const xmlChar*>("");
@@ -71,7 +70,7 @@ namespace DOM
OUString val(reinterpret_cast<const char*>(pHref), OUString val(reinterpret_cast<const char*>(pHref),
strlen(reinterpret_cast<const char*>(pHref)), strlen(reinterpret_cast<const char*>(pHref)),
RTL_TEXTENCODING_UTF8); RTL_TEXTENCODING_UTF8);
pAttrs->AddAttribute(name, type, val); pAttrs->AddAttribute(name, val);
} }
// add attributes // add attributes
for (xmlAttrPtr pAttr = m_aNodePtr->properties; for (xmlAttrPtr pAttr = m_aNodePtr->properties;
@@ -84,7 +83,7 @@ namespace DOM
? pNode->getLocalName() ? pNode->getLocalName()
: prefix + ":" + pNode->getLocalName(); : prefix + ":" + pNode->getLocalName();
OUString val = pNode->getNodeValue(); OUString val = pNode->getNodeValue();
pAttrs->AddAttribute(name, type, val); pAttrs->AddAttribute(name, val);
} }
OUString prefix = getPrefix(); OUString prefix = getPrefix();
OUString name = (prefix.isEmpty()) OUString name = (prefix.isEmpty())
@@ -14,8 +14,7 @@
#include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp> #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
#include <com/sun/star/xml/sax/XAttributeList.hpp> #include <com/sun/star/xml/sax/XAttributeList.hpp>
#include <comphelper/attributelist.hxx>
#include <xmloff/attrlist.hxx>
#include <xmloff/xmlimp.hxx> #include <xmloff/xmlimp.hxx>
namespace writerperfect namespace writerperfect
@@ -126,7 +125,7 @@ void DocumentHandler::endDocument() { mxHandler->endDocument(); }
void DocumentHandler::startElement(const char* psName, void DocumentHandler::startElement(const char* psName,
const librevenge::RVNGPropertyList& xPropList) const librevenge::RVNGPropertyList& xPropList)
{ {
rtl::Reference<SvXMLAttributeList> pAttrList = new SvXMLAttributeList(); rtl::Reference<comphelper::AttributeList> pAttrList = new comphelper::AttributeList();
librevenge::RVNGPropertyList::Iter i(xPropList); librevenge::RVNGPropertyList::Iter i(xPropList);
for (i.rewind(); i.next();) for (i.rewind(); i.next();)
{ {
+2 -2
View File
@@ -18,9 +18,9 @@
#include <com/sun/star/embed/XHierarchicalStorageAccess.hpp> #include <com/sun/star/embed/XHierarchicalStorageAccess.hpp>
#include <sal/log.hxx> #include <sal/log.hxx>
#include <comphelper/attributelist.hxx>
#include <comphelper/storagehelper.hxx> #include <comphelper/storagehelper.hxx>
#include <unotools/mediadescriptor.hxx> #include <unotools/mediadescriptor.hxx>
#include <xmloff/attrlist.hxx>
using namespace com::sun::star; using namespace com::sun::star;
@@ -80,7 +80,7 @@ void EPUBPackage::openElement(const char* pName, const librevenge::RVNGPropertyL
{ {
assert(mxOutputWriter.is()); assert(mxOutputWriter.is());
rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); rtl::Reference<comphelper::AttributeList> pAttributeList(new comphelper::AttributeList());
librevenge::RVNGPropertyList::Iter it(rAttributes); librevenge::RVNGPropertyList::Iter it(rAttributes);
for (it.rewind(); it.next();) for (it.rewind(); it.next();)
-1
View File
@@ -120,7 +120,6 @@ $(eval $(call gb_Library_add_exception_objects,xo,\
xmloff/source/core/XMLBasicExportFilter \ xmloff/source/core/XMLBasicExportFilter \
xmloff/source/core/XMLEmbeddedObjectExportFilter \ xmloff/source/core/XMLEmbeddedObjectExportFilter \
xmloff/source/core/XMLEmbeddedObjectImportContext \ xmloff/source/core/XMLEmbeddedObjectImportContext \
xmloff/source/core/attrlist \
xmloff/source/core/i18nmap \ xmloff/source/core/i18nmap \
xmloff/source/core/namespacemap \ xmloff/source/core/namespacemap \
xmloff/source/core/unoatrcn \ xmloff/source/core/unoatrcn \
+1 -1
View File
@@ -27,7 +27,7 @@ class SchXMLAutoStylePoolP final : public SvXMLAutoStylePoolP
SchXMLExport& mrSchXMLExport; SchXMLExport& mrSchXMLExport;
virtual void exportStyleAttributes( virtual void exportStyleAttributes(
SvXMLAttributeList& rAttrList, comphelper::AttributeList& rAttrList,
XmlStyleFamily nFamily, XmlStyleFamily nFamily,
const ::std::vector< XMLPropertyState >& rProperties, const ::std::vector< XMLPropertyState >& rProperties,
const SvXMLExportPropertyMapper& rPropExp const SvXMLExportPropertyMapper& rPropExp
+1 -1
View File
@@ -64,7 +64,7 @@ private:
/// this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set /// this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set
virtual void handleSpecialItem( virtual void handleSpecialItem(
SvXMLAttributeList& rAttrList, const XMLPropertyState& rProperty, comphelper::AttributeList& rAttrList, const XMLPropertyState& rProperty,
const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap, const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap,
const ::std::vector< XMLPropertyState > *pProperties, const ::std::vector< XMLPropertyState > *pProperties,
sal_uInt32 nIdx ) const override; sal_uInt32 nIdx ) const override;
-1
View File
@@ -219,7 +219,6 @@
#include <xmloff/ProgressBarHelper.hxx> #include <xmloff/ProgressBarHelper.hxx>
#include <xmloff/XMLBase64ImportContext.hxx> #include <xmloff/XMLBase64ImportContext.hxx>
#include <xmloff/XMLEventsImportContext.hxx> #include <xmloff/XMLEventsImportContext.hxx>
#include <xmloff/attrlist.hxx>
#include <xmloff/dllapi.h> #include <xmloff/dllapi.h>
#include <xmloff/families.hxx> #include <xmloff/families.hxx>
#include <xmloff/maptype.hxx> #include <xmloff/maptype.hxx>
-1
View File
@@ -56,7 +56,6 @@
#include <comphelper/diagnose_ex.hxx> #include <comphelper/diagnose_ex.hxx>
#endif // PCH_LEVEL >= 3 #endif // PCH_LEVEL >= 3
#if PCH_LEVEL >= 4 #if PCH_LEVEL >= 4
#include <xmloff/attrlist.hxx>
#include <xmloff/namespacemap.hxx> #include <xmloff/namespacemap.hxx>
#include <xmloff/xmlimp.hxx> #include <xmloff/xmlimp.hxx>
#include <xmloff/xmlnamespace.hxx> #include <xmloff/xmlnamespace.hxx>
+2 -2
View File
@@ -31,7 +31,7 @@
#include <propimp0.hxx> #include <propimp0.hxx>
#include <xmloff/EnumPropertyHdl.hxx> #include <xmloff/EnumPropertyHdl.hxx>
#include <xmloff/attrlist.hxx> #include <comphelper/attributelist.hxx>
#include <xmloff/namespacemap.hxx> #include <xmloff/namespacemap.hxx>
#include <xmloff/xmluconv.hxx> #include <xmloff/xmluconv.hxx>
#include <xmloff/shapeimport.hxx> #include <xmloff/shapeimport.hxx>
@@ -683,7 +683,7 @@ OUString convertRange( const OUString & rRange, const uno::Reference< chart2::XC
} }
void XMLChartExportPropertyMapper::handleSpecialItem( void XMLChartExportPropertyMapper::handleSpecialItem(
SvXMLAttributeList& rAttrList, const XMLPropertyState& rProperty, comphelper::AttributeList& rAttrList, const XMLPropertyState& rProperty,
const SvXMLUnitConverter& rUnitConverter, const SvXMLUnitConverter& rUnitConverter,
const SvXMLNamespaceMap& rNamespaceMap, const SvXMLNamespaceMap& rNamespaceMap,
const ::std::vector< XMLPropertyState > *pProperties, const ::std::vector< XMLPropertyState > *pProperties,
+1 -1
View File
@@ -33,7 +33,7 @@ SchXMLAutoStylePoolP::~SchXMLAutoStylePoolP()
{} {}
void SchXMLAutoStylePoolP::exportStyleAttributes( void SchXMLAutoStylePoolP::exportStyleAttributes(
SvXMLAttributeList& rAttrList, comphelper::AttributeList& rAttrList,
XmlStyleFamily nFamily, XmlStyleFamily nFamily,
const ::std::vector< XMLPropertyState >& rProperties, const ::std::vector< XMLPropertyState >& rProperties,
const SvXMLExportPropertyMapper& rPropExp const SvXMLExportPropertyMapper& rPropExp
@@ -32,7 +32,6 @@
#include <xmloff/xmlimp.hxx> #include <xmloff/xmlimp.hxx>
#include <xmloff/xmlnamespace.hxx> #include <xmloff/xmlnamespace.hxx>
#include <xmloff/xmltoken.hxx> #include <xmloff/xmltoken.hxx>
#include <xmloff/attrlist.hxx>
#include <xmloff/XMLFilterServiceNames.h> #include <xmloff/XMLFilterServiceNames.h>
#include <XMLEmbeddedObjectImportContext.hxx> #include <XMLEmbeddedObjectImportContext.hxx>
-187
View File
@@ -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: */
+3 -4
View File
@@ -46,7 +46,6 @@
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
#include <comphelper/propertysetinfo.hxx> #include <comphelper/propertysetinfo.hxx>
#include <comphelper/propertyvalue.hxx> #include <comphelper/propertyvalue.hxx>
#include <xmloff/attrlist.hxx>
#include <xmloff/namespacemap.hxx> #include <xmloff/namespacemap.hxx>
#include <xmloff/xmluconv.hxx> #include <xmloff/xmluconv.hxx>
#include <xmloff/xmlnamespace.hxx> #include <xmloff/xmlnamespace.hxx>
@@ -441,7 +440,7 @@ SvXMLExport::SvXMLExport(
const enum XMLTokenEnum eClass, SvXMLExportFlags nExportFlags ) const enum XMLTokenEnum eClass, SvXMLExportFlags nExportFlags )
: mpImpl( new SvXMLExport_Impl ), : mpImpl( new SvXMLExport_Impl ),
m_xContext(xContext), m_implementationName(std::move(implementationName)), m_xContext(xContext), m_implementationName(std::move(implementationName)),
mxAttrList( new SvXMLAttributeList ), mxAttrList( new comphelper::AttributeList ),
mpNamespaceMap( new SvXMLNamespaceMap ), mpNamespaceMap( new SvXMLNamespaceMap ),
mpAuthorIDs( new SvtSecurityMapPersonalInfo ), mpAuthorIDs( new SvtSecurityMapPersonalInfo ),
maUnitConv(xContext, util::MeasureUnit::MM_100TH, eDefaultMeasureUnit, getSaneDefaultVersion()), maUnitConv(xContext, util::MeasureUnit::MM_100TH, eDefaultMeasureUnit, getSaneDefaultVersion()),
@@ -466,7 +465,7 @@ SvXMLExport::SvXMLExport(
m_xContext(xContext), m_implementationName(std::move(implementationName)), m_xContext(xContext), m_implementationName(std::move(implementationName)),
mxHandler( rHandler ), mxHandler( rHandler ),
mxExtHandler( rHandler, uno::UNO_QUERY ), mxExtHandler( rHandler, uno::UNO_QUERY ),
mxAttrList( new SvXMLAttributeList ), mxAttrList( new comphelper::AttributeList ),
msOrigFileName(std::move( fileName )), msOrigFileName(std::move( fileName )),
mpNamespaceMap( new SvXMLNamespaceMap ), mpNamespaceMap( new SvXMLNamespaceMap ),
mpAuthorIDs( new SvtSecurityMapPersonalInfo ), mpAuthorIDs( new SvtSecurityMapPersonalInfo ),
@@ -500,7 +499,7 @@ SvXMLExport::SvXMLExport(
mxHandler( rHandler ), mxHandler( rHandler ),
mxExtHandler( rHandler, uno::UNO_QUERY ), mxExtHandler( rHandler, uno::UNO_QUERY ),
mxNumberFormatsSupplier (rModel, uno::UNO_QUERY), mxNumberFormatsSupplier (rModel, uno::UNO_QUERY),
mxAttrList( new SvXMLAttributeList ), mxAttrList( new comphelper::AttributeList ),
msOrigFileName(std::move( fileName )), msOrigFileName(std::move( fileName )),
mpNamespaceMap( new SvXMLNamespaceMap ), mpNamespaceMap( new SvXMLNamespaceMap ),
mpAuthorIDs( new SvtSecurityMapPersonalInfo ), mpAuthorIDs( new SvtSecurityMapPersonalInfo ),
+1 -1
View File
@@ -2124,7 +2124,7 @@ void SvXMLImportFastNamespaceHandler::addNSDeclAttributes( rtl::Reference < comp
sDecl = "xmlns"; sDecl = "xmlns";
else else
sDecl = "xmlns:" + rPrefix; sDecl = "xmlns:" + rPrefix;
rAttrList->AddAttribute( sDecl, "CDATA", rNamespaceURI ); rAttrList->AddAttribute( sDecl, rNamespaceURI );
} }
m_aNamespaceDefines.clear(); m_aNamespaceDefines.clear();
} }
+1 -1
View File
@@ -1688,7 +1688,7 @@ void XMLShapeExportPropertyMapper::ContextFilter(
} }
void XMLShapeExportPropertyMapper::handleSpecialItem( void XMLShapeExportPropertyMapper::handleSpecialItem(
SvXMLAttributeList& rAttrList, comphelper::AttributeList& rAttrList,
const XMLPropertyState& rProperty, const XMLPropertyState& rProperty,
const SvXMLUnitConverter& rUnitConverter, const SvXMLUnitConverter& rUnitConverter,
const SvXMLNamespaceMap& rNamespaceMap, const SvXMLNamespaceMap& rNamespaceMap,
+1 -1
View File
@@ -97,7 +97,7 @@ public:
void SetAutoStyles( bool bIsInAutoStyles ) { mbIsInAutoStyles = bIsInAutoStyles; } void SetAutoStyles( bool bIsInAutoStyles ) { mbIsInAutoStyles = bIsInAutoStyles; }
virtual void handleSpecialItem( virtual void handleSpecialItem(
SvXMLAttributeList& rAttrList, comphelper::AttributeList& rAttrList,
const XMLPropertyState& rProperty, const XMLPropertyState& rProperty,
const SvXMLUnitConverter& rUnitConverter, const SvXMLUnitConverter& rUnitConverter,
const SvXMLNamespaceMap& rNamespaceMap, const SvXMLNamespaceMap& rNamespaceMap,
+4 -4
View File
@@ -559,7 +559,7 @@ namespace
void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape, void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape,
XMLShapeExportFlags nFeatures /* = SEF_DEFAULT */, XMLShapeExportFlags nFeatures /* = SEF_DEFAULT */,
css::awt::Point* pRefPoint /* = NULL */, css::awt::Point* pRefPoint /* = NULL */,
SvXMLAttributeList* pAttrList /* = NULL */ ) comphelper::AttributeList* pAttrList /* = NULL */ )
{ {
SAL_INFO("xmloff", xShape->getShapeType()); SAL_INFO("xmloff", xShape->getShapeType());
if( maCurrentShapesIter == maShapesInfos.end() ) 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 // Need to stash the attributes that are pre-loaded for the shape export
// (otherwise they will become attributes of the draw:a element) // (otherwise they will become attributes of the draw:a element)
uno::Reference<xml::sax::XAttributeList> xSaveAttribs( uno::Reference<xml::sax::XAttributeList> xSaveAttribs(
new SvXMLAttributeList(GetExport().GetAttrList())); new comphelper::AttributeList(GetExport().GetAttrList()));
GetExport().ClearAttrList(); GetExport().ClearAttrList();
if( xSet.is() && (GetExport().GetModelType() == SvtModuleOptions::EFactory::DRAW) ) if( xSet.is() && (GetExport().GetModelType() == SvtModuleOptions::EFactory::DRAW) )
{ {
@@ -2576,7 +2576,7 @@ void XMLShapeExport::ImpExportGraphicObjectShape(
void XMLShapeExport::ImpExportChartShape( void XMLShapeExport::ImpExportChartShape(
const uno::Reference< drawing::XShape >& xShape, const uno::Reference< drawing::XShape >& xShape,
XmlShapeType eShapeType, XMLShapeExportFlags nFeatures, awt::Point* pRefPoint, XmlShapeType eShapeType, XMLShapeExportFlags nFeatures, awt::Point* pRefPoint,
SvXMLAttributeList* pAttrList ) comphelper::AttributeList* pAttrList )
{ {
ImpExportOLE2Shape( xShape, eShapeType, nFeatures, pRefPoint, pAttrList ); ImpExportOLE2Shape( xShape, eShapeType, nFeatures, pRefPoint, pAttrList );
} }
@@ -2920,7 +2920,7 @@ void XMLShapeExport::ImpExportMeasureShape(
void XMLShapeExport::ImpExportOLE2Shape( void XMLShapeExport::ImpExportOLE2Shape(
const uno::Reference< drawing::XShape >& xShape, const uno::Reference< drawing::XShape >& xShape,
XmlShapeType eShapeType, XMLShapeExportFlags nFeatures /* = SEF_DEFAULT */, awt::Point* pRefPoint /* = NULL */, 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< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
uno::Reference< container::XNamed > xNamed(xShape, uno::UNO_QUERY); uno::Reference< container::XNamed > xNamed(xShape, uno::UNO_QUERY);
-1
View File
@@ -35,7 +35,6 @@
#include <xmloff/xmlnamespace.hxx> #include <xmloff/xmlnamespace.hxx>
#include <xmloff/xmltoken.hxx> #include <xmloff/xmltoken.hxx>
#include <xmloff/table/XMLTableImport.hxx> #include <xmloff/table/XMLTableImport.hxx>
#include <xmloff/attrlist.hxx>
#include "eventimp.hxx" #include "eventimp.hxx"
#include "ximpshap.hxx" #include "ximpshap.hxx"
#include "sdpropls.hxx" #include "sdpropls.hxx"
-1
View File
@@ -78,7 +78,6 @@
#include <xmloff/xmlerror.hxx> #include <xmloff/xmlerror.hxx>
#include <xmloff/table/XMLTableImport.hxx> #include <xmloff/table/XMLTableImport.hxx>
#include <xmloff/ProgressBarHelper.hxx> #include <xmloff/ProgressBarHelper.hxx>
#include <xmloff/attrlist.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/matrix/b2dhommatrix.hxx>
#include <com/sun/star/drawing/XEnhancedCustomShapeDefaulter.hpp> #include <com/sun/star/drawing/XEnhancedCustomShapeDefaulter.hpp>
#include <com/sun/star/container/XChild.hpp> #include <com/sun/star/container/XChild.hpp>
+1 -1
View File
@@ -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, const SvXMLNamespaceMap& _rNamespaceMap, const ::std::vector< XMLPropertyState >* _pProperties,
sal_uInt32 _nIdx ) const sal_uInt32 _nIdx ) const
{ {
+1 -1
View File
@@ -37,7 +37,7 @@ namespace xmloff
explicit OFormComponentStyleExportMapper( const rtl::Reference< XMLPropertySetMapper >& _rMapper ); explicit OFormComponentStyleExportMapper( const rtl::Reference< XMLPropertySetMapper >& _rMapper );
void handleSpecialItem( void handleSpecialItem(
SvXMLAttributeList& _rAttrList, comphelper::AttributeList& _rAttrList,
const XMLPropertyState& _rProperty, const XMLPropertyState& _rProperty,
const SvXMLUnitConverter& _rUnitConverter, const SvXMLUnitConverter& _rUnitConverter,
const SvXMLNamespaceMap& _rNamespaceMap, const SvXMLNamespaceMap& _rNamespaceMap,
@@ -345,7 +345,7 @@ void XMLPageMasterExportPropMapper::handleElementItem(
} }
void XMLPageMasterExportPropMapper::handleSpecialItem( void XMLPageMasterExportPropMapper::handleSpecialItem(
SvXMLAttributeList&, comphelper::AttributeList&,
const XMLPropertyState&, const XMLPropertyState&,
const SvXMLUnitConverter&, const SvXMLUnitConverter&,
const SvXMLNamespaceMap&, const SvXMLNamespaceMap&,
@@ -52,7 +52,7 @@ public:
sal_uInt32 nIdx sal_uInt32 nIdx
) const override; ) const override;
virtual void handleSpecialItem( virtual void handleSpecialItem(
SvXMLAttributeList& rAttrList, comphelper::AttributeList& rAttrList,
const XMLPropertyState& rProperty, const XMLPropertyState& rProperty,
const SvXMLUnitConverter& rUnitConverter, const SvXMLUnitConverter& rUnitConverter,
const SvXMLNamespaceMap& rNamespaceMap, const SvXMLNamespaceMap& rNamespaceMap,
+1 -1
View File
@@ -58,7 +58,7 @@ namespace
} }
void SvXMLAutoStylePoolP::exportStyleAttributes( void SvXMLAutoStylePoolP::exportStyleAttributes(
SvXMLAttributeList&, comphelper::AttributeList&,
XmlStyleFamily nFamily, XmlStyleFamily nFamily,
const vector< XMLPropertyState >& rProperties, const vector< XMLPropertyState >& rProperties,
const SvXMLExportPropertyMapper& rPropExp, const SvXMLExportPropertyMapper& rPropExp,
+3 -4
View File
@@ -38,7 +38,6 @@
#include <utility> #include <utility>
#include <xmloff/xmlexppr.hxx> #include <xmloff/xmlexppr.hxx>
#include <xmloff/xmltoken.hxx> #include <xmloff/xmltoken.hxx>
#include <xmloff/attrlist.hxx>
#include <xmloff/namespacemap.hxx> #include <xmloff/namespacemap.hxx>
#include <xmloff/xmlnamespace.hxx> #include <xmloff/xmlnamespace.hxx>
#include <xmloff/xmlexp.hxx> #include <xmloff/xmlexp.hxx>
@@ -856,7 +855,7 @@ void SvXMLExportPropertyMapper::exportXML(
/** this method is called for every item that has the /** this method is called for every item that has the
MID_FLAG_SPECIAL_ITEM_EXPORT flag set */ MID_FLAG_SPECIAL_ITEM_EXPORT flag set */
void SvXMLExportPropertyMapper::handleSpecialItem( void SvXMLExportPropertyMapper::handleSpecialItem(
SvXMLAttributeList& rAttrList, comphelper::AttributeList& rAttrList,
const XMLPropertyState& rProperty, const XMLPropertyState& rProperty,
const SvXMLUnitConverter& rUnitConverter, const SvXMLUnitConverter& rUnitConverter,
const SvXMLNamespaceMap& rNamespaceMap, const SvXMLNamespaceMap& rNamespaceMap,
@@ -888,7 +887,7 @@ void SvXMLExportPropertyMapper::handleElementItem(
/** fills the given attribute list with the items in the given set */ /** fills the given attribute list with the items in the given set */
void SvXMLExportPropertyMapper::_exportXML( void SvXMLExportPropertyMapper::_exportXML(
sal_uInt16 nPropType, sal_uInt16& rPropTypeFlags, sal_uInt16 nPropType, sal_uInt16& rPropTypeFlags,
SvXMLAttributeList& rAttrList, comphelper::AttributeList& rAttrList,
const ::std::vector< XMLPropertyState >& rProperties, const ::std::vector< XMLPropertyState >& rProperties,
const SvXMLUnitConverter& rUnitConverter, const SvXMLUnitConverter& rUnitConverter,
const SvXMLNamespaceMap& rNamespaceMap, const SvXMLNamespaceMap& rNamespaceMap,
@@ -958,7 +957,7 @@ sal_Int8 CheckExtendedNamespace(std::u16string_view sXMLAttributeName, std::u16s
} }
void SvXMLExportPropertyMapper::_exportXML( void SvXMLExportPropertyMapper::_exportXML(
SvXMLAttributeList& rAttrList, comphelper::AttributeList& rAttrList,
const XMLPropertyState& rProperty, const XMLPropertyState& rProperty,
const SvXMLUnitConverter& rUnitConverter, const SvXMLUnitConverter& rUnitConverter,
const SvXMLNamespaceMap& rNamespaceMap, const SvXMLNamespaceMap& rNamespaceMap,
+1 -1
View File
@@ -163,7 +163,7 @@ public:
using SvXMLExportPropertyMapper::SvXMLExportPropertyMapper; using SvXMLExportPropertyMapper::SvXMLExportPropertyMapper;
/** this method is called for every item that has the /** this method is called for every item that has the
MID_FLAG_SPECIAL_ITEM_EXPORT flag set */ 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 const SvXMLNamespaceMap&, const std::vector<XMLPropertyState>*, sal_uInt32) const override
{ {
// the SpecialItem NumberFormat must not be handled by this method // the SpecialItem NumberFormat must not be handled by this method
@@ -55,7 +55,6 @@
#include <xmloff/XMLEventsImportContext.hxx> #include <xmloff/XMLEventsImportContext.hxx>
#include <XMLImageMapContext.hxx> #include <XMLImageMapContext.hxx>
#include "XMLTextFrameContext.hxx" #include "XMLTextFrameContext.hxx"
#include <xmloff/attrlist.hxx>
#include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx>
+1 -1
View File
@@ -143,7 +143,7 @@ void XMLTextExportPropertySetMapper::handleElementItem(
} }
void XMLTextExportPropertySetMapper::handleSpecialItem( void XMLTextExportPropertySetMapper::handleSpecialItem(
SvXMLAttributeList& rAttrList, comphelper::AttributeList& rAttrList,
const XMLPropertyState& rProperty, const XMLPropertyState& rProperty,
const SvXMLUnitConverter& rUnitConverter, const SvXMLUnitConverter& rUnitConverter,
const SvXMLNamespaceMap& rNamespaceMap, const SvXMLNamespaceMap& rNamespaceMap,
+1 -1
View File
@@ -78,7 +78,7 @@ public:
sal_uInt32 nIdx ) const override; sal_uInt32 nIdx ) const override;
virtual void handleSpecialItem( virtual void handleSpecialItem(
SvXMLAttributeList& rAttrList, comphelper::AttributeList& rAttrList,
const XMLPropertyState& rProperty, const XMLPropertyState& rProperty,
const SvXMLUnitConverter& rUnitConverter, const SvXMLUnitConverter& rUnitConverter,
const SvXMLNamespaceMap& rNamespaceMap, const SvXMLNamespaceMap& rNamespaceMap,
+8 -6
View File
@@ -17,7 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * 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 <comphelper/servicehelper.hxx>
#include "MutableAttrList.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::lang;
using namespace ::com::sun::star::util; using namespace ::com::sun::star::util;
SvXMLAttributeList *XMLMutableAttributeList::GetMutableAttrList() comphelper::AttributeList* XMLMutableAttributeList::GetMutableAttrList()
{ {
if( !m_pMutableAttrList ) if( !m_pMutableAttrList )
{ {
m_pMutableAttrList = new SvXMLAttributeList( m_xAttrList ); m_pMutableAttrList = new comphelper::AttributeList( m_xAttrList );
m_xAttrList = m_pMutableAttrList; m_xAttrList = m_pMutableAttrList;
} }
@@ -38,14 +40,14 @@ SvXMLAttributeList *XMLMutableAttributeList::GetMutableAttrList()
} }
XMLMutableAttributeList::XMLMutableAttributeList() : XMLMutableAttributeList::XMLMutableAttributeList() :
m_pMutableAttrList( new SvXMLAttributeList ) m_pMutableAttrList( new comphelper::AttributeList )
{ {
m_xAttrList = m_pMutableAttrList; m_xAttrList = m_pMutableAttrList;
} }
XMLMutableAttributeList::XMLMutableAttributeList( const Reference< XMLMutableAttributeList::XMLMutableAttributeList( const Reference<
XAttributeList> & rAttrList, bool bClone ) : XAttributeList> & rAttrList, bool bClone ) :
m_xAttrList( rAttrList.is() ? rAttrList : new SvXMLAttributeList ) m_xAttrList( rAttrList.is() ? rAttrList : new comphelper::AttributeList )
{ {
if( bClone ) if( bClone )
GetMutableAttrList(); GetMutableAttrList();
@@ -95,7 +97,7 @@ OUString SAL_CALL XMLMutableAttributeList::getValueByName(
Reference< XCloneable > XMLMutableAttributeList::createClone() Reference< XCloneable > XMLMutableAttributeList::createClone()
{ {
// A cloned list will be a read only list! // 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; return r;
} }
+3 -3
View File
@@ -25,7 +25,7 @@
#include <cppuhelper/implbase.hxx> #include <cppuhelper/implbase.hxx>
#include <rtl/ref.hxx> #include <rtl/ref.hxx>
class SvXMLAttributeList; namespace comphelper { class AttributeList; }
class XMLMutableAttributeList : public ::cppu::WeakImplHelper< class XMLMutableAttributeList : public ::cppu::WeakImplHelper<
css::xml::sax::XAttributeList, css::xml::sax::XAttributeList,
@@ -33,9 +33,9 @@ class XMLMutableAttributeList : public ::cppu::WeakImplHelper<
{ {
css::uno::Reference< css::xml::sax::XAttributeList> m_xAttrList; 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: public:
XMLMutableAttributeList(); XMLMutableAttributeList();
+1 -1
View File
@@ -347,7 +347,7 @@ void exportXFormsBinding( SvXMLExport& rExport,
rMap.GetNameByKey( nKey ) != sURI ) rMap.GetNameByKey( nKey ) != sURI )
{ {
// add declaration if it doesn't already exist // add declaration if it doesn't already exist
SvXMLAttributeList& rAttrList = rExport.GetAttrList(); comphelper::AttributeList& rAttrList = rExport.GetAttrList();
OUString sName = "xmlns:" + rPrefix; OUString sName = "xmlns:" + rPrefix;
sal_Int16 nFound = rAttrList.GetIndexByName(sName); sal_Int16 nFound = rAttrList.GetIndexByName(sName);
// duplicate xmlns:script, http://openoffice.org/2000/script seen // duplicate xmlns:script, http://openoffice.org/2000/script seen
@@ -32,6 +32,7 @@
#include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp> #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
#include <comphelper/attributelist.hxx>
#include <comphelper/documentconstants.hxx> #include <comphelper/documentconstants.hxx>
#include <comphelper/ofopxmlhelper.hxx> #include <comphelper/ofopxmlhelper.hxx>
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
@@ -41,7 +42,6 @@
#include <sal/log.hxx> #include <sal/log.hxx>
#include <svx/xoutbmp.hxx> #include <svx/xoutbmp.hxx>
#include <comphelper/diagnose_ex.hxx> #include <comphelper/diagnose_ex.hxx>
#include <xmloff/attrlist.hxx>
#include <o3tl/string_view.hxx> #include <o3tl/string_view.hxx>
#include <xsecctl.hxx> #include <xsecctl.hxx>
@@ -521,7 +521,7 @@ OUString DocumentSignatureHelper::GetPackageSignatureDefaultStreamName()
void DocumentSignatureHelper::writeDigestMethod( void DocumentSignatureHelper::writeDigestMethod(
const uno::Reference<xml::sax::XDocumentHandler>& xDocumentHandler) 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); pAttributeList->AddAttribute("Algorithm", ALGO_XMLDSIGSHA256);
xDocumentHandler->startElement("DigestMethod", uno::Reference<xml::sax::XAttributeList>(pAttributeList)); xDocumentHandler->startElement("DigestMethod", uno::Reference<xml::sax::XAttributeList>(pAttributeList));
xDocumentHandler->endElement("DigestMethod"); xDocumentHandler->endElement("DigestMethod");
@@ -531,19 +531,19 @@ static void WriteXadesCert(
uno::Reference<xml::sax::XDocumentHandler> const& xDocumentHandler, uno::Reference<xml::sax::XDocumentHandler> const& xDocumentHandler,
SignatureInformation::X509CertInfo const& rCertInfo) SignatureInformation::X509CertInfo const& rCertInfo)
{ {
xDocumentHandler->startElement("xd:Cert", 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 SvXMLAttributeList())); xDocumentHandler->startElement("xd:CertDigest", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList()));
DocumentSignatureHelper::writeDigestMethod(xDocumentHandler); 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()); assert(!rCertInfo.CertDigest.isEmpty());
xDocumentHandler->characters(rCertInfo.CertDigest); xDocumentHandler->characters(rCertInfo.CertDigest);
xDocumentHandler->endElement("DigestValue"); xDocumentHandler->endElement("DigestValue");
xDocumentHandler->endElement("xd:CertDigest"); xDocumentHandler->endElement("xd:CertDigest");
xDocumentHandler->startElement("xd:IssuerSerial", 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 SvXMLAttributeList())); xDocumentHandler->startElement("X509IssuerName", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList()));
xDocumentHandler->characters(rCertInfo.X509IssuerName); xDocumentHandler->characters(rCertInfo.X509IssuerName);
xDocumentHandler->endElement("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->characters(rCertInfo.X509SerialNumber);
xDocumentHandler->endElement("X509SerialNumber"); xDocumentHandler->endElement("X509SerialNumber");
xDocumentHandler->endElement("xd:IssuerSerial"); xDocumentHandler->endElement("xd:IssuerSerial");
@@ -556,16 +556,16 @@ void DocumentSignatureHelper::writeSignedProperties(
const OUString& sDate, const bool bWriteSignatureLineData) 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); pAttributeList->AddAttribute("Id", "idSignedProperties_" + signatureInfo.ouSignatureId);
xDocumentHandler->startElement("xd:SignedProperties", uno::Reference<xml::sax::XAttributeList>(pAttributeList)); xDocumentHandler->startElement("xd:SignedProperties", uno::Reference<xml::sax::XAttributeList>(pAttributeList));
} }
xDocumentHandler->startElement("xd:SignedSignatureProperties", 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 SvXMLAttributeList())); xDocumentHandler->startElement("xd:SigningTime", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList()));
xDocumentHandler->characters(sDate); xDocumentHandler->characters(sDate);
xDocumentHandler->endElement("xd:SigningTime"); 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()); assert(signatureInfo.GetSigningCertificate() || !signatureInfo.ouGpgKeyID.isEmpty());
if (signatureInfo.GetSigningCertificate()) if (signatureInfo.GetSigningCertificate())
{ {
@@ -587,15 +587,15 @@ void DocumentSignatureHelper::writeSignedProperties(
WriteXadesCert(xDocumentHandler, temp); WriteXadesCert(xDocumentHandler, temp);
} }
xDocumentHandler->endElement("xd:SigningCertificate"); xDocumentHandler->endElement("xd:SigningCertificate");
xDocumentHandler->startElement("xd:SignaturePolicyIdentifier", 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 SvXMLAttributeList())); xDocumentHandler->startElement("xd:SignaturePolicyImplied", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList()));
xDocumentHandler->endElement("xd:SignaturePolicyImplied"); xDocumentHandler->endElement("xd:SignaturePolicyImplied");
xDocumentHandler->endElement("xd:SignaturePolicyIdentifier"); xDocumentHandler->endElement("xd:SignaturePolicyIdentifier");
if (bWriteSignatureLineData && !signatureInfo.ouSignatureLineId.isEmpty() if (bWriteSignatureLineData && !signatureInfo.ouSignatureLineId.isEmpty()
&& signatureInfo.aValidSignatureImage.is() && signatureInfo.aInvalidSignatureImage.is()) && signatureInfo.aValidSignatureImage.is() && signatureInfo.aInvalidSignatureImage.is())
{ {
rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); rtl::Reference<comphelper::AttributeList> pAttributeList(new comphelper::AttributeList());
pAttributeList->AddAttribute( pAttributeList->AddAttribute(
"xmlns:loext", "urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"); "xmlns:loext", "urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0");
xDocumentHandler->startElement( xDocumentHandler->startElement(
@@ -606,7 +606,7 @@ void DocumentSignatureHelper::writeSignedProperties(
// Write SignatureLineId element // Write SignatureLineId element
xDocumentHandler->startElement( xDocumentHandler->startElement(
"loext:SignatureLineId", "loext:SignatureLineId",
Reference<XAttributeList>(new SvXMLAttributeList())); Reference<XAttributeList>(new comphelper::AttributeList()));
xDocumentHandler->characters(signatureInfo.ouSignatureLineId); xDocumentHandler->characters(signatureInfo.ouSignatureLineId);
xDocumentHandler->endElement("loext:SignatureLineId"); xDocumentHandler->endElement("loext:SignatureLineId");
} }
@@ -615,7 +615,7 @@ void DocumentSignatureHelper::writeSignedProperties(
// Write SignatureLineValidImage element // Write SignatureLineValidImage element
xDocumentHandler->startElement( xDocumentHandler->startElement(
"loext:SignatureLineValidImage", "loext:SignatureLineValidImage",
Reference<XAttributeList>(new SvXMLAttributeList())); Reference<XAttributeList>(new comphelper::AttributeList()));
OUString aGraphicInBase64; OUString aGraphicInBase64;
Graphic aGraphic(signatureInfo.aValidSignatureImage); Graphic aGraphic(signatureInfo.aValidSignatureImage);
@@ -630,7 +630,7 @@ void DocumentSignatureHelper::writeSignedProperties(
// Write SignatureLineInvalidImage element // Write SignatureLineInvalidImage element
xDocumentHandler->startElement( xDocumentHandler->startElement(
"loext:SignatureLineInvalidImage", "loext:SignatureLineInvalidImage",
Reference<XAttributeList>(new SvXMLAttributeList())); Reference<XAttributeList>(new comphelper::AttributeList()));
OUString aGraphicInBase64; OUString aGraphicInBase64;
Graphic aGraphic(signatureInfo.aInvalidSignatureImage); Graphic aGraphic(signatureInfo.aInvalidSignatureImage);
if (!XOutBitmap::GraphicToBase64(aGraphic, aGraphicInBase64, false)) if (!XOutBitmap::GraphicToBase64(aGraphic, aGraphicInBase64, false))
+62 -55
View File
@@ -19,6 +19,7 @@
#include <com/sun/star/beans/StringPair.hpp> #include <com/sun/star/beans/StringPair.hpp>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp> #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
#include <comphelper/attributelist.hxx>
#include <comphelper/ofopxmlhelper.hxx> #include <comphelper/ofopxmlhelper.hxx>
#include <o3tl/string_view.hxx> #include <o3tl/string_view.hxx>
#include <rtl/ref.hxx> #include <rtl/ref.hxx>
@@ -26,7 +27,6 @@
#include <svx/xoutbmp.hxx> #include <svx/xoutbmp.hxx>
#include <unotools/datetime.hxx> #include <unotools/datetime.hxx>
#include <vcl/salctype.hxx> #include <vcl/salctype.hxx>
#include <xmloff/attrlist.hxx>
#include <documentsignaturehelper.hxx> #include <documentsignaturehelper.hxx>
#include <xsecctl.hxx> #include <xsecctl.hxx>
@@ -113,7 +113,7 @@ bool OOXMLSecExporter::Impl::isOOXMLRelationDenylist(const OUString& rRelationNa
void OOXMLSecExporter::Impl::writeSignedInfo() void OOXMLSecExporter::Impl::writeSignedInfo()
{ {
m_xDocumentHandler->startElement( m_xDocumentHandler->startElement(
"SignedInfo", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); "SignedInfo", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList()));
writeCanonicalizationMethod(); writeCanonicalizationMethod();
writeSignatureMethod(); writeSignatureMethod();
@@ -124,7 +124,7 @@ void OOXMLSecExporter::Impl::writeSignedInfo()
void OOXMLSecExporter::Impl::writeCanonicalizationMethod() void OOXMLSecExporter::Impl::writeCanonicalizationMethod()
{ {
rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); rtl::Reference<comphelper::AttributeList> pAttributeList(new comphelper::AttributeList());
pAttributeList->AddAttribute("Algorithm", ALGO_C14N); pAttributeList->AddAttribute("Algorithm", ALGO_C14N);
m_xDocumentHandler->startElement("CanonicalizationMethod", m_xDocumentHandler->startElement("CanonicalizationMethod",
uno::Reference<xml::sax::XAttributeList>(pAttributeList)); uno::Reference<xml::sax::XAttributeList>(pAttributeList));
@@ -133,7 +133,7 @@ void OOXMLSecExporter::Impl::writeCanonicalizationMethod()
void OOXMLSecExporter::Impl::writeCanonicalizationTransform() void OOXMLSecExporter::Impl::writeCanonicalizationTransform()
{ {
rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); rtl::Reference<comphelper::AttributeList> pAttributeList(new comphelper::AttributeList());
pAttributeList->AddAttribute("Algorithm", ALGO_C14N); pAttributeList->AddAttribute("Algorithm", ALGO_C14N);
m_xDocumentHandler->startElement("Transform", m_xDocumentHandler->startElement("Transform",
uno::Reference<xml::sax::XAttributeList>(pAttributeList)); uno::Reference<xml::sax::XAttributeList>(pAttributeList));
@@ -142,7 +142,7 @@ void OOXMLSecExporter::Impl::writeCanonicalizationTransform()
void OOXMLSecExporter::Impl::writeSignatureMethod() 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) if (m_rInformation.eAlgorithmID == svl::crypto::SignatureMethodAlgorithm::ECDSA)
pAttributeList->AddAttribute("Algorithm", ALGO_ECDSASHA256); pAttributeList->AddAttribute("Algorithm", ALGO_ECDSASHA256);
@@ -162,7 +162,8 @@ void OOXMLSecExporter::Impl::writeSignedInfoReferences()
if (rReference.nType == SignatureReferenceType::SAMEDOCUMENT) if (rReference.nType == SignatureReferenceType::SAMEDOCUMENT)
{ {
{ {
rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); rtl::Reference<comphelper::AttributeList> pAttributeList(
new comphelper::AttributeList());
if (!rReference.ouURI.startsWith("idSignedProperties")) if (!rReference.ouURI.startsWith("idSignedProperties"))
pAttributeList->AddAttribute("Type", pAttributeList->AddAttribute("Type",
"http://www.w3.org/2000/09/xmldsig#Object"); "http://www.w3.org/2000/09/xmldsig#Object");
@@ -177,14 +178,15 @@ void OOXMLSecExporter::Impl::writeSignedInfoReferences()
{ {
m_xDocumentHandler->startElement( m_xDocumentHandler->startElement(
"Transforms", "Transforms",
uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList()));
writeCanonicalizationTransform(); writeCanonicalizationTransform();
m_xDocumentHandler->endElement("Transforms"); m_xDocumentHandler->endElement("Transforms");
} }
DocumentSignatureHelper::writeDigestMethod(m_xDocumentHandler); DocumentSignatureHelper::writeDigestMethod(m_xDocumentHandler);
m_xDocumentHandler->startElement( 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->characters(rReference.ouDigestValue);
m_xDocumentHandler->endElement("DigestValue"); m_xDocumentHandler->endElement("DigestValue");
m_xDocumentHandler->endElement("Reference"); m_xDocumentHandler->endElement("Reference");
@@ -194,8 +196,8 @@ void OOXMLSecExporter::Impl::writeSignedInfoReferences()
void OOXMLSecExporter::Impl::writeSignatureValue() void OOXMLSecExporter::Impl::writeSignatureValue()
{ {
m_xDocumentHandler->startElement( m_xDocumentHandler->startElement("SignatureValue", uno::Reference<xml::sax::XAttributeList>(
"SignatureValue", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); new comphelper::AttributeList()));
m_xDocumentHandler->characters(m_rInformation.ouSignatureValue); m_xDocumentHandler->characters(m_rInformation.ouSignatureValue);
m_xDocumentHandler->endElement("SignatureValue"); m_xDocumentHandler->endElement("SignatureValue");
} }
@@ -203,17 +205,17 @@ void OOXMLSecExporter::Impl::writeSignatureValue()
void OOXMLSecExporter::Impl::writeKeyInfo() void OOXMLSecExporter::Impl::writeKeyInfo()
{ {
m_xDocumentHandler->startElement( m_xDocumentHandler->startElement(
"KeyInfo", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); "KeyInfo", uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList()));
assert(m_rInformation.GetSigningCertificate()); assert(m_rInformation.GetSigningCertificate());
for (auto const& rData : m_rInformation.X509Datas) for (auto const& rData : m_rInformation.X509Datas)
{ {
m_xDocumentHandler->startElement( 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) for (auto const& it : rData)
{ {
m_xDocumentHandler->startElement( m_xDocumentHandler->startElement(
"X509Certificate", "X509Certificate",
uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList()));
m_xDocumentHandler->characters(it.X509Certificate); m_xDocumentHandler->characters(it.X509Certificate);
m_xDocumentHandler->endElement("X509Certificate"); m_xDocumentHandler->endElement("X509Certificate");
} }
@@ -224,7 +226,7 @@ void OOXMLSecExporter::Impl::writeKeyInfo()
void OOXMLSecExporter::Impl::writePackageObject() 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); pAttributeList->AddAttribute("Id", "idPackageObject_" + m_rInformation.ouSignatureId);
m_xDocumentHandler->startElement("Object", m_xDocumentHandler->startElement("Object",
uno::Reference<xml::sax::XAttributeList>(pAttributeList)); uno::Reference<xml::sax::XAttributeList>(pAttributeList));
@@ -238,7 +240,7 @@ void OOXMLSecExporter::Impl::writePackageObject()
void OOXMLSecExporter::Impl::writeManifest() void OOXMLSecExporter::Impl::writeManifest()
{ {
m_xDocumentHandler->startElement( 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; const SignatureReferenceInformations& rReferences = m_rInformation.vSignatureReferenceInfors;
for (const SignatureReferenceInformation& rReference : rReferences) for (const SignatureReferenceInformation& rReference : rReferences)
{ {
@@ -262,7 +264,7 @@ void OOXMLSecExporter::Impl::writeRelationshipTransform(const OUString& rURI)
embed::ElementModes::READ), embed::ElementModes::READ),
uno::UNO_QUERY); uno::UNO_QUERY);
{ {
rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); rtl::Reference<comphelper::AttributeList> pAttributeList(new comphelper::AttributeList());
pAttributeList->AddAttribute("Algorithm", ALGO_RELATIONSHIP); pAttributeList->AddAttribute("Algorithm", ALGO_RELATIONSHIP);
m_xDocumentHandler->startElement("Transform", m_xDocumentHandler->startElement("Transform",
uno::Reference<xml::sax::XAttributeList>(pAttributeList)); uno::Reference<xml::sax::XAttributeList>(pAttributeList));
@@ -286,7 +288,7 @@ void OOXMLSecExporter::Impl::writeRelationshipTransform(const OUString& rURI)
if (OOXMLSecExporter::Impl::isOOXMLRelationDenylist(aType)) if (OOXMLSecExporter::Impl::isOOXMLRelationDenylist(aType))
continue; continue;
rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); rtl::Reference<comphelper::AttributeList> pAttributeList(new comphelper::AttributeList());
pAttributeList->AddAttribute("xmlns:mdssi", NS_MDSSI); pAttributeList->AddAttribute("xmlns:mdssi", NS_MDSSI);
pAttributeList->AddAttribute("SourceId", aId); pAttributeList->AddAttribute("SourceId", aId);
m_xDocumentHandler->startElement("mdssi:RelationshipReference", m_xDocumentHandler->startElement("mdssi:RelationshipReference",
@@ -300,27 +302,28 @@ void OOXMLSecExporter::Impl::writeRelationshipTransform(const OUString& rURI)
void OOXMLSecExporter::Impl::writePackageObjectSignatureProperties() void OOXMLSecExporter::Impl::writePackageObjectSignatureProperties()
{ {
m_xDocumentHandler->startElement( 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("Id", "idSignatureTime_" + m_rInformation.ouSignatureId);
pAttributeList->AddAttribute("Target", "#" + m_rInformation.ouSignatureId); pAttributeList->AddAttribute("Target", "#" + m_rInformation.ouSignatureId);
m_xDocumentHandler->startElement("SignatureProperty", m_xDocumentHandler->startElement("SignatureProperty",
uno::Reference<xml::sax::XAttributeList>(pAttributeList)); 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); pAttributeList->AddAttribute("xmlns:mdssi", NS_MDSSI);
m_xDocumentHandler->startElement("mdssi:SignatureTime", m_xDocumentHandler->startElement("mdssi:SignatureTime",
uno::Reference<xml::sax::XAttributeList>(pAttributeList)); uno::Reference<xml::sax::XAttributeList>(pAttributeList));
} }
m_xDocumentHandler->startElement( 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->characters("YYYY-MM-DDThh:mm:ssTZD");
m_xDocumentHandler->endElement("mdssi:Format"); m_xDocumentHandler->endElement("mdssi:Format");
m_xDocumentHandler->startElement( 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()) if (!m_rInformation.ouDateTime.isEmpty())
m_aSignatureTimeValue = m_rInformation.ouDateTime; m_aSignatureTimeValue = m_rInformation.ouDateTime;
else else
@@ -344,7 +347,7 @@ void OOXMLSecExporter::Impl::writePackageObjectSignatureProperties()
void OOXMLSecExporter::Impl::writeManifestReference(const SignatureReferenceInformation& rReference) 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); pAttributeList->AddAttribute("URI", rReference.ouURI);
m_xDocumentHandler->startElement("Reference", m_xDocumentHandler->startElement("Reference",
uno::Reference<xml::sax::XAttributeList>(pAttributeList)); uno::Reference<xml::sax::XAttributeList>(pAttributeList));
@@ -362,8 +365,8 @@ void OOXMLSecExporter::Impl::writeManifestReference(const SignatureReferenceInfo
if (nQueryPos != -1) if (nQueryPos != -1)
aURI = aURI.copy(0, nQueryPos); aURI = aURI.copy(0, nQueryPos);
m_xDocumentHandler->startElement( m_xDocumentHandler->startElement("Transforms", uno::Reference<xml::sax::XAttributeList>(
"Transforms", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); new comphelper::AttributeList()));
writeRelationshipTransform(aURI); writeRelationshipTransform(aURI);
writeCanonicalizationTransform(); writeCanonicalizationTransform();
@@ -373,7 +376,7 @@ void OOXMLSecExporter::Impl::writeManifestReference(const SignatureReferenceInfo
DocumentSignatureHelper::writeDigestMethod(m_xDocumentHandler); DocumentSignatureHelper::writeDigestMethod(m_xDocumentHandler);
m_xDocumentHandler->startElement( 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->characters(rReference.ouDigestValue);
m_xDocumentHandler->endElement("DigestValue"); m_xDocumentHandler->endElement("DigestValue");
m_xDocumentHandler->endElement("Reference"); m_xDocumentHandler->endElement("Reference");
@@ -382,15 +385,16 @@ void OOXMLSecExporter::Impl::writeManifestReference(const SignatureReferenceInfo
void OOXMLSecExporter::Impl::writeOfficeObject() 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); pAttributeList->AddAttribute("Id", "idOfficeObject_" + m_rInformation.ouSignatureId);
m_xDocumentHandler->startElement("Object", m_xDocumentHandler->startElement("Object",
uno::Reference<xml::sax::XAttributeList>(pAttributeList)); uno::Reference<xml::sax::XAttributeList>(pAttributeList));
} }
m_xDocumentHandler->startElement( 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("Id", "idOfficeV1Details_" + m_rInformation.ouSignatureId);
pAttributeList->AddAttribute("Target", "#" + m_rInformation.ouSignatureId); pAttributeList->AddAttribute("Target", "#" + m_rInformation.ouSignatureId);
m_xDocumentHandler->startElement("SignatureProperty", m_xDocumentHandler->startElement("SignatureProperty",
@@ -404,69 +408,72 @@ void OOXMLSecExporter::Impl::writeOfficeObject()
void OOXMLSecExporter::Impl::writeSignatureInfo() 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"); pAttributeList->AddAttribute("xmlns", "http://schemas.microsoft.com/office/2006/digsig");
m_xDocumentHandler->startElement("SignatureInfoV1", m_xDocumentHandler->startElement("SignatureInfoV1",
uno::Reference<xml::sax::XAttributeList>(pAttributeList)); uno::Reference<xml::sax::XAttributeList>(pAttributeList));
m_xDocumentHandler->startElement( 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->characters(m_rInformation.ouSignatureLineId);
m_xDocumentHandler->endElement("SetupID"); m_xDocumentHandler->endElement("SetupID");
m_xDocumentHandler->startElement( 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->endElement("SignatureText");
m_xDocumentHandler->startElement( m_xDocumentHandler->startElement("SignatureImage", uno::Reference<xml::sax::XAttributeList>(
"SignatureImage", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); new comphelper::AttributeList()));
m_xDocumentHandler->endElement("SignatureImage"); m_xDocumentHandler->endElement("SignatureImage");
m_xDocumentHandler->startElement( m_xDocumentHandler->startElement("SignatureComments", uno::Reference<xml::sax::XAttributeList>(
"SignatureComments", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); new comphelper::AttributeList()));
m_xDocumentHandler->characters(m_rInformation.ouDescription); m_xDocumentHandler->characters(m_rInformation.ouDescription);
m_xDocumentHandler->endElement("SignatureComments"); m_xDocumentHandler->endElement("SignatureComments");
// Just hardcode something valid according to [MS-OFFCRYPTO]. // Just hardcode something valid according to [MS-OFFCRYPTO].
m_xDocumentHandler->startElement( m_xDocumentHandler->startElement("WindowsVersion", uno::Reference<xml::sax::XAttributeList>(
"WindowsVersion", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); new comphelper::AttributeList()));
m_xDocumentHandler->characters("6.1"); m_xDocumentHandler->characters("6.1");
m_xDocumentHandler->endElement("WindowsVersion"); m_xDocumentHandler->endElement("WindowsVersion");
m_xDocumentHandler->startElement( 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->characters("16.0");
m_xDocumentHandler->endElement("OfficeVersion"); m_xDocumentHandler->endElement("OfficeVersion");
m_xDocumentHandler->startElement( m_xDocumentHandler->startElement("ApplicationVersion", uno::Reference<xml::sax::XAttributeList>(
"ApplicationVersion", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); new comphelper::AttributeList()));
m_xDocumentHandler->characters("16.0"); m_xDocumentHandler->characters("16.0");
m_xDocumentHandler->endElement("ApplicationVersion"); m_xDocumentHandler->endElement("ApplicationVersion");
m_xDocumentHandler->startElement( 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->characters("1");
m_xDocumentHandler->endElement("Monitors"); m_xDocumentHandler->endElement("Monitors");
m_xDocumentHandler->startElement( 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->characters("1280");
m_xDocumentHandler->endElement("HorizontalResolution"); m_xDocumentHandler->endElement("HorizontalResolution");
m_xDocumentHandler->startElement( m_xDocumentHandler->startElement("VerticalResolution", uno::Reference<xml::sax::XAttributeList>(
"VerticalResolution", uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); new comphelper::AttributeList()));
m_xDocumentHandler->characters("800"); m_xDocumentHandler->characters("800");
m_xDocumentHandler->endElement("VerticalResolution"); m_xDocumentHandler->endElement("VerticalResolution");
m_xDocumentHandler->startElement( 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->characters("32");
m_xDocumentHandler->endElement("ColorDepth"); m_xDocumentHandler->endElement("ColorDepth");
m_xDocumentHandler->startElement( 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->characters("{00000000-0000-0000-0000-000000000000}");
m_xDocumentHandler->endElement("SignatureProviderId"); m_xDocumentHandler->endElement("SignatureProviderId");
m_xDocumentHandler->startElement( 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->endElement("SignatureProviderUrl");
m_xDocumentHandler->startElement( m_xDocumentHandler->startElement(
"SignatureProviderDetails", "SignatureProviderDetails",
uno::Reference<xml::sax::XAttributeList>(new SvXMLAttributeList())); uno::Reference<xml::sax::XAttributeList>(new comphelper::AttributeList()));
m_xDocumentHandler->characters( m_xDocumentHandler->characters(
"9"); // This is what MSO 2016 writes, though [MS-OFFCRYPTO] doesn't document what the value means. "9"); // This is what MSO 2016 writes, though [MS-OFFCRYPTO] doesn't document what the value means.
m_xDocumentHandler->endElement("SignatureProviderDetails"); m_xDocumentHandler->endElement("SignatureProviderDetails");
m_xDocumentHandler->startElement( 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->characters("2");
m_xDocumentHandler->endElement("SignatureType"); m_xDocumentHandler->endElement("SignatureType");
@@ -476,9 +483,9 @@ void OOXMLSecExporter::Impl::writeSignatureInfo()
void OOXMLSecExporter::Impl::writePackageSignature() void OOXMLSecExporter::Impl::writePackageSignature()
{ {
m_xDocumentHandler->startElement( 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("xmlns:xd", NS_XD);
pAttributeList->AddAttribute("Target", "#" + m_rInformation.ouSignatureId); pAttributeList->AddAttribute("Target", "#" + m_rInformation.ouSignatureId);
m_xDocumentHandler->startElement("xd:QualifyingProperties", m_xDocumentHandler->startElement("xd:QualifyingProperties",
@@ -496,7 +503,7 @@ void OOXMLSecExporter::Impl::writeSignatureLineImages()
{ {
if (m_rInformation.aValidSignatureImage.is()) if (m_rInformation.aValidSignatureImage.is())
{ {
rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); rtl::Reference<comphelper::AttributeList> pAttributeList(new comphelper::AttributeList());
pAttributeList->AddAttribute("Id", "idValidSigLnImg"); pAttributeList->AddAttribute("Id", "idValidSigLnImg");
m_xDocumentHandler->startElement("Object", m_xDocumentHandler->startElement("Object",
uno::Reference<xml::sax::XAttributeList>(pAttributeList)); uno::Reference<xml::sax::XAttributeList>(pAttributeList));
@@ -510,7 +517,7 @@ void OOXMLSecExporter::Impl::writeSignatureLineImages()
if (!m_rInformation.aInvalidSignatureImage.is()) if (!m_rInformation.aInvalidSignatureImage.is())
return; return;
rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); rtl::Reference<comphelper::AttributeList> pAttributeList(new comphelper::AttributeList());
pAttributeList->AddAttribute("Id", "idInvalidSigLnImg"); pAttributeList->AddAttribute("Id", "idInvalidSigLnImg");
m_xDocumentHandler->startElement("Object", m_xDocumentHandler->startElement("Object",
uno::Reference<xml::sax::XAttributeList>(pAttributeList)); uno::Reference<xml::sax::XAttributeList>(pAttributeList));
@@ -524,7 +531,7 @@ void OOXMLSecExporter::Impl::writeSignatureLineImages()
void OOXMLSecExporter::Impl::writeSignature() 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("xmlns", NS_XMLDSIG);
pAttributeList->AddAttribute("Id", m_rInformation.ouSignatureId); pAttributeList->AddAttribute("Id", m_rInformation.ouSignatureId);
getDocumentHandler()->startElement("Signature", getDocumentHandler()->startElement("Signature",
@@ -27,8 +27,6 @@
#include <tools/datetime.hxx> #include <tools/datetime.hxx>
#include <xmloff/attrlist.hxx>
#include <com/sun/star/io/XOutputStream.hpp> #include <com/sun/star/io/XOutputStream.hpp>
#include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XTruncate.hpp> #include <com/sun/star/io/XTruncate.hpp>
@@ -41,6 +39,7 @@
#include <com/sun/star/embed/StorageFormats.hpp> #include <com/sun/star/embed/StorageFormats.hpp>
#include <com/sun/star/embed/XTransactedObject.hpp> #include <com/sun/star/embed/XTransactedObject.hpp>
#include <comphelper/attributelist.hxx>
#include <comphelper/ofopxmlhelper.hxx> #include <comphelper/ofopxmlhelper.hxx>
#include <comphelper/sequence.hxx> #include <comphelper/sequence.hxx>
#include <comphelper/diagnose_ex.hxx> #include <comphelper/diagnose_ex.hxx>
@@ -188,7 +187,7 @@ uno::Reference<xml::sax::XWriter> XMLSignatureHelper::CreateDocumentHandlerWithH
/* /*
* write the xml context for signatures * write the xml context for signatures
*/ */
rtl::Reference<SvXMLAttributeList> pAttributeList = new SvXMLAttributeList(); rtl::Reference<comphelper::AttributeList> pAttributeList = new comphelper::AttributeList();
OUString sNamespace; OUString sNamespace;
if (mbODFPre1_2) if (mbODFPre1_2)
sNamespace = NS_DOCUMENTSIGNATURES; sNamespace = NS_DOCUMENTSIGNATURES;
+34 -34
View File
@@ -34,7 +34,7 @@
#include <com/sun/star/xml/sax/XParser.hpp> #include <com/sun/star/xml/sax/XParser.hpp>
#include <com/sun/star/xml/crypto/XXMLSignature.hpp> #include <com/sun/star/xml/crypto/XXMLSignature.hpp>
#include <xmloff/attrlist.hxx> #include <comphelper/attributelist.hxx>
#include <rtl/ustrbuf.hxx> #include <rtl/ustrbuf.hxx>
#include <rtl/ref.hxx> #include <rtl/ref.hxx>
#include <sal/log.hxx> #include <sal/log.hxx>
@@ -530,21 +530,21 @@ void writeUnsignedProperties(
const SignatureInformation& signatureInfo) const SignatureInformation& signatureInfo)
{ {
{ {
rtl::Reference<SvXMLAttributeList> pAttributeList(new SvXMLAttributeList()); rtl::Reference<comphelper::AttributeList> pAttributeList(new comphelper::AttributeList());
pAttributeList->AddAttribute("Id", "idUnsignedProperties_" + signatureInfo.ouSignatureId); pAttributeList->AddAttribute("Id", "idUnsignedProperties_" + signatureInfo.ouSignatureId);
xDocumentHandler->startElement("xd:UnsignedProperties", uno::Reference<xml::sax::XAttributeList>(pAttributeList)); 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) 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->characters(i);
xDocumentHandler->endElement("xd:EncapsulatedX509Certificate"); xDocumentHandler->endElement("xd:EncapsulatedX509Certificate");
} }
@@ -579,12 +579,12 @@ void XSecController::exportSignature(
******************************************************************************/ ******************************************************************************/
{ {
const SignatureReferenceInformations& vReferenceInfors = signatureInfo.vSignatureReferenceInfors; const SignatureReferenceInformations& vReferenceInfors = signatureInfo.vSignatureReferenceInfors;
rtl::Reference<SvXMLAttributeList> pAttributeList; rtl::Reference<comphelper::AttributeList> pAttributeList;
/* /*
* Write Signature element * Write Signature element
*/ */
pAttributeList = new SvXMLAttributeList(); pAttributeList = new comphelper::AttributeList();
pAttributeList->AddAttribute( pAttributeList->AddAttribute(
"xmlns", "xmlns",
NS_XMLDSIG); NS_XMLDSIG);
@@ -601,10 +601,10 @@ void XSecController::exportSignature(
/* Write SignedInfo element */ /* Write SignedInfo element */
xDocumentHandler->startElement( xDocumentHandler->startElement(
"SignedInfo", "SignedInfo",
css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList())); css::uno::Reference< css::xml::sax::XAttributeList > (new comphelper::AttributeList()));
{ {
/* Write CanonicalizationMethod element */ /* Write CanonicalizationMethod element */
pAttributeList = new SvXMLAttributeList(); pAttributeList = new comphelper::AttributeList();
pAttributeList->AddAttribute( pAttributeList->AddAttribute(
"Algorithm", "Algorithm",
ALGO_C14N); ALGO_C14N);
@@ -612,7 +612,7 @@ void XSecController::exportSignature(
xDocumentHandler->endElement( "CanonicalizationMethod" ); xDocumentHandler->endElement( "CanonicalizationMethod" );
/* Write SignatureMethod element */ /* Write SignatureMethod element */
pAttributeList = new SvXMLAttributeList(); pAttributeList = new comphelper::AttributeList();
// TODO: actually roundtrip this value from parsing documentsignatures.xml - entirely // 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 // 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]; const SignatureReferenceInformation& refInfor = vReferenceInfors[j];
pAttributeList = new SvXMLAttributeList(); pAttributeList = new comphelper::AttributeList();
if ( refInfor.nType != SignatureReferenceType::SAMEDOCUMENT ) if ( refInfor.nType != SignatureReferenceType::SAMEDOCUMENT )
/* /*
* stream reference * stream reference
@@ -676,9 +676,9 @@ void XSecController::exportSignature(
{ {
xDocumentHandler->startElement( xDocumentHandler->startElement(
"Transforms", "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( pAttributeList->AddAttribute(
"Algorithm", "Algorithm",
ALGO_C14N); ALGO_C14N);
@@ -691,7 +691,7 @@ void XSecController::exportSignature(
} }
/* Write DigestMethod element */ /* Write DigestMethod element */
pAttributeList = new SvXMLAttributeList(); pAttributeList = new comphelper::AttributeList();
pAttributeList->AddAttribute( pAttributeList->AddAttribute(
"Algorithm", "Algorithm",
getDigestURI(refInfor.nDigestID)); getDigestURI(refInfor.nDigestID));
@@ -703,7 +703,7 @@ void XSecController::exportSignature(
/* Write DigestValue element */ /* Write DigestValue element */
xDocumentHandler->startElement( xDocumentHandler->startElement(
"DigestValue", "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->characters( refInfor.ouDigestValue );
xDocumentHandler->endElement( "DigestValue" ); xDocumentHandler->endElement( "DigestValue" );
} }
@@ -715,19 +715,19 @@ void XSecController::exportSignature(
/* Write SignatureValue element */ /* Write SignatureValue element */
xDocumentHandler->startElement( xDocumentHandler->startElement(
"SignatureValue", "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->characters( signatureInfo.ouSignatureValue );
xDocumentHandler->endElement( "SignatureValue" ); xDocumentHandler->endElement( "SignatureValue" );
/* Write KeyInfo element */ /* Write KeyInfo element */
xDocumentHandler->startElement( xDocumentHandler->startElement(
"KeyInfo", "KeyInfo",
css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList())); css::uno::Reference< css::xml::sax::XAttributeList > (new comphelper::AttributeList()));
{ {
// GPG or X509 key? // GPG or X509 key?
if (!signatureInfo.ouGpgCertificate.isEmpty()) if (!signatureInfo.ouGpgCertificate.isEmpty())
{ {
pAttributeList = new SvXMLAttributeList(); pAttributeList = new comphelper::AttributeList();
pAttributeList->AddAttribute("xmlns:loext", NS_LOEXT); pAttributeList->AddAttribute("xmlns:loext", NS_LOEXT);
/* Write PGPData element */ /* Write PGPData element */
xDocumentHandler->startElement( xDocumentHandler->startElement(
@@ -737,7 +737,7 @@ void XSecController::exportSignature(
/* Write keyid element */ /* Write keyid element */
xDocumentHandler->startElement( xDocumentHandler->startElement(
"PGPKeyID", "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->characters(signatureInfo.ouGpgKeyID);
xDocumentHandler->endElement( "PGPKeyID" ); xDocumentHandler->endElement( "PGPKeyID" );
@@ -746,7 +746,7 @@ void XSecController::exportSignature(
{ {
xDocumentHandler->startElement( xDocumentHandler->startElement(
"PGPKeyPacket", "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->characters( signatureInfo.ouGpgCertificate );
xDocumentHandler->endElement( "PGPKeyPacket" ); xDocumentHandler->endElement( "PGPKeyPacket" );
} }
@@ -754,7 +754,7 @@ void XSecController::exportSignature(
/* Write PGPOwner element */ /* Write PGPOwner element */
xDocumentHandler->startElement( xDocumentHandler->startElement(
"loext:PGPOwner", "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->characters( signatureInfo.ouGpgOwner );
xDocumentHandler->endElement( "loext:PGPOwner" ); xDocumentHandler->endElement( "loext:PGPOwner" );
} }
@@ -768,26 +768,26 @@ void XSecController::exportSignature(
/* Write X509Data element */ /* Write X509Data element */
xDocumentHandler->startElement( xDocumentHandler->startElement(
"X509Data", "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) for (auto const& it : rData)
{ {
/* Write X509IssuerSerial element */ /* Write X509IssuerSerial element */
xDocumentHandler->startElement( xDocumentHandler->startElement(
"X509IssuerSerial", "X509IssuerSerial",
css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList())); css::uno::Reference< css::xml::sax::XAttributeList > (new comphelper::AttributeList()));
{ {
/* Write X509IssuerName element */ /* Write X509IssuerName element */
xDocumentHandler->startElement( xDocumentHandler->startElement(
"X509IssuerName", "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->characters(it.X509IssuerName);
xDocumentHandler->endElement( "X509IssuerName" ); xDocumentHandler->endElement( "X509IssuerName" );
/* Write X509SerialNumber element */ /* Write X509SerialNumber element */
xDocumentHandler->startElement( xDocumentHandler->startElement(
"X509SerialNumber", "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->characters(it.X509SerialNumber);
xDocumentHandler->endElement( "X509SerialNumber" ); xDocumentHandler->endElement( "X509SerialNumber" );
} }
@@ -798,7 +798,7 @@ void XSecController::exportSignature(
{ {
xDocumentHandler->startElement( xDocumentHandler->startElement(
"X509Certificate", "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->characters(it.X509Certificate);
xDocumentHandler->endElement( "X509Certificate" ); xDocumentHandler->endElement( "X509Certificate" );
} }
@@ -815,15 +815,15 @@ void XSecController::exportSignature(
/* Write Object element */ /* Write Object element */
xDocumentHandler->startElement( xDocumentHandler->startElement(
"Object", "Object",
css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList())); css::uno::Reference< css::xml::sax::XAttributeList > (new comphelper::AttributeList()));
{ {
/* Write SignatureProperties element */ /* Write SignatureProperties element */
xDocumentHandler->startElement( xDocumentHandler->startElement(
"SignatureProperties", "SignatureProperties",
css::uno::Reference< css::xml::sax::XAttributeList > (new SvXMLAttributeList())); css::uno::Reference< css::xml::sax::XAttributeList > (new comphelper::AttributeList()));
{ {
/* Write SignatureProperty element */ /* Write SignatureProperty element */
pAttributeList = new SvXMLAttributeList(); pAttributeList = new comphelper::AttributeList();
pAttributeList->AddAttribute( pAttributeList->AddAttribute(
"Id", "Id",
signatureInfo.ouDateTimePropertyId); signatureInfo.ouDateTimePropertyId);
@@ -836,7 +836,7 @@ void XSecController::exportSignature(
{ {
/* Write timestamp element */ /* Write timestamp element */
pAttributeList = new SvXMLAttributeList(); pAttributeList = new comphelper::AttributeList();
pAttributeList->AddAttribute( pAttributeList->AddAttribute(
"xmlns:dc", "xmlns:dc",
NS_DC); NS_DC);
@@ -872,14 +872,14 @@ void XSecController::exportSignature(
if (!signatureInfo.ouDescription.isEmpty()) if (!signatureInfo.ouDescription.isEmpty())
{ {
// SignatureProperty element. // SignatureProperty element.
pAttributeList = new SvXMLAttributeList(); pAttributeList = new comphelper::AttributeList();
pAttributeList->AddAttribute("Id", signatureInfo.ouDescriptionPropertyId); pAttributeList->AddAttribute("Id", signatureInfo.ouDescriptionPropertyId);
pAttributeList->AddAttribute("Target", "#" + signatureInfo.ouSignatureId); pAttributeList->AddAttribute("Target", "#" + signatureInfo.ouSignatureId);
xDocumentHandler->startElement("SignatureProperty", pAttributeList); xDocumentHandler->startElement("SignatureProperty", pAttributeList);
{ {
// Description element. // Description element.
pAttributeList = new SvXMLAttributeList(); pAttributeList = new comphelper::AttributeList();
pAttributeList->AddAttribute("xmlns:dc", NS_DC); pAttributeList->AddAttribute("xmlns:dc", NS_DC);
xDocumentHandler->startElement("dc:description", pAttributeList); xDocumentHandler->startElement("dc:description", pAttributeList);
@@ -897,13 +897,13 @@ void XSecController::exportSignature(
// In XAdES, write another Object element for the QualifyingProperties // In XAdES, write another Object element for the QualifyingProperties
if (bXAdESCompliantIfODF) if (bXAdESCompliantIfODF)
{ {
pAttributeList = new SvXMLAttributeList(); pAttributeList = new comphelper::AttributeList();
pAttributeList->AddAttribute("xmlns:xd", NS_XD); pAttributeList->AddAttribute("xmlns:xd", NS_XD);
xDocumentHandler->startElement( xDocumentHandler->startElement(
"Object", "Object",
pAttributeList); pAttributeList);
{ {
pAttributeList = new SvXMLAttributeList(); pAttributeList = new comphelper::AttributeList();
pAttributeList->AddAttribute("Target", "#" + signatureInfo.ouSignatureId); pAttributeList->AddAttribute("Target", "#" + signatureInfo.ouSignatureId);
xDocumentHandler->startElement( xDocumentHandler->startElement(
"xd:QualifyingProperties", "xd:QualifyingProperties",
@@ -25,8 +25,7 @@
#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/supportsservice.hxx>
#include <xmlsec/xmldocumentwrapper_xmlsecimpl.hxx> #include <xmlsec/xmldocumentwrapper_xmlsecimpl.hxx>
#include "xmlelementwrapper_xmlsecimpl.hxx" #include "xmlelementwrapper_xmlsecimpl.hxx"
#include <comphelper/attributelist.hxx>
#include <xmloff/attrlist.hxx>
#include <rtl/ref.hxx> #include <rtl/ref.hxx>
#ifdef UNX #ifdef UNX
@@ -174,7 +173,7 @@ void XMLDocumentWrapper_XmlSecImpl::sendStartElement(
* This node must be an element type. * 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; xmlNsPtr pNsDef = pNode->nsDef;