Tag: cws_dev300_dba30b
User: fs      
Date: 2008-03-17 10:54:24+0000
Modified:
   dba/dbaccess/source/core/dataaccess/databasecontext.cxx

Log:
 for convenience: as long as 'macros in database documents' are not 
implemented, still add the 'ThisDatabaseDocument' variable to the BasicManager 
of a form/report

File Changes:

Directory: /dba/dbaccess/source/core/dataaccess/
================================================

File [changed]: databasecontext.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/databasecontext.cxx?r1=1.38.4.2&r2=1.38.4.3
Delta lines:  +12 -4
--------------------
--- databasecontext.cxx 2008-03-17 10:11:03+0000        1.38.4.2
+++ databasecontext.cxx 2008-03-17 10:54:22+0000        1.38.4.3
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: databasecontext.cxx,v $
  *
- *  $Revision: 1.38.4.2 $
+ *  $Revision: 1.38.4.3 $
  *
- *  last change: $Author: fs $ $Date: 2008/03/17 10:11:03 $
+ *  last change: $Author: fs $ $Date: 2008/03/17 10:54:22 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -698,9 +698,17 @@
 // 
-----------------------------------------------------------------------------
 void ODatabaseContext::onBasicManagerCreated( const Reference< XModel >& 
_rxForDocument, BasicManager& _rBasicManager )
 {
-    // if it's a database document whose BasicManager has just been created, 
add the global
-    // DatabaseDocument variable to its scope.
+    // if it's a database document ...
     Reference< XOfficeDatabaseDocument > xDatabaseDocument( _rxForDocument, 
UNO_QUERY );
+    // ... or a sub document of a database document ...
+    if ( !xDatabaseDocument.is() )
+    {
+        Reference< XChild > xDocAsChild( _rxForDocument, UNO_QUERY );
+        if ( xDocAsChild.is() )
+            xDatabaseDocument.set( xDocAsChild->getParent(), UNO_QUERY );
+    }
+
+    // ... whose BasicManager has just been created, then add the global 
DatabaseDocument variable to its scope.
     if ( xDatabaseDocument.is() )
         _rBasicManager.SetGlobalUNOConstant( "ThisDatabaseDocument", makeAny( 
xDatabaseDocument ) );
 }




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to