[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3-desktop' - basic/source

Eike Rathke erack at redhat.com
Mon Jul 2 05:41:02 UTC 2018


 basic/source/runtime/stdobj.cxx |   16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

New commits:
commit 87b2a75fb20f7e551c646f5115ce39a27b213d06
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Nov 28 16:21:18 2017 +0100

    Find VBA-only functions when compiling first on module level
    
    This likely never worked as there is no SbiInstance in that step,
    but worked by chance when running a module's code that was
    compiled with VBA support where the VBA-only function was added as
    a symbol to be resolved later during runtime and then the
    SbiInstance exists and the symbol was magically resolved.
    
    Found when trying to correct vba_tests to actually fail if all
    subtests fail that then started to fail in Atn.vb because of the
    Round() function being VBA-only.
    
    Change-Id: I7d9f6e2640a73388a2a58c3d180820c6ef85abe3
    Reviewed-on: https://gerrit.libreoffice.org/45425
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins <ci at libreoffice.org>
    (cherry picked from commit af8431d8dbc59df1e1f17742a1be002b054f3b00)
    Reviewed-on: https://gerrit.libreoffice.org/56790
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    Tested-by: Mike Kaganski <mike.kaganski at collabora.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/basic/source/runtime/stdobj.cxx b/basic/source/runtime/stdobj.cxx
index 80d637aa39bb..a73f7efd764a 100644
--- a/basic/source/runtime/stdobj.cxx
+++ b/basic/source/runtime/stdobj.cxx
@@ -775,11 +775,23 @@ SbxVariable* SbiStdObject::Find( const OUString& rName, SbxClassType t )
              && ( p->nHash == nHash_ )
              && ( rName.equalsIgnoreAsciiCaseAscii( p->pName ) ) )
             {
-                SbiInstance* pInst = GetSbData()->pInst;
                 bFound = true;
                 if( p->nArgs & COMPTMASK_ )
                 {
-                    if ( !pInst || ( pInst->IsCompatibility()  && ( NORMONLY_ & p->nArgs )  ) || ( !pInst->IsCompatibility()  && ( COMPATONLY_ & p->nArgs )  ) )
+                    bool bCompatibility = false;
+                    SbiInstance* pInst = GetSbData()->pInst;
+                    if (pInst)
+                    {
+                        bCompatibility = pInst->IsCompatibility();
+                    }
+                    else
+                    {
+                        // No instance running => compiling a source on module level.
+                        const SbModule* pModule = GetSbData()->pCompMod;
+                        if (pModule)
+                            bCompatibility = pModule->IsVBACompat();
+                    }
+                    if ((bCompatibility && (NORMONLY_ & p->nArgs)) || (!bCompatibility && (COMPATONLY_ & p->nArgs)))
                         bFound = false;
                 }
                 break;


More information about the Libreoffice-commits mailing list