diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-08-10 18:26:23 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-08-10 20:56:38 +0200 |
commit | e510b3089024e451b57d6150f6f1a5a34594e376 (patch) | |
tree | 9f1d8a7714c5291597cad0240a3ac71b0fd7682d /basic/source/classes | |
parent | 958a39425faa7c5ec3c422ac0de9fac7f79cad8e (diff) |
Use nStringSize instead of nStringOff
nStringSize is the actual size of the string block, and is the correct
end position to use to calculate last string length. nStringOff is not
updated during load, so using it makes no sense here.
It was this way ever since 039dbbcb9688971a85b1791f60a55693ff3ba261.
Change-Id: I4fad1bdd6ed4af9dd7d29b5438ec23db0b815806
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120243
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'basic/source/classes')
-rw-r--r-- | basic/source/classes/image.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx index 73d65e98eab9..50ccbfa09669 100644 --- a/basic/source/classes/image.cxx +++ b/basic/source/classes/image.cxx @@ -655,7 +655,7 @@ OUString SbiImage::GetString( short nId, SbxDataType *eType ) const sal_uInt32 nOff = mvStringOffsets[ nId - 1 ]; sal_Unicode* pStr = pStrings.get() + nOff; - sal_uInt32 nNextOff = (nId < short(mvStringOffsets.size())) ? mvStringOffsets[ nId ] : nStringOff; + sal_uInt32 nNextOff = (nId < short(mvStringOffsets.size())) ? mvStringOffsets[ nId ] : nStringSize; sal_uInt32 nLen = nNextOff - nOff - 1; // #i42467: Special treatment for vbNullChar if (*pStr == 0) |