diff options
author | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-01-13 15:46:51 +0100 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-01-13 15:46:51 +0100 |
commit | d5dd9e7ed9e39096be2071296593420ed38f0cca (patch) | |
tree | 241b61053fc4f39550b579dee5c8f2f2421d4d79 /dbaccess/source/ui/app/AppControllerGen.cxx | |
parent | 08284bee522c0639de09e147fc1cb7b3b4021f67 (diff) |
autorecovery: save open/modified (Writer-based) reports and forms, when doing a session/emergency save
Still, the documents are stored only, and not loaded. For storing, there's at least one known issue: The controller
is unable to deliver the proper object name for a form which has been newly created, and then saved. In this
case, an empty name (from the time where the form was created) will be returned, and used in the save process.
Diffstat (limited to 'dbaccess/source/ui/app/AppControllerGen.cxx')
-rw-r--r-- | dbaccess/source/ui/app/AppControllerGen.cxx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/dbaccess/source/ui/app/AppControllerGen.cxx b/dbaccess/source/ui/app/AppControllerGen.cxx index 7e08e4016..45fa4a985 100644 --- a/dbaccess/source/ui/app/AppControllerGen.cxx +++ b/dbaccess/source/ui/app/AppControllerGen.cxx @@ -90,6 +90,7 @@ namespace dbaui using namespace ::dbtools; using namespace ::connectivity; using namespace ::svx; +using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::awt; using namespace ::com::sun::star::util; @@ -107,6 +108,7 @@ using namespace ::com::sun::star::ucb; using ::com::sun::star::util::XCloseable; using ::com::sun::star::ui::XContextMenuInterceptor; /** === end UNO using === **/ + namespace DatabaseObject = ::com::sun::star::sdb::application::DatabaseObject; namespace ErrorCondition = ::com::sun::star::sdb::ErrorCondition; @@ -385,6 +387,8 @@ Reference< XConnection > SAL_CALL OApplicationController::getActiveConnection() // ----------------------------------------------------------------------------- void SAL_CALL OApplicationController::connect( ) throw (SQLException, RuntimeException) { + ::osl::MutexGuard aGuard( getMutex() ); + SQLExceptionInfo aError; SharedConnection xConnection = ensureConnection( &aError ); if ( !xConnection.is() ) @@ -400,8 +404,28 @@ void SAL_CALL OApplicationController::connect( ) throw (SQLException, RuntimeEx } // ----------------------------------------------------------------------------- +beans::Pair< ::sal_Int32, ::rtl::OUString > SAL_CALL OApplicationController::identifySubComponent( const Reference< XComponent >& i_rSubComponent ) throw (IllegalArgumentException, RuntimeException) +{ + ::osl::MutexGuard aGuard( getMutex() ); + + sal_Int32 nType = -1; + ::rtl::OUString sName; + + if ( !m_pSubComponentManager->lookupSubComponent( i_rSubComponent, sName, nType ) ) + throw IllegalArgumentException( ::rtl::OUString(), *this, 1 ); + + if ( nType == SID_DB_APP_DSRELDESIGN ) + // this is somewhat hacky ... we're expected to return a DatabaseObject value. However, there is no such + // value for the relation design. /me thinks we should change the API definition here ... + nType = -1; + + return beans::Pair< ::sal_Int32, ::rtl::OUString >( nType, sName ); +} + +// ----------------------------------------------------------------------------- ::sal_Bool SAL_CALL OApplicationController::closeSubComponents( ) throw (RuntimeException) { + ::osl::MutexGuard aGuard( getMutex() ); return m_pSubComponentManager->closeSubComponents(); } |