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

Justin Luth justin_luth at sil.org
Mon Feb 27 04:26:11 UTC 2017


 basic/source/comp/dim.cxx   |    3 +++
 basic/source/comp/token.cxx |    1 +
 basic/source/inc/token.hxx  |    2 +-
 3 files changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 51eb2ad7a05938b69aa7874caf17079ed6c19e31
Author: Justin Luth <justin_luth at sil.org>
Date:   Tue Feb 21 18:26:20 2017 +0300

    VBA: accept the PtrSafe keyword
    
    64bit MSOffice VBA7 requires the PtrSafe Declare attribute
     #If Win64 Then
       Declare PtrSafe Function aht_apiGetOpenFileName Lib "comdlg32.dll"
     #Else
       Declare Function aht_apiGetOpenFileName Lib "comdlg32.dll"
     #End If
    
    Accept this new keyword to enable compatibility with macros adjusted
    to work in a 64bit MSOffice environment.
    
    Change-Id: I9e64cb5339075cdda2ec91e8128fd0a35d458432
    Reviewed-on: https://gerrit.libreoffice.org/34519
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Justin Luth <justin_luth at sil.org>

diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx
index dc6522c..1ea7ce3 100644
--- a/basic/source/comp/dim.cxx
+++ b/basic/source/comp/dim.cxx
@@ -1012,6 +1012,9 @@ void SbiParser::Declare()
 void SbiParser::DefDeclare( bool bPrivate )
 {
     Next();
+    if( eCurTok == PTRSAFE )
+        Next();
+
     if( eCurTok != SUB && eCurTok != FUNCTION )
     {
       Error( ERRCODE_BASIC_UNEXPECTED, eCurTok );
diff --git a/basic/source/comp/token.cxx b/basic/source/comp/token.cxx
index f422147..b4de0f0 100644
--- a/basic/source/comp/token.cxx
+++ b/basic/source/comp/token.cxx
@@ -138,6 +138,7 @@ static const TokenTable aTokTable_Basic [] = {
     { PRINT,    "Print" },
     { PRIVATE,  "Private" },
     { PROPERTY, "Property" },
+    { PTRSAFE,  "PtrSafe" },
     { PUBLIC,   "Public" },
     { RANDOM,   "Random" },
     { READ,     "Read" },
diff --git a/basic/source/inc/token.hxx b/basic/source/inc/token.hxx
index f9d7c0d..3799d29 100644
--- a/basic/source/inc/token.hxx
+++ b/basic/source/inc/token.hxx
@@ -88,7 +88,7 @@ enum SbiToken {
     FIRSTEXTRA,
     NUMBER=FIRSTEXTRA, FIXSTRING, SYMBOL, CDECL_, BYVAL, BYREF,
     OUTPUT, RANDOM, APPEND, BINARY, ACCESS,
-    LOCK, READ, PRESERVE, BASE, ANY, LIB, OPTIONAL_,
+    LOCK, READ, PRESERVE, BASE, ANY, LIB, OPTIONAL_, PTRSAFE,
     BASIC_EXPLICIT, COMPATIBLE, CLASSMODULE, PARAMARRAY, WITHEVENTS,
 
     // from here there are JavaScript-tokens (same enum so that same type)


More information about the Libreoffice-commits mailing list