summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2018-02-28 21:28:55 +0100
committerMichael Stahl <mstahl@redhat.com>2018-03-02 09:51:55 +0100
commit1bd9fcafe67cac9404c8c96553a262c048802c25 (patch)
treecff22442b06f8c803ce641627324ad6f4489b7c9 /xmloff
parent3d5a7631942171c2d73fbb172c2a9e7a50e9c3e3 (diff)
tdf#115429 sax,xmloff: assert on empty attribute names & namespaces
Surely that's indication of a bug somewhere. Change-Id: Ic6219d8eb7f22301d8c4da98b2132ae3ef0467b5 Reviewed-on: https://gerrit.libreoffice.org/50579 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/core/SvXMLAttrCollection.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/xmloff/source/core/SvXMLAttrCollection.cxx b/xmloff/source/core/SvXMLAttrCollection.cxx
index e203e3c9f920..fcb9a5b0dd9a 100644
--- a/xmloff/source/core/SvXMLAttrCollection.cxx
+++ b/xmloff/source/core/SvXMLAttrCollection.cxx
@@ -20,6 +20,7 @@ bool SvXMLAttrCollection::operator ==( const SvXMLAttrCollection& rCmp ) const
bool SvXMLAttrCollection::AddAttr( const OUString& rLName,
const OUString& rValue )
{
+ assert(!rLName.isEmpty());
aAttrs.emplace_back(rLName, rValue );
return true;
}
@@ -29,6 +30,9 @@ bool SvXMLAttrCollection::AddAttr( const OUString& rPrefix,
const OUString& rLName,
const OUString& rValue )
{
+ assert(!rPrefix.isEmpty());
+ assert(!rNamespace.isEmpty());
+ assert(!rLName.isEmpty());
sal_uInt16 nPos = aNamespaceMap.Add( rPrefix, rNamespace );
aAttrs.emplace_back(nPos, rLName, rValue );
return true;
@@ -38,6 +42,8 @@ bool SvXMLAttrCollection::AddAttr( const OUString& rPrefix,
const OUString& rLName,
const OUString& rValue )
{
+ assert(!rPrefix.isEmpty());
+ assert(!rLName.isEmpty());
sal_uInt16 nPos = aNamespaceMap.GetIndexByPrefix( rPrefix );
if( USHRT_MAX == nPos )
return false;
@@ -49,6 +55,7 @@ bool SvXMLAttrCollection::SetAt( size_t i,
const OUString& rLName,
const OUString& rValue )
{
+ assert(!rLName.isEmpty());
if( i >= GetAttrCount() )
return false;
aAttrs[i] = SvXMLAttr(rLName, rValue);
@@ -61,6 +68,9 @@ bool SvXMLAttrCollection::SetAt( size_t i,
const OUString& rLName,
const OUString& rValue )
{
+ assert(!rPrefix.isEmpty());
+ assert(!rNamespace.isEmpty());
+ assert(!rLName.isEmpty());
if( i >= GetAttrCount() )
return false;
@@ -77,6 +87,8 @@ bool SvXMLAttrCollection::SetAt( size_t i,
const OUString& rLName,
const OUString& rValue )
{
+ assert(!rPrefix.isEmpty());
+ assert(!rLName.isEmpty());
if( i >= GetAttrCount() )
return false;