[Libreoffice-commits] core.git: basic/source

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 10 18:57:19 UTC 2021


 basic/source/classes/image.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e510b3089024e451b57d6150f6f1a5a34594e376
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Tue Aug 10 18:26:23 2021 +0200
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Tue Aug 10 20:56:38 2021 +0200

    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 at collabora.com>
    Tested-by: Mike Kaganski <mike.kaganski at collabora.com>

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)


More information about the Libreoffice-commits mailing list