summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--svx/prj/d.lst2
-rwxr-xr-xsvx/source/accessibility/AccessibleShape.cxx6
-rw-r--r--svx/source/accessibility/AccessibleTextHelper.cxx1514
3 files changed, 774 insertions, 748 deletions
diff --git a/svx/prj/d.lst b/svx/prj/d.lst
index 382eaa31754a..61983ecd3d25 100644
--- a/svx/prj/d.lst
+++ b/svx/prj/d.lst
@@ -525,7 +525,7 @@ hedabu: ..\inc\deflt3d.hxx %_DEST%\inc%_EXT%\svx\deflt3d.hxx
hedabu: ..\inc\unotext.hxx %_DEST%\inc%_EXT%\svx\unotext.hxx
hedabu: ..\inc\unofield.hxx %_DEST%\inc%_EXT%\svx\unofield.hxx
hedabu: ..\source\inc\mutxhelp.hxx %_DEST%\inc%_EXT%\svx\mutxhelp.hxx
-hedabu: ..\inc\unoedacc.hxx %_DEST%\inc%_EXT%\svx\unoedacc.hxx
+hedabu: ..\inc\AccessibleTextHelper.hxx %_DEST%\inc%_EXT%\svx\AccessibleTextHelper.hxx
hedabu: ..\inc\unoviwed.hxx %_DEST%\inc%_EXT%\svx\unoviwed.hxx
hedabu: ..\inc\unoviwou.hxx %_DEST%\inc%_EXT%\svx\unoviwou.hxx
hedabu: ..\inc\unoedsrc.hxx %_DEST%\inc%_EXT%\svx\unoedsrc.hxx
diff --git a/svx/source/accessibility/AccessibleShape.cxx b/svx/source/accessibility/AccessibleShape.cxx
index b3960eae4ac9..2bd98a8ec71b 100755
--- a/svx/source/accessibility/AccessibleShape.cxx
+++ b/svx/source/accessibility/AccessibleShape.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: AccessibleShape.cxx,v $
*
- * $Revision: 1.19 $
+ * $Revision: 1.20 $
*
- * last change: $Author: af $ $Date: 2002-05-17 16:10:31 $
+ * last change: $Author: thb $ $Date: 2002-05-17 19:10:58 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -203,7 +203,7 @@ void AccessibleShape::Init (void)
{
SvxEditSource* pEditSource = new SvxTextEditSource (
*GetSdrObjectFromXShape (mxShape), *pView, *pWindow);
- mpText = new SvxAccessibleTextHelper (
+ mpText = new AccessibleTextHelper (
this,
::std::auto_ptr<SvxEditSource>(pEditSource));
}
diff --git a/svx/source/accessibility/AccessibleTextHelper.cxx b/svx/source/accessibility/AccessibleTextHelper.cxx
index cda414c7e1f7..920643215704 100644
--- a/svx/source/accessibility/AccessibleTextHelper.cxx
+++ b/svx/source/accessibility/AccessibleTextHelper.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: AccessibleTextHelper.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: thb $ $Date: 2002-05-17 17:34:45 $
+ * last change: $Author: thb $ $Date: 2002-05-17 19:09:14 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -142,8 +142,8 @@
//
//------------------------------------------------------------------------
-#ifndef _SVX_UNOEDACC_HXX_
-#include "unoedacc.hxx"
+#ifndef _SVX_ACCESSILE_TEXT_HELPER_HXX_
+#include "AccessibleTextHelper.hxx"
#endif
#ifndef _SVX_UNOSHAPE_HXX
@@ -171,1045 +171,1071 @@
using namespace ::com::sun::star;
using namespace ::drafts::com::sun::star::accessibility;
+namespace accessibility
+{
//------------------------------------------------------------------------
//
-// SvxAccessibleTextHelper_Impl declaration
+// AccessibleTextHelper_Impl declaration
//
//------------------------------------------------------------------------
-class SvxAccessibleTextHelper_Impl : public SfxListener
-{
+ class AccessibleTextHelper_Impl : public SfxListener
+ {
-public:
+ public:
- // receive pointer to our frontend class and view window
- SvxAccessibleTextHelper_Impl( const uno::Reference< XAccessible >& rInterface );
- ~SvxAccessibleTextHelper_Impl();
+ // receive pointer to our frontend class and view window
+ AccessibleTextHelper_Impl( const uno::Reference< XAccessible >& rInterface );
+ ~AccessibleTextHelper_Impl();
- // XAccessibleContext child handling methods
- sal_Int32 SAL_CALL getAccessibleChildCount() throw (uno::RuntimeException);
- uno::Reference< XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException);
+ // XAccessibleContext child handling methods
+ sal_Int32 SAL_CALL getAccessibleChildCount() throw (uno::RuntimeException);
+ uno::Reference< XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException);
- // XAccessibleEventBroadcaster child related methods
- void SAL_CALL addEventListener( const uno::Reference< XAccessibleEventListener >& xListener ) throw (uno::RuntimeException);
- void SAL_CALL removeEventListener( const uno::Reference< XAccessibleEventListener >& xListener ) throw (uno::RuntimeException);
+ // XAccessibleEventBroadcaster child related methods
+ void SAL_CALL addEventListener( const uno::Reference< XAccessibleEventListener >& xListener ) throw (uno::RuntimeException);
+ void SAL_CALL removeEventListener( const uno::Reference< XAccessibleEventListener >& xListener ) throw (uno::RuntimeException);
- // XAccessibleComponent child related methods
- uno::Reference< XAccessible > SAL_CALL getAccessibleAt( const awt::Point& aPoint ) throw (uno::RuntimeException);
+ // XAccessibleComponent child related methods
+ uno::Reference< XAccessible > SAL_CALL getAccessibleAt( const awt::Point& aPoint ) throw (uno::RuntimeException);
- SvxEditSourceAdapter& GetEditSource() const throw (uno::RuntimeException);
- void SetEditSource( ::std::auto_ptr< SvxEditSource > pEditSource ) throw (uno::RuntimeException);
+ SvxEditSourceAdapter& GetEditSource() const throw (uno::RuntimeException);
+ void SetEditSource( ::std::auto_ptr< SvxEditSource > pEditSource ) throw (uno::RuntimeException);
- void SetOffset( const Point& );
- const Point& GetOffset() const { return maOffset; } // Strictly correct only with locked solar mutex!
+ void SetOffset( const Point& );
+ const Point& GetOffset() const { return maOffset; } // Strictly correct only with locked solar mutex!
- sal_Bool IsSelected() const;
+ sal_Bool IsSelected() const;
- // do NOT hold object mutex when calling this! Danger of deadlock
- void FireEvent( const sal_Int16 nEventId, const uno::Any& rNewValue = uno::Any(), const uno::Any& rOldValue = uno::Any() ) const;
+ // do NOT hold object mutex when calling this! Danger of deadlock
+ void FireEvent( const sal_Int16 nEventId, const uno::Any& rNewValue = uno::Any(), const uno::Any& rOldValue = uno::Any() ) const;
#ifdef DBG_UTIL
- void CheckInvariants() const;
+ void CheckInvariants() const;
#endif
- // checks all children for visibility, throws away invisible ones
- void UpdateVisibleChildren();
-
-private:
-
- // syntactic sugar for FireEvent
- void GotPropertyEvent( const uno::Any& rNewValue, const sal_Int16 nEventId ) const { FireEvent( nEventId, rNewValue ); }
- void LostPropertyEvent( const uno::Any& rOldValue, const sal_Int16 nEventId ) const { FireEvent( nEventId, uno::Any(), rOldValue ); }
+ // checks all children for visibility, throws away invisible ones
+ void UpdateVisibleChildren();
- // shutdown usage of current edit source on myself and the children.
- void ShutdownEditSource() throw (uno::RuntimeException);
+ private:
- virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+ // syntactic sugar for FireEvent
+ void GotPropertyEvent( const uno::Any& rNewValue, const sal_Int16 nEventId ) const { FireEvent( nEventId, rNewValue ); }
+ void LostPropertyEvent( const uno::Any& rOldValue, const sal_Int16 nEventId ) const { FireEvent( nEventId, uno::Any(), rOldValue ); }
- // lock solar mutex before
- SvxTextForwarder& GetTextForwarder() const throw (uno::RuntimeException);
- // lock solar mutex before
- SvxViewForwarder& GetViewForwarder() const throw (uno::RuntimeException);
- // lock solar mutex before
- SvxEditViewForwarder& GetEditViewForwarder( sal_Bool bCreate = sal_False ) const throw (uno::RuntimeException);
+ // shutdown usage of current edit source on myself and the children.
+ void ShutdownEditSource() throw (uno::RuntimeException);
- // are we in edit mode?
- sal_Bool IsActive() const throw (uno::RuntimeException);
+ virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
- void UpdateVisibleData();
+ // lock solar mutex before
+ SvxTextForwarder& GetTextForwarder() const throw (uno::RuntimeException);
+ // lock solar mutex before
+ SvxViewForwarder& GetViewForwarder() const throw (uno::RuntimeException);
+ // lock solar mutex before
+ SvxEditViewForwarder& GetEditViewForwarder( sal_Bool bCreate = sal_False ) const throw (uno::RuntimeException);
- // calls SetSelection on the forwarder and updates maLastSelection
- // cache. Caution: calls StateChangeEvent and sets object into
- // edit mode!
- void UpdateSelection( const ESelection& );
+ // are we in edit mode?
+ sal_Bool IsActive() const throw (uno::RuntimeException);
- /// our current offset to the containing shape/cell (guarded by solar mutex)
- Point maOffset;
+ void UpdateVisibleData();
- // our frontend class (the one implementing the actual
- // interface). That's not necessarily the one containing the impl
- // pointer!
- const uno::Reference< XAccessible > mxFrontEnd;
+ // calls SetSelection on the forwarder and updates maLastSelection
+ // cache. Caution: calls StateChangeEvent and sets object into
+ // edit mode!
+ void UpdateSelection( const ESelection& );
- // a wrapper for the text forwarders (guarded by solar mutex)
- mutable SvxEditSourceAdapter maEditSource;
+ /// our current offset to the containing shape/cell (guarded by solar mutex)
+ Point maOffset;
- // store last selection (to correctly report selection changes, guarded by solar mutex)
- ESelection maLastSelection;
+ // our frontend class (the one implementing the actual
+ // interface). That's not necessarily the one containing the impl
+ // pointer!
+ const uno::Reference< XAccessible > mxFrontEnd;
- // cache range of visible children (guarded by solar mutex)
- sal_Int32 mnFirstVisibleChild;
- sal_Int32 mnLastVisibleChild;
+ // a wrapper for the text forwarders (guarded by solar mutex)
+ mutable SvxEditSourceAdapter maEditSource;
- // the object handling our children (guarded by solar mutex)
- accessibility::AccessibleParaManager maParaManager;
+ // store last selection (to correctly report selection changes, guarded by solar mutex)
+ ESelection maLastSelection;
- // spin lock to prevent notify in notify
- sal_Bool mbInNotify;
+ // cache range of visible children (guarded by solar mutex)
+ sal_Int32 mnFirstVisibleChild;
+ sal_Int32 mnLastVisibleChild;
- // must be before maStateListeners, has to live longer
- mutable ::osl::Mutex maMutex;
+ // the object handling our children (guarded by solar mutex)
+ accessibility::AccessibleParaManager maParaManager;
- // handles our event listeners (guarded by maMutex)
- ::cppu::OInterfaceContainerHelper maStateListeners;
+ // spin lock to prevent notify in notify
+ sal_Bool mbInNotify;
-};
+ // must be before maStateListeners, has to live longer
+ mutable ::osl::Mutex maMutex;
-//------------------------------------------------------------------------
-//
-// SvxAccessibleTextHelper_Impl implementation
-//
-//------------------------------------------------------------------------
+ // handles our event listeners (guarded by maMutex)
+ ::cppu::OInterfaceContainerHelper maStateListeners;
-SvxAccessibleTextHelper_Impl::SvxAccessibleTextHelper_Impl( const uno::Reference< XAccessible >& rInterface ) :
- maOffset(0,0),
- mxFrontEnd( rInterface ),
- maLastSelection( 0,0,0,0 ),
- mnFirstVisibleChild( -1 ),
- mnLastVisibleChild( -2 ),
- mbInNotify( sal_False ),
- maStateListeners( maMutex )
-{
-}
+ };
-SvxAccessibleTextHelper_Impl::~SvxAccessibleTextHelper_Impl()
-{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ //------------------------------------------------------------------------
+ //
+ // AccessibleTextHelper_Impl implementation
+ //
+ //------------------------------------------------------------------------
- try
+ AccessibleTextHelper_Impl::AccessibleTextHelper_Impl( const uno::Reference< XAccessible >& rInterface ) :
+ maOffset(0,0),
+ mxFrontEnd( rInterface ),
+ maLastSelection( 0,0,0,0 ),
+ mnFirstVisibleChild( -1 ),
+ mnLastVisibleChild( -2 ),
+ mbInNotify( sal_False ),
+ maStateListeners( maMutex )
{
- // shutdown and release edit source
- SetEditSource( ::std::auto_ptr< SvxEditSource >() );
}
- catch( const uno::RuntimeException& ) {}
- // owner is responsible for dispose and clear on listeners
-}
+ AccessibleTextHelper_Impl::~AccessibleTextHelper_Impl()
+ {
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
-SvxTextForwarder& SvxAccessibleTextHelper_Impl::GetTextForwarder() const throw (uno::RuntimeException)
-{
- if( !maEditSource.IsValid() )
- throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown edit source")), mxFrontEnd);
+ try
+ {
+ // shutdown and release edit source
+ SetEditSource( ::std::auto_ptr< SvxEditSource >() );
+ }
+ catch( const uno::RuntimeException& ) {}
- SvxTextForwarder* pTextForwarder = maEditSource.GetTextForwarder();
+ // owner is responsible for dispose and clear on listeners
+ }
- if( !pTextForwarder )
- throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Unable to fetch text forwarder, model might be dead")), mxFrontEnd);
+ SvxTextForwarder& AccessibleTextHelper_Impl::GetTextForwarder() const throw (uno::RuntimeException)
+ {
+ if( !maEditSource.IsValid() )
+ throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown edit source")), mxFrontEnd);
- if( pTextForwarder->IsValid() )
- return *pTextForwarder;
- else
- throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Text forwarder is invalid, model might be dead")), mxFrontEnd);
-}
+ SvxTextForwarder* pTextForwarder = maEditSource.GetTextForwarder();
-SvxViewForwarder& SvxAccessibleTextHelper_Impl::GetViewForwarder() const throw (uno::RuntimeException)
-{
- if( !maEditSource.IsValid() )
- throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown edit source")), mxFrontEnd);
+ if( !pTextForwarder )
+ throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Unable to fetch text forwarder, model might be dead")), mxFrontEnd);
- SvxViewForwarder* pViewForwarder = maEditSource.GetViewForwarder();
+ if( pTextForwarder->IsValid() )
+ return *pTextForwarder;
+ else
+ throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Text forwarder is invalid, model might be dead")), mxFrontEnd);
+ }
- if( !pViewForwarder )
- throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Unable to fetch view forwarder, model might be dead")), mxFrontEnd);
+ SvxViewForwarder& AccessibleTextHelper_Impl::GetViewForwarder() const throw (uno::RuntimeException)
+ {
+ if( !maEditSource.IsValid() )
+ throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown edit source")), mxFrontEnd);
- if( pViewForwarder->IsValid() )
- return *pViewForwarder;
- else
- throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("View forwarder is invalid, model might be dead")), mxFrontEnd);
-}
+ SvxViewForwarder* pViewForwarder = maEditSource.GetViewForwarder();
-SvxEditViewForwarder& SvxAccessibleTextHelper_Impl::GetEditViewForwarder( sal_Bool bCreate ) const throw (uno::RuntimeException)
-{
- if( !maEditSource.IsValid() )
- throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown edit source")), mxFrontEnd);
+ if( !pViewForwarder )
+ throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Unable to fetch view forwarder, model might be dead")), mxFrontEnd);
- SvxEditViewForwarder* pViewForwarder = maEditSource.GetEditViewForwarder( bCreate );
+ if( pViewForwarder->IsValid() )
+ return *pViewForwarder;
+ else
+ throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("View forwarder is invalid, model might be dead")), mxFrontEnd);
+ }
- if( !pViewForwarder )
+ SvxEditViewForwarder& AccessibleTextHelper_Impl::GetEditViewForwarder( sal_Bool bCreate ) const throw (uno::RuntimeException)
{
- if( bCreate )
- throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Unable to fetch edit view forwarder, model might be dead")), mxFrontEnd);
+ if( !maEditSource.IsValid() )
+ throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown edit source")), mxFrontEnd);
+
+ SvxEditViewForwarder* pViewForwarder = maEditSource.GetEditViewForwarder( bCreate );
+
+ if( !pViewForwarder )
+ {
+ if( bCreate )
+ throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Unable to fetch edit view forwarder, model might be dead")), mxFrontEnd);
+ else
+ throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("No edit view forwarder, object not in edit mode")), mxFrontEnd);
+ }
+
+ if( pViewForwarder->IsValid() )
+ return *pViewForwarder;
else
- throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("No edit view forwarder, object not in edit mode")), mxFrontEnd);
+ {
+ if( bCreate )
+ throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("View forwarder is invalid, model might be dead")), mxFrontEnd);
+ else
+ throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("View forwarder is invalid, object not in edit mode")), mxFrontEnd);
+ }
}
- if( pViewForwarder->IsValid() )
- return *pViewForwarder;
- else
+ SvxEditSourceAdapter& AccessibleTextHelper_Impl::GetEditSource() const throw (uno::RuntimeException)
{
- if( bCreate )
- throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("View forwarder is invalid, model might be dead")), mxFrontEnd);
+ if( maEditSource.IsValid() )
+ return maEditSource;
else
- throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("View forwarder is invalid, object not in edit mode")), mxFrontEnd);
+ throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AccessibleTextHelper_Impl::GetEditSource: no edit source")), mxFrontEnd );
}
-}
-SvxEditSourceAdapter& SvxAccessibleTextHelper_Impl::GetEditSource() const throw (uno::RuntimeException)
-{
- if( maEditSource.IsValid() )
- return maEditSource;
- else
- throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SvxAccessibleTextHelper_Impl::GetEditSource: no edit source")), mxFrontEnd );
-}
+ sal_Bool AccessibleTextHelper_Impl::IsSelected() const
+ {
+ sal_Bool bRet = sal_False;
-sal_Bool SvxAccessibleTextHelper_Impl::IsSelected() const
-{
- sal_Bool bRet = sal_False;
+ try
+ {
+ ESelection aSelection;
+ bRet = GetEditViewForwarder().GetSelection( aSelection );
+ }
+ catch( const uno::RuntimeException& ) {}
- try
- {
- ESelection aSelection;
- bRet = GetEditViewForwarder().GetSelection( aSelection );
+ return bRet;
}
- catch( const uno::RuntimeException& ) {}
-
- return bRet;
-}
-sal_Bool SvxAccessibleTextHelper_Impl::IsActive() const throw (uno::RuntimeException)
-{
- SvxEditSource& rEditSource = GetEditSource();
- SvxEditViewForwarder* pViewForwarder = rEditSource.GetEditViewForwarder();
+ sal_Bool AccessibleTextHelper_Impl::IsActive() const throw (uno::RuntimeException)
+ {
+ SvxEditSource& rEditSource = GetEditSource();
+ SvxEditViewForwarder* pViewForwarder = rEditSource.GetEditViewForwarder();
- if( !pViewForwarder )
- return sal_False;
+ if( !pViewForwarder )
+ return sal_False;
- if( pViewForwarder->IsValid() )
- return sal_True;
- else
- return sal_False;
-}
+ if( pViewForwarder->IsValid() )
+ return sal_True;
+ else
+ return sal_False;
+ }
-void SvxAccessibleTextHelper_Impl::UpdateSelection( const ESelection& rSelection )
-{
- if( !maLastSelection.IsEqual( rSelection ) )
+ void AccessibleTextHelper_Impl::UpdateSelection( const ESelection& rSelection )
{
- // notify all affected paragraphs (TODO: may be suboptimal,
- // since some paragraphs might stay selected)
+ if( !maLastSelection.IsEqual( rSelection ) )
+ {
+ // notify all affected paragraphs (TODO: may be suboptimal,
+ // since some paragraphs might stay selected)
- maParaManager.FireEvent( maLastSelection.nStartPara,
- maLastSelection.nEndPara,
- AccessibleEventId::ACCESSIBLE_SELECTION_EVENT );
+ maParaManager.FireEvent( maLastSelection.nStartPara,
+ maLastSelection.nEndPara,
+ AccessibleEventId::ACCESSIBLE_SELECTION_EVENT );
- maParaManager.FireEvent( maLastSelection.nStartPara,
- maLastSelection.nStartPara,
- AccessibleEventId::ACCESSIBLE_CARET_EVENT );
+ maParaManager.FireEvent( maLastSelection.nStartPara,
+ maLastSelection.nStartPara,
+ AccessibleEventId::ACCESSIBLE_CARET_EVENT );
- maParaManager.FireEvent( rSelection.nStartPara,
- rSelection.nEndPara,
- AccessibleEventId::ACCESSIBLE_SELECTION_EVENT );
+ maParaManager.FireEvent( rSelection.nStartPara,
+ rSelection.nEndPara,
+ AccessibleEventId::ACCESSIBLE_SELECTION_EVENT );
- maParaManager.FireEvent( rSelection.nStartPara,
- rSelection.nStartPara,
- AccessibleEventId::ACCESSIBLE_CARET_EVENT );
+ maParaManager.FireEvent( rSelection.nStartPara,
+ rSelection.nStartPara,
+ AccessibleEventId::ACCESSIBLE_CARET_EVENT );
- maLastSelection = rSelection;
+ maLastSelection = rSelection;
+ }
}
-}
-// functor for sending child events
-class SvxAccessibleTextHelper_SendAccessibleChildEvent : public ::std::unary_function< accessibility::AccessibleEditableTextPara&, void >
-{
-public:
- SvxAccessibleTextHelper_SendAccessibleChildEvent( SvxAccessibleTextHelper_Impl& rImpl ) : mrImpl(rImpl) {}
- void operator()( accessibility::AccessibleEditableTextPara& rPara )
+ // functor for sending child events
+ class AccessibleTextHelper_SendAccessibleChildEvent : public ::std::unary_function< accessibility::AccessibleEditableTextPara&, void >
{
- uno::Reference< XAccessible > xChild( static_cast< ::cppu::OWeakObject* > ( &rPara ), uno::UNO_QUERY );
- mrImpl.FireEvent(AccessibleEventId::ACCESSIBLE_CHILD_EVENT, uno::Any(), uno::makeAny( xChild ) );
- }
+ public:
+ AccessibleTextHelper_SendAccessibleChildEvent( AccessibleTextHelper_Impl& rImpl ) : mrImpl(rImpl) {}
+ void operator()( accessibility::AccessibleEditableTextPara& rPara )
+ {
+ uno::Reference< XAccessible > xChild( static_cast< ::cppu::OWeakObject* > ( &rPara ), uno::UNO_QUERY );
+ mrImpl.FireEvent(AccessibleEventId::ACCESSIBLE_CHILD_EVENT, uno::Any(), uno::makeAny( xChild ) );
+ }
-private:
- SvxAccessibleTextHelper_Impl& mrImpl;
-};
+ private:
+ AccessibleTextHelper_Impl& mrImpl;
+ };
-void SvxAccessibleTextHelper_Impl::ShutdownEditSource() throw (uno::RuntimeException)
-{
- // This should only be called with solar mutex locked, i.e. from the main office thread
+ void AccessibleTextHelper_Impl::ShutdownEditSource() throw (uno::RuntimeException)
+ {
+ // This should only be called with solar mutex locked, i.e. from the main office thread
- // invalidate children
- maParaManager.SetEditSource( NULL );
+ // invalidate children
+ maParaManager.SetEditSource( NULL );
- // loosing all children
- maParaManager.ForEach( SvxAccessibleTextHelper_SendAccessibleChildEvent( *this ) );
- maParaManager.SetNum(0);
+ // loosing all children
+ maParaManager.ForEach( AccessibleTextHelper_SendAccessibleChildEvent( *this ) );
+ maParaManager.SetNum(0);
- // quit listen on stale edit source
- if( maEditSource.IsValid() )
- EndListening( maEditSource.GetBroadcaster() );
+ // quit listen on stale edit source
+ if( maEditSource.IsValid() )
+ EndListening( maEditSource.GetBroadcaster() );
- maEditSource.SetEditSource( ::std::auto_ptr< SvxEditSource >(NULL) );
-}
+ maEditSource.SetEditSource( ::std::auto_ptr< SvxEditSource >(NULL) );
+ }
-void SvxAccessibleTextHelper_Impl::SetEditSource( ::std::auto_ptr< SvxEditSource > pEditSource ) throw (uno::RuntimeException)
-{
- // This should only be called with solar mutex locked, i.e. from the main office thread
+ void AccessibleTextHelper_Impl::SetEditSource( ::std::auto_ptr< SvxEditSource > pEditSource ) throw (uno::RuntimeException)
+ {
+ // This should only be called with solar mutex locked, i.e. from the main office thread
- // shutdown old edit source
- ShutdownEditSource();
+ // shutdown old edit source
+ ShutdownEditSource();
- // set new edit source
- maEditSource.SetEditSource( pEditSource );
+ // set new edit source
+ maEditSource.SetEditSource( pEditSource );
- // init child vector to the current child count
- if( maEditSource.IsValid() )
- {
- maParaManager.SetNum( GetTextForwarder().GetParagraphCount() );
+ // init child vector to the current child count
+ if( maEditSource.IsValid() )
+ {
+ maParaManager.SetNum( GetTextForwarder().GetParagraphCount() );
- // listen on new edit source
- StartListening( maEditSource.GetBroadcaster() );
+ // listen on new edit source
+ StartListening( maEditSource.GetBroadcaster() );
- UpdateVisibleChildren();
+ UpdateVisibleChildren();
+ }
}
-}
-void SvxAccessibleTextHelper_Impl::SetOffset( const Point& rPoint )
-{
- maOffset = rPoint;
- maParaManager.SetEEOffset( rPoint );
+ void AccessibleTextHelper_Impl::SetOffset( const Point& rPoint )
+ {
+ maOffset = rPoint;
+ maParaManager.SetEEOffset( rPoint );
- // in all cases, check visibility afterwards.
- UpdateVisibleChildren();
-}
+ // in all cases, check visibility afterwards.
+ UpdateVisibleChildren();
+ }
-void SvxAccessibleTextHelper_Impl::UpdateVisibleChildren()
-{
- try
+ void AccessibleTextHelper_Impl::UpdateVisibleChildren()
{
- SvxTextForwarder& rCacheTF = GetTextForwarder();
- SvxViewForwarder& rCacheVF = GetViewForwarder();
+ try
+ {
+ SvxTextForwarder& rCacheTF = GetTextForwarder();
+ SvxViewForwarder& rCacheVF = GetViewForwarder();
- Rectangle aViewArea = rCacheVF.GetVisArea();
+ Rectangle aViewArea = rCacheVF.GetVisArea();
- if( IsActive() )
- {
- // maybe the edit view scrolls, adapt aViewArea
- Rectangle aEditViewArea = GetEditViewForwarder().GetVisArea();
- aViewArea += aEditViewArea.TopLeft();
+ if( IsActive() )
+ {
+ // maybe the edit view scrolls, adapt aViewArea
+ Rectangle aEditViewArea = GetEditViewForwarder().GetVisArea();
+ aViewArea += aEditViewArea.TopLeft();
- // now determine intersection
- aViewArea.Intersection( aEditViewArea );
- }
+ // now determine intersection
+ aViewArea.Intersection( aEditViewArea );
+ }
- Rectangle aTmpBB, aParaBB;
- sal_Bool bFirstChild = sal_True;
- sal_Int32 nCurrPara;
- sal_Int32 nParas=rCacheTF.GetParagraphCount();
+ Rectangle aTmpBB, aParaBB;
+ sal_Bool bFirstChild = sal_True;
+ sal_Int32 nCurrPara;
+ sal_Int32 nParas=rCacheTF.GetParagraphCount();
- mnFirstVisibleChild = -1;
- mnLastVisibleChild = -2;
+ mnFirstVisibleChild = -1;
+ mnLastVisibleChild = -2;
- for( nCurrPara=0; nCurrPara<nParas; ++nCurrPara )
- {
- DBG_ASSERT(nCurrPara >= 0 && nCurrPara <= USHRT_MAX,
- "SvxAccessibleTextHelper_Impl::UpdateVisibleChildren: index value overflow");
+ for( nCurrPara=0; nCurrPara<nParas; ++nCurrPara )
+ {
+ DBG_ASSERT(nCurrPara >= 0 && nCurrPara <= USHRT_MAX,
+ "AccessibleTextHelper_Impl::UpdateVisibleChildren: index value overflow");
- aTmpBB = rCacheTF.GetParaBounds( static_cast< USHORT >( nCurrPara ) );
+ aTmpBB = rCacheTF.GetParaBounds( static_cast< USHORT >( nCurrPara ) );
- // convert to screen coordinates
- aParaBB = accessibility::AccessibleEditableTextPara::LogicToPixel( aTmpBB, rCacheTF.GetMapMode(), rCacheVF );
+ // convert to screen coordinates
+ aParaBB = accessibility::AccessibleEditableTextPara::LogicToPixel( aTmpBB, rCacheTF.GetMapMode(), rCacheVF );
- if( aParaBB.IsOver( aViewArea ) )
- {
- // at least partially visible
- if( bFirstChild )
+ if( aParaBB.IsOver( aViewArea ) )
{
- bFirstChild = sal_False;
- mnFirstVisibleChild = nCurrPara;
- }
+ // at least partially visible
+ if( bFirstChild )
+ {
+ bFirstChild = sal_False;
+ mnFirstVisibleChild = nCurrPara;
+ }
- mnLastVisibleChild = nCurrPara;
+ mnLastVisibleChild = nCurrPara;
- GotPropertyEvent( uno::makeAny( getAccessibleChild(nCurrPara) ), AccessibleEventId::ACCESSIBLE_CHILD_EVENT );
- }
- else
- {
- // not or no longer visible
- if( maParaManager.IsReferencable( nCurrPara ) )
+ GotPropertyEvent( uno::makeAny( getAccessibleChild(nCurrPara) ), AccessibleEventId::ACCESSIBLE_CHILD_EVENT );
+ }
+ else
{
- LostPropertyEvent( uno::makeAny( getAccessibleChild(nCurrPara) ), AccessibleEventId::ACCESSIBLE_CHILD_EVENT );
+ // not or no longer visible
+ if( maParaManager.IsReferencable( nCurrPara ) )
+ {
+ LostPropertyEvent( uno::makeAny( getAccessibleChild(nCurrPara) ), AccessibleEventId::ACCESSIBLE_CHILD_EVENT );
- // clear reference
- maParaManager.Release( nCurrPara );
+ // clear reference
+ maParaManager.Release( nCurrPara );
+ }
}
}
}
- }
- catch( const uno::RuntimeException& )
- {
- DBG_ERROR("SvxAccessibleTextHelper_Impl::UpdateVisibleChildren error while determining visible children");
+ catch( const uno::RuntimeException& )
+ {
+ DBG_ERROR("AccessibleTextHelper_Impl::UpdateVisibleChildren error while determining visible children");
- // something failed - currently no children
- mnFirstVisibleChild = -1;
- mnLastVisibleChild = -2;
+ // something failed - currently no children
+ mnFirstVisibleChild = -1;
+ mnLastVisibleChild = -2;
- maParaManager.ForEach( SvxAccessibleTextHelper_SendAccessibleChildEvent( *this ) );
- maParaManager.SetNum(0);
+ maParaManager.ForEach( AccessibleTextHelper_SendAccessibleChildEvent( *this ) );
+ maParaManager.SetNum(0);
+ }
}
-}
-// functor for checking changes in paragraph bounding boxes
-class SvxAccessibleTextHelper_UpdateChildBounds : public ::std::unary_function< const accessibility::AccessibleParaManager::WeakChild&,
- accessibility::AccessibleParaManager::WeakChild >
-{
-public:
- SvxAccessibleTextHelper_UpdateChildBounds( SvxAccessibleTextHelper_Impl& rImpl ) : mrImpl(rImpl) {}
- accessibility::AccessibleParaManager::WeakChild operator()( const accessibility::AccessibleParaManager::WeakChild& rChild )
+ // functor for checking changes in paragraph bounding boxes
+ class AccessibleTextHelper_UpdateChildBounds : public ::std::unary_function< const accessibility::AccessibleParaManager::WeakChild&,
+ accessibility::AccessibleParaManager::WeakChild >
{
- // retrieve hard reference from weak one
- accessibility::AccessibleParaManager::WeakPara::HardRefType aHardRef( rChild.first.get() );
-
- if( aHardRef.is() )
+ public:
+ AccessibleTextHelper_UpdateChildBounds( AccessibleTextHelper_Impl& rImpl ) : mrImpl(rImpl) {}
+ accessibility::AccessibleParaManager::WeakChild operator()( const accessibility::AccessibleParaManager::WeakChild& rChild )
{
- awt::Rectangle aNewRect = aHardRef->getBounds();
- const awt::Rectangle& aOldRect = rChild.second;
+ // retrieve hard reference from weak one
+ accessibility::AccessibleParaManager::WeakPara::HardRefType aHardRef( rChild.first.get() );
- if( aNewRect.X != aOldRect.X ||
- aNewRect.Y != aOldRect.Y ||
- aNewRect.Width != aOldRect.Width ||
- aNewRect.Height != aOldRect.Height )
+ if( aHardRef.is() )
{
- // visible data changed
- aHardRef->FireEvent( AccessibleEventId::ACCESSIBLE_VISIBLE_DATA_EVENT );
+ awt::Rectangle aNewRect = aHardRef->getBounds();
+ const awt::Rectangle& aOldRect = rChild.second;
+
+ if( aNewRect.X != aOldRect.X ||
+ aNewRect.Y != aOldRect.Y ||
+ aNewRect.Width != aOldRect.Width ||
+ aNewRect.Height != aOldRect.Height )
+ {
+ // visible data changed
+ aHardRef->FireEvent( AccessibleEventId::ACCESSIBLE_VISIBLE_DATA_EVENT );
- // update bounds
- return accessibility::AccessibleParaManager::WeakChild( rChild.first, aNewRect );
+ // update bounds
+ return accessibility::AccessibleParaManager::WeakChild( rChild.first, aNewRect );
+ }
}
- }
- // identity transform
- return rChild;
- }
+ // identity transform
+ return rChild;
+ }
-private:
- SvxAccessibleTextHelper_Impl& mrImpl;
-};
+ private:
+ AccessibleTextHelper_Impl& mrImpl;
+ };
-void SvxAccessibleTextHelper_Impl::UpdateVisibleData()
-{
- // send CHILD_EVENT to affected children
- ::accessibility::AccessibleParaManager::VectorOfChildren::const_iterator begin = maParaManager.begin();
- ::accessibility::AccessibleParaManager::VectorOfChildren::const_iterator end = begin;
+ void AccessibleTextHelper_Impl::UpdateVisibleData()
+ {
+ // send CHILD_EVENT to affected children
+ ::accessibility::AccessibleParaManager::VectorOfChildren::const_iterator begin = maParaManager.begin();
+ ::accessibility::AccessibleParaManager::VectorOfChildren::const_iterator end = begin;
- ::std::advance< ::accessibility::AccessibleParaManager::VectorOfChildren::const_iterator, sal_Int32 >( begin, mnFirstVisibleChild );
- ::std::advance< ::accessibility::AccessibleParaManager::VectorOfChildren::const_iterator, sal_Int32 >( end, mnLastVisibleChild );
+ ::std::advance< ::accessibility::AccessibleParaManager::VectorOfChildren::const_iterator, sal_Int32 >( begin, mnFirstVisibleChild );
+ ::std::advance< ::accessibility::AccessibleParaManager::VectorOfChildren::const_iterator, sal_Int32 >( end, mnLastVisibleChild );
- ::std::for_each( begin, end, SvxAccessibleTextHelper_UpdateChildBounds( *this ) );
-}
+ ::std::for_each( begin, end, AccessibleTextHelper_UpdateChildBounds( *this ) );
+ }
#ifdef DBG_UTIL
-void SvxAccessibleTextHelper_Impl::CheckInvariants() const
-{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ void AccessibleTextHelper_Impl::CheckInvariants() const
+ {
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
- if( !mxFrontEnd.is() )
- DBG_ERROR( "SvxAccessibleTextHelper: no frontend" );
+ if( !mxFrontEnd.is() )
+ DBG_ERROR( "AccessibleTextHelper: no frontend" );
- if( mnFirstVisibleChild >= 0 &&
- mnFirstVisibleChild > mnLastVisibleChild )
- {
- DBG_ERROR( "SvxAccessibleTextHelper: range invalid" );
+ if( mnFirstVisibleChild >= 0 &&
+ mnFirstVisibleChild > mnLastVisibleChild )
+ {
+ DBG_ERROR( "AccessibleTextHelper: range invalid" );
+ }
}
-}
#endif
-void SvxAccessibleTextHelper_Impl::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
-{
- // do not recurse
- if( mbInNotify )
- return;
+ void AccessibleTextHelper_Impl::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
+ {
+ // do not recurse
+ if( mbInNotify )
+ return;
- mbInNotify = sal_True;
+ mbInNotify = sal_True;
- const SfxSimpleHint* pSimpleHint = PTR_CAST( SfxSimpleHint, &rHint );
- const TextHint* pTextHint = PTR_CAST( TextHint, &rHint );
- const SvxViewHint* pViewHint = PTR_CAST( SvxViewHint, &rHint );
- const SvxEditSourceHint* pEditSourceHint = PTR_CAST( SvxEditSourceHint, &rHint );
+ const SfxSimpleHint* pSimpleHint = PTR_CAST( SfxSimpleHint, &rHint );
+ const TextHint* pTextHint = PTR_CAST( TextHint, &rHint );
+ const SvxViewHint* pViewHint = PTR_CAST( SvxViewHint, &rHint );
+ const SvxEditSourceHint* pEditSourceHint = PTR_CAST( SvxEditSourceHint, &rHint );
- try
- {
- // precondition: solar mutex locked
- if( pEditSourceHint )
+ try
{
- if( pEditSourceHint->GetValue() < GetTextForwarder().GetParagraphCount() )
+ // precondition: solar mutex locked
+ if( pEditSourceHint )
{
- switch( pEditSourceHint->GetId() )
+ if( pEditSourceHint->GetValue() < GetTextForwarder().GetParagraphCount() )
{
- case EDITSOURCE_HINT_PARASMOVED:
+ switch( pEditSourceHint->GetId() )
{
- DBG_ASSERT( pEditSourceHint->GetStartValue() < GetTextForwarder().GetParagraphCount() &&
- pEditSourceHint->GetEndValue() < GetTextForwarder().GetParagraphCount(),
- "SvxAccessibleTextHelper_Impl::NotifyHdl: Invalid notification");
-
- const sal_Int32 nParas = GetTextForwarder().GetParagraphCount();
- sal_Int32 nFirst, nMiddle, nLast;
-
- /* rotate paragraphs
- * =================
- *
- * Three cases:
- *
- * 1.
- * ... nParagraph ... nParam1 ... nParam2 ...
- * |______________[xxxxxxxxxxx]
- * becomes
- * [xxxxxxxxxxx]|______________
- *
- * tail is 0
- *
- * 2.
- * ... nParam1 ... nParagraph ... nParam2 ...
- * [xxxxxxxxxxx|xxxxxxxxxxxxxx]____________
- * becomes
- * ____________[xxxxxxxxxxx|xxxxxxxxxxxxxx]
- *
- * tail is nParagraph - nParam1
- *
- * 3.
- * ... nParam1 ... nParam2 ... nParagraph ...
- * [xxxxxxxxxxx]___________|____________
- * becomes
- * ___________|____________[xxxxxxxxxxx]
- *
- * tail is nParam2 - nParam1
- */
-
- // sort nParagraph, nParam1 and nParam2 in ascending order, calc range
- if( pEditSourceHint->GetValue() < pEditSourceHint->GetStartValue() )
- {
- nFirst = pEditSourceHint->GetValue();
- nMiddle = pEditSourceHint->GetStartValue();
- nLast = pEditSourceHint->GetEndValue();
- }
- else if( pEditSourceHint->GetValue() < pEditSourceHint->GetEndValue() )
+ case EDITSOURCE_HINT_PARASMOVED:
{
- nFirst = pEditSourceHint->GetStartValue();
- nMiddle = pEditSourceHint->GetValue();
- nLast = pEditSourceHint->GetEndValue() + nMiddle - nFirst;
- }
- else
- {
- nFirst = pEditSourceHint->GetStartValue();
- nMiddle = pEditSourceHint->GetEndValue();
- nLast = pEditSourceHint->GetValue() + nMiddle - nFirst;
+ DBG_ASSERT( pEditSourceHint->GetStartValue() < GetTextForwarder().GetParagraphCount() &&
+ pEditSourceHint->GetEndValue() < GetTextForwarder().GetParagraphCount(),
+ "AccessibleTextHelper_Impl::NotifyHdl: Invalid notification");
+
+ const sal_Int32 nParas = GetTextForwarder().GetParagraphCount();
+ sal_Int32 nFirst, nMiddle, nLast;
+
+ /* rotate paragraphs
+ * =================
+ *
+ * Three cases:
+ *
+ * 1.
+ * ... nParagraph ... nParam1 ... nParam2 ...
+ * |______________[xxxxxxxxxxx]
+ * becomes
+ * [xxxxxxxxxxx]|______________
+ *
+ * tail is 0
+ *
+ * 2.
+ * ... nParam1 ... nParagraph ... nParam2 ...
+ * [xxxxxxxxxxx|xxxxxxxxxxxxxx]____________
+ * becomes
+ * ____________[xxxxxxxxxxx|xxxxxxxxxxxxxx]
+ *
+ * tail is nParagraph - nParam1
+ *
+ * 3.
+ * ... nParam1 ... nParam2 ... nParagraph ...
+ * [xxxxxxxxxxx]___________|____________
+ * becomes
+ * ___________|____________[xxxxxxxxxxx]
+ *
+ * tail is nParam2 - nParam1
+ */
+
+ // sort nParagraph, nParam1 and nParam2 in ascending order, calc range
+ if( pEditSourceHint->GetValue() < pEditSourceHint->GetStartValue() )
+ {
+ nFirst = pEditSourceHint->GetValue();
+ nMiddle = pEditSourceHint->GetStartValue();
+ nLast = pEditSourceHint->GetEndValue();
+ }
+ else if( pEditSourceHint->GetValue() < pEditSourceHint->GetEndValue() )
+ {
+ nFirst = pEditSourceHint->GetStartValue();
+ nMiddle = pEditSourceHint->GetValue();
+ nLast = pEditSourceHint->GetEndValue() + nMiddle - nFirst;
+ }
+ else
+ {
+ nFirst = pEditSourceHint->GetStartValue();
+ nMiddle = pEditSourceHint->GetEndValue();
+ nLast = pEditSourceHint->GetValue() + nMiddle - nFirst;
+ }
+
+ if( nFirst < nParas && nMiddle < nParas && nLast < nParas )
+ {
+ // since we have no "paragraph index
+ // changed" event on UAA, remove
+ // [first,last] and insert again later (in
+ // UpdateVisibleChildren)
+
+ // maParaManager.Rotate( nFirst, nMiddle, nLast );
+
+ maParaManager.Release(nFirst, nLast);
+
+ // send CHILD_EVENT to affected children
+ ::accessibility::AccessibleParaManager::VectorOfChildren::const_iterator begin = maParaManager.begin();
+ ::accessibility::AccessibleParaManager::VectorOfChildren::const_iterator end = begin;
+
+ ::std::advance< ::accessibility::AccessibleParaManager::VectorOfChildren::const_iterator, sal_Int32 >( begin, nFirst );
+ ::std::advance< ::accessibility::AccessibleParaManager::VectorOfChildren::const_iterator, sal_Int32 >( end, nLast );
+
+ ::std::for_each( begin, end,
+ ::accessibility::AccessibleParaManager::WeakChildAdapter< AccessibleTextHelper_SendAccessibleChildEvent >
+ (AccessibleTextHelper_SendAccessibleChildEvent( *this )) );
+ }
+#ifdef DBG_UTIL
+ else
+ {
+ DBG_ERROR("AccessibleTextHelper_Impl::NotifyHdl: Invalid move ranges");
+ }
+#endif
+ break;
}
- if( nFirst < nParas && nMiddle < nParas && nLast < nParas )
+ case EDITSOURCE_HINT_SELECTIONCHANGED:
+ // notify listeners
+ ESelection aSelection;
+ try
+ {
+ if( GetEditViewForwarder().GetSelection( aSelection ) )
+ UpdateSelection( aSelection );
+ else
+ UpdateSelection( ESelection() );
+ }
+ // maybe we're not in edit mode (this is not an error)
+ catch( const uno::RuntimeException& ) {}
+ break;
+ }
+
+ // in all cases, check visibility afterwards.
+ UpdateVisibleChildren();
+ }
+#ifdef DBG_UTIL
+ else
+ {
+ DBG_ERROR("AccessibleTextHelper_Impl::NotifyHdl: Invalid notification");
+ }
+#endif
+ }
+ else if( pTextHint )
+ {
+ if( pTextHint->GetValue() < GetTextForwarder().GetParagraphCount() )
+ {
+ sal_Bool bUpdateVisibleData = sal_False;
+
+ switch( pTextHint->GetId() )
+ {
+ case TEXT_HINT_MODIFIED:
+ // notify listeners
+ maParaManager.FireEvent( pTextHint->GetValue(), AccessibleEventId::ACCESSIBLE_TEXT_EVENT );
+ break;
+
+ case TEXT_HINT_PARAINSERTED:
{
+ // resize child vector to the current child count
+ const sal_Int32 nParas = GetTextForwarder().GetParagraphCount();
+
+ maParaManager.SetNum( nParas );
+
// since we have no "paragraph index
// changed" event on UAA, remove
// [first,last] and insert again later (in
// UpdateVisibleChildren)
- // maParaManager.Rotate( nFirst, nMiddle, nLast );
+ // move successors of inserted paragraph one position further
+ //maParaManager.MoveRightFrom( pTextHint->GetValue() );
- maParaManager.Release(nFirst, nLast);
+ // release everything from the insertion position until the end
+ maParaManager.Release(pTextHint->GetValue(), nParas);
// send CHILD_EVENT to affected children
::accessibility::AccessibleParaManager::VectorOfChildren::const_iterator begin = maParaManager.begin();
::accessibility::AccessibleParaManager::VectorOfChildren::const_iterator end = begin;
- ::std::advance< ::accessibility::AccessibleParaManager::VectorOfChildren::const_iterator, sal_Int32 >( begin, nFirst );
- ::std::advance< ::accessibility::AccessibleParaManager::VectorOfChildren::const_iterator, sal_Int32 >( end, nLast );
+ ::std::advance< ::accessibility::AccessibleParaManager::VectorOfChildren::const_iterator, sal_Int32 >( begin, pTextHint->GetValue() );
+ ::std::advance< ::accessibility::AccessibleParaManager::VectorOfChildren::const_iterator, sal_Int32 >( end, nParas );
::std::for_each( begin, end,
- ::accessibility::AccessibleParaManager::WeakChildAdapter< SvxAccessibleTextHelper_SendAccessibleChildEvent >
- (SvxAccessibleTextHelper_SendAccessibleChildEvent( *this )) );
+ ::accessibility::AccessibleParaManager::WeakChildAdapter< AccessibleTextHelper_SendAccessibleChildEvent >
+ (AccessibleTextHelper_SendAccessibleChildEvent( *this )) );
+ break;
}
-#ifdef DBG_UTIL
- else
- {
- DBG_ERROR("SvxAccessibleTextHelper_Impl::NotifyHdl: Invalid move ranges");
- }
-#endif
- break;
- }
- case EDITSOURCE_HINT_SELECTIONCHANGED:
- // notify listeners
- ESelection aSelection;
- try
+ case TEXT_HINT_PARAREMOVED:
{
- if( GetEditViewForwarder().GetSelection( aSelection ) )
- UpdateSelection( aSelection );
- else
- UpdateSelection( ESelection() );
- }
- // maybe we're not in edit mode (this is not an error)
- catch( const uno::RuntimeException& ) {}
- break;
- }
-
- // in all cases, check visibility afterwards.
- UpdateVisibleChildren();
- }
-#ifdef DBG_UTIL
- else
- {
- DBG_ERROR("SvxAccessibleTextHelper_Impl::NotifyHdl: Invalid notification");
- }
-#endif
- }
- else if( pTextHint )
- {
- if( pTextHint->GetValue() < GetTextForwarder().GetParagraphCount() )
- {
- sal_Bool bUpdateVisibleData = sal_False;
-
- switch( pTextHint->GetId() )
- {
- case TEXT_HINT_MODIFIED:
- // notify listeners
- maParaManager.FireEvent( pTextHint->GetValue(), AccessibleEventId::ACCESSIBLE_TEXT_EVENT );
- break;
-
- case TEXT_HINT_PARAINSERTED:
- {
- // resize child vector to the current child count
- const sal_Int32 nParas = GetTextForwarder().GetParagraphCount();
-
- maParaManager.SetNum( nParas );
-
- // since we have no "paragraph index
- // changed" event on UAA, remove
- // [first,last] and insert again later (in
- // UpdateVisibleChildren)
-
- // move successors of inserted paragraph one position further
- //maParaManager.MoveRightFrom( pTextHint->GetValue() );
-
- // release everything from the insertion position until the end
- maParaManager.Release(pTextHint->GetValue(), nParas);
+ const sal_Int32 nParas = GetTextForwarder().GetParagraphCount();
- // send CHILD_EVENT to affected children
- ::accessibility::AccessibleParaManager::VectorOfChildren::const_iterator begin = maParaManager.begin();
- ::accessibility::AccessibleParaManager::VectorOfChildren::const_iterator end = begin;
-
- ::std::advance< ::accessibility::AccessibleParaManager::VectorOfChildren::const_iterator, sal_Int32 >( begin, pTextHint->GetValue() );
- ::std::advance< ::accessibility::AccessibleParaManager::VectorOfChildren::const_iterator, sal_Int32 >( end, nParas );
-
- ::std::for_each( begin, end,
- ::accessibility::AccessibleParaManager::WeakChildAdapter< SvxAccessibleTextHelper_SendAccessibleChildEvent >
- (SvxAccessibleTextHelper_SendAccessibleChildEvent( *this )) );
- break;
- }
+ // since we have no "paragraph index
+ // changed" event on UAA, remove
+ // [first,last] and insert again later (in
+ // UpdateVisibleChildren)
- case TEXT_HINT_PARAREMOVED:
- {
- const sal_Int32 nParas = GetTextForwarder().GetParagraphCount();
+ // move successors of removed paragraph one position closer
+ // maParaManager.MoveLeftFrom( pTextHint->GetValue() );
- // since we have no "paragraph index
- // changed" event on UAA, remove
- // [first,last] and insert again later (in
- // UpdateVisibleChildren)
+ // release everything from the remove position until the end
+ maParaManager.Release(pTextHint->GetValue(), nParas);
- // move successors of removed paragraph one position closer
- // maParaManager.MoveLeftFrom( pTextHint->GetValue() );
+ // send CHILD_EVENT to affected children
+ ::accessibility::AccessibleParaManager::VectorOfChildren::const_iterator begin = maParaManager.begin();
+ ::accessibility::AccessibleParaManager::VectorOfChildren::const_iterator end = begin;
- // release everything from the remove position until the end
- maParaManager.Release(pTextHint->GetValue(), nParas);
+ ::std::advance< ::accessibility::AccessibleParaManager::VectorOfChildren::const_iterator, sal_Int32 >( begin, pTextHint->GetValue() );
+ ::std::advance< ::accessibility::AccessibleParaManager::VectorOfChildren::const_iterator, sal_Int32 >( end, nParas );
- // send CHILD_EVENT to affected children
- ::accessibility::AccessibleParaManager::VectorOfChildren::const_iterator begin = maParaManager.begin();
- ::accessibility::AccessibleParaManager::VectorOfChildren::const_iterator end = begin;
+ ::std::for_each( begin, end,
+ ::accessibility::AccessibleParaManager::WeakChildAdapter< AccessibleTextHelper_SendAccessibleChildEvent >
+ (AccessibleTextHelper_SendAccessibleChildEvent( *this )) );
- ::std::advance< ::accessibility::AccessibleParaManager::VectorOfChildren::const_iterator, sal_Int32 >( begin, pTextHint->GetValue() );
- ::std::advance< ::accessibility::AccessibleParaManager::VectorOfChildren::const_iterator, sal_Int32 >( end, nParas );
+ // resize child vector to the current child count
+ maParaManager.SetNum( nParas );
+ break;
+ }
- ::std::for_each( begin, end,
- ::accessibility::AccessibleParaManager::WeakChildAdapter< SvxAccessibleTextHelper_SendAccessibleChildEvent >
- (SvxAccessibleTextHelper_SendAccessibleChildEvent( *this )) );
+ case TEXT_HINT_TEXTHEIGHTCHANGED:
+ bUpdateVisibleData = sal_True;
+ break;
- // resize child vector to the current child count
- maParaManager.SetNum( nParas );
- break;
+ case TEXT_HINT_VIEWSCROLLED:
+ bUpdateVisibleData = sal_True;
+ break;
}
- case TEXT_HINT_TEXTHEIGHTCHANGED:
- bUpdateVisibleData = sal_True;
- break;
+ // in all cases, check visibility afterwards.
+ UpdateVisibleChildren();
- case TEXT_HINT_VIEWSCROLLED:
- bUpdateVisibleData = sal_True;
- break;
+ if( bUpdateVisibleData )
+ UpdateVisibleData();
}
-
- // in all cases, check visibility afterwards.
- UpdateVisibleChildren();
-
- if( bUpdateVisibleData )
- UpdateVisibleData();
- }
#ifdef DBG_UTIL
- else
- {
- DBG_ERROR("SvxAccessibleTextHelper_Impl::NotifyHdl: Invalid notification");
+ else
+ {
+ DBG_ERROR("AccessibleTextHelper_Impl::NotifyHdl: Invalid notification");
- }
+ }
#endif
- }
- else if( pViewHint )
- {
- switch( pViewHint->GetId() )
+ }
+ else if( pViewHint )
{
- case SVX_HINT_VIEWCHANGED:
- // just check visibility
- UpdateVisibleData();
- UpdateVisibleChildren();
- break;
+ switch( pViewHint->GetId() )
+ {
+ case SVX_HINT_VIEWCHANGED:
+ // just check visibility
+ UpdateVisibleData();
+ UpdateVisibleChildren();
+ break;
+ }
}
- }
- // it's VITAL to keep the SfxSimpleHint last! It's the base of some classes above!
- else if( pSimpleHint )
- {
- switch( pSimpleHint->GetId() )
+ // it's VITAL to keep the SfxSimpleHint last! It's the base of some classes above!
+ else if( pSimpleHint )
{
- case SFX_HINT_DYING:
- // edit source is dying under us, become defunc then
- try
- {
- // make edit source inaccessible
- // Note: cannot destroy it here, since we're called from there!
- ShutdownEditSource();
- }
- catch( const uno::RuntimeException& ) {}
+ switch( pSimpleHint->GetId() )
+ {
+ case SFX_HINT_DYING:
+ // edit source is dying under us, become defunc then
+ try
+ {
+ // make edit source inaccessible
+ // Note: cannot destroy it here, since we're called from there!
+ ShutdownEditSource();
+ }
+ catch( const uno::RuntimeException& ) {}
- break;
+ break;
+ }
}
}
- }
- catch( const uno::RuntimeException& )
- {
+ catch( const uno::RuntimeException& )
+ {
#ifdef DBG_UTIL
- DBG_ERROR("SvxAccessibleTextHelper_Impl::Notify: Unhandled exception.");
+ DBG_ERROR("AccessibleTextHelper_Impl::Notify: Unhandled exception.");
#endif
- }
-
- mbInNotify = sal_False;
-}
+ }
-void SvxAccessibleTextHelper_Impl::FireEvent( const sal_Int16 nEventId, const uno::Any& rNewValue, const uno::Any& rOldValue ) const
-{
-// -- object locked --
- ::osl::ClearableMutexGuard aGuard( maMutex );
+ mbInNotify = sal_False;
+ }
- AccessibleEventObject aEvent(mxFrontEnd, nEventId, rNewValue, rOldValue);
+ void AccessibleTextHelper_Impl::FireEvent( const sal_Int16 nEventId, const uno::Any& rNewValue, const uno::Any& rOldValue ) const
+ {
+ // -- object locked --
+ ::osl::ClearableMutexGuard aGuard( maMutex );
- ::cppu::OInterfaceIteratorHelper aIter( const_cast< SvxAccessibleTextHelper_Impl* >(this)->maStateListeners );
+ AccessibleEventObject aEvent(mxFrontEnd, nEventId, rNewValue, rOldValue);
- // no locking necessary, OInterfaceIteratorHelper copies listeners if someone removes/adds in between
- // Further locking, actually, might lead to deadlocks, since we're calling out of this object
- aGuard.clear();
-// -- until here --
+ ::cppu::OInterfaceIteratorHelper aIter( const_cast< AccessibleTextHelper_Impl* >(this)->maStateListeners );
- while( aIter.hasMoreElements() )
- {
- uno::Reference < XAccessibleEventListener > xListener( aIter.next(), uno::UNO_QUERY );
+ // no locking necessary, OInterfaceIteratorHelper copies listeners if someone removes/adds in between
+ // Further locking, actually, might lead to deadlocks, since we're calling out of this object
+ aGuard.clear();
+ // -- until here --
- if( xListener.is() )
+ while( aIter.hasMoreElements() )
{
- try
- {
- xListener->notifyEvent( aEvent );
- }
- catch( const uno::RuntimeException& )
+ uno::Reference < XAccessibleEventListener > xListener( aIter.next(), uno::UNO_QUERY );
+
+ if( xListener.is() )
{
+ try
+ {
+ xListener->notifyEvent( aEvent );
+ }
+ catch( const uno::RuntimeException& )
+ {
#ifdef DBG_UTIL
- DBG_ERROR("SvxAccessibleTextHelper_Impl::StateChangeEvent: Caught runtime exception from listener (bridge/listener dead?).");
+ DBG_ERROR("AccessibleTextHelper_Impl::StateChangeEvent: Caught runtime exception from listener (bridge/listener dead?).");
#endif
+ }
}
}
}
-}
-
-// XAccessibleContext
-sal_Int32 SAL_CALL SvxAccessibleTextHelper_Impl::getAccessibleChildCount() throw (uno::RuntimeException)
-{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- return mnLastVisibleChild - mnFirstVisibleChild + 1;
-}
-
-uno::Reference< XAccessible > SAL_CALL SvxAccessibleTextHelper_Impl::getAccessibleChild( sal_Int32 i ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
-{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
-
- if( 0 > i || i > getAccessibleChildCount() ||
- GetTextForwarder().GetParagraphCount() <= i )
+ // XAccessibleContext
+ sal_Int32 SAL_CALL AccessibleTextHelper_Impl::getAccessibleChildCount() throw (uno::RuntimeException)
{
- throw lang::IndexOutOfBoundsException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Invalid child index")), mxFrontEnd);
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+
+ return mnLastVisibleChild - mnFirstVisibleChild + 1;
}
- return maParaManager.GetChild( i, mxFrontEnd, GetEditSource(), mnFirstVisibleChild + i ).first;
-}
+ uno::Reference< XAccessible > SAL_CALL AccessibleTextHelper_Impl::getAccessibleChild( sal_Int32 i ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
+ {
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
-void SAL_CALL SvxAccessibleTextHelper_Impl::addEventListener( const uno::Reference< XAccessibleEventListener >& xListener ) throw (uno::RuntimeException)
-{
- maStateListeners.addInterface( xListener );
-}
+ if( 0 > i || i > getAccessibleChildCount() ||
+ GetTextForwarder().GetParagraphCount() <= i )
+ {
+ throw lang::IndexOutOfBoundsException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Invalid child index")), mxFrontEnd);
+ }
-void SAL_CALL SvxAccessibleTextHelper_Impl::removeEventListener( const uno::Reference< XAccessibleEventListener >& xListener ) throw (uno::RuntimeException)
-{
- maStateListeners.removeInterface( xListener );
-}
+ return maParaManager.GetChild( i, mxFrontEnd, GetEditSource(), mnFirstVisibleChild + i ).first;
+ }
-uno::Reference< XAccessible > SAL_CALL SvxAccessibleTextHelper_Impl::getAccessibleAt( const awt::Point& _aPoint ) throw (uno::RuntimeException)
-{
- // make given position relative
- if( !mxFrontEnd.is() )
- throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SvxAccessibleTextHelper_Impl::getAccessibleAt: frontend invalid")), mxFrontEnd );
+ void SAL_CALL AccessibleTextHelper_Impl::addEventListener( const uno::Reference< XAccessibleEventListener >& xListener ) throw (uno::RuntimeException)
+ {
+ maStateListeners.addInterface( xListener );
+ }
- uno::Reference< XAccessibleContext > xFrontEndContext = mxFrontEnd->getAccessibleContext();
+ void SAL_CALL AccessibleTextHelper_Impl::removeEventListener( const uno::Reference< XAccessibleEventListener >& xListener ) throw (uno::RuntimeException)
+ {
+ maStateListeners.removeInterface( xListener );
+ }
- if( !xFrontEndContext.is() )
- throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SvxAccessibleTextHelper_Impl::getAccessibleAt: frontend invalid")), mxFrontEnd );
+ uno::Reference< XAccessible > SAL_CALL AccessibleTextHelper_Impl::getAccessibleAt( const awt::Point& _aPoint ) throw (uno::RuntimeException)
+ {
+ // make given position relative
+ if( !mxFrontEnd.is() )
+ throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AccessibleTextHelper_Impl::getAccessibleAt: frontend invalid")), mxFrontEnd );
- uno::Reference< XAccessibleComponent > xFrontEndComponent( xFrontEndContext, uno::UNO_QUERY );
+ uno::Reference< XAccessibleContext > xFrontEndContext = mxFrontEnd->getAccessibleContext();
- if( !xFrontEndComponent.is() )
- throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SvxAccessibleTextHelper_Impl::getAccessibleAt: frontend is no XAccessibleComponent")),
- mxFrontEnd );
+ if( !xFrontEndContext.is() )
+ throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AccessibleTextHelper_Impl::getAccessibleAt: frontend invalid")), mxFrontEnd );
- Point aPoint( _aPoint.X, _aPoint.Y );
- awt::Point aRefPoint = xFrontEndComponent->getLocationOnScreen();
- aPoint -= Point( aRefPoint.X, aRefPoint.Y );
+ uno::Reference< XAccessibleComponent > xFrontEndComponent( xFrontEndContext, uno::UNO_QUERY );
- // respect EditEngine offset to surrounding shape/cell
- aPoint -= GetOffset();
+ if( !xFrontEndComponent.is() )
+ throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AccessibleTextHelper_Impl::getAccessibleAt: frontend is no XAccessibleComponent")),
+ mxFrontEnd );
- // convert to EditEngine coordinate system
- SvxTextForwarder& rCacheTF = GetTextForwarder();
- Point aLogPoint( GetViewForwarder().PixelToLogic( aPoint, rCacheTF.GetMapMode() ) );
+ Point aPoint( _aPoint.X, _aPoint.Y );
+ awt::Point aRefPoint = xFrontEndComponent->getLocationOnScreen();
+ aPoint -= Point( aRefPoint.X, aRefPoint.Y );
- // iterate over all visible children (including those not yet created)
- sal_Int32 nChild;
- for( nChild=mnFirstVisibleChild; nChild <= mnLastVisibleChild; ++nChild )
- {
- DBG_ASSERT(nChild >= 0 && nChild <= USHRT_MAX,
- "SvxAccessibleTextHelper_Impl::getAccessibleAt: index value overflow");
+ // respect EditEngine offset to surrounding shape/cell
+ aPoint -= GetOffset();
- Rectangle aParaBounds( rCacheTF.GetParaBounds( static_cast< USHORT > (nChild) ) );
+ // convert to EditEngine coordinate system
+ SvxTextForwarder& rCacheTF = GetTextForwarder();
+ Point aLogPoint( GetViewForwarder().PixelToLogic( aPoint, rCacheTF.GetMapMode() ) );
- if( aParaBounds.IsInside( aLogPoint ) )
+ // iterate over all visible children (including those not yet created)
+ sal_Int32 nChild;
+ for( nChild=mnFirstVisibleChild; nChild <= mnLastVisibleChild; ++nChild )
{
- DBG_ASSERT(nChild - mnFirstVisibleChild >= 0 && nChild - mnFirstVisibleChild <= USHRT_MAX,
- "SvxAccessibleTextHelper_Impl::getAccessibleAt: index value overflow");
+ DBG_ASSERT(nChild >= 0 && nChild <= USHRT_MAX,
+ "AccessibleTextHelper_Impl::getAccessibleAt: index value overflow");
+
+ Rectangle aParaBounds( rCacheTF.GetParaBounds( static_cast< USHORT > (nChild) ) );
+
+ if( aParaBounds.IsInside( aLogPoint ) )
+ {
+ DBG_ASSERT(nChild - mnFirstVisibleChild >= 0 && nChild - mnFirstVisibleChild <= USHRT_MAX,
+ "AccessibleTextHelper_Impl::getAccessibleAt: index value overflow");
- return getAccessibleChild( static_cast< USHORT > (nChild - mnFirstVisibleChild) );
+ return getAccessibleChild( static_cast< USHORT > (nChild - mnFirstVisibleChild) );
+ }
}
+
+ // found none
+ return uno::Reference< XAccessible >();
}
- // found none
- return uno::Reference< XAccessible >();
-}
+ //------------------------------------------------------------------------
+ //
+ // AccessibleTextHelper implementation (simply forwards to impl)
+ //
+ //------------------------------------------------------------------------
-//------------------------------------------------------------------------
-//
-// SvxAccessibleTextHelper implementation (simply forwards to impl)
-//
-//------------------------------------------------------------------------
-
-SvxAccessibleTextHelper::SvxAccessibleTextHelper( const uno::Reference< XAccessible >& rInterface,
- ::std::auto_ptr< SvxEditSource > pEditSource ) :
- mpImpl( new SvxAccessibleTextHelper_Impl( rInterface ) )
-{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ AccessibleTextHelper::AccessibleTextHelper( const uno::Reference< XAccessible >& rInterface,
+ ::std::auto_ptr< SvxEditSource > pEditSource ) :
+ mpImpl( new AccessibleTextHelper_Impl( rInterface ) )
+ {
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
- SetEditSource( pEditSource );
-}
+ SetEditSource( pEditSource );
+ }
-SvxAccessibleTextHelper::~SvxAccessibleTextHelper()
-{
-}
+ AccessibleTextHelper::~AccessibleTextHelper()
+ {
+ }
-SvxEditSource& SvxAccessibleTextHelper::GetEditSource() const throw (uno::RuntimeException)
-{
+ SvxEditSource& AccessibleTextHelper::GetEditSource() const throw (uno::RuntimeException)
+ {
#ifdef DBG_UTIL
- mpImpl->CheckInvariants();
+ mpImpl->CheckInvariants();
- SvxEditSource& aEditSource = mpImpl->GetEditSource();
+ SvxEditSource& aEditSource = mpImpl->GetEditSource();
- mpImpl->CheckInvariants();
+ mpImpl->CheckInvariants();
- return aEditSource;
+ return aEditSource;
#else
- return mpImpl->GetEditSource();
+ return mpImpl->GetEditSource();
#endif
-}
+ }
-void SvxAccessibleTextHelper::SetEditSource( ::std::auto_ptr< SvxEditSource > pEditSource ) throw (uno::RuntimeException)
-{
+ void AccessibleTextHelper::SetEditSource( ::std::auto_ptr< SvxEditSource > pEditSource ) throw (uno::RuntimeException)
+ {
#ifdef DBG_UTIL
- mpImpl->CheckInvariants();
+ mpImpl->CheckInvariants();
- mpImpl->SetEditSource( pEditSource );
+ mpImpl->SetEditSource( pEditSource );
- mpImpl->CheckInvariants();
+ mpImpl->CheckInvariants();
#else
- mpImpl->SetEditSource( pEditSource );
+ mpImpl->SetEditSource( pEditSource );
#endif
-}
+ }
-void SvxAccessibleTextHelper::StateChangeEvent( const sal_Int16 nEventId, const uno::Any& rNewValue, const uno::Any& rOldValue ) const
-{
+ void AccessibleTextHelper::SetFocus( sal_Bool bHaveFocus ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ // TODO
+ }
+
+ sal_Bool AccessibleTextHelper::HaveFocus() throw (::com::sun::star::uno::RuntimeException)
+ {
+ // TODO
+ return sal_False;
+ }
+
+ void AccessibleTextHelper::FireEvent( const sal_Int16 nEventId, const uno::Any& rNewValue, const uno::Any& rOldValue ) const
+ {
#ifdef DBG_UTIL
- mpImpl->CheckInvariants();
+ mpImpl->CheckInvariants();
- mpImpl->FireEvent( nEventId, rNewValue, rOldValue );
+ mpImpl->FireEvent( nEventId, rNewValue, rOldValue );
- mpImpl->CheckInvariants();
+ mpImpl->CheckInvariants();
#else
- mpImpl->StateChangeEvent( nEventId, rNewValue, rOldValue );
+ mpImpl->StateChangeEvent( nEventId, rNewValue, rOldValue );
#endif
-}
+ }
-void SvxAccessibleTextHelper::SetOffset( const Point& rPoint )
-{
+ void AccessibleTextHelper::SetOffset( const Point& rPoint )
+ {
#ifdef DBG_UTIL
- mpImpl->CheckInvariants();
+ mpImpl->CheckInvariants();
- mpImpl->SetOffset( rPoint );
+ mpImpl->SetOffset( rPoint );
- mpImpl->CheckInvariants();
+ mpImpl->CheckInvariants();
#else
- mpImpl->SetOffset( rPoint );
+ mpImpl->SetOffset( rPoint );
#endif
-}
+ }
-const Point& SvxAccessibleTextHelper::GetOffset() const
-{
+ const Point& AccessibleTextHelper::GetOffset() const
+ {
#ifdef DBG_UTIL
- mpImpl->CheckInvariants();
+ mpImpl->CheckInvariants();
- const Point& rRef = mpImpl->GetOffset();
+ const Point& rRef = mpImpl->GetOffset();
- mpImpl->CheckInvariants();
+ mpImpl->CheckInvariants();
- return rRef;
+ return rRef;
#else
- return mpImpl->GetOffset();
+ return mpImpl->GetOffset();
#endif
-}
+ }
-void SvxAccessibleTextHelper::UpdateChildren() throw (::com::sun::star::uno::RuntimeException)
-{
+ void AccessibleTextHelper::SetChildrenOffset( sal_Int32 nOffset )
+ {
+ // TODO
+ }
+
+ sal_Int32 AccessibleTextHelper::GetChildrenOffset() const
+ {
+ // TODO
+ return 0;
+ }
+
+ void AccessibleTextHelper::UpdateChildren() throw (::com::sun::star::uno::RuntimeException)
+ {
#ifdef DBG_UTIL
- mpImpl->CheckInvariants();
+ mpImpl->CheckInvariants();
- mpImpl->UpdateVisibleChildren();
+ mpImpl->UpdateVisibleChildren();
- mpImpl->CheckInvariants();
+ mpImpl->CheckInvariants();
#else
- mpImpl->UpdateVisibleChildren();
+ mpImpl->UpdateVisibleChildren();
#endif
-}
+ }
-sal_Bool SvxAccessibleTextHelper::IsSelected() const
-{
+ sal_Bool AccessibleTextHelper::IsSelected() const
+ {
#ifdef DBG_UTIL
- mpImpl->CheckInvariants();
+ mpImpl->CheckInvariants();
- sal_Bool aRet = mpImpl->IsSelected();
+ sal_Bool aRet = mpImpl->IsSelected();
- mpImpl->CheckInvariants();
+ mpImpl->CheckInvariants();
- return aRet;
+ return aRet;
#else
- return mpImpl->IsSelected();
+ return mpImpl->IsSelected();
#endif
-}
+ }
-// XAccessibleContext
-sal_Int32 SvxAccessibleTextHelper::GetChildCount() throw (uno::RuntimeException)
-{
+ // XAccessibleContext
+ sal_Int32 AccessibleTextHelper::GetChildCount() throw (uno::RuntimeException)
+ {
#ifdef DBG_UTIL
- mpImpl->CheckInvariants();
+ mpImpl->CheckInvariants();
- sal_Int32 nRet = mpImpl->getAccessibleChildCount();
+ sal_Int32 nRet = mpImpl->getAccessibleChildCount();
- mpImpl->CheckInvariants();
+ mpImpl->CheckInvariants();
- return nRet;
+ return nRet;
#else
- return mpImpl->getAccessibleChildCount();
+ return mpImpl->getAccessibleChildCount();
#endif
-}
+ }
-uno::Reference< XAccessible > SvxAccessibleTextHelper::GetChild( sal_Int32 i ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
-{
+ uno::Reference< XAccessible > AccessibleTextHelper::GetChild( sal_Int32 i ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
+ {
#ifdef DBG_UTIL
- mpImpl->CheckInvariants();
+ mpImpl->CheckInvariants();
- uno::Reference< XAccessible > xRet = mpImpl->getAccessibleChild( i );
+ uno::Reference< XAccessible > xRet = mpImpl->getAccessibleChild( i );
- mpImpl->CheckInvariants();
+ mpImpl->CheckInvariants();
- return xRet;
+ return xRet;
#else
- return mpImpl->getAccessibleChild( i );
+ return mpImpl->getAccessibleChild( i );
#endif
-}
+ }
-void SvxAccessibleTextHelper::AddEventListener( const uno::Reference< XAccessibleEventListener >& xListener ) throw (uno::RuntimeException)
-{
+ void AccessibleTextHelper::AddEventListener( const uno::Reference< XAccessibleEventListener >& xListener ) throw (uno::RuntimeException)
+ {
#ifdef DBG_UTIL
- mpImpl->CheckInvariants();
+ mpImpl->CheckInvariants();
- mpImpl->addEventListener( xListener );
+ mpImpl->addEventListener( xListener );
- mpImpl->CheckInvariants();
+ mpImpl->CheckInvariants();
#else
- mpImpl->addEventListener( xListener );
+ mpImpl->addEventListener( xListener );
#endif
-}
+ }
-void SvxAccessibleTextHelper::RemoveEventListener( const uno::Reference< XAccessibleEventListener >& xListener ) throw (uno::RuntimeException)
-{
+ void AccessibleTextHelper::RemoveEventListener( const uno::Reference< XAccessibleEventListener >& xListener ) throw (uno::RuntimeException)
+ {
#ifdef DBG_UTIL
- mpImpl->CheckInvariants();
+ mpImpl->CheckInvariants();
- mpImpl->removeEventListener( xListener );
+ mpImpl->removeEventListener( xListener );
- mpImpl->CheckInvariants();
+ mpImpl->CheckInvariants();
#else
- mpImpl->removeEventListener( xListener );
+ mpImpl->removeEventListener( xListener );
#endif
-}
+ }
-// XAccessibleComponent
-uno::Reference< XAccessible > SvxAccessibleTextHelper::GetAt( const awt::Point& aPoint ) throw (uno::RuntimeException)
-{
+ // XAccessibleComponent
+ uno::Reference< XAccessible > AccessibleTextHelper::GetAt( const awt::Point& aPoint ) throw (uno::RuntimeException)
+ {
#ifdef DBG_UTIL
- mpImpl->CheckInvariants();
+ mpImpl->CheckInvariants();
- uno::Reference< XAccessible > xChild = mpImpl->getAccessibleAt( aPoint );
+ uno::Reference< XAccessible > xChild = mpImpl->getAccessibleAt( aPoint );
- mpImpl->CheckInvariants();
+ mpImpl->CheckInvariants();
- return xChild;
+ return xChild;
#else
- return mpImpl->getAccessibleAt( aPoint );
+ return mpImpl->getAccessibleAt( aPoint );
#endif
-}
+ }
+
+} // end of namespace accessibility
//------------------------------------------------------------------------