Files
libreoffice/svx/source/table/accessiblecell.cxx

625 lines
18 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
re-base on ALv2 code. Includes: Patch contributed by Christian Lippka impress212: #i113063# patch: dubios self assign in svx/source/dialog/framelink.cxx http://svn.apache.org/viewvc?view=revision&revision=1167619 Patches contributed by Mathias Bauer gnumake4 work variously http://svn.apache.org/viewvc?view=revision&revision=1394707 http://svn.apache.org/viewvc?view=revision&revision=1394326 cws mba34issues01: #i117712#: fix several resource errors introduced by IAccessible2 implementation http://svn.apache.org/viewvc?view=revision&revision=1172343 cws mba34issues01: #i117719#: use correct resource ID http://svn.apache.org/viewvc?view=revision&revision=1172351 Patch contributed by Andre Fischer Do not add targets for junit tests when junit is disabled. http://svn.apache.org/viewvc?view=revision&revision=1241508 Patches contributed by Armin Le-Grand #118804# corrected GraphicExporter behaviour on shortcut when pixel graphic is requested http://svn.apache.org/viewvc?view=revision&revision=1240195 fix for #118525#: Using primitives for chart sub-geometry visualisation http://svn.apache.org/viewvc?view=revision&revision=1226879 #118485# - Styles for OLEs are not saved. http://svn.apache.org/viewvc?view=revision&revision=1182166 #118524: apply patch, followup fixes to 118485 http://svn.apache.org/viewvc?view=revision&revision=1186077 13f79535-47bb-0310-9956-ffa450edef68 Patch contributed by Regina Henschel linecap: Reintegrating finished LineCap feature http://svn.apache.org/viewvc?view=revision&revision=1232507 Patch contributed by Wang Lei (leiw) #i118760# split the first table cell vertically, then undo&redo, the Presentation app will crash http://svn.apache.org/viewvc?view=revision&revision=1301361 cleanup globlmn hacks, undo dependent fixmes.
2012-11-21 22:06:52 +00:00
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <sal/config.h>
#include <memory>
#include <utility>
#include "accessiblecell.hxx"
#include <svx/DescriptionGenerator.hxx>
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <vcl/svapp.hxx>
#include <unotools/accessiblestatesethelper.hxx>
#include <comphelper/string.hxx>
#include <editeng/outlobj.hxx>
#include <svx/IAccessibleViewForwarder.hxx>
#include <svx/unoshtxt.hxx>
#include <svx/svdotext.hxx>
#include <o3tl/make_unique.hxx>
using namespace sdr::table;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::accessibility;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::container;
namespace accessibility {
AccessibleCell::AccessibleCell( const css::uno::Reference< css::accessibility::XAccessible>& rxParent, const sdr::table::CellRef& rCell, sal_Int32 nIndex, const AccessibleShapeTreeInfo& rShapeTreeInfo )
: AccessibleCellBase( rxParent, AccessibleRole::TABLE_CELL )
, maShapeTreeInfo( rShapeTreeInfo )
, mnIndexInParent( nIndex )
, mpText( nullptr )
, mxCell( rCell )
{
//Init the pAccTable var
pAccTable = dynamic_cast <AccessibleTableShape *> (rxParent.get());
}
AccessibleCell::~AccessibleCell()
{
DBG_ASSERT( mpText == nullptr, "svx::AccessibleCell::~AccessibleCell(), not disposed!?" );
}
void AccessibleCell::Init()
{
SdrView* pView = maShapeTreeInfo.GetSdrView();
const vcl::Window* pWindow = maShapeTreeInfo.GetWindow ();
if( (pView != nullptr) && (pWindow != nullptr) && mxCell.is())
{
OutlinerParaObject* pOutlinerParaObject = mxCell->GetEditOutlinerParaObject(); // Get the OutlinerParaObject if text edit is active
bool bOwnParaObject = pOutlinerParaObject != nullptr;
CWS-TOOLING: integrate CWS impress168 2009-04-24 11:26:33 +0200 wg r271204 : i101157 2009-04-24 10:17:59 +0200 wg r271200 : i101157 2009-04-23 15:50:12 +0200 wg r271178 : i101157 2009-04-23 15:16:58 +0200 wg r271176 : i101157 2009-04-23 13:04:41 +0200 wg r271158 : i101157 2009-04-22 15:39:32 +0200 wg r271123 : i101157 2009-04-22 14:27:24 +0200 wg r271111 : i101157 2009-04-22 14:14:02 +0200 wg r271109 : i101157 2009-04-17 14:34:19 +0200 wg r270946 : i101157 2009-04-17 13:49:15 +0200 wg r270939 : i101157 2009-03-31 14:54:52 +0200 sj r270281 : CWS-TOOLING: rebase CWS impress168 to trunk@270033 (milestone: DEV300:m45) 2009-03-26 16:56:44 +0100 sj r270089 : removed invalid file names 2009-03-24 14:02:54 +0100 sj r269944 : CWS-TOOLING: rebase CWS impress168 to trunk@269781 (milestone: DEV300:m44) 2009-03-06 16:32:14 +0100 sj r269020 : #i99970# importing customshapes without group object, taking care of the correct text alignment 2009-02-27 13:53:24 +0100 sj r268591 : #158501,158483# fixed positioning problem of 3d customshapes 2009-02-19 16:02:00 +0100 sj r268292 : #76543# fixed interactive hyperlink program action with relativ url 2009-02-18 15:36:52 +0100 sj r268233 : #158503# added import of circular gradients for ellipse shapes 2009-02-16 19:51:54 +0100 sj r267836 : #i99146# calculating correct text bounds 2009-02-12 13:59:46 +0100 sj r267654 : #i96179# fixed bullet problem 2009-02-10 17:26:41 +0100 sj r267566 : #158476# fixed import of the ribbon shape 2009-02-10 17:10:27 +0100 cl r267561 : #i95364# fixed type detection of linked images 2009-02-09 18:31:59 +0100 cl r267531 : #i98352# removed assertion 2009-02-09 18:31:17 +0100 cl r267530 : #i98355# fixed alien attribute import for sd in binfilter 2009-02-09 18:30:53 +0100 cl r267529 : #i98355# fixed alien attribute import for sd in binfilter 2009-02-09 09:52:15 +0100 cl r267501 : #i98573# fixed build error 2009-02-06 17:02:21 +0100 sj r267476 : #i96179# fixed bullet problem 2009-02-06 14:58:39 +0100 cl r267466 : #i14832# fixed page count field for handout printing 2009-02-06 10:23:01 +0100 cl r267447 : #i98573# fixed GetEditOutlinerParaObject() memory leak 2009-02-05 18:03:34 +0100 cl r267435 : #i98573# fixed GetEditOutlinerParaObject() memory leak 2009-02-05 18:03:08 +0100 cl r267434 : #i85481# added XMultiPropertyStates to text implementations 2009-02-05 18:02:54 +0100 cl r267433 : #i85481# added XMultiPropertyStates to text implementations 2009-02-05 18:02:42 +0100 cl r267432 : #i85481# added XMultiPropertyStates to text implementations 2009-02-04 18:54:46 +0100 sj r267400 : #i33630# fixed arrow size of word import 2009-02-04 15:40:16 +0100 cl r267389 : #i58702# fixed tiled bitmap fill for vcl canvas 2009-02-04 15:39:07 +0100 cl r267388 : #i58702# fixed tiled bitmap fill for vcl canvas 2009-02-04 14:23:27 +0100 cl r267382 : #i98573# fixed memory leaks caused by wron usage of GetEditOutlinerParaObject() 2009-02-04 14:22:34 +0100 cl r267381 : #i98573# fixed memory leaks caused by wron usage of GetEditOutlinerParaObject() 2009-02-04 12:51:50 +0100 cl r267371 : #i14832# added Page Count field to impress 2009-02-04 12:41:31 +0100 cl r267368 : #i14832# added Page Count field to impress
2009-05-06 21:51:02 +00:00
if( !pOutlinerParaObject )
pOutlinerParaObject = mxCell->GetOutlinerParaObject();
// create AccessibleTextHelper to handle this shape's text
if( pOutlinerParaObject )
{
// non-empty text -> use full-fledged edit source right away
mpText = new AccessibleTextHelper( o3tl::make_unique<SvxTextEditSource>(mxCell->GetObject(), mxCell.get(), *pView, *pWindow) );
if( mxCell.is() && mxCell.get()->IsActiveCell() )
mpText->SetFocus();
mpText->SetEventSource(this);
}
CWS-TOOLING: integrate CWS impress168 2009-04-24 11:26:33 +0200 wg r271204 : i101157 2009-04-24 10:17:59 +0200 wg r271200 : i101157 2009-04-23 15:50:12 +0200 wg r271178 : i101157 2009-04-23 15:16:58 +0200 wg r271176 : i101157 2009-04-23 13:04:41 +0200 wg r271158 : i101157 2009-04-22 15:39:32 +0200 wg r271123 : i101157 2009-04-22 14:27:24 +0200 wg r271111 : i101157 2009-04-22 14:14:02 +0200 wg r271109 : i101157 2009-04-17 14:34:19 +0200 wg r270946 : i101157 2009-04-17 13:49:15 +0200 wg r270939 : i101157 2009-03-31 14:54:52 +0200 sj r270281 : CWS-TOOLING: rebase CWS impress168 to trunk@270033 (milestone: DEV300:m45) 2009-03-26 16:56:44 +0100 sj r270089 : removed invalid file names 2009-03-24 14:02:54 +0100 sj r269944 : CWS-TOOLING: rebase CWS impress168 to trunk@269781 (milestone: DEV300:m44) 2009-03-06 16:32:14 +0100 sj r269020 : #i99970# importing customshapes without group object, taking care of the correct text alignment 2009-02-27 13:53:24 +0100 sj r268591 : #158501,158483# fixed positioning problem of 3d customshapes 2009-02-19 16:02:00 +0100 sj r268292 : #76543# fixed interactive hyperlink program action with relativ url 2009-02-18 15:36:52 +0100 sj r268233 : #158503# added import of circular gradients for ellipse shapes 2009-02-16 19:51:54 +0100 sj r267836 : #i99146# calculating correct text bounds 2009-02-12 13:59:46 +0100 sj r267654 : #i96179# fixed bullet problem 2009-02-10 17:26:41 +0100 sj r267566 : #158476# fixed import of the ribbon shape 2009-02-10 17:10:27 +0100 cl r267561 : #i95364# fixed type detection of linked images 2009-02-09 18:31:59 +0100 cl r267531 : #i98352# removed assertion 2009-02-09 18:31:17 +0100 cl r267530 : #i98355# fixed alien attribute import for sd in binfilter 2009-02-09 18:30:53 +0100 cl r267529 : #i98355# fixed alien attribute import for sd in binfilter 2009-02-09 09:52:15 +0100 cl r267501 : #i98573# fixed build error 2009-02-06 17:02:21 +0100 sj r267476 : #i96179# fixed bullet problem 2009-02-06 14:58:39 +0100 cl r267466 : #i14832# fixed page count field for handout printing 2009-02-06 10:23:01 +0100 cl r267447 : #i98573# fixed GetEditOutlinerParaObject() memory leak 2009-02-05 18:03:34 +0100 cl r267435 : #i98573# fixed GetEditOutlinerParaObject() memory leak 2009-02-05 18:03:08 +0100 cl r267434 : #i85481# added XMultiPropertyStates to text implementations 2009-02-05 18:02:54 +0100 cl r267433 : #i85481# added XMultiPropertyStates to text implementations 2009-02-05 18:02:42 +0100 cl r267432 : #i85481# added XMultiPropertyStates to text implementations 2009-02-04 18:54:46 +0100 sj r267400 : #i33630# fixed arrow size of word import 2009-02-04 15:40:16 +0100 cl r267389 : #i58702# fixed tiled bitmap fill for vcl canvas 2009-02-04 15:39:07 +0100 cl r267388 : #i58702# fixed tiled bitmap fill for vcl canvas 2009-02-04 14:23:27 +0100 cl r267382 : #i98573# fixed memory leaks caused by wron usage of GetEditOutlinerParaObject() 2009-02-04 14:22:34 +0100 cl r267381 : #i98573# fixed memory leaks caused by wron usage of GetEditOutlinerParaObject() 2009-02-04 12:51:50 +0100 cl r267371 : #i14832# added Page Count field to impress 2009-02-04 12:41:31 +0100 cl r267368 : #i14832# added Page Count field to impress
2009-05-06 21:51:02 +00:00
if( bOwnParaObject)
delete pOutlinerParaObject;
}
}
bool AccessibleCell::SetState (sal_Int16 aState)
{
bool bStateHasChanged = false;
if (aState == AccessibleStateType::FOCUSED && mpText != nullptr)
{
// Offer FOCUSED state to edit engine and detect whether the state
// changes.
bool bIsFocused = mpText->HaveFocus ();
mpText->SetFocus();
bStateHasChanged = (bIsFocused != mpText->HaveFocus ());
}
else
bStateHasChanged = AccessibleContextBase::SetState (aState);
return bStateHasChanged;
}
bool AccessibleCell::ResetState (sal_Int16 aState)
{
bool bStateHasChanged = false;
if (aState == AccessibleStateType::FOCUSED && mpText != nullptr)
{
// Try to remove FOCUSED state from the edit engine and detect
// whether the state changes.
bool bIsFocused = mpText->HaveFocus ();
mpText->SetFocus (false);
bStateHasChanged = (bIsFocused != mpText->HaveFocus ());
}
else
bStateHasChanged = AccessibleContextBase::ResetState (aState);
return bStateHasChanged;
}
// XInterface
Any SAL_CALL AccessibleCell::queryInterface( const Type& aType )
{
return AccessibleCellBase::queryInterface( aType );
}
void SAL_CALL AccessibleCell::acquire( ) throw ()
{
AccessibleCellBase::acquire();
}
void SAL_CALL AccessibleCell::release( ) throw ()
{
AccessibleCellBase::release();
}
// XAccessibleContext
/** The children of this cell come from the paragraphs of text.
*/
sal_Int32 SAL_CALL AccessibleCell::getAccessibleChildCount()
{
SolarMutexGuard aSolarGuard;
ThrowIfDisposed ();
return mpText != nullptr ? mpText->GetChildCount () : 0;
}
/** Forward the request to the shape. Return the requested shape or throw
an exception for a wrong index.
*/
Reference<XAccessible> SAL_CALL AccessibleCell::getAccessibleChild (sal_Int32 nIndex)
{
SolarMutexGuard aSolarGuard;
ThrowIfDisposed ();
// todo: does GetChild throw IndexOutOfBoundsException?
return mpText->GetChild (nIndex);
}
/** Return a copy of the state set.
Possible states are:
ENABLED
SHOWING
VISIBLE
*/
Reference<XAccessibleStateSet> SAL_CALL AccessibleCell::getAccessibleStateSet()
{
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard (maMutex);
Reference<XAccessibleStateSet> xStateSet;
if (rBHelper.bDisposed || mpText == nullptr)
{
// Return a minimal state set that only contains the DEFUNC state.
xStateSet = AccessibleContextBase::getAccessibleStateSet ();
}
else
{
::utl::AccessibleStateSetHelper* pStateSet = static_cast< ::utl::AccessibleStateSetHelper*>(mxStateSet.get());
if(pStateSet)
{
// Merge current FOCUSED state from edit engine.
if (mpText != nullptr)
{
if (mpText->HaveFocus())
pStateSet->AddState (AccessibleStateType::FOCUSED);
else
pStateSet->RemoveState (AccessibleStateType::FOCUSED);
}
// Set the invisible state for merged cell
if (mxCell.is() && mxCell->isMerged())
pStateSet->RemoveState(AccessibleStateType::VISIBLE);
else
pStateSet->AddState(AccessibleStateType::VISIBLE);
//Just when the parent table is not read-only,set states EDITABLE,RESIZABLE,MOVEABLE
css::uno::Reference<XAccessible> xTempAcc = getAccessibleParent();
if( xTempAcc.is() )
{
css::uno::Reference<XAccessibleContext>
xTempAccContext = xTempAcc->getAccessibleContext();
if( xTempAccContext.is() )
{
css::uno::Reference<XAccessibleStateSet> rState =
xTempAccContext->getAccessibleStateSet();
if( rState.is() ) {
css::uno::Sequence<short> aStates = rState->getStates();
int count = aStates.getLength();
for( int iIndex = 0;iIndex < count;iIndex++ )
{
if( aStates[iIndex] == AccessibleStateType::EDITABLE )
{
pStateSet->AddState (AccessibleStateType::EDITABLE);
pStateSet->AddState (AccessibleStateType::RESIZABLE);
pStateSet->AddState (AccessibleStateType::MOVEABLE);
break;
}
}
}
}
}
// Create a copy of the state set that may be modified by the
// caller without affecting the current state set.
xStateSet.set(new ::utl::AccessibleStateSetHelper (*pStateSet));
}
}
return xStateSet;
}
// XAccessibleComponent
sal_Bool SAL_CALL AccessibleCell::containsPoint( const css::awt::Point& aPoint)
{
return AccessibleComponentBase::containsPoint( aPoint );
}
/** The implementation below is at the moment straightforward. It iterates
over all children (and thereby instances all children which have not
been already instantiated) until a child covering the specified point is
found.
This leaves room for improvement. For instance, first iterate only over
the already instantiated children and only if no match is found
instantiate the remaining ones.
*/
Reference<XAccessible > SAL_CALL AccessibleCell::getAccessibleAtPoint ( const css::awt::Point& aPoint)
{
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard (maMutex);
sal_Int32 nChildCount = getAccessibleChildCount ();
for (sal_Int32 i=0; i<nChildCount; ++i)
{
Reference<XAccessible> xChild (getAccessibleChild (i));
if (xChild.is())
{
Reference<XAccessibleComponent> xChildComponent (xChild->getAccessibleContext(), uno::UNO_QUERY);
if (xChildComponent.is())
{
awt::Rectangle aBBox (xChildComponent->getBounds());
if ( (aPoint.X >= aBBox.X)
&& (aPoint.Y >= aBBox.Y)
&& (aPoint.X < aBBox.X+aBBox.Width)
&& (aPoint.Y < aBBox.Y+aBBox.Height) )
return xChild;
}
}
}
// Have not found a child under the given point. Returning empty
// reference to indicate this.
return uno::Reference<XAccessible>();
}
css::awt::Rectangle SAL_CALL AccessibleCell::getBounds()
{
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard (maMutex);
ThrowIfDisposed ();
css::awt::Rectangle aBoundingBox;
if( mxCell.is() )
{
// Get the cell's bounding box in internal coordinates (in 100th of mm)
const ::tools::Rectangle aCellRect( mxCell->getCellRect() );
// Transform coordinates from internal to pixel.
if (maShapeTreeInfo.GetViewForwarder() == nullptr)
throw uno::RuntimeException ("AccessibleCell has no valid view forwarder",static_cast<uno::XWeak*>(this));
::Size aPixelSize( maShapeTreeInfo.GetViewForwarder()->LogicToPixel(::Size(aCellRect.GetWidth(), aCellRect.GetHeight())) );
::Point aPixelPosition( maShapeTreeInfo.GetViewForwarder()->LogicToPixel( aCellRect.TopLeft() ));
// Clip the shape's bounding box with the bounding box of its parent.
Reference<XAccessibleComponent> xParentComponent ( getAccessibleParent(), uno::UNO_QUERY);
if (xParentComponent.is())
{
// Make the coordinates relative to the parent.
awt::Point aParentLocation (xParentComponent->getLocationOnScreen());
int x = aPixelPosition.getX() - aParentLocation.X;
int y = aPixelPosition.getY() - aParentLocation.Y;
// Clip with parent (with coordinates relative to itself).
::tools::Rectangle aBBox ( x, y, x + aPixelSize.getWidth(), y + aPixelSize.getHeight());
awt::Size aParentSize (xParentComponent->getSize());
::tools::Rectangle aParentBBox (0,0, aParentSize.Width, aParentSize.Height);
aBBox = aBBox.GetIntersection (aParentBBox);
aBoundingBox = awt::Rectangle ( aBBox.getX(), aBBox.getY(), aBBox.getWidth(), aBBox.getHeight());
}
else
{
SAL_INFO("svx", "parent does not support component");
aBoundingBox = awt::Rectangle (aPixelPosition.getX(), aPixelPosition.getY(),aPixelSize.getWidth(), aPixelSize.getHeight());
}
}
return aBoundingBox;
}
css::awt::Point SAL_CALL AccessibleCell::getLocation()
{
ThrowIfDisposed ();
css::awt::Rectangle aBoundingBox(getBounds());
return css::awt::Point(aBoundingBox.X, aBoundingBox.Y);
}
css::awt::Point SAL_CALL AccessibleCell::getLocationOnScreen()
{
ThrowIfDisposed ();
// Get relative position...
css::awt::Point aLocation(getLocation ());
// ... and add absolute position of the parent.
Reference<XAccessibleComponent> xParentComponent( getAccessibleParent(), uno::UNO_QUERY);
if(xParentComponent.is())
{
css::awt::Point aParentLocation(xParentComponent->getLocationOnScreen());
aLocation.X += aParentLocation.X;
aLocation.Y += aParentLocation.Y;
}
else
{
SAL_WARN("svx", "parent does not support XAccessibleComponent");
}
return aLocation;
}
awt::Size SAL_CALL AccessibleCell::getSize()
{
ThrowIfDisposed ();
awt::Rectangle aBoundingBox (getBounds());
return awt::Size (aBoundingBox.Width, aBoundingBox.Height);
}
void SAL_CALL AccessibleCell::grabFocus()
{
AccessibleComponentBase::grabFocus();
}
sal_Int32 SAL_CALL AccessibleCell::getForeground()
{
ThrowIfDisposed ();
// todo
return sal_Int32(0x0ffffffL);
}
sal_Int32 SAL_CALL AccessibleCell::getBackground()
{
ThrowIfDisposed ();
// todo
return 0;
}
// XAccessibleExtendedComponent
css::uno::Reference< css::awt::XFont > SAL_CALL AccessibleCell::getFont()
{
//todo
return AccessibleComponentBase::getFont();
}
OUString SAL_CALL AccessibleCell::getTitledBorderText()
{
return AccessibleComponentBase::getTitledBorderText();
}
OUString SAL_CALL AccessibleCell::getToolTipText()
{
return AccessibleComponentBase::getToolTipText();
}
// XAccessibleEventBroadcaster
void SAL_CALL AccessibleCell::addAccessibleEventListener( const Reference<XAccessibleEventListener >& rxListener)
{
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard (maMutex);
if (rBHelper.bDisposed || rBHelper.bInDispose)
{
Reference<XInterface> xSource( static_cast<XComponent *>(this) );
lang::EventObject aEventObj(xSource);
rxListener->disposing(aEventObj);
}
else
{
AccessibleContextBase::addAccessibleEventListener (rxListener);
if (mpText != nullptr)
mpText->AddEventListener (rxListener);
}
}
void SAL_CALL AccessibleCell::removeAccessibleEventListener( const Reference<XAccessibleEventListener >& rxListener)
{
SolarMutexGuard aSolarGuard;
AccessibleContextBase::removeAccessibleEventListener(rxListener);
if (mpText != nullptr)
mpText->RemoveEventListener (rxListener);
}
// XServiceInfo
OUString SAL_CALL AccessibleCell::getImplementationName()
{
return OUString("AccessibleCell");
}
Sequence<OUString> SAL_CALL AccessibleCell::getSupportedServiceNames()
{
ThrowIfDisposed ();
// Get list of supported service names from base class...
uno::Sequence<OUString> aServiceNames = AccessibleContextBase::getSupportedServiceNames();
sal_Int32 nCount (aServiceNames.getLength());
// ...and add additional names.
aServiceNames.realloc (nCount + 1);
aServiceNames[nCount] = "com.sun.star.drawing.AccessibleCell";
return aServiceNames;
}
// IAccessibleViewForwarderListener
void AccessibleCell::ViewForwarderChanged()
{
// Inform all listeners that the graphical representation (i.e. size
// and/or position) of the shape has changed.
CommitChange(AccessibleEventId::VISIBLE_DATA_CHANGED, Any(), Any());
// update our children that our screen position might have changed
if( mpText )
mpText->UpdateChildren();
}
// protected
void AccessibleCell::disposing()
{
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard (maMutex);
// Make sure to send an event that this object loses the focus in the
// case that it has the focus.
::utl::AccessibleStateSetHelper* pStateSet = static_cast< ::utl::AccessibleStateSetHelper*>(mxStateSet.get());
if (pStateSet != nullptr)
pStateSet->RemoveState(AccessibleStateType::FOCUSED);
if (mpText != nullptr)
{
mpText->Dispose();
delete mpText;
mpText = nullptr;
}
// Cleanup. Remove references to objects to allow them to be
// destroyed.
mxCell.clear();
maShapeTreeInfo.dispose();
// Call base classes.
AccessibleContextBase::dispose ();
}
sal_Int32 SAL_CALL AccessibleCell::getAccessibleIndexInParent()
{
ThrowIfDisposed ();
return mnIndexInParent;
}
OUString AccessibleCell::getCellName( sal_Int32 nCol, sal_Int32 nRow )
{
OUStringBuffer aBuf;
if (nCol < 26*26)
{
if (nCol < 26)
aBuf.append( static_cast<sal_Unicode>( 'A' +
static_cast<sal_uInt16>(nCol)));
else
{
aBuf.append( static_cast<sal_Unicode>( 'A' +
(static_cast<sal_uInt16>(nCol) / 26) - 1));
aBuf.append( static_cast<sal_Unicode>( 'A' +
(static_cast<sal_uInt16>(nCol) % 26)));
}
}
else
{
OUStringBuffer aStr;
while (nCol >= 26)
{
sal_Int32 nC = nCol % 26;
aStr.append(static_cast<sal_Unicode>( 'A' +
static_cast<sal_uInt16>(nC)));
nCol = nCol - nC;
nCol = nCol / 26 - 1;
}
aStr.append(static_cast<sal_Unicode>( 'A' +
static_cast<sal_uInt16>(nCol)));
aBuf.append(comphelper::string::reverseString(aStr.makeStringAndClear()));
}
aBuf.append( OUString::number(nRow+1) );
return aBuf.makeStringAndClear();
}
OUString SAL_CALL AccessibleCell::getAccessibleName()
{
ThrowIfDisposed ();
SolarMutexGuard aSolarGuard;
if( pAccTable )
{
try
{
sal_Int32 nRow = 0, nCol = 0;
pAccTable->getColumnAndRow(mnIndexInParent, nCol, nRow);
return getCellName( nCol, nRow );
}
catch(const Exception&)
{
}
}
return AccessibleCellBase::getAccessibleName();
}
void AccessibleCell::UpdateChildren()
{
if (mpText)
mpText->UpdateChildren();
}
/* MT: Above getAccessibleName was introduced with IA2 CWS, while below was introduce in 3.3 meanwhile. Check which one is correct
+If this is correct, we also don't need sdr::table::CellRef getCellRef(), UpdateChildren(), getCellName( sal_Int32 nCol, sal_Int32 nRow ) above
+
OUString SAL_CALL AccessibleCell::getAccessibleName() throw (css::uno::RuntimeException)
CWS-TOOLING: integrate CWS swa11y32_2nd 2009-08-13 13:04:09 +0200 mav r274936 : #i104204# remove support for Ctrl-Tab 2009-08-13 09:59:22 +0200 od r274924 : #i93269# method <atk_wrapper_focus_idle_handler(..)> - emit also object:state-changed:focus, if cursor is inside <XAccessibleText> object 2009-08-11 12:15:11 +0200 tl r274851 : CWS-TOOLING: rebase CWS swa11y32_2nd to trunk@274622 (milestone: DEV300:m54) 2009-07-14 17:35:03 +0200 tl r273982 : 2009-07-10 10:46:39 +0200 tl r273879 : CWS-TOOLING: rebase CWS swa11y32 to trunk@273468 (milestone: DEV300:m51) 2009-07-01 14:00:25 +0200 mav r273577 : #i102879# the text of the button should not change 2009-07-01 13:16:19 +0200 od r273574 : #159496# method <GetHelpAnchor_Impl(..)> - do not release the solar mutex 2009-06-29 15:29:10 +0200 od r273476 : #i95042# method <CreateXWindow(..)> - return instance <VCLXComboBox> for <Window> instance of type <MetricBox>. note: <MetricBox> is inherited from <ComboBox> 2009-06-23 15:49:32 +0200 mav r273283 : #i101967# fix tab-control implementation 2009-06-22 13:56:22 +0200 od r273229 : #i100938# method <text_wrapper_get_run_attributes(..)> - always provide start_offset and end_offset - do _not_ increment the end_offset provide by <accessibility::TextSegment> instance 2009-06-02 12:09:03 +0200 mav r272492 : #i101959# Let the additional dialog window add its childred to the parents tab-hierarchy 2009-06-02 09:55:39 +0200 mav r272484 : #i102015# allow to have indirect child windows in tab-hierarchy 2009-06-02 09:49:42 +0200 mav r272482 : #i102015# Let the windows containing the extension dialog controls add controls to the tab hierarchy 2009-05-27 15:45:33 +0200 od r272354 : #i101012# method <SvxIconChoiceCtrl_Impl::EntrySelected(..)> - emit vcl event LISTBOX_SELECT only in case that the given entry is selected. 2009-05-27 09:54:36 +0200 od r272333 : #i92103# map UNO-API accessible events list box entry expanded/collapsed to corresponding atk events. 2009-05-27 09:52:15 +0200 od r272331 : #i92103# process list box entry expanded/collapsed events 2009-05-27 09:49:19 +0200 od r272330 : #i92103# emit vcl event list box entry expanded/collapsed 2009-05-26 10:42:05 +0200 od r272283 : #i93269# correct fix: check success of <queryInterface> call 2009-05-04 15:52:04 +0200 od r271469 : #i92103# new vcl event ids VCLEVENT_LISTBOX_ENTRY_EXPANDED and VCLEVENT_LISTBOX_ENTRY_COLLAPSED 2009-05-04 15:10:20 +0200 od r271460 : #i92103# refine definition of new constants 2009-05-04 14:36:44 +0200 od r271454 : #i92103# new constants for indicating that a list box entry is expanded respectively collapsed. 2009-04-30 16:09:40 +0200 od r271421 : #i93269# method <atk_wrapper_focus_idle_handler(..)> - emit text_caret_moved event for <XAccessibleText> object, if cursor is inside the <XAccessibleText> object. 2009-04-22 14:00:10 +0200 tl r271105 : warning-free code 2009-04-22 09:17:30 +0200 tl r271073 : CWS-TOOLING: rebase CWS swa11y32 to trunk@270723 (milestone: DEV300:m46) 2009-04-20 12:53:03 +0200 cd r270974 : #i83639# Check extendedhelp state to provide correct tool tip text 2009-04-03 13:07:13 +0200 tl r270471 : #i63983# changed accessible object names to empty strings 2009-04-01 15:52:09 +0200 tl r270336 : #i90991# accessible names and description for paragraphs should be empty 2009-04-01 15:12:42 +0200 tl r270333 : #i90991# accessible names and description for paragraphs should be empty 2009-04-01 15:10:34 +0200 tl r270331 : warning-free code 2009-04-01 12:54:44 +0200 tl r270319 : #i89176# Implementation of XAccessibleMultiLineText in EditEngine 2009-04-01 12:52:56 +0200 tl r270318 : #i89176# Implementation of XAccessibleMultiLineText in EditEngine 2009-03-27 18:31:01 +0100 tbe r270166 : #i92143# text getRangeExtents reports incorrect 'x' values for spreadsheet cells 2009-03-13 13:43:54 +0100 tl r269476 : #i94322# ImpEditView::ShowCursor and nPara == USHRT_MAX problem fixed 2009-03-12 10:27:30 +0100 tl r269366 : warning-free code; unresolved external dbg_out when compiling with debug=t 2009-03-11 12:40:31 +0100 tl r269312 : warning-free code Solaris x86 2009-03-10 15:49:01 +0100 tl r269279 : #i86443# handle GetColumnCount() == 0 2009-03-10 10:48:32 +0100 cl r269254 : #i91742# name cells for accessibility 2009-03-09 17:06:33 +0100 cl r269203 : #i91742# call init on accessible cells
2009-08-26 13:37:34 +00:00
{
ThrowIfDisposed ();
SolarMutexGuard aSolarGuard;
CWS-TOOLING: integrate CWS swa11y32_2nd 2009-08-13 13:04:09 +0200 mav r274936 : #i104204# remove support for Ctrl-Tab 2009-08-13 09:59:22 +0200 od r274924 : #i93269# method <atk_wrapper_focus_idle_handler(..)> - emit also object:state-changed:focus, if cursor is inside <XAccessibleText> object 2009-08-11 12:15:11 +0200 tl r274851 : CWS-TOOLING: rebase CWS swa11y32_2nd to trunk@274622 (milestone: DEV300:m54) 2009-07-14 17:35:03 +0200 tl r273982 : 2009-07-10 10:46:39 +0200 tl r273879 : CWS-TOOLING: rebase CWS swa11y32 to trunk@273468 (milestone: DEV300:m51) 2009-07-01 14:00:25 +0200 mav r273577 : #i102879# the text of the button should not change 2009-07-01 13:16:19 +0200 od r273574 : #159496# method <GetHelpAnchor_Impl(..)> - do not release the solar mutex 2009-06-29 15:29:10 +0200 od r273476 : #i95042# method <CreateXWindow(..)> - return instance <VCLXComboBox> for <Window> instance of type <MetricBox>. note: <MetricBox> is inherited from <ComboBox> 2009-06-23 15:49:32 +0200 mav r273283 : #i101967# fix tab-control implementation 2009-06-22 13:56:22 +0200 od r273229 : #i100938# method <text_wrapper_get_run_attributes(..)> - always provide start_offset and end_offset - do _not_ increment the end_offset provide by <accessibility::TextSegment> instance 2009-06-02 12:09:03 +0200 mav r272492 : #i101959# Let the additional dialog window add its childred to the parents tab-hierarchy 2009-06-02 09:55:39 +0200 mav r272484 : #i102015# allow to have indirect child windows in tab-hierarchy 2009-06-02 09:49:42 +0200 mav r272482 : #i102015# Let the windows containing the extension dialog controls add controls to the tab hierarchy 2009-05-27 15:45:33 +0200 od r272354 : #i101012# method <SvxIconChoiceCtrl_Impl::EntrySelected(..)> - emit vcl event LISTBOX_SELECT only in case that the given entry is selected. 2009-05-27 09:54:36 +0200 od r272333 : #i92103# map UNO-API accessible events list box entry expanded/collapsed to corresponding atk events. 2009-05-27 09:52:15 +0200 od r272331 : #i92103# process list box entry expanded/collapsed events 2009-05-27 09:49:19 +0200 od r272330 : #i92103# emit vcl event list box entry expanded/collapsed 2009-05-26 10:42:05 +0200 od r272283 : #i93269# correct fix: check success of <queryInterface> call 2009-05-04 15:52:04 +0200 od r271469 : #i92103# new vcl event ids VCLEVENT_LISTBOX_ENTRY_EXPANDED and VCLEVENT_LISTBOX_ENTRY_COLLAPSED 2009-05-04 15:10:20 +0200 od r271460 : #i92103# refine definition of new constants 2009-05-04 14:36:44 +0200 od r271454 : #i92103# new constants for indicating that a list box entry is expanded respectively collapsed. 2009-04-30 16:09:40 +0200 od r271421 : #i93269# method <atk_wrapper_focus_idle_handler(..)> - emit text_caret_moved event for <XAccessibleText> object, if cursor is inside the <XAccessibleText> object. 2009-04-22 14:00:10 +0200 tl r271105 : warning-free code 2009-04-22 09:17:30 +0200 tl r271073 : CWS-TOOLING: rebase CWS swa11y32 to trunk@270723 (milestone: DEV300:m46) 2009-04-20 12:53:03 +0200 cd r270974 : #i83639# Check extendedhelp state to provide correct tool tip text 2009-04-03 13:07:13 +0200 tl r270471 : #i63983# changed accessible object names to empty strings 2009-04-01 15:52:09 +0200 tl r270336 : #i90991# accessible names and description for paragraphs should be empty 2009-04-01 15:12:42 +0200 tl r270333 : #i90991# accessible names and description for paragraphs should be empty 2009-04-01 15:10:34 +0200 tl r270331 : warning-free code 2009-04-01 12:54:44 +0200 tl r270319 : #i89176# Implementation of XAccessibleMultiLineText in EditEngine 2009-04-01 12:52:56 +0200 tl r270318 : #i89176# Implementation of XAccessibleMultiLineText in EditEngine 2009-03-27 18:31:01 +0100 tbe r270166 : #i92143# text getRangeExtents reports incorrect 'x' values for spreadsheet cells 2009-03-13 13:43:54 +0100 tl r269476 : #i94322# ImpEditView::ShowCursor and nPara == USHRT_MAX problem fixed 2009-03-12 10:27:30 +0100 tl r269366 : warning-free code; unresolved external dbg_out when compiling with debug=t 2009-03-11 12:40:31 +0100 tl r269312 : warning-free code Solaris x86 2009-03-10 15:49:01 +0100 tl r269279 : #i86443# handle GetColumnCount() == 0 2009-03-10 10:48:32 +0100 cl r269254 : #i91742# name cells for accessibility 2009-03-09 17:06:33 +0100 cl r269203 : #i91742# call init on accessible cells
2009-08-26 13:37:34 +00:00
if( mxCell.is() )
return mxCell->getName();
return AccessibleCellBase::getAccessibleName();
}
*/
CWS-TOOLING: integrate CWS swa11y32_2nd 2009-08-13 13:04:09 +0200 mav r274936 : #i104204# remove support for Ctrl-Tab 2009-08-13 09:59:22 +0200 od r274924 : #i93269# method <atk_wrapper_focus_idle_handler(..)> - emit also object:state-changed:focus, if cursor is inside <XAccessibleText> object 2009-08-11 12:15:11 +0200 tl r274851 : CWS-TOOLING: rebase CWS swa11y32_2nd to trunk@274622 (milestone: DEV300:m54) 2009-07-14 17:35:03 +0200 tl r273982 : 2009-07-10 10:46:39 +0200 tl r273879 : CWS-TOOLING: rebase CWS swa11y32 to trunk@273468 (milestone: DEV300:m51) 2009-07-01 14:00:25 +0200 mav r273577 : #i102879# the text of the button should not change 2009-07-01 13:16:19 +0200 od r273574 : #159496# method <GetHelpAnchor_Impl(..)> - do not release the solar mutex 2009-06-29 15:29:10 +0200 od r273476 : #i95042# method <CreateXWindow(..)> - return instance <VCLXComboBox> for <Window> instance of type <MetricBox>. note: <MetricBox> is inherited from <ComboBox> 2009-06-23 15:49:32 +0200 mav r273283 : #i101967# fix tab-control implementation 2009-06-22 13:56:22 +0200 od r273229 : #i100938# method <text_wrapper_get_run_attributes(..)> - always provide start_offset and end_offset - do _not_ increment the end_offset provide by <accessibility::TextSegment> instance 2009-06-02 12:09:03 +0200 mav r272492 : #i101959# Let the additional dialog window add its childred to the parents tab-hierarchy 2009-06-02 09:55:39 +0200 mav r272484 : #i102015# allow to have indirect child windows in tab-hierarchy 2009-06-02 09:49:42 +0200 mav r272482 : #i102015# Let the windows containing the extension dialog controls add controls to the tab hierarchy 2009-05-27 15:45:33 +0200 od r272354 : #i101012# method <SvxIconChoiceCtrl_Impl::EntrySelected(..)> - emit vcl event LISTBOX_SELECT only in case that the given entry is selected. 2009-05-27 09:54:36 +0200 od r272333 : #i92103# map UNO-API accessible events list box entry expanded/collapsed to corresponding atk events. 2009-05-27 09:52:15 +0200 od r272331 : #i92103# process list box entry expanded/collapsed events 2009-05-27 09:49:19 +0200 od r272330 : #i92103# emit vcl event list box entry expanded/collapsed 2009-05-26 10:42:05 +0200 od r272283 : #i93269# correct fix: check success of <queryInterface> call 2009-05-04 15:52:04 +0200 od r271469 : #i92103# new vcl event ids VCLEVENT_LISTBOX_ENTRY_EXPANDED and VCLEVENT_LISTBOX_ENTRY_COLLAPSED 2009-05-04 15:10:20 +0200 od r271460 : #i92103# refine definition of new constants 2009-05-04 14:36:44 +0200 od r271454 : #i92103# new constants for indicating that a list box entry is expanded respectively collapsed. 2009-04-30 16:09:40 +0200 od r271421 : #i93269# method <atk_wrapper_focus_idle_handler(..)> - emit text_caret_moved event for <XAccessibleText> object, if cursor is inside the <XAccessibleText> object. 2009-04-22 14:00:10 +0200 tl r271105 : warning-free code 2009-04-22 09:17:30 +0200 tl r271073 : CWS-TOOLING: rebase CWS swa11y32 to trunk@270723 (milestone: DEV300:m46) 2009-04-20 12:53:03 +0200 cd r270974 : #i83639# Check extendedhelp state to provide correct tool tip text 2009-04-03 13:07:13 +0200 tl r270471 : #i63983# changed accessible object names to empty strings 2009-04-01 15:52:09 +0200 tl r270336 : #i90991# accessible names and description for paragraphs should be empty 2009-04-01 15:12:42 +0200 tl r270333 : #i90991# accessible names and description for paragraphs should be empty 2009-04-01 15:10:34 +0200 tl r270331 : warning-free code 2009-04-01 12:54:44 +0200 tl r270319 : #i89176# Implementation of XAccessibleMultiLineText in EditEngine 2009-04-01 12:52:56 +0200 tl r270318 : #i89176# Implementation of XAccessibleMultiLineText in EditEngine 2009-03-27 18:31:01 +0100 tbe r270166 : #i92143# text getRangeExtents reports incorrect 'x' values for spreadsheet cells 2009-03-13 13:43:54 +0100 tl r269476 : #i94322# ImpEditView::ShowCursor and nPara == USHRT_MAX problem fixed 2009-03-12 10:27:30 +0100 tl r269366 : warning-free code; unresolved external dbg_out when compiling with debug=t 2009-03-11 12:40:31 +0100 tl r269312 : warning-free code Solaris x86 2009-03-10 15:49:01 +0100 tl r269279 : #i86443# handle GetColumnCount() == 0 2009-03-10 10:48:32 +0100 cl r269254 : #i91742# name cells for accessibility 2009-03-09 17:06:33 +0100 cl r269203 : #i91742# call init on accessible cells
2009-08-26 13:37:34 +00:00
} // end of namespace accessibility
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */