diff options
author | Sascha Ballach <sab@openoffice.org> | 2002-09-02 13:38:29 +0000 |
---|---|---|
committer | Sascha Ballach <sab@openoffice.org> | 2002-09-02 13:38:29 +0000 |
commit | a18238ca2b104df748a227daa0e6c2a773684601 (patch) | |
tree | f57473cd92eea508029d96d66a3730294a9c6349 /sc | |
parent | e6d6206d441ba1ca581c7489ced9fed6d5ee8d8b (diff) |
#102444#; send visible data change events
Diffstat (limited to 'sc')
4 files changed, 129 insertions, 15 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx index e19b4ef35474..d8bfae52ac87 100644 --- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessibleDocumentPagePreview.cxx,v $ * - * $Revision: 1.21 $ + * $Revision: 1.22 $ * - * last change: $Author: sab $ $Date: 2002-08-29 13:05:05 $ + * last change: $Author: sab $ $Date: 2002-09-02 14:38:29 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -681,6 +681,7 @@ public: uno::Reference<XAccessible> GetAt(const awt::Point& rPoint) const; void DataChanged(); + void VisAreaChanged() const; void SetDrawBroadcaster(); private: @@ -848,6 +849,33 @@ void ScShapeChilds::DataChanged() } } +struct ScVisAreaChanged +{ + const ScShapeChilds* mpAccDoc; + ScVisAreaChanged(const ScShapeChilds* pAccDoc) : mpAccDoc(pAccDoc) {} + void operator() (const ScShapeChild& rAccShapeData) const + { + if (rAccShapeData.mpAccShape) + { + rAccShapeData.mpAccShape->ViewForwarderChanged(accessibility::IAccessibleViewForwarderListener::VISIBLE_AREA, mpAccDoc); + } + } +}; + +void ScShapeChilds::VisAreaChanged() const +{ + ScShapeRangeVec::const_iterator aEndItr = maShapeRanges.end(); + ScShapeRangeVec::const_iterator aItr = maShapeRanges.begin(); + ScVisAreaChanged aVisAreaChanged(this); + while (aItr != aEndItr) + { + std::for_each(aItr->maBackShapes.begin(), aItr->maBackShapes.end(), aVisAreaChanged); + std::for_each(aItr->maControls.begin(), aItr->maControls.end(), aVisAreaChanged); + std::for_each(aItr->maForeShapes.begin(), aItr->maForeShapes.end(), aVisAreaChanged); + ++aItr; + } +} + ///===== IAccessibleViewForwarder ======================================== sal_Bool ScShapeChilds::IsValid (void) const @@ -1477,6 +1505,7 @@ void ScAccessibleDocumentPagePreview::Notify( SfxBroadcaster& rBC, const SfxHint uno::Reference<XAccessible> xAcc = mpTable; AccessibleEventObject aEvent; aEvent.EventId = AccessibleEventId::ACCESSIBLE_CHILD_EVENT; + aEvent.Source = uno::Reference< XAccessible >(this); aEvent.OldValue <<= xAcc; CommitChange(aEvent); } @@ -1512,6 +1541,7 @@ void ScAccessibleDocumentPagePreview::Notify( SfxBroadcaster& rBC, const SfxHint uno::Reference<XAccessible> xAcc = mpTable; AccessibleEventObject aEvent; aEvent.EventId = AccessibleEventId::ACCESSIBLE_CHILD_EVENT; + aEvent.Source = uno::Reference< XAccessible >(this); aEvent.NewValue <<= xAcc; CommitChange(aEvent); } @@ -1521,6 +1551,31 @@ void ScAccessibleDocumentPagePreview::Notify( SfxBroadcaster& rBC, const SfxHint { GetShapeChilds()->SetDrawBroadcaster(); } + else if (rRef.GetId() == SC_HINT_ACC_VISAREACHANGED) + { + Size aOutputSize; + Window* pSizeWindow = mpViewShell->GetWindow(); + if ( pSizeWindow ) + aOutputSize = pSizeWindow->GetOutputSizePixel(); + Point aPoint; + Rectangle aVisRect( aPoint, aOutputSize ); + GetNotesChilds()->DataChanged(aVisRect); + + GetShapeChilds()->VisAreaChanged(); + + AccessibleEventObject aEvent; + aEvent.EventId = AccessibleEventId::ACCESSIBLE_VISIBLE_DATA_EVENT; + aEvent.Source = uno::Reference< XAccessible >(this); + CommitChange(aEvent); + } + } + else if ( rHint.ISA(ScAccWinFocusLostHint) ) + { + CommitFocusLost(); + } + else if ( rHint.ISA(ScAccWinFocusGotHint) ) + { + CommitFocusGained(); } ScAccessibleDocumentBase::Notify(rBC, rHint); } diff --git a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx index 1d919439d4a3..7f68b2dee048 100644 --- a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx +++ b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessiblePageHeader.cxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: sab $ $Date: 2002-08-29 13:05:06 $ + * last change: $Author: sab $ $Date: 2002-09-02 14:38:29 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -63,6 +63,9 @@ #ifndef _SC_ACCESSIBLEPAGEHEADERAREA_HXX #include "AccessiblePageHeaderArea.hxx" #endif +#ifndef SC_ACCESSIBILITYHINTS_HXX +#include "AccessibilityHints.hxx" +#endif #include "prevwsh.hxx" #include "unoguard.hxx" #include "miscuno.hxx" @@ -227,6 +230,13 @@ void ScAccessiblePageHeader::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) } std::for_each(aOldAreas.begin(), aOldAreas.end(), Release()); } + else if (rRef.GetId() == SC_HINT_ACC_VISAREACHANGED) + { + AccessibleEventObject aEvent; + aEvent.EventId = AccessibleEventId::ACCESSIBLE_VISIBLE_DATA_EVENT; + aEvent.Source = uno::Reference< XAccessible >(this); + CommitChange(aEvent); + } } ScAccessibleContextBase::Notify(rBC, rHint); @@ -435,7 +445,17 @@ Rectangle ScAccessiblePageHeader::GetBoundingBox() const throw (uno::RuntimeExce rData.GetHeaderPosition( aRect ); else rData.GetFooterPosition( aRect ); + + // the Rectangle could contain negative coordinates so it should be cliped + Rectangle aClipRect(Point(0, 0), aRect.GetSize()); + Window* pWindow = mpViewShell->GetWindow(); + if (pWindow) + aClipRect = pWindow->GetWindowExtentsRelative(pWindow->GetAccessibleParentWindow()); + aRect = aClipRect.GetIntersection(aRect); } + if (aRect.IsEmpty()) + aRect.SetSize(Size(-1, -1)); + return aRect; } diff --git a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx index 291847b9dc7f..684a2ec441c7 100644 --- a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx +++ b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessiblePageHeaderArea.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: sab $ $Date: 2002-08-29 14:56:11 $ + * last change: $Author: sab $ $Date: 2002-09-02 14:38:29 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -69,6 +69,9 @@ #ifndef _SC_ACCESSIBLETEXT_HXX #include "AccessibleText.hxx" #endif +#ifndef SC_ACCESSIBILITYHINTS_HXX +#include "AccessibilityHints.hxx" +#endif #ifndef SC_UNOGUARD_HXX #include "unoguard.hxx" #endif @@ -90,6 +93,9 @@ #ifndef _DRAFTS_COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLESTATETYPE_HPP_ #include <drafts/com/sun/star/accessibility/AccessibleStateType.hpp> #endif +#ifndef _DRAFTS_COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLEEVENTID_HPP_ +#include <drafts/com/sun/star/accessibility/AccessibleEventId.hpp> +#endif #ifndef _EDITOBJ_HXX #include <svx/editobj.hxx> @@ -148,6 +154,27 @@ void SAL_CALL ScAccessiblePageHeaderArea::disposing() ScAccessibleContextBase::disposing(); } +//===== SfxListener ===================================================== + +void ScAccessiblePageHeaderArea::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) +{ + if (rHint.ISA( SfxSimpleHint ) ) + { + const SfxSimpleHint& rRef = (const SfxSimpleHint&)rHint; + // only notify if child exist, otherwise it is not necessary + if (rRef.GetId() == SC_HINT_ACC_VISAREACHANGED) + { + if (mpTextHelper) + mpTextHelper->UpdateChildren(); + + AccessibleEventObject aEvent; + aEvent.EventId = AccessibleEventId::ACCESSIBLE_VISIBLE_DATA_EVENT; + aEvent.Source = uno::Reference< XAccessible >(this); + CommitChange(aEvent); + } + } + ScAccessibleContextBase::Notify(rBC, rHint); +} //===== XAccessibleComponent ============================================ uno::Reference< XAccessible > SAL_CALL ScAccessiblePageHeaderArea::getAccessibleAt( @@ -311,12 +338,6 @@ Rectangle ScAccessiblePageHeaderArea::GetBoundingBoxOnScreen(void) const Rectangle aCellRect(GetBoundingBox()); if (mpViewShell) { - const ScPreviewLocationData& rData = mpViewShell->GetLocationData(); - if ( mbHeader ) - rData.GetHeaderPosition( aCellRect ); - else - rData.GetFooterPosition( aCellRect ); - Window* pWindow = mpViewShell->GetWindow(); if (pWindow) { @@ -340,8 +361,13 @@ Rectangle ScAccessiblePageHeaderArea::GetBoundingBox(void) const else rData.GetFooterPosition( aRect ); - aRect.SetPos(Point()); // has the same size and position on screen like the parent and so the pos is (0, 0) + // the Rectangle could contain negative coordinates so it should be cliped + Rectangle aClipRect(Point(0, 0), aRect.GetSize()); // has the same size and position on screen like the parent and so the pos is (0, 0) + aRect = aClipRect.GetIntersection(aRect); } + if (aRect.IsEmpty()) + aRect.SetSize(Size(-1, -1)); + return aRect; } diff --git a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx index a7b45db4df7c..b1f94bf31ecf 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessiblePreviewTable.cxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: sab $ $Date: 2002-08-29 13:05:07 $ + * last change: $Author: sab $ $Date: 2002-09-02 14:38:29 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -63,6 +63,9 @@ #include "AccessiblePreviewTable.hxx" #include "AccessiblePreviewCell.hxx" #include "AccessiblePreviewHeaderCell.hxx" +#ifndef SC_ACCESSIBILITYHINTS_HXX +#include "AccessibilityHints.hxx" +#endif #include "prevwsh.hxx" #include "unoguard.hxx" #include "miscuno.hxx" @@ -78,6 +81,9 @@ #include <drafts/com/sun/star/accessibility/AccessibleRole.hpp> #include <drafts/com/sun/star/accessibility/AccessibleStateType.hpp> +#ifndef _DRAFTS_COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLEEVENTID_HPP_ +#include <drafts/com/sun/star/accessibility/AccessibleEventId.hpp> +#endif #include <vcl/window.hxx> #include <svtools/smplhint.hxx> @@ -142,6 +148,13 @@ void ScAccessiblePreviewTable::Notify( SfxBroadcaster& rBC, const SfxHint& rHint // so it must be invalidated DELETEZ( mpTableInfo ); } + else if (rRef.GetId() == SC_HINT_ACC_VISAREACHANGED) + { + AccessibleEventObject aEvent; + aEvent.EventId = AccessibleEventId::ACCESSIBLE_VISIBLE_DATA_EVENT; + aEvent.Source = uno::Reference< XAccessible >(this); + CommitChange(aEvent); + } } ScAccessibleContextBase::Notify(rBC, rHint); |