summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorAndreas Heinisch <andreas.heinisch@yahoo.de>2023-05-09 11:43:45 +0200
committerAndras Timar <andras.timar@collabora.com>2023-05-13 20:05:33 +0200
commit207e2e67cb009501654297625fd6bf0d64570e63 (patch)
treef00423c5e2cd1411fb779e2452310b86e3032711 /basic
parent7c0f9682a1ddd61a85edab79dd2306e6de823327 (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> (cherry picked from commit fa0a1f6462c050bdd14a4f75589eb324c6575a91) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151522 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
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);