Tag: cws_src680_dba24c
User: fs      
Date: 2007-10-22 08:25:27+0000
Modified:
   dba/dbaccess/source/core/dataaccess/databasedocument.cxx

Log:
 #i52527#/#i73705#: connectController: check the DB doc's macro mode

File Changes:

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

File [changed]: databasedocument.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/databasedocument.cxx?r1=1.34&r2=1.34.4.1
Delta lines:  +25 -4
--------------------
--- databasedocument.cxx        2007-09-26 14:39:51+0000        1.34
+++ databasedocument.cxx        2007-10-22 08:25:24+0000        1.34.4.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: databasedocument.cxx,v $
  *
- *  $Revision: 1.34 $
+ *  $Revision: 1.34.4.1 $
  *
- *  last change: $Author: hr $ $Date: 2007/09/26 14:39:51 $
+ *  last change: $Author: fs $ $Date: 2007/10/22 08:25:24 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -45,6 +45,7 @@
 #include "dbastrings.hrc"
 #endif
 #include <comphelper/documentconstants.hxx>
+#include <comphelper/namedvaluecollection.hxx>
 #include <comphelper/enumhelper.hxx>
 #ifndef _COM_SUN_STAR_EMBED_XTRANSACTEDOBJECT_HPP_
 #include <com/sun/star/embed/XTransactedObject.hpp>
@@ -208,7 +209,6 @@
 void lcl_stripLoadArguments( ::comphelper::MediaDescriptor& _rDescriptor, 
Sequence< PropertyValue >& _rArgs )
 {
     _rDescriptor.erase( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 
"StatusIndicator" ) ) );
-    _rDescriptor.erase( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 
"InteractionHandler" ) ) );
        _rDescriptor.erase( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 
"Model" ) ) );
     _rDescriptor >> _rArgs;
 }
@@ -340,7 +340,28 @@
 void SAL_CALL ODatabaseDocument::connectController( const Reference< 
XController >& _xController ) throw (RuntimeException)
 {
     ModelMethodGuard aGuard( *this );
+
     m_aControllers.push_back( _xController );
+
+    if ( m_aControllers.size() == 1 )
+    {
+        // check/adjust our macro mode. Note: This is only temporary. When we 
fully support the
+        // XEmbeddedScripts interface, then the controller is able to do this 
itself, since
+        // we'll then have a UNO method for this.
+        //
+        // Also, the same has to happen in the loader then, since the checks 
must be made
+        // *before* OnLoad events are triggered - finally, the user can bind 
events to OnLoad ...
+        // (This, at the latest, implies we need a UNO equivalent for 
checkMacrosOnLoading, else
+        //  the loader can't call it.)
+        //
+        // For now, as long as we do not have own macros, but only those in 
the embedded
+        // forms/reports, it's sufficient to do the check here.
+        //
+        ::comphelper::NamedValueCollection aArgs( m_pImpl->m_aArgs );
+        Reference< XInteractionHandler > xInteraction;
+        xInteraction = aArgs.getOrDefault( "InteractionHandler", xInteraction 
);
+        m_pImpl->m_aMacroMode.checkMacrosOnLoading( xInteraction );
+    }
 }
 // 
-----------------------------------------------------------------------------
 void SAL_CALL ODatabaseDocument::disconnectController( const Reference< 
XController >& _xController ) throw (RuntimeException)




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

Reply via email to