User: kz      
Date: 2008-06-25 12:32:55+0000
Modified:
   dba/dbaccess/source/core/dataaccess/documentdefinition.cxx

Log:
 INTEGRATION: CWS dba30d (1.60.6); FILE MERGED
 2008/06/16 04:55:42 fs 1.60.6.5: don't allow form/report macros if the 
document itself is written by a version which already supports DBDoc-level 
macros
 2008/06/10 06:40:40 fs 1.60.6.4: RESYNC: (1.60-1.61); FILE MERGED
 2008/05/30 10:58:09 oj 1.60.6.3: #i88750# special handling for reports as mail
 2008/05/29 14:03:12 oj 1.60.6.2: #i87957# use desktop as parentframe when no 
one is given
 2008/05/22 20:00:59 fs 1.60.6.1: #i89509# when opening an already opened 
documenbt, don't do all the stuff which might confuse us later on, just 
activate the document

File Changes:

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

File [changed]: documentdefinition.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/documentdefinition.cxx?r1=1.62&r2=1.63
Delta lines:  +33 -2
--------------------
--- documentdefinition.cxx      2008-06-16 12:31:02+0000        1.62
+++ documentdefinition.cxx      2008-06-25 12:32:52+0000        1.63
@@ -1011,6 +1011,9 @@
 
         xReportEngine->setReportDefinition(xReportDefinition);
         xReportEngine->setActiveConnection(m_xLastKnownConnection);
+        if ( bOpenHidden )
+            _out_rComponent <<= xReportEngine->createDocumentModel( );
+        else
         _out_rComponent <<= xReportEngine->createDocumentAlive(NULL);
         return;
     }
@@ -1044,6 +1047,24 @@
                 bActivateObject = false;
             }
 
+            // if the object is already opened, do nothing
+            // #i89509# / 2008-05-22 / [EMAIL PROTECTED]
+            if ( m_xEmbeddedObject.is() )
+            {
+                sal_Int32 nCurrentState = m_xEmbeddedObject->getCurrentState();
+                bool bIsActive = ( nCurrentState == EmbedStates::ACTIVE );
+
+                // exception: new-style reports always create a new document 
when "open" is executed
+                Reference< report::XReportDefinition > xReportDefinition( 
getComponent(), UNO_QUERY );
+                bool bIsAliveNewStyleReport = ( xReportDefinition.is() && ( 
bOpen || bOpenForMail ) );
+
+                if ( bIsActive && !bIsAliveNewStyleReport )
+                {
+                    impl_onActivateEmbeddedObject();
+                    return makeAny( getComponent() );
+                }
+            }
+
             m_bOpenInDesign = bOpenInDesign || bOpenForMail;
             onCommandOpenSomething( aCommand.Argument, bActivateObject, 
Environment, aRet );
         }
@@ -1508,7 +1529,11 @@
     // TODO: revert to the disabled code. The current version is just to be 
able
     // to integrate an intermediate version of the CWS, which should behave as
     // if no macros in DB docs are allowed
-    bool bAllowDocumentMacros = true;
+    bool bAllowDocumentMacros = !m_pImpl->m_pDataSource->hasMacroStorages();
+        // even if the current version is not able to create documents which 
contain macros,
+        // later versions will be. Such documents contain macro/script 
storages in the
+        // document root storage, in which case we need to disable the 
per-form/report
+        // scripting.
 
     // if *any* of the objects of the database document already has macros, we 
continue to allow it
     // to have them, until the user did a migration.
@@ -1544,6 +1569,12 @@
     Reference< XFrame > xParentFrame;
     if ( m_pImpl->m_pDataSource )
         xParentFrame = lcl_getDatabaseDocumentFrame( *m_pImpl->m_pDataSource );
+    if ( !xParentFrame.is() )
+    { // i87957 we need a parent frame
+        if ( !m_xDesktop.is() )
+            m_xDesktop.set( m_aContext.createComponent( 
(::rtl::OUString)SERVICE_FRAME_DESKTOP ), UNO_QUERY_THROW );
+        xParentFrame.set(m_xDesktop,uno::UNO_QUERY);
+    }
     OSL_ENSURE( xParentFrame.is(), "ODocumentDefinition::fillLoadArgs: no 
parent frame!" );
     if  ( xParentFrame.is() )
         OutplaceFrameProperties.put( "ParentFrame", xParentFrame );




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

Reply via email to