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_svtools.hxx"
30*cdf0e10cSrcweir #include "svtaccessiblefactory.hxx"
31*cdf0e10cSrcweir #include <osl/module.h>
32*cdf0e10cSrcweir 
33*cdf0e10cSrcweir // #define UNLOAD_ON_LAST_CLIENT_DYING
34*cdf0e10cSrcweir     // this is not recommended currently. If enabled, the implementation will log
35*cdf0e10cSrcweir     // the number of active clients, and unload the acc library when the last client
36*cdf0e10cSrcweir     // goes away.
37*cdf0e10cSrcweir     // Sounds like a good idea, unfortunately, there's no guarantee that all objects
38*cdf0e10cSrcweir     // implemented in this library are already dead.
39*cdf0e10cSrcweir     // Iow, just because an object implementing an XAccessible (implemented in this lib
40*cdf0e10cSrcweir     // here) died, it's not said that everybody released all references to the
41*cdf0e10cSrcweir     // XAccessibleContext used by this component, and implemented in the acc lib.
42*cdf0e10cSrcweir     // So we cannot really unload the lib.
43*cdf0e10cSrcweir     //
44*cdf0e10cSrcweir     // Alternatively, if the lib would us own "usage counting", i.e. every component
45*cdf0e10cSrcweir     // implemented therein would affect a static ref count, the acc lib could care
46*cdf0e10cSrcweir     // for unloading itself.
47*cdf0e10cSrcweir 
48*cdf0e10cSrcweir //........................................................................
49*cdf0e10cSrcweir namespace svt
50*cdf0e10cSrcweir {
51*cdf0e10cSrcweir //........................................................................
52*cdf0e10cSrcweir 
53*cdf0e10cSrcweir     using namespace ::com::sun::star::uno;
54*cdf0e10cSrcweir     using namespace ::com::sun::star::awt;
55*cdf0e10cSrcweir     using namespace ::com::sun::star::accessibility;
56*cdf0e10cSrcweir 
57*cdf0e10cSrcweir     namespace
58*cdf0e10cSrcweir     {
59*cdf0e10cSrcweir #ifdef UNLOAD_ON_LAST_CLIENT_DYING
60*cdf0e10cSrcweir         static oslInterlockedCount                      s_nAccessibleFactoryAccesss = 0;
61*cdf0e10cSrcweir #endif // UNLOAD_ON_LAST_CLIENT_DYING
62*cdf0e10cSrcweir         static oslModule                                s_hAccessibleImplementationModule = NULL;
63*cdf0e10cSrcweir         static GetSvtAccessibilityComponentFactory      s_pAccessibleFactoryFunc = NULL;
64*cdf0e10cSrcweir         static ::rtl::Reference< IAccessibleFactory >   s_pFactory;
65*cdf0e10cSrcweir 
66*cdf0e10cSrcweir         //====================================================================
67*cdf0e10cSrcweir         //= AccessibleDummyFactory
68*cdf0e10cSrcweir         //====================================================================
69*cdf0e10cSrcweir         class AccessibleDummyFactory : public IAccessibleFactory
70*cdf0e10cSrcweir         {
71*cdf0e10cSrcweir         public:
72*cdf0e10cSrcweir             AccessibleDummyFactory();
73*cdf0e10cSrcweir 
74*cdf0e10cSrcweir         protected:
75*cdf0e10cSrcweir             virtual ~AccessibleDummyFactory();
76*cdf0e10cSrcweir 
77*cdf0e10cSrcweir         private:
78*cdf0e10cSrcweir             AccessibleDummyFactory( const AccessibleDummyFactory& );            // never implemented
79*cdf0e10cSrcweir             AccessibleDummyFactory& operator=( const AccessibleDummyFactory& ); // never implemented
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir             oslInterlockedCount m_refCount;
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir         public:
84*cdf0e10cSrcweir             // IReference
85*cdf0e10cSrcweir 	        virtual oslInterlockedCount SAL_CALL acquire();
86*cdf0e10cSrcweir 	        virtual oslInterlockedCount SAL_CALL release();
87*cdf0e10cSrcweir 
88*cdf0e10cSrcweir             // IAccessibleFactory
89*cdf0e10cSrcweir             virtual IAccessibleTabListBox*
90*cdf0e10cSrcweir                 createAccessibleTabListBox(
91*cdf0e10cSrcweir 		            const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& /*rxParent*/,
92*cdf0e10cSrcweir 		            SvHeaderTabListBox& /*rBox*/
93*cdf0e10cSrcweir                 ) const
94*cdf0e10cSrcweir             {
95*cdf0e10cSrcweir                 return NULL;
96*cdf0e10cSrcweir             }
97*cdf0e10cSrcweir 
98*cdf0e10cSrcweir             virtual IAccessibleBrowseBox*
99*cdf0e10cSrcweir                 createAccessibleBrowseBox(
100*cdf0e10cSrcweir                     const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& /*_rxParent*/,
101*cdf0e10cSrcweir                     IAccessibleTableProvider& /*_rBrowseBox*/
102*cdf0e10cSrcweir 		        ) const
103*cdf0e10cSrcweir             {
104*cdf0e10cSrcweir                 return NULL;
105*cdf0e10cSrcweir             }
106*cdf0e10cSrcweir 
107*cdf0e10cSrcweir 			virtual table::IAccessibleTableControl*
108*cdf0e10cSrcweir                 createAccessibleTableControl(
109*cdf0e10cSrcweir                     const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& /*_rxParent*/,
110*cdf0e10cSrcweir                     table::IAccessibleTable& /*_rTable*/
111*cdf0e10cSrcweir 		        ) const
112*cdf0e10cSrcweir             {
113*cdf0e10cSrcweir                 return NULL;
114*cdf0e10cSrcweir             }
115*cdf0e10cSrcweir 
116*cdf0e10cSrcweir             virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
117*cdf0e10cSrcweir 		        createAccessibleIconChoiceCtrl(
118*cdf0e10cSrcweir                     SvtIconChoiceCtrl& /*_rIconCtrl*/,
119*cdf0e10cSrcweir                     const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& /*_xParent*/
120*cdf0e10cSrcweir                 ) const
121*cdf0e10cSrcweir             {
122*cdf0e10cSrcweir                 return NULL;
123*cdf0e10cSrcweir             }
124*cdf0e10cSrcweir 
125*cdf0e10cSrcweir             virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
126*cdf0e10cSrcweir 		        createAccessibleTabBar(
127*cdf0e10cSrcweir                     TabBar& /*_rTabBar*/
128*cdf0e10cSrcweir                 ) const
129*cdf0e10cSrcweir             {
130*cdf0e10cSrcweir                 return NULL;
131*cdf0e10cSrcweir             }
132*cdf0e10cSrcweir 
133*cdf0e10cSrcweir             virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
134*cdf0e10cSrcweir 		        createAccessibleTextWindowContext(
135*cdf0e10cSrcweir                     VCLXWindow* /*pVclXWindow*/, TextEngine& /*rEngine*/, TextView& /*rView*/, bool /*bCompoundControlChild*/
136*cdf0e10cSrcweir                 ) const
137*cdf0e10cSrcweir             {
138*cdf0e10cSrcweir                 return NULL;
139*cdf0e10cSrcweir             }
140*cdf0e10cSrcweir 
141*cdf0e10cSrcweir             virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
142*cdf0e10cSrcweir                 createAccessibleTreeListBox(
143*cdf0e10cSrcweir                     SvTreeListBox& /*_rListBox*/,
144*cdf0e10cSrcweir 				    const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& /*_xParent*/
145*cdf0e10cSrcweir                 ) const
146*cdf0e10cSrcweir             {
147*cdf0e10cSrcweir                 return NULL;
148*cdf0e10cSrcweir             }
149*cdf0e10cSrcweir 
150*cdf0e10cSrcweir             virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
151*cdf0e10cSrcweir                 createAccessibleBrowseBoxHeaderBar(
152*cdf0e10cSrcweir                     const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& /*rxParent*/,
153*cdf0e10cSrcweir                     IAccessibleTableProvider& /*_rOwningTable*/,
154*cdf0e10cSrcweir                     AccessibleBrowseBoxObjType /*_eObjType*/
155*cdf0e10cSrcweir                 ) const
156*cdf0e10cSrcweir             {
157*cdf0e10cSrcweir                 return NULL;
158*cdf0e10cSrcweir             }
159*cdf0e10cSrcweir 
160*cdf0e10cSrcweir             virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
161*cdf0e10cSrcweir                 createAccessibleBrowseBoxTableCell(
162*cdf0e10cSrcweir                     const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& /*_rxParent*/,
163*cdf0e10cSrcweir 				    IAccessibleTableProvider& /*_rBrowseBox*/,
164*cdf0e10cSrcweir 				    const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& /*_xFocusWindow*/,
165*cdf0e10cSrcweir 				    sal_Int32 /*_nRowId*/,
166*cdf0e10cSrcweir 				    sal_uInt16 /*_nColId*/,
167*cdf0e10cSrcweir                     sal_Int32 /*_nOffset*/
168*cdf0e10cSrcweir                 ) const
169*cdf0e10cSrcweir             {
170*cdf0e10cSrcweir                 return NULL;
171*cdf0e10cSrcweir             }
172*cdf0e10cSrcweir 
173*cdf0e10cSrcweir             virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
174*cdf0e10cSrcweir                 createAccessibleBrowseBoxHeaderCell(
175*cdf0e10cSrcweir                     sal_Int32 /*_nColumnRowId*/,
176*cdf0e10cSrcweir 				    const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& /*rxParent*/,
177*cdf0e10cSrcweir 				    IAccessibleTableProvider& /*_rBrowseBox*/,
178*cdf0e10cSrcweir 				    const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& /*_xFocusWindow*/,
179*cdf0e10cSrcweir 				    AccessibleBrowseBoxObjType  /*_eObjType*/
180*cdf0e10cSrcweir                 ) const
181*cdf0e10cSrcweir             {
182*cdf0e10cSrcweir                 return NULL;
183*cdf0e10cSrcweir             }
184*cdf0e10cSrcweir 
185*cdf0e10cSrcweir             virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
186*cdf0e10cSrcweir                 createAccessibleCheckBoxCell(
187*cdf0e10cSrcweir                     const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& /*_rxParent*/,
188*cdf0e10cSrcweir 				    IAccessibleTableProvider& /*_rBrowseBox*/,
189*cdf0e10cSrcweir 				    const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& /*_xFocusWindow*/,
190*cdf0e10cSrcweir 				    sal_Int32 /*_nRowPos*/,
191*cdf0e10cSrcweir 				    sal_uInt16 /*_nColPos*/,
192*cdf0e10cSrcweir 				    const TriState& /*_eState*/,
193*cdf0e10cSrcweir 				    sal_Bool /*_bEnabled*/,
194*cdf0e10cSrcweir 				    sal_Bool /*_bIsTriState*/
195*cdf0e10cSrcweir                 ) const
196*cdf0e10cSrcweir             {
197*cdf0e10cSrcweir                 return NULL;
198*cdf0e10cSrcweir             }
199*cdf0e10cSrcweir 
200*cdf0e10cSrcweir             virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
201*cdf0e10cSrcweir                 createEditBrowseBoxTableCellAccess(
202*cdf0e10cSrcweir 			        const ::com::sun::star::uno::Reference< com::sun::star::accessibility::XAccessible >& /*_rxParent*/,
203*cdf0e10cSrcweir 			        const ::com::sun::star::uno::Reference< com::sun::star::accessibility::XAccessible >& /*_rxControlAccessible*/,
204*cdf0e10cSrcweir 			        const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& /*_rxFocusWindow*/,
205*cdf0e10cSrcweir                     IAccessibleTableProvider& /*_rBrowseBox*/,
206*cdf0e10cSrcweir 			        sal_Int32 /*_nRowPos*/,
207*cdf0e10cSrcweir 			        sal_uInt16 /*_nColPos*/
208*cdf0e10cSrcweir 		        ) const
209*cdf0e10cSrcweir             {
210*cdf0e10cSrcweir                 return NULL;
211*cdf0e10cSrcweir             }
212*cdf0e10cSrcweir 
213*cdf0e10cSrcweir             virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
214*cdf0e10cSrcweir                 createAccessibleToolPanelDeck(
215*cdf0e10cSrcweir                     const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& /*i_rAccessibleParent*/,
216*cdf0e10cSrcweir                     ::svt::ToolPanelDeck& /*i_rPanelDeck*/
217*cdf0e10cSrcweir                 )
218*cdf0e10cSrcweir             {
219*cdf0e10cSrcweir                 return NULL;
220*cdf0e10cSrcweir             }
221*cdf0e10cSrcweir             virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
222*cdf0e10cSrcweir                 createAccessibleToolPanelTabBar(
223*cdf0e10cSrcweir                     const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& /*i_rAccessibleParent*/,
224*cdf0e10cSrcweir                     ::svt::IToolPanelDeck& /*i_rPanelDeck*/,
225*cdf0e10cSrcweir                     ::svt::PanelTabBar& /*i_rTabBar*/
226*cdf0e10cSrcweir                 )
227*cdf0e10cSrcweir             {
228*cdf0e10cSrcweir                 return NULL;
229*cdf0e10cSrcweir             }
230*cdf0e10cSrcweir         };
231*cdf0e10cSrcweir 
232*cdf0e10cSrcweir         //----------------------------------------------------------------
233*cdf0e10cSrcweir         AccessibleDummyFactory::AccessibleDummyFactory()
234*cdf0e10cSrcweir         {
235*cdf0e10cSrcweir         }
236*cdf0e10cSrcweir 
237*cdf0e10cSrcweir         //----------------------------------------------------------------
238*cdf0e10cSrcweir         AccessibleDummyFactory::~AccessibleDummyFactory()
239*cdf0e10cSrcweir         {
240*cdf0e10cSrcweir         }
241*cdf0e10cSrcweir 
242*cdf0e10cSrcweir         //----------------------------------------------------------------
243*cdf0e10cSrcweir 	    oslInterlockedCount SAL_CALL AccessibleDummyFactory::acquire()
244*cdf0e10cSrcweir         {
245*cdf0e10cSrcweir             return osl_incrementInterlockedCount( &m_refCount );
246*cdf0e10cSrcweir         }
247*cdf0e10cSrcweir 
248*cdf0e10cSrcweir 	    //----------------------------------------------------------------
249*cdf0e10cSrcweir 	    oslInterlockedCount SAL_CALL AccessibleDummyFactory::release()
250*cdf0e10cSrcweir         {
251*cdf0e10cSrcweir             if ( 0 == osl_decrementInterlockedCount( &m_refCount ) )
252*cdf0e10cSrcweir             {
253*cdf0e10cSrcweir                 delete this;
254*cdf0e10cSrcweir                 return 0;
255*cdf0e10cSrcweir             }
256*cdf0e10cSrcweir             return m_refCount;
257*cdf0e10cSrcweir         }
258*cdf0e10cSrcweir     }
259*cdf0e10cSrcweir 
260*cdf0e10cSrcweir     //====================================================================
261*cdf0e10cSrcweir     //= AccessibleFactoryAccess
262*cdf0e10cSrcweir     //====================================================================
263*cdf0e10cSrcweir     //--------------------------------------------------------------------
264*cdf0e10cSrcweir     AccessibleFactoryAccess::AccessibleFactoryAccess()
265*cdf0e10cSrcweir         :m_bInitialized( false )
266*cdf0e10cSrcweir     {
267*cdf0e10cSrcweir     }
268*cdf0e10cSrcweir 
269*cdf0e10cSrcweir     //--------------------------------------------------------------------
270*cdf0e10cSrcweir     extern "C" { static void SAL_CALL thisModule() {} }
271*cdf0e10cSrcweir 
272*cdf0e10cSrcweir     void AccessibleFactoryAccess::ensureInitialized()
273*cdf0e10cSrcweir     {
274*cdf0e10cSrcweir         if ( m_bInitialized )
275*cdf0e10cSrcweir             return;
276*cdf0e10cSrcweir 
277*cdf0e10cSrcweir         ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
278*cdf0e10cSrcweir 
279*cdf0e10cSrcweir #ifdef UNLOAD_ON_LAST_CLIENT_DYING
280*cdf0e10cSrcweir         if ( 1 == osl_incrementInterlockedCount( &s_nAccessibleFactoryAccesss ) )
281*cdf0e10cSrcweir         {   // the first client
282*cdf0e10cSrcweir #endif // UNLOAD_ON_LAST_CLIENT_DYING
283*cdf0e10cSrcweir             // load the library implementing the factory
284*cdf0e10cSrcweir             if ( !s_pFactory.get() )
285*cdf0e10cSrcweir             {
286*cdf0e10cSrcweir                 const ::rtl::OUString sModuleName = ::rtl::OUString::createFromAscii(
287*cdf0e10cSrcweir                     SVLIBRARY( "acc" )
288*cdf0e10cSrcweir                 );
289*cdf0e10cSrcweir                 s_hAccessibleImplementationModule = osl_loadModuleRelative( &thisModule, sModuleName.pData, 0 );
290*cdf0e10cSrcweir                 if ( s_hAccessibleImplementationModule != NULL )
291*cdf0e10cSrcweir                 {
292*cdf0e10cSrcweir                     const ::rtl::OUString sFactoryCreationFunc =
293*cdf0e10cSrcweir                         ::rtl::OUString::createFromAscii( "getSvtAccessibilityComponentFactory" );
294*cdf0e10cSrcweir                     s_pAccessibleFactoryFunc = (GetSvtAccessibilityComponentFactory)
295*cdf0e10cSrcweir                         osl_getFunctionSymbol( s_hAccessibleImplementationModule, sFactoryCreationFunc.pData );
296*cdf0e10cSrcweir 
297*cdf0e10cSrcweir                 }
298*cdf0e10cSrcweir                 OSL_ENSURE( s_pAccessibleFactoryFunc, "ac_registerClient: could not load the library, or not retrieve the needed symbol!" );
299*cdf0e10cSrcweir 
300*cdf0e10cSrcweir                 // get a factory instance
301*cdf0e10cSrcweir                 if ( s_pAccessibleFactoryFunc )
302*cdf0e10cSrcweir                 {
303*cdf0e10cSrcweir                     IAccessibleFactory* pFactory = static_cast< IAccessibleFactory* >( (*s_pAccessibleFactoryFunc)() );
304*cdf0e10cSrcweir                     if ( pFactory )
305*cdf0e10cSrcweir                     {
306*cdf0e10cSrcweir                         s_pFactory = pFactory;
307*cdf0e10cSrcweir                         pFactory->release();
308*cdf0e10cSrcweir                     }
309*cdf0e10cSrcweir                 }
310*cdf0e10cSrcweir             }
311*cdf0e10cSrcweir 
312*cdf0e10cSrcweir             if ( !s_pFactory.get() )
313*cdf0e10cSrcweir                 // the attempt to load the lib, or to create the factory, failed
314*cdf0e10cSrcweir                 // -> fall back to a dummy factory
315*cdf0e10cSrcweir                 s_pFactory = new AccessibleDummyFactory;
316*cdf0e10cSrcweir #ifdef UNLOAD_ON_LAST_CLIENT_DYING
317*cdf0e10cSrcweir         }
318*cdf0e10cSrcweir #endif
319*cdf0e10cSrcweir 
320*cdf0e10cSrcweir         m_bInitialized = true;
321*cdf0e10cSrcweir     }
322*cdf0e10cSrcweir 
323*cdf0e10cSrcweir     //--------------------------------------------------------------------
324*cdf0e10cSrcweir     AccessibleFactoryAccess::~AccessibleFactoryAccess()
325*cdf0e10cSrcweir     {
326*cdf0e10cSrcweir         if ( m_bInitialized )
327*cdf0e10cSrcweir         {
328*cdf0e10cSrcweir             ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
329*cdf0e10cSrcweir 
330*cdf0e10cSrcweir #ifdef UNLOAD_ON_LAST_CLIENT_DYING
331*cdf0e10cSrcweir             if( 0 == osl_decrementInterlockedCount( &s_nAccessibleFactoryAccesss ) )
332*cdf0e10cSrcweir             {
333*cdf0e10cSrcweir                 s_pFactory = NULL;
334*cdf0e10cSrcweir                 s_pAccessibleFactoryFunc = NULL;
335*cdf0e10cSrcweir                 if ( s_hAccessibleImplementationModule )
336*cdf0e10cSrcweir                 {
337*cdf0e10cSrcweir                     osl_unloadModule( s_hAccessibleImplementationModule );
338*cdf0e10cSrcweir                     s_hAccessibleImplementationModule = NULL;
339*cdf0e10cSrcweir                 }
340*cdf0e10cSrcweir             }
341*cdf0e10cSrcweir #endif // UNLOAD_ON_LAST_CLIENT_DYING
342*cdf0e10cSrcweir         }
343*cdf0e10cSrcweir     }
344*cdf0e10cSrcweir 
345*cdf0e10cSrcweir     //--------------------------------------------------------------------
346*cdf0e10cSrcweir     IAccessibleFactory& AccessibleFactoryAccess::getFactory()
347*cdf0e10cSrcweir     {
348*cdf0e10cSrcweir         ensureInitialized();
349*cdf0e10cSrcweir         DBG_ASSERT( s_pFactory.is(), "AccessibleFactoryAccess::getFactory: at least a dummy factory should have been created!" );
350*cdf0e10cSrcweir         return *s_pFactory;
351*cdf0e10cSrcweir     }
352*cdf0e10cSrcweir 
353*cdf0e10cSrcweir //........................................................................
354*cdf0e10cSrcweir }   // namespace svt
355*cdf0e10cSrcweir //........................................................................
356