summaryrefslogtreecommitdiffstats
path: root/basic/source/runtime/runtime.cxx
diff options
context:
space:
mode:
authorU-DESKTOP-8OSNV7R\DrRobotto <andreas.heinisch@yahoo.de>2019-12-24 12:22:34 +0100
committerMike Kaganski <mike.kaganski@collabora.com>2020-01-05 21:42:27 +0100
commit0b4f8bf571baf2ccd5a8aafdc4deb41867420be3 (patch)
tree5f5af8179e6180f118000df70f49e9783bf66c98 /basic/source/runtime/runtime.cxx
parentUpdate git submodules (diff)
downloadcore-0b4f8bf571baf2ccd5a8aafdc4deb41867420be3.tar.gz
core-0b4f8bf571baf2ccd5a8aafdc4deb41867420be3.zip
tdf#129596 Distinguish between integer and long while loading immediate values
During the generation of CONST_ expressions, distinguish between integer and long and load the correct value in the immediate load step. Change-Id: Ib4eb65d7fae3163043899ad8234816b1ebd7316b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85779 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'basic/source/runtime/runtime.cxx')
-rwxr-xr-x[-rw-r--r--]basic/source/runtime/runtime.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index d2cb9fe988b5..3a9cb95264d5 100644..100755
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -2803,8 +2803,18 @@ void SbiRuntime::StepLOADSC( sal_uInt32 nOp1 )
void SbiRuntime::StepLOADI( sal_uInt32 nOp1 )
{
SbxVariable* p = new SbxVariable;
- p->PutInteger( static_cast<sal_Int16>( nOp1 ) );
- PushVar( p );
+
+ OUString aStr = pImg->GetString(static_cast<short>(nOp1));
+ double n = ::rtl::math::stringToDouble(aStr, '.', ',');
+ if (n >= SbxMININT && n <= SbxMAXINT)
+ {
+ p->PutInteger(static_cast<sal_Int16>(n));
+ }
+ else
+ {
+ p->PutLong(static_cast<sal_Int32>(n));
+ }
+ PushVar(p);
}
// store a named argument in Argv (+Arg-no. from 1!)