summaryrefslogtreecommitdiff
path: root/xml2cmp
diff options
context:
space:
mode:
authorSeo Sanghyeon <sanxiyn@gmail.com>2010-09-29 13:59:36 +0200
committerCédric Bosdonnat <cedricbosdo@openoffice.org>2010-09-29 13:59:36 +0200
commitf5cc5634ebb1fd3834d963534650c9f62f00783a (patch)
treee778c6d5eafb2c4a8fdeb6bdb235397bec7b1c44 /xml2cmp
parentd19be7acbe78e7b25fc6349e1db7fd9c5974cc72 (diff)
Removes is_valid_index method for future migration to STL
Diffstat (limited to 'xml2cmp')
-rw-r--r--xml2cmp/source/support/list.hxx5
-rw-r--r--xml2cmp/source/xcd/xmlelem.cxx2
2 files changed, 2 insertions, 5 deletions
diff --git a/xml2cmp/source/support/list.hxx b/xml2cmp/source/support/list.hxx
index 163cd74ece83..7fbd71412ae3 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 10662b3a40d4..006197465de6 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_;
}