Files
libreoffice/sdext/source/presenter/PresenterScreen.cxx

863 lines
28 KiB
C++
Raw Normal View History

/* -*- 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/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "PresenterScreen.hxx"
#include "PresenterConfigurationAccess.hxx"
#include "PresenterController.hxx"
#include "PresenterFrameworkObserver.hxx"
#include "PresenterHelper.hxx"
#include "PresenterPaneContainer.hxx"
#include "PresenterPaneFactory.hxx"
#include "PresenterViewFactory.hxx"
#include "PresenterWindowManager.hxx"
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/drawing/framework/Configuration.hpp>
#include <com/sun/star/drawing/framework/XControllerManager.hpp>
#include <com/sun/star/drawing/framework/ResourceId.hpp>
#include <com/sun/star/drawing/framework/ResourceActivationMode.hpp>
#include <com/sun/star/presentation/XSlideShow.hpp>
#include <com/sun/star/presentation/XPresentation2.hpp>
#include <com/sun/star/presentation/XPresentationSupplier.hpp>
#include <com/sun/star/document/XEventBroadcaster.hpp>
#include <boost/bind.hpp>
#include <com/sun/star/view/XSelectionSupplier.hpp>
#include <vcl/svapp.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::presentation;
using namespace ::com::sun::star::drawing::framework;
namespace sdext { namespace presenter {
namespace {
typedef ::cppu::WeakComponentImplHelper1 <
css::document::XEventListener
> PresenterScreenListenerInterfaceBase;
/** One instance of a PresenterScreenListener is registered per Impress
document and waits for the full screen slide show to start and to
end.
*/
class PresenterScreenListener
: private ::boost::noncopyable,
private ::cppu::BaseMutex,
public PresenterScreenListenerInterfaceBase
{
public:
PresenterScreenListener (
const css::uno::Reference<css::uno::XComponentContext>& rxContext,
const css::uno::Reference<css::frame::XModel2>& rxModel);
virtual ~PresenterScreenListener();
void Initialize();
virtual void SAL_CALL disposing() SAL_OVERRIDE;
// document::XEventListener
virtual void SAL_CALL notifyEvent( const css::document::EventObject& Event ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
// XEventListener
virtual void SAL_CALL disposing ( const css::lang::EventObject& rEvent) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
private:
css::uno::Reference<css::frame::XModel2 > mxModel;
css::uno::Reference<css::uno::XComponentContext> mxComponentContext;
rtl::Reference<PresenterScreen> mpPresenterScreen;
void ThrowIfDisposed() const throw (::com::sun::star::lang::DisposedException);
};
}
//----- Service ---------------------------------------------------------------
OUString PresenterScreenJob::getImplementationName_static()
{
Turn presenter screen from bundled extension to plain code The immediate trigger was 5e5c11c664f67ff9fd1120905b09a32bea3b2f6c "fdo#42070 Fix RTL support in presenter console" causing build failures on Mac OS X when linking the extension against vcl, but there should be more benefits of going from a bundled-anyway extension to plain code. (Not the least to get rid of the com.sun.star.drawing.XPresenterHelper hack.) To avoid unnecessary confusion between the newly plain code and any instance of the old extension still installed (per-user or shared), I renamed all relevant identifiers as follows: * UNO implementation com.sun.star.comp.Draw.framework.PresenterScreenJob -> org.libreoffice.comp.PresenterScreenJob * UNO implementation com.sun.star.sdext.presenter.PresenterProtocolHandler -> org.libreoffice.comp.PresenterScreenProtocolHandler * protocol handler schema vnd.com.sun.star.comp.PresenterScreen -> vnd.org.libreoffice.presenterscreen * configuration schema /org.openoffice.Office.extension.PresenterScreen -> /org.openoffice.Office.PresenterScreen (it appears this contains little to no user-changeable data anyway, so not migrating it to a new user profile due to the schema name change should not be problematic) * job ID onDocumentOpenedJob -> org.libreoffice.PresenterScreen Even with these precautions, having the presenter screen installed both as plain code and as a (per-user or shared) extension still leads to a crash when activating presentation mode (likely due to how both codes want to take control of the screen). To mitigate this, existing installations of the extension are explicitly not migrated to new user profiles. The sdext/source/presenter/bitmaps/*.png files were moved to icon-themes/galaxy/sd/res/presenterscreen-*.png and are now accessed via SdResId (adding the relevant data to sd/source/ui/inc/res_bmp.hrc and sd/source/ui/app/res_bmp.src; not sure whether these locations are already ideal). The code itself has been left mostly unchanged in sdext/source/presenter/, and it still clumsily communicates with sd core code via XPresenterHelper. There is a lot of room for improvement here. The help data is left untouched at sdext/source/presenter/help/ and needs to be incorporated properly into helpcontent2 in a follow-up commit. The --disable-ext-presenter-console configure switch is gone. Change-Id: I71adb7ae6dcdbd1802151fce6e3871d8a2026332
2012-11-21 17:19:28 +01:00
return OUString("org.libreoffice.comp.PresenterScreenJob");
}
Sequence<OUString> PresenterScreenJob::getSupportedServiceNames_static()
{
return Sequence<OUString>();
}
Reference<XInterface> PresenterScreenJob::Create (const Reference<uno::XComponentContext>& rxContext)
{
return Reference<XInterface>(static_cast<XWeak*>(new PresenterScreenJob(rxContext)));
}
//===== PresenterScreenJob ====================================================
PresenterScreenJob::PresenterScreenJob (const Reference<XComponentContext>& rxContext)
: PresenterScreenJobInterfaceBase(m_aMutex),
mxComponentContext(rxContext)
{
}
PresenterScreenJob::~PresenterScreenJob()
{
}
void SAL_CALL PresenterScreenJob::disposing()
{
mxComponentContext = NULL;
}
//----- XJob -----------------------------------------------------------
Any SAL_CALL PresenterScreenJob::execute(
const Sequence< beans::NamedValue >& Arguments )
throw (lang::IllegalArgumentException, Exception, RuntimeException, std::exception)
{
Sequence< beans::NamedValue > lEnv;
sal_Int32 i = 0;
sal_Int32 c = Arguments.getLength();
const beans::NamedValue* p = Arguments.getConstArray();
for (i=0; i<c; ++i)
{
if ( p[i].Name == "Environment" )
{
p[i].Value >>= lEnv;
break;
}
}
Reference<frame::XModel2> xModel;
c = lEnv.getLength();
p = lEnv.getConstArray();
for (i=0; i<c; ++i)
{
if ( p[i].Name == "Model" )
{
p[i].Value >>= xModel;
break;
}
}
Reference< XServiceInfo > xInfo( xModel, UNO_QUERY );
if( xInfo.is() && xInfo->supportsService("com.sun.star.presentation.PresentationDocument") )
{
// Create a new listener that waits for the full screen presentation
// to start and to end. It takes care of its own lifetime.
::rtl::Reference<PresenterScreenListener> pListener (
new PresenterScreenListener(mxComponentContext, xModel));
pListener->Initialize();
}
return Any();
}
//===== PresenterScreenListener ===============================================
namespace {
PresenterScreenListener::PresenterScreenListener (
const css::uno::Reference<css::uno::XComponentContext>& rxContext,
const css::uno::Reference<css::frame::XModel2>& rxModel)
: PresenterScreenListenerInterfaceBase(m_aMutex),
mxModel(rxModel),
mxComponentContext(rxContext),
mpPresenterScreen()
{
}
void PresenterScreenListener::Initialize()
{
Reference< document::XEventListener > xDocListener(
static_cast< document::XEventListener* >(this), UNO_QUERY);
Reference< document::XEventBroadcaster > xDocBroadcaster( mxModel, UNO_QUERY );
if( xDocBroadcaster.is() )
xDocBroadcaster->addEventListener(xDocListener);
}
PresenterScreenListener::~PresenterScreenListener()
{
}
void SAL_CALL PresenterScreenListener::disposing()
{
Reference< document::XEventBroadcaster > xDocBroadcaster( mxModel, UNO_QUERY );
if( xDocBroadcaster.is() )
xDocBroadcaster->removeEventListener(
Reference<document::XEventListener>(
static_cast<document::XEventListener*>(this), UNO_QUERY));
if (mpPresenterScreen.is())
{
mpPresenterScreen->RequestShutdownPresenterScreen();
mpPresenterScreen = NULL;
}
}
// document::XEventListener
void SAL_CALL PresenterScreenListener::notifyEvent( const css::document::EventObject& Event ) throw (css::uno::RuntimeException, std::exception)
{
ThrowIfDisposed();
if ( Event.EventName == "OnStartPresentation" )
{
mpPresenterScreen = new PresenterScreen(mxComponentContext, mxModel);
if(PresenterScreen::isPresenterScreenEnabled(mxComponentContext))
fdo#56995 Created global option to disable presenter console in Impress Changes made are as Follows /officecfg/registry/schema/org/openoffice/Office/Impress.xcs To add the new global checkbox to Libreoffice Impress>General>Start A new xml block for EnablePresenterScreen was added <prop oor:name="EnablePresenterScreen" oor:type="xs:boolean" > /sd/source/ui/app/optsitem.cxx To add the setter/getter for the new checkbox button, namely: SetEnablePresenterScreen IsEnablePresenterScreen EnablePresenterScreen added to index number 26 of: GetPropNameArray() /sd/source/ui/dlg/tpoption.cxx SdTpOptionsMisc() editted to attach EnablePresenterScreen to CBX_ENABLE_PRESENTER_SCREEN aCbxEnablePresenterScreen ( this, SdResId( CBX_ENABLE_PRESENTER_SCREEN)) Also Added to FillItemSet() and Reset() functions /sd/source/ui/dlg/tpoption.src b/sd/source/ui/dlg/tpoption.src enableSdRemote size changed to Size = MAP_APPFONT ( 116 , 10 ) ; Pos = MAP_APPFONT ( 12 , 171 ) ; 158 was correct but 171 was added on request To allow enableSdRemote(CBX_ENABLE_SDREMOTE) and enablePresenterScreen( CBX_ENABLE_PRESENTER_SCREEN) to be drawn adjacent. enablePresenterScreen checkbox CBX_ENABLE_PRESENTER_SCREEN added /sd/source/ui/inc/optsitem.hxx Set default value for enablePresenterScreen as 1 or TRUE sal_Bool bEnablePresenterScreen : 1; Added getter/setter named same as above for interface definition sd/source/ui/inc/tpoption.hrc Defined CBX_ENABLE_PRESENTER_SCREEN as 42nd checkbox #define CBX_ENABLE_PRESENTER_SCREEN 42 /sd/source/ui/inc/tpoption.hxx Added interface declaration of aCbxEnablePresenterScreen which was attached to CBX_ENABLE_PRESENTER_SCREEN /sdext/source/presenter/PresenterScreen.hxx Added interface declaration of bool isPresenterScreenEnabled() to PresenterScreen class to allow presenterscreen to get if the option is checked /sdext/source/presenter/PresenterScreen.cxx Added definition of isPresenterScreenEnabled(const css::uno::Reference<css::uno::XComponentContext>& rxContext) Input : Current Process Context Output : The 0/1 value of EnablePresenterScreen from presenterconfig In PresenterScreenListener::notifyEvent( ) Added if(mpPresenterScreen->isPresenterScreenEnabled(mxComponentContext) mpPresenterScreen->InitializePresenterScreen() To initialize PresenterScreen only when enabled Change-Id: If8242e607323df57d8e78d08cf2129d03c0c9e4f Reviewed-on: https://gerrit.libreoffice.org/3762 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
2013-05-03 09:20:28 -07:00
mpPresenterScreen->InitializePresenterScreen();
}
else if ( Event.EventName == "OnEndPresentation" )
{
if (mpPresenterScreen.is())
{
mpPresenterScreen->RequestShutdownPresenterScreen();
mpPresenterScreen = NULL;
}
}
}
// XEventListener
void SAL_CALL PresenterScreenListener::disposing (const css::lang::EventObject& rEvent)
throw (css::uno::RuntimeException, std::exception)
{
(void)rEvent;
if (mpPresenterScreen.is())
{
mpPresenterScreen->RequestShutdownPresenterScreen();
mpPresenterScreen = NULL;
}
}
void PresenterScreenListener::ThrowIfDisposed() const throw (
::com::sun::star::lang::DisposedException)
{
if (rBHelper.bDisposed || rBHelper.bInDispose)
{
throw lang::DisposedException (
OUString(
"PresenterScreenListener object has already been disposed"),
const_cast<uno::XWeak*>(static_cast<const uno::XWeak*>(this)));
}
}
} // end of anonymous namespace
//===== PresenterScreen =======================================================
PresenterScreen::PresenterScreen (
const Reference<XComponentContext>& rxContext,
const css::uno::Reference<css::frame::XModel2>& rxModel)
: PresenterScreenInterfaceBase(m_aMutex),
mxModel(rxModel),
mxController(),
mxConfigurationControllerWeak(),
mxContextWeak(rxContext),
mxSlideShowControllerWeak(),
mpPresenterController(),
mxSlideShowViewId(),
mxSavedConfiguration(),
mpPaneContainer(),
mnComponentIndex(0),
mxPaneFactory(),
mxViewFactory(),
maViewDescriptors()
{
}
PresenterScreen::~PresenterScreen()
{
}
fdo#56995 Created global option to disable presenter console in Impress Changes made are as Follows /officecfg/registry/schema/org/openoffice/Office/Impress.xcs To add the new global checkbox to Libreoffice Impress>General>Start A new xml block for EnablePresenterScreen was added <prop oor:name="EnablePresenterScreen" oor:type="xs:boolean" > /sd/source/ui/app/optsitem.cxx To add the setter/getter for the new checkbox button, namely: SetEnablePresenterScreen IsEnablePresenterScreen EnablePresenterScreen added to index number 26 of: GetPropNameArray() /sd/source/ui/dlg/tpoption.cxx SdTpOptionsMisc() editted to attach EnablePresenterScreen to CBX_ENABLE_PRESENTER_SCREEN aCbxEnablePresenterScreen ( this, SdResId( CBX_ENABLE_PRESENTER_SCREEN)) Also Added to FillItemSet() and Reset() functions /sd/source/ui/dlg/tpoption.src b/sd/source/ui/dlg/tpoption.src enableSdRemote size changed to Size = MAP_APPFONT ( 116 , 10 ) ; Pos = MAP_APPFONT ( 12 , 171 ) ; 158 was correct but 171 was added on request To allow enableSdRemote(CBX_ENABLE_SDREMOTE) and enablePresenterScreen( CBX_ENABLE_PRESENTER_SCREEN) to be drawn adjacent. enablePresenterScreen checkbox CBX_ENABLE_PRESENTER_SCREEN added /sd/source/ui/inc/optsitem.hxx Set default value for enablePresenterScreen as 1 or TRUE sal_Bool bEnablePresenterScreen : 1; Added getter/setter named same as above for interface definition sd/source/ui/inc/tpoption.hrc Defined CBX_ENABLE_PRESENTER_SCREEN as 42nd checkbox #define CBX_ENABLE_PRESENTER_SCREEN 42 /sd/source/ui/inc/tpoption.hxx Added interface declaration of aCbxEnablePresenterScreen which was attached to CBX_ENABLE_PRESENTER_SCREEN /sdext/source/presenter/PresenterScreen.hxx Added interface declaration of bool isPresenterScreenEnabled() to PresenterScreen class to allow presenterscreen to get if the option is checked /sdext/source/presenter/PresenterScreen.cxx Added definition of isPresenterScreenEnabled(const css::uno::Reference<css::uno::XComponentContext>& rxContext) Input : Current Process Context Output : The 0/1 value of EnablePresenterScreen from presenterconfig In PresenterScreenListener::notifyEvent( ) Added if(mpPresenterScreen->isPresenterScreenEnabled(mxComponentContext) mpPresenterScreen->InitializePresenterScreen() To initialize PresenterScreen only when enabled Change-Id: If8242e607323df57d8e78d08cf2129d03c0c9e4f Reviewed-on: https://gerrit.libreoffice.org/3762 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
2013-05-03 09:20:28 -07:00
bool PresenterScreen::isPresenterScreenEnabled(const css::uno::Reference<css::uno::XComponentContext>& rxContext)
{
bool dEnablePresenterScreen=true;
PresenterConfigurationAccess aConfiguration (
rxContext,
OUString("/org.openoffice.Office.Impress/"),
PresenterConfigurationAccess::READ_ONLY);
aConfiguration.GetConfigurationNode("Misc/Start/EnablePresenterScreen")
>>= dEnablePresenterScreen;
return dEnablePresenterScreen;
}
void SAL_CALL PresenterScreen::disposing()
{
Reference<XConfigurationController> xCC (mxConfigurationControllerWeak);
if (xCC.is() && mxSavedConfiguration.is())
{
xCC->restoreConfiguration(mxSavedConfiguration);
}
mxConfigurationControllerWeak = Reference<XConfigurationController>(NULL);
Reference<lang::XComponent> xViewFactoryComponent (mxViewFactory, UNO_QUERY);
if (xViewFactoryComponent.is())
xViewFactoryComponent->dispose();
Reference<lang::XComponent> xPaneFactoryComponent (mxPaneFactory, UNO_QUERY);
if (xPaneFactoryComponent.is())
xPaneFactoryComponent->dispose();
mxModel = NULL;
}
//----- XEventListener --------------------------------------------------------
void SAL_CALL PresenterScreen::disposing (const lang::EventObject& /*rEvent*/)
throw (RuntimeException, std::exception)
{
mxSlideShowControllerWeak = WeakReference<presentation::XSlideShowController>();
RequestShutdownPresenterScreen();
}
void PresenterScreen::InitializePresenterScreen()
{
try
{
Reference<XComponentContext> xContext (mxContextWeak);
mpPaneContainer =
new PresenterPaneContainer(Reference<XComponentContext>(xContext));
Reference<XPresentationSupplier> xPS ( mxModel, UNO_QUERY_THROW);
Reference<XPresentation2> xPresentation(xPS->getPresentation(), UNO_QUERY_THROW);
Reference<presentation::XSlideShowController> xSlideShowController( xPresentation->getController() );
mxSlideShowControllerWeak = xSlideShowController;
if( !xSlideShowController.is() || !xSlideShowController->isFullScreen() )
return;
// find first controller that is not the current controller (the one with the slideshow
mxController = mxModel->getCurrentController();
Reference< container::XEnumeration > xEnum( mxModel->getControllers() );
if( xEnum.is() )
{
while( xEnum->hasMoreElements() )
{
Reference< frame::XController > xC( xEnum->nextElement(), UNO_QUERY );
if( xC.is() && (xC != mxController) )
{
mxController = xC;
break;
}
}
}
// Get the XController from the first argument.
Reference<XControllerManager> xCM(mxController, UNO_QUERY_THROW);
Reference<XConfigurationController> xCC( xCM->getConfigurationController());
mxConfigurationControllerWeak = xCC;
CWS-TOOLING: integrate CWS sjfixes10 2009-01-15 14:02:24 +0100 af r266369 : #i88851# Finding the right font size is now an iterative process. 2009-01-15 11:01:59 +0100 wg r266354 : i97985 2009-01-15 10:57:33 +0100 wg r266353 : i97985 2009-01-15 10:48:53 +0100 wg r266347 : i97985 2009-01-15 10:48:23 +0100 wg r266346 : i97985 2009-01-15 10:46:47 +0100 wg r266345 : i97985 2009-01-15 10:45:43 +0100 wg r266344 : i97985 2009-01-15 10:45:14 +0100 wg r266343 : i97985 2009-01-15 10:44:38 +0100 wg r266342 : i97985 2009-01-15 10:43:56 +0100 wg r266341 : i97985 2009-01-15 10:42:50 +0100 wg r266340 : i97985 2009-01-15 10:41:40 +0100 wg r266339 : i97985 2009-01-15 10:39:46 +0100 wg r266337 : i97985 2009-01-15 10:00:09 +0100 hde r266336 : i98065 2009-01-13 15:48:20 +0100 wg r266232 : i97985 2009-01-13 13:22:05 +0100 wg r266217 : i97985 2009-01-13 12:34:05 +0100 wg r266210 : i97985 2009-01-13 12:30:56 +0100 wg r266209 : i97985 2009-01-13 12:26:56 +0100 wg r266208 : i97985 2009-01-12 15:58:06 +0100 wg r266165 : i97985 2009-01-12 15:43:24 +0100 wg r266163 : i97985 2009-01-08 16:21:47 +0100 sj r266023 : fixed warning 2009-01-08 15:33:34 +0100 sj r266017 : fixed warning 2009-01-06 18:13:42 +0100 sj r265935 : CWS-TOOLING: rebase CWS sjfixes10 to trunk@265758 (milestone: DEV300:m38) 2008-12-10 16:54:02 +0100 af r265206 : #i43354# Do not delete all unused master pages automatically. 2008-12-04 13:12:50 +0100 af r264836 : #i92795# Use BitmapEx for icons to allow transparency. 2008-12-02 17:01:49 +0100 af r264723 : #i93082# Fixed SID_INSERTPAGE_LAYOUT_MENU. 2008-11-28 14:37:28 +0100 af r264555 : #i88851# Changed association of Ctrl-'?' to views. 2008-11-28 11:38:52 +0100 af r264535 : #i96681# Set version to 1.0.2 2008-11-28 11:30:04 +0100 af r264533 : #i88851# Ctrl-1,2,3 switch to slide overview, notes, normal view. 2008-11-27 16:41:25 +0100 af r264505 : #i92144# Removed unused code. 2008-11-26 15:29:56 +0100 af r264401 : #i92574# Do not lock configuration controller when main pane is not available. 2008-11-21 10:13:40 +0100 sj r264112 : #i96146# applied patch (ambiguous && ||) 2008-11-20 20:12:06 +0100 sj r264097 : #i96083# applied patch (ambigous && ||) 2008-11-20 19:13:53 +0100 sj r264096 : #i96163# applied patch (ambigous && ||) 2008-11-20 18:39:10 +0100 sj r264093 : #i96165# applied patch (ambigous && ||) 2008-11-03 18:12:29 +0100 sj r263303 : #i93996# fixed word wrapping problem 2008-11-03 18:11:02 +0100 sj r263302 : #i93996# fixed word wrapping problem 2008-11-03 18:08:41 +0100 sj r263301 : #i93996# fixed word wrapping problem 2008-11-03 18:06:45 +0100 sj r263300 : #i93996# fixed word wrapping problem 2008-11-03 18:05:00 +0100 sj r263299 : #i94831,i93616# fixed crash when importing diagonal cell border lines, fixed table import 2008-11-03 18:00:43 +0100 sj r263298 : #i93718# spellchecking is no longer triggering the autolayout of connector objects
2009-01-21 14:22:27 +00:00
Reference<drawing::framework::XResourceId> xMainPaneId(
GetMainPaneId(xPresentation));
// An empty reference means that the presenter screen can
// not or must not be displayed.
if ( ! xMainPaneId.is())
return;
if (xCC.is() && xContext.is())
{
// Store the current configuration so that we can restore it when
// the presenter view is deactivated.
mxSavedConfiguration = xCC->getRequestedConfiguration();
xCC->lock();
try
{
// At the moment the presenter controller is displayed in its
// own full screen window that is controlled by the same
// configuration controller as the Impress document from
// which the presentation was started. Therefore the main
Many spelling fixes: directories r* - z*. Attempt to clean up most but certainly not all the spelling mistakes that found home in OpenOffice through decades. We could probably blame the international nature of the code but it is somewhat shameful that this wasn't done before. (cherry picked from commit 28206a7cb43aff5adb10f8235ad1680c3941ee3e) Conflicts: include/osl/file.hxx include/osl/pipe_decl.hxx include/osl/socket.h include/osl/socket_decl.hxx include/sal/main.h include/svx/dbaexchange.hxx include/svx/dlgctrl.hxx include/svx/msdffdef.hxx include/svx/sdr/contact/objectcontactofpageview.hxx include/svx/svdpntv.hxx include/ucbhelper/content.hxx include/ucbhelper/interceptedinteraction.hxx include/ucbhelper/resultsethelper.hxx include/unotools/sharedunocomponent.hxx include/unotools/viewoptions.hxx include/vcl/pdfwriter.hxx include/xmloff/txtparae.hxx include/xmloff/uniref.hxx rhino/rhino1_7R3.patch rsc/inc/rscrsc.hxx sal/inc/osl/conditn.h sal/inc/osl/security.h sal/inc/osl/semaphor.h sal/inc/osl/semaphor.hxx sal/inc/rtl/string.hxx sal/inc/rtl/tres.h sal/inc/systools/win32/StrConvert.h sal/osl/os2/file_path_helper.h sal/osl/os2/file_path_helper.hxx sal/osl/os2/file_url.cxx sal/osl/os2/file_url.h sal/osl/os2/makefile.mk sal/osl/os2/pipe.cxx sal/osl/os2/process.c sal/osl/os2/profile.c sal/osl/os2/socket.c sal/osl/os2/system.h sal/osl/unx/asm/interlck_sparc.s sal/osl/unx/file_url.cxx sal/osl/unx/signal.c sal/osl/unx/system.h sal/osl/w32/MAKEFILE.MK sal/osl/w32/interlck.c sal/osl/w32/module.cxx sal/osl/w32/security.c sal/qa/buildall.pl sal/qa/osl/file/osl_File.cxx sal/qa/osl/module/osl_Module_Const.h sal/qa/osl/mutex/osl_Mutex.cxx sal/qa/osl/pipe/osl_Pipe.cxx sal/qa/osl/process/osl_Thread.cxx sal/qa/osl/socket/osl_StreamSocket.cxx sal/qa/osl/socket/sockethelper.cxx sal/qa/rtl_strings/rtl_OUString.cxx sal/rtl/source/unload.cxx sal/systools/win32/kill/kill.cxx sal/systools/win32/uwinapi/MoveFileExA.cpp sal/test/bootstrap.pl sal/typesconfig/typesconfig.c sal/workben/tgetpwnam.cxx sax/inc/sax/parser/saxparser.hxx sc/addin/datefunc/dfa.cl sc/addin/datefunc/dfa.src sc/addin/rot13/rot13.cl sc/addin/rot13/rot13.src sc/inc/attarray.hxx sc/inc/chgtrack.hxx sc/inc/column.hxx sc/inc/compressedarray.hxx sc/inc/document.hxx sc/inc/table.hxx sc/source/core/data/column.cxx sc/source/core/data/dptablecache.cxx sc/source/core/data/dptabres.cxx sc/source/core/data/dptabsrc.cxx sc/source/core/data/global.cxx sc/source/core/tool/chgtrack.cxx sc/source/core/tool/compiler.cxx sc/source/filter/excel/xestyle.cxx sc/source/filter/excel/xichart.cxx sc/source/filter/inc/fapihelper.hxx sc/source/filter/inc/xistyle.hxx sc/source/filter/xml/xmlsubti.cxx sc/source/ui/Accessibility/AccessibleCell.cxx sc/source/ui/Accessibility/AccessibleContextBase.cxx sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx sc/source/ui/Accessibility/AccessibleEditObject.cxx sc/source/ui/Accessibility/AccessiblePreviewCell.cxx sc/source/ui/app/inputwin.cxx sc/source/ui/docshell/docfunc.cxx sc/source/ui/drawfunc/fupoor.cxx sc/source/ui/miscdlgs/linkarea.cxx sc/source/ui/unoobj/chart2uno.cxx sc/source/ui/unoobj/nameuno.cxx sc/source/ui/vba/vbacharacters.hxx sc/source/ui/vba/vbarange.cxx sc/source/ui/vba/vbawindow.cxx scaddins/source/analysis/analysishelper.cxx scaddins/source/analysis/analysishelper.hxx scaddins/source/datefunc/datefunc.cxx scripting/examples/python/Capitalise.py scripting/source/pyprov/officehelper.py sd/source/filter/eppt/eppt.cxx sd/source/filter/eppt/epptso.cxx sd/source/ui/dlg/prltempl.cxx sd/source/ui/dlg/tpoption.cxx sd/source/ui/func/fuediglu.cxx sd/source/ui/func/fupoor.cxx sd/source/ui/func/fusel.cxx sd/source/ui/func/smarttag.cxx sd/source/ui/inc/OutlinerIteratorImpl.hxx sd/source/ui/inc/SlideViewShell.hxx sd/source/ui/inc/fuediglu.hxx sd/source/ui/inc/fusel.hxx sd/source/ui/slideshow/slideshowimpl.cxx sd/source/ui/slidesorter/cache/SlsQueueProcessorThread.hxx sd/source/ui/slidesorter/controller/SlsHideSlideFunction.cxx sd/source/ui/slidesorter/controller/SlsSelectionCommand.hxx sd/source/ui/slidesorter/inc/controller/SlsAnimationFunction.hxx sd/source/ui/slidesorter/view/SlsButtonBar.cxx sd/source/ui/view/Outliner.cxx sd/source/ui/view/drviewsh.cxx sd/source/ui/view/frmview.cxx sdext/source/presenter/PresenterFrameworkObserver.hxx sdext/source/presenter/PresenterSlideShowView.cxx setup_native/scripts/deregister_extensions setup_native/scripts/register_extensions setup_native/source/opensolaris/bundledextensions/README setup_native/source/opensolaris/bundledextensions/svc-ooo_bundled_extensions setup_native/source/win32/customactions/patch/swappatchfiles.cxx setup_native/source/win32/customactions/reg4msdoc/registrar.cxx setup_native/source/win32/customactions/reg4msdoc/userregistrar.cxx sfx2/inc/sfx2/sfxbasemodel.hxx sfx2/qa/complex/sfx2/DocumentProperties.java sfx2/source/appl/appopen.cxx sfx2/source/appl/appquit.cxx sfx2/source/appl/appserv.cxx sfx2/source/bastyp/sfxhtml.cxx sfx2/source/dialog/dockwin.cxx sfx2/source/doc/docfile.cxx sfx2/source/doc/docvor.cxx sfx2/source/doc/graphhelp.cxx sfx2/source/doc/objcont.cxx sfx2/source/doc/objserv.cxx sfx2/source/doc/objstor.cxx sfx2/source/doc/objuno.cxx sfx2/source/doc/objxtor.cxx sfx2/source/doc/printhelper.cxx sfx2/source/doc/sfxbasemodel.cxx sfx2/source/notify/eventsupplier.cxx sfx2/source/view/frmload.cxx sfx2/source/view/sfxbasecontroller.cxx shell/qa/zip/ziptest.cxx shell/source/backends/wininetbe/wininetbackend.cxx shell/source/win32/shlxthandler/util/utilities.cxx solenv/bin/build.pl solenv/bin/build_release.pl solenv/bin/cws.pl solenv/bin/download_external_dependencies.pl solenv/bin/make_download.pl solenv/bin/make_installer.pl solenv/bin/modules/Cws.pm solenv/bin/modules/ExtensionsLst.pm solenv/bin/modules/installer/control.pm solenv/bin/modules/installer/downloadsigner.pm solenv/bin/modules/installer/javainstaller.pm solenv/bin/modules/installer/packagepool.pm solenv/bin/modules/installer/patch/InstallationSet.pm solenv/bin/modules/installer/scriptitems.pm solenv/bin/modules/installer/windows/feature.pm solenv/bin/modules/installer/windows/msiglobal.pm solenv/bin/modules/installer/windows/sign.pm solenv/bin/modules/installer/worker.pm solenv/bin/modules/installer/xpdinstaller.pm solenv/bin/modules/osarch.pm solenv/bin/modules/packager/work.pm solenv/bin/modules/pre2par/parameter.pm solenv/bin/patch_tool.pl solenv/bin/transform_description.pl solenv/doc/gbuild/doxygen.cfg solenv/gbuild/LinkTarget.mk solenv/gbuild/gbuild.mk solenv/inc/os2gcci.mk solenv/inc/settings.mk solenv/inc/startup/Readme solenv/inc/target.mk solenv/inc/tg_compv.mk solenv/inc/tg_javav.mk solenv/inc/unitools.mk solenv/inc/unxbsdi.mk solenv/inc/unxbsdi2.mk solenv/inc/unxbsds.mk solenv/inc/unxfbsd.mk solenv/inc/unxlng.mk sot/source/sdstor/stg.cxx sot/source/sdstor/stgelem.cxx sot/source/sdstor/ucbstorage.cxx starmath/inc/toolbox.hxx starmath/source/mathmlexport.cxx starmath/source/node.cxx starmath/source/toolbox.cxx starmath/source/view.cxx stoc/source/bootstrap/bootstrap.xml stoc/source/corereflection/criface.cxx stoc/source/invocation/invocation.cxx stoc/source/security/access_controller.cxx stoc/source/servicemanager/servicemanager.cxx stoc/source/tdmanager/tdmgr.cxx stoc/test/javavm/testjavavm.cxx stoc/test/testconv.cxx stoc/test/testcorefl.cxx stoc/test/testintrosp.cxx svl/inc/svl/inettype.hxx svl/inc/svl/urihelper.hxx svl/qa/complex/ConfigItems/helper/HistoryOptTest.cxx svl/qa/complex/ConfigItems/helper/HistoryOptTest.hxx svl/source/config/itemholder2.hxx svl/source/items/itemset.cxx svl/source/numbers/zforlist.cxx svl/source/numbers/zformat.cxx svl/source/numbers/zforscan.cxx svtools/bmpmaker/bmp.cxx svtools/inc/svtools/helpagentwindow.hxx svtools/inc/svtools/menuoptions.hxx svtools/inc/svtools/miscopt.hxx svtools/inc/svtools/optionsdrawinglayer.hxx svtools/inc/svtools/stringtransfer.hxx svtools/inc/svtools/svlbitm.hxx svtools/inc/svtools/svtdata.hxx svtools/inc/svtools/valueset.hxx svtools/source/brwbox/editbrowsebox.cxx svtools/source/config/itemholder2.hxx svtools/source/contnr/contentenumeration.hxx svx/inc/svx/fmsrcimp.hxx svx/inc/svx/svdobj.hxx svx/inc/svx/xtable.hxx svx/source/accessibility/DGColorNameLookUp.cxx svx/source/accessibility/svxrectctaccessiblecontext.cxx svx/source/dialog/pfiledlg.cxx svx/source/fmcomp/fmgridcl.cxx svx/source/fmcomp/fmgridif.cxx svx/source/fmcomp/gridctrl.cxx svx/source/form/filtnav.cxx svx/source/form/fmPropBrw.cxx svx/source/form/fmshimp.cxx svx/source/form/fmsrcimp.cxx svx/source/gallery2/galtheme.cxx svx/source/inc/docrecovery.hxx svx/source/sdr/event/eventhandler.cxx svx/source/svdraw/svdedtv2.cxx svx/source/svdraw/svdedxv.cxx svx/source/svdraw/svdhdl.cxx svx/source/svdraw/svdobj.cxx svx/source/svdraw/svdograf.cxx svx/source/svdraw/svdoole2.cxx svx/source/svdraw/svdotxtr.cxx svx/source/svdraw/svdundo.cxx svx/source/svdraw/svdxcgv.cxx svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx sw/inc/SwNumberTree.hxx sw/inc/ndnotxt.hxx sw/source/core/access/acccell.cxx sw/source/core/access/acccell.hxx sw/source/core/access/accframebase.cxx sw/source/core/access/accframebase.hxx sw/source/core/access/accmap.cxx sw/source/core/access/accpage.cxx sw/source/core/access/accpage.hxx sw/source/core/access/accpara.cxx sw/source/core/access/accpara.hxx sw/source/core/bastyp/swrect.cxx sw/source/core/crsr/findtxt.cxx sw/source/core/doc/docdde.cxx sw/source/core/doc/notxtfrm.cxx sw/source/core/docnode/section.cxx sw/source/core/draw/dcontact.cxx sw/source/core/edit/edlingu.cxx sw/source/core/inc/anchoredobjectposition.hxx sw/source/core/layout/paintfrm.cxx sw/source/core/layout/tabfrm.cxx sw/source/core/layout/trvlfrm.cxx sw/source/core/ole/ndole.cxx sw/source/core/text/atrstck.cxx sw/source/core/text/inftxt.cxx sw/source/core/text/itratr.cxx sw/source/core/text/itrform2.cxx sw/source/core/text/itrform2.hxx sw/source/core/text/porfld.cxx sw/source/core/text/txtfly.cxx sw/source/core/txtnode/thints.cxx sw/source/core/txtnode/txtedt.cxx sw/source/core/uibase/dochdl/swdtflvr.cxx sw/source/core/uibase/docvw/PostItMgr.cxx sw/source/core/uibase/docvw/SidebarWin.cxx sw/source/core/uibase/docvw/edtwin.cxx sw/source/core/uibase/envelp/labimg.cxx sw/source/core/uibase/uiview/pview.cxx sw/source/core/uibase/uno/unomailmerge.cxx sw/source/core/undo/unattr.cxx sw/source/core/undo/untbl.cxx sw/source/core/unocore/unochart.cxx sw/source/core/view/vdraw.cxx sw/source/core/view/vnew.cxx sw/source/filter/basflt/fltini.cxx sw/source/filter/html/wrthtml.cxx sw/source/filter/inc/wwstyles.hxx sw/source/filter/rtf/rtffly.cxx sw/source/filter/rtf/swparrtf.cxx sw/source/filter/ww8/docxattributeoutput.cxx sw/source/filter/ww8/dump/msvbasic.cxx sw/source/filter/ww8/dump/ww8scan.cxx sw/source/filter/ww8/dump/ww8scan.hxx sw/source/filter/ww8/dump/ww8struc.hxx sw/source/filter/ww8/wrtww8.cxx sw/source/filter/ww8/ww8graf.cxx sw/source/filter/ww8/ww8par.cxx sw/source/filter/ww8/ww8par2.cxx sw/source/filter/ww8/ww8par2.hxx sw/source/filter/ww8/ww8par3.cxx sw/source/filter/ww8/ww8par6.cxx sw/source/filter/ww8/ww8scan.cxx sw/source/filter/ww8/ww8scan.hxx sw/source/ui/dbui/dbinsdlg.cxx sw/source/ui/inc/tablemgr.hxx sw/source/ui/inc/uitool.hxx sw/source/ui/lingu/olmenu.cxx sw/source/ui/uiview/viewport.cxx sysui/desktop/productversion.mk sysui/desktop/slackware/makefile.mk testgraphical/source/CallExternals.pm testgraphical/source/fill_documents_loop.pl testgraphical/ui/java/ConvwatchGUIProject/src/IniFile.java toolkit/doc/layout/notes.txt toolkit/doc/layout/oldnotes.txt toolkit/source/awt/vclxtabcontrol.cxx toolkit/src2xml/source/srcparser.py toolkit/workben/layout/editor.cxx tools/inc/tools/simplerm.hxx tools/inc/tools/solar.h tools/source/communi/geninfo.cxx tools/source/fsys/dirent.cxx tools/source/fsys/filecopy.cxx tools/source/fsys/os2.cxx tools/source/inet/inetmime.cxx tools/source/rc/resmgr.cxx ucb/source/core/ucbcmds.cxx ucb/source/ucp/file/filglob.cxx ucb/source/ucp/odma/odma_content.cxx ucb/source/ucp/tdoc/ucptdoc.xml ucb/source/ucp/webdav/makefile.mk ucbhelper/inc/ucbhelper/simplecertificatevalidationrequest.hxx ucbhelper/source/client/content.cxx ucbhelper/source/client/interceptedinteraction.cxx udkapi/com/sun/star/beans/XPropertiesChangeListener.idl udkapi/com/sun/star/io/ObjectOutputStream.idl udkapi/com/sun/star/io/XMarkableStream.idl udkapi/com/sun/star/io/XTextOutputStream.idl udkapi/com/sun/star/reflection/CoreReflection.idl udkapi/com/sun/star/reflection/XTypeDescriptionEnumerationAccess.idl udkapi/com/sun/star/test/XSimpleTest.idl unodevtools/source/skeletonmaker/skeletoncommon.cxx unodevtools/source/skeletonmaker/skeletoncommon.hxx unotools/inc/unotools/cacheoptions.hxx unotools/inc/unotools/cmdoptions.hxx unotools/inc/unotools/dynamicmenuoptions.hxx unotools/inc/unotools/extendedsecurityoptions.hxx unotools/inc/unotools/fontoptions.hxx unotools/inc/unotools/historyoptions.hxx unotools/inc/unotools/idhelper.hxx unotools/inc/unotools/internaloptions.hxx unotools/inc/unotools/localisationoptions.hxx unotools/inc/unotools/moduleoptions.hxx unotools/inc/unotools/printwarningoptions.hxx unotools/inc/unotools/securityoptions.hxx unotools/inc/unotools/startoptions.hxx unotools/inc/unotools/workingsetoptions.hxx unotools/source/config/cmdoptions.cxx unotools/source/config/compatibility.cxx unotools/source/config/configitem.cxx unotools/source/config/configmgr.cxx unotools/source/config/dynamicmenuoptions.cxx unotools/source/config/fontcfg.cxx unotools/source/config/itemholder1.hxx unotools/source/config/moduleoptions.cxx unotools/source/config/pathoptions.cxx unotools/source/config/viewoptions.cxx unotools/source/misc/sharedunocomponent.cxx uui/source/fltdlg.cxx uui/source/iahndl-filter.cxx vbahelper/inc/vbahelper/collectionbase.hxx vbahelper/source/msforms/vbacontrol.cxx vbahelper/source/vbahelper/collectionbase.cxx vcl/aqua/source/gdi/atsfonts.cxx vcl/inc/aqua/salmathutils.hxx vcl/inc/graphite_cache.hxx vcl/inc/jobset.h vcl/inc/os2/salgdi.h vcl/inc/osx/saldata.hxx vcl/inc/salgdi.hxx vcl/inc/salwtype.hxx vcl/inc/unx/wmadaptor.hxx vcl/inc/vcl/print.hxx vcl/inc/vcl/strhelper.hxx vcl/os2/source/app/salinst.cxx vcl/os2/source/app/saltimer.cxx vcl/os2/source/gdi/salgdi2.cxx vcl/osx/salframeview.mm vcl/osx/salprn.cxx vcl/qa/cppunit/dndtest.cxx vcl/source/app/dbggui.cxx vcl/source/control/ilstbox.cxx vcl/source/gdi/cvtsvm.cxx vcl/source/gdi/gdimtf.cxx vcl/source/gdi/outdev4.cxx vcl/source/gdi/outdev6.cxx vcl/source/gdi/pdfwriter_impl.cxx vcl/source/gdi/pdfwriter_impl2.cxx vcl/source/gdi/print.cxx vcl/source/gdi/print2.cxx vcl/source/glyphs/gcach_layout.cxx vcl/source/glyphs/glyphcache.cxx vcl/source/glyphs/graphite_layout.cxx vcl/source/window/printdlg.cxx vcl/source/window/tabdlg.cxx vcl/source/window/window.cxx vcl/source/window/winproc.cxx vcl/unx/generic/app/saldisp.cxx vcl/unx/generic/dtrans/X11_selection.hxx vcl/unx/gtk/app/gtkdata.cxx vcl/win/source/gdi/salgdi2.cxx vcl/win/source/gdi/salgdi3.cxx vcl/win/source/window/salframe.cxx vos/inc/vos/pipe.hxx vos/inc/vos/process.hxx vos/inc/vos/signal.hxx vos/inc/vos/socket.hxx vos/inc/vos/thread.hxx vos/source/pipe.cxx vos/source/socket.cxx wizards/com/sun/star/wizards/agenda/AgendaTemplate.java wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.java wizards/com/sun/star/wizards/agenda/TopicsControl.java wizards/com/sun/star/wizards/web/FTPDialog.java wizards/com/sun/star/wizards/web/ImageListDialog.java wizards/com/sun/star/wizards/web/Process.java wizards/com/sun/star/wizards/web/ProcessStatusRenderer.java wizards/com/sun/star/wizards/web/TOCPreview.java wizards/com/sun/star/wizards/web/WWD_Startup.java wizards/com/sun/star/wizards/web/data/TypeDetection.java wizards/com/sun/star/wizards/web/export/ImpressHTMLExporter.java writerfilter/inc/doctok/WW8Document.hxx writerfilter/source/dmapper/DomainMapper.cxx writerfilter/source/dmapper/NumberingManager.cxx writerfilter/source/dmapper/PropertyMap.cxx writerfilter/source/dmapper/StyleSheetTable.cxx writerfilter/source/doctok/WW8StructBase.hxx writerfilter/source/doctok/resources.xmi writerfilter/source/ooxml/README.efforts xmerge/source/activesync/XMergeFilter.cpp xmerge/source/minicalc/java/org/openoffice/xmerge/converter/xml/sxc/minicalc/SxcDocumentDeserializerImpl.java xmerge/source/palmtests/qa/comparator/pdbcomparison.java xmerge/source/palmtests/qa/test_spec/convertor_test_spec.html xmerge/source/pexcel/java/org/openoffice/xmerge/converter/xml/sxc/pexcel/records/DefinedName.java xmerge/source/pexcel/java/org/openoffice/xmerge/converter/xml/sxc/pexcel/records/Workbook.java xmerge/source/pexcel/java/org/openoffice/xmerge/converter/xml/sxc/pexcel/records/Worksheet.java xmerge/source/pexcel/java/org/openoffice/xmerge/converter/xml/sxc/pexcel/records/formula/SymbolLookup.java xmerge/source/pocketword/java/org/openoffice/xmerge/converter/xml/sxw/pocketword/DocumentDescriptor.java xmerge/workben/jstyle.pl xmlhelp/source/cxxhelp/provider/databases.hxx xmlhelp/source/cxxhelp/provider/provider.cxx xmlhelp/source/treeview/tvread.cxx xmloff/inc/txtfldi.hxx xmloff/inc/xmloff/xmlmultiimagehelper.hxx xmloff/inc/xmloff/xmluconv.hxx xmloff/source/core/xmlexp.cxx xmloff/source/draw/shapeexport2.cxx xmloff/source/draw/shapeexport3.cxx xmloff/source/meta/xmlversion.cxx xmloff/source/style/impastp4.cxx xmloff/source/style/xmlaustp.cxx xmloff/source/text/XMLSectionExport.cxx xmloff/source/text/txtflde.cxx xmloff/source/text/txtimp.cxx xmloff/source/text/txtparae.cxx xmloff/source/text/txtparai.cxx xmloff/source/text/txtvfldi.cxx xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx Change-Id: Ie072e7c3a60c5dae16a67ac36d1f372c5065c99c
2014-04-29 19:25:03 +00:00
// pane is activated additionally to the already existing
// panes and does not replace them.
xCC->requestResourceActivation(
xMainPaneId,
ResourceActivationMode_ADD);
SetupConfiguration(xContext, xMainPaneId);
mpPresenterController = new PresenterController(
css::uno::WeakReference<css::lang::XEventListener>(this),
xContext,
mxController,
xSlideShowController,
mpPaneContainer,
xMainPaneId);
// Create pane and view factories and integrate them into the
// drawing framework.
SetupPaneFactory(xContext);
SetupViewFactory(xContext);
mpPresenterController->GetWindowManager()->RestoreViewMode();
}
catch (const RuntimeException&)
{
xCC->restoreConfiguration(mxSavedConfiguration);
}
xCC->unlock();
}
}
catch (const Exception&)
{
}
}
void PresenterScreen::SwitchMonitors()
{
try {
Reference<XPresentationSupplier> xPS ( mxModel, UNO_QUERY_THROW);
Reference<XPresentation2> xPresentation(xPS->getPresentation(), UNO_QUERY_THROW);
// Get the existing presenter console screen, we want to switch the
// presentation to use that instead.
sal_Int32 nNewScreen = GetPresenterScreenNumber (xPresentation);
if (nNewScreen < 0)
return;
// Adapt that display number to be the 'default' setting of 0 if it matches
sal_Int32 nExternalDisplay = Application::GetDisplayExternalScreen();
if (nNewScreen == nExternalDisplay)
nNewScreen = 0; // screen zero is best == the primary display
else
nNewScreen++; // otherwise we store screens offset by one.
// Set the new presentation display
Reference<beans::XPropertySet> xProperties (xPresentation, UNO_QUERY_THROW);
uno::Any aDisplay;
aDisplay <<= nNewScreen;
xProperties->setPropertyValue("Display", aDisplay);
2011-12-26 03:38:13 +09:00
} catch (const uno::Exception &) {
}
}
/**
* Return the real VCL screen number to show the presenter console
* on or -1 to not show anything.
*/
sal_Int32 PresenterScreen::GetPresenterScreenNumber (
const Reference<presentation::XPresentation2>& rxPresentation) const
{
sal_Int32 nScreenNumber (0);
sal_Int32 nScreenCount (1);
try
{
Reference<beans::XPropertySet> xProperties (rxPresentation, UNO_QUERY);
if ( ! xProperties.is())
return -1;
// Determine the screen on which the full screen presentation is being
// displayed.
sal_Int32 nDisplayNumber (-1);
if ( ! (xProperties->getPropertyValue("Display") >>= nDisplayNumber))
return -1;
if (nDisplayNumber == -1)
{
// The special value -1 indicates that the slide show
// spans all available displays. That leaves no room for
// the presenter screen.
return -1;
}
SAL_INFO("sdext.presenter", "Display number is " << nDisplayNumber);
if (nDisplayNumber > 0)
{
nScreenNumber = nDisplayNumber - 1;
}
else if (nDisplayNumber == 0)
{
// A display number value of 0 indicates the primary screen.
// Find out which screen number that is.
if (nDisplayNumber <= 0)
nScreenNumber = Application::GetDisplayExternalScreen();
}
// We still have to determine the number of screens to decide
// whether the presenter screen may be shown at all.
nScreenCount = Application::GetScreenCount();
if (nScreenCount < 2 || nDisplayNumber > nScreenCount)
{
// There is either only one screen or the full screen
// presentation spans all available screens. The presenter
// screen is shown only when a special flag in the configuration
// is set.
Reference<XComponentContext> xContext (mxContextWeak);
PresenterConfigurationAccess aConfiguration (
xContext,
Turn presenter screen from bundled extension to plain code The immediate trigger was 5e5c11c664f67ff9fd1120905b09a32bea3b2f6c "fdo#42070 Fix RTL support in presenter console" causing build failures on Mac OS X when linking the extension against vcl, but there should be more benefits of going from a bundled-anyway extension to plain code. (Not the least to get rid of the com.sun.star.drawing.XPresenterHelper hack.) To avoid unnecessary confusion between the newly plain code and any instance of the old extension still installed (per-user or shared), I renamed all relevant identifiers as follows: * UNO implementation com.sun.star.comp.Draw.framework.PresenterScreenJob -> org.libreoffice.comp.PresenterScreenJob * UNO implementation com.sun.star.sdext.presenter.PresenterProtocolHandler -> org.libreoffice.comp.PresenterScreenProtocolHandler * protocol handler schema vnd.com.sun.star.comp.PresenterScreen -> vnd.org.libreoffice.presenterscreen * configuration schema /org.openoffice.Office.extension.PresenterScreen -> /org.openoffice.Office.PresenterScreen (it appears this contains little to no user-changeable data anyway, so not migrating it to a new user profile due to the schema name change should not be problematic) * job ID onDocumentOpenedJob -> org.libreoffice.PresenterScreen Even with these precautions, having the presenter screen installed both as plain code and as a (per-user or shared) extension still leads to a crash when activating presentation mode (likely due to how both codes want to take control of the screen). To mitigate this, existing installations of the extension are explicitly not migrated to new user profiles. The sdext/source/presenter/bitmaps/*.png files were moved to icon-themes/galaxy/sd/res/presenterscreen-*.png and are now accessed via SdResId (adding the relevant data to sd/source/ui/inc/res_bmp.hrc and sd/source/ui/app/res_bmp.src; not sure whether these locations are already ideal). The code itself has been left mostly unchanged in sdext/source/presenter/, and it still clumsily communicates with sd core code via XPresenterHelper. There is a lot of room for improvement here. The help data is left untouched at sdext/source/presenter/help/ and needs to be incorporated properly into helpcontent2 in a follow-up commit. The --disable-ext-presenter-console configure switch is gone. Change-Id: I71adb7ae6dcdbd1802151fce6e3871d8a2026332
2012-11-21 17:19:28 +01:00
OUString("/org.openoffice.Office.PresenterScreen/"),
PresenterConfigurationAccess::READ_ONLY);
bool bStartAlways (false);
if (aConfiguration.GetConfigurationNode(
OUString("Presenter/StartAlways")) >>= bStartAlways)
{
if (bStartAlways)
return GetPresenterScreenFromScreen(nScreenNumber);
}
return -1;
}
}
catch (const beans::UnknownPropertyException&)
{
OSL_ASSERT(false);
// For some reason we can not access the screen number. Use
// the default instead.
}
SAL_INFO("sdext.presenter", "Get presenter screen for screen " << nScreenNumber);
return GetPresenterScreenFromScreen(nScreenNumber);
}
sal_Int32 PresenterScreen::GetPresenterScreenFromScreen( sal_Int32 nPresentationScreen )
{
// Setup the resource id of the full screen background pane so that
// it is displayed on another screen than the presentation.
sal_Int32 nPresenterScreenNumber (1);
switch (nPresentationScreen)
{
case 0:
nPresenterScreenNumber = 1;
break;
case 1:
nPresenterScreenNumber = 0;
break;
default:
SAL_INFO("sdext.presenter", "Warning unexpected, out of bound screen "
"mapped to 0" << nPresentationScreen);
// When the full screen presentation is displayed on a screen
// other than 0 or 1 then place the presenter on the first
// available screen.
nPresenterScreenNumber = 0;
break;
}
return nPresenterScreenNumber;
}
Reference<drawing::framework::XResourceId> PresenterScreen::GetMainPaneId (
const Reference<presentation::XPresentation2>& rxPresentation) const
{
// A negative value means that the presentation spans all available
// displays. That leaves no room for the presenter.
const sal_Int32 nScreen(GetPresenterScreenNumber(rxPresentation));
if (nScreen < 0)
return NULL;
return ResourceId::create(
Reference<XComponentContext>(mxContextWeak),
PresenterHelper::msFullScreenPaneURL
+ "?FullScreen=true&ScreenNumber="
+ OUString::number(nScreen));
}
void PresenterScreen::RequestShutdownPresenterScreen()
{
// Restore the configuration that was active before the presenter screen
// has been activated. Now, that the presenter screen is displayed in
// its own top level window this probably not necessary, but one never knows.
Reference<XConfigurationController> xCC (mxConfigurationControllerWeak);
if (xCC.is() && mxSavedConfiguration.is())
{
xCC->restoreConfiguration(mxSavedConfiguration);
mxSavedConfiguration = NULL;
}
if (xCC.is())
{
// The actual restoration of the configuration takes place
// asynchronously. The view and pane factories can only by disposed
// after that. Therefore, set up a listener and wait for the
// restoration.
rtl::Reference<PresenterScreen> pSelf (this);
PresenterFrameworkObserver::RunOnUpdateEnd(
xCC,
::boost::bind(&PresenterScreen::ShutdownPresenterScreen, pSelf));
xCC->update();
}
}
void PresenterScreen::ShutdownPresenterScreen()
{
Reference<lang::XComponent> xViewFactoryComponent (mxViewFactory, UNO_QUERY);
if (xViewFactoryComponent.is())
xViewFactoryComponent->dispose();
mxViewFactory = NULL;
Reference<lang::XComponent> xPaneFactoryComponent (mxPaneFactory, UNO_QUERY);
if (xPaneFactoryComponent.is())
xPaneFactoryComponent->dispose();
mxPaneFactory = NULL;
if (mpPresenterController.get() != NULL)
{
mpPresenterController->dispose();
mpPresenterController = rtl::Reference<PresenterController>();
}
mpPaneContainer = new PresenterPaneContainer(Reference<XComponentContext>(mxContextWeak));
}
void PresenterScreen::SetupPaneFactory (const Reference<XComponentContext>& rxContext)
{
try
{
if ( ! mxPaneFactory.is())
mxPaneFactory = PresenterPaneFactory::Create(
rxContext,
mxController,
mpPresenterController);
}
catch (const RuntimeException&)
{
OSL_ASSERT(false);
}
}
void PresenterScreen::SetupViewFactory (const Reference<XComponentContext>& rxContext)
{
try
{
if ( ! mxViewFactory.is())
mxViewFactory = PresenterViewFactory::Create(
rxContext,
mxController,
mpPresenterController);
}
catch (const RuntimeException&)
{
OSL_ASSERT(false);
}
}
void PresenterScreen::SetupConfiguration (
const Reference<XComponentContext>& rxContext,
const Reference<XResourceId>& rxAnchorId)
{
try
{
PresenterConfigurationAccess aConfiguration (
rxContext,
Turn presenter screen from bundled extension to plain code The immediate trigger was 5e5c11c664f67ff9fd1120905b09a32bea3b2f6c "fdo#42070 Fix RTL support in presenter console" causing build failures on Mac OS X when linking the extension against vcl, but there should be more benefits of going from a bundled-anyway extension to plain code. (Not the least to get rid of the com.sun.star.drawing.XPresenterHelper hack.) To avoid unnecessary confusion between the newly plain code and any instance of the old extension still installed (per-user or shared), I renamed all relevant identifiers as follows: * UNO implementation com.sun.star.comp.Draw.framework.PresenterScreenJob -> org.libreoffice.comp.PresenterScreenJob * UNO implementation com.sun.star.sdext.presenter.PresenterProtocolHandler -> org.libreoffice.comp.PresenterScreenProtocolHandler * protocol handler schema vnd.com.sun.star.comp.PresenterScreen -> vnd.org.libreoffice.presenterscreen * configuration schema /org.openoffice.Office.extension.PresenterScreen -> /org.openoffice.Office.PresenterScreen (it appears this contains little to no user-changeable data anyway, so not migrating it to a new user profile due to the schema name change should not be problematic) * job ID onDocumentOpenedJob -> org.libreoffice.PresenterScreen Even with these precautions, having the presenter screen installed both as plain code and as a (per-user or shared) extension still leads to a crash when activating presentation mode (likely due to how both codes want to take control of the screen). To mitigate this, existing installations of the extension are explicitly not migrated to new user profiles. The sdext/source/presenter/bitmaps/*.png files were moved to icon-themes/galaxy/sd/res/presenterscreen-*.png and are now accessed via SdResId (adding the relevant data to sd/source/ui/inc/res_bmp.hrc and sd/source/ui/app/res_bmp.src; not sure whether these locations are already ideal). The code itself has been left mostly unchanged in sdext/source/presenter/, and it still clumsily communicates with sd core code via XPresenterHelper. There is a lot of room for improvement here. The help data is left untouched at sdext/source/presenter/help/ and needs to be incorporated properly into helpcontent2 in a follow-up commit. The --disable-ext-presenter-console configure switch is gone. Change-Id: I71adb7ae6dcdbd1802151fce6e3871d8a2026332
2012-11-21 17:19:28 +01:00
OUString("org.openoffice.Office.PresenterScreen"),
PresenterConfigurationAccess::READ_ONLY);
maViewDescriptors.clear();
ProcessViewDescriptions(aConfiguration);
OUString sLayoutName ("DefaultLayout");
aConfiguration.GetConfigurationNode(
OUString("Presenter/CurrentLayout")) >>= sLayoutName;
ProcessLayout(aConfiguration, sLayoutName, rxContext, rxAnchorId);
}
catch (const RuntimeException&)
{
}
}
void PresenterScreen::ProcessLayout (
PresenterConfigurationAccess& rConfiguration,
const OUString& rsLayoutName,
const Reference<XComponentContext>& rxContext,
const Reference<XResourceId>& rxAnchorId)
{
try
{
Reference<container::XHierarchicalNameAccess> xLayoutNode (
rConfiguration.GetConfigurationNode(
"Presenter/Layouts/"+rsLayoutName),
UNO_QUERY_THROW);
// Read the parent layout first, if one is referenced.
OUString sParentLayout;
PresenterConfigurationAccess::GetConfigurationNode(
xLayoutNode,
OUString("ParentLayout")) >>= sParentLayout;
if (!sParentLayout.isEmpty())
{
// Prevent infinite recursion.
if (rsLayoutName != sParentLayout)
ProcessLayout(rConfiguration, sParentLayout, rxContext, rxAnchorId);
}
// Process the actual layout list.
Reference<container::XNameAccess> xList (
PresenterConfigurationAccess::GetConfigurationNode(
xLayoutNode,
OUString("Layout")),
UNO_QUERY_THROW);
::std::vector<OUString> aProperties (6);
aProperties[0] = "PaneURL";
aProperties[1] = "ViewURL";
aProperties[2] = "RelativeX";
aProperties[3] = "RelativeY";
aProperties[4] = "RelativeWidth";
aProperties[5] = "RelativeHeight";
mnComponentIndex = 1;
PresenterConfigurationAccess::ForAll(
xList,
aProperties,
::boost::bind(&PresenterScreen::ProcessComponent, this,
_1,
_2,
rxContext,
rxAnchorId));
}
catch (const RuntimeException&)
{
}
}
void PresenterScreen::ProcessViewDescriptions (
PresenterConfigurationAccess& rConfiguration)
{
try
{
Reference<container::XNameAccess> xViewDescriptionsNode (
rConfiguration.GetConfigurationNode("Presenter/Views"),
UNO_QUERY_THROW);
::std::vector<OUString> aProperties (4);
aProperties[0] = "ViewURL";
aProperties[1] = "Title";
aProperties[2] = "AccessibleTitle";
aProperties[3] = "IsOpaque";
mnComponentIndex = 1;
PresenterConfigurationAccess::ForAll(
xViewDescriptionsNode,
aProperties,
::boost::bind(&PresenterScreen::ProcessViewDescription, this, _1, _2));
}
catch (const RuntimeException&)
{
OSL_ASSERT(false);
}
}
void PresenterScreen::ProcessComponent (
const OUString& rsKey,
const ::std::vector<Any>& rValues,
const Reference<XComponentContext>& rxContext,
const Reference<XResourceId>& rxAnchorId)
{
(void)rsKey;
if (rValues.size() != 6)
return;
try
{
OUString sPaneURL;
OUString sViewURL;
double nX = 0;
double nY = 0;
double nWidth = 0;
double nHeight = 0;
rValues[0] >>= sPaneURL;
rValues[1] >>= sViewURL;
rValues[2] >>= nX;
rValues[3] >>= nY;
rValues[4] >>= nWidth;
rValues[5] >>= nHeight;
if (nX>=0 && nY>=0 && nWidth>0 && nHeight>0)
{
SetupView(
rxContext,
rxAnchorId,
sPaneURL,
sViewURL,
PresenterPaneContainer::ViewInitializationFunction(),
nX,
nY,
nX+nWidth,
nY+nHeight);
}
}
2011-12-26 03:38:13 +09:00
catch (const Exception&)
{
OSL_ASSERT(false);
}
}
void PresenterScreen::ProcessViewDescription (
const OUString& rsKey,
const ::std::vector<Any>& rValues)
{
(void)rsKey;
if (rValues.size() != 4)
return;
try
{
ViewDescriptor aViewDescriptor;
OUString sViewURL;
rValues[0] >>= sViewURL;
rValues[1] >>= aViewDescriptor.msTitle;
rValues[2] >>= aViewDescriptor.msAccessibleTitle;
rValues[3] >>= aViewDescriptor.mbIsOpaque;
if (aViewDescriptor.msAccessibleTitle.isEmpty())
aViewDescriptor.msAccessibleTitle = aViewDescriptor.msTitle;
maViewDescriptors[sViewURL] = aViewDescriptor;
}
catch (const Exception&)
{
OSL_ASSERT(false);
}
}
void PresenterScreen::SetupView(
const Reference<XComponentContext>& rxContext,
const Reference<XResourceId>& rxAnchorId,
const OUString& rsPaneURL,
const OUString& rsViewURL,
const PresenterPaneContainer::ViewInitializationFunction& rViewInitialization,
const double nLeft,
const double nTop,
const double nRight,
const double nBottom)
{
Reference<XConfigurationController> xCC (mxConfigurationControllerWeak);
if (xCC.is())
{
Reference<XResourceId> xPaneId (ResourceId::createWithAnchor(rxContext,rsPaneURL,rxAnchorId));
// Look up the view descriptor.
ViewDescriptor aViewDescriptor;
ViewDescriptorContainer::const_iterator iDescriptor (maViewDescriptors.find(rsViewURL));
if (iDescriptor != maViewDescriptors.end())
aViewDescriptor = iDescriptor->second;
// Prepare the pane.
OSL_ASSERT(mpPaneContainer.get() != NULL);
mpPaneContainer->PreparePane(
xPaneId,
rsViewURL,
aViewDescriptor.msTitle,
aViewDescriptor.msAccessibleTitle,
aViewDescriptor.mbIsOpaque,
rViewInitialization,
nLeft,
nTop,
nRight,
nBottom);
}
}
} } // end of namespace ::sdext::presenter
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */