Attached patch removes is_valid_index method and its users from
xml2cmp/source/support/list.hxx for future migration to STL.
--
Seo Sanghyeon
diff --git a/xml2cmp/source/support/list.hxx b/xml2cmp/source/support/list.hxx
index 944fcec..984ccba 100644
--- a/xml2cmp/source/support/list.hxx
+++ b/xml2cmp/source/support/list.hxx
@@ -72,9 +72,6 @@ class List
unsigned size() const { return len; }
unsigned space() const { return allocated; }
- bool is_valid_index(
- unsigned n) const
- { return n < len; }
// ACCESS
XX & front() { return elem(0); }
XX & back() { return elem(len-1); }
@@ -238,7 +235,7 @@ template <class XY>
void
DynamicList<XY>::remove( unsigned pos )
{
- if (!this->is_valid_index(pos) )
+ if (pos >= this->len)
return;
this->len--;
delete this->inhalt[pos];
diff --git a/xml2cmp/source/xcd/xmlelem.cxx b/xml2cmp/source/xcd/xmlelem.cxx
index f4bffb7..234aac0 100644
--- a/xml2cmp/source/xcd/xmlelem.cxx
+++ b/xml2cmp/source/xcd/xmlelem.cxx
@@ -207,7 +207,7 @@ MultipleTextElement::Data( unsigned i_nNr ) const
{
static const Simstr sNull_;
- if (aContent.is_valid_index(i_nNr))
+ if (i_nNr < aContent.size())
return aContent[i_nNr];
return sNull_;
}
Context
- [Libreoffice] Using STL for xml2cmp (1) · Seo Sanghyeon
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.