summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2003-04-08 14:24:01 +0000
committerRüdiger Timm <rt@openoffice.org>2003-04-08 14:24:01 +0000
commit7cb1c1d247492afb0230c4060746e944d4f96934 (patch)
treeb6c73cb2ffe5aff8f45efd49a1cc62bfb9332362 /svx
parent59936278cb04bed2a572be5fab9189c79b1cfd33 (diff)
INTEGRATION: CWS draw8 (1.23.6.2.28); FILE MERGED
2003/03/29 12:58:19 af 1.23.6.2.28.3: RESYNC: (1.23.6.2-1.23.6.3); FILE MERGED 2003/03/23 14:09:38 af 1.23.6.2.28.2: #108166# After switching to the new list in Update() this list is used by the following functions. 2003/03/14 09:35:37 af 1.23.6.2.28.1: #107893# Added methods HasFocus() and RemoveFocus().
Diffstat (limited to 'svx')
-rw-r--r--svx/source/accessibility/ChildrenManagerImpl.cxx52
1 files changed, 44 insertions, 8 deletions
diff --git a/svx/source/accessibility/ChildrenManagerImpl.cxx b/svx/source/accessibility/ChildrenManagerImpl.cxx
index d7499f563317..cca4af727f61 100644
--- a/svx/source/accessibility/ChildrenManagerImpl.cxx
+++ b/svx/source/accessibility/ChildrenManagerImpl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ChildrenManagerImpl.cxx,v $
*
- * $Revision: 1.26 $
+ * $Revision: 1.27 $
*
- * last change: $Author: hr $ $Date: 2003-03-27 15:00:27 $
+ * last change: $Author: rt $ $Date: 2003-04-08 15:24:01 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -73,6 +73,9 @@
#ifndef _COM_SUN_STAR_VIEW_XSELECTIONSUPPLIER_HPP_
#include <com/sun/star/view/XSelectionSupplier.hpp>
#endif
+#ifndef _COM_SUN_STAR_CONTAINER_XCHILD_HPP_
+#include <com/sun/star/container/XChild.hpp>
+#endif
#ifndef _COMPHELPER_UNO3_HXX_
#include <comphelper/uno3.hxx>
#endif
@@ -88,6 +91,7 @@ using namespace ::com::sun::star;
using namespace ::drafts::com::sun::star::accessibility;
using ::com::sun::star::uno::Reference;
+
namespace accessibility {
namespace
@@ -269,7 +273,11 @@ void ChildrenManagerImpl::Update (bool bCreateNewObjectsOnDemand)
{
::osl::MutexGuard aGuard (maMutex);
adjustIndexInParentOfShapes(aNewChildList);
- maVisibleChildren = aNewChildList;
+
+ // Use swap to copy the contents of the new list in constant time.
+ maVisibleChildren.swap (aNewChildList);
+ aNewChildList.clear();
+
maVisibleArea = aVisibleArea;
}
@@ -277,12 +285,12 @@ void ChildrenManagerImpl::Update (bool bCreateNewObjectsOnDemand)
// change of their bounding boxes for all shapes that are members of
// both the current and the new list of visible shapes.
if (maVisibleArea != aVisibleArea)
- SendVisibleAreaEvents (aNewChildList);
+ SendVisibleAreaEvents (maVisibleChildren);
// 6. If children have to be created immediately and not on demand then
// create the missing accessible objects now.
if ( ! bCreateNewObjectsOnDemand)
- CreateAccessibilityObjects (aNewChildList);
+ CreateAccessibilityObjects (maVisibleChildren);
}
@@ -426,8 +434,9 @@ void ChildrenManagerImpl::CreateAccessibilityObjects (
// it does not yet exist.
if ( ! I->mxAccessibleShape.is() )
GetChild (*I,nPos);
- if ( I->mxAccessibleShape.is() && I->mbCreateEventPending )
+ if (I->mxAccessibleShape.is() && I->mbCreateEventPending)
{
+ I->mbCreateEventPending = false;
mrContext.CommitChange (
AccessibleEventId::ACCESSIBLE_CHILD_EVENT,
uno::makeAny(I->mxAccessibleShape),
@@ -455,6 +464,7 @@ void ChildrenManagerImpl::AddShape (const Reference<drawing::XShape>& rxShape)
aPos.Y,
aPos.X + aSize.Width,
aPos.Y + aSize.Height);
+
// Add the shape only when it belongs to the list of shapes stored
// in mxShapeList (which is either a page or a group shape).
Reference<container::XChild> xChild (rxShape, uno::UNO_QUERY);
@@ -547,6 +557,7 @@ void ChildrenManagerImpl::ClearAccessibleShapeList (void)
for (I=maVisibleChildren.begin(); I != aEnd; ++I)
if ( I->mxAccessibleShape.is() && I->mxShape.is() )
I->disposeAccessibleObject(mrContext);
+
maVisibleChildren.clear ();
@@ -870,7 +881,8 @@ void ChildrenManagerImpl::UpdateSelection (void)
}
else if (xSelectedShapeAccess.is())
{
- for (sal_Int32 i=0,nCount=xSelectedShapeAccess->getCount(); i<nCount&&!bShapeIsSelected; i++)
+ sal_Int32 nCount=xSelectedShapeAccess->getCount();
+ for (sal_Int32 i=0; i<nCount&&!bShapeIsSelected; i++)
if (xSelectedShapeAccess->getByIndex(i) == I->mxShape)
{
bShapeIsSelected = true;
@@ -910,8 +922,31 @@ void ChildrenManagerImpl::UpdateSelection (void)
if (pNewFocusedShape != NULL)
pNewFocusedShape->SetState (AccessibleStateType::FOCUSED);
}
+
+ // Remember whether there is a shape that now has the focus.
+ mpFocusedShape = pNewFocusedShape;
}
-// -----------------------------------------------------------------------------
+
+
+
+
+bool ChildrenManagerImpl::HasFocus (void)
+{
+ return mpFocusedShape != NULL;
+}
+
+
+
+
+void ChildrenManagerImpl::RemoveFocus (void)
+{
+ if (mpFocusedShape != NULL)
+ {
+ mpFocusedShape->ResetState (AccessibleStateType::FOCUSED);
+ mpFocusedShape = NULL;
+ }
+}
+
void ChildrenManagerImpl::RegisterAsDisposeListener (
@@ -1008,3 +1043,4 @@ void ChildDescriptor::disposeAccessibleObject (AccessibleContextBase& rParent)
} // end of namespace accessibility
+