Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/2758

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/58/2758/1

detect follow-on default member of default member object bnc#809017

Change-Id: I366c049fc342240081957b81d2f28bfcf8d4e331
---
M basic/source/classes/sbunoobj.cxx
M basic/source/runtime/step2.cxx
2 files changed, 29 insertions(+), 0 deletions(-)



diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 4ac95f0..9267909 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -296,6 +296,10 @@
             Any aAny;
             aAny <<= xOLEObject;
             pUnoObj = new SbUnoObject( aType, aAny );
+            ::rtl::OUString sDfltPropName;
+
+            if ( SbUnoObject::getDefaultPropName( pUnoObj, sDfltPropName ) )
+                pUnoObj->SetDfltProperty( sDfltPropName );
         }
     }
     return pUnoObj;
diff --git a/basic/source/runtime/step2.cxx b/basic/source/runtime/step2.cxx
index 0f6c07bd..cc2fff5 100644
--- a/basic/source/runtime/step2.cxx
+++ b/basic/source/runtime/step2.cxx
@@ -43,6 +43,7 @@
 
 SbxVariable* getVBAConstant( const OUString& rName );
 
+SbxVariable* getDefaultProp( SbxVariable* pRef );
 
 // the bits in the String-ID:
 // 0x8000 - Argv is reserved
@@ -606,6 +607,30 @@
                         }
                         else
                         {
+                            // check if there isn't a default member between the current variable
+                            // and the params, e.g.
+                            //   Dim rst1 As New ADODB.Recordset
+                            //      "
+                            //   val = rst1("FirstName")
+                            // has the default 'Fields' member between rst1 and '("FirstName")'
+                            SbxVariable* pDflt = getDefaultProp( pElem );
+                            if ( pDflt )
+                            {
+                                pDflt->Broadcast( SBX_HINT_DATAWANTED );
+                                SbxBaseRef pObj = (SbxBase*)pDflt->GetObject();
+                                if( pObj )
+                                {
+                                    if( pObj->ISA(SbUnoObject) )
+                                    {
+                                        pUnoObj = (SbUnoObject*)(SbxBase*)pObj;
+                                        Any aAny = pUnoObj->getUnoAny();
+
+                                        if( aAny.getValueType().getTypeClass() == 
TypeClass_INTERFACE )
+                                            x = *(Reference< XInterface >*)aAny.getValue();
+                                        pElem = pDflt;
+                                    }
+                                }
+                            }
                             OUString sDefaultMethod;
 
                             Reference< XDefaultMethod > xDfltMethod( x, UNO_QUERY );

-- 
To view, visit https://gerrit.libreoffice.org/2758
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I366c049fc342240081957b81d2f28bfcf8d4e331
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Noel Power <noel.power@suse.com>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.