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

2020-01-05 Thread U-DESKTOP-8OSNV7RDrRobotto (via logerrit)
 basic/qa/vba_tests/typename.vb   |6 ++
 basic/source/comp/exprgen.cxx|4 +++-
 basic/source/runtime/runtime.cxx |   14 --
 3 files changed, 21 insertions(+), 3 deletions(-)

New commits:
commit 0b4f8bf571baf2ccd5a8aafdc4deb41867420be3
Author: U-DESKTOP-8OSNV7R\DrRobotto 
AuthorDate: Tue Dec 24 12:22:34 2019 +0100
Commit: Mike Kaganski 
CommitDate: Sun Jan 5 21:42:27 2020 +0100

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 

diff --git a/basic/qa/vba_tests/typename.vb b/basic/qa/vba_tests/typename.vb
index 4ec2f3e31063..7e49a4d61cdc 100644
--- a/basic/qa/vba_tests/typename.vb
+++ b/basic/qa/vba_tests/typename.vb
@@ -61,6 +61,12 @@ Function verify_testTypeName() As String
 date1 = TypeName(l1)
 TestLog_ASSERT date1 = date2, "the return TypeName is: " & date1
 
+' tdf#129596 - Types of constant values
+TestLog_ASSERT TypeName(32767) = "Integer", "the return TypeName(32767) 
is: " & TypeName(32767)
+TestLog_ASSERT TypeName(-32767) = "Integer", "the return TypeName(-32767) 
is: " & TypeName(-32767)
+TestLog_ASSERT TypeName(1048575) = "Long", "the return TypeName(1048575) 
is: " & TypeName(1048575)
+TestLog_ASSERT TypeName(-1048575) = "Long", "the return TypeName(-1048575) 
is: " & TypeName(-1048575)
+
 result = result & Chr$(10) & "Tests passed: " & passCount & Chr$(10) & 
"Tests failed: " & failCount & Chr$(10)
 verify_testTypeName = result
 
diff --git a/basic/source/comp/exprgen.cxx b/basic/source/comp/exprgen.cxx
old mode 100644
new mode 100755
index d1ebb48c4c09..3981bef2fb5e
--- a/basic/source/comp/exprgen.cxx
+++ b/basic/source/comp/exprgen.cxx
@@ -72,8 +72,10 @@ void SbiExprNode::Gen( SbiCodeGen& rGen, RecursiveMode 
eRecMode )
 case SbxEMPTY:
 rGen.Gen( SbiOpcode::EMPTY_ );
 break;
+case SbxLONG:
 case SbxINTEGER:
-rGen.Gen( SbiOpcode::CONST_,  static_cast(nVal) );
+nStringId = rGen.GetParser()->aGblStrings.Add(nVal, eType);
+rGen.Gen( SbiOpcode::CONST_, nStringId );
 break;
 case SbxSTRING:
 nStringId = rGen.GetParser()->aGblStrings.Add( aStrVal );
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
old mode 100644
new mode 100755
index d2cb9fe988b5..3a9cb95264d5
--- 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( nOp1 ) );
-PushVar( p );
+
+OUString aStr = pImg->GetString(static_cast(nOp1));
+double n = ::rtl::math::stringToDouble(aStr, '.', ',');
+if (n >= SbxMININT && n <= SbxMAXINT)
+{
+p->PutInteger(static_cast(n));
+}
+else
+{
+p->PutLong(static_cast(n));
+}
+PushVar(p);
 }
 
 // store a named argument in Argv (+Arg-no. from 1!)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-01-01 Thread U-DESKTOP-8OSNV7RDrRobotto (via logerrit)
 basctl/source/basicide/basides1.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 83955c30405b086fb9b753f2734827c63e951c91
Author: U-DESKTOP-8OSNV7R\DrRobotto 
AuthorDate: Tue Dec 31 18:35:10 2019 +0100
Commit: Tomaž Vajngerl 
CommitDate: Wed Jan 1 19:20:55 2020 +0100

tdf#126506 - Adjusted height margin of the tab bar

Adjusted the height margin of the tab bar in the Basic IDE in order
to reflect the new look of the TabBar from tdf#124572.

Change-Id: I4fadec983405b05c7330f762f4ed2e12d3a40d27
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86048
Reviewed-by: Tomaž Vajngerl 
Tested-by: Jenkins

diff --git a/basctl/source/basicide/basides1.cxx 
b/basctl/source/basicide/basides1.cxx
old mode 100644
new mode 100755
index 3e2b585ad320..79c809927fb2
--- a/basctl/source/basicide/basides1.cxx
+++ b/basctl/source/basicide/basides1.cxx
@@ -56,6 +56,8 @@
 #include 
 #include 
 
+constexpr sal_Int32 TAB_HEIGHT_MARGIN = 10;
+
 namespace basctl
 {
 
@@ -1329,7 +1331,7 @@ void Shell::AdjustPosSizePixel( const Point , const 
Size  )
 return;
 
 Size aTabBarSize;
-aTabBarSize.setHeight( 
GetViewFrame()->GetWindow().GetFont().GetFontHeight() + 4 );
+aTabBarSize.setHeight( 
GetViewFrame()->GetWindow().GetFont().GetFontHeight() + TAB_HEIGHT_MARGIN );
 aTabBarSize.setWidth( rSize.Width() );
 
 Size aSz( rSize );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits