summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorAndreas Heinisch <andreas.heinisch@yahoo.de>2023-05-09 11:43:45 +0200
committerAndreas Heinisch <andreas.heinisch@yahoo.de>2023-05-09 14:12:54 +0200
commitfa0a1f6462c050bdd14a4f75589eb324c6575a91 (patch)
treecf6128c6925e7d5430e186ef007f13404ea3ffc6 /basic
parentf75b4eca9f9f81abbace8fdf192293feed90565c (diff)
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>
Diffstat (limited to 'basic')
-rw-r--r--basic/qa/vba_tests/constants.vb9
-rw-r--r--basic/source/comp/parser.cxx9
2 files changed, 18 insertions, 0 deletions
diff --git a/basic/qa/vba_tests/constants.vb b/basic/qa/vba_tests/constants.vb
index be7add515e83..c31444889fae 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 70bc27dcd16b..97bd27675fa8 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);