diff options
author | Noel Grandin <noel@peralex.com> | 2013-10-23 13:29:32 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-11-04 08:06:10 +0200 |
commit | 0e6a2601b39cbadaff7f7506ba9e804f108060db (patch) | |
tree | ffd6bb4970f689d20087b721eb8dfd4bc86cd53f /include/rtl/ustrbuf.hxx | |
parent | 457b349edbaf6d9dc747f3a631fee70e0c035bae (diff) |
Convert code that calls OUString::getStr()[] to use the [] operator
This also means that this code now gets bounds checked in debug builds.
Change-Id: Id777f85eaee6a737bbcb84625e6e110abe0e0f27
Diffstat (limited to 'include/rtl/ustrbuf.hxx')
-rw-r--r-- | include/rtl/ustrbuf.hxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/rtl/ustrbuf.hxx b/include/rtl/ustrbuf.hxx index f7d640c0e415..baf6daf014b8 100644 --- a/include/rtl/ustrbuf.hxx +++ b/include/rtl/ustrbuf.hxx @@ -384,6 +384,21 @@ public: } /** + Access to individual characters. + + @param index must be non-negative and less than length. + + @return a reference to the character at the given index. + + @since LibreOffice 4.2 + */ + const sal_Unicode & operator [](sal_Int32 index) const + { + assert(index >= 0 && index < pData->length); + return pData->buffer[index]; + } + + /** Return a OUString instance reflecting the current content of this OUStringBuffer. */ |