diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-05-06 15:10:56 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-05-06 16:18:25 +0200 |
commit | 068f16e2f44b21df0bf7423eb02e8d57b4cb589c (patch) | |
tree | 12438be3af22634b769a0661bf0faa1c0699b10e /xmloff/source/style/xmlprmap.cxx | |
parent | cd84fffd506e7d681d6542f979045691c49bbd8c (diff) |
xmloff: assert validity of XMLPropertySetMapper indexes
Apparently -1 is used for invalidated ones.
Change-Id: I31901ff9f1caf3d011e476e220cec71669f5a356
Diffstat (limited to 'xmloff/source/style/xmlprmap.cxx')
-rw-r--r-- | xmloff/source/style/xmlprmap.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/xmloff/source/style/xmlprmap.cxx b/xmloff/source/style/xmlprmap.cxx index c1302b46a264..046fd3de8862 100644 --- a/xmloff/source/style/xmlprmap.cxx +++ b/xmloff/source/style/xmlprmap.cxx @@ -181,13 +181,13 @@ sal_Int32 XMLPropertySetMapper::GetEntryCount() const sal_uInt32 XMLPropertySetMapper::GetEntryFlags( sal_Int32 nIndex ) const { - DBG_ASSERT( (nIndex >= 0) && (nIndex < (sal_Int32)mpImpl->maMapEntries.size() ), "illegal access to invalid entry!" ); + assert((0 <= nIndex) && (nIndex < static_cast<sal_Int32>(mpImpl->maMapEntries.size()))); return mpImpl->maMapEntries[nIndex].nType & ~MID_FLAG_MASK; } sal_uInt32 XMLPropertySetMapper::GetEntryType( sal_Int32 nIndex, bool bWithFlags ) const { - DBG_ASSERT( (nIndex >= 0) && (nIndex < (sal_Int32)mpImpl->maMapEntries.size() ), "illegal access to invalid entry!" ); + assert((0 <= nIndex) && (nIndex < static_cast<sal_Int32>(mpImpl->maMapEntries.size()))); sal_uInt32 nType = mpImpl->maMapEntries[nIndex].nType; if( !bWithFlags ) nType = nType & MID_FLAG_MASK; @@ -196,37 +196,37 @@ sal_uInt32 XMLPropertySetMapper::GetEntryType( sal_Int32 nIndex, bool bWithFlags sal_uInt16 XMLPropertySetMapper::GetEntryNameSpace( sal_Int32 nIndex ) const { - DBG_ASSERT( (nIndex >= 0) && (nIndex < (sal_Int32)mpImpl->maMapEntries.size() ), "illegal access to invalid entry!" ); + assert((0 <= nIndex) && (nIndex < static_cast<sal_Int32>(mpImpl->maMapEntries.size()))); return mpImpl->maMapEntries[nIndex].nXMLNameSpace; } const OUString& XMLPropertySetMapper::GetEntryXMLName( sal_Int32 nIndex ) const { - DBG_ASSERT( (nIndex >= 0) && (nIndex < (sal_Int32)mpImpl->maMapEntries.size() ), "illegal access to invalid entry!" ); + assert((0 <= nIndex) && (nIndex < static_cast<sal_Int32>(mpImpl->maMapEntries.size()))); return mpImpl->maMapEntries[nIndex].sXMLAttributeName; } const OUString& XMLPropertySetMapper::GetEntryAPIName( sal_Int32 nIndex ) const { - DBG_ASSERT( (nIndex >= 0) && (nIndex < (sal_Int32)mpImpl->maMapEntries.size() ), "illegal access to invalid entry!" ); + assert((0 <= nIndex) && (nIndex < static_cast<sal_Int32>(mpImpl->maMapEntries.size()))); return mpImpl->maMapEntries[nIndex].sAPIPropertyName; } sal_Int16 XMLPropertySetMapper::GetEntryContextId( sal_Int32 nIndex ) const { - DBG_ASSERT( (nIndex >= -1) && (nIndex < (sal_Int32)mpImpl->maMapEntries.size() ), "illegal access to invalid entry!" ); + assert((-1 <= nIndex) && (nIndex < static_cast<sal_Int32>(mpImpl->maMapEntries.size()))); return nIndex == -1 ? 0 : mpImpl->maMapEntries[nIndex].nContextId; } SvtSaveOptions::ODFDefaultVersion XMLPropertySetMapper::GetEarliestODFVersionForExport( sal_Int32 nIndex ) const { - DBG_ASSERT( (nIndex >= -1) && (nIndex < (sal_Int32)mpImpl->maMapEntries.size() ), "illegal access to invalid entry!" ); + assert((-1 <= nIndex) && (nIndex < static_cast<sal_Int32>(mpImpl->maMapEntries.size()))); return nIndex == -1 ? SvtSaveOptions::ODFVER_UNKNOWN : mpImpl->maMapEntries[nIndex].nEarliestODFVersionForExport; } const XMLPropertyHandler* XMLPropertySetMapper::GetPropertyHandler( sal_Int32 nIndex ) const { - DBG_ASSERT( (nIndex >= 0) && (nIndex < (sal_Int32)mpImpl->maMapEntries.size() ), "illegal access to invalid entry!" ); + assert((0 <= nIndex) && (nIndex < static_cast<sal_Int32>(mpImpl->maMapEntries.size()))); return mpImpl->maMapEntries[nIndex].pHdl; } |