diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-03-12 20:06:58 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-03-12 20:06:58 +0100 |
commit | c61cd1a5a26de1d1f62389988b00229c04e36693 (patch) | |
tree | 9d6de00f4d149cba080fe88f1eff71a67786b5f0 /sd/source/ui/accessibility | |
parent | 064f1e4ed53cb16d174534e20a7d02b8c93a4948 (diff) | |
parent | f2aeec8f22f37146c2f9120e8d0ead383049c1fa (diff) |
Merge commit 'ooo/DEV300_m101' into integration/dev300_m101
Diffstat (limited to 'sd/source/ui/accessibility')
-rwxr-xr-x[-rw-r--r--] | sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx | 15 | ||||
-rw-r--r-- | sd/source/ui/accessibility/AccessibleSlideSorterView.cxx | 78 | ||||
-rw-r--r-- | sd/source/ui/accessibility/AccessibleTreeNode.cxx | 25 |
5 files changed, 75 insertions, 49 deletions
diff --git a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx index 9a8ed5dd8ddb..53bbedffc062 100644..100755 --- a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx +++ b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx @@ -152,7 +152,7 @@ void AccessibleDocumentViewBase::Init (void) pWindow->AddChildEventListener (maWindowLink); - USHORT nCount = pWindow->GetChildCount(); + sal_uInt16 nCount = pWindow->GetChildCount(); for (sal_uInt16 i=0; i<nCount; i++) { Window* pChildWindow = pWindow->GetChild (i); diff --git a/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx b/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx index 9fd2430d64e6..51354728f1c6 100644..100755 --- a/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx +++ b/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx @@ -108,12 +108,12 @@ namespace accessibility return *( const_cast< AccessibleOutlineEditSource* > (this) ); } - BOOL AccessibleOutlineEditSource::IsValid() const + sal_Bool AccessibleOutlineEditSource::IsValid() const { if( mpOutliner && mpOutlinerView ) { // Our view still on outliner? - ULONG nCurrView, nViews; + sal_uLong nCurrView, nViews; for( nCurrView=0, nViews=mpOutliner->GetViewCount(); nCurrView<nViews; ++nCurrView ) { diff --git a/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx b/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx index 20147ca70d67..989d12c5d4bf 100644 --- a/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx +++ b/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx @@ -38,6 +38,8 @@ #include "model/SlideSorterModel.hxx" #include "model/SlsPageDescriptor.hxx" #include "view/SlideSorterView.hxx" +#include "view/SlsLayouter.hxx" +#include "view/SlsPageObjectLayouter.hxx" #include <com/sun/star/accessibility/AccessibleRole.hpp> #include <com/sun/star/accessibility/AccessibleStateType.hpp> #include <comphelper/accessibleeventnotifier.hxx> @@ -386,10 +388,11 @@ awt::Rectangle SAL_CALL AccessibleSlideSorterObject::getBounds (void) const SolarMutexGuard aSolarGuard; - Rectangle aBBox (mrSlideSorter.GetView().GetPageBoundingBox ( - mnPageNumber, - ::sd::slidesorter::view::SlideSorterView::CS_SCREEN, - ::sd::slidesorter::view::SlideSorterView::BBT_INFO)); + Rectangle aBBox ( + mrSlideSorter.GetView().GetLayouter().GetPageObjectLayouter()->GetBoundingBox( + mrSlideSorter.GetModel().GetPageDescriptor(mnPageNumber), + ::sd::slidesorter::view::PageObjectLayouter::PageObject, + ::sd::slidesorter::view::PageObjectLayouter::WindowCoordinateSystem)); if (mxParent.is()) { @@ -477,7 +480,7 @@ sal_Int32 SAL_CALL AccessibleSlideSorterObject::getForeground (void) { ThrowIfDisposed (); svtools::ColorConfig aColorConfig; - UINT32 nColor = aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor; + sal_uInt32 nColor = aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor; return static_cast<sal_Int32>(nColor); } @@ -488,7 +491,7 @@ sal_Int32 SAL_CALL AccessibleSlideSorterObject::getBackground (void) throw (::com::sun::star::uno::RuntimeException) { ThrowIfDisposed (); - UINT32 nColor = Application::GetSettings().GetStyleSettings().GetWindowColor().GetColor(); + sal_uInt32 nColor = Application::GetSettings().GetStyleSettings().GetWindowColor().GetColor(); return static_cast<sal_Int32>(nColor); } diff --git a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx index 00c4d93b2288..a4e6eae35faa 100644 --- a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx +++ b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx @@ -63,6 +63,14 @@ using namespace ::com::sun::star::accessibility; namespace accessibility { +/** Inner implementation class of the AccessibleSlideSorterView. + + Note that some event broadcasting is done asynchronously because + otherwise it could lead to deadlocks on (at least) some Solaris + machines. Probably (but unverified) this can happen on all GTK based + systems. The asynchronous broadcasting is just a workaround for a + poorly understood problem. +*/ class AccessibleSlideSorterView::Implementation : public SfxListener { @@ -73,7 +81,7 @@ public: ::Window* pWindow); ~Implementation (void); - void UpdateChildren (void); + void RequestUpdateChildren (void); void Clear (void); sal_Int32 GetVisibleChildCount (void) const; AccessibleSlideSorterObject* GetAccessibleChild (sal_Int32 nIndex); @@ -84,8 +92,9 @@ public: void Notify (SfxBroadcaster& rBroadcaster, const SfxHint& rHint); DECL_LINK(WindowEventListener, VclWindowEvent*); DECL_LINK(SelectionChangeListener, void*); + DECL_LINK(BroadcastSelectionChange, void*); DECL_LINK(FocusChangeListener, void*); - DECL_LINK(VisibilityChangeListener, void*); + DECL_LINK(UpdateChildrenCallback, void*); private: AccessibleSlideSorterView& mrAccessibleSlideSorter; @@ -98,6 +107,10 @@ private: ::Window* mpWindow; sal_Int32 mnFocusedIndex; bool mbModelChangeLocked; + sal_uLong mnUpdateChildrenUserEventId; + sal_uLong mnSelectionChangeUserEventId; + + void UpdateChildren (void); }; @@ -115,7 +128,6 @@ AccessibleSlideSorterView::AccessibleSlideSorterView( mnClientId(0), mpContentWindow(pContentWindow) { - OSL_TRACE("creating AccessibleSlideSorterView"); } @@ -568,7 +580,7 @@ sal_Int32 SAL_CALL AccessibleSlideSorterView::getForeground (void) { ThrowIfDisposed(); svtools::ColorConfig aColorConfig; - UINT32 nColor = aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor; + sal_uInt32 nColor = aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor; return static_cast<sal_Int32>(nColor); } @@ -579,7 +591,7 @@ sal_Int32 SAL_CALL AccessibleSlideSorterView::getBackground (void) throw (RuntimeException) { ThrowIfDisposed(); - UINT32 nColor = Application::GetSettings().GetStyleSettings().GetWindowColor().GetColor(); + sal_uInt32 nColor = Application::GetSettings().GetStyleSettings().GetWindowColor().GetColor(); return static_cast<sal_Int32>(nColor); } @@ -781,6 +793,9 @@ sal_Bool AccessibleSlideSorterView::IsDisposed (void) return (rBHelper.bDisposed || rBHelper.bInDispose); } + + + //===== AccessibleSlideSorterView::Implementation ============================= AccessibleSlideSorterView::Implementation::Implementation ( @@ -795,7 +810,9 @@ AccessibleSlideSorterView::Implementation::Implementation ( mbListeningToDocument(false), mpWindow(pWindow), mnFocusedIndex(-1), - mbModelChangeLocked(false) + mbModelChangeLocked(false), + mnUpdateChildrenUserEventId(0), + mnSelectionChangeUserEventId(0) { ConnectListeners(); UpdateChildren(); @@ -806,6 +823,10 @@ AccessibleSlideSorterView::Implementation::Implementation ( AccessibleSlideSorterView::Implementation::~Implementation (void) { + if (mnUpdateChildrenUserEventId != 0) + Application::RemoveUserEvent(mnUpdateChildrenUserEventId); + if (mnSelectionChangeUserEventId != 0) + Application::RemoveUserEvent(mnSelectionChangeUserEventId); ReleaseListeners(); Clear(); } @@ -813,6 +834,17 @@ AccessibleSlideSorterView::Implementation::~Implementation (void) +void AccessibleSlideSorterView::Implementation::RequestUpdateChildren (void) +{ + if (mnUpdateChildrenUserEventId == 0) + mnUpdateChildrenUserEventId = Application::PostUserEvent( + LINK(this, AccessibleSlideSorterView::Implementation, + UpdateChildrenCallback)); +} + + + + void AccessibleSlideSorterView::Implementation::UpdateChildren (void) { if (mbModelChangeLocked) @@ -822,10 +854,9 @@ void AccessibleSlideSorterView::Implementation::UpdateChildren (void) return; } - ::sd::slidesorter::view::SlideSorterView::PageRange aRange ( - mrSlideSorter.GetView().GetVisiblePageRange()); - mnFirstVisibleChild = aRange.first; - mnLastVisibleChild = aRange.second; + const Pair aRange (mrSlideSorter.GetView().GetVisiblePageRange()); + mnFirstVisibleChild = aRange.A(); + mnLastVisibleChild = aRange.B(); // Release all children. Clear(); @@ -864,7 +895,7 @@ void AccessibleSlideSorterView::Implementation::Clear (void) sal_Int32 AccessibleSlideSorterView::Implementation::GetVisibleChildCount (void) const { - if (mnFirstVisibleChild <= mnLastVisibleChild) + if (mnFirstVisibleChild<=mnLastVisibleChild && mnFirstVisibleChild>=0) return mnLastVisibleChild - mnFirstVisibleChild + 1; else return 0; @@ -939,7 +970,7 @@ void AccessibleSlideSorterView::Implementation::ConnectListeners (void) mrSlideSorter.GetController().GetFocusManager().AddFocusChangeListener( LINK(this,AccessibleSlideSorterView::Implementation,FocusChangeListener)); mrSlideSorter.GetView().AddVisibilityChangeListener( - LINK(this,AccessibleSlideSorterView::Implementation,VisibilityChangeListener)); + LINK(this,AccessibleSlideSorterView::Implementation,UpdateChildrenCallback)); } @@ -952,7 +983,7 @@ void AccessibleSlideSorterView::Implementation::ReleaseListeners (void) mrSlideSorter.GetController().GetSelectionManager()->RemoveSelectionChangeListener( LINK(this,AccessibleSlideSorterView::Implementation,SelectionChangeListener)); mrSlideSorter.GetView().RemoveVisibilityChangeListener( - LINK(this,AccessibleSlideSorterView::Implementation,VisibilityChangeListener)); + LINK(this,AccessibleSlideSorterView::Implementation,UpdateChildrenCallback)); if (mpWindow != NULL) mpWindow->RemoveEventListener( @@ -980,7 +1011,7 @@ void AccessibleSlideSorterView::Implementation::Notify ( switch (rSdrHint.GetKind()) { case HINT_PAGEORDERCHG: - UpdateChildren(); + RequestUpdateChildren(); break; default: break; @@ -997,7 +1028,7 @@ void AccessibleSlideSorterView::Implementation::Notify ( case sd::ViewShellHint::HINT_COMPLEX_MODEL_CHANGE_END: mbModelChangeLocked = false; - UpdateChildren(); + RequestUpdateChildren(); break; default: break; @@ -1014,7 +1045,7 @@ IMPL_LINK(AccessibleSlideSorterView::Implementation, WindowEventListener, VclWin { case VCLEVENT_WINDOW_MOVE: case VCLEVENT_WINDOW_RESIZE: - UpdateChildren(); + RequestUpdateChildren(); break; case VCLEVENT_WINDOW_GETFOCUS: @@ -1035,6 +1066,18 @@ IMPL_LINK(AccessibleSlideSorterView::Implementation, WindowEventListener, VclWin IMPL_LINK(AccessibleSlideSorterView::Implementation, SelectionChangeListener, void*, EMPTYARG ) { + if (mnSelectionChangeUserEventId == 0) + mnSelectionChangeUserEventId = Application::PostUserEvent( + LINK(this, AccessibleSlideSorterView::Implementation, BroadcastSelectionChange)); + return 1; +} + + + + +IMPL_LINK(AccessibleSlideSorterView::Implementation, BroadcastSelectionChange, void*, EMPTYARG ) +{ + mnSelectionChangeUserEventId = 0; mrAccessibleSlideSorter.FireAccessibleEvent( AccessibleEventId::SELECTION_CHANGED, Any(), @@ -1078,8 +1121,9 @@ IMPL_LINK(AccessibleSlideSorterView::Implementation, FocusChangeListener, void*, -IMPL_LINK(AccessibleSlideSorterView::Implementation, VisibilityChangeListener, void*, EMPTYARG ) +IMPL_LINK(AccessibleSlideSorterView::Implementation, UpdateChildrenCallback, void*, EMPTYARG ) { + mnUpdateChildrenUserEventId = 0; UpdateChildren(); return 1; diff --git a/sd/source/ui/accessibility/AccessibleTreeNode.cxx b/sd/source/ui/accessibility/AccessibleTreeNode.cxx index 449b3d2235e6..f6fb75d1fe34 100644 --- a/sd/source/ui/accessibility/AccessibleTreeNode.cxx +++ b/sd/source/ui/accessibility/AccessibleTreeNode.cxx @@ -83,27 +83,6 @@ AccessibleTreeNode::AccessibleTreeNode( -AccessibleTreeNode::AccessibleTreeNode( - const Reference<XAccessible>& rxParent, - ::sd::toolpanel::TreeNode& rNode, - const OUString& rsName, - const OUString& rsDescription, - const sal_Int16 eRole) - : AccessibleTreeNodeBase(MutexOwner::maMutex), - mxParent(rxParent), - mrTreeNode(rNode), - mrStateSet(new ::utl::AccessibleStateSetHelper()), - msName(rsName), - msDescription(rsDescription), - meRole(eRole), - mnClientId(0) -{ - CommonConstructor(); -} - - - - void AccessibleTreeNode::CommonConstructor (void) { UpdateStateSet(); @@ -570,7 +549,7 @@ sal_Int32 SAL_CALL AccessibleTreeNode::getForeground (void) { ThrowIfDisposed(); svtools::ColorConfig aColorConfig; - UINT32 nColor = aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor; + sal_uInt32 nColor = aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor; return static_cast<sal_Int32>(nColor); } @@ -581,7 +560,7 @@ sal_Int32 SAL_CALL AccessibleTreeNode::getBackground (void) throw (RuntimeException) { ThrowIfDisposed(); - UINT32 nColor = Application::GetSettings().GetStyleSettings().GetWindowColor().GetColor(); + sal_uInt32 nColor = Application::GetSettings().GetStyleSettings().GetWindowColor().GetColor(); return static_cast<sal_Int32>(nColor); } |