basic/source/sbx/sbxvar.cxx |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 712bddcec53a8f3ef5f70d4d9e9201b186452cf6
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Fri Aug 30 10:54:29 2024 +0200
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sat Aug 31 08:04:37 2024 +0200

    Move variables into their usage scope
    
    Change-Id: I8d708ecdc94c19069d955b19daf1a5c5c4bc2f45
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172584
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    Tested-by: Jenkins

diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx
index 2d86029c5ad1..5ae69288af13 100644
--- a/basic/source/sbx/sbxvar.cxx
+++ b/basic/source/sbx/sbxvar.cxx
@@ -215,14 +215,15 @@ const OUString& SbxVariable::GetName( SbxNameType t ) 
const
     {
         return maName;
     }
-    sal_Unicode cType = ' ';
     OUStringBuffer aTmp( maName );
-    // short type? Then fetch it, possible this is 0.
-    SbxDataType et = GetType();
     if( t == SbxNameType::ShortTypes )
     {
+        sal_Unicode cType = ' ';
+        // short type? Then fetch it, possible this is 0.
+        SbxDataType et = GetType();
         if( et <= SbxSTRING )
         {
+            assert(et >= 0 && size_t(et) < std::size(cSuffixes) - 1);
             cType = cSuffixes[ et ];
         }
         if( cType != ' ' )
@@ -249,7 +250,7 @@ const OUString& SbxVariable::GetName( SbxNameType t ) const
             aTmp.append( GetSbxRes( StringId::ByRef ) );
         }
         aTmp.append( i->aName );
-        cType = ' ';
+        sal_Unicode cType = ' ';
         // short type? Then fetch it, possible this is 0.
         if( t == SbxNameType::ShortTypes )
         {

Reply via email to