drop enum IAccessibleViewForwarderListener::ChangeType

since only one of it's values was in use, and simplify the
ViewForwarderChanged method as a consequence.

Change-Id: I00544c9b0a601c01e49519be5bafe192c6f735f6
This commit is contained in:
Noel Grandin
2016-08-24 15:51:14 +02:00
parent 3aa7db4586
commit f360244e5d
18 changed files with 35 additions and 91 deletions

View File

@@ -323,8 +323,7 @@ public:
throw (css::uno::RuntimeException, std::exception) override;
//===== IAccessibleViewForwarderListener ================================
virtual void ViewForwarderChanged (ChangeType aChangeType,
const IAccessibleViewForwarder* pViewForwarder) override;
virtual void ViewForwarderChanged() override;
//===== lang::XEventListener ============================================

View File

@@ -192,9 +192,7 @@ public:
*/
void RemoveFocus();
void ViewForwarderChanged(
IAccessibleViewForwarderListener::ChangeType aChangeType,
const IAccessibleViewForwarder* pViewForwarder);
void ViewForwarderChanged();
private:
rtl::Reference<ChildrenManagerImpl> mpImpl;

View File

@@ -39,25 +39,11 @@ class IAccessibleViewForwarder;
class IAccessibleViewForwarderListener
{
public:
/** Enumeration of the different change types.
*/
enum ChangeType {TRANSFORMATION, VISIBLE_AREA, STATE};
/** This method is called to indicate a change of the specified view
forwarder.
@param aChangeType
The type of the change. TRANSFORMATION indicates a change of
the coordinate transformation with a constant visible area. If
the visible area changes, just use VISIBLE_AREA. This changes
the transformation implicitly. The value STATE indicates a
change of the validity state. Check the IsValid method of the
view forwarder before doing further calls.
@param pViewForwarder
The modified view forwarder. It is specified just in case that
there is more than one view forwarder in use at the same time.
forwarder, specifically, a change in visible area.
*/
virtual void ViewForwarderChanged (ChangeType aChangeType,
const IAccessibleViewForwarder* pViewForwarder) = 0;
virtual void ViewForwarderChanged() = 0;
protected:
~IAccessibleViewForwarderListener() {}

View File

@@ -1377,13 +1377,12 @@ namespace
{
struct ScVisAreaChanged
{
ScAccessibleDocument* mpAccDoc;
explicit ScVisAreaChanged(ScAccessibleDocument* pAccDoc) : mpAccDoc(pAccDoc) {}
explicit ScVisAreaChanged() {}
void operator() (const ScAccessibleShapeData* pAccShapeData) const
{
if (pAccShapeData && pAccShapeData->pAccShape.is())
{
pAccShapeData->pAccShape->ViewForwarderChanged(::accessibility::IAccessibleViewForwarderListener::VISIBLE_AREA, mpAccDoc);
pAccShapeData->pAccShape->ViewForwarderChanged();
}
}
};
@@ -1391,7 +1390,7 @@ namespace
void ScChildrenShapes::VisAreaChanged() const
{
ScVisAreaChanged aVisAreaChanged(mpAccessibleDocument);
ScVisAreaChanged aVisAreaChanged;
std::for_each(maZOrderedShapes.begin(), maZOrderedShapes.end(), aVisAreaChanged);
}

View File

@@ -806,7 +806,7 @@ namespace
{
if (rAccShapeData.mpAccShape.is())
{
rAccShapeData.mpAccShape->ViewForwarderChanged(::accessibility::IAccessibleViewForwarderListener::VISIBLE_AREA, mpViewForwarder);
rAccShapeData.mpAccShape->ViewForwarderChanged();
}
}
};

View File

@@ -212,7 +212,7 @@ IMPL_LINK_TYPED(AccessibleDocumentViewBase, WindowChildEventListener,
//===== IAccessibleViewForwarderListener ====================================
void AccessibleDocumentViewBase::ViewForwarderChanged(ChangeType, const IAccessibleViewForwarder* )
void AccessibleDocumentViewBase::ViewForwarderChanged()
{
// Empty
}
@@ -558,9 +558,7 @@ void SAL_CALL
if( IsDisposed() )
return;
ViewForwarderChanged (
IAccessibleViewForwarderListener::VISIBLE_AREA,
&maViewForwarder);
ViewForwarderChanged();
}
void SAL_CALL
@@ -570,9 +568,7 @@ void SAL_CALL
if( IsDisposed() )
return;
ViewForwarderChanged (
IAccessibleViewForwarderListener::VISIBLE_AREA,
&maViewForwarder);
ViewForwarderChanged();
}
void SAL_CALL
@@ -582,9 +578,7 @@ void SAL_CALL
if( IsDisposed() )
return;
ViewForwarderChanged (
IAccessibleViewForwarderListener::VISIBLE_AREA,
&maViewForwarder);
ViewForwarderChanged();
}
void SAL_CALL
@@ -594,9 +588,7 @@ void SAL_CALL
if( IsDisposed() )
return;
ViewForwarderChanged (
IAccessibleViewForwarderListener::VISIBLE_AREA,
&maViewForwarder);
ViewForwarderChanged();
}
//===== XFocusListener ==================================================

View File

@@ -123,12 +123,11 @@ void AccessibleDrawDocumentView::Init()
mpChildrenManager->UpdateSelection ();
}
void AccessibleDrawDocumentView::ViewForwarderChanged (ChangeType aChangeType,
const IAccessibleViewForwarder* pViewForwarder)
void AccessibleDrawDocumentView::ViewForwarderChanged()
{
AccessibleDocumentViewBase::ViewForwarderChanged (aChangeType, pViewForwarder);
AccessibleDocumentViewBase::ViewForwarderChanged();
if (mpChildrenManager != nullptr)
mpChildrenManager->ViewForwarderChanged (aChangeType, pViewForwarder);
mpChildrenManager->ViewForwarderChanged();
}
/** The page shape is created on every call at the moment (provided that
@@ -335,9 +334,7 @@ void SAL_CALL
{
OSL_TRACE (" visible area changed");
if (mpChildrenManager != nullptr)
mpChildrenManager->ViewForwarderChanged (
IAccessibleViewForwarderListener::VISIBLE_AREA,
&maViewForwarder);
mpChildrenManager->ViewForwarderChanged();
}
else if (rEventObject.PropertyName == "ActiveLayer")
{

View File

@@ -103,10 +103,9 @@ void AccessibleOutlineView::Init()
AccessibleDocumentViewBase::Init ();
}
void AccessibleOutlineView::ViewForwarderChanged (ChangeType aChangeType,
const IAccessibleViewForwarder* pViewForwarder)
void AccessibleOutlineView::ViewForwarderChanged()
{
AccessibleDocumentViewBase::ViewForwarderChanged (aChangeType, pViewForwarder);
AccessibleDocumentViewBase::ViewForwarderChanged();
UpdateChildren();
}

View File

@@ -134,8 +134,7 @@ public:
windowResized... methods it will be sufficient in most cases just to
override this method.
*/
virtual void ViewForwarderChanged (ChangeType aChangeType,
const IAccessibleViewForwarder* pViewForwarder) override;
virtual void ViewForwarderChanged() override;
//===== XAccessibleContext ==============================================

View File

@@ -54,8 +54,7 @@ public:
//===== IAccessibleViewForwarderListener ================================
virtual void ViewForwarderChanged (ChangeType aChangeType,
const IAccessibleViewForwarder* pViewForwarder) override;
virtual void ViewForwarderChanged() override;
//===== XAccessibleContext ==============================================

View File

@@ -52,8 +52,7 @@ public:
//===== IAccessibleViewForwarderListener ================================
virtual void ViewForwarderChanged (ChangeType aChangeType,
const IAccessibleViewForwarder* pViewForwarder) override;
virtual void ViewForwarderChanged() override;
//===== XAccessibleContext ==============================================

View File

@@ -1087,8 +1087,7 @@ sal_Int64 SAL_CALL
}
// IAccessibleViewForwarderListener
void AccessibleShape::ViewForwarderChanged (ChangeType aChangeType,
const IAccessibleViewForwarder* pViewForwarder)
void AccessibleShape::ViewForwarderChanged()
{
// Inform all listeners that the graphical representation (i.e. size
// and/or position) of the shape has changed.
@@ -1098,7 +1097,7 @@ void AccessibleShape::ViewForwarderChanged (ChangeType aChangeType,
// Tell children manager of the modified view forwarder.
if (mpChildrenManager != nullptr)
mpChildrenManager->ViewForwarderChanged (aChangeType, pViewForwarder);
mpChildrenManager->ViewForwarderChanged();
// update our children that our screen position might have changed
if( mpText )

View File

@@ -115,11 +115,9 @@ void ChildrenManager::RemoveFocus()
}
// IAccessibleViewForwarderListener
void ChildrenManager::ViewForwarderChanged(
IAccessibleViewForwarderListener::ChangeType aChangeType,
const IAccessibleViewForwarder* pViewForwarder)
void ChildrenManager::ViewForwarderChanged()
{
mpImpl->ViewForwarderChanged (aChangeType, pViewForwarder);
mpImpl->ViewForwarderChanged();
}
} // end of namespace accessibility

View File

@@ -403,9 +403,7 @@ void ChildrenManagerImpl::SendVisibleAreaEvents (
// as a result of a change of the view forwarder).
AccessibleShape* pShape = I->GetAccessibleShape ();
if (pShape != nullptr)
pShape->ViewForwarderChanged (
IAccessibleViewForwarderListener::VISIBLE_AREA,
maShapeTreeInfo.GetViewForwarder());
pShape->ViewForwarderChanged();
}
}
@@ -729,22 +727,9 @@ void SAL_CALL ChildrenManagerImpl::disposing()
}
// IAccessibleViewForwarderListener
void ChildrenManagerImpl::ViewForwarderChanged (ChangeType aChangeType,
const IAccessibleViewForwarder* pViewForwarder)
void ChildrenManagerImpl::ViewForwarderChanged()
{
if (aChangeType == IAccessibleViewForwarderListener::VISIBLE_AREA)
Update (false);
else
{
SolarMutexGuard g;
ChildDescriptorListType::const_iterator aEnd = maVisibleChildren.end();
for (ChildDescriptorListType::iterator I=maVisibleChildren.begin(); I != aEnd; ++I)
{
AccessibleShape* pShape = I->GetAccessibleShape();
if (pShape != nullptr)
pShape->ViewForwarderChanged (aChangeType, pViewForwarder);
}
}
Update(false);
}
// IAccessibleParent

View File

@@ -262,8 +262,7 @@ public:
@param pViewForwarder
The modified view forwarder. Use this one from now on.
*/
virtual void ViewForwarderChanged (ChangeType aChangeType,
const IAccessibleViewForwarder* pViewForwarder) override;
virtual void ViewForwarderChanged() override;
// IAccessibleParent
/** Replace the specified child with a replacement.
@@ -393,7 +392,7 @@ private:
Events are sent to all entries of this list that already contain
an accessible object.
*/
void SendVisibleAreaEvents (ChildDescriptorListType& raChildList);
static void SendVisibleAreaEvents (ChildDescriptorListType& raChildList);
/** If children have to be created immediately and not on demand the
create the missing accessible objects now.

View File

@@ -492,7 +492,7 @@ Sequence<OUString> SAL_CALL AccessibleCell::getSupportedServiceNames() throw (Ru
// IAccessibleViewForwarderListener
void AccessibleCell::ViewForwarderChanged (ChangeType /*aChangeType*/, const IAccessibleViewForwarder* /*pViewForwarder*/)
void AccessibleCell::ViewForwarderChanged()
{
// Inform all listeners that the graphical representation (i.e. size
// and/or position) of the shape has changed.

View File

@@ -101,7 +101,7 @@ public:
virtual css::uno::Sequence< OUString> SAL_CALL getSupportedServiceNames() throw(css::uno::RuntimeException, std::exception) override;
// IAccessibleViewForwarderListener
virtual void ViewForwarderChanged (ChangeType aChangeType, const IAccessibleViewForwarder* pViewForwarder) override;
virtual void ViewForwarderChanged() override;
// Misc

View File

@@ -227,9 +227,7 @@ void SwAccessibleContext::ChildrenScrolled( const SwFrame *pFrame,
{
case Action::SCROLLED:
case Action::SCROLLED_WITHIN:
xAccImpl->ViewForwarderChanged(
::accessibility::IAccessibleViewForwarderListener::VISIBLE_AREA,
GetMap() );
xAccImpl->ViewForwarderChanged();
break;
case Action::SCROLLED_IN:
ScrolledInShape( rLower.GetDrawObject(),
@@ -237,9 +235,7 @@ void SwAccessibleContext::ChildrenScrolled( const SwFrame *pFrame,
break;
case Action::SCROLLED_OUT:
{
xAccImpl->ViewForwarderChanged(
::accessibility::IAccessibleViewForwarderListener::VISIBLE_AREA,
GetMap() );
xAccImpl->ViewForwarderChanged();
// this DisposeShape call was removed by
// IAccessibility2 implementation
// without giving any reason why