summaryrefslogtreecommitdiff
path: root/offapi
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2022-10-06 19:35:21 -0400
committerJustin Luth <jluth@mail.com>2022-10-08 16:14:05 +0200
commit3d77fe0af515830001448fde0d394ef20a89002b (patch)
treee67d4dcbeed77fc31ea3dd69d903f661eea93810 /offapi
parent07211eda0c90d54d8993febd2af4d9811249a063 (diff)
tdf#148806 doc vba: highest priority is ThisDocument AutoOpen
Word has three ways of running events at doc open, although the two AutoOpen methods are exclusive. One is the special ThisDocument Document_open subroutine. Another is the AutoOpen subroutine, which is what this patch is about. It can exist in any module - first come first served (alphabetically) in doc - except that ThisDocument is checked first. [This is very different from Calc - which IGNORES these functions in ThisWorksheet.] //TODO: The subroutine must be public And finally, there can be an AutoOpen module with a Main subroutine. It is ignored if there is any AutoOpen subroutine. //TODO: fix the third way. I tried to create a unit test, but LO's Selection.TypeText always starts at position 0 for each call, unlike Word which also starts at position 0 for the first call, but then remembers where it left off. Change-Id: I4caf29eefd432c320b5acaf6210222f50a111e89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141037 Tested-by: Justin Luth <jluth@mail.com> Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'offapi')
-rw-r--r--offapi/com/sun/star/script/vba/VBAEventId.idl5
1 files changed, 5 insertions, 0 deletions
diff --git a/offapi/com/sun/star/script/vba/VBAEventId.idl b/offapi/com/sun/star/script/vba/VBAEventId.idl
index 00989fccd053..00a524a1ef3b 100644
--- a/offapi/com/sun/star/script/vba/VBAEventId.idl
+++ b/offapi/com/sun/star/script/vba/VBAEventId.idl
@@ -58,6 +58,11 @@ constants VBAEventId
const long DOCUMENT_OPEN = 1002;
/** Document about to be closed. No arguments. */
const long DOCUMENT_CLOSE = 1003;
+ // auto* subroutines in ThisDocument have highest priority
+ const long DOCUMENT_AUTO_NEW = 1004;
+ const long DOCUMENT_AUTO_OPEN = 1005;
+ const long DOCUMENT_AUTO_CLOSE = 1006;
+
// MS Excel (identifiers from 2001 to 2999)