diff options
Diffstat (limited to 'framework/source')
27 files changed, 297 insertions, 130 deletions
diff --git a/framework/source/classes/bmkmenu.cxx b/framework/source/classes/bmkmenu.cxx index efa66b3a6140..44a023d3b70d 100644 --- a/framework/source/classes/bmkmenu.cxx +++ b/framework/source/classes/bmkmenu.cxx @@ -61,7 +61,7 @@ //_________________________________________________________________________________________________________________ #include <tools/config.hxx> #include <vcl/svapp.hxx> -#include <svtools/dynamicmenuoptions.hxx> +#include <unotools/dynamicmenuoptions.hxx> #include <svtools/menuoptions.hxx> #include <rtl/logfile.hxx> diff --git a/framework/source/classes/fwktabwindow.cxx b/framework/source/classes/fwktabwindow.cxx index d737a2d77308..c841e6fb0b8d 100644 --- a/framework/source/classes/fwktabwindow.cxx +++ b/framework/source/classes/fwktabwindow.cxx @@ -65,7 +65,6 @@ namespace framework { // class FwkTabControl --------------------------------------------------- - FwkTabControl::FwkTabControl( Window* pParent, const ResId& rResId ) : TabControl( pParent, rResId ) @@ -336,6 +335,11 @@ void FwkTabWindow::AddEventListener( const Link& rEventListener ) m_aTabCtrl.AddEventListener( rEventListener ); } +void FwkTabWindow::RemoveEventListener( const Link& rEventListener ) +{ + m_aTabCtrl.RemoveEventListener( rEventListener ); +} + // ----------------------------------------------------------------------- FwkTabPage* FwkTabWindow::AddTabPage( sal_Int32 nIndex, const uno::Sequence< beans::NamedValue >& rProperties ) diff --git a/framework/source/classes/menumanager.cxx b/framework/source/classes/menumanager.cxx index bb850b876e5c..588c59d8f323 100644 --- a/framework/source/classes/menumanager.cxx +++ b/framework/source/classes/menumanager.cxx @@ -66,8 +66,8 @@ #include <comphelper/extract.hxx> #include <svtools/menuoptions.hxx> -#include <svtools/historyoptions.hxx> -#include <svtools/pathoptions.hxx> +#include <unotools/historyoptions.hxx> +#include <unotools/pathoptions.hxx> #include <unotools/localfilehelper.hxx> #ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_ diff --git a/framework/source/classes/protocolhandlercache.cxx b/framework/source/classes/protocolhandlercache.cxx index 034b35259186..f426eb530c90 100644 --- a/framework/source/classes/protocolhandlercache.cxx +++ b/framework/source/classes/protocolhandlercache.cxx @@ -357,4 +357,8 @@ void HandlerCFGAccess::Notify(const css::uno::Sequence< rtl::OUString >& /*lProp } } +void HandlerCFGAccess::Commit() +{ +} + } // namespace framework diff --git a/framework/source/dispatch/closedispatcher.cxx b/framework/source/dispatch/closedispatcher.cxx index 25b80650e81a..d1ac0c0e044e 100644 --- a/framework/source/dispatch/closedispatcher.cxx +++ b/framework/source/dispatch/closedispatcher.cxx @@ -58,7 +58,7 @@ #include <vcl/window.hxx> #include <vcl/svapp.hxx> #include <vos/mutex.hxx> -#include <svtools/moduleoptions.hxx> +#include <unotools/moduleoptions.hxx> //_______________________________________________ // namespace diff --git a/framework/source/dispatch/startmoduledispatcher.cxx b/framework/source/dispatch/startmoduledispatcher.cxx index 80f02236065f..9326181c6476 100644 --- a/framework/source/dispatch/startmoduledispatcher.cxx +++ b/framework/source/dispatch/startmoduledispatcher.cxx @@ -60,7 +60,7 @@ #include <vcl/window.hxx> #include <vcl/svapp.hxx> #include <vos/mutex.hxx> -#include <svtools/moduleoptions.hxx> +#include <unotools/moduleoptions.hxx> //_______________________________________________ // namespace diff --git a/framework/source/helper/titlebarupdate.cxx b/framework/source/helper/titlebarupdate.cxx index c57840b4d442..feec90e5a167 100644 --- a/framework/source/helper/titlebarupdate.cxx +++ b/framework/source/helper/titlebarupdate.cxx @@ -371,6 +371,12 @@ void TitleBarUpdate::impl_updateIcon(const css::uno::Reference< css::frame::XFra { WorkWindow* pWorkWindow = (WorkWindow*)pWindow; pWorkWindow->SetIcon( (sal_uInt16)nIcon ); + + css::uno::Reference< css::frame::XModel > xModel = xController->getModel(); + rtl::OUString aURL; + if( xModel.is() ) + aURL = xModel->getURL(); + pWorkWindow->SetRepresentedURL( aURL ); } aSolarLock.clear(); diff --git a/framework/source/helper/titlehelper.cxx b/framework/source/helper/titlehelper.cxx index 88a6484ca92c..b021d4f4de9d 100644 --- a/framework/source/helper/titlehelper.cxx +++ b/framework/source/helper/titlehelper.cxx @@ -616,7 +616,7 @@ void TitleHelper::impl_appendModuleName (::rtl::OUStringBuffer& sTitle) } //***************************************************************************************************************** -#ifndef PRODUCT +#ifdef DBG_UTIL void TitleHelper::impl_appendDebugVersion (::rtl::OUStringBuffer& sTitle) { ::rtl::OUString sDefault ; diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx index 491738dea73f..01934dfb47df 100644 --- a/framework/source/layoutmanager/layoutmanager.cxx +++ b/framework/source/layoutmanager/layoutmanager.cxx @@ -101,7 +101,7 @@ #include <comphelper/mediadescriptor.hxx> #include <comphelper/uno3.hxx> #include <rtl/logfile.hxx> -#include <svtools/cmdoptions.hxx> +#include <unotools/cmdoptions.hxx> #include <algorithm> #include <boost/bind.hpp> @@ -419,7 +419,7 @@ LayoutManager::LayoutManager( const Reference< XMultiServiceFactory >& xServiceM m_pMiscOptions = new SvtMiscOptions(); - m_pMiscOptions->AddListener( LINK( this, LayoutManager, OptionsChanged ) ); + m_pMiscOptions->AddListenerLink( LINK( this, LayoutManager, OptionsChanged ) ); Application::AddEventListener( LINK( this, LayoutManager, SettingsChanged ) ); m_eSymbolsSize = m_pMiscOptions->GetSymbolsSize(); m_eSymbolsStyle = m_pMiscOptions->GetCurrentSymbolsStyle(); @@ -442,7 +442,7 @@ LayoutManager::~LayoutManager() Application::RemoveEventListener( LINK( this, LayoutManager, SettingsChanged ) ); if ( m_pMiscOptions ) { - m_pMiscOptions->RemoveListener( LINK( this, LayoutManager, OptionsChanged ) ); + m_pMiscOptions->RemoveListenerLink( LINK( this, LayoutManager, OptionsChanged ) ); delete m_pMiscOptions; m_pMiscOptions = 0; } @@ -7191,7 +7191,7 @@ throw( RuntimeException ) Application::RemoveEventListener( LINK( this, LayoutManager, SettingsChanged ) ); if ( m_pMiscOptions ) { - m_pMiscOptions->RemoveListener( LINK( this, LayoutManager, OptionsChanged ) ); + m_pMiscOptions->RemoveListenerLink( LINK( this, LayoutManager, OptionsChanged ) ); delete m_pMiscOptions; m_pMiscOptions = 0; } diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx index ee39e583e5e7..9fb939e9db0b 100644 --- a/framework/source/loadenv/loadenv.cxx +++ b/framework/source/loadenv/loadenv.cxx @@ -106,7 +106,7 @@ #ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_ #include <toolkit/unohlp.hxx> #endif -#include <svtools/moduleoptions.hxx> +#include <unotools/moduleoptions.hxx> #include <svtools/sfxecode.hxx> #include <unotools/processfactory.hxx> #include <comphelper/configurationhelper.hxx> diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index 9328ed9d9a5c..9b19503f887e 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -80,7 +80,7 @@ #include <comphelper/configurationhelper.hxx> #include <comphelper/mediadescriptor.hxx> #include <vcl/svapp.hxx> -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #include <tools/link.hxx> #include <tools/string.hxx> #include <unotools/tempfile.hxx> @@ -91,7 +91,7 @@ #include <osl/file.hxx> #include <unotools/bootstrap.hxx> #include <unotools/configmgr.hxx> -#include <svtools/documentlockfile.hxx> +#include <svl/documentlockfile.hxx> #include <tools/urlobj.hxx> @@ -170,6 +170,7 @@ static const ::rtl::OUString CMD_DO_RECOVERY = ::rtl::OUString:: static const ::rtl::OUString CMD_DO_ENTRY_BACKUP = ::rtl::OUString::createFromAscii("/doEntryBackup" ); // try to store a temp or original file to a user defined location static const ::rtl::OUString CMD_DO_ENTRY_CLEANUP = ::rtl::OUString::createFromAscii("/doEntryCleanUp" ); // remove the specified entry from the recovery cache static const ::rtl::OUString CMD_DO_SESSION_SAVE = ::rtl::OUString::createFromAscii("/doSessionSave" ); // save all open documents if e.g. a window manager closes an user session +static const ::rtl::OUString CMD_DO_SESSION_QUIET_QUIT = ::rtl::OUString::createFromAscii("/doSessionQuietQuit" ); // let the current session be quietly closed ( the saving should be done using doSessionSave previously ) if e.g. a window manager closes an user session static const ::rtl::OUString CMD_DO_SESSION_RESTORE = ::rtl::OUString::createFromAscii("/doSessionRestore" ); // restore a saved user session from disc static const ::rtl::OUString CMD_DO_DISABLE_RECOVERY = ::rtl::OUString::createFromAscii("/disableRecovery" ); // disable recovery and auto save (!) temp. for this office session static const ::rtl::OUString CMD_DO_SET_AUTOSAVE_STATE = ::rtl::OUString::createFromAscii("/setAutoSaveState" ); // disable/enable auto save (not crash save) for this office session @@ -725,6 +726,16 @@ void AutoRecovery::implts_dispatch(const DispatchParams& aParams) } else if ( + ((eJob & AutoRecovery::E_SESSION_QUIET_QUIT ) == AutoRecovery::E_SESSION_QUIET_QUIT ) && + ((eJob & AutoRecovery::E_DISABLE_AUTORECOVERY) != AutoRecovery::E_DISABLE_AUTORECOVERY) + ) + { + LOG_RECOVERY("... do session quiet quit ...") + bAllowAutoSaveReactivation = sal_False; + implts_doSessionQuietQuit(aParams); + } + else + if ( ((eJob & AutoRecovery::E_SESSION_RESTORE ) == AutoRecovery::E_SESSION_RESTORE ) && ((eJob & AutoRecovery::E_DISABLE_AUTORECOVERY) != AutoRecovery::E_DISABLE_AUTORECOVERY) ) @@ -1987,6 +1998,30 @@ void AutoRecovery::implts_changeAllDocVisibility(sal_Bool bVisible) } //----------------------------------------------- +/* Currently the document is not closed in case of crash, + so the lock file must be removed explicitly +*/ +void lc_removeLockFile(AutoRecovery::TDocumentInfo& rInfo) +{ + if ( rInfo.Document.is() ) + { + try + { + css::uno::Reference< css::frame::XStorable > xStore(rInfo.Document, css::uno::UNO_QUERY_THROW); + ::rtl::OUString aURL = xStore->getLocation(); + if ( aURL.getLength() ) + { + ::svt::DocumentLockFile aLockFile( aURL ); + aLockFile.RemoveFile(); + } + } + catch( const css::uno::Exception& ) + {} + } +} + + +//----------------------------------------------- void AutoRecovery::implts_prepareSessionShutdown() { LOG_RECOVERY("AutoRecovery::implts_prepareSessionShutdown() starts ...") @@ -2004,6 +2039,10 @@ void AutoRecovery::implts_prepareSessionShutdown() { AutoRecovery::TDocumentInfo& rInfo = *pIt; + // WORKAROUND... Since the documents are not closed the lock file must be removed explicitly + // it is not done on documents saving since shutdown can be cancelled + lc_removeLockFile( rInfo ); + // Prevent us from deregistration of these documents. // Because we close these documents by ourself (see XClosable below) ... // it's fact, that we reach our deregistration method. There we @@ -2014,31 +2053,38 @@ void AutoRecovery::implts_prepareSessionShutdown() // reset modified flag of these documents (ignoring the notification about it!) // Otherwise a message box is shown on closing these models. implts_stopModifyListeningOnDoc(rInfo); - css::uno::Reference< css::util::XModifiable > xModify(rInfo.Document, css::uno::UNO_QUERY); - if (xModify.is()) - xModify->setModified(sal_False); - // close the model. - css::uno::Reference< css::util::XCloseable > xClose(rInfo.Document, css::uno::UNO_QUERY); - if (xClose.is()) + // if the session save is still running the documents should not be thrown away, + // actually that would be a bad sign, that means that the SessionManager tryes + // to kill the session before the saving is ready + if ((m_eJob & AutoRecovery::E_SESSION_SAVE) != AutoRecovery::E_SESSION_SAVE) { - try + css::uno::Reference< css::util::XModifiable > xModify(rInfo.Document, css::uno::UNO_QUERY); + if (xModify.is()) + xModify->setModified(sal_False); + + // close the model. + css::uno::Reference< css::util::XCloseable > xClose(rInfo.Document, css::uno::UNO_QUERY); + if (xClose.is()) { - xClose->close(sal_False); - } - /* - catch(const css::lang::DisposedException&) - { - // closed ... disposed ... always the same .-) - } - */ - catch(const css::uno::Exception&) + try { - // At least it's only a try to close these documents before anybody else it does. - // So it seams to be possible to ignore any error here .-) + xClose->close(sal_False); } + /* + catch(const css::lang::DisposedException&) + { + // closed ... disposed ... always the same .-) + } + */ + catch(const css::uno::Exception&) + { + // At least it's only a try to close these documents before anybody else it does. + // So it seams to be possible to ignore any error here .-) + } - rInfo.Document.clear(); + rInfo.Document.clear(); + } } } @@ -2047,30 +2093,6 @@ void AutoRecovery::implts_prepareSessionShutdown() } //----------------------------------------------- -/* Currently the document is not closed in case of crash, - so the lock file must be removed explicitly -*/ -void lc_removeLockFile(AutoRecovery::TDocumentInfo& rInfo) -{ - if ( rInfo.Document.is() ) - { - try - { - css::uno::Reference< css::frame::XStorable > xStore(rInfo.Document, css::uno::UNO_QUERY_THROW); - ::rtl::OUString aURL = xStore->getLocation(); - if ( aURL.getLength() ) - { - ::svt::DocumentLockFile aLockFile( aURL ); - aLockFile.RemoveFile(); - } - } - catch( const css::uno::Exception& ) - {} - } -} - - -//----------------------------------------------- /* TODO WORKAROUND: #i64599# @@ -2750,6 +2772,9 @@ void AutoRecovery::implts_informListener( sal_Int32 eJ if ((eJob & AutoRecovery::E_SESSION_SAVE) == AutoRecovery::E_SESSION_SAVE) sFeature.append(CMD_DO_SESSION_SAVE); else + if ((eJob & AutoRecovery::E_SESSION_QUIET_QUIT) == AutoRecovery::E_SESSION_QUIET_QUIT) + sFeature.append(CMD_DO_SESSION_QUIET_QUIT); + else if ((eJob & AutoRecovery::E_SESSION_RESTORE) == AutoRecovery::E_SESSION_RESTORE) sFeature.append(CMD_DO_SESSION_RESTORE); else @@ -2792,6 +2817,9 @@ sal_Int32 AutoRecovery::implst_classifyJob(const css::util::URL& aURL) if (aURL.Path.equals(CMD_DO_SESSION_SAVE)) return AutoRecovery::E_SESSION_SAVE; else + if (aURL.Path.equals(CMD_DO_SESSION_QUIET_QUIT)) + return AutoRecovery::E_SESSION_QUIET_QUIT; + else if (aURL.Path.equals(CMD_DO_SESSION_RESTORE)) return AutoRecovery::E_SESSION_RESTORE; else @@ -2968,14 +2996,6 @@ void AutoRecovery::implts_doSessionSave(const DispatchParams& aParams) { LOG_RECOVERY("AutoRecovery::implts_doSessionSave()") - // try to make sure next time office will be started user wont be - // notified about any other might be running office instance - // remove ".lock" file from disc ! - // it is done as a first action for session save since Gnome sessions - // do not provide enough time for shutdown, and the dialog looks to be - // confusing for the user - AutoRecovery::st_impl_removeLockFile(); - // Be sure to know all open documents realy .-) implts_verifyCacheAgainstDesktopDocumentList(); @@ -2991,7 +3011,8 @@ void AutoRecovery::implts_doSessionSave(const DispatchParams& aParams) AutoRecovery::ETimerType eSuggestedTimer = AutoRecovery::E_DONT_START_TIMER; do { - eSuggestedTimer = implts_saveDocs(bAllowUserIdleLoop, sal_True, &aParams); + // do not remove lock files of the documents, it will be done on session quit + eSuggestedTimer = implts_saveDocs(bAllowUserIdleLoop, sal_False, &aParams); } while(eSuggestedTimer == AutoRecovery::E_CALL_ME_BACK); @@ -3002,6 +3023,23 @@ void AutoRecovery::implts_doSessionSave(const DispatchParams& aParams) // any "handle" state ... implts_resetHandleStates(sal_False); + // flush config cached back to disc. + impl_flushALLConfigChanges(); +} + +//----------------------------------------------- +void AutoRecovery::implts_doSessionQuietQuit(const DispatchParams& /*aParams*/) +{ + LOG_RECOVERY("AutoRecovery::implts_doSessionQuietQuit()") + + // try to make sure next time office will be started user wont be + // notified about any other might be running office instance + // remove ".lock" file from disc ! + // it is done as a first action for session save since Gnome sessions + // do not provide enough time for shutdown, and the dialog looks to be + // confusing for the user + AutoRecovery::st_impl_removeLockFile(); + // reset all modified documents, so the dont show any UI on closing ... // and close all documents, so we can shutdown the OS! implts_prepareSessionShutdown(); @@ -3020,6 +3058,7 @@ void AutoRecovery::implts_doSessionSave(const DispatchParams& aParams) impl_flushALLConfigChanges(); } + //----------------------------------------------- void AutoRecovery::implts_doSessionRestore(const DispatchParams& aParams) { diff --git a/framework/source/services/backingcomp.cxx b/framework/source/services/backingcomp.cxx index 5a299150611e..7f190a678763 100644 --- a/framework/source/services/backingcomp.cxx +++ b/framework/source/services/backingcomp.cxx @@ -75,9 +75,9 @@ #include <rtl/ustrbuf.hxx> #ifndef _SOLAR_HRC -#include <svtools/solar.hrc> +#include <svl/solar.hrc> #endif -#include <svtools/urihelper.hxx> +#include <svl/urihelper.hxx> #include <osl/file.hxx> #include <unotools/configmgr.hxx> diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx index c5d845a9d333..a354b01d3c32 100644 --- a/framework/source/services/backingwindow.cxx +++ b/framework/source/services/backingwindow.cxx @@ -43,9 +43,9 @@ #include "tools/urlobj.hxx" -#include "svtools/dynamicmenuoptions.hxx" +#include "unotools/dynamicmenuoptions.hxx" #include "svtools/imagemgr.hxx" -#include "svtools/svtools.hrc" +#include "svl/svtools.hrc" #include "comphelper/processfactory.hxx" #include "comphelper/sequenceashashmap.hxx" diff --git a/framework/source/services/backingwindow.hxx b/framework/source/services/backingwindow.hxx index 0b9afa6d38de..e02206cf5f29 100644 --- a/framework/source/services/backingwindow.hxx +++ b/framework/source/services/backingwindow.hxx @@ -38,7 +38,7 @@ #include "vcl/bitmapex.hxx" #include "vcl/toolbox.hxx" -#include "svtools/moduleoptions.hxx" +#include "unotools/moduleoptions.hxx" #include "svtools/acceleratorexecute.hxx" #include "com/sun/star/frame/XDispatchProvider.hpp" diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx index 0e14404de381..2b615240b594 100644 --- a/framework/source/services/frame.cxx +++ b/framework/source/services/frame.cxx @@ -106,7 +106,7 @@ #endif #include <toolkit/awt/vclxwindow.hxx> #include <comphelper/processfactory.hxx> -#include <svtools/moduleoptions.hxx> +#include <unotools/moduleoptions.hxx> #ifdef ENABLE_ASSERTIONS #ifndef _RTL_STRBUF_HXX_ diff --git a/framework/source/services/mediatypedetectionhelper.cxx b/framework/source/services/mediatypedetectionhelper.cxx index 41d57b47899e..aca9b8f79523 100644 --- a/framework/source/services/mediatypedetectionhelper.cxx +++ b/framework/source/services/mediatypedetectionhelper.cxx @@ -36,7 +36,7 @@ //_________________________________________________________________________________________________________________ #include <services/mediatypedetectionhelper.hxx> #include <services.h> -#include <svtools/inettype.hxx> +#include <svl/inettype.hxx> #include <tools/string.hxx> #include <rtl/logfile.hxx> diff --git a/framework/source/services/sessionlistener.cxx b/framework/source/services/sessionlistener.cxx index ad0016fc0af6..95cbc52dcd04 100644 --- a/framework/source/services/sessionlistener.cxx +++ b/framework/source/services/sessionlistener.cxx @@ -60,14 +60,15 @@ #include <com/sun/star/frame/XStorable.hpp> #include <com/sun/star/frame/XComponentLoader.hpp> #include <com/sun/star/frame/XDispatch.hpp> +#include <com/sun/star/frame/XDesktop.hpp> #include <com/sun/star/util/XModifiable.hpp> #include <com/sun/star/util/XChangesBatch.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/util/URL.hpp> #include <osl/time.h> #include <comphelper/processfactory.hxx> -#include <svtools/pathoptions.hxx> -#include <svtools/internaloptions.hxx> +#include <unotools/pathoptions.hxx> +#include <unotools/internaloptions.hxx> #include <stdio.h> //_______________________________________________ // interface includes @@ -103,12 +104,13 @@ namespace framework{ //*********************************************** // XInterface, XTypeProvider, XServiceInfo -DEFINE_XINTERFACE_5( +DEFINE_XINTERFACE_6( SessionListener, OWeakObject, DIRECT_INTERFACE(css::lang::XTypeProvider), DIRECT_INTERFACE(css::lang::XInitialization), DIRECT_INTERFACE(css::frame::XSessionManagerListener), + DIRECT_INTERFACE(css::frame::XSessionManagerListener2), DIRECT_INTERFACE(css::frame::XStatusListener), DIRECT_INTERFACE(css::lang::XServiceInfo)) @@ -116,7 +118,7 @@ DEFINE_XTYPEPROVIDER_5( SessionListener, css::lang::XTypeProvider, css::lang::XInitialization, - css::frame::XSessionManagerListener, + css::frame::XSessionManagerListener2, css::frame::XStatusListener, css::lang::XServiceInfo) @@ -137,7 +139,10 @@ SessionListener::SessionListener(const css::uno::Reference< css::lang::XMultiSer : ThreadHelpBase (&Application::GetSolarMutex()) , OWeakObject ( ) , m_xSMGR (xSMGR ) - , m_bRestored( false ) + , m_bRestored( sal_False ) + , m_bSessionStoreRequested( sal_False ) + , m_bAllowUserInteractionOnQuit( sal_False ) + , m_bTerminated( sal_False ) { } @@ -150,6 +155,63 @@ SessionListener::~SessionListener() } } +void SessionListener::StoreSession( sal_Bool bAsync ) +{ + ResetableGuard aGuard(m_aLock); + try + { + // xd create SERVICENAME_AUTORECOVERY -> XDispatch + // xd->dispatch("vnd.sun.star.autorecovery:/doSessionSave, async=bAsync + // on stop event m_rSessionManager->saveDone(this); in case of asynchronous call + // in case of synchronous call the caller should do saveDone() call himself! + + css::uno::Reference< XDispatch > xDispatch(m_xSMGR->createInstance(SERVICENAME_AUTORECOVERY), UNO_QUERY_THROW); + css::uno::Reference< XURLTransformer > xURLTransformer(m_xSMGR->createInstance(SERVICENAME_URLTRANSFORMER), UNO_QUERY_THROW); + URL aURL; + aURL.Complete = OUString::createFromAscii("vnd.sun.star.autorecovery:/doSessionSave"); + xURLTransformer->parseStrict(aURL); + + // in case of asynchronous call the notification will trigger saveDone() + if ( bAsync ) + xDispatch->addStatusListener(this, aURL); + + Sequence< PropertyValue > args(1); + args[0] = PropertyValue(OUString::createFromAscii("DispatchAsynchron"),-1,makeAny(bAsync),PropertyState_DIRECT_VALUE); + xDispatch->dispatch(aURL, args); + } catch (com::sun::star::uno::Exception& e) { + OString aMsg = OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8); + OSL_ENSURE(sal_False, aMsg.getStr()); + // save failed, but tell manager to go on if we havent yet dispatched the request + // in case of synchronous saving the notification is done by the caller + if ( bAsync && m_rSessionManager.is() ) + m_rSessionManager->saveDone(this); + } +} + +void SessionListener::QuitSessionQuietly() +{ + ResetableGuard aGuard(m_aLock); + try + { + // xd create SERVICENAME_AUTORECOVERY -> XDispatch + // xd->dispatch("vnd.sun.star.autorecovery:/doSessionQuietQuit, async=false + // it is done synchronously to avoid conflict with normal quit process + + css::uno::Reference< XDispatch > xDispatch(m_xSMGR->createInstance(SERVICENAME_AUTORECOVERY), UNO_QUERY_THROW); + css::uno::Reference< XURLTransformer > xURLTransformer(m_xSMGR->createInstance(SERVICENAME_URLTRANSFORMER), UNO_QUERY_THROW); + URL aURL; + aURL.Complete = OUString::createFromAscii("vnd.sun.star.autorecovery:/doSessionQuietQuit"); + xURLTransformer->parseStrict(aURL); + + Sequence< PropertyValue > args(1); + args[0] = PropertyValue(OUString::createFromAscii("DispatchAsynchron"),-1,makeAny(sal_False),PropertyState_DIRECT_VALUE); + xDispatch->dispatch(aURL, args); + } catch (com::sun::star::uno::Exception& e) { + OString aMsg = OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8); + OSL_ENSURE(sal_False, aMsg.getStr()); + } +} + void SAL_CALL SessionListener::disposing(const com::sun::star::lang::EventObject&) throw (RuntimeException) { } @@ -170,6 +232,8 @@ void SAL_CALL SessionListener::initialize(const Sequence< Any >& args) v.Value >>= aSMgr; else if (v.Name.equalsAscii("SessionManager")) v.Value >>= m_rSessionManager; + else if (v.Name.equalsAscii("AllowUserInteractionOnQuit")) + v.Value >>= m_bAllowUserInteractionOnQuit; } } } @@ -235,46 +299,73 @@ void SAL_CALL SessionListener::doSave( sal_Bool bShutdown, sal_Bool /*bCancelabl { if (bShutdown) { - sal_Bool bDispatched = sal_False; - ResetableGuard aGuard(m_aLock); - try - { - // xd create SERVICENAME_AUTORECOVERY -> XDispatch - // xd->dispatch("vnd.sun.star.autorecovery:/doSessionSave, async=true - // on stop event m_rSessionManager->saveDone(this); - - css::uno::Reference< XDispatch > xDispatch(m_xSMGR->createInstance(SERVICENAME_AUTORECOVERY), UNO_QUERY_THROW); - css::uno::Reference< XURLTransformer > xURLTransformer(m_xSMGR->createInstance(SERVICENAME_URLTRANSFORMER), UNO_QUERY_THROW); - URL aURL; - aURL.Complete = OUString::createFromAscii("vnd.sun.star.autorecovery:/doSessionSave"); - xURLTransformer->parseStrict(aURL); - xDispatch->addStatusListener(this, aURL); - Sequence< PropertyValue > args(1); - args[0] = PropertyValue(OUString::createFromAscii("DispatchAsynchron"),-1,makeAny(sal_True),PropertyState_DIRECT_VALUE); - xDispatch->dispatch(aURL, args); - bDispatched = sal_True; - // on stop event set call m_rSessionManager->saveDone(this); - } catch (com::sun::star::uno::Exception& e) { - OString aMsg = OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8); - OSL_ENSURE(sal_False, aMsg.getStr()); - // save failed, but tell manager to go on if we havent yet dispatched the request - if (m_rSessionManager.is() && !bDispatched) - m_rSessionManager->saveDone(this); - } + m_bSessionStoreRequested = sal_True; // there is no need to protect it with mutex + if ( m_bAllowUserInteractionOnQuit && m_rSessionManager.is() ) + m_rSessionManager->queryInteraction( static_cast< css::frame::XSessionManagerListener* >( this ) ); + else + StoreSession( sal_True ); } // we don't have anything to do so tell the session manager we're done else if( m_rSessionManager.is() ) m_rSessionManager->saveDone( this ); } +void SAL_CALL SessionListener::approveInteraction( sal_Bool bInteractionGranted ) + throw (RuntimeException) +{ + // do AutoSave as the first step + ResetableGuard aGuard(m_aLock); + + if ( bInteractionGranted ) + { + // close the office documents in normal way + try + { + // first of all let the session be stored to be sure that we lose no information + StoreSession( sal_False ); + css::uno::Reference< css::frame::XDesktop > xDesktop( m_xSMGR->createInstance(SERVICENAME_DESKTOP), css::uno::UNO_QUERY_THROW); + m_bTerminated = xDesktop->terminate(); -void SAL_CALL SessionListener::approveInteraction( sal_Bool /*bInteractionGranted*/ ) - throw (RuntimeException) -{} + if ( m_rSessionManager.is() ) + { + // false means that the application closing has been cancelled + if ( !m_bTerminated ) + m_rSessionManager->cancelShutdown(); + else + m_rSessionManager->interactionDone( this ); + } + } + catch( css::uno::Exception& ) + { + StoreSession( sal_True ); + m_rSessionManager->interactionDone( this ); + } + + if ( m_rSessionManager.is() ) + m_rSessionManager->saveDone(this); + } + else + { + StoreSession( sal_True ); + } +} void SessionListener::shutdownCanceled() throw (RuntimeException) -{} +{ + // set the state back + m_bSessionStoreRequested = sal_False; // there is no need to protect it with mutex +} + +void SessionListener::doQuit() + throw (RuntimeException) +{ + if ( m_bSessionStoreRequested && !m_bTerminated ) + { + // let the session be closed quietly in this case + QuitSessionQuietly(); + } +} } diff --git a/framework/source/services/substitutepathvars.cxx b/framework/source/services/substitutepathvars.cxx index 966ce1756c64..21b2be8b1c53 100644 --- a/framework/source/services/substitutepathvars.cxx +++ b/framework/source/services/substitutepathvars.cxx @@ -319,6 +319,11 @@ void SubstitutePathVariables_Impl::Notify( const com::sun::star::uno::Sequence< // NOT implemented yet! } +void SubstitutePathVariables_Impl::Commit() +{ +} + + //_________________________________________________________________________________________________________________ // private methods //_________________________________________________________________________________________________________________ diff --git a/framework/source/services/tabwindowservice.cxx b/framework/source/services/tabwindowservice.cxx index fb3c08876687..dfce492ddcd7 100644 --- a/framework/source/services/tabwindowservice.cxx +++ b/framework/source/services/tabwindowservice.cxx @@ -75,18 +75,20 @@ namespace framework{ // css::uno::XInterface, XTypeProvider, XServiceInfo //***************************************************************************************************************** -DEFINE_XINTERFACE_5 ( TabWindowService , +DEFINE_XINTERFACE_6 ( TabWindowService , OWeakObject , DIRECT_INTERFACE(css::lang::XTypeProvider ), DIRECT_INTERFACE(css::lang::XServiceInfo ), + DIRECT_INTERFACE(css::lang::XComponent), DIRECT_INTERFACE(css::awt::XSimpleTabController), DIRECT_INTERFACE(css::beans::XPropertySet ), DIRECT_INTERFACE(css::beans::XPropertySetInfo ) ) -DEFINE_XTYPEPROVIDER_5 ( TabWindowService , +DEFINE_XTYPEPROVIDER_6 ( TabWindowService , css::lang::XTypeProvider , css::lang::XServiceInfo , + css::lang::XComponent , css::awt::XSimpleTabController , css::beans::XPropertySet , css::beans::XPropertySetInfo @@ -100,7 +102,7 @@ DEFINE_XSERVICEINFO_MULTISERVICE ( TabWindowService , DEFINE_INIT_SERVICE ( TabWindowService, { - impl_initializePropInfo();
+ impl_initializePropInfo(); m_aTransactionManager.setWorkingMode( E_WORK ); } ) @@ -141,7 +143,12 @@ TabWindowService::TabWindowService( const css::uno::Reference< css::lang::XMulti // destructor //***************************************************************************************************************** TabWindowService::~TabWindowService() -{
+{ + // SAFE-> + ResetableGuard aGuard(m_aLock); + + if (m_pTabWin) + m_pTabWin->RemoveEventListener( LINK( this, TabWindowService, EventListener ) ); } //***************************************************************************************************************** @@ -286,8 +293,11 @@ void SAL_CALL TabWindowService::dispose() m_lListener.disposeAndClear (aEvent); + if (m_pTabWin) + m_pTabWin->RemoveEventListener( LINK( this, TabWindowService, EventListener ) ); + m_pTabWin = NULL; - m_xTabWin.clear (); + m_xTabWin.clear(); } //***************************************************************************************************************** @@ -357,6 +367,7 @@ css::uno::Any SAL_CALL TabWindowService::impl_getPropertyValue(const ::rtl::OUSt //***************************************************************************************************************** IMPL_LINK( TabWindowService, EventListener, VclSimpleEvent*, pEvent ) { + if ( !pEvent && !pEvent->ISA(VclWindowEvent)) return 0; @@ -369,6 +380,11 @@ IMPL_LINK( TabWindowService, EventListener, VclSimpleEvent*, pEvent ) if (nEventId == VCLEVENT_OBJECT_DYING) { m_lListener.disposeAndClear (aEvent); + + m_pTabWin->RemoveEventListener( LINK( this, TabWindowService, EventListener ) ); + m_pTabWin = NULL; + m_xTabWin.clear(); + return 0; } @@ -454,9 +470,9 @@ FwkTabWindow* TabWindowService::mem_TabWin () FwkTabWindow* pWin = NULL; if ( ! m_xTabWin.is ()) - {
- Window* pFakeParent = dynamic_cast< Window* >(Application::GetDefaultDevice ());
-
+ { + Window* pFakeParent = dynamic_cast< Window* >(Application::GetDefaultDevice ()); + m_pTabWin = new FwkTabWindow (pFakeParent); m_xTabWin = VCLUnoHelper::GetInterface (m_pTabWin); diff --git a/framework/source/uielement/controlmenucontroller.cxx b/framework/source/uielement/controlmenucontroller.cxx index 311db615ed2a..caa356d850fa 100644 --- a/framework/source/uielement/controlmenucontroller.cxx +++ b/framework/source/uielement/controlmenucontroller.cxx @@ -62,7 +62,7 @@ #include <rtl/ustrbuf.hxx> #include <rtl/strbuf.hxx> #ifndef _SOLAR_HRC -#include <svtools/solar.hrc> +#include <svl/solar.hrc> #endif #include <tools/rcid.h> #include <vcl/image.hxx> diff --git a/framework/source/uielement/langselectionmenucontroller.cxx b/framework/source/uielement/langselectionmenucontroller.cxx index 555682677e33..ec1508cb0fd7 100644 --- a/framework/source/uielement/langselectionmenucontroller.cxx +++ b/framework/source/uielement/langselectionmenucontroller.cxx @@ -68,7 +68,7 @@ #include <com/sun/star/linguistic2/XLanguageGuessing.hpp> #include <map> #include <i18npool/mslangid.hxx> -#include <svtools/languageoptions.hxx> +#include <svl/languageoptions.hxx> #include <com/sun/star/awt/MenuItemStyle.hpp> #include <svtools/langtab.hxx> #include <classes/fwlresid.hxx> diff --git a/framework/source/uielement/langselectionstatusbarcontroller.cxx b/framework/source/uielement/langselectionstatusbarcontroller.cxx index bccd553b57d3..3a92fa7848b1 100644 --- a/framework/source/uielement/langselectionstatusbarcontroller.cxx +++ b/framework/source/uielement/langselectionstatusbarcontroller.cxx @@ -71,7 +71,7 @@ #include <toolkit/unohlp.hxx> #include <tools/gen.hxx> #include <com/sun/star/awt/Command.hpp> -#include <svtools/languageoptions.hxx> +#include <svl/languageoptions.hxx> #include <com/sun/star/linguistic2/XLanguageGuessing.hpp> #include <dispatch/uieventloghelper.hxx> @@ -337,7 +337,7 @@ void LangSelectionStatusbarController::LangMenu()throw (::com::sun::star::uno::R mRectangle.Y = mMousePos.Y(); sal_Int16 nId = xPopupMenu->execute( xParent, mRectangle, com::sun::star::awt::PopupMenuDirection::EXECUTE_UP+16 ); //click "More..." - if ( m_xFrame.is() ) + if ( nId && m_xFrame.is() ) { uno::Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY ); util::URL aURL; diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index 4c20b96f00dc..0b26f96829d2 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -82,9 +82,9 @@ #include <comphelper/processfactory.hxx> #include <comphelper/extract.hxx> #include <svtools/menuoptions.hxx> -#include <svtools/historyoptions.hxx> -#include <svtools/pathoptions.hxx> -#include <svtools/cmdoptions.hxx> +#include <unotools/historyoptions.hxx> +#include <unotools/pathoptions.hxx> +#include <unotools/cmdoptions.hxx> #include <unotools/localfilehelper.hxx> #ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_ #include <toolkit/unohlp.hxx> diff --git a/framework/source/uielement/newmenucontroller.cxx b/framework/source/uielement/newmenucontroller.cxx index 37580f86f546..d4e5228c6b9c 100644 --- a/framework/source/uielement/newmenucontroller.cxx +++ b/framework/source/uielement/newmenucontroller.cxx @@ -68,7 +68,7 @@ #include <osl/file.hxx> #include <svtools/menuoptions.hxx> #include <svtools/acceleratorexecute.hxx> -#include <svtools/moduleoptions.hxx> +#include <unotools/moduleoptions.hxx> #include <dispatch/uieventloghelper.hxx> //_________________________________________________________________________________________________________________ diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx index 1ca5bf409e6d..9c5ed617b9e0 100644 --- a/framework/source/uielement/recentfilesmenucontroller.cxx +++ b/framework/source/uielement/recentfilesmenucontroller.cxx @@ -62,7 +62,7 @@ #include <vcl/i18nhelp.hxx> #include <tools/urlobj.hxx> #include <rtl/ustrbuf.hxx> -#include <svtools/historyoptions.hxx> +#include <unotools/historyoptions.hxx> #include <cppuhelper/implbase1.hxx> #include <osl/file.hxx> //#include <tools/solar.hrc> diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx index 55c8d16af2ec..6463dd634c20 100644 --- a/framework/source/uielement/toolbarmanager.cxx +++ b/framework/source/uielement/toolbarmanager.cxx @@ -85,13 +85,13 @@ //_________________________________________________________________________________________________________________ #include <svtools/imgdef.hxx> #include <svtools/toolboxcontroller.hxx> -#include <svtools/cmdoptions.hxx> +#include <unotools/cmdoptions.hxx> #ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_ #include <toolkit/unohlp.hxx> #endif #include <comphelper/mediadescriptor.hxx> #include <svtools/miscopt.hxx> -#include <svtools/imageitm.hxx> +#include <svl/imageitm.hxx> #include <svtools/framestatuslistener.hxx> #include <vcl/svapp.hxx> #include <vcl/menu.hxx> @@ -99,7 +99,7 @@ #include <vcl/taskpanelist.hxx> #include <rtl/logfile.hxx> #include <svtools/menuoptions.hxx> -#include <svtools/cmdoptions.hxx> +#include <unotools/cmdoptions.hxx> #include <boost/bind.hpp> //_________________________________________________________________________________________________________________ @@ -341,9 +341,11 @@ void ToolBarManager::Destroy() delete static_cast< AddonsParams* >( m_pToolBar->GetItemData( nItemId )); } + // Hide toolbar as lazy delete can destroy the toolbar much later. + m_pToolBar->Hide(); /* #i99167# removed change for i93173 since there is some weird crash */ // #i93173# delete toolbar lazily as we can still be in one of its handlers - m_pToolBar->doLazyDelete(); + m_pToolBar->doLazyDelete(); Link aEmpty; m_pToolBar->SetSelectHdl( aEmpty ); diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx index 3b359eea97c2..a697eaeff3b7 100644 --- a/framework/source/uielement/toolbarsmenucontroller.cxx +++ b/framework/source/uielement/toolbarsmenucontroller.cxx @@ -80,7 +80,7 @@ #endif #include <vcl/window.hxx> #include <svtools/menuoptions.hxx> -#include <svtools/cmdoptions.hxx> +#include <unotools/cmdoptions.hxx> #include <dispatch/uieventloghelper.hxx> #include <rtl/logfile.hxx> |