renaissance1: #i107215# Integrated accessibility fix from other CWS impressaccessibility7.
This commit is contained in:
@@ -72,7 +72,6 @@ public:
|
|||||||
::Window* pWindow);
|
::Window* pWindow);
|
||||||
~Implementation (void);
|
~Implementation (void);
|
||||||
|
|
||||||
void UpdateVisibility (void);
|
|
||||||
void UpdateChildren (void);
|
void UpdateChildren (void);
|
||||||
void Clear (void);
|
void Clear (void);
|
||||||
sal_Int32 GetVisibleChildCount (void) const;
|
sal_Int32 GetVisibleChildCount (void) const;
|
||||||
@@ -85,6 +84,7 @@ public:
|
|||||||
DECL_LINK(WindowEventListener, VclWindowEvent*);
|
DECL_LINK(WindowEventListener, VclWindowEvent*);
|
||||||
DECL_LINK(SelectionChangeListener, void*);
|
DECL_LINK(SelectionChangeListener, void*);
|
||||||
DECL_LINK(FocusChangeListener, void*);
|
DECL_LINK(FocusChangeListener, void*);
|
||||||
|
DECL_LINK(VisibilityChangeListener, void*);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AccessibleSlideSorterView& mrAccessibleSlideSorter;
|
AccessibleSlideSorterView& mrAccessibleSlideSorter;
|
||||||
@@ -789,7 +789,6 @@ AccessibleSlideSorterView::Implementation::Implementation (
|
|||||||
{
|
{
|
||||||
ConnectListeners();
|
ConnectListeners();
|
||||||
UpdateChildren();
|
UpdateChildren();
|
||||||
UpdateVisibility();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -804,23 +803,26 @@ AccessibleSlideSorterView::Implementation::~Implementation (void)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void AccessibleSlideSorterView::Implementation::UpdateVisibility (void)
|
|
||||||
{
|
|
||||||
Pair aRange (mrSlideSorter.GetView().GetVisiblePageRange());
|
|
||||||
mnFirstVisibleChild = aRange.A();
|
|
||||||
mnLastVisibleChild = aRange.B();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void AccessibleSlideSorterView::Implementation::UpdateChildren (void)
|
void AccessibleSlideSorterView::Implementation::UpdateChildren (void)
|
||||||
{
|
{
|
||||||
// Clear the list of accessible children and adapt its size. It is
|
if (mbModelChangeLocked)
|
||||||
// refilled on demand when later the children are requested.
|
{
|
||||||
|
// Do nothing right now. When the flag is reset, this method is
|
||||||
|
// called again.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Pair aRange (mrSlideSorter.GetView().GetVisiblePageRange());
|
||||||
|
mnFirstVisibleChild = aRange.A();
|
||||||
|
mnLastVisibleChild = aRange.B();
|
||||||
|
|
||||||
|
// Release all children.
|
||||||
Clear();
|
Clear();
|
||||||
|
|
||||||
|
// Create new children for the modified visible range.
|
||||||
maPageObjects.resize(mrSlideSorter.GetModel().GetPageCount());
|
maPageObjects.resize(mrSlideSorter.GetModel().GetPageCount());
|
||||||
UpdateVisibility();
|
for (sal_Int32 nIndex(mnFirstVisibleChild); nIndex<=mnLastVisibleChild; ++nIndex)
|
||||||
|
GetAccessibleChild(nIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -833,6 +835,11 @@ void AccessibleSlideSorterView::Implementation::Clear (void)
|
|||||||
for (iPageObject=maPageObjects.begin(); iPageObject!=iEnd; ++iPageObject)
|
for (iPageObject=maPageObjects.begin(); iPageObject!=iEnd; ++iPageObject)
|
||||||
if (*iPageObject != NULL)
|
if (*iPageObject != NULL)
|
||||||
{
|
{
|
||||||
|
mrAccessibleSlideSorter.FireAccessibleEvent(
|
||||||
|
AccessibleEventId::CHILD,
|
||||||
|
Any(Reference<XAccessible>(iPageObject->get())),
|
||||||
|
Any());
|
||||||
|
|
||||||
Reference<XComponent> xComponent (Reference<XWeak>(iPageObject->get()), UNO_QUERY);
|
Reference<XComponent> xComponent (Reference<XWeak>(iPageObject->get()), UNO_QUERY);
|
||||||
if (xComponent.is())
|
if (xComponent.is())
|
||||||
xComponent->dispose();
|
xComponent->dispose();
|
||||||
@@ -846,7 +853,7 @@ void AccessibleSlideSorterView::Implementation::Clear (void)
|
|||||||
|
|
||||||
sal_Int32 AccessibleSlideSorterView::Implementation::GetVisibleChildCount (void) const
|
sal_Int32 AccessibleSlideSorterView::Implementation::GetVisibleChildCount (void) const
|
||||||
{
|
{
|
||||||
if (mnFirstVisibleChild <= mnLastVisibleChild && mnFirstVisibleChild>=0)
|
if (mnFirstVisibleChild<=mnLastVisibleChild && mnFirstVisibleChild>=0)
|
||||||
return mnLastVisibleChild - mnFirstVisibleChild + 1;
|
return mnLastVisibleChild - mnFirstVisibleChild + 1;
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
@@ -869,8 +876,6 @@ AccessibleSlideSorterObject* AccessibleSlideSorterView::Implementation::GetVisib
|
|||||||
AccessibleSlideSorterObject* AccessibleSlideSorterView::Implementation::GetAccessibleChild (
|
AccessibleSlideSorterObject* AccessibleSlideSorterView::Implementation::GetAccessibleChild (
|
||||||
sal_Int32 nIndex)
|
sal_Int32 nIndex)
|
||||||
{
|
{
|
||||||
OSL_ASSERT(nIndex>=0 && (sal_uInt32)nIndex<maPageObjects.size());
|
|
||||||
|
|
||||||
AccessibleSlideSorterObject* pChild = NULL;
|
AccessibleSlideSorterObject* pChild = NULL;
|
||||||
|
|
||||||
if (nIndex>=0 && (sal_uInt32)nIndex<maPageObjects.size())
|
if (nIndex>=0 && (sal_uInt32)nIndex<maPageObjects.size())
|
||||||
@@ -880,14 +885,26 @@ AccessibleSlideSorterObject* AccessibleSlideSorterView::Implementation::GetAcces
|
|||||||
::sd::slidesorter::model::SharedPageDescriptor pDescriptor(
|
::sd::slidesorter::model::SharedPageDescriptor pDescriptor(
|
||||||
mrSlideSorter.GetModel().GetPageDescriptor(nIndex));
|
mrSlideSorter.GetModel().GetPageDescriptor(nIndex));
|
||||||
if (pDescriptor.get() != NULL)
|
if (pDescriptor.get() != NULL)
|
||||||
|
{
|
||||||
maPageObjects[nIndex] = new AccessibleSlideSorterObject(
|
maPageObjects[nIndex] = new AccessibleSlideSorterObject(
|
||||||
&mrAccessibleSlideSorter,
|
&mrAccessibleSlideSorter,
|
||||||
mrSlideSorter,
|
mrSlideSorter,
|
||||||
(pDescriptor->GetPage()->GetPageNum()-1)/2);
|
(pDescriptor->GetPage()->GetPageNum()-1)/2);
|
||||||
|
|
||||||
|
mrAccessibleSlideSorter.FireAccessibleEvent(
|
||||||
|
AccessibleEventId::CHILD,
|
||||||
|
Any(),
|
||||||
|
Any(Reference<XAccessible>(maPageObjects[nIndex].get())));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pChild = maPageObjects[nIndex].get();
|
pChild = maPageObjects[nIndex].get();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
OSL_ASSERT(nIndex>=0 && (sal_uInt32)nIndex<maPageObjects.size());
|
||||||
|
}
|
||||||
|
|
||||||
return pChild;
|
return pChild;
|
||||||
}
|
}
|
||||||
@@ -908,9 +925,10 @@ void AccessibleSlideSorterView::Implementation::ConnectListeners (void)
|
|||||||
|
|
||||||
mrSlideSorter.GetController().GetSelectionManager()->AddSelectionChangeListener(
|
mrSlideSorter.GetController().GetSelectionManager()->AddSelectionChangeListener(
|
||||||
LINK(this,AccessibleSlideSorterView::Implementation,SelectionChangeListener));
|
LINK(this,AccessibleSlideSorterView::Implementation,SelectionChangeListener));
|
||||||
|
|
||||||
mrSlideSorter.GetController().GetFocusManager().AddFocusChangeListener(
|
mrSlideSorter.GetController().GetFocusManager().AddFocusChangeListener(
|
||||||
LINK(this,AccessibleSlideSorterView::Implementation,FocusChangeListener));
|
LINK(this,AccessibleSlideSorterView::Implementation,FocusChangeListener));
|
||||||
|
mrSlideSorter.GetView().AddVisibilityChangeListener(
|
||||||
|
LINK(this,AccessibleSlideSorterView::Implementation,VisibilityChangeListener));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -920,9 +938,10 @@ void AccessibleSlideSorterView::Implementation::ReleaseListeners (void)
|
|||||||
{
|
{
|
||||||
mrSlideSorter.GetController().GetFocusManager().RemoveFocusChangeListener(
|
mrSlideSorter.GetController().GetFocusManager().RemoveFocusChangeListener(
|
||||||
LINK(this,AccessibleSlideSorterView::Implementation,FocusChangeListener));
|
LINK(this,AccessibleSlideSorterView::Implementation,FocusChangeListener));
|
||||||
|
|
||||||
mrSlideSorter.GetController().GetSelectionManager()->RemoveSelectionChangeListener(
|
mrSlideSorter.GetController().GetSelectionManager()->RemoveSelectionChangeListener(
|
||||||
LINK(this,AccessibleSlideSorterView::Implementation,SelectionChangeListener));
|
LINK(this,AccessibleSlideSorterView::Implementation,SelectionChangeListener));
|
||||||
|
mrSlideSorter.GetView().RemoveVisibilityChangeListener(
|
||||||
|
LINK(this,AccessibleSlideSorterView::Implementation,VisibilityChangeListener));
|
||||||
|
|
||||||
if (mpWindow != NULL)
|
if (mpWindow != NULL)
|
||||||
mpWindow->RemoveEventListener(
|
mpWindow->RemoveEventListener(
|
||||||
@@ -950,14 +969,7 @@ void AccessibleSlideSorterView::Implementation::Notify (
|
|||||||
switch (rSdrHint.GetKind())
|
switch (rSdrHint.GetKind())
|
||||||
{
|
{
|
||||||
case HINT_PAGEORDERCHG:
|
case HINT_PAGEORDERCHG:
|
||||||
if ( ! mbModelChangeLocked)
|
UpdateChildren();
|
||||||
{
|
|
||||||
UpdateChildren();
|
|
||||||
mrAccessibleSlideSorter.FireAccessibleEvent(
|
|
||||||
AccessibleEventId::INVALIDATE_ALL_CHILDREN,
|
|
||||||
Any(),
|
|
||||||
Any());
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -975,10 +987,6 @@ void AccessibleSlideSorterView::Implementation::Notify (
|
|||||||
case sd::ViewShellHint::HINT_COMPLEX_MODEL_CHANGE_END:
|
case sd::ViewShellHint::HINT_COMPLEX_MODEL_CHANGE_END:
|
||||||
mbModelChangeLocked = false;
|
mbModelChangeLocked = false;
|
||||||
UpdateChildren();
|
UpdateChildren();
|
||||||
mrAccessibleSlideSorter.FireAccessibleEvent(
|
|
||||||
AccessibleEventId::INVALIDATE_ALL_CHILDREN,
|
|
||||||
Any(),
|
|
||||||
Any());
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -995,11 +1003,7 @@ IMPL_LINK(AccessibleSlideSorterView::Implementation, WindowEventListener, VclWin
|
|||||||
{
|
{
|
||||||
case VCLEVENT_WINDOW_MOVE:
|
case VCLEVENT_WINDOW_MOVE:
|
||||||
case VCLEVENT_WINDOW_RESIZE:
|
case VCLEVENT_WINDOW_RESIZE:
|
||||||
UpdateVisibility();
|
UpdateChildren();
|
||||||
mrAccessibleSlideSorter.FireAccessibleEvent(
|
|
||||||
AccessibleEventId::INVALIDATE_ALL_CHILDREN,
|
|
||||||
Any(),
|
|
||||||
Any());
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VCLEVENT_WINDOW_GETFOCUS:
|
case VCLEVENT_WINDOW_GETFOCUS:
|
||||||
@@ -1061,4 +1065,16 @@ IMPL_LINK(AccessibleSlideSorterView::Implementation, FocusChangeListener, void*,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
IMPL_LINK(AccessibleSlideSorterView::Implementation, VisibilityChangeListener, void*, EMPTYARG )
|
||||||
|
{
|
||||||
|
UpdateChildren();
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // end of namespace ::accessibility
|
} // end of namespace ::accessibility
|
||||||
|
@@ -528,9 +528,9 @@ void Clipboard::DragFinished (sal_Int8 nDropAction)
|
|||||||
aDraggedPage!=maPagesToRemove.end();
|
aDraggedPage!=maPagesToRemove.end();
|
||||||
aDraggedPage++)
|
aDraggedPage++)
|
||||||
{
|
{
|
||||||
rSelector.SelectPage (*aDraggedPage);
|
rSelector.SelectPage(*aDraggedPage);
|
||||||
}
|
}
|
||||||
mrController.GetSelectionManager()->DeleteSelectedPages ();
|
mrController.GetSelectionManager()->DeleteSelectedPages();
|
||||||
}
|
}
|
||||||
mpUndoContext.reset();
|
mpUndoContext.reset();
|
||||||
mpSelectionObserverContext.reset();
|
mpSelectionObserverContext.reset();
|
||||||
|
@@ -160,6 +160,7 @@ void SelectionManager::DeleteSelectedPages (const bool bSelectFollowingPage)
|
|||||||
nNewCurrentSlide = 0;
|
nNewCurrentSlide = 0;
|
||||||
else if (nNewCurrentSlide >= mrSlideSorter.GetModel().GetPageCount())
|
else if (nNewCurrentSlide >= mrSlideSorter.GetModel().GetPageCount())
|
||||||
nNewCurrentSlide = mrSlideSorter.GetModel().GetPageCount()-1;
|
nNewCurrentSlide = mrSlideSorter.GetModel().GetPageCount()-1;
|
||||||
|
mrController.GetPageSelector().CountSelectedPages();
|
||||||
mrController.GetPageSelector().SelectPage(nNewCurrentSlide);
|
mrController.GetPageSelector().SelectPage(nNewCurrentSlide);
|
||||||
mrController.GetFocusManager().SetFocusedPage(nNewCurrentSlide);
|
mrController.GetFocusManager().SetFocusedPage(nNewCurrentSlide);
|
||||||
}
|
}
|
||||||
|
@@ -161,6 +161,11 @@ public:
|
|||||||
const ::boost::shared_ptr<PageSelection>& rSelection,
|
const ::boost::shared_ptr<PageSelection>& rSelection,
|
||||||
const bool bUpdateCurrentPage = true);
|
const bool bUpdateCurrentPage = true);
|
||||||
|
|
||||||
|
/** Call this method after the the model has changed to set the number
|
||||||
|
of selected pages.
|
||||||
|
*/
|
||||||
|
void CountSelectedPages (void);
|
||||||
|
|
||||||
/** Use the UpdateLock whenever you do a complex selection, i.e. call
|
/** Use the UpdateLock whenever you do a complex selection, i.e. call
|
||||||
more than one method in a row. An active lock prevents intermediate
|
more than one method in a row. An active lock prevents intermediate
|
||||||
changes of the current slide.
|
changes of the current slide.
|
||||||
@@ -214,7 +219,6 @@ private:
|
|||||||
*/
|
*/
|
||||||
void DisableBroadcasting (void);
|
void DisableBroadcasting (void);
|
||||||
|
|
||||||
void CountSelectedPages (void);
|
|
||||||
void UpdateCurrentPage (const bool bUpdateOnlyWhenPending = false);
|
void UpdateCurrentPage (const bool bUpdateOnlyWhenPending = false);
|
||||||
|
|
||||||
void CheckConsistency (void) const;
|
void CheckConsistency (void) const;
|
||||||
|
@@ -195,7 +195,22 @@ public:
|
|||||||
/** Add a shape to the page. Typically used from inside
|
/** Add a shape to the page. Typically used from inside
|
||||||
PostModelChange().
|
PostModelChange().
|
||||||
*/
|
*/
|
||||||
void AddSdrObject (SdrObject& rObject);
|
// void AddSdrObject (SdrObject& rObject);
|
||||||
|
|
||||||
|
/** Add a listener that is called when the set of visible slides.
|
||||||
|
@param rListener
|
||||||
|
When this method is called multiple times for the same listener
|
||||||
|
the second and all following calls are ignored. Each listener
|
||||||
|
is added only once.
|
||||||
|
*/
|
||||||
|
void AddVisibilityChangeListener (const Link& rListener);
|
||||||
|
|
||||||
|
/** Remove a listener that is called when the set of visible slides changes.
|
||||||
|
@param rListener
|
||||||
|
It is save to pass a listener that was not added or has been
|
||||||
|
removed previously. Such calls are ignored.
|
||||||
|
*/
|
||||||
|
void RemoveVisibilityChangeListener (const Link& rListener);
|
||||||
|
|
||||||
/** The page under the mouse is not highlighted in some contexts. Call
|
/** The page under the mouse is not highlighted in some contexts. Call
|
||||||
this method on context changes.
|
this method on context changes.
|
||||||
@@ -269,6 +284,7 @@ private:
|
|||||||
::boost::scoped_ptr<ButtonBar> mpButtonBar;
|
::boost::scoped_ptr<ButtonBar> mpButtonBar;
|
||||||
::boost::scoped_ptr<ToolTip> mpToolTip;
|
::boost::scoped_ptr<ToolTip> mpToolTip;
|
||||||
bool mbIsRearrangePending;
|
bool mbIsRearrangePending;
|
||||||
|
::std::vector<Link> maVisibilityChangeListeners;
|
||||||
|
|
||||||
/** Determine the visibility of all page objects.
|
/** Determine the visibility of all page objects.
|
||||||
*/
|
*/
|
||||||
|
@@ -81,6 +81,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace ::sd::slidesorter::model;
|
using namespace ::sd::slidesorter::model;
|
||||||
using namespace ::drawinglayer::primitive2d;
|
using namespace ::drawinglayer::primitive2d;
|
||||||
@@ -167,7 +168,8 @@ SlideSorterView::SlideSorterView (SlideSorter& rSlideSorter)
|
|||||||
new BackgroundPainter(mrSlideSorter.GetTheme()->GetColor(Theme::Color_Background))),
|
new BackgroundPainter(mrSlideSorter.GetTheme()->GetColor(Theme::Color_Background))),
|
||||||
mpButtonBar(new ButtonBar(mrSlideSorter)),
|
mpButtonBar(new ButtonBar(mrSlideSorter)),
|
||||||
mpToolTip(new ToolTip(mrSlideSorter)),
|
mpToolTip(new ToolTip(mrSlideSorter)),
|
||||||
mbIsRearrangePending(true)
|
mbIsRearrangePending(true),
|
||||||
|
maVisibilityChangeListeners()
|
||||||
{
|
{
|
||||||
// Hide the page that contains the page objects.
|
// Hide the page that contains the page objects.
|
||||||
SetPageVisible (FALSE);
|
SetPageVisible (FALSE);
|
||||||
@@ -561,7 +563,25 @@ void SlideSorterView::DeterminePageObjectVisibilities (void)
|
|||||||
PageDescriptor::ST_Visible,
|
PageDescriptor::ST_Visible,
|
||||||
aRange.IsInside(nIndex));
|
aRange.IsInside(nIndex));
|
||||||
}
|
}
|
||||||
maVisiblePageRange = aRange;
|
|
||||||
|
// Broadcast a change of the set of visible page objects.
|
||||||
|
if (maVisiblePageRange != aRange)
|
||||||
|
{
|
||||||
|
maVisiblePageRange = aRange;
|
||||||
|
|
||||||
|
// Tell the listeners that the visibility of some objects has
|
||||||
|
// changed.
|
||||||
|
::std::vector<Link>& aChangeListeners (maVisibilityChangeListeners);
|
||||||
|
for (::std::vector<Link>::const_iterator
|
||||||
|
iLink(aChangeListeners.begin()),
|
||||||
|
iEnd(aChangeListeners.end());
|
||||||
|
iLink!=iEnd;
|
||||||
|
++iLink)
|
||||||
|
{
|
||||||
|
iLink->Call(NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Restore the mouse over state.
|
// Restore the mouse over state.
|
||||||
UpdatePageUnderMouse(true);
|
UpdatePageUnderMouse(true);
|
||||||
@@ -831,6 +851,32 @@ Pair SlideSorterView::GetVisiblePageRange (void)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void SlideSorterView::AddVisibilityChangeListener (const Link& rListener)
|
||||||
|
{
|
||||||
|
if (::std::find (
|
||||||
|
maVisibilityChangeListeners.begin(),
|
||||||
|
maVisibilityChangeListeners.end(),
|
||||||
|
rListener) == maVisibilityChangeListeners.end())
|
||||||
|
{
|
||||||
|
maVisibilityChangeListeners.push_back(rListener);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void SlideSorterView::RemoveVisibilityChangeListener(const Link&rListener)
|
||||||
|
{
|
||||||
|
maVisibilityChangeListeners.erase (
|
||||||
|
::std::find (
|
||||||
|
maVisibilityChangeListeners.begin(),
|
||||||
|
maVisibilityChangeListeners.end(),
|
||||||
|
rListener));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ButtonBar& SlideSorterView::GetButtonBar (void) const
|
ButtonBar& SlideSorterView::GetButtonBar (void) const
|
||||||
{
|
{
|
||||||
OSL_ASSERT(mpButtonBar);
|
OSL_ASSERT(mpButtonBar);
|
||||||
|
Reference in New Issue
Block a user