Tag: cws_dev300_dba30d
User: fs      
Date: 2008-05-22 20:01:02+0000
Modified:
   dba/dbaccess/source/core/dataaccess/documentdefinition.cxx

Log:
 #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.60&r2=1.60.6.1
Delta lines:  +20 -2
--------------------
--- documentdefinition.cxx      2008-05-05 15:50:24+0000        1.60
+++ documentdefinition.cxx      2008-05-22 20:00:59+0000        1.60.6.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: documentdefinition.cxx,v $
- * $Revision: 1.60 $
+ * $Revision: 1.60.6.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -1039,6 +1039,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 );
         }




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

Reply via email to