Update ooo320-m1
[ooovba.git] / svx / source / accessibility / AccessibleImageBullet.cxx
blob9212b9dd40f1bf9f41ee86a03d1896f2c7d24a99
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: AccessibleImageBullet.cxx,v $
10 * $Revision: 1.22 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_svx.hxx"
33 #include <tools/gen.hxx>
34 #include <vos/mutex.hxx>
35 #include <vcl/svapp.hxx>
36 #include <rtl/ustring.hxx>
37 #include <com/sun/star/awt/Point.hpp>
38 #include <com/sun/star/awt/Rectangle.hpp>
39 #include <com/sun/star/lang/DisposedException.hpp>
40 #include <com/sun/star/accessibility/AccessibleRole.hpp>
41 #include <com/sun/star/accessibility/AccessibleTextType.hpp>
42 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
43 #include <com/sun/star/accessibility/AccessibleEventId.hpp>
44 #include <comphelper/accessibleeventnotifier.hxx>
45 #include <unotools/accessiblestatesethelper.hxx>
46 #include "unolingu.hxx"
47 #include "AccessibleEditableTextPara.hxx"
48 #include "AccessibleImageBullet.hxx"
49 #include <svx/dialmgr.hxx>
51 #include <svx/editdata.hxx>
52 #include <svx/editeng.hxx>
53 #include <svx/outliner.hxx>
54 #include "accessibility.hrc"
55 #include <svtools/colorcfg.hxx>
58 using namespace ::com::sun::star;
59 using namespace ::com::sun::star::accessibility;
61 namespace accessibility
63 DBG_NAME( AccessibleImageBullet )
65 AccessibleImageBullet::AccessibleImageBullet ( const uno::Reference< XAccessible >& rParent ) :
66 mnParagraphIndex( 0 ),
67 mnIndexInParent( 0 ),
68 mpEditSource( NULL ),
69 maEEOffset( 0, 0 ),
70 mxParent( rParent ),
71 // well, that's strictly (UNO) exception safe, though not
72 // really robust. We rely on the fact that this member is
73 // constructed last, and that the constructor body catches
74 // exceptions, thus no chance for exceptions once the Id is
75 // fetched. Nevertheless, normally should employ RAII here...
76 mnNotifierClientId(::comphelper::AccessibleEventNotifier::registerClient())
78 #ifdef DBG_UTIL
79 DBG_CTOR( AccessibleImageBullet, NULL );
80 OSL_TRACE( "Received ID: %d", mnNotifierClientId );
81 #endif
83 try
85 // Create the state set.
86 ::utl::AccessibleStateSetHelper* pStateSet = new ::utl::AccessibleStateSetHelper ();
87 mxStateSet = pStateSet;
89 // these are always on
90 pStateSet->AddState( AccessibleStateType::VISIBLE );
91 pStateSet->AddState( AccessibleStateType::SHOWING );
92 pStateSet->AddState( AccessibleStateType::ENABLED );
93 pStateSet->AddState( AccessibleStateType::SENSITIVE );
95 catch( const uno::Exception& ) {}
98 AccessibleImageBullet::~AccessibleImageBullet()
100 DBG_DTOR( AccessibleImageBullet, NULL );
102 // sign off from event notifier
103 if( getNotifierClientId() != -1 )
107 ::comphelper::AccessibleEventNotifier::revokeClient( getNotifierClientId() );
108 #ifdef DBG_UTIL
109 OSL_TRACE( "AccessibleImageBullet revoked ID: %d\n", mnNotifierClientId );
110 #endif
112 catch( const uno::Exception& ) {}
116 uno::Any SAL_CALL AccessibleImageBullet::queryInterface (const uno::Type & rType) throw (uno::RuntimeException)
118 DBG_CHKTHIS( AccessibleImageBullet, NULL );
120 return AccessibleImageBulletInterfaceBase::queryInterface(rType);
123 uno::Reference< XAccessibleContext > SAL_CALL AccessibleImageBullet::getAccessibleContext( ) throw (uno::RuntimeException)
125 DBG_CHKTHIS( AccessibleImageBullet, NULL );
127 // We implement the XAccessibleContext interface in the same object
128 return uno::Reference< XAccessibleContext > ( this );
131 sal_Int32 SAL_CALL AccessibleImageBullet::getAccessibleChildCount() throw (uno::RuntimeException)
133 DBG_CHKTHIS( AccessibleImageBullet, NULL );
135 return 0;
138 uno::Reference< XAccessible > SAL_CALL AccessibleImageBullet::getAccessibleChild( sal_Int32 i ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
140 DBG_CHKTHIS( AccessibleImageBullet, NULL );
141 (void)i;
143 throw lang::IndexOutOfBoundsException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("No childs available")),
144 uno::Reference< uno::XInterface >
145 ( static_cast< ::cppu::OWeakObject* > (this) ) ); // static_cast: disambiguate hierarchy
148 uno::Reference< XAccessible > SAL_CALL AccessibleImageBullet::getAccessibleParent() throw (uno::RuntimeException)
150 DBG_CHKTHIS( AccessibleImageBullet, NULL );
152 return mxParent;
155 sal_Int32 SAL_CALL AccessibleImageBullet::getAccessibleIndexInParent() throw (uno::RuntimeException)
157 DBG_CHKTHIS( AccessibleImageBullet, NULL );
159 return mnIndexInParent;
162 sal_Int16 SAL_CALL AccessibleImageBullet::getAccessibleRole() throw (uno::RuntimeException)
164 DBG_CHKTHIS( AccessibleImageBullet, NULL );
166 return AccessibleRole::GRAPHIC;
169 ::rtl::OUString SAL_CALL AccessibleImageBullet::getAccessibleDescription() throw (uno::RuntimeException)
171 DBG_CHKTHIS( AccessibleImageBullet, NULL );
173 ::vos::OGuard aGuard( Application::GetSolarMutex() );
175 // Get the string from the resource for the specified id.
176 return ::rtl::OUString( SVX_RESSTR (RID_SVXSTR_A11Y_IMAGEBULLET_DESCRIPTION) );
179 ::rtl::OUString SAL_CALL AccessibleImageBullet::getAccessibleName() throw (uno::RuntimeException)
181 DBG_CHKTHIS( AccessibleImageBullet, NULL );
183 ::vos::OGuard aGuard( Application::GetSolarMutex() );
185 // Get the string from the resource for the specified id.
186 return ::rtl::OUString( SVX_RESSTR (RID_SVXSTR_A11Y_IMAGEBULLET_NAME) );
189 uno::Reference< XAccessibleRelationSet > SAL_CALL AccessibleImageBullet::getAccessibleRelationSet() throw (uno::RuntimeException)
191 DBG_CHKTHIS( AccessibleImageBullet, NULL );
193 // no relations, therefore empty
194 return uno::Reference< XAccessibleRelationSet >();
197 uno::Reference< XAccessibleStateSet > SAL_CALL AccessibleImageBullet::getAccessibleStateSet() throw (uno::RuntimeException)
199 DBG_CHKTHIS( AccessibleImageBullet, NULL );
201 ::vos::OGuard aGuard( Application::GetSolarMutex() );
203 // Create a copy of the state set and return it.
204 ::utl::AccessibleStateSetHelper* pStateSet = static_cast< ::utl::AccessibleStateSetHelper*>(mxStateSet.get());
206 if( !pStateSet )
207 return uno::Reference<XAccessibleStateSet>();
209 return uno::Reference<XAccessibleStateSet>( new ::utl::AccessibleStateSetHelper (*pStateSet) );
212 lang::Locale SAL_CALL AccessibleImageBullet::getLocale() throw (IllegalAccessibleComponentStateException, uno::RuntimeException)
214 DBG_CHKTHIS( AccessibleImageBullet, NULL );
216 ::vos::OGuard aGuard( Application::GetSolarMutex() );
218 lang::Locale aLocale;
220 DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= USHRT_MAX,
221 "AccessibleImageBullet::getLocale: paragraph index value overflow");
223 // return locale of first character in the paragraph
224 return SvxLanguageToLocale(aLocale, GetTextForwarder().GetLanguage( static_cast< USHORT >( GetParagraphIndex() ), 0 ));
227 void SAL_CALL AccessibleImageBullet::addEventListener( const uno::Reference< XAccessibleEventListener >& xListener ) throw (uno::RuntimeException)
229 DBG_CHKTHIS( AccessibleImageBullet, NULL );
231 if( getNotifierClientId() != -1 )
232 ::comphelper::AccessibleEventNotifier::addEventListener( getNotifierClientId(), xListener );
235 void SAL_CALL AccessibleImageBullet::removeEventListener( const uno::Reference< XAccessibleEventListener >& xListener ) throw (uno::RuntimeException)
237 DBG_CHKTHIS( AccessibleImageBullet, NULL );
239 if( getNotifierClientId() != -1 )
240 ::comphelper::AccessibleEventNotifier::removeEventListener( getNotifierClientId(), xListener );
243 sal_Bool SAL_CALL AccessibleImageBullet::containsPoint( const awt::Point& rPoint ) throw (uno::RuntimeException)
245 DBG_CHKTHIS( AccessibleImageBullet, NULL );
247 ::vos::OGuard aGuard( Application::GetSolarMutex() );
249 DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= USHRT_MAX,
250 "AccessibleEditableTextPara::contains: index value overflow");
252 awt::Rectangle aTmpRect = getBounds();
253 Rectangle aRect( Point(aTmpRect.X, aTmpRect.Y), Size(aTmpRect.Width, aTmpRect.Height) );
254 Point aPoint( rPoint.X, rPoint.Y );
256 return aRect.IsInside( aPoint );
259 uno::Reference< XAccessible > SAL_CALL AccessibleImageBullet::getAccessibleAtPoint( const awt::Point& /*aPoint*/ ) throw (uno::RuntimeException)
261 DBG_CHKTHIS( AccessibleImageBullet, NULL );
263 // as we have no children, empty reference
264 return uno::Reference< XAccessible >();
267 awt::Rectangle SAL_CALL AccessibleImageBullet::getBounds( ) throw (uno::RuntimeException)
269 DBG_CHKTHIS( AccessibleImageBullet, NULL );
271 ::vos::OGuard aGuard( Application::GetSolarMutex() );
273 DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= USHRT_MAX,
274 "AccessibleEditableTextPara::getBounds: index value overflow");
276 SvxTextForwarder& rCacheTF = GetTextForwarder();
277 EBulletInfo aBulletInfo = rCacheTF.GetBulletInfo( static_cast< USHORT > (GetParagraphIndex()) );
278 Rectangle aParentRect = rCacheTF.GetParaBounds( static_cast< USHORT >( GetParagraphIndex() ) );
280 if( aBulletInfo.nParagraph != EE_PARA_NOT_FOUND &&
281 aBulletInfo.bVisible &&
282 aBulletInfo.nType == SVX_NUM_BITMAP )
284 Rectangle aRect = aBulletInfo.aBounds;
286 // subtract paragraph position (bullet pos is absolute in EditEngine/Outliner)
287 aRect.Move( -aParentRect.Left(), -aParentRect.Top() );
289 // convert to screen coordinates
290 Rectangle aScreenRect = AccessibleEditableTextPara::LogicToPixel( aRect,
291 rCacheTF.GetMapMode(),
292 GetViewForwarder() );
294 // offset from shape/cell
295 Point aOffset = GetEEOffset();
297 return awt::Rectangle( aScreenRect.Left() + aOffset.X(),
298 aScreenRect.Top() + aOffset.Y(),
299 aScreenRect.GetSize().Width(),
300 aScreenRect.GetSize().Height() );
303 return awt::Rectangle();
306 awt::Point SAL_CALL AccessibleImageBullet::getLocation( ) throw (uno::RuntimeException)
308 DBG_CHKTHIS( AccessibleImageBullet, NULL );
310 ::vos::OGuard aGuard( Application::GetSolarMutex() );
312 awt::Rectangle aRect = getBounds();
314 return awt::Point( aRect.X, aRect.Y );
317 awt::Point SAL_CALL AccessibleImageBullet::getLocationOnScreen( ) throw (uno::RuntimeException)
319 DBG_CHKTHIS( AccessibleImageBullet, NULL );
321 ::vos::OGuard aGuard( Application::GetSolarMutex() );
323 // relate us to parent
324 uno::Reference< XAccessible > xParent = getAccessibleParent();
325 if( xParent.is() )
327 uno::Reference< XAccessibleComponent > xParentComponent( xParent, uno::UNO_QUERY );
328 if( xParentComponent.is() )
330 awt::Point aRefPoint = xParentComponent->getLocationOnScreen();
331 awt::Point aPoint = getLocation();
332 aPoint.X += aRefPoint.X;
333 aPoint.Y += aRefPoint.Y;
335 return aPoint;
339 throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Cannot access parent")),
340 uno::Reference< uno::XInterface >
341 ( static_cast< XAccessible* > (this) ) ); // disambiguate hierarchy
344 awt::Size SAL_CALL AccessibleImageBullet::getSize( ) throw (uno::RuntimeException)
346 DBG_CHKTHIS( AccessibleImageBullet, NULL );
348 ::vos::OGuard aGuard( Application::GetSolarMutex() );
350 awt::Rectangle aRect = getBounds();
352 return awt::Size( aRect.Width, aRect.Height );
355 void SAL_CALL AccessibleImageBullet::grabFocus( ) throw (uno::RuntimeException)
357 DBG_CHKTHIS( AccessibleImageBullet, NULL );
359 throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Not focusable")),
360 uno::Reference< uno::XInterface >
361 ( static_cast< XAccessible* > (this) ) ); // disambiguate hierarchy
364 sal_Int32 SAL_CALL AccessibleImageBullet::getForeground( ) throw (::com::sun::star::uno::RuntimeException)
366 DBG_CHKTHIS( AccessibleImageBullet, NULL );
368 // #104444# Added to XAccessibleComponent interface
369 svtools::ColorConfig aColorConfig;
370 UINT32 nColor = aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor;
371 return static_cast<sal_Int32>(nColor);
374 sal_Int32 SAL_CALL AccessibleImageBullet::getBackground( ) throw (::com::sun::star::uno::RuntimeException)
376 DBG_CHKTHIS( AccessibleImageBullet, NULL );
378 // #104444# Added to XAccessibleComponent interface
379 Color aColor( Application::GetSettings().GetStyleSettings().GetWindowColor().GetColor() );
381 // the background is transparent
382 aColor.SetTransparency( 0xFF);
384 return static_cast<sal_Int32>( aColor.GetColor() );
387 ::rtl::OUString SAL_CALL AccessibleImageBullet::getImplementationName (void) throw (uno::RuntimeException)
389 DBG_CHKTHIS( AccessibleImageBullet, NULL );
391 return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM ("AccessibleImageBullet"));
394 sal_Bool SAL_CALL AccessibleImageBullet::supportsService (const ::rtl::OUString& sServiceName) throw (uno::RuntimeException)
396 DBG_CHKTHIS( AccessibleImageBullet, NULL );
398 // Iterate over all supported service names and return true if on of them
399 // matches the given name.
400 uno::Sequence< ::rtl::OUString> aSupportedServices (
401 getSupportedServiceNames ());
402 for (int i=0; i<aSupportedServices.getLength(); i++)
403 if (sServiceName == aSupportedServices[i])
404 return sal_True;
405 return sal_False;
408 uno::Sequence< ::rtl::OUString> SAL_CALL AccessibleImageBullet::getSupportedServiceNames (void) throw (uno::RuntimeException)
410 DBG_CHKTHIS( AccessibleImageBullet, NULL );
412 const ::rtl::OUString sServiceName (RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.accessibility.AccessibleContext"));
413 return uno::Sequence< ::rtl::OUString > (&sServiceName, 1);
416 ::rtl::OUString SAL_CALL AccessibleImageBullet::getServiceName (void) throw (uno::RuntimeException)
418 DBG_CHKTHIS( AccessibleImageBullet, NULL );
420 return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.accessibility.AccessibleContext"));
423 void AccessibleImageBullet::SetIndexInParent( sal_Int32 nIndex )
425 DBG_CHKTHIS( AccessibleImageBullet, NULL );
427 mnIndexInParent = nIndex;
430 sal_Int32 AccessibleImageBullet::GetIndexInParent() const
432 DBG_CHKTHIS( AccessibleImageBullet, NULL );
434 return mnIndexInParent;
437 void AccessibleImageBullet::SetEEOffset( const Point& rOffset )
439 DBG_CHKTHIS( AccessibleImageBullet, NULL );
441 maEEOffset = rOffset;
444 void AccessibleImageBullet::Dispose()
446 DBG_CHKTHIS( AccessibleImageBullet, NULL );
448 int nClientId( getNotifierClientId() );
450 // #108212# drop all references before notifying dispose
451 mxParent = NULL;
452 mnNotifierClientId = -1;
453 mpEditSource = NULL;
455 // notify listeners
456 if( nClientId != -1 )
460 uno::Reference < XAccessibleContext > xThis = getAccessibleContext();
462 // #106234# Delegate to EventNotifier
463 ::comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing( nClientId, xThis );
464 #ifdef DBG_UTIL
465 OSL_TRACE( "AccessibleImageBullet disposed ID: %d", nClientId );
466 #endif
468 catch( const uno::Exception& ) {}
472 void AccessibleImageBullet::SetEditSource( SvxEditSource* pEditSource )
474 DBG_CHKTHIS( AccessibleImageBullet, NULL );
476 mpEditSource = pEditSource;
478 if( !mpEditSource )
480 // going defunc
481 UnSetState( AccessibleStateType::SHOWING );
482 UnSetState( AccessibleStateType::VISIBLE );
483 SetState( AccessibleStateType::INVALID );
484 SetState( AccessibleStateType::DEFUNC );
486 Dispose();
490 void AccessibleImageBullet::FireEvent(const sal_Int16 nEventId, const uno::Any& rNewValue, const uno::Any& rOldValue ) const
492 DBG_CHKTHIS( AccessibleImageBullet, NULL );
494 uno::Reference < XAccessibleContext > xThis( const_cast< AccessibleImageBullet* > (this)->getAccessibleContext() );
496 AccessibleEventObject aEvent(xThis, nEventId, rNewValue, rOldValue);
498 // #106234# Delegate to EventNotifier
499 ::comphelper::AccessibleEventNotifier::addEvent( getNotifierClientId(),
500 aEvent );
503 void AccessibleImageBullet::GotPropertyEvent( const uno::Any& rNewValue, const sal_Int16 nEventId ) const
505 DBG_CHKTHIS( AccessibleImageBullet, NULL );
507 FireEvent( nEventId, rNewValue );
510 void AccessibleImageBullet::LostPropertyEvent( const uno::Any& rOldValue, const sal_Int16 nEventId ) const
512 DBG_CHKTHIS( AccessibleImageBullet, NULL );
514 FireEvent( nEventId, uno::Any(), rOldValue );
517 void AccessibleImageBullet::SetState( const sal_Int16 nStateId )
519 DBG_CHKTHIS( AccessibleImageBullet, NULL );
521 ::utl::AccessibleStateSetHelper* pStateSet = static_cast< ::utl::AccessibleStateSetHelper*>(mxStateSet.get());
522 if( pStateSet != NULL &&
523 !pStateSet->contains(nStateId) )
525 pStateSet->AddState( nStateId );
526 GotPropertyEvent( uno::makeAny( nStateId ), AccessibleEventId::STATE_CHANGED );
530 void AccessibleImageBullet::UnSetState( const sal_Int16 nStateId )
532 DBG_CHKTHIS( AccessibleImageBullet, NULL );
534 ::utl::AccessibleStateSetHelper* pStateSet = static_cast< ::utl::AccessibleStateSetHelper*>(mxStateSet.get());
535 if( pStateSet != NULL &&
536 pStateSet->contains(nStateId) )
538 pStateSet->RemoveState( nStateId );
539 LostPropertyEvent( uno::makeAny( nStateId ), AccessibleEventId::STATE_CHANGED );
543 int AccessibleImageBullet::getNotifierClientId() const
545 DBG_CHKTHIS( AccessibleImageBullet, NULL );
547 return mnNotifierClientId;
550 void AccessibleImageBullet::SetParagraphIndex( sal_Int32 nIndex )
552 DBG_CHKTHIS( AccessibleImageBullet, NULL );
554 uno::Any aOldDesc;
555 uno::Any aOldName;
559 aOldDesc <<= getAccessibleDescription();
560 aOldName <<= getAccessibleName();
562 catch( const uno::Exception& ) {} // optional behaviour
564 sal_Int32 nOldIndex = mnParagraphIndex;
566 mnParagraphIndex = nIndex;
570 if( nOldIndex != nIndex )
572 // index and therefore description changed
573 FireEvent( AccessibleEventId::DESCRIPTION_CHANGED, uno::makeAny( getAccessibleDescription() ), aOldDesc );
574 FireEvent( AccessibleEventId::NAME_CHANGED, uno::makeAny( getAccessibleName() ), aOldName );
577 catch( const uno::Exception& ) {} // optional behaviour
580 sal_Int32 AccessibleImageBullet::GetParagraphIndex() const SAL_THROW((uno::RuntimeException))
582 DBG_CHKTHIS( AccessibleImageBullet, NULL );
584 return mnParagraphIndex;
587 SvxEditSource& AccessibleImageBullet::GetEditSource() const SAL_THROW((uno::RuntimeException))
589 DBG_CHKTHIS( AccessibleImageBullet, NULL );
591 if( mpEditSource )
592 return *mpEditSource;
593 else
594 throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("No edit source, object is defunct")),
595 uno::Reference< uno::XInterface >
596 ( static_cast< ::cppu::OWeakObject* >
597 ( const_cast< AccessibleImageBullet* > (this) ) ) ); // disambiguate hierarchy
600 SvxTextForwarder& AccessibleImageBullet::GetTextForwarder() const SAL_THROW((uno::RuntimeException))
602 DBG_CHKTHIS( AccessibleImageBullet, NULL );
604 SvxEditSource& rEditSource = GetEditSource();
605 SvxTextForwarder* pTextForwarder = rEditSource.GetTextForwarder();
607 if( !pTextForwarder )
608 throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Unable to fetch text forwarder, object is defunct")),
609 uno::Reference< uno::XInterface >
610 ( static_cast< ::cppu::OWeakObject* >
611 ( const_cast< AccessibleImageBullet* > (this) ) ) ); // disambiguate hierarchy
613 if( pTextForwarder->IsValid() )
614 return *pTextForwarder;
615 else
616 throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Text forwarder is invalid, object is defunct")),
617 uno::Reference< uno::XInterface >
618 ( static_cast< ::cppu::OWeakObject* >
619 ( const_cast< AccessibleImageBullet* > (this) ) ) ); // disambiguate hierarchy
622 SvxViewForwarder& AccessibleImageBullet::GetViewForwarder() const SAL_THROW((uno::RuntimeException))
624 DBG_CHKTHIS( AccessibleImageBullet, NULL );
626 SvxEditSource& rEditSource = GetEditSource();
627 SvxViewForwarder* pViewForwarder = rEditSource.GetViewForwarder();
629 if( !pViewForwarder )
631 throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Unable to fetch view forwarder, object is defunct")),
632 uno::Reference< uno::XInterface >
633 ( static_cast< ::cppu::OWeakObject* >
634 ( const_cast< AccessibleImageBullet* > (this) ) ) ); // disambiguate hierarchy
637 if( pViewForwarder->IsValid() )
638 return *pViewForwarder;
639 else
640 throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("View forwarder is invalid, object is defunct")),
641 uno::Reference< uno::XInterface >
642 ( static_cast< ::cppu::OWeakObject* >
643 ( const_cast< AccessibleImageBullet* > (this) ) ) ); // disambiguate hierarchy
646 const Point& AccessibleImageBullet::GetEEOffset() const
648 DBG_CHKTHIS( AccessibleImageBullet, NULL );
650 return maEEOffset;
653 } // end of namespace accessibility