Tag: cws_src680_dba24 User: oj Date: 05/02/03 05:53:50 Modified: /dba/dbaccess/source/ui/app/ AppController.hxx, AppControllerGen.cxx
Log: #i41913# set suspended back to before if failed File Changes: Directory: /dba/dbaccess/source/ui/app/ ======================================= File [changed]: AppController.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppController.hxx?r1=1.8&r2=1.8.4.1 Delta lines: +6 -0 ------------------- --- AppController.hxx 21 Jan 2005 17:05:23 -0000 1.8 +++ AppController.hxx 3 Feb 2005 13:53:47 -0000 1.8.4.1 @@ -389,6 +389,12 @@ */ void askToReconnect(); + /** suspend one document. + @return + <TRUE/> if the document could be suspended, otherwise <FALSE/>. + */ + sal_Bool suspendDocument(const TDocuments::key_type& _xComponent,sal_Bool _bSuspend); + /** suspend all open documents. @return <TRUE/> if all documents could be suspended, otherwise <FALSE/>. File [changed]: AppControllerGen.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppControllerGen.cxx?r1=1.9&r2=1.9.4.1 Delta lines: +42 -23 --------------------- --- AppControllerGen.cxx 21 Jan 2005 17:06:03 -0000 1.9 +++ AppControllerGen.cxx 3 Feb 2005 13:53:47 -0000 1.9.4.1 @@ -176,6 +176,7 @@ using namespace ::com::sun::star::container; using namespace ::com::sun::star::ucb; //........................................................................ +// ----------------------------------------------------------------------------- void OApplicationController::convertToView(const ::rtl::OUString& _sName) { try @@ -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]
