Kaydet (Commit) dd1c991b authored tarafından Matúš Kukan's avatar Matúš Kukan

Introduce com.sun.star.frame.theAutoRecovery singleton.

To replace com.sun.star.frame.AutoRecovery single-instance service,
incorrectly converted in 279859fd

Unfortunately needs a lot of changes in autorecovery.cxx.

Change-Id: Iba5188dffea3e03803236f23e0b3f343746ace90
üst 3774a6fd
......@@ -39,7 +39,7 @@
#include <svl/languageoptions.hxx>
#include <svtools/javacontext.hxx>
#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/SessionListener.hpp>
#include <com/sun/star/frame/XSessionManagerListener.hpp>
......@@ -2344,7 +2344,7 @@ void Desktop::OpenClients()
{
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() );
css::util::URL aCmd;
......
......@@ -106,7 +106,7 @@
#include <com/sun/star/embed/XPackageStructureCreator.hpp>
#include <com/sun/star/embed/XTransactedObject.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/ContentHandlerFactory.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.XModel;
import com.sun.star.frame.XStatusListener;
import com.sun.star.frame.theAutoRecovery;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.sheet.FillDirection;
import com.sun.star.sheet.XCellSeries;
......@@ -204,7 +205,7 @@ public class AutoSave
m_aSOF = SOfficeFactory.getFactory(m_xSMGR);
// 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
// make sure it will be started every 1 min
......
......@@ -36,7 +36,7 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/PropertyState.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/XStorable.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
// 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 );
URL aURL;
aURL.Complete = "vnd.sun.star.autorecovery:/doSessionSave";
......@@ -145,7 +145,7 @@ void SessionListener::QuitSessionQuietly()
// 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 = 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 );
URL aURL;
aURL.Complete = "vnd.sun.star.autorecovery:/doSessionQuietQuit";
......@@ -226,7 +226,7 @@ sal_Bool SAL_CALL SessionListener::doRestore()
ResetableGuard aGuard(m_aLock);
m_bRestored = sal_False;
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;
aURL.Complete = "vnd.sun.star.autorecovery:/doSessionRestore";
......
......@@ -29,6 +29,7 @@
<implementation name="com.sun.star.comp.framework.AutoRecovery"
constructor="com_sun_star_comp_framework_AutoRecovery_get_implementation">
<service name="com.sun.star.frame.AutoRecovery"/>
<singleton name="com.sun.star.frame.theAutoRecovery"/>
</implementation>
<implementation name="com.sun.star.comp.framework.ControlMenuController"
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 \
TaskCreator \
UICommandDescription \
theAutoRecovery \
theGlobalEventBroadcaster \
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,com/sun/star/graphic,\
......
......@@ -24,6 +24,9 @@
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
*/
......
/* -*- 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/XVisualObject.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/DispatchResultState.hpp>
#include <com/sun/star/frame/DocumentTemplates.hpp>
......
......@@ -17,7 +17,7 @@
* 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/lang/XInitialization.hpp>
#include <com/sun/star/document/XEventsSupplier.hpp>
......@@ -2870,7 +2870,7 @@ void SlideshowImpl::setAutoSaveState( bool bOn)
aArgs[0].Name = "AutoSaveState";
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);
}
catch( Exception& )
......
......@@ -118,7 +118,7 @@
#include <com/sun/star/drawing/XShapeDescriptor.hpp>
#include <com/sun/star/drawing/XShapes.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/ModuleManager.hpp>
#include <com/sun/star/frame/XController.hpp>
......
......@@ -44,7 +44,7 @@
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/util/URL.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/awt/XWindow.hpp>
#include <com/sun/star/ui/dialogs/FolderPicker.hpp>
......@@ -533,7 +533,7 @@ void RecoveryCore::impl_startListening()
// listening already initialized ?
if (m_xRealCore.is())
return;
m_xRealCore = css::frame::AutoRecovery::create(m_xContext);
m_xRealCore = css::frame::theAutoRecovery::get(m_xContext);
css::util::URL aURL;
if (m_bListenForSaving)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment