diff options
author | Matthew J. Francis <mjay.francis@gmail.com> | 2015-06-04 15:56:58 +0800 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2015-06-14 15:03:58 +0000 |
commit | 46e12364dcf638e97831dc3d7507bb6b93377757 (patch) | |
tree | bf4111815f9ccb9437a7cd3fd23778890b0b177f /comphelper/source | |
parent | 8f324aebfb94c4b2023894121b954ad4f35eb395 (diff) |
Fix insertion and deletion in IndexedPropertyValuesContainer
The cases for iterating to an element from the end (used for
elements in the second half of the underlying array) had an off by
one error causing the wrong elements to be inserted/removed
Change-Id: Idcbf158cc31afaf02fce3f1975509edf6239d3ae
Reviewed-on: https://gerrit.libreoffice.org/16073
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'comphelper/source')
-rw-r--r-- | comphelper/source/container/IndexedPropertyValuesContainer.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/comphelper/source/container/IndexedPropertyValuesContainer.cxx b/comphelper/source/container/IndexedPropertyValuesContainer.cxx index cd329af150e9..b8b91f3ee48f 100644 --- a/comphelper/source/container/IndexedPropertyValuesContainer.cxx +++ b/comphelper/source/container/IndexedPropertyValuesContainer.cxx @@ -116,7 +116,7 @@ void SAL_CALL IndexedPropertyValuesContainer::insertByIndex( sal_Int32 nIndex, c else { aItr = maProperties.end(); - sal_Int32 i(nSize - 1); + sal_Int32 i(nSize); while(i > nIndex) { --i; @@ -151,7 +151,7 @@ void SAL_CALL IndexedPropertyValuesContainer::removeByIndex( sal_Int32 nIndex ) else { aItr = maProperties.end(); - sal_Int32 i(nSize - 1); + sal_Int32 i(nSize); while(i > nIndex) { --i; |