User: vg      
Date: 05/03/10 08:44:11

Modified:
 /dba/dbaccess/source/ui/app/
  AppControllerGen.cxx

Log:
 INTEGRATION: CWS dba24 (1.9.4); FILE MERGED
 2005/03/08 10:16:41 oj 1.9.4.3: RESYNC: (1.9-1.10); FILE MERGED
 2005/02/18 12:27:21 oj 1.9.4.2: #i42460# changes for the separation of 
datasource and database document(model)
 2005/02/03 13:53:47 oj 1.9.4.1: #i41913# set suspended back to before if failed

File Changes:

Directory: /dba/dbaccess/source/ui/app/
=======================================

File [changed]: AppControllerGen.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppControllerGen.cxx?r1=1.10&r2=1.11
Delta lines:  +43 -24
---------------------
--- AppControllerGen.cxx        1 Mar 2005 19:14:59 -0000       1.10
+++ AppControllerGen.cxx        10 Mar 2005 16:44:07 -0000      1.11
@@ -176,6 +176,7 @@
 using namespace ::com::sun::star::container;
 using namespace ::com::sun::star::ucb;
 //........................................................................
+// 
-----------------------------------------------------------------------------
 void OApplicationController::convertToView(const ::rtl::OUString& _sName)
 {
        try
@@ -364,7 +365,7 @@
        }
 
        EventObject aEvt;
-       aEvt.Source = m_xDataSource;
+       aEvt.Source = m_xModel;
        modified(aEvt);
 }
 // 
-----------------------------------------------------------------------------
@@ -455,26 +456,19 @@
        }
 }
 // 
-----------------------------------------------------------------------------
-sal_Bool OApplicationController::suspendDocuments(sal_Bool bSuspend)
+sal_Bool OApplicationController::suspendDocument(const TDocuments::key_type& 
_xComponent,sal_Bool _bSuspend)
 {
-       sal_Bool bSubSuspended = sal_True;
-       Reference<XModel> xModel;
-       TDocuments::iterator aIter = m_aDocuments.begin();
-       TDocuments::iterator aEnd = m_aDocuments.end();
-       try
-       {
-               for (; aIter != aEnd && bSubSuspended; ++aIter)
-               {
+       sal_Bool bSuspended = sal_True;
                        Reference<XController> xController;
-                       xModel.set(aIter->first,UNO_QUERY);
+       Reference<XModel> xModel(_xComponent,UNO_QUERY);
                        if ( xModel.is() )
                                xController = xModel->getCurrentController();
                        else
                        {
-                               xController.set(aIter->first,UNO_QUERY);
+               xController.set(_xComponent,UNO_QUERY);
                                if ( !xController.is() )
                                {
-                                       Reference<XFrame> 
xFrame(aIter->first,UNO_QUERY);
+                       Reference<XFrame> xFrame(_xComponent,UNO_QUERY);
                                        if ( xFrame.is() )
                                                xController = 
xFrame->getController();
                                }
@@ -482,10 +476,22 @@
 
 
                        if ( xController.is() && xController != *this )
+               bSuspended = xController->suspend(_bSuspend);
+
+       return bSuspended;
+}
+// 
-----------------------------------------------------------------------------
+sal_Bool OApplicationController::suspendDocuments(sal_Bool bSuspend)
+{
+       sal_Bool bSubSuspended = sal_True;
+       Reference<XModel> xModel;
+       TDocuments::iterator aIter = m_aDocuments.begin();
+       TDocuments::iterator aEnd = m_aDocuments.end();
+       sal_Int32 nSuspendPos = 1;
+       try
                        {
-                               bSubSuspended = xController->suspend(bSuspend);
-                       }
-               }
+               for (; aIter != aEnd && bSubSuspended; ++aIter,++nSuspendPos)
+                       bSubSuspended = suspendDocument(aIter->first,bSuspend);
        }
        catch(Exception)
        {
@@ -542,6 +548,19 @@
                {
                }
                m_aDocuments.clear();
+       }
+       else // resuspend the documents again
+       {
+               aIter = m_aDocuments.begin();
+               aEnd = m_aDocuments.end();
+               try
+               {
+                       for (; aIter != aEnd && nSuspendPos ; 
++aIter,--nSuspendPos)
+                               suspendDocument(aIter->first,!bSuspend);
+               }
+               catch(Exception)
+               {
+               }
        }
 
        return bSubSuspended;




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

Reply via email to