tdf#153543 - Add vba shell constants
Change-Id: Ifa73050f6892ce8ce95d16dedc166e68d1809491
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151567
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
(cherry picked from commit fa0a1f6462c050bdd14a4f75589eb324c6575a91)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151522
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
diff --git a/basic/qa/vba_tests/constants.vb b/basic/qa/vba_tests/constants.vb
index be7add5..c314448 100644
--- a/basic/qa/vba_tests/constants.vb
+++ b/basic/qa/vba_tests/constants.vb
@@ -25,6 +25,15 @@ Sub verify_testConstants()
TestUtil.AssertEqual(vbNewLine, vbLf, "vbNewline")
End If
' tdf#153543 - check for vba shell constants
' See https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/shell-constants
TestUtil.AssertEqual(vbHide, 0, "vbHide")
TestUtil.AssertEqual(vbNormalFocus, 1, "vbNormalFocus")
TestUtil.AssertEqual(vbMinimizedFocus, 2, "vbMinimizedFocus")
TestUtil.AssertEqual(vbMaximizedFocus, 3, "vbMaximizedFocus")
TestUtil.AssertEqual(vbNormalNoFocus, 4, "vbNormalNoFocus")
TestUtil.AssertEqual(vbMinimizedNoFocus, 6, "vbMinimizedNoFocus")
' tdf#131563 - check for vba color constants
' See https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/color-constants
TestUtil.AssertEqual(vbBlack, RGB(0, 0, 0), "vbBlack")
diff --git a/basic/source/comp/parser.cxx b/basic/source/comp/parser.cxx
index 70bc27d..97bd276 100644
--- a/basic/source/comp/parser.cxx
+++ b/basic/source/comp/parser.cxx
@@ -849,6 +849,15 @@ static void addNumericConst(SbiSymPool& rPool, const OUString& pSym, double nVal
void SbiParser::AddConstants()
{
// tdf#153543 - shell constants
// See https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/shell-constants
addNumericConst(aPublics, "vbHide", 0);
addNumericConst(aPublics, "vbNormalFocus", 1);
addNumericConst(aPublics, "vbMinimizedFocus", 2);
addNumericConst(aPublics, "vbMaximizedFocus", 3);
addNumericConst(aPublics, "vbNormalNoFocus", 4);
addNumericConst(aPublics, "vbMinimizedNoFocus", 6);
// tdf#131563 - add vba color constants
// See https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/color-constants
addNumericConst(aPublics, "vbBlack", 0x0);