Tag: cws_src680_rptwizard01
User: lla     
Date: 2008-02-14 13:20:26+0000
Modified:
   dba/dbaccess/source/core/dataaccess/documentcontainer.cxx
   dba/dbaccess/source/core/dataaccess/documentdefinition.cxx
   dba/dbaccess/source/core/dataaccess/documentdefinition.hxx
   dba/dbaccess/source/core/dataaccess/intercept.cxx

Log:
 #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]: documentcontainer.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/documentcontainer.cxx?r1=1.26&r2=1.26.48.1
Delta lines:  +21 -4
--------------------
--- documentcontainer.cxx       2007-11-21 15:38:50+0000        1.26
+++ documentcontainer.cxx       2008-02-14 13:20:23+0000        1.26.48.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: documentcontainer.cxx,v $
  *
- *  $Revision: 1.26 $
+ *  $Revision: 1.26.48.1 $
  *
- *  last change: $Author: ihi $ $Date: 2007/11/21 15:38:50 $
+ *  last change: $Author: lla $ $Date: 2008/02/14 13:20:23 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -78,6 +78,7 @@
 #ifndef _DBA_COREDATAACCESS_DATASOURCE_HXX_
 #include "datasource.hxx"
 #endif
+#include <comphelper/classids.hxx>
 #ifndef _COMPHELPER_MIMECONFIGHELPER_HXX_
 #include <comphelper/mimeconfighelper.hxx>
 #endif
@@ -85,6 +86,9 @@
 #include <connectivity/sqlerror.hxx>
 #endif
 
+#include <vcl/svapp.hxx>
+#include <vos/mutex.hxx>
+
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::embed;
@@ -236,7 +240,18 @@
                        }
                        else if ( aValue.Name.equalsAscii("ClassID") )
                        {
-                               aValue.Value >>= aClassID;
+                if (! ( aValue.Value >>= aClassID ) )
+                {
+                    // Extended for usage also with a string
+                    ::rtl::OUString suValue;
+                    aValue.Value >>= suValue;
+                    aClassID = 
::comphelper::MimeConfigurationHelper::GetSequenceClassIDRepresentation( 
suValue );
+                    
+                }
+                rtl::OUString suClassID = 
::comphelper::MimeConfigurationHelper::GetStringClassIDRepresentation(aClassID);
+                volatile int dummy = 0;
+                (void)dummy;
+                (void)suClassID;
                        }
                        else if ( aValue.Name.equalsAscii(PROPERTY_AS_TEMPLATE) 
)
                        {
@@ -523,6 +538,8 @@
                                                                                
                                                           , sal_Int32 
/*SearchFlags*/
                                                                                
                                                           , const Sequence< 
PropertyValue >& Arguments ) throw (IOException, IllegalArgumentException, 
RuntimeException)
 {
+       vos::OGuard aSolarGuard(Application::GetSolarMutex());
+
        MutexGuard aGuard(m_aMutex);
        Reference< XComponent > xComp;
        try

File [changed]: documentdefinition.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/documentdefinition.cxx?r1=1.50&r2=1.50.46.1
Delta lines:  +25 -8
--------------------
--- documentdefinition.cxx      2007-11-21 15:39:30+0000        1.50
+++ documentdefinition.cxx      2008-02-14 13:20:23+0000        1.50.46.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: documentdefinition.cxx,v $
  *
- *  $Revision: 1.50 $
+ *  $Revision: 1.50.46.1 $
  *
- *  last change: $Author: ihi $ $Date: 2007/11/21 15:39:30 $
+ *  last change: $Author: lla $ $Date: 2008/02/14 13:20:23 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -841,7 +841,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);
 
@@ -967,7 +967,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;
                }
        }
@@ -977,7 +979,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" );
@@ -986,7 +988,7 @@
            if ( bOpen || bOpenInDesign || bOpenForMail )
            {
             m_bOpenInDesign = bOpenInDesign;
-            onCommandOpenSomething( aCommand.Argument, !bOpenForMail, 
Environment, aRet );
+            onCommandOpenSomething( aCommand.Argument, !bOpenForMail, 
Environment, aRet, aGuard );
         }
            else if ( aCommand.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( 
"copyTo" ) ) )
            {
@@ -1055,10 +1057,22 @@
                 xStorage->removeElement(m_pImpl->m_aProps.sPersistentName);
 
             dispose();
+
+           }
+        else if ( aCommand.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( 
"storeOwn" ) ) )
+        {
+                   Reference<XEmbedPersist> 
xPersist(m_xEmbeddedObject,UNO_QUERY);
+                   if ( xPersist.is() )
+                   {
+                           xPersist->storeOwn();
+                           notifyDataSourceModified();
+                   }
            }
            else
+        {
                    aRet = 
OContentHelper::execute(aCommand,CommandId,Environment);
     }
+    }
        return aRet;
 }
 // 
-----------------------------------------------------------------------------
@@ -1665,7 +1679,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
        {
@@ -1680,9 +1694,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()
 {

File [changed]: documentdefinition.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/documentdefinition.hxx?r1=1.24&r2=1.24.46.1
Delta lines:  +7 -5
-------------------
--- documentdefinition.hxx      2007-11-21 15:39:47+0000        1.24
+++ documentdefinition.hxx      2008-02-14 13:20:24+0000        1.24.46.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: documentdefinition.hxx,v $
  *
- *  $Revision: 1.24 $
+ *  $Revision: 1.24.46.1 $
  *
- *  last change: $Author: ihi $ $Date: 2007/11/21 15:39:47 $
+ *  last change: $Author: lla $ $Date: 2008/02/14 13:20:24 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -148,7 +148,7 @@
        sal_Bool save(sal_Bool _bApprove);
        void closeObject();
        sal_Bool isModified();
-       void fillReportData();
+       void fillReportData(::osl::ClearableMutexGuard & _aGuard);
 
     /** prepares closing the document component
 
@@ -265,7 +265,9 @@
        void onCommandInsert( const ::rtl::OUString& _sURL, const 
::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >& 
Environment ) throw( ::com::sun::star::uno::Exception );
        void onCommandPreview( ::com::sun::star::uno::Any& _rImage );
     void onCommandOpenSomething( const ::com::sun::star::uno::Any& _rArgument, 
const bool _bActivate,
-            const ::com::sun::star::uno::Reference< 
::com::sun::star::ucb::XCommandEnvironment >& _rxEnvironment, 
::com::sun::star::uno::Any& _out_rComponent );
+            const ::com::sun::star::uno::Reference< 
::com::sun::star::ucb::XCommandEnvironment >& _rxEnvironment,
+                       ::com::sun::star::uno::Any& _out_rComponent,
+                       ::osl::ClearableMutexGuard & _aClearableGuard);
 };
 
 //........................................................................

File [changed]: intercept.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/intercept.cxx?r1=1.8&r2=1.8.228.1
Delta lines:  +8 -6
-------------------
--- intercept.cxx       2006-09-17 06:40:38+0000        1.8
+++ intercept.cxx       2008-02-14 13:20:24+0000        1.8.228.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: intercept.cxx,v $
  *
- *  $Revision: 1.8 $
+ *  $Revision: 1.8.228.1 $
  *
- *  last change: $Author: obo $ $Date: 2006/09/17 06:40:38 $
+ *  last change: $Author: lla $ $Date: 2008/02/14 13:20:24 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -146,15 +146,17 @@
        PropertyValue >& Arguments )
        throw (RuntimeException)
 {
-       osl::MutexGuard aGuard(m_aMutex);
+       osl::ClearableMutexGuard aClearableGuard(m_aMutex);
        if( m_pContentHolder )
+       {
                if(     _URL.Complete == m_aInterceptedURL[DISPATCH_SAVE] )
                {
                        m_pContentHolder->save(sal_False);
                }
                else if( _URL.Complete == m_aInterceptedURL[DISPATCH_RELOAD] )
                {
-                       m_pContentHolder->fillReportData();
+                       m_pContentHolder->fillReportData(aClearableGuard);
+                       // IMPORTANT: m_aMutex is cleared!
                }
                else if( _URL.Complete == m_aInterceptedURL[DISPATCH_SAVEAS] )
                {
@@ -204,7 +206,7 @@
                        }
                }
 }
-
+}
 void SAL_CALL
 OInterceptor::addStatusListener(
        const Reference<




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

Reply via email to