User: kz      
Date: 2008-06-26 09:00:51+0000
Modified:
   dba/dbaccess/source/core/dataaccess/documentdefinition.cxx

Log:
 INTEGRATION: CWS rptwizard01 (1.50.46); FILE MERGED
 2008/06/09 10:02:11 lla 1.50.46.6: #i90513# declaration of 'aGuard' shadows a 
previous local
 2008/06/09 09:26:38 lla 1.50.46.5: #i90513# fix for saveas of unchanged new 
report
 2008/05/21 10:59:55 lla 1.50.46.4: RESYNC: (1.58-1.60); FILE MERGED
 2008/04/14 10:41:08 lla 1.50.46.3: RESYNC: (1.53-1.58); FILE MERGED
 2008/02/15 07:37:16 lla 1.50.46.2: RESYNC: (1.50-1.53); FILE MERGED
 2008/02/14 13:20:23 lla 1.50.46.1: #i86092# change a mutex to a clearable 
mutex or it could be possible to hang in report wizard

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.63&r2=1.64
Delta lines:  +26 -14
---------------------
--- documentdefinition.cxx      2008-06-25 12:32:52+0000        1.63
+++ documentdefinition.cxx      2008-06-26 09:00:48+0000        1.64
@@ -850,7 +850,7 @@
 
 // 
-----------------------------------------------------------------------------
 void ODocumentDefinition::onCommandOpenSomething( const Any& _rOpenArgument, 
const bool _bActivate,
-    const Reference< XCommandEnvironment >& _rxEnvironment, Any& 
_out_rComponent )
+    const Reference< XCommandEnvironment >& _rxEnvironment, Any& 
_out_rComponent, ::osl::ClearableMutexGuard & _aGuard )
 {
     OExecuteImpl aExecuteGuard(m_bInExecute);
 
@@ -1024,7 +1024,9 @@
         impl_onActivateEmbeddedObject();
        }
 
-       fillReportData();
+    // LLA: Alle fillReportData() calls prüfen, sollte es welche geben, die 
danach noch viel machen
+    // LLA: sollten wir einen _aGuard Pointer übergeben, sonst erstmal als 
Referenz
+    fillReportData(_aGuard);
        _out_rComponent <<= xModel;
 }
 
@@ -1032,7 +1034,7 @@
 Any SAL_CALL ODocumentDefinition::execute( const Command& aCommand, sal_Int32 
CommandId, const Reference< XCommandEnvironment >& Environment ) throw 
(Exception, CommandAbortedException, RuntimeException)
 {
        Any aRet;
-       ::osl::MutexGuard aGuard(m_aMutex);
+       ::osl::ClearableMutexGuard aGuard(m_aMutex);
     if ( !m_bInExecute )
     {
         sal_Bool bOpen = aCommand.Name.equalsAscii( "open" );
@@ -1065,8 +1067,11 @@
                 }
             }
 
+            // m_bOpenInDesign = bOpenInDesign;
+            // onCommandOpenSomething( aCommand.Argument, !bOpenForMail, 
Environment, aRet, aGuard );
+
             m_bOpenInDesign = bOpenInDesign || bOpenForMail;
-            onCommandOpenSomething( aCommand.Argument, bActivateObject, 
Environment, aRet );
+            onCommandOpenSomething( aCommand.Argument, bActivateObject, 
Environment, aRet, aGuard );
         }
            else if ( aCommand.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( 
"copyTo" ) ) )
            {
@@ -1137,6 +1142,7 @@
                 xStorage->removeElement(m_pImpl->m_aProps.sPersistentName);
 
             dispose();
+
            }
         else if (   ( aCommand.Name.compareToAscii( "storeOwn" ) == 0 ) // 
compatibility
                 ||  ( aCommand.Name.compareToAscii( "store" ) == 0 )
@@ -1162,8 +1168,10 @@
             aRet <<= bSuccess;
                }
            else
+        {
                    aRet = 
OContentHelper::execute(aCommand,CommandId,Environment);
     }
+    }
        return aRet;
 }
 // 
-----------------------------------------------------------------------------
@@ -1381,6 +1389,15 @@
        // default handling: instantiate an interaction handler and let it 
handle the parameter request
     if ( !m_bOpenInDesign )
         return sal_False;
+
+       {
+               osl::ClearableGuard< osl::Mutex > aGuard( m_aMutex );
+               if ( !m_pImpl->m_aProps.aTitle.getLength() )
+               {
+                       aGuard.clear();
+                       return save(sal_False); // (sal_False) : we don't want 
an approve dialog
+               }
+       }
        try
        {
                {
@@ -1390,14 +1407,6 @@
                        Reference<XNameAccess> 
xName(m_xParentContainer,UNO_QUERY);
                        DocumentSaveRequest aRequest;
                        aRequest.Name = m_pImpl->m_aProps.aTitle;
-                       if ( !aRequest.Name.getLength() )
-                       {
-                               if ( m_bForm )
-                                       aRequest.Name = DBACORE_RESSTRING( 
RID_STR_FORM );
-                               else
-                                       aRequest.Name = DBACORE_RESSTRING( 
RID_STR_REPORT );
-                               aRequest.Name = 
::dbtools::createUniqueName(xName,aRequest.Name);
-                       }
 
                        aRequest.Content.set(m_xParentContainer,UNO_QUERY);
                        OInteractionRequest* pRequest = new 
OInteractionRequest(makeAny(aRequest));
@@ -1945,7 +1954,7 @@
     return true;
 }
 // 
-----------------------------------------------------------------------------
-void ODocumentDefinition::fillReportData()
+void ODocumentDefinition::fillReportData(::osl::ClearableMutexGuard & _aGuard)
 {
        if ( !m_bForm && m_pImpl->m_aProps.bAsTemplate && !m_bOpenInDesign ) // 
open a report in alive mode, so we need to fill it
        {
@@ -1960,9 +1969,12 @@
 
                Reference< XJobExecutor > xExecuteable( 
m_aContext.createComponentWithArguments( 
"com.sun.star.wizards.report.CallReportWizard", aArgs ), UNO_QUERY );
                if ( xExecuteable.is() )
+               {
+                       _aGuard.clear();
                        
xExecuteable->trigger(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("fill")));
        }
 }
+}
 // 
-----------------------------------------------------------------------------
 void ODocumentDefinition::updateDocumentTitle()
 {




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

Reply via email to