Introduce com.sun.star.frame.theAutoRecovery singleton.
To replace com.sun.star.frame.AutoRecovery single-instance service, incorrectly converted in 279859fdbc40f68d8f1649fa5b928d9de49e8d9e Unfortunately needs a lot of changes in autorecovery.cxx. Change-Id: Iba5188dffea3e03803236f23e0b3f343746ace90
This commit is contained in:
parent
3774a6fd94
commit
dd1c991bd9
@ -39,7 +39,7 @@
|
|||||||
#include <svl/languageoptions.hxx>
|
#include <svl/languageoptions.hxx>
|
||||||
#include <svtools/javacontext.hxx>
|
#include <svtools/javacontext.hxx>
|
||||||
#include <com/sun/star/beans/XPropertySet.hpp>
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
||||||
#include <com/sun/star/frame/AutoRecovery.hpp>
|
#include <com/sun/star/frame/theAutoRecovery.hpp>
|
||||||
#include <com/sun/star/frame/theGlobalEventBroadcaster.hpp>
|
#include <com/sun/star/frame/theGlobalEventBroadcaster.hpp>
|
||||||
#include <com/sun/star/frame/SessionListener.hpp>
|
#include <com/sun/star/frame/SessionListener.hpp>
|
||||||
#include <com/sun/star/frame/XSessionManagerListener.hpp>
|
#include <com/sun/star/frame/XSessionManagerListener.hpp>
|
||||||
@ -2344,7 +2344,7 @@ void Desktop::OpenClients()
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Reference< XDispatch > xRecovery = css::frame::AutoRecovery::create( ::comphelper::getProcessComponentContext() );
|
Reference< XDispatch > xRecovery = css::frame::theAutoRecovery::get( ::comphelper::getProcessComponentContext() );
|
||||||
Reference< css::util::XURLTransformer > xParser = css::util::URLTransformer::create( ::comphelper::getProcessComponentContext() );
|
Reference< css::util::XURLTransformer > xParser = css::util::URLTransformer::create( ::comphelper::getProcessComponentContext() );
|
||||||
|
|
||||||
css::util::URL aCmd;
|
css::util::URL aCmd;
|
||||||
|
@ -106,7 +106,7 @@
|
|||||||
#include <com/sun/star/embed/XPackageStructureCreator.hpp>
|
#include <com/sun/star/embed/XPackageStructureCreator.hpp>
|
||||||
#include <com/sun/star/embed/XTransactedObject.hpp>
|
#include <com/sun/star/embed/XTransactedObject.hpp>
|
||||||
#include <com/sun/star/frame/AppDispatchProvider.hpp>
|
#include <com/sun/star/frame/AppDispatchProvider.hpp>
|
||||||
#include <com/sun/star/frame/AutoRecovery.hpp>
|
#include <com/sun/star/frame/theAutoRecovery.hpp>
|
||||||
#include <com/sun/star/frame/CommandGroup.hpp>
|
#include <com/sun/star/frame/CommandGroup.hpp>
|
||||||
#include <com/sun/star/frame/ContentHandlerFactory.hpp>
|
#include <com/sun/star/frame/ContentHandlerFactory.hpp>
|
||||||
#include <com/sun/star/frame/Desktop.hpp>
|
#include <com/sun/star/frame/Desktop.hpp>
|
||||||
|
@ -26,6 +26,7 @@ import com.sun.star.frame.XDispatch;
|
|||||||
import com.sun.star.frame.XDispatchProvider;
|
import com.sun.star.frame.XDispatchProvider;
|
||||||
import com.sun.star.frame.XModel;
|
import com.sun.star.frame.XModel;
|
||||||
import com.sun.star.frame.XStatusListener;
|
import com.sun.star.frame.XStatusListener;
|
||||||
|
import com.sun.star.frame.theAutoRecovery;
|
||||||
import com.sun.star.lang.XMultiServiceFactory;
|
import com.sun.star.lang.XMultiServiceFactory;
|
||||||
import com.sun.star.sheet.FillDirection;
|
import com.sun.star.sheet.FillDirection;
|
||||||
import com.sun.star.sheet.XCellSeries;
|
import com.sun.star.sheet.XCellSeries;
|
||||||
@ -204,7 +205,7 @@ public class AutoSave
|
|||||||
m_aSOF = SOfficeFactory.getFactory(m_xSMGR);
|
m_aSOF = SOfficeFactory.getFactory(m_xSMGR);
|
||||||
|
|
||||||
// create AutoSave instance
|
// create AutoSave instance
|
||||||
m_xAutoSave = UnoRuntime.queryInterface(XDispatch.class, m_xSMGR.createInstance("com.sun.star.comp.framework.AutoRecovery"));
|
m_xAutoSave = theAutoRecovery.get(connection.getComponentContext());
|
||||||
|
|
||||||
// prepare AutoSave
|
// prepare AutoSave
|
||||||
// make sure it will be started every 1 min
|
// make sure it will be started every 1 min
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -36,7 +36,7 @@
|
|||||||
#include <com/sun/star/beans/PropertyValue.hpp>
|
#include <com/sun/star/beans/PropertyValue.hpp>
|
||||||
#include <com/sun/star/beans/PropertyState.hpp>
|
#include <com/sun/star/beans/PropertyState.hpp>
|
||||||
#include <com/sun/star/beans/XPropertySet.hpp>
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
||||||
#include <com/sun/star/frame/AutoRecovery.hpp>
|
#include <com/sun/star/frame/theAutoRecovery.hpp>
|
||||||
#include <com/sun/star/frame/XFramesSupplier.hpp>
|
#include <com/sun/star/frame/XFramesSupplier.hpp>
|
||||||
#include <com/sun/star/frame/XStorable.hpp>
|
#include <com/sun/star/frame/XStorable.hpp>
|
||||||
#include <com/sun/star/frame/XComponentLoader.hpp>
|
#include <com/sun/star/frame/XComponentLoader.hpp>
|
||||||
@ -113,7 +113,7 @@ void SessionListener::StoreSession( sal_Bool bAsync )
|
|||||||
// on stop event m_rSessionManager->saveDone(this); in case of asynchronous call
|
// on stop event m_rSessionManager->saveDone(this); in case of asynchronous call
|
||||||
// in case of synchronous call the caller should do saveDone() call himself!
|
// in case of synchronous call the caller should do saveDone() call himself!
|
||||||
|
|
||||||
css::uno::Reference< XDispatch > xDispatch = css::frame::AutoRecovery::create( m_xContext );
|
css::uno::Reference< XDispatch > xDispatch = css::frame::theAutoRecovery::get( m_xContext );
|
||||||
css::uno::Reference< XURLTransformer > xURLTransformer = URLTransformer::create( m_xContext );
|
css::uno::Reference< XURLTransformer > xURLTransformer = URLTransformer::create( m_xContext );
|
||||||
URL aURL;
|
URL aURL;
|
||||||
aURL.Complete = "vnd.sun.star.autorecovery:/doSessionSave";
|
aURL.Complete = "vnd.sun.star.autorecovery:/doSessionSave";
|
||||||
@ -145,7 +145,7 @@ void SessionListener::QuitSessionQuietly()
|
|||||||
// xd->dispatch("vnd.sun.star.autorecovery:/doSessionQuietQuit, async=false
|
// xd->dispatch("vnd.sun.star.autorecovery:/doSessionQuietQuit, async=false
|
||||||
// it is done synchronously to avoid conflict with normal quit process
|
// it is done synchronously to avoid conflict with normal quit process
|
||||||
|
|
||||||
css::uno::Reference< XDispatch > xDispatch = css::frame::AutoRecovery::create( m_xContext );
|
css::uno::Reference< XDispatch > xDispatch = css::frame::theAutoRecovery::get( m_xContext );
|
||||||
css::uno::Reference< XURLTransformer > xURLTransformer = URLTransformer::create( m_xContext );
|
css::uno::Reference< XURLTransformer > xURLTransformer = URLTransformer::create( m_xContext );
|
||||||
URL aURL;
|
URL aURL;
|
||||||
aURL.Complete = "vnd.sun.star.autorecovery:/doSessionQuietQuit";
|
aURL.Complete = "vnd.sun.star.autorecovery:/doSessionQuietQuit";
|
||||||
@ -226,7 +226,7 @@ sal_Bool SAL_CALL SessionListener::doRestore()
|
|||||||
ResetableGuard aGuard(m_aLock);
|
ResetableGuard aGuard(m_aLock);
|
||||||
m_bRestored = sal_False;
|
m_bRestored = sal_False;
|
||||||
try {
|
try {
|
||||||
css::uno::Reference< XDispatch > xDispatch = css::frame::AutoRecovery::create( m_xContext );
|
css::uno::Reference< XDispatch > xDispatch = css::frame::theAutoRecovery::get( m_xContext );
|
||||||
|
|
||||||
URL aURL;
|
URL aURL;
|
||||||
aURL.Complete = "vnd.sun.star.autorecovery:/doSessionRestore";
|
aURL.Complete = "vnd.sun.star.autorecovery:/doSessionRestore";
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
<implementation name="com.sun.star.comp.framework.AutoRecovery"
|
<implementation name="com.sun.star.comp.framework.AutoRecovery"
|
||||||
constructor="com_sun_star_comp_framework_AutoRecovery_get_implementation">
|
constructor="com_sun_star_comp_framework_AutoRecovery_get_implementation">
|
||||||
<service name="com.sun.star.frame.AutoRecovery"/>
|
<service name="com.sun.star.frame.AutoRecovery"/>
|
||||||
|
<singleton name="com.sun.star.frame.theAutoRecovery"/>
|
||||||
</implementation>
|
</implementation>
|
||||||
<implementation name="com.sun.star.comp.framework.ControlMenuController"
|
<implementation name="com.sun.star.comp.framework.ControlMenuController"
|
||||||
constructor="com_sun_star_comp_framework_ControlMenuController_get_implementation">
|
constructor="com_sun_star_comp_framework_ControlMenuController_get_implementation">
|
||||||
|
@ -200,6 +200,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,com/sun/star/frame,\
|
|||||||
StartModule \
|
StartModule \
|
||||||
TaskCreator \
|
TaskCreator \
|
||||||
UICommandDescription \
|
UICommandDescription \
|
||||||
|
theAutoRecovery \
|
||||||
theGlobalEventBroadcaster \
|
theGlobalEventBroadcaster \
|
||||||
))
|
))
|
||||||
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,com/sun/star/graphic,\
|
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,com/sun/star/graphic,\
|
||||||
|
@ -24,6 +24,9 @@
|
|||||||
module com { module sun { module star { module frame {
|
module com { module sun { module star { module frame {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
A legacy (single-instance) service-variant of theAutoRecovery singleton.
|
||||||
|
|
||||||
|
@deprecated Use theAutoRecovery singleton instead.
|
||||||
|
|
||||||
@since LibreOffice 4.0
|
@since LibreOffice 4.0
|
||||||
*/
|
*/
|
||||||
|
28
offapi/com/sun/star/frame/theAutoRecovery.idl
Normal file
28
offapi/com/sun/star/frame/theAutoRecovery.idl
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||||
|
/*
|
||||||
|
* This file is part of the LibreOffice project.
|
||||||
|
*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
*/
|
||||||
|
#ifndef __com_sun_star_frame_theAutoRecovery_idl__
|
||||||
|
#define __com_sun_star_frame_theAutoRecovery_idl__
|
||||||
|
|
||||||
|
#include <com/sun/star/frame/XDispatch.idl>
|
||||||
|
|
||||||
|
module com { module sun { module star { module frame {
|
||||||
|
|
||||||
|
/**
|
||||||
|
Prior to LibreOffice 4.3, this singleton was only available as a
|
||||||
|
(single-instance) AutoRecovery service.
|
||||||
|
|
||||||
|
@since LibreOffice 4.3
|
||||||
|
*/
|
||||||
|
singleton theAutoRecovery : XDispatch;
|
||||||
|
|
||||||
|
}; }; }; };
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -203,7 +203,7 @@
|
|||||||
#include <com/sun/star/embed/XTransactedObject.hpp>
|
#include <com/sun/star/embed/XTransactedObject.hpp>
|
||||||
#include <com/sun/star/embed/XVisualObject.hpp>
|
#include <com/sun/star/embed/XVisualObject.hpp>
|
||||||
#include <com/sun/star/form/FormButtonType.hpp>
|
#include <com/sun/star/form/FormButtonType.hpp>
|
||||||
#include <com/sun/star/frame/AutoRecovery.hpp>
|
#include <com/sun/star/frame/theAutoRecovery.hpp>
|
||||||
#include <com/sun/star/frame/Desktop.hpp>
|
#include <com/sun/star/frame/Desktop.hpp>
|
||||||
#include <com/sun/star/frame/DispatchResultState.hpp>
|
#include <com/sun/star/frame/DispatchResultState.hpp>
|
||||||
#include <com/sun/star/frame/DocumentTemplates.hpp>
|
#include <com/sun/star/frame/DocumentTemplates.hpp>
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <com/sun/star/frame/AutoRecovery.hpp>
|
#include <com/sun/star/frame/theAutoRecovery.hpp>
|
||||||
#include <com/sun/star/frame/XComponentLoader.hpp>
|
#include <com/sun/star/frame/XComponentLoader.hpp>
|
||||||
#include <com/sun/star/lang/XInitialization.hpp>
|
#include <com/sun/star/lang/XInitialization.hpp>
|
||||||
#include <com/sun/star/document/XEventsSupplier.hpp>
|
#include <com/sun/star/document/XEventsSupplier.hpp>
|
||||||
@ -2870,7 +2870,7 @@ void SlideshowImpl::setAutoSaveState( bool bOn)
|
|||||||
aArgs[0].Name = "AutoSaveState";
|
aArgs[0].Name = "AutoSaveState";
|
||||||
aArgs[0].Value <<= bOn ? sal_True : sal_False;
|
aArgs[0].Value <<= bOn ? sal_True : sal_False;
|
||||||
|
|
||||||
uno::Reference< frame::XDispatch > xAutoSave = frame::AutoRecovery::create(xContext);
|
uno::Reference< frame::XDispatch > xAutoSave = frame::theAutoRecovery::get(xContext);
|
||||||
xAutoSave->dispatch(aURL, aArgs);
|
xAutoSave->dispatch(aURL, aArgs);
|
||||||
}
|
}
|
||||||
catch( Exception& )
|
catch( Exception& )
|
||||||
|
@ -118,7 +118,7 @@
|
|||||||
#include <com/sun/star/drawing/XShapeDescriptor.hpp>
|
#include <com/sun/star/drawing/XShapeDescriptor.hpp>
|
||||||
#include <com/sun/star/drawing/XShapes.hpp>
|
#include <com/sun/star/drawing/XShapes.hpp>
|
||||||
#include <com/sun/star/form/FormComponentType.hpp>
|
#include <com/sun/star/form/FormComponentType.hpp>
|
||||||
#include <com/sun/star/frame/AutoRecovery.hpp>
|
#include <com/sun/star/frame/theAutoRecovery.hpp>
|
||||||
#include <com/sun/star/frame/Desktop.hpp>
|
#include <com/sun/star/frame/Desktop.hpp>
|
||||||
#include <com/sun/star/frame/ModuleManager.hpp>
|
#include <com/sun/star/frame/ModuleManager.hpp>
|
||||||
#include <com/sun/star/frame/XController.hpp>
|
#include <com/sun/star/frame/XController.hpp>
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
#include <com/sun/star/beans/NamedValue.hpp>
|
#include <com/sun/star/beans/NamedValue.hpp>
|
||||||
#include <com/sun/star/util/URL.hpp>
|
#include <com/sun/star/util/URL.hpp>
|
||||||
#include <com/sun/star/util/XURLTransformer.hpp>
|
#include <com/sun/star/util/XURLTransformer.hpp>
|
||||||
#include <com/sun/star/frame/AutoRecovery.hpp>
|
#include <com/sun/star/frame/theAutoRecovery.hpp>
|
||||||
#include <com/sun/star/frame/XDispatch.hpp>
|
#include <com/sun/star/frame/XDispatch.hpp>
|
||||||
#include <com/sun/star/awt/XWindow.hpp>
|
#include <com/sun/star/awt/XWindow.hpp>
|
||||||
#include <com/sun/star/ui/dialogs/FolderPicker.hpp>
|
#include <com/sun/star/ui/dialogs/FolderPicker.hpp>
|
||||||
@ -533,7 +533,7 @@ void RecoveryCore::impl_startListening()
|
|||||||
// listening already initialized ?
|
// listening already initialized ?
|
||||||
if (m_xRealCore.is())
|
if (m_xRealCore.is())
|
||||||
return;
|
return;
|
||||||
m_xRealCore = css::frame::AutoRecovery::create(m_xContext);
|
m_xRealCore = css::frame::theAutoRecovery::get(m_xContext);
|
||||||
|
|
||||||
css::util::URL aURL;
|
css::util::URL aURL;
|
||||||
if (m_bListenForSaving)
|
if (m_bListenForSaving)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user