1*cde9e8dcSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*cde9e8dcSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*cde9e8dcSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*cde9e8dcSAndrew Rist  * distributed with this work for additional information
6*cde9e8dcSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*cde9e8dcSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*cde9e8dcSAndrew Rist  * "License"); you may not use this file except in compliance
9*cde9e8dcSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*cde9e8dcSAndrew Rist  *
11*cde9e8dcSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*cde9e8dcSAndrew Rist  *
13*cde9e8dcSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*cde9e8dcSAndrew Rist  * software distributed under the License is distributed on an
15*cde9e8dcSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*cde9e8dcSAndrew Rist  * KIND, either express or implied.  See the License for the
17*cde9e8dcSAndrew Rist  * specific language governing permissions and limitations
18*cde9e8dcSAndrew Rist  * under the License.
19*cde9e8dcSAndrew Rist  *
20*cde9e8dcSAndrew Rist  *************************************************************/
21*cde9e8dcSAndrew Rist 
22*cde9e8dcSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_chart2.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "AccessibleChartView.hxx"
28cdf0e10cSrcweir #include "chartview/ExplicitValueProvider.hxx"
29cdf0e10cSrcweir #include "servicenames.hxx"
30cdf0e10cSrcweir #include "macros.hxx"
31cdf0e10cSrcweir #include "ObjectHierarchy.hxx"
32cdf0e10cSrcweir #include "ObjectIdentifier.hxx"
33cdf0e10cSrcweir #include "ResId.hxx"
34cdf0e10cSrcweir #include "Strings.hrc"
35cdf0e10cSrcweir #include "AccessibleViewForwarder.hxx"
36cdf0e10cSrcweir 
37cdf0e10cSrcweir #include <com/sun/star/accessibility/AccessibleEventId.hpp>
38cdf0e10cSrcweir #include <com/sun/star/accessibility/AccessibleStateType.hpp>
39cdf0e10cSrcweir #include <com/sun/star/accessibility/AccessibleRole.hpp>
40cdf0e10cSrcweir 
41cdf0e10cSrcweir #include <tools/string.hxx>
42cdf0e10cSrcweir #include <vcl/window.hxx>
43cdf0e10cSrcweir #include <toolkit/helper/vclunohelper.hxx>
44cdf0e10cSrcweir // for SolarMutex
45cdf0e10cSrcweir #include <vcl/svapp.hxx>
46cdf0e10cSrcweir 
47cdf0e10cSrcweir // header for typedef MutexGuard
48cdf0e10cSrcweir #include <osl/mutex.hxx>
49cdf0e10cSrcweir 
50cdf0e10cSrcweir using namespace ::com::sun::star;
51cdf0e10cSrcweir using namespace ::com::sun::star::accessibility;
52cdf0e10cSrcweir 
53cdf0e10cSrcweir using ::com::sun::star::uno::Sequence;
54cdf0e10cSrcweir using ::com::sun::star::uno::Reference;
55cdf0e10cSrcweir using ::com::sun::star::uno::WeakReference;
56cdf0e10cSrcweir using ::com::sun::star::uno::Any;
57cdf0e10cSrcweir using ::rtl::OUString;
58cdf0e10cSrcweir using osl::MutexGuard;
59cdf0e10cSrcweir 
60cdf0e10cSrcweir //.............................................................................
61cdf0e10cSrcweir namespace chart
62cdf0e10cSrcweir {
63cdf0e10cSrcweir //.............................................................................
64cdf0e10cSrcweir 
AccessibleChartView(const Reference<uno::XComponentContext> & xContext,SdrView * pView)65cdf0e10cSrcweir AccessibleChartView::AccessibleChartView(
66cdf0e10cSrcweir     const Reference< uno::XComponentContext >& xContext, SdrView* pView ) :
67cdf0e10cSrcweir         impl::AccessibleChartView_Base(
68cdf0e10cSrcweir             AccessibleElementInfo(), // empty for now
69cdf0e10cSrcweir             true, // has children
70cdf0e10cSrcweir             true  // always transparent
71cdf0e10cSrcweir             ),
72cdf0e10cSrcweir         m_xContext( xContext ),
73cdf0e10cSrcweir         m_pSdrView( pView ),
74cdf0e10cSrcweir         m_pViewForwarder( NULL )
75cdf0e10cSrcweir {
76cdf0e10cSrcweir     AddState( AccessibleStateType::OPAQUE );
77cdf0e10cSrcweir }
78cdf0e10cSrcweir 
~AccessibleChartView()79cdf0e10cSrcweir AccessibleChartView::~AccessibleChartView()
80cdf0e10cSrcweir {
81cdf0e10cSrcweir     delete m_pViewForwarder;
82cdf0e10cSrcweir }
83cdf0e10cSrcweir 
84cdf0e10cSrcweir 
GetWindowPosSize() const85cdf0e10cSrcweir awt::Rectangle AccessibleChartView::GetWindowPosSize() const
86cdf0e10cSrcweir {
87cdf0e10cSrcweir     Reference< awt::XWindow > xWindow( GetInfo().m_xWindow );
88cdf0e10cSrcweir     if( ! xWindow.is())
89cdf0e10cSrcweir         return awt::Rectangle();
90cdf0e10cSrcweir 
91cdf0e10cSrcweir     // this should do, but it doesn't => HACK
92cdf0e10cSrcweir //     return xWindow->getPosSize();
93cdf0e10cSrcweir 
94cdf0e10cSrcweir     awt::Rectangle aBBox( xWindow->getPosSize() );
95cdf0e10cSrcweir 
96cdf0e10cSrcweir     Window* pWindow( VCLUnoHelper::GetWindow( GetInfo().m_xWindow ));
97cdf0e10cSrcweir     if( pWindow )
98cdf0e10cSrcweir     {
99cdf0e10cSrcweir         // /-- solar
100cdf0e10cSrcweir         ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
101cdf0e10cSrcweir         Point aVCLPoint( pWindow->OutputToAbsoluteScreenPixel( Point( 0, 0 ) ));
102cdf0e10cSrcweir         aBBox.X = aVCLPoint.getX();
103cdf0e10cSrcweir         aBBox.Y = aVCLPoint.getY();
104cdf0e10cSrcweir         // \-- solar
105cdf0e10cSrcweir     }
106cdf0e10cSrcweir 
107cdf0e10cSrcweir     return aBBox;
108cdf0e10cSrcweir }
109cdf0e10cSrcweir 
GetUpperLeftOnScreen() const110cdf0e10cSrcweir awt::Point AccessibleChartView::GetUpperLeftOnScreen() const
111cdf0e10cSrcweir {
112cdf0e10cSrcweir     awt::Point aParentPosition;
113cdf0e10cSrcweir 
114cdf0e10cSrcweir     awt::Rectangle aBBox( GetWindowPosSize() );
115cdf0e10cSrcweir     aParentPosition.X = aBBox.X;
116cdf0e10cSrcweir     aParentPosition.Y = aBBox.Y;
117cdf0e10cSrcweir 
118cdf0e10cSrcweir     return aParentPosition;
119cdf0e10cSrcweir }
120cdf0e10cSrcweir 
121cdf0e10cSrcweir // ________ XAccessibleContext ________
getAccessibleName()122cdf0e10cSrcweir OUString SAL_CALL AccessibleChartView::getAccessibleName()
123cdf0e10cSrcweir     throw (uno::RuntimeException)
124cdf0e10cSrcweir {
125cdf0e10cSrcweir     return OUString( String( SchResId( STR_OBJECT_DIAGRAM )));
126cdf0e10cSrcweir }
127cdf0e10cSrcweir 
getAccessibleDescription()128cdf0e10cSrcweir OUString SAL_CALL AccessibleChartView::getAccessibleDescription()
129cdf0e10cSrcweir     throw (uno::RuntimeException)
130cdf0e10cSrcweir {
131cdf0e10cSrcweir     return getAccessibleName();
132cdf0e10cSrcweir }
133cdf0e10cSrcweir 
getAccessibleParent()134cdf0e10cSrcweir Reference< XAccessible > SAL_CALL AccessibleChartView::getAccessibleParent()
135cdf0e10cSrcweir     throw (uno::RuntimeException)
136cdf0e10cSrcweir {
137cdf0e10cSrcweir     return Reference< XAccessible >( m_xParent );
138cdf0e10cSrcweir }
139cdf0e10cSrcweir 
getAccessibleIndexInParent()140cdf0e10cSrcweir sal_Int32 SAL_CALL AccessibleChartView::getAccessibleIndexInParent()
141cdf0e10cSrcweir     throw (uno::RuntimeException)
142cdf0e10cSrcweir {
143cdf0e10cSrcweir     // the document is always the only child of the window
144cdf0e10cSrcweir     return 0;
145cdf0e10cSrcweir }
146cdf0e10cSrcweir 
getAccessibleRole()147cdf0e10cSrcweir sal_Int16 SAL_CALL AccessibleChartView::getAccessibleRole()
148cdf0e10cSrcweir     throw (uno::RuntimeException)
149cdf0e10cSrcweir {
150cdf0e10cSrcweir     return AccessibleRole::DOCUMENT;
151cdf0e10cSrcweir }
152cdf0e10cSrcweir 
153cdf0e10cSrcweir // ________ XAccessibleComponent ________
getBounds()154cdf0e10cSrcweir awt::Rectangle SAL_CALL AccessibleChartView::getBounds()
155cdf0e10cSrcweir     throw (uno::RuntimeException)
156cdf0e10cSrcweir {
157cdf0e10cSrcweir     awt::Rectangle aResult( GetWindowPosSize());
158cdf0e10cSrcweir     Reference< XAccessible > xParent( m_xParent );
159cdf0e10cSrcweir     if( xParent.is())
160cdf0e10cSrcweir     {
161cdf0e10cSrcweir         Reference< XAccessibleComponent > xContext( xParent->getAccessibleContext(), uno::UNO_QUERY );
162cdf0e10cSrcweir         if( xContext.is())
163cdf0e10cSrcweir         {
164cdf0e10cSrcweir             awt::Point aParentPosition = xContext->getLocationOnScreen();
165cdf0e10cSrcweir             aResult.X -= aParentPosition.X;
166cdf0e10cSrcweir             aResult.Y -= aParentPosition.Y;
167cdf0e10cSrcweir         }
168cdf0e10cSrcweir     }
169cdf0e10cSrcweir     return aResult;
170cdf0e10cSrcweir }
171cdf0e10cSrcweir 
getLocationOnScreen()172cdf0e10cSrcweir awt::Point SAL_CALL AccessibleChartView::getLocationOnScreen()
173cdf0e10cSrcweir     throw (uno::RuntimeException)
174cdf0e10cSrcweir {
175cdf0e10cSrcweir     awt::Rectangle aBounds( getBounds());
176cdf0e10cSrcweir     awt::Point aResult;
177cdf0e10cSrcweir     Reference< XAccessible > xParent( m_xParent );
178cdf0e10cSrcweir     if( xParent.is())
179cdf0e10cSrcweir     {
180cdf0e10cSrcweir         Reference< XAccessibleComponent > xAccComp(
181cdf0e10cSrcweir             xParent->getAccessibleContext(), uno::UNO_QUERY );
182cdf0e10cSrcweir         aResult = xAccComp->getLocationOnScreen();
183cdf0e10cSrcweir         aResult.X += aBounds.X;
184cdf0e10cSrcweir         aResult.Y += aBounds.Y;
185cdf0e10cSrcweir     }
186cdf0e10cSrcweir     return aResult;
187cdf0e10cSrcweir }
188cdf0e10cSrcweir 
189cdf0e10cSrcweir //-----------------------------------------------------------------
190cdf0e10cSrcweir // lang::XInitialization
191cdf0e10cSrcweir //-----------------------------------------------------------------
192cdf0e10cSrcweir 
initialize(const Sequence<Any> & rArguments)193cdf0e10cSrcweir void SAL_CALL AccessibleChartView::initialize( const Sequence< Any >& rArguments )
194cdf0e10cSrcweir                 throw (uno::Exception, uno::RuntimeException)
195cdf0e10cSrcweir {
196cdf0e10cSrcweir     //0: view::XSelectionSupplier offers notifications for selection changes and access to the selection itself
197cdf0e10cSrcweir     //1: frame::XModel representing the chart model - offers access to object data
198cdf0e10cSrcweir     //2: lang::XInterface representing the normal chart view - offers access to some extra object data
199cdf0e10cSrcweir 
200cdf0e10cSrcweir     //all arguments are only valid until next initialization
201cdf0e10cSrcweir     bool bChanged = false;
202cdf0e10cSrcweir     bool bOldInvalid = false;
203cdf0e10cSrcweir     bool bNewInvalid = false;
204cdf0e10cSrcweir 
205cdf0e10cSrcweir     Reference< view::XSelectionSupplier > xSelectionSupplier;
206cdf0e10cSrcweir     Reference< frame::XModel > xChartModel;
207cdf0e10cSrcweir     Reference< uno::XInterface > xChartView;
208cdf0e10cSrcweir     Reference< XAccessible > xParent;
209cdf0e10cSrcweir     Reference< awt::XWindow > xWindow;
210cdf0e10cSrcweir     {
211cdf0e10cSrcweir         MutexGuard aGuard( GetMutex());
212cdf0e10cSrcweir         xSelectionSupplier.set( m_xSelectionSupplier );
213cdf0e10cSrcweir         xChartModel.set( m_xChartModel );
214cdf0e10cSrcweir         xChartView.set( m_xChartView );
215cdf0e10cSrcweir         xParent.set( m_xParent );
216cdf0e10cSrcweir         xWindow.set( m_xWindow );
217cdf0e10cSrcweir     }
218cdf0e10cSrcweir 
219cdf0e10cSrcweir     if( !xSelectionSupplier.is() || !xChartModel.is() || !xChartView.is() )
220cdf0e10cSrcweir     {
221cdf0e10cSrcweir         bOldInvalid = true;
222cdf0e10cSrcweir     }
223cdf0e10cSrcweir 
224cdf0e10cSrcweir     if( rArguments.getLength() > 1 )
225cdf0e10cSrcweir     {
226cdf0e10cSrcweir         Reference< frame::XModel > xNewChartModel;
227cdf0e10cSrcweir         rArguments[1] >>= xNewChartModel;
228cdf0e10cSrcweir         if( xNewChartModel != xChartModel )
229cdf0e10cSrcweir         {
230cdf0e10cSrcweir             xChartModel = xNewChartModel;
231cdf0e10cSrcweir             bChanged = true;
232cdf0e10cSrcweir         }
233cdf0e10cSrcweir     }
234cdf0e10cSrcweir     else if( xChartModel.is() )
235cdf0e10cSrcweir     {
236cdf0e10cSrcweir         bChanged = true;
237cdf0e10cSrcweir         xChartModel = 0;
238cdf0e10cSrcweir     }
239cdf0e10cSrcweir 
240cdf0e10cSrcweir     if( rArguments.getLength() > 2 )
241cdf0e10cSrcweir     {
242cdf0e10cSrcweir         Reference< uno::XInterface > xNewChartView;
243cdf0e10cSrcweir         rArguments[2] >>= xNewChartView;
244cdf0e10cSrcweir         if( xNewChartView != xChartView )
245cdf0e10cSrcweir         {
246cdf0e10cSrcweir             xChartView = xNewChartView;
247cdf0e10cSrcweir             bChanged = true;
248cdf0e10cSrcweir         }
249cdf0e10cSrcweir     }
250cdf0e10cSrcweir     else if( xChartView.is() )
251cdf0e10cSrcweir     {
252cdf0e10cSrcweir         bChanged = true;
253cdf0e10cSrcweir         xChartView = 0;
254cdf0e10cSrcweir     }
255cdf0e10cSrcweir 
256cdf0e10cSrcweir     if( rArguments.getLength() > 3 )
257cdf0e10cSrcweir     {
258cdf0e10cSrcweir         Reference< XAccessible > xNewParent;
259cdf0e10cSrcweir         rArguments[3] >>= xNewParent;
260cdf0e10cSrcweir         if( xNewParent != xParent )
261cdf0e10cSrcweir         {
262cdf0e10cSrcweir             xParent = xNewParent;
263cdf0e10cSrcweir             bChanged = true;
264cdf0e10cSrcweir         }
265cdf0e10cSrcweir     }
266cdf0e10cSrcweir 
267cdf0e10cSrcweir     if( rArguments.getLength() > 4 )
268cdf0e10cSrcweir     {
269cdf0e10cSrcweir         Reference< awt::XWindow > xNewWindow;
270cdf0e10cSrcweir         rArguments[4] >>= xNewWindow;
271cdf0e10cSrcweir         if( xNewWindow != xWindow )
272cdf0e10cSrcweir         {
273cdf0e10cSrcweir             xWindow.set( xNewWindow );
274cdf0e10cSrcweir             bChanged = true;
275cdf0e10cSrcweir         }
276cdf0e10cSrcweir     }
277cdf0e10cSrcweir 
278cdf0e10cSrcweir     if( rArguments.getLength() > 0 && xChartModel.is() && xChartView.is() )
279cdf0e10cSrcweir     {
280cdf0e10cSrcweir         Reference< view::XSelectionSupplier > xNewSelectionSupplier;
281cdf0e10cSrcweir         rArguments[0] >>= xNewSelectionSupplier;
282cdf0e10cSrcweir         if(xSelectionSupplier!=xNewSelectionSupplier)
283cdf0e10cSrcweir         {
284cdf0e10cSrcweir             bChanged = true;
285cdf0e10cSrcweir             if(xSelectionSupplier.is())
286cdf0e10cSrcweir                 xSelectionSupplier->removeSelectionChangeListener(this);
287cdf0e10cSrcweir             if(xNewSelectionSupplier.is())
288cdf0e10cSrcweir                 xNewSelectionSupplier->addSelectionChangeListener(this);
289cdf0e10cSrcweir             xSelectionSupplier = xNewSelectionSupplier;
290cdf0e10cSrcweir         }
291cdf0e10cSrcweir     }
292cdf0e10cSrcweir     else if( xSelectionSupplier.is() )
293cdf0e10cSrcweir     {
294cdf0e10cSrcweir         bChanged = true;
295cdf0e10cSrcweir         xSelectionSupplier->removeSelectionChangeListener(this);
296cdf0e10cSrcweir         xSelectionSupplier = 0;
297cdf0e10cSrcweir     }
298cdf0e10cSrcweir 
299cdf0e10cSrcweir     if( !xSelectionSupplier.is() || !xChartModel.is() || !xChartView.is() )
300cdf0e10cSrcweir     {
301cdf0e10cSrcweir         if(xSelectionSupplier.is())
302cdf0e10cSrcweir             xSelectionSupplier->removeSelectionChangeListener(this);
303cdf0e10cSrcweir         xSelectionSupplier = 0;
304cdf0e10cSrcweir         xChartModel.clear();
305cdf0e10cSrcweir         xChartView.clear();
306cdf0e10cSrcweir         xParent.clear();
307cdf0e10cSrcweir         xWindow.clear();
308cdf0e10cSrcweir 
309cdf0e10cSrcweir         bNewInvalid = true;
310cdf0e10cSrcweir     }
311cdf0e10cSrcweir 
312cdf0e10cSrcweir     {
313cdf0e10cSrcweir         MutexGuard aGuard( GetMutex());
314cdf0e10cSrcweir         m_xSelectionSupplier = WeakReference< view::XSelectionSupplier >(xSelectionSupplier);
315cdf0e10cSrcweir         m_xChartModel = WeakReference< frame::XModel >(xChartModel);
316cdf0e10cSrcweir         m_xChartView = WeakReference< uno::XInterface >(xChartView);
317cdf0e10cSrcweir         m_xParent = WeakReference< XAccessible >(xParent);
318cdf0e10cSrcweir         m_xWindow = WeakReference< awt::XWindow >(xWindow);
319cdf0e10cSrcweir     }
320cdf0e10cSrcweir 
321cdf0e10cSrcweir     if( bOldInvalid && bNewInvalid )
322cdf0e10cSrcweir         bChanged = false;
323cdf0e10cSrcweir 
324cdf0e10cSrcweir     if( bChanged )
325cdf0e10cSrcweir     {
326cdf0e10cSrcweir         {
327cdf0e10cSrcweir             //before notification we prepare for creation of new context
328cdf0e10cSrcweir             //the old context will be deleted after notification than
329cdf0e10cSrcweir             MutexGuard aGuard( GetMutex());
330cdf0e10cSrcweir             Reference< chart2::XChartDocument > xChartDoc( xChartModel, uno::UNO_QUERY );
331cdf0e10cSrcweir             if( xChartDoc.is())
332cdf0e10cSrcweir                 m_spObjectHierarchy.reset( new ObjectHierarchy( xChartDoc, getExplicitValueProvider() ));
333cdf0e10cSrcweir             else
334cdf0e10cSrcweir                 m_spObjectHierarchy.reset();
335cdf0e10cSrcweir         }
336cdf0e10cSrcweir 
337cdf0e10cSrcweir         {
338cdf0e10cSrcweir             AccessibleElementInfo aAccInfo;
339cdf0e10cSrcweir             aAccInfo.m_aOID = ObjectIdentifier( C2U( "ROOT" ) );
340cdf0e10cSrcweir             aAccInfo.m_xChartDocument = uno::WeakReference< chart2::XChartDocument >(
341cdf0e10cSrcweir                 uno::Reference< chart2::XChartDocument >( m_xChartModel.get(), uno::UNO_QUERY ));
342cdf0e10cSrcweir             aAccInfo.m_xSelectionSupplier = m_xSelectionSupplier;
343cdf0e10cSrcweir             aAccInfo.m_xView = m_xChartView;
344cdf0e10cSrcweir             aAccInfo.m_xWindow = m_xWindow;
345cdf0e10cSrcweir             aAccInfo.m_pParent = 0;
346cdf0e10cSrcweir             aAccInfo.m_spObjectHierarchy = m_spObjectHierarchy;
347cdf0e10cSrcweir             aAccInfo.m_pSdrView = m_pSdrView;
348cdf0e10cSrcweir             Window* pWindow = VCLUnoHelper::GetWindow( m_xWindow );
349cdf0e10cSrcweir             if ( m_pViewForwarder )
350cdf0e10cSrcweir             {
351cdf0e10cSrcweir                 delete m_pViewForwarder;
352cdf0e10cSrcweir             }
353cdf0e10cSrcweir             m_pViewForwarder = new AccessibleViewForwarder( this, pWindow );
354cdf0e10cSrcweir             aAccInfo.m_pViewForwarder = m_pViewForwarder;
355cdf0e10cSrcweir             // broadcasts an INVALIDATE_ALL_CHILDREN event globally
356cdf0e10cSrcweir             SetInfo( aAccInfo );
357cdf0e10cSrcweir         }
358cdf0e10cSrcweir     }
359cdf0e10cSrcweir }
360cdf0e10cSrcweir 
getExplicitValueProvider()361cdf0e10cSrcweir ExplicitValueProvider* AccessibleChartView::getExplicitValueProvider()
362cdf0e10cSrcweir {
363cdf0e10cSrcweir     return ExplicitValueProvider::getExplicitValueProvider(m_xChartView);
364cdf0e10cSrcweir }
365cdf0e10cSrcweir 
366cdf0e10cSrcweir //-------------------------------------------------------------------------
367cdf0e10cSrcweir // view::XSelectionChangeListener
368cdf0e10cSrcweir //-------------------------------------------------------------------------
369cdf0e10cSrcweir 
selectionChanged(const lang::EventObject &)370cdf0e10cSrcweir void SAL_CALL AccessibleChartView::selectionChanged( const lang::EventObject& /*rEvent*/ )
371cdf0e10cSrcweir                 throw (uno::RuntimeException)
372cdf0e10cSrcweir {
373cdf0e10cSrcweir     Reference< view::XSelectionSupplier > xSelectionSupplier;
374cdf0e10cSrcweir     {
375cdf0e10cSrcweir         MutexGuard aGuard( GetMutex());
376cdf0e10cSrcweir         xSelectionSupplier = Reference< view::XSelectionSupplier >(m_xSelectionSupplier);
377cdf0e10cSrcweir     }
378cdf0e10cSrcweir 
379cdf0e10cSrcweir     if( xSelectionSupplier.is() )
380cdf0e10cSrcweir     {
381cdf0e10cSrcweir         ObjectIdentifier aSelectedOID( xSelectionSupplier->getSelection() );
382cdf0e10cSrcweir         if ( m_aCurrentSelectionOID.isValid() )
383cdf0e10cSrcweir         {
384cdf0e10cSrcweir             NotifyEvent( LOST_SELECTION, m_aCurrentSelectionOID );
385cdf0e10cSrcweir         }
386cdf0e10cSrcweir         if( aSelectedOID.isValid() )
387cdf0e10cSrcweir         {
388cdf0e10cSrcweir             NotifyEvent( GOT_SELECTION, aSelectedOID );
389cdf0e10cSrcweir         }
390cdf0e10cSrcweir         m_aCurrentSelectionOID = aSelectedOID;
391cdf0e10cSrcweir     }
392cdf0e10cSrcweir }
393cdf0e10cSrcweir 
394cdf0e10cSrcweir //-------------------------------------------------------------------------
395cdf0e10cSrcweir // lang::XComponent::dispose()
396cdf0e10cSrcweir //-------------------------------------------------------------------------
disposing()397cdf0e10cSrcweir void SAL_CALL AccessibleChartView::disposing()
398cdf0e10cSrcweir {
399cdf0e10cSrcweir     AccessibleBase::disposing();
400cdf0e10cSrcweir }
401cdf0e10cSrcweir 
402cdf0e10cSrcweir //-------------------------------------------------------------------------
403cdf0e10cSrcweir // XEventListener
404cdf0e10cSrcweir //-------------------------------------------------------------------------
disposing(const lang::EventObject &)405cdf0e10cSrcweir void SAL_CALL AccessibleChartView::disposing( const lang::EventObject& /*Source*/ )
406cdf0e10cSrcweir     throw (uno::RuntimeException)
407cdf0e10cSrcweir {
408cdf0e10cSrcweir }
409cdf0e10cSrcweir 
410cdf0e10cSrcweir //.............................................................................
411cdf0e10cSrcweir } //namespace chart
412cdf0e10cSrcweir //.............................................................................
413