xref: /AOO41X/main/sdext/source/presenter/PresenterPaneFactory.cxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_sdext.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include "PresenterPaneFactory.hxx"
32*cdf0e10cSrcweir #include "PresenterController.hxx"
33*cdf0e10cSrcweir #include "PresenterPane.hxx"
34*cdf0e10cSrcweir #include "PresenterPaneBorderPainter.hxx"
35*cdf0e10cSrcweir #include "PresenterPaneContainer.hxx"
36*cdf0e10cSrcweir #include "PresenterSpritePane.hxx"
37*cdf0e10cSrcweir #include <com/sun/star/container/XChild.hpp>
38*cdf0e10cSrcweir #include <com/sun/star/drawing/framework/ResourceId.hpp>
39*cdf0e10cSrcweir #include <com/sun/star/drawing/framework/XControllerManager.hpp>
40*cdf0e10cSrcweir #include <com/sun/star/drawing/framework/XConfigurationController.hpp>
41*cdf0e10cSrcweir #include <com/sun/star/frame/XController.hpp>
42*cdf0e10cSrcweir #include <com/sun/star/lang/XComponent.hpp>
43*cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp>
44*cdf0e10cSrcweir #include <boost/bind.hpp>
45*cdf0e10cSrcweir 
46*cdf0e10cSrcweir using namespace ::com::sun::star;
47*cdf0e10cSrcweir using namespace ::com::sun::star::uno;
48*cdf0e10cSrcweir using namespace ::com::sun::star::lang;
49*cdf0e10cSrcweir using namespace ::com::sun::star::drawing::framework;
50*cdf0e10cSrcweir using ::rtl::OUString;
51*cdf0e10cSrcweir 
52*cdf0e10cSrcweir namespace sdext { namespace presenter {
53*cdf0e10cSrcweir 
54*cdf0e10cSrcweir const ::rtl::OUString PresenterPaneFactory::msCurrentSlidePreviewPaneURL(
55*cdf0e10cSrcweir     OUString::createFromAscii("private:resource/pane/Presenter/Pane1"));
56*cdf0e10cSrcweir const ::rtl::OUString PresenterPaneFactory::msNextSlidePreviewPaneURL(
57*cdf0e10cSrcweir     OUString::createFromAscii("private:resource/pane/Presenter/Pane2"));
58*cdf0e10cSrcweir const ::rtl::OUString PresenterPaneFactory::msNotesPaneURL(
59*cdf0e10cSrcweir     OUString::createFromAscii("private:resource/pane/Presenter/Pane3"));
60*cdf0e10cSrcweir const ::rtl::OUString PresenterPaneFactory::msToolBarPaneURL(
61*cdf0e10cSrcweir     OUString::createFromAscii("private:resource/pane/Presenter/Pane4"));
62*cdf0e10cSrcweir const ::rtl::OUString PresenterPaneFactory::msSlideSorterPaneURL(
63*cdf0e10cSrcweir     OUString::createFromAscii("private:resource/pane/Presenter/Pane5"));
64*cdf0e10cSrcweir const ::rtl::OUString PresenterPaneFactory::msHelpPaneURL(
65*cdf0e10cSrcweir     OUString::createFromAscii("private:resource/pane/Presenter/Pane6"));
66*cdf0e10cSrcweir 
67*cdf0e10cSrcweir const ::rtl::OUString PresenterPaneFactory::msOverlayPaneURL(
68*cdf0e10cSrcweir     OUString::createFromAscii("private:resource/pane/Presenter/Overlay"));
69*cdf0e10cSrcweir 
70*cdf0e10cSrcweir 
71*cdf0e10cSrcweir 
72*cdf0e10cSrcweir //===== PresenterPaneFactory ==================================================
73*cdf0e10cSrcweir 
74*cdf0e10cSrcweir Reference<drawing::framework::XResourceFactory> PresenterPaneFactory::Create (
75*cdf0e10cSrcweir     const Reference<uno::XComponentContext>& rxContext,
76*cdf0e10cSrcweir     const Reference<frame::XController>& rxController,
77*cdf0e10cSrcweir     const ::rtl::Reference<PresenterController>& rpPresenterController)
78*cdf0e10cSrcweir {
79*cdf0e10cSrcweir     rtl::Reference<PresenterPaneFactory> pFactory (
80*cdf0e10cSrcweir         new PresenterPaneFactory(rxContext,rpPresenterController));
81*cdf0e10cSrcweir     pFactory->Register(rxController);
82*cdf0e10cSrcweir     return Reference<drawing::framework::XResourceFactory>(
83*cdf0e10cSrcweir         static_cast<XWeak*>(pFactory.get()), UNO_QUERY);
84*cdf0e10cSrcweir }
85*cdf0e10cSrcweir 
86*cdf0e10cSrcweir 
87*cdf0e10cSrcweir 
88*cdf0e10cSrcweir 
89*cdf0e10cSrcweir PresenterPaneFactory::PresenterPaneFactory (
90*cdf0e10cSrcweir     const Reference<uno::XComponentContext>& rxContext,
91*cdf0e10cSrcweir     const ::rtl::Reference<PresenterController>& rpPresenterController)
92*cdf0e10cSrcweir     : PresenterPaneFactoryInterfaceBase(m_aMutex),
93*cdf0e10cSrcweir       mxComponentContextWeak(rxContext),
94*cdf0e10cSrcweir       mxConfigurationControllerWeak(),
95*cdf0e10cSrcweir       mpPresenterController(rpPresenterController),
96*cdf0e10cSrcweir       mpResourceCache()
97*cdf0e10cSrcweir {
98*cdf0e10cSrcweir }
99*cdf0e10cSrcweir 
100*cdf0e10cSrcweir 
101*cdf0e10cSrcweir 
102*cdf0e10cSrcweir 
103*cdf0e10cSrcweir void PresenterPaneFactory::Register (const Reference<frame::XController>& rxController)
104*cdf0e10cSrcweir {
105*cdf0e10cSrcweir     Reference<XConfigurationController> xCC;
106*cdf0e10cSrcweir     try
107*cdf0e10cSrcweir     {
108*cdf0e10cSrcweir         // Get the configuration controller.
109*cdf0e10cSrcweir         Reference<XControllerManager> xCM (rxController, UNO_QUERY_THROW);
110*cdf0e10cSrcweir         xCC = Reference<XConfigurationController>(xCM->getConfigurationController());
111*cdf0e10cSrcweir         mxConfigurationControllerWeak = xCC;
112*cdf0e10cSrcweir         if ( ! xCC.is())
113*cdf0e10cSrcweir         {
114*cdf0e10cSrcweir             throw RuntimeException();
115*cdf0e10cSrcweir         }
116*cdf0e10cSrcweir         else
117*cdf0e10cSrcweir         {
118*cdf0e10cSrcweir             xCC->addResourceFactory(
119*cdf0e10cSrcweir                 OUString::createFromAscii("private:resource/pane/Presenter/*"),
120*cdf0e10cSrcweir                 this);
121*cdf0e10cSrcweir         }
122*cdf0e10cSrcweir     }
123*cdf0e10cSrcweir     catch (RuntimeException&)
124*cdf0e10cSrcweir     {
125*cdf0e10cSrcweir         OSL_ASSERT(false);
126*cdf0e10cSrcweir         if (xCC.is())
127*cdf0e10cSrcweir             xCC->removeResourceFactoryForReference(this);
128*cdf0e10cSrcweir         mxConfigurationControllerWeak = WeakReference<XConfigurationController>();
129*cdf0e10cSrcweir 
130*cdf0e10cSrcweir         throw;
131*cdf0e10cSrcweir     }
132*cdf0e10cSrcweir }
133*cdf0e10cSrcweir 
134*cdf0e10cSrcweir 
135*cdf0e10cSrcweir 
136*cdf0e10cSrcweir 
137*cdf0e10cSrcweir PresenterPaneFactory::~PresenterPaneFactory (void)
138*cdf0e10cSrcweir {
139*cdf0e10cSrcweir }
140*cdf0e10cSrcweir 
141*cdf0e10cSrcweir 
142*cdf0e10cSrcweir 
143*cdf0e10cSrcweir 
144*cdf0e10cSrcweir void SAL_CALL PresenterPaneFactory::disposing (void)
145*cdf0e10cSrcweir     throw (RuntimeException)
146*cdf0e10cSrcweir {
147*cdf0e10cSrcweir     Reference<XConfigurationController> xCC (mxConfigurationControllerWeak);
148*cdf0e10cSrcweir     if (xCC.is())
149*cdf0e10cSrcweir         xCC->removeResourceFactoryForReference(this);
150*cdf0e10cSrcweir     mxConfigurationControllerWeak = WeakReference<XConfigurationController>();
151*cdf0e10cSrcweir 
152*cdf0e10cSrcweir     // Dispose the panes in the cache.
153*cdf0e10cSrcweir     if (mpResourceCache.get() != NULL)
154*cdf0e10cSrcweir     {
155*cdf0e10cSrcweir         ResourceContainer::const_iterator iPane (mpResourceCache->begin());
156*cdf0e10cSrcweir         ResourceContainer::const_iterator iEnd (mpResourceCache->end());
157*cdf0e10cSrcweir         for ( ; iPane!=iEnd; ++iPane)
158*cdf0e10cSrcweir         {
159*cdf0e10cSrcweir             Reference<lang::XComponent> xPaneComponent (iPane->second, UNO_QUERY);
160*cdf0e10cSrcweir             if (xPaneComponent.is())
161*cdf0e10cSrcweir                 xPaneComponent->dispose();
162*cdf0e10cSrcweir         }
163*cdf0e10cSrcweir         mpResourceCache.reset();
164*cdf0e10cSrcweir     }
165*cdf0e10cSrcweir }
166*cdf0e10cSrcweir 
167*cdf0e10cSrcweir 
168*cdf0e10cSrcweir 
169*cdf0e10cSrcweir 
170*cdf0e10cSrcweir //----- XPaneFactory ----------------------------------------------------------
171*cdf0e10cSrcweir 
172*cdf0e10cSrcweir Reference<XResource> SAL_CALL PresenterPaneFactory::createResource (
173*cdf0e10cSrcweir     const Reference<XResourceId>& rxPaneId)
174*cdf0e10cSrcweir     throw (RuntimeException, IllegalArgumentException, WrappedTargetException)
175*cdf0e10cSrcweir {
176*cdf0e10cSrcweir     ThrowIfDisposed();
177*cdf0e10cSrcweir 
178*cdf0e10cSrcweir     if ( ! rxPaneId.is())
179*cdf0e10cSrcweir         return NULL;
180*cdf0e10cSrcweir 
181*cdf0e10cSrcweir     const OUString sPaneURL (rxPaneId->getResourceURL());
182*cdf0e10cSrcweir     if (sPaneURL.getLength() == 0)
183*cdf0e10cSrcweir         return NULL;
184*cdf0e10cSrcweir 
185*cdf0e10cSrcweir     if (mpResourceCache.get() != NULL)
186*cdf0e10cSrcweir     {
187*cdf0e10cSrcweir         // Has the requested resource already been created?
188*cdf0e10cSrcweir         ResourceContainer::const_iterator iResource (mpResourceCache->find(sPaneURL));
189*cdf0e10cSrcweir         if (iResource != mpResourceCache->end())
190*cdf0e10cSrcweir         {
191*cdf0e10cSrcweir             // Yes.  Mark it as active.
192*cdf0e10cSrcweir             rtl::Reference<PresenterPaneContainer> pPaneContainer(
193*cdf0e10cSrcweir                 mpPresenterController->GetPaneContainer());
194*cdf0e10cSrcweir             PresenterPaneContainer::SharedPaneDescriptor pDescriptor (
195*cdf0e10cSrcweir                 pPaneContainer->FindPaneURL(sPaneURL));
196*cdf0e10cSrcweir             if (pDescriptor.get() != NULL)
197*cdf0e10cSrcweir             {
198*cdf0e10cSrcweir                 pDescriptor->SetActivationState(true);
199*cdf0e10cSrcweir                 if (pDescriptor->mxBorderWindow.is())
200*cdf0e10cSrcweir                     pDescriptor->mxBorderWindow->setVisible(sal_True);
201*cdf0e10cSrcweir                 pPaneContainer->StorePane(pDescriptor->mxPane);
202*cdf0e10cSrcweir             }
203*cdf0e10cSrcweir 
204*cdf0e10cSrcweir             return iResource->second;
205*cdf0e10cSrcweir         }
206*cdf0e10cSrcweir     }
207*cdf0e10cSrcweir 
208*cdf0e10cSrcweir     // No.  Create a new one.
209*cdf0e10cSrcweir     Reference<XResource> xResource = CreatePane(rxPaneId, OUString());
210*cdf0e10cSrcweir     return xResource;
211*cdf0e10cSrcweir }
212*cdf0e10cSrcweir 
213*cdf0e10cSrcweir 
214*cdf0e10cSrcweir 
215*cdf0e10cSrcweir 
216*cdf0e10cSrcweir void SAL_CALL PresenterPaneFactory::releaseResource (const Reference<XResource>& rxResource)
217*cdf0e10cSrcweir     throw (RuntimeException)
218*cdf0e10cSrcweir {
219*cdf0e10cSrcweir     ThrowIfDisposed();
220*cdf0e10cSrcweir 
221*cdf0e10cSrcweir     if ( ! rxResource.is())
222*cdf0e10cSrcweir         throw lang::IllegalArgumentException();
223*cdf0e10cSrcweir 
224*cdf0e10cSrcweir     // Mark the pane as inactive.
225*cdf0e10cSrcweir     rtl::Reference<PresenterPaneContainer> pPaneContainer(
226*cdf0e10cSrcweir         mpPresenterController->GetPaneContainer());
227*cdf0e10cSrcweir     const OUString sPaneURL (rxResource->getResourceId()->getResourceURL());
228*cdf0e10cSrcweir     PresenterPaneContainer::SharedPaneDescriptor pDescriptor (
229*cdf0e10cSrcweir         pPaneContainer->FindPaneURL(sPaneURL));
230*cdf0e10cSrcweir     if (pDescriptor.get() != NULL)
231*cdf0e10cSrcweir     {
232*cdf0e10cSrcweir         pDescriptor->SetActivationState(false);
233*cdf0e10cSrcweir         if (pDescriptor->mxBorderWindow.is())
234*cdf0e10cSrcweir             pDescriptor->mxBorderWindow->setVisible(sal_False);
235*cdf0e10cSrcweir 
236*cdf0e10cSrcweir         if (mpResourceCache.get() != NULL)
237*cdf0e10cSrcweir         {
238*cdf0e10cSrcweir             // Store the pane in the cache.
239*cdf0e10cSrcweir             (*mpResourceCache)[sPaneURL] = rxResource;
240*cdf0e10cSrcweir         }
241*cdf0e10cSrcweir         else
242*cdf0e10cSrcweir         {
243*cdf0e10cSrcweir             // Dispose the pane.
244*cdf0e10cSrcweir             Reference<lang::XComponent> xPaneComponent (rxResource, UNO_QUERY);
245*cdf0e10cSrcweir             if (xPaneComponent.is())
246*cdf0e10cSrcweir                 xPaneComponent->dispose();
247*cdf0e10cSrcweir         }
248*cdf0e10cSrcweir     }
249*cdf0e10cSrcweir }
250*cdf0e10cSrcweir 
251*cdf0e10cSrcweir 
252*cdf0e10cSrcweir 
253*cdf0e10cSrcweir 
254*cdf0e10cSrcweir //-----------------------------------------------------------------------------
255*cdf0e10cSrcweir 
256*cdf0e10cSrcweir Reference<XResource> PresenterPaneFactory::CreatePane (
257*cdf0e10cSrcweir     const Reference<XResourceId>& rxPaneId,
258*cdf0e10cSrcweir     const OUString& rsTitle)
259*cdf0e10cSrcweir {
260*cdf0e10cSrcweir     if ( ! rxPaneId.is())
261*cdf0e10cSrcweir         return NULL;
262*cdf0e10cSrcweir 
263*cdf0e10cSrcweir     Reference<XConfigurationController> xCC (mxConfigurationControllerWeak);
264*cdf0e10cSrcweir     if ( ! xCC.is())
265*cdf0e10cSrcweir         return NULL;
266*cdf0e10cSrcweir 
267*cdf0e10cSrcweir     Reference<XComponentContext> xContext (mxComponentContextWeak);
268*cdf0e10cSrcweir     if ( ! xContext.is())
269*cdf0e10cSrcweir         return NULL;
270*cdf0e10cSrcweir 
271*cdf0e10cSrcweir     Reference<XPane> xParentPane (xCC->getResource(rxPaneId->getAnchor()), UNO_QUERY);
272*cdf0e10cSrcweir     if ( ! xParentPane.is())
273*cdf0e10cSrcweir         return NULL;
274*cdf0e10cSrcweir 
275*cdf0e10cSrcweir     try
276*cdf0e10cSrcweir     {
277*cdf0e10cSrcweir         return CreatePane(
278*cdf0e10cSrcweir             rxPaneId,
279*cdf0e10cSrcweir             rsTitle,
280*cdf0e10cSrcweir             xParentPane,
281*cdf0e10cSrcweir             rxPaneId->getFullResourceURL().Arguments.compareToAscii("Sprite=1") == 0);
282*cdf0e10cSrcweir     }
283*cdf0e10cSrcweir     catch (Exception&)
284*cdf0e10cSrcweir     {
285*cdf0e10cSrcweir         OSL_ASSERT(false);
286*cdf0e10cSrcweir     }
287*cdf0e10cSrcweir 
288*cdf0e10cSrcweir     return NULL;
289*cdf0e10cSrcweir }
290*cdf0e10cSrcweir 
291*cdf0e10cSrcweir 
292*cdf0e10cSrcweir 
293*cdf0e10cSrcweir 
294*cdf0e10cSrcweir Reference<XResource> PresenterPaneFactory::CreatePane (
295*cdf0e10cSrcweir     const Reference<XResourceId>& rxPaneId,
296*cdf0e10cSrcweir     const OUString& rsTitle,
297*cdf0e10cSrcweir     const Reference<drawing::framework::XPane>& rxParentPane,
298*cdf0e10cSrcweir     const bool bIsSpritePane)
299*cdf0e10cSrcweir {
300*cdf0e10cSrcweir     Reference<XComponentContext> xContext (mxComponentContextWeak);
301*cdf0e10cSrcweir     Reference<lang::XMultiComponentFactory> xFactory (
302*cdf0e10cSrcweir         xContext->getServiceManager(), UNO_QUERY_THROW);
303*cdf0e10cSrcweir 
304*cdf0e10cSrcweir     // Create a border window and canvas and store it in the pane
305*cdf0e10cSrcweir     // container.
306*cdf0e10cSrcweir 
307*cdf0e10cSrcweir     // Create the pane.
308*cdf0e10cSrcweir     ::rtl::Reference<PresenterPaneBase> xPane;
309*cdf0e10cSrcweir     if (bIsSpritePane)
310*cdf0e10cSrcweir     {
311*cdf0e10cSrcweir         xPane = ::rtl::Reference<PresenterPaneBase>(
312*cdf0e10cSrcweir             new PresenterSpritePane(xContext, mpPresenterController));
313*cdf0e10cSrcweir     }
314*cdf0e10cSrcweir     else
315*cdf0e10cSrcweir     {
316*cdf0e10cSrcweir         xPane = ::rtl::Reference<PresenterPaneBase>(
317*cdf0e10cSrcweir             new PresenterPane(xContext, mpPresenterController));
318*cdf0e10cSrcweir     }
319*cdf0e10cSrcweir 
320*cdf0e10cSrcweir     // Supply arguments.
321*cdf0e10cSrcweir     Sequence<Any> aArguments (6);
322*cdf0e10cSrcweir     aArguments[0] <<= rxPaneId;
323*cdf0e10cSrcweir     aArguments[1] <<= rxParentPane->getWindow();
324*cdf0e10cSrcweir     aArguments[2] <<= rxParentPane->getCanvas();
325*cdf0e10cSrcweir     aArguments[3] <<= rsTitle;
326*cdf0e10cSrcweir     aArguments[4] <<= Reference<drawing::framework::XPaneBorderPainter>(
327*cdf0e10cSrcweir         static_cast<XWeak*>(mpPresenterController->GetPaneBorderPainter().get()),
328*cdf0e10cSrcweir         UNO_QUERY);
329*cdf0e10cSrcweir     aArguments[5] <<= bIsSpritePane ? false : true;
330*cdf0e10cSrcweir     xPane->initialize(aArguments);
331*cdf0e10cSrcweir 
332*cdf0e10cSrcweir     // Store pane and canvases and windows in container.
333*cdf0e10cSrcweir     ::rtl::Reference<PresenterPaneContainer> pContainer (
334*cdf0e10cSrcweir         mpPresenterController->GetPaneContainer());
335*cdf0e10cSrcweir     PresenterPaneContainer::SharedPaneDescriptor pDescriptor(
336*cdf0e10cSrcweir         pContainer->StoreBorderWindow(rxPaneId, xPane->GetBorderWindow()));
337*cdf0e10cSrcweir     pContainer->StorePane(xPane);
338*cdf0e10cSrcweir     if (pDescriptor.get() != NULL)
339*cdf0e10cSrcweir     {
340*cdf0e10cSrcweir         if (bIsSpritePane)
341*cdf0e10cSrcweir         {
342*cdf0e10cSrcweir             pDescriptor->maSpriteProvider = ::boost::bind(
343*cdf0e10cSrcweir                 &PresenterSpritePane::GetSprite,
344*cdf0e10cSrcweir                 dynamic_cast<PresenterSpritePane*>(xPane.get()));
345*cdf0e10cSrcweir             pDescriptor->mbIsSprite = true;
346*cdf0e10cSrcweir             pDescriptor->mbNeedsClipping = false;
347*cdf0e10cSrcweir         }
348*cdf0e10cSrcweir         else
349*cdf0e10cSrcweir         {
350*cdf0e10cSrcweir             pDescriptor->mbIsSprite = false;
351*cdf0e10cSrcweir             pDescriptor->mbNeedsClipping = true;
352*cdf0e10cSrcweir         }
353*cdf0e10cSrcweir 
354*cdf0e10cSrcweir         // Get the window of the frame and make that visible.
355*cdf0e10cSrcweir         Reference<awt::XWindow> xWindow (pDescriptor->mxBorderWindow, UNO_QUERY_THROW);
356*cdf0e10cSrcweir         xWindow->setVisible(sal_True);
357*cdf0e10cSrcweir     }
358*cdf0e10cSrcweir 
359*cdf0e10cSrcweir     return Reference<XResource>(static_cast<XWeak*>(xPane.get()), UNO_QUERY_THROW);
360*cdf0e10cSrcweir }
361*cdf0e10cSrcweir 
362*cdf0e10cSrcweir 
363*cdf0e10cSrcweir 
364*cdf0e10cSrcweir 
365*cdf0e10cSrcweir void PresenterPaneFactory::ThrowIfDisposed (void) const
366*cdf0e10cSrcweir     throw (::com::sun::star::lang::DisposedException)
367*cdf0e10cSrcweir {
368*cdf0e10cSrcweir 	if (rBHelper.bDisposed || rBHelper.bInDispose)
369*cdf0e10cSrcweir 	{
370*cdf0e10cSrcweir         throw lang::DisposedException (
371*cdf0e10cSrcweir             OUString(RTL_CONSTASCII_USTRINGPARAM(
372*cdf0e10cSrcweir                 "PresenterPaneFactory object has already been disposed")),
373*cdf0e10cSrcweir             const_cast<uno::XWeak*>(static_cast<const uno::XWeak*>(this)));
374*cdf0e10cSrcweir     }
375*cdf0e10cSrcweir }
376*cdf0e10cSrcweir 
377*cdf0e10cSrcweir 
378*cdf0e10cSrcweir } } // end of namespace sdext::presenter
379