Kaydet (Commit) 1d2244ec authored tarafından Michael Stahl's avatar Michael Stahl

sw: remove SwAccessibleDocument XEventListener buggy dead code

This was added with IA2, but evidently it's dead - the listener is never
registered at the broadcaster.  Also the first of the events it is
listening for does not exist, and the others are actually called
"OnLoadFinished" and "OnLayoutFinished".

Also remove the "isIfAsynLoad" [sic] member.

Change-Id: Ib261c193289e415af91b3097c525e90ef051f824
üst 8c7928b6
......@@ -521,9 +521,7 @@ SwAccessibleContext::SwAccessibleContext( SwAccessibleMap *const pMap,
, m_nRole(nRole)
, m_isDisposing( false )
, m_isRegisteredAtAccessibleMap( true )
//Initialize the begin document load and IfAsynLoad to true
, m_isBeginDocumentLoad( true )
, isIfAsynLoad( true )
, m_isSelectedInDoc(false)
{
InitStates();
......@@ -589,16 +587,13 @@ uno::Reference< XAccessible> SAL_CALL
FireStateChangedEvent( AccessibleStateType::FOCUSABLE,true );
FireStateChangedEvent( AccessibleStateType::BUSY,true );
if( !isIfAsynLoad )
{
FireStateChangedEvent( AccessibleStateType::FOCUSED,true );
// OFFSCREEN == !SHOWING, should stay consistent
// FireStateChangedEvent( AccessibleStateType::OFFSCREEN,true );
FireStateChangedEvent( AccessibleStateType::SHOWING,true );
FireStateChangedEvent( AccessibleStateType::BUSY,false );
// OFFSCREEN again?
// FireStateChangedEvent( AccessibleStateType::OFFSCREEN,false );
}
FireStateChangedEvent( AccessibleStateType::FOCUSED,true );
// OFFSCREEN == !SHOWING, should stay consistent
// FireStateChangedEvent( AccessibleStateType::OFFSCREEN,true );
FireStateChangedEvent( AccessibleStateType::SHOWING,true );
FireStateChangedEvent( AccessibleStateType::BUSY,false );
// OFFSCREEN again?
// FireStateChangedEvent( AccessibleStateType::OFFSCREEN,false );
m_isBeginDocumentLoad = false;
}
if( xChildImpl.is() )
......
......@@ -98,8 +98,6 @@ protected:
{
return m_nRole;
}
//Add a member to identify if the document is Asyn load.
bool isIfAsynLoad;
//This flag is used to mark the object's selected state.
bool m_isSelectedInDoc;
void SetParent( SwAccessibleContext *pParent );
......
......@@ -465,12 +465,6 @@ uno::Any SwAccessibleDocument::queryInterface(
uno::Reference<XAccessibleSelection> aSelect = this;
aRet <<= aSelect;
}
//Add XEventListener interface support.
else if ( (rType == cppu::UnoType<com::sun::star::document::XEventListener>::get()) )
{
uno::Reference<com::sun::star::document::XEventListener> aSelect = this;
aRet <<= aSelect;
}
else if ( rType == cppu::UnoType<XAccessibleExtendedAttributes>::get())
{
uno::Reference<XAccessibleExtendedAttributes> aAttribute = this;
......@@ -494,13 +488,10 @@ uno::Sequence< uno::Type > SAL_CALL SwAccessibleDocument::getTypes()
sal_Int32 nIndex = aTypes.getLength();
//Reset types memory alloc
//aTypes.realloc( nIndex + 1 );
aTypes.realloc( nIndex + 2 );
aTypes.realloc( nIndex + 1 );
uno::Type* pTypes = aTypes.getArray();
pTypes[nIndex] = cppu::UnoType<XAccessibleSelection>::get();
//Add XEventListener interface support.
pTypes[nIndex + 1 ] = cppu::UnoType<com::sun::star::document::XEventListener>::get();
return aTypes;
}
......@@ -562,40 +553,6 @@ void SwAccessibleDocument::deselectAccessibleChild(
maSelectionHelper.deselectAccessibleChild( nChildIndex );
}
//Implement XEventListener interfaces
void SAL_CALL SwAccessibleDocument::notifyEvent( const ::com::sun::star::document::EventObject& Event )
throw (::com::sun::star::uno::RuntimeException, std::exception)
{
SolarMutexGuard g;
if ( Event.EventName == "FirstPageShows" )
{
FireStateChangedEvent( AccessibleStateType::FOCUSED,true );
}
else if ( Event.EventName == "LoadFinished" )
{
// IA2 CWS. MT: OFFSCREEN == !SHOWING, should stay consistent
// FireStateChangedEvent( AccessibleStateType::OFFSCREEN,true );
// MT: LoadFinished => Why not SHOWING == TRUE?
FireStateChangedEvent( AccessibleStateType::SHOWING,false );
}
else if ( Event.EventName == "FormatFinished" )
{
FireStateChangedEvent( AccessibleStateType::BUSY,false );
// FireStateChangedEvent( AccessibleStateType::OFFSCREEN,false );
FireStateChangedEvent( AccessibleStateType::SHOWING,true );
}
else
{
isIfAsynLoad = false;
}
}
void SAL_CALL SwAccessibleDocument::disposing( const ::com::sun::star::lang::EventObject& )
throw (::com::sun::star::uno::RuntimeException, std::exception)
{
}
uno::Any SAL_CALL SwAccessibleDocument::getExtendedAttributes()
throw (::com::sun::star::lang::IndexOutOfBoundsException,
::com::sun::star::uno::RuntimeException,
......
......@@ -107,7 +107,6 @@ public:
*/
class SwAccessibleDocument : public SwAccessibleDocumentBase,
public com::sun::star::accessibility::XAccessibleSelection,
public com::sun::star::document::XEventListener,
public com::sun::star::accessibility::XAccessibleExtendedAttributes,
public com::sun::star::accessibility::XAccessibleGetAccFlowTo
{
......@@ -125,11 +124,6 @@ public:
SwAccessibleDocument( SwAccessibleMap* pInitMap );
DECL_LINK( WindowChildEventListener, VclSimpleEvent* );
// XEventListener
virtual void SAL_CALL notifyEvent( const ::com::sun::star::document::EventObject& Event )
throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Event )
throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
// XServiceInfo
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment