summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-11-14 14:18:51 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-11-14 14:31:24 +0000
commit9dacd849b6ba76bab36558ad9e5d5614cd9fa29e (patch)
tree45aca24e6d04436bd9138cabae2692a5701466c9
parente8fbdb374a1f8c5f97dedb53922746d41699c39b (diff)
this is for detecting the type of a variable based on its name
which means legal input is any character which a variable can start with Change-Id: I0c2d13a92ba374f8020e86e90e8e5f18ce8a9c90
-rw-r--r--basic/source/comp/symtbl.cxx13
1 files changed, 5 insertions, 8 deletions
diff --git a/basic/source/comp/symtbl.cxx b/basic/source/comp/symtbl.cxx
index 594b1d38f44b..99e02e3b3ae5 100644
--- a/basic/source/comp/symtbl.cxx
+++ b/basic/source/comp/symtbl.cxx
@@ -318,6 +318,8 @@ void SbiSymDef::SetType( SbxDataType t )
{
if( t == SbxVARIANT && pIn )
{
+ //See if there have been any deftype statements to set the default type
+ //of a variable based on its starting letter
sal_Unicode cu = aName[0];
if( cu < 256 )
{
@@ -327,14 +329,9 @@ void SbiSymDef::SetType( SbxDataType t )
ch = 'Z';
}
int ch2 = toupper( ch );
- unsigned char c = (unsigned char)ch2;
- if( c > 0 && c < 128 )
- {
- int nIndex = ch2 - 'A';
- assert(nIndex >= 0 && nIndex < N_DEF_TYPES);
- if (nIndex >= 0 && nIndex < N_DEF_TYPES)
- t = pIn->pParser->eDefTypes[nIndex];
- }
+ int nIndex = ch2 - 'A';
+ if (nIndex >= 0 && nIndex < N_DEF_TYPES)
+ t = pIn->pParser->eDefTypes[nIndex];
}
}
eType = t;