Tag: cws_dev300_odbmacros3 User: fs Date: 2008-05-08 10:10:42+0000 Modified: dba/dbaccess/source/ext/macromigration/macromigrationdialog.cxx
Log: tuned the error handling File Changes: Directory: /dba/dbaccess/source/ext/macromigration/ =================================================== File [changed]: macromigrationdialog.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ext/macromigration/macromigrationdialog.cxx?r1=1.3.2.4&r2=1.3.2.5 Delta lines: +20 -3 -------------------- --- macromigrationdialog.cxx 2008-05-07 08:38:18+0000 1.3.2.4 +++ macromigrationdialog.cxx 2008-05-08 10:10:39+0000 1.3.2.5 @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: macromigrationdialog.cxx,v $ - * $Revision: 1.3.2.4 $ + * $Revision: 1.3.2.5 $ * * This file is part of OpenOffice.org. * @@ -252,11 +252,17 @@ break; case STATE_SUMMARY: - defaultButton( WZB_FINISH ); // disable the previous step - we can't return to the actual migration, it already happened (or failed) enableState( STATE_MIGRATE, false ); updateTravelUI(); - dynamic_cast< ResultPage& >( *GetPage( STATE_SUMMARY ) ).displaySummary( m_pData->aLogger.getCompleteLog() ); + + // display the results + dynamic_cast< ResultPage& >( *GetPage( STATE_SUMMARY ) ).displayMigrationLog( + m_pData->bMigrationSuccess, m_pData->aLogger.getCompleteLog() ); + + enableButtons( WZB_FINISH, m_pData->bMigrationSuccess ); + enableButtons( WZB_CANCEL, m_pData->bMigrationFailure ); + defaultButton( m_pData->bMigrationSuccess ? WZB_FINISH : WZB_CANCEL ); break; default: @@ -451,6 +457,8 @@ // reset the modified flag of the document, so the controller can be suspended later Reference< XModifiable > xModify( xDocument, UNO_QUERY_THROW ); xModify->setModified( sal_False ); + // after this reload, don't show the migration warning, again + aDocumentArgs.put( "SuppressMigrationWarning", sal_Bool(sal_True) ); } // remove anything from the args which might refer to the old document @@ -528,6 +536,15 @@ } m_pData->xDocument = xNewDocument; + + // finally, now that the document has been reloaded - if the migration was not successful, + // then it was reloaded from the backup, but the real document still is broken. So, save + // the document once, which will write the content loaded from the backup to the real docfile. + Reference< XModifiable > xModify( m_pData->xDocument, UNO_QUERY_THROW ); + xModify->setModified( sal_True ); + // this is just parnoia - in case saving the doc fails, perhaps the user is tempted to do so + Reference< XStorable > xStor( m_pData->xDocument, UNO_QUERY_THROW ); + xStor->store(); } catch( const Exception& ) { --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
