summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sal/inc/rtl/ustrbuf.hxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/sal/inc/rtl/ustrbuf.hxx b/sal/inc/rtl/ustrbuf.hxx
index 8a509466371c..8e4ca1d80ba4 100644
--- a/sal/inc/rtl/ustrbuf.hxx
+++ b/sal/inc/rtl/ustrbuf.hxx
@@ -1322,8 +1322,10 @@ public:
*/
OUStringBuffer copy( sal_Int32 beginIndex ) const SAL_THROW(())
{
+ assert(beginIndex >= 0 && beginIndex <= getLength());
return copy( beginIndex, getLength() - beginIndex );
}
+
/**
Returns a new string buffer that is a substring of this string.
@@ -1339,6 +1341,8 @@ public:
*/
OUStringBuffer copy( sal_Int32 beginIndex, sal_Int32 count ) const SAL_THROW(())
{
+ assert(beginIndex >= 0 && beginIndex <= getLength());
+ assert(count >= 0 && count <= getLength() - beginIndex);
rtl_uString *pNew = 0;
rtl_uStringbuffer_newFromStr_WithLength( &pNew, getStr() + beginIndex, count );
return OUStringBuffer( pNew, count + 16 );