Tag: cws_src680_rpt23fix01
User: oj      
Date: 2007-07-16 12:10:02+0000
Modified:
   dba/dbaccess/source/core/dataaccess/documentdefinition.cxx
   dba/dbaccess/source/core/dataaccess/documentdefinition.hxx

Log:
 #i77411# set parent frame at embeded object

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.43&r2=1.43.4.1
Delta lines:  +28 -31
---------------------
--- documentdefinition.cxx      2007-07-06 07:54:16+0000        1.43
+++ documentdefinition.cxx      2007-07-16 12:10:00+0000        1.43.4.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: documentdefinition.cxx,v $
  *
- *  $Revision: 1.43 $
+ *  $Revision: 1.43.4.1 $
  *
- *  last change: $Author: rt $ $Date: 2007/07/06 07:54:16 $
+ *  last change: $Author: oj $ $Date: 2007/07/16 12:10:00 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -665,30 +665,6 @@
 }
 
 // 
-----------------------------------------------------------------------------
-void ODocumentDefinition::impl_appendFrameToDocumentFrames_throw( const 
Reference< XFrame >& _rxFrame )
-{
-    Reference< XModel > xDatabaseDocumentModel;
-    if ( m_pImpl->m_pDataSource )
-        xDatabaseDocumentModel = m_pImpl->m_pDataSource->getModel_noCreate();
-
-    Reference< XController > xDatabaseDocumentController;
-    if ( xDatabaseDocumentModel.is() )
-        xDatabaseDocumentController = 
xDatabaseDocumentModel->getCurrentController();
-
-    Reference< XFramesSupplier > xDatabaseDocumentFramesSupp;
-    if ( xDatabaseDocumentController.is() )
-        xDatabaseDocumentFramesSupp = xDatabaseDocumentFramesSupp.query( 
xDatabaseDocumentController->getFrame() );
-
-    Reference< XFrames > xDatabaseDocumentFrames;
-    if ( xDatabaseDocumentFramesSupp.is() )
-        xDatabaseDocumentFrames = xDatabaseDocumentFramesSupp->getFrames();
-
-    OSL_ENSURE( xDatabaseDocumentFrames.is(), 
"ODocumentDefinition::impl_appendFrameToDocumentFrames_throw: cannot append the 
component frame to the document's frame!" );
-    if ( xDatabaseDocumentFrames.is() )
-        xDatabaseDocumentFrames->append( _rxFrame );
-}
-
-// 
-----------------------------------------------------------------------------
 void ODocumentDefinition::impl_onActivateEmbeddedObject( bool 
_bOpenedInDesignMode )
 {
     try
@@ -712,9 +688,6 @@
 
             // remove the frame from the desktop's frame collection because we 
need full control of it.
             impl_removeFrameFromDesktop_throw( xFrame );
-
-            // ensure that the component's frame is a child of the database 
document's frame
-            impl_appendFrameToDocumentFrames_throw( xFrame );
         }
 
         // ensure that we ourself are kept alive as long as the embedded 
object's frame is
@@ -1280,10 +1253,34 @@
        m_pInterceptor->acquire();
        Reference<XDispatchProviderInterceptor> xInterceptor = m_pInterceptor;
 
-       _rEmbeddedObjectDescriptor.realloc(1);
+       _rEmbeddedObjectDescriptor.realloc(2);
        nLen = 0;
        _rEmbeddedObjectDescriptor[nLen].Name = 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OutplaceDispatchInterceptor"));
        _rEmbeddedObjectDescriptor[nLen++].Value <<= xInterceptor;
+
+    uno::Sequence< uno::Any > aOutFrameProps(2);
+    PropertyValue aProp;
+    aProp.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TopWindow"));
+       aProp.Value <<= sal_True;
+    aOutFrameProps[0] <<= aProp;
+       
+    Reference< XModel > xDatabaseDocumentModel;
+    if ( m_pImpl->m_pDataSource )
+        xDatabaseDocumentModel = m_pImpl->m_pDataSource->getModel_noCreate();
+
+    Reference< XController > xDatabaseDocumentController;
+    if ( xDatabaseDocumentModel.is() )
+        xDatabaseDocumentController = 
xDatabaseDocumentModel->getCurrentController();
+
+    if ( xDatabaseDocumentController.is() )
+    {
+        aProp.Name = 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParentFrame"));
+        aProp.Value <<= xDatabaseDocumentController->getFrame();
+        aOutFrameProps[1] <<= aProp;
+    }
+
+    _rEmbeddedObjectDescriptor[nLen].Name = 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OutplaceFrameProperties"));
+       _rEmbeddedObjectDescriptor[nLen++].Value <<= aOutFrameProps;
 }
 // 
-----------------------------------------------------------------------------
 void ODocumentDefinition::loadEmbeddedObject(const Sequence< sal_Int8 >& 
_aClassID,const Reference<XConnection>& _xConnection,sal_Bool _bReadOnly)

File [changed]: documentdefinition.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/documentdefinition.hxx?r1=1.21&r2=1.21.4.1
Delta lines:  +3 -7
-------------------
--- documentdefinition.hxx      2007-07-06 07:54:31+0000        1.21
+++ documentdefinition.hxx      2007-07-16 12:10:00+0000        1.21.4.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: documentdefinition.hxx,v $
  *
- *  $Revision: 1.21 $
+ *  $Revision: 1.21.4.1 $
  *
- *  last change: $Author: rt $ $Date: 2007/07/06 07:54:31 $
+ *  last change: $Author: oj $ $Date: 2007/07/16 12:10:00 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -208,10 +208,6 @@
     */
     void impl_initObjectEditView( const ::com::sun::star::uno::Reference< 
::com::sun::star::frame::XController >& _rxController );
 
-    /** appends the given frame to the frames collection of our database 
document's current controller
-    */
-    void impl_appendFrameToDocumentFrames_throw( const 
::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame );
-
     /** removes the given frame from the desktop's frame collection
         @raises ::com::sun::star::uno::RuntimeException
     */




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

Reply via email to