LibreOffice Module sw (master)  1
acctable.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <sal/log.hxx>
21 
22 #include <algorithm>
23 #include <vector>
24 #include <com/sun/star/accessibility/AccessibleRole.hpp>
25 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
26 #include <com/sun/star/accessibility/AccessibleEventId.hpp>
27 #include <com/sun/star/accessibility/AccessibleTableModelChange.hpp>
28 #include <com/sun/star/accessibility/AccessibleTableModelChangeType.hpp>
29 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
30 #include <o3tl/safeint.hxx>
32 #include <vcl/svapp.hxx>
33 #include <frmfmt.hxx>
34 #include <tabfrm.hxx>
35 #include <cellfrm.hxx>
36 #include <swtable.hxx>
37 #include <crsrsh.hxx>
38 #include <viscrs.hxx>
39 #include <hints.hxx>
40 #include "accfrmobjslist.hxx"
41 #include <accmap.hxx>
42 #include <strings.hrc>
43 #include "acctable.hxx"
44 
45 #include <com/sun/star/accessibility/XAccessibleText.hpp>
46 
47 #include <editeng/brushitem.hxx>
48 #include <swatrset.hxx>
49 #include <frmatr.hxx>
50 
53 
54 using namespace ::com::sun::star;
55 using namespace ::com::sun::star::accessibility;
56 using namespace ::sw::access;
57 
59 
60 const unsigned int SELECTION_WITH_NUM = 10;
61 
62 namespace {
63 
64 class SwAccTableSelHandler_Impl
65 {
66 public:
67  virtual void Unselect( sal_Int32 nRowOrCol, sal_Int32 nExt ) = 0;
68 
69 protected:
70  ~SwAccTableSelHandler_Impl() {}
71 };
72 
73 }
74 
76 {
84 
85  void CollectData( const SwFrame *pFrame );
86 
87  bool FindCell( const Point& rPos, const SwFrame *pFrame ,
88  bool bExact, const SwFrame *& rFrame ) const;
89 
90  void GetSelection( const Point& rTabPos, const SwRect& rArea,
91  const SwSelBoxes& rSelBoxes, const SwFrame *pFrame,
92  SwAccTableSelHandler_Impl& rSelHdl,
93  bool bColumns ) const;
94 
95  // #i77106#
96  bool IncludeRow( const SwFrame& rFrame ) const
97  {
98  return !mbOnlyTableColumnHeader ||
99  mpTabFrame->IsInHeadline( rFrame );
100  }
101 public:
102  // #i77106# - add third optional parameter <bOnlyTableColumnHeader>, default value <false>
104  const SwTabFrame *pTabFrame,
105  bool bIsInPagePreview,
106  bool bOnlyTableColumnHeader = false );
107 
108  const Int32Set_Impl& GetRows() const { return maRows; }
109  const Int32Set_Impl& GetColumns() const { return maColumns; }
110 
111  inline Int32Set_Impl::const_iterator GetRowIter( sal_Int32 nRow ) const;
112  inline Int32Set_Impl::const_iterator GetColumnIter( sal_Int32 nCol ) const;
113 
116  const SwFrame *GetCell( sal_Int32 nRow, sal_Int32 nColumn, SwAccessibleTable *pThis ) const;
117  const SwFrame *GetCellAtPos( sal_Int32 nLeft, sal_Int32 nTop ) const;
118  inline sal_Int32 GetRowCount() const;
119  inline sal_Int32 GetColumnCount() const;
120  bool CompareExtents( const SwAccessibleTableData_Impl& r ) const;
121 
122  void GetSelection( sal_Int32 nStart, sal_Int32 nEnd,
123  const SwSelBoxes& rSelBoxes,
124  SwAccTableSelHandler_Impl& rSelHdl,
125  bool bColumns ) const;
126 
128  void CheckRowAndCol( sal_Int32 nRow, sal_Int32 nCol,
129  SwAccessibleTable *pThis ) const;
130 
131  const Point& GetTablePos() const { return maTabFramePos; }
132  void SetTablePos( const Point& rPos ) { maTabFramePos = rPos; }
133 };
134 
136 {
137  const SwAccessibleChildSList aList( *pFrame, mrAccMap );
139  SwAccessibleChildSList::const_iterator aEndIter( aList.end() );
140  while( aIter != aEndIter )
141  {
142  const SwAccessibleChild& rLower = *aIter;
143  const SwFrame *pLower = rLower.GetSwFrame();
144  if( pLower )
145  {
146  if( pLower->IsRowFrame() )
147  {
148  // #i77106#
149  if ( IncludeRow( *pLower ) )
150  {
151  maRows.insert( pLower->getFrameArea().Top() - maTabFramePos.getY() );
152  CollectData( pLower );
153  }
154  }
155  else if( pLower->IsCellFrame() &&
156  rLower.IsAccessible( mbIsInPagePreview ) )
157  {
158  maColumns.insert( pLower->getFrameArea().Left() - maTabFramePos.getX() );
159  }
160  else
161  {
162  CollectData( pLower );
163  }
164  }
165  ++aIter;
166  }
167 }
168 
170  const Point& rPos, const SwFrame *pFrame, bool bExact,
171  const SwFrame *& rRet ) const
172 {
173  bool bFound = false;
174 
175  const SwAccessibleChildSList aList( *pFrame, mrAccMap );
177  SwAccessibleChildSList::const_iterator aEndIter( aList.end() );
178  while( !bFound && aIter != aEndIter )
179  {
180  const SwAccessibleChild& rLower = *aIter;
181  const SwFrame *pLower = rLower.GetSwFrame();
182  OSL_ENSURE( pLower, "child should be a frame" );
183  if( pLower )
184  {
185  if( rLower.IsAccessible( mbIsInPagePreview ) )
186  {
187  OSL_ENSURE( pLower->IsCellFrame(), "lower is not a cell frame" );
188  const SwRect& rFrame = pLower->getFrameArea();
189  if( rFrame.Right() >= rPos.X() && rFrame.Bottom() >= rPos.Y() )
190  {
191  // We have found the cell
192  OSL_ENSURE( rFrame.Left() <= rPos.X() && rFrame.Top() <= rPos.Y(),
193  "find frame moved to far!" );
194  bFound = true;
195  if( !bExact ||
196  (rFrame.Top() == rPos.Y() && rFrame.Left() == rPos.Y() ) )
197  {
198  rRet = pLower;
199  }
200  }
201  }
202  else
203  {
204  // #i77106#
205  if ( !pLower->IsRowFrame() ||
206  IncludeRow( *pLower ) )
207  {
208  bFound = FindCell( rPos, pLower, bExact, rRet );
209  }
210  }
211  }
212  ++aIter;
213  }
214 
215  return bFound;
216 }
217 
219  const Point& rTabPos,
220  const SwRect& rArea,
221  const SwSelBoxes& rSelBoxes,
222  const SwFrame *pFrame,
223  SwAccTableSelHandler_Impl& rSelHdl,
224  bool bColumns ) const
225 {
226  const SwAccessibleChildSList aList( *pFrame, mrAccMap );
228  SwAccessibleChildSList::const_iterator aEndIter( aList.end() );
229  while( aIter != aEndIter )
230  {
231  const SwAccessibleChild& rLower = *aIter;
232  const SwFrame *pLower = rLower.GetSwFrame();
233  OSL_ENSURE( pLower, "child should be a frame" );
234  const SwRect& rBox = rLower.GetBox( mrAccMap );
235  if( pLower && rBox.IsOver( rArea ) )
236  {
237  if( rLower.IsAccessible( mbIsInPagePreview ) )
238  {
239  OSL_ENSURE( pLower->IsCellFrame(), "lower is not a cell frame" );
240  const SwCellFrame *pCFrame =
241  static_cast < const SwCellFrame * >( pLower );
242  SwTableBox *pBox =
243  const_cast< SwTableBox *>( pCFrame->GetTabBox() );
244  if( rSelBoxes.find( pBox ) == rSelBoxes.end() )
245  {
246  const Int32Set_Impl rRowsOrCols =
247  bColumns ? maColumns : maRows;
248 
249  sal_Int32 nPos = bColumns ? (rBox.Left() - rTabPos.X())
250  : (rBox.Top() - rTabPos.Y());
251  Int32Set_Impl::const_iterator aSttRowOrCol(
252  rRowsOrCols.lower_bound( nPos ) );
253  sal_Int32 nRowOrCol =
254  static_cast< sal_Int32 >( std::distance(
255  rRowsOrCols.begin(), aSttRowOrCol ) );
256 
257  nPos = bColumns ? (rBox.Right() - rTabPos.X())
258  : (rBox.Bottom() - rTabPos.Y());
259  Int32Set_Impl::const_iterator aEndRowOrCol(
260  rRowsOrCols.upper_bound( nPos ) );
261  sal_Int32 nExt =
262  static_cast< sal_Int32 >( std::distance(
263  aSttRowOrCol, aEndRowOrCol ) );
264 
265  rSelHdl.Unselect( nRowOrCol, nExt );
266  }
267  }
268  else
269  {
270  // #i77106#
271  if ( !pLower->IsRowFrame() ||
272  IncludeRow( *pLower ) )
273  {
274  GetSelection( rTabPos, rArea, rSelBoxes, pLower, rSelHdl,
275  bColumns );
276  }
277  }
278  }
279  ++aIter;
280  }
281 }
282 
284  sal_Int32 nRow, sal_Int32 nColumn,
285  SwAccessibleTable *pThis ) const
286 {
287  CheckRowAndCol( nRow, nColumn, pThis );
288 
289  Int32Set_Impl::const_iterator aSttCol( GetColumnIter( nColumn ) );
290  Int32Set_Impl::const_iterator aSttRow( GetRowIter( nRow ) );
291  const SwFrame *pCellFrame = GetCellAtPos( *aSttCol, *aSttRow );
292 
293  return pCellFrame;
294 }
295 
297  sal_Int32 nStart, sal_Int32 nEnd,
298  const SwSelBoxes& rSelBoxes,
299  SwAccTableSelHandler_Impl& rSelHdl,
300  bool bColumns ) const
301 {
302  SwRect aArea( mpTabFrame->getFrameArea() );
303  Point aPos( aArea.Pos() );
304 
305  const Int32Set_Impl& rRowsOrColumns = bColumns ? maColumns : maRows;
306  if( nStart > 0 )
307  {
308  Int32Set_Impl::const_iterator aStt( rRowsOrColumns.begin() );
309  std::advance( aStt,
310  static_cast< Int32Set_Impl::difference_type >( nStart ) );
311  if( bColumns )
312  aArea.Left( *aStt + aPos.getX() );
313  else
314  aArea.Top( *aStt + aPos.getY() );
315  }
316  if( nEnd < static_cast< sal_Int32 >( rRowsOrColumns.size() ) )
317  {
318  Int32Set_Impl::const_iterator aEnd( rRowsOrColumns.begin() );
319  std::advance( aEnd,
320  static_cast< Int32Set_Impl::difference_type >( nEnd ) );
321  if( bColumns )
322  aArea.Right( *aEnd + aPos.getX() - 1 );
323  else
324  aArea.Bottom( *aEnd + aPos.getY() - 1 );
325  }
326 
327  GetSelection( aPos, aArea, rSelBoxes, mpTabFrame, rSelHdl, bColumns );
328 }
329 
331  sal_Int32 nLeft, sal_Int32 nTop ) const
332 {
333  Point aPos( mpTabFrame->getFrameArea().Pos() );
334  aPos.Move( nLeft, nTop );
335  const SwFrame *pRet = nullptr;
336  FindCell( aPos, mpTabFrame, false/*bExact*/, pRet );
337 
338  return pRet;
339 }
340 
342 {
343  sal_Int32 count = static_cast< sal_Int32 >( maRows.size() ) ;
344  count = (count <=0)? 1:count;
345  return count;
346 }
347 
349 {
350  return static_cast< sal_Int32 >( maColumns.size() );
351 }
352 
354  const SwAccessibleTableData_Impl& rCmp ) const
355 {
356  return maRows == rCmp.maRows
357  && maColumns == rCmp.maColumns;
358 }
359 
361  const SwTabFrame *pTabFrame,
362  bool bIsInPagePreview,
363  bool bOnlyTableColumnHeader )
364  : mrAccMap( rAccMap )
365  , maTabFramePos( pTabFrame->getFrameArea().Pos() )
366  , mpTabFrame( pTabFrame )
367  , mbIsInPagePreview( bIsInPagePreview )
368  , mbOnlyTableColumnHeader( bOnlyTableColumnHeader )
369 {
371 }
372 
374  sal_Int32 nRow ) const
375 {
377  if( nRow > 0 )
378  {
379  std::advance( aCol,
380  static_cast< Int32Set_Impl::difference_type >( nRow ) );
381  }
382  return aCol;
383 }
384 
386  sal_Int32 nColumn ) const
387 {
389  if( nColumn > 0 )
390  {
391  std::advance( aCol,
392  static_cast< Int32Set_Impl::difference_type >( nColumn ) );
393  }
394  return aCol;
395 }
396 
398  sal_Int32 nRow, sal_Int32 nCol, SwAccessibleTable *pThis ) const
399 {
400  if( ( nRow < 0 || nRow >= static_cast< sal_Int32 >( maRows.size() ) ) ||
401  ( nCol < 0 || nCol >= static_cast< sal_Int32 >( maColumns.size() ) ) )
402  {
403  uno::Reference < XAccessibleTable > xThis( pThis );
404  lang::IndexOutOfBoundsException aExcept(
405  "row or column index out of range",
406  xThis );
407  throw aExcept;
408  }
409 }
410 
411 namespace {
412 
413 class SwAccSingleTableSelHandler_Impl : public SwAccTableSelHandler_Impl
414 {
415  bool m_bSelected;
416 
417 public:
418 
419  inline SwAccSingleTableSelHandler_Impl();
420 
421  virtual ~SwAccSingleTableSelHandler_Impl() {}
422 
423  bool IsSelected() const { return m_bSelected; }
424 
425  virtual void Unselect( sal_Int32, sal_Int32 ) override;
426 };
427 
428 }
429 
430 inline SwAccSingleTableSelHandler_Impl::SwAccSingleTableSelHandler_Impl() :
431  m_bSelected( true )
432 {
433 }
434 
435 void SwAccSingleTableSelHandler_Impl::Unselect( sal_Int32, sal_Int32 )
436 {
437  m_bSelected = false;
438 }
439 
440 namespace {
441 
442 class SwAccAllTableSelHandler_Impl : public SwAccTableSelHandler_Impl
443 
444 {
445  std::vector< bool > m_aSelected;
446  sal_Int32 m_nCount;
447 
448 public:
449  explicit SwAccAllTableSelHandler_Impl(sal_Int32 nSize)
450  : m_aSelected(nSize, true)
451  , m_nCount(nSize)
452  {
453  }
454 
455  uno::Sequence < sal_Int32 > GetSelSequence();
456 
457  virtual void Unselect( sal_Int32 nRowOrCol, sal_Int32 nExt ) override;
458  virtual ~SwAccAllTableSelHandler_Impl();
459 };
460 
461 }
462 
463 SwAccAllTableSelHandler_Impl::~SwAccAllTableSelHandler_Impl()
464 {
465 }
466 
467 uno::Sequence < sal_Int32 > SwAccAllTableSelHandler_Impl::GetSelSequence()
468 {
469  OSL_ENSURE( m_nCount >= 0, "underflow" );
470  uno::Sequence < sal_Int32 > aRet( m_nCount );
471  sal_Int32 *pRet = aRet.getArray();
472  sal_Int32 nPos = 0;
473  size_t nSize = m_aSelected.size();
474  for( size_t i=0; i < nSize && nPos < m_nCount; i++ )
475  {
476  if( m_aSelected[i] )
477  {
478  *pRet++ = i;
479  nPos++;
480  }
481  }
482 
483  OSL_ENSURE( nPos == m_nCount, "count is wrong" );
484 
485  return aRet;
486 }
487 
488 void SwAccAllTableSelHandler_Impl::Unselect( sal_Int32 nRowOrCol,
489  sal_Int32 nExt )
490 {
491  OSL_ENSURE( o3tl::make_unsigned( nRowOrCol ) < m_aSelected.size(),
492  "index too large" );
493  OSL_ENSURE( o3tl::make_unsigned( nRowOrCol+nExt ) <= m_aSelected.size(),
494  "extent too large" );
495  while( nExt )
496  {
497  if( m_aSelected[static_cast< size_t >( nRowOrCol )] )
498  {
499  m_aSelected[static_cast< size_t >( nRowOrCol )] = false;
500  m_nCount--;
501  }
502  nExt--;
503  nRowOrCol++;
504  }
505 }
506 
508 {
509  const SwSelBoxes *pSelBoxes = nullptr;
510  const SwCursorShell *pCSh = GetCursorShell();
511  if( (pCSh != nullptr) && pCSh->IsTableMode() )
512  {
513  pSelBoxes = &pCSh->GetTableCursor()->GetSelectedBoxes();
514  }
515 
516  return pSelBoxes;
517 }
518 
520  const SwAccessibleTableData_Impl& rTableData )
521 {
522  AccessibleTableModelChange aModelChange;
523  aModelChange.Type = AccessibleTableModelChangeType::UPDATE;
524  aModelChange.FirstRow = 0;
525  aModelChange.LastRow = rTableData.GetRowCount() - 1;
526  aModelChange.FirstColumn = 0;
527  aModelChange.LastColumn = rTableData.GetColumnCount() - 1;
528 
529  AccessibleEventObject aEvent;
530  aEvent.EventId = AccessibleEventId::TABLE_MODEL_CHANGED;
531  aEvent.NewValue <<= aModelChange;
532 
533  FireAccessibleEvent( aEvent );
534 }
535 
536 const SwTableBox* SwAccessibleTable::GetTableBox( sal_Int32 nChildIndex ) const
537 {
538  OSL_ENSURE( nChildIndex >= 0, "Illegal child index." );
539  OSL_ENSURE( nChildIndex < const_cast<SwAccessibleTable*>(this)->getAccessibleChildCount(), "Illegal child index." ); // #i77106#
540 
541  const SwTableBox* pBox = nullptr;
542 
543  // get table box for 'our' table cell
544  SwAccessibleChild aCell( GetChild( *const_cast<SwAccessibleMap*>(GetMap()), nChildIndex ) );
545  if( aCell.GetSwFrame() )
546  {
547  const SwFrame* pChildFrame = aCell.GetSwFrame();
548  if( (pChildFrame != nullptr) && pChildFrame->IsCellFrame() )
549  {
550  const SwCellFrame* pCellFrame =
551  static_cast<const SwCellFrame*>( pChildFrame );
552  pBox = pCellFrame->GetTabBox();
553  }
554  }
555 
556  OSL_ENSURE( pBox != nullptr, "We need the table box." );
557  return pBox;
558 }
559 
560 bool SwAccessibleTable::IsChildSelected( sal_Int32 nChildIndex ) const
561 {
562  bool bRet = false;
563  const SwSelBoxes* pSelBoxes = GetSelBoxes();
564  if( pSelBoxes )
565  {
566  const SwTableBox* pBox = GetTableBox( nChildIndex );
567  OSL_ENSURE( pBox != nullptr, "We need the table box." );
568  bRet = pSelBoxes->find( const_cast<SwTableBox*>( pBox ) ) != pSelBoxes->end();
569  }
570 
571  return bRet;
572 }
573 
575  sal_Int32 nSelectedChildIndex ) const
576 {
577  // iterate over all children to n-th isAccessibleChildSelected()
578  sal_Int32 nChildren = const_cast<SwAccessibleTable*>(this)->getAccessibleChildCount(); // #i77106#
579  if( nSelectedChildIndex >= nChildren )
580  return -1;
581 
582  sal_Int32 n = 0;
583  while( n < nChildren )
584  {
585  if( IsChildSelected( n ) )
586  {
587  if( 0 == nSelectedChildIndex )
588  break;
589  else
590  --nSelectedChildIndex;
591  }
592  ++n;
593  }
594 
595  return n < nChildren ? n : -1;
596 }
597 
599  ::utl::AccessibleStateSetHelper& rStateSet )
600 {
601  SwAccessibleContext::GetStates( rStateSet );
602  //Add resizable state to table
603  rStateSet.AddState( AccessibleStateType::RESIZABLE );
604  // MULTISELECTABLE
605  rStateSet.AddState( AccessibleStateType::MULTI_SELECTABLE );
606  SwCursorShell* pCursorShell = GetCursorShell();
607  if( pCursorShell )
608  rStateSet.AddState( AccessibleStateType::MULTI_SELECTABLE );
609 }
610 
612  std::shared_ptr<SwAccessibleMap> const& pInitMap,
613  const SwTabFrame* pTabFrame ) :
614  SwAccessibleContext( pInitMap, AccessibleRole::TABLE, pTabFrame )
615 {
616  const SwFrameFormat* pFrameFormat = pTabFrame->GetFormat();
617  if(pFrameFormat)
618  StartListening(const_cast<SwFrameFormat*>(pFrameFormat)->GetNotifier());
619 
620  SetName( pFrameFormat->GetName() + "-" + OUString::number( pTabFrame->GetPhyPageNum() ) );
621 
622  const OUString sArg1( static_cast< const SwTabFrame * >( GetFrame() )->GetFormat()->GetName() );
623  const OUString sArg2( GetFormattedPageNumber() );
624 
625  m_sDesc = GetResource( STR_ACCESS_TABLE_DESC, &sArg1, &sArg2 );
626  UpdateTableData();
627 }
628 
630 {
631  SolarMutexGuard aGuard;
632 
633  mpTableData.reset();
634 }
635 
637 {
638  if(rHint.GetId() == SfxHintId::Dying)
639  {
640  EndListeningAll();
641  }
642  else if(auto pLegacyHint = dynamic_cast<const sw::LegacyModifyHint*>(&rHint))
643  {
644  const sal_uInt16 nWhich = pLegacyHint->GetWhich();
645  const SwTabFrame* pTabFrame = static_cast<const SwTabFrame*>(GetFrame());
646  if(nWhich == RES_NAME_CHANGED && pTabFrame)
647  {
648  const SwFrameFormat *pFrameFormat = pTabFrame->GetFormat();
649 
650  const OUString sOldName( GetName() );
651  const OUString sNewTabName = pFrameFormat->GetName();
652 
653  SetName( sNewTabName + "-" + OUString::number( pTabFrame->GetPhyPageNum() ) );
654 
655  if( sOldName != GetName() )
656  {
657  AccessibleEventObject aEvent;
658  aEvent.EventId = AccessibleEventId::NAME_CHANGED;
659  aEvent.OldValue <<= sOldName;
660  aEvent.NewValue <<= GetName();
661  FireAccessibleEvent( aEvent );
662  }
663 
664  const OUString sOldDesc( m_sDesc );
665  const OUString sArg2( GetFormattedPageNumber() );
666 
667  m_sDesc = GetResource( STR_ACCESS_TABLE_DESC, &sNewTabName, &sArg2 );
668  if( m_sDesc != sOldDesc )
669  {
670  AccessibleEventObject aEvent;
671  aEvent.EventId = AccessibleEventId::DESCRIPTION_CHANGED;
672  aEvent.OldValue <<= sOldDesc;
673  aEvent.NewValue <<= m_sDesc;
674  FireAccessibleEvent( aEvent );
675  }
676  }
677  }
678 }
679 
681 {
682  uno::Any aRet;
683  if ( rType == cppu::UnoType<XAccessibleTable>::get() )
684  {
685  uno::Reference<XAccessibleTable> xThis( this );
686  aRet <<= xThis;
687  }
688  else if ( rType == cppu::UnoType<XAccessibleSelection>::get() )
689  {
690  uno::Reference<XAccessibleSelection> xSelection( this );
691  aRet <<= xSelection;
692  }
693  else if ( rType == cppu::UnoType<XAccessibleTableSelection>::get() )
694  {
695  uno::Reference<XAccessibleTableSelection> xTableExtent( this );
696  aRet <<= xTableExtent;
697  }
698  else
699  {
700  aRet = SwAccessibleContext::queryInterface(rType);
701  }
702 
703  return aRet;
704 }
705 
706 // XTypeProvider
707 uno::Sequence< uno::Type > SAL_CALL SwAccessibleTable::getTypes()
708 {
709  return cppu::OTypeCollection(
712  SwAccessibleContext::getTypes() ).getTypes();
713 }
714 
715 uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleTable::getImplementationId()
716 {
717  return css::uno::Sequence<sal_Int8>();
718 }
719 
720 // #i77106#
721 std::unique_ptr<SwAccessibleTableData_Impl> SwAccessibleTable::CreateNewTableData()
722 {
723  const SwTabFrame* pTabFrame = static_cast<const SwTabFrame*>( GetFrame() );
724  return std::unique_ptr<SwAccessibleTableData_Impl>(new SwAccessibleTableData_Impl( *GetMap(), pTabFrame, IsInPagePreview() ));
725 }
726 
728 {
729  // #i77106# - usage of new method <CreateNewTableData()>
731 }
732 
734 {
735  mpTableData.reset();
736 }
737 
739 {
740  SolarMutexGuard aGuard;
741 
742  ThrowIfDisposed();
743 
744  return m_sDesc;
745 }
746 
748 {
749  SolarMutexGuard aGuard;
750 
751  ThrowIfDisposed();
752 
753  return GetTableData().GetRowCount();
754 }
755 
757 {
758  SolarMutexGuard aGuard;
759 
760  ThrowIfDisposed();
761 
762  return GetTableData().GetColumnCount();
763 }
764 
766  sal_Int32 nRow )
767 {
768  // #i87532# - determine table cell in <nRow>th row and
769  // in first column of row header table and return its text content.
770  OUString sRowDesc;
771 
772  GetTableData().CheckRowAndCol(nRow, 0, this);
773 
774  uno::Reference< XAccessibleTable > xTableRowHeader = getAccessibleRowHeaders();
775  if ( xTableRowHeader.is() )
776  {
777  uno::Reference< XAccessible > xRowHeaderCell =
778  xTableRowHeader->getAccessibleCellAt( nRow, 0 );
779  OSL_ENSURE( xRowHeaderCell.is(),
780  "<SwAccessibleTable::getAccessibleRowDescription(..)> - missing row header cell -> serious issue." );
781  uno::Reference< XAccessibleContext > xRowHeaderCellContext =
782  xRowHeaderCell->getAccessibleContext();
783  const sal_Int32 nCellChildCount( xRowHeaderCellContext->getAccessibleChildCount() );
784  for ( sal_Int32 nChildIndex = 0; nChildIndex < nCellChildCount; ++nChildIndex )
785  {
786  uno::Reference< XAccessible > xChild = xRowHeaderCellContext->getAccessibleChild( nChildIndex );
787  uno::Reference< XAccessibleText > xChildText( xChild, uno::UNO_QUERY );
788  if ( xChildText.is() )
789  {
790  sRowDesc += xChildText->getText();
791  }
792  }
793  }
794 
795  return sRowDesc;
796 }
797 
799  sal_Int32 nColumn )
800 {
801  // #i87532# - determine table cell in first row and
802  // in <nColumn>th column of column header table and return its text content.
803  OUString sColumnDesc;
804 
805  GetTableData().CheckRowAndCol(0, nColumn, this);
806 
807  uno::Reference< XAccessibleTable > xTableColumnHeader = getAccessibleColumnHeaders();
808  if ( xTableColumnHeader.is() )
809  {
810  uno::Reference< XAccessible > xColumnHeaderCell =
811  xTableColumnHeader->getAccessibleCellAt( 0, nColumn );
812  OSL_ENSURE( xColumnHeaderCell.is(),
813  "<SwAccessibleTable::getAccessibleColumnDescription(..)> - missing column header cell -> serious issue." );
814  uno::Reference< XAccessibleContext > xColumnHeaderCellContext =
815  xColumnHeaderCell->getAccessibleContext();
816  const sal_Int32 nCellChildCount( xColumnHeaderCellContext->getAccessibleChildCount() );
817  for ( sal_Int32 nChildIndex = 0; nChildIndex < nCellChildCount; ++nChildIndex )
818  {
819  uno::Reference< XAccessible > xChild = xColumnHeaderCellContext->getAccessibleChild( nChildIndex );
820  uno::Reference< XAccessibleText > xChildText( xChild, uno::UNO_QUERY );
821  if ( xChildText.is() )
822  {
823  sColumnDesc += xChildText->getText();
824  }
825  }
826  }
827 
828  return sColumnDesc;
829 }
830 
832  sal_Int32 nRow, sal_Int32 nColumn )
833 {
834  sal_Int32 nExtend = -1;
835 
836  SolarMutexGuard aGuard;
837 
838  ThrowIfDisposed();
839 
840  UpdateTableData();
841  GetTableData().CheckRowAndCol( nRow, nColumn, this );
842 
844  GetTableData().GetColumnIter( nColumn ) );
846  GetTableData().GetRowIter( nRow ) );
847  const SwFrame *pCellFrame = GetTableData().GetCellAtPos( *aSttCol, *aSttRow );
848  if( pCellFrame )
849  {
850  sal_Int32 nBottom = pCellFrame->getFrameArea().Bottom();
851  nBottom -= GetFrame()->getFrameArea().Top();
853  GetTableData().GetRows().upper_bound( nBottom ) );
854  nExtend =
855  static_cast< sal_Int32 >( std::distance( aSttRow, aEndRow ) );
856  }
857 
858  return nExtend;
859 }
860 
862  sal_Int32 nRow, sal_Int32 nColumn )
863 {
864  sal_Int32 nExtend = -1;
865 
866  SolarMutexGuard aGuard;
867 
868  ThrowIfDisposed();
869  UpdateTableData();
870 
871  GetTableData().CheckRowAndCol( nRow, nColumn, this );
872 
874  GetTableData().GetColumnIter( nColumn ) );
876  GetTableData().GetRowIter( nRow ) );
877  const SwFrame *pCellFrame = GetTableData().GetCellAtPos( *aSttCol, *aSttRow );
878  if( pCellFrame )
879  {
880  sal_Int32 nRight = pCellFrame->getFrameArea().Right();
881  nRight -= GetFrame()->getFrameArea().Left();
883  GetTableData().GetColumns().upper_bound( nRight ) );
884  nExtend =
885  static_cast< sal_Int32 >( std::distance( aSttCol, aEndCol ) );
886  }
887 
888  return nExtend;
889 }
890 
891 uno::Reference< XAccessibleTable > SAL_CALL
893 {
894  // Row headers aren't supported
895  return uno::Reference< XAccessibleTable >();
896 }
897 
898 uno::Reference< XAccessibleTable > SAL_CALL
900 {
901  SolarMutexGuard aGuard;
902 
903  // #i87532# - assure that return accessible object is empty,
904  // if no column header exists.
905  SwAccessibleTableColHeaders* pTableColHeaders =
906  new SwAccessibleTableColHeaders(GetMap()->shared_from_this(),
907  static_cast<const SwTabFrame *>(GetFrame()));
908  uno::Reference< XAccessibleTable > xTableColumnHeaders( pTableColHeaders );
909  if ( pTableColHeaders->getAccessibleChildCount() <= 0 )
910  {
911  return uno::Reference< XAccessibleTable >();
912  }
913 
914  return xTableColumnHeaders;
915 }
916 
917 uno::Sequence< sal_Int32 > SAL_CALL SwAccessibleTable::getSelectedAccessibleRows()
918 {
919  SolarMutexGuard aGuard;
920 
921  ThrowIfDisposed();
922 
923  const SwSelBoxes *pSelBoxes = GetSelBoxes();
924  if( pSelBoxes )
925  {
926  sal_Int32 nRows = GetTableData().GetRowCount();
927  SwAccAllTableSelHandler_Impl aSelRows( nRows );
928 
929  GetTableData().GetSelection( 0, nRows, *pSelBoxes, aSelRows,
930  false );
931 
932  return aSelRows.GetSelSequence();
933  }
934  else
935  {
936  return uno::Sequence< sal_Int32 >( 0 );
937  }
938 }
939 
940 uno::Sequence< sal_Int32 > SAL_CALL SwAccessibleTable::getSelectedAccessibleColumns()
941 {
942  SolarMutexGuard aGuard;
943 
944  ThrowIfDisposed();
945 
946  const SwSelBoxes *pSelBoxes = GetSelBoxes();
947  if( pSelBoxes )
948  {
949  sal_Int32 nCols = GetTableData().GetColumnCount();
950  SwAccAllTableSelHandler_Impl aSelCols( nCols );
951 
952  GetTableData().GetSelection( 0, nCols, *pSelBoxes, aSelCols, true );
953 
954  return aSelCols.GetSelSequence();
955  }
956  else
957  {
958  return uno::Sequence< sal_Int32 >( 0 );
959  }
960 }
961 
963 {
964  SolarMutexGuard aGuard;
965 
966  ThrowIfDisposed();
967 
968  GetTableData().CheckRowAndCol( nRow, 0, this );
969 
970  bool bRet;
971  const SwSelBoxes *pSelBoxes = GetSelBoxes();
972  if( pSelBoxes )
973  {
974  SwAccSingleTableSelHandler_Impl aSelRow;
975  GetTableData().GetSelection( nRow, nRow+1, *pSelBoxes, aSelRow,
976  false );
977  bRet = aSelRow.IsSelected();
978  }
979  else
980  {
981  bRet = false;
982  }
983 
984  return bRet;
985 }
986 
988  sal_Int32 nColumn )
989 {
990  SolarMutexGuard aGuard;
991 
992  ThrowIfDisposed();
993 
994  GetTableData().CheckRowAndCol( 0, nColumn, this );
995 
996  bool bRet;
997  const SwSelBoxes *pSelBoxes = GetSelBoxes();
998  if( pSelBoxes )
999  {
1000  SwAccSingleTableSelHandler_Impl aSelCol;
1001 
1002  GetTableData().GetSelection( nColumn, nColumn+1, *pSelBoxes, aSelCol,
1003  true );
1004  bRet = aSelCol.IsSelected();
1005  }
1006  else
1007  {
1008  bRet = false;
1009  }
1010 
1011  return bRet;
1012 }
1013 
1014 uno::Reference< XAccessible > SAL_CALL SwAccessibleTable::getAccessibleCellAt(
1015  sal_Int32 nRow, sal_Int32 nColumn )
1016 {
1017  uno::Reference< XAccessible > xRet;
1018 
1019  SolarMutexGuard aGuard;
1020 
1021  ThrowIfDisposed();
1022 
1023  const SwFrame *pCellFrame =
1024  GetTableData().GetCell( nRow, nColumn, this );
1025  if( pCellFrame )
1026  xRet = GetMap()->GetContext( pCellFrame );
1027 
1028  return xRet;
1029 }
1030 
1031 uno::Reference< XAccessible > SAL_CALL SwAccessibleTable::getAccessibleCaption()
1032 {
1033  // captions aren't supported
1034  return uno::Reference< XAccessible >();
1035 }
1036 
1037 uno::Reference< XAccessible > SAL_CALL SwAccessibleTable::getAccessibleSummary()
1038 {
1039  // summaries aren't supported
1040  return uno::Reference< XAccessible >();
1041 }
1042 
1044  sal_Int32 nRow, sal_Int32 nColumn )
1045 {
1046  bool bRet = false;
1047 
1048  SolarMutexGuard aGuard;
1049 
1050  ThrowIfDisposed();
1051 
1052  const SwFrame *pFrame =
1053  GetTableData().GetCell( nRow, nColumn, this );
1054  if( pFrame && pFrame->IsCellFrame() )
1055  {
1056  const SwSelBoxes *pSelBoxes = GetSelBoxes();
1057  if( pSelBoxes )
1058  {
1059  const SwCellFrame *pCFrame = static_cast < const SwCellFrame * >( pFrame );
1060  SwTableBox *pBox =
1061  const_cast< SwTableBox *>( pCFrame->GetTabBox() );
1062  bRet = pSelBoxes->find( pBox ) != pSelBoxes->end();
1063  }
1064  }
1065 
1066  return bRet;
1067 }
1068 
1070  sal_Int32 nRow, sal_Int32 nColumn )
1071 {
1072  sal_Int32 nRet = -1;
1073 
1074  SolarMutexGuard aGuard;
1075 
1076  ThrowIfDisposed();
1077 
1078  SwAccessibleChild aCell( GetTableData().GetCell( nRow, nColumn, this ));
1079  if ( aCell.IsValid() )
1080  {
1081  nRet = GetChildIndex( *(GetMap()), aCell );
1082  }
1083 
1084  return nRet;
1085 }
1086 
1087 sal_Int32 SAL_CALL SwAccessibleTable::getAccessibleRow( sal_Int32 nChildIndex )
1088 {
1089  sal_Int32 nRet = -1;
1090 
1091  SolarMutexGuard aGuard;
1092 
1093  ThrowIfDisposed();
1094 
1095  // #i77106#
1096  if ( ( nChildIndex < 0 ) ||
1097  ( nChildIndex >= getAccessibleChildCount() ) )
1098  {
1099  throw lang::IndexOutOfBoundsException();
1100  }
1101 
1102  SwAccessibleChild aCell( GetChild( *(GetMap()), nChildIndex ) );
1103  if ( aCell.GetSwFrame() )
1104  {
1105  sal_Int32 nTop = aCell.GetSwFrame()->getFrameArea().Top();
1106  nTop -= GetFrame()->getFrameArea().Top();
1108  GetTableData().GetRows().lower_bound( nTop ) );
1109  nRet = static_cast< sal_Int32 >( std::distance(
1110  GetTableData().GetRows().begin(), aRow ) );
1111  }
1112  else
1113  {
1114  OSL_ENSURE( !aCell.IsValid(), "SwAccessibleTable::getAccessibleColumn:"
1115  "aCell not expected to be valid.");
1116 
1117  throw lang::IndexOutOfBoundsException();
1118  }
1119 
1120  return nRet;
1121 }
1122 
1124  sal_Int32 nChildIndex )
1125 {
1126  sal_Int32 nRet = -1;
1127 
1128  SolarMutexGuard aGuard;
1129 
1130  ThrowIfDisposed();
1131 
1132  // #i77106#
1133  if ( ( nChildIndex < 0 ) ||
1134  ( nChildIndex >= getAccessibleChildCount() ) )
1135  {
1136  throw lang::IndexOutOfBoundsException();
1137  }
1138 
1139  SwAccessibleChild aCell( GetChild( *(GetMap()), nChildIndex ) );
1140  if ( aCell.GetSwFrame() )
1141  {
1142  sal_Int32 nLeft = aCell.GetSwFrame()->getFrameArea().Left();
1143  nLeft -= GetFrame()->getFrameArea().Left();
1145  GetTableData().GetColumns().lower_bound( nLeft ) );
1146  nRet = static_cast< sal_Int32 >( std::distance(
1147  GetTableData().GetColumns().begin(), aCol ) );
1148  }
1149  else
1150  {
1151  OSL_ENSURE( !aCell.IsValid(), "SwAccessibleTable::getAccessibleColumn:"
1152  "aCell not expected to be valid.");
1153 
1154  throw lang::IndexOutOfBoundsException();
1155  }
1156 
1157  return nRet;
1158 }
1159 
1161 {
1162  return "com.sun.star.comp.Writer.SwAccessibleTableView";
1163 }
1164 
1166  const OUString& sTestServiceName)
1167 {
1168  return cppu::supportsService(this, sTestServiceName);
1169 }
1170 
1171 uno::Sequence< OUString > SAL_CALL SwAccessibleTable::getSupportedServiceNames()
1172 {
1173  return { "com.sun.star.table.AccessibleTableView", sAccessibleServiceName };
1174 }
1175 
1177 {
1178  SolarMutexGuard aGuard;
1179 
1180  //need to update children
1181  std::unique_ptr<SwAccessibleTableData_Impl> pNewTableData = CreateNewTableData();
1182  if( !pNewTableData->CompareExtents( GetTableData() ) )
1183  {
1184  mpTableData = std::move(pNewTableData);
1186  }
1187  if( HasTableData() )
1188  GetTableData().SetTablePos( GetFrame()->getFrameArea().Pos() );
1189 
1191 }
1192 
1193 void SwAccessibleTable::Dispose(bool bRecursive, bool bCanSkipInvisible)
1194 {
1195  SolarMutexGuard aGuard;
1196  EndListeningAll();
1197  SwAccessibleContext::Dispose(bRecursive, bCanSkipInvisible);
1198 }
1199 
1200 void SwAccessibleTable::DisposeChild( const SwAccessibleChild& rChildFrameOrObj,
1201  bool bRecursive, bool bCanSkipInvisible )
1202 {
1203  SolarMutexGuard aGuard;
1204 
1205  const SwFrame *pFrame = rChildFrameOrObj.GetSwFrame();
1206  OSL_ENSURE( pFrame, "frame expected" );
1207  if( HasTableData() )
1208  {
1210  ClearTableData();
1211  }
1212 
1213  // There are two reason why this method has been called. The first one
1214  // is there is no context for pFrame. The method is then called by
1215  // the map, and we have to call our superclass.
1216  // The other situation is that we have been call by a call to get notified
1217  // about its change. We then must not call the superclass
1218  uno::Reference< XAccessible > xAcc( GetMap()->GetContext( pFrame, false ) );
1219  if( !xAcc.is() )
1220  SwAccessibleContext::DisposeChild( rChildFrameOrObj, bRecursive, bCanSkipInvisible );
1221 }
1222 
1223 void SwAccessibleTable::InvalidateChildPosOrSize( const SwAccessibleChild& rChildFrameOrObj,
1224  const SwRect& rOldBox )
1225 {
1226  SolarMutexGuard aGuard;
1227 
1228  if( HasTableData() )
1229  {
1231  GetFrame()->getFrameArea().Pos() != GetTableData().GetTablePos(),
1232  "sw.a11y", "table has invalid position" );
1233  if( HasTableData() )
1234  {
1235  std::unique_ptr<SwAccessibleTableData_Impl> pNewTableData = CreateNewTableData(); // #i77106#
1236  if( !pNewTableData->CompareExtents( GetTableData() ) )
1237  {
1238  if (pNewTableData->GetRowCount() != mpTableData->GetRowCount()
1239  && 1 < GetTableData().GetRowCount())
1240  {
1241  Int32Set_Impl::const_iterator aSttCol( GetTableData().GetColumnIter( 0 ) );
1242  Int32Set_Impl::const_iterator aSttRow( GetTableData().GetRowIter( 1 ) );
1243  const SwFrame *pCellFrame = GetTableData().GetCellAtPos( *aSttCol, *aSttRow );
1244  Int32Set_Impl::const_iterator aSttCol2( pNewTableData->GetColumnIter( 0 ) );
1245  Int32Set_Impl::const_iterator aSttRow2( pNewTableData->GetRowIter( 0 ) );
1246  const SwFrame *pCellFrame2 = pNewTableData->GetCellAtPos( *aSttCol2, *aSttRow2 );
1247 
1248  if(pCellFrame == pCellFrame2)
1249  {
1250  AccessibleTableModelChange aModelChange;
1251  aModelChange.Type = AccessibleTableModelChangeType::UPDATE;
1252  aModelChange.FirstRow = 0;
1253  aModelChange.LastRow = mpTableData->GetRowCount() - 1;
1254  aModelChange.FirstColumn = 0;
1255  aModelChange.LastColumn = mpTableData->GetColumnCount() - 1;
1256 
1257  AccessibleEventObject aEvent;
1258  aEvent.EventId = AccessibleEventId::TABLE_COLUMN_HEADER_CHANGED;
1259  aEvent.NewValue <<= aModelChange;
1260 
1261  FireAccessibleEvent( aEvent );
1262  }
1263  }
1264  else
1266  ClearTableData();
1267  mpTableData = std::move(pNewTableData);
1268  }
1269  }
1270  }
1271 
1272  // #i013961# - always call super class method
1273  SwAccessibleContext::InvalidateChildPosOrSize( rChildFrameOrObj, rOldBox );
1274 }
1275 
1276 // XAccessibleSelection
1277 
1279  sal_Int32 nChildIndex )
1280 {
1281  SolarMutexGuard aGuard;
1282 
1283  ThrowIfDisposed();
1284 
1285  if( (nChildIndex < 0) || (nChildIndex >= getAccessibleChildCount()) ) // #i77106#
1286  throw lang::IndexOutOfBoundsException();
1287 
1288  // preliminaries: get 'our' table box, and get the cursor shell
1289  const SwTableBox* pBox = GetTableBox( nChildIndex );
1290  OSL_ENSURE( pBox != nullptr, "We need the table box." );
1291 
1292  SwCursorShell* pCursorShell = GetCursorShell();
1293  if( pCursorShell == nullptr )
1294  return;
1295 
1296  // assure, that child, identified by the given index, isn't already selected.
1297  if ( IsChildSelected( nChildIndex ) )
1298  {
1299  return;
1300  }
1301 
1302  // now we can start to do the work: check whether we already have
1303  // a table selection (in 'our' table). If so, extend the
1304  // selection, else select the current cell.
1305 
1306  // if we have a selection in a table, check if it's in the
1307  // same table that we're trying to select in
1308  const SwTableNode* pSelectedTable = pCursorShell->IsCursorInTable();
1309  if( pSelectedTable != nullptr )
1310  {
1311  // get top-most table line
1312  const SwTableLine* pUpper = pBox->GetUpper();
1313  while( pUpper->GetUpper() != nullptr )
1314  pUpper = pUpper->GetUpper()->GetUpper();
1315  sal_uInt16 nPos =
1316  pSelectedTable->GetTable().GetTabLines().GetPos( pUpper );
1317  if( nPos == USHRT_MAX )
1318  pSelectedTable = nullptr;
1319  }
1320 
1321  // create the new selection
1322  const SwStartNode* pStartNode = pBox->GetSttNd();
1323  if( pSelectedTable == nullptr || !pCursorShell->GetTableCrs() )
1324  {
1325  pCursorShell->StartAction();
1326  // Set cursor into current cell. This deletes any table cursor.
1327  SwPaM aPaM( *pStartNode );
1328  aPaM.Move( fnMoveForward, GoInNode );
1329  Select( aPaM );
1330  // Move cursor to the end of the table creating a selection and a table
1331  // cursor.
1332  pCursorShell->SetMark();
1333  pCursorShell->MoveTable( GotoCurrTable, fnTableEnd );
1334  // now set the cursor into the cell again.
1335  SwPaM *pPaM = pCursorShell->GetTableCrs() ? pCursorShell->GetTableCrs()
1336  : pCursorShell->GetCursor();
1337  *pPaM->GetPoint() = *pPaM->GetMark();
1338  pCursorShell->EndAction();
1339  // we now have one cell selected!
1340  }
1341  else
1342  {
1343  // if the cursor is already in this table,
1344  // expand the current selection (i.e., set
1345  // point to new position; keep mark)
1346  SwPaM aPaM( *pStartNode );
1347  aPaM.Move( fnMoveForward, GoInNode );
1348  aPaM.SetMark();
1349  const SwPaM *pPaM = pCursorShell->GetTableCrs() ? pCursorShell->GetTableCrs()
1350  : pCursorShell->GetCursor();
1351  *(aPaM.GetMark()) = *pPaM->GetMark();
1352  Select( aPaM );
1353 
1354  }
1355 }
1356 
1358  sal_Int32 nChildIndex )
1359 {
1360  SolarMutexGuard aGuard;
1361 
1362  ThrowIfDisposed();
1363 
1364  if( (nChildIndex < 0) || (nChildIndex >= getAccessibleChildCount()) ) // #i77106#
1365  throw lang::IndexOutOfBoundsException();
1366 
1367  return IsChildSelected( nChildIndex );
1368 }
1369 
1371 {
1372  SolarMutexGuard aGuard;
1373 
1374  ThrowIfDisposed();
1375 
1376  SwCursorShell* pCursorShell = GetCursorShell();
1377  if( pCursorShell != nullptr )
1378  {
1379  pCursorShell->StartAction();
1380  pCursorShell->ClearMark();
1381  pCursorShell->EndAction();
1382  }
1383 }
1384 
1386 {
1387  // first clear selection, then select first and last child
1389  selectAccessibleChild( 0 );
1391 }
1392 
1394 {
1395  SolarMutexGuard aGuard;
1396 
1397  ThrowIfDisposed();
1398 
1399  // iterate over all children and count isAccessibleChildSelected()
1400  sal_Int32 nCount = 0;
1401 
1402  sal_Int32 nChildren = getAccessibleChildCount(); // #i71106#
1403  for( sal_Int32 n = 0; n < nChildren; n++ )
1404  if( IsChildSelected( n ) )
1405  nCount++;
1406 
1407  return nCount;
1408 }
1409 
1410 uno::Reference<XAccessible> SAL_CALL SwAccessibleTable::getSelectedAccessibleChild(
1411  sal_Int32 nSelectedChildIndex )
1412 {
1413  SolarMutexGuard aGuard;
1414 
1415  ThrowIfDisposed();
1416 
1417  // parameter checking (part 1): index lower 0
1418  if( nSelectedChildIndex < 0 )
1419  throw lang::IndexOutOfBoundsException();
1420 
1421  sal_Int32 nChildIndex = GetIndexOfSelectedChild( nSelectedChildIndex );
1422 
1423  // parameter checking (part 2): index higher than selected children?
1424  if( nChildIndex < 0 )
1425  throw lang::IndexOutOfBoundsException();
1426 
1427  // #i77106#
1428  if ( nChildIndex >= getAccessibleChildCount() )
1429  {
1430  throw lang::IndexOutOfBoundsException();
1431  }
1432 
1433  return getAccessibleChild( nChildIndex );
1434 }
1435 
1436 // index has to be treated as global child index.
1438  sal_Int32 nChildIndex )
1439 {
1440  SolarMutexGuard aGuard;
1441 
1442  ThrowIfDisposed();
1443 
1444  SwCursorShell* pCursorShell = GetCursorShell();
1445 
1446  // index has to be treated as global child index
1447  if ( !pCursorShell )
1448  throw lang::IndexOutOfBoundsException();
1449 
1450  // assure, that given child index is in bounds.
1451  if ( nChildIndex < 0 || nChildIndex >= getAccessibleChildCount() ) // #i77106#
1452  throw lang::IndexOutOfBoundsException();
1453 
1454  // assure, that child, identified by the given index, is selected.
1455  if ( !IsChildSelected( nChildIndex ) )
1456  return;
1457 
1458  const SwTableBox* pBox = GetTableBox( nChildIndex );
1459  OSL_ENSURE( pBox != nullptr, "We need the table box." );
1460 
1461  // If we unselect point, then set cursor to mark. If we clear another
1462  // selected box, then set cursor to point.
1463  // reduce selection to mark.
1464  SwPaM *pPaM = pCursorShell->GetTableCrs() ? pCursorShell->GetTableCrs()
1465  : pCursorShell->GetCursor();
1466  bool bDeselectPoint =
1467  pBox->GetSttNd() ==
1469 
1470  SwPaM aPaM( bDeselectPoint ? *pPaM->GetMark() : *pPaM->GetPoint() );
1471 
1472  pCursorShell->StartAction();
1473 
1474  // Set cursor into either point or mark
1475  Select( aPaM );
1476  // Move cursor to the end of the table creating a selection and a table
1477  // cursor.
1478  pCursorShell->SetMark();
1479  pCursorShell->MoveTable( GotoCurrTable, fnTableEnd );
1480  // now set the cursor into the cell again.
1481  pPaM = pCursorShell->GetTableCrs() ? pCursorShell->GetTableCrs()
1482  : pCursorShell->GetCursor();
1483  *pPaM->GetPoint() = *pPaM->GetMark();
1484  pCursorShell->EndAction();
1485 }
1486 
1488 {
1489  const SvxBrushItem &rBack = GetFrame()->GetAttrSet()->GetBackground();
1490  Color crBack = rBack.GetColor();
1491 
1492  if (COL_AUTO == crBack)
1493  {
1494  uno::Reference<XAccessible> xAccDoc = getAccessibleParent();
1495  if (xAccDoc.is())
1496  {
1497  uno::Reference<XAccessibleComponent> xComponentDoc(xAccDoc,uno::UNO_QUERY);
1498  if (xComponentDoc.is())
1499  {
1500  crBack = Color(xComponentDoc->getBackground());
1501  }
1502  }
1503  }
1504  return sal_Int32(crBack);
1505 }
1506 
1508 {
1509  AccessibleEventObject aEvent;
1510 
1511  aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_REMOVE;
1512 
1513  for (const auto& rCell : m_vecCellRemove)
1514  {
1515  // fdo#57197: check if the object is still alive
1516  uno::Reference<XAccessible> const xAcc(rCell.second);
1517  if (xAcc.is())
1518  {
1519  SwAccessibleContext *const pAccCell(rCell.first);
1520  assert(pAccCell);
1521  pAccCell->FireAccessibleEvent(aEvent);
1522  }
1523  }
1524 
1525  if (m_vecCellAdd.size() <= SELECTION_WITH_NUM)
1526  {
1527  aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_ADD;
1528  for (const auto& rCell : m_vecCellAdd)
1529  {
1530  // fdo#57197: check if the object is still alive
1531  uno::Reference<XAccessible> const xAcc(rCell.second);
1532  if (xAcc.is())
1533  {
1534  SwAccessibleContext *const pAccCell(rCell.first);
1535  assert(pAccCell);
1536  pAccCell->FireAccessibleEvent(aEvent);
1537  }
1538  }
1539  return ;
1540  }
1541  else
1542  {
1543  aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_WITHIN;
1544  FireAccessibleEvent(aEvent);
1545  }
1546 }
1547 
1549  SwAccessibleContext *const pAccCell, bool const bAddOrRemove)
1550 {
1551  uno::Reference<XAccessible> const xTmp(pAccCell);
1552  if (bAddOrRemove)
1553  {
1554  m_vecCellAdd.emplace_back(pAccCell, xTmp);
1555  }
1556  else
1557  {
1558  m_vecCellRemove.emplace_back(pAccCell, xTmp);
1559  }
1560 }
1561 
1562 // XAccessibleTableSelection
1563 sal_Bool SAL_CALL SwAccessibleTable::selectRow( sal_Int32 row )
1564 {
1565  SolarMutexGuard g;
1566 
1567  if( isAccessibleColumnSelected( row ) )
1568  return true;
1569 
1570  long lColumnCount = getAccessibleColumnCount();
1571  for(long lCol = 0; lCol < lColumnCount; lCol ++)
1572  {
1573  long lChildIndex = getAccessibleIndex(row, lCol);
1574  selectAccessibleChild(lChildIndex);
1575  }
1576 
1577  return true;
1578 }
1579 sal_Bool SAL_CALL SwAccessibleTable::selectColumn( sal_Int32 column )
1580 {
1581  SolarMutexGuard g;
1582 
1583  if( isAccessibleColumnSelected( column ) )
1584  return true;
1585 
1586  long lRowCount = getAccessibleRowCount();
1587 
1588  for(long lRow = 0; lRow < lRowCount; lRow ++)
1589  {
1590  long lChildIndex = getAccessibleIndex(lRow, column);
1591  selectAccessibleChild(lChildIndex);
1592  }
1593  return true;
1594 }
1595 
1596 sal_Bool SAL_CALL SwAccessibleTable::unselectRow( sal_Int32 row )
1597 {
1598  SolarMutexGuard g;
1599 
1600  if( isAccessibleSelected( row , 0 ) && isAccessibleSelected( row , getAccessibleColumnCount()-1 ) )
1601  {
1602  SwCursorShell* pCursorShell = GetCursorShell();
1603  if( pCursorShell != nullptr )
1604  {
1605  pCursorShell->StartAction();
1606  pCursorShell->ClearMark();
1607  pCursorShell->EndAction();
1608  return true;
1609  }
1610  }
1611  return true;
1612 }
1613 
1614 sal_Bool SAL_CALL SwAccessibleTable::unselectColumn( sal_Int32 column )
1615 {
1616  SolarMutexGuard g;
1617 
1618  if( isAccessibleSelected( 0 , column ) && isAccessibleSelected( getAccessibleRowCount()-1,column))
1619  {
1620  SwCursorShell* pCursorShell = GetCursorShell();
1621  if( pCursorShell != nullptr )
1622  {
1623  pCursorShell->StartAction();
1624  pCursorShell->ClearMark();
1625  pCursorShell->EndAction();
1626  return true;
1627  }
1628  }
1629  return true;
1630 }
1631 
1632 // #i77106# - implementation of class <SwAccessibleTableColHeaders>
1634  std::shared_ptr<SwAccessibleMap> const& pMap,
1635  const SwTabFrame *const pTabFrame)
1636  : SwAccessibleTable(pMap, pTabFrame)
1637 {
1638  SolarMutexGuard aGuard;
1639 
1640  const SwFrameFormat* pFrameFormat = pTabFrame->GetFormat();
1641  if(pFrameFormat)
1642  StartListening(const_cast<SwFrameFormat*>(pFrameFormat)->GetNotifier());
1643  const OUString aName = pFrameFormat->GetName() + "-ColumnHeaders";
1644 
1645  SetName( aName + "-" + OUString::number( pTabFrame->GetPhyPageNum() ) );
1646 
1647  const OUString sArg2( GetFormattedPageNumber() );
1648 
1649  SetDesc( GetResource( STR_ACCESS_TABLE_DESC, &aName, &sArg2 ) );
1650 
1651  NotRegisteredAtAccessibleMap(); // #i85634#
1652 }
1653 
1654 std::unique_ptr<SwAccessibleTableData_Impl> SwAccessibleTableColHeaders::CreateNewTableData()
1655 {
1656  const SwTabFrame* pTabFrame = static_cast<const SwTabFrame*>( GetFrame() );
1657  return std::unique_ptr<SwAccessibleTableData_Impl>(new SwAccessibleTableData_Impl( *(GetMap()), pTabFrame, IsInPagePreview(), true ));
1658 }
1659 
1661 {
1662 }
1663 
1664 // XInterface
1666 {
1667  return SwAccessibleTable::queryInterface( aType );
1668 }
1669 
1670 // XAccessibleContext
1672 {
1673  SolarMutexGuard aGuard;
1674 
1675  ThrowIfDisposed();
1676 
1677  sal_Int32 nCount = 0;
1678 
1679  const SwTabFrame* pTabFrame = static_cast<const SwTabFrame*>( GetFrame() );
1680  const SwAccessibleChildSList aVisList( GetVisArea(), *pTabFrame, *(GetMap()) );
1681  SwAccessibleChildSList::const_iterator aIter( aVisList.begin() );
1682  while( aIter != aVisList.end() )
1683  {
1684  const SwAccessibleChild& rLower = *aIter;
1685  if( rLower.IsAccessible( IsInPagePreview() ) )
1686  {
1687  nCount++;
1688  }
1689  else if( rLower.GetSwFrame() )
1690  {
1691  // There are no unaccessible SdrObjects that count
1692  if ( !rLower.GetSwFrame()->IsRowFrame() ||
1693  pTabFrame->IsInHeadline( *(rLower.GetSwFrame()) ) )
1694  {
1695  nCount += SwAccessibleFrame::GetChildCount( *(GetMap()),
1696  GetVisArea(),
1697  rLower.GetSwFrame(),
1698  IsInPagePreview() );
1699  }
1700  }
1701  ++aIter;
1702  }
1703 
1704  return nCount;
1705 }
1706 
1707 uno::Reference< XAccessible> SAL_CALL
1709 {
1710  if ( nIndex < 0 || nIndex >= getAccessibleChildCount() )
1711  {
1712  throw lang::IndexOutOfBoundsException();
1713  }
1714 
1715  return SwAccessibleTable::getAccessibleChild( nIndex );
1716 }
1717 
1718 // XAccessibleTable
1719 uno::Reference< XAccessibleTable >
1721 {
1722  return uno::Reference< XAccessibleTable >();
1723 }
1724 
1725 uno::Reference< XAccessibleTable >
1727 {
1728  return uno::Reference< XAccessibleTable >();
1729 }
1730 
1731 // XServiceInfo
1732 
1734 {
1735  static const char sImplName[] = "com.sun.star.comp.Writer.SwAccessibleTableColumnHeadersView";
1736  return sImplName;
1737 }
1738 
1739 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void Dispose(bool bRecursive, bool bCanSkipInvisible=true) override
Definition: acctable.cxx:1193
Starts a section of nodes in the document model.
Definition: node.hxx:311
Base class of the Writer layout elements.
Definition: frame.hxx:297
virtual sal_Bool SAL_CALL selectColumn(sal_Int32 column) override
Definition: acctable.cxx:1579
virtual OUString SAL_CALL getImplementationName() override
Returns an identifier for the implementation of this object.
Definition: acctable.cxx:1733
virtual sal_Bool SAL_CALL unselectRow(sal_Int32 row) override
Definition: acctable.cxx:1596
const_iterator lower_bound(const Value &x) const
const size_t count(pCandidateA->getBorderLines().size())
SwMoveFnCollection const & fnTableEnd
Definition: paminit.cxx:53
void FireAccessibleEvent(css::accessibility::AccessibleEventObject &rEvent)
Definition: acccontext.cxx:443
SwAccessibleTableData_Impl(SwAccessibleMap &rAccMap, const SwTabFrame *pTabFrame, bool bIsInPagePreview, bool bOnlyTableColumnHeader=false)
Definition: acctable.cxx:360
const SwSelBoxes & GetSelectedBoxes() const
Definition: swcrsr.hxx:280
virtual void SAL_CALL selectAllAccessibleChildren() override
Definition: acctable.cxx:1385
sal_Int32 SAL_CALL getBackground() override
Definition: acctable.cxx:1487
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleCaption() override
Definition: acctable.cxx:1031
bool IncludeRow(const SwFrame &rFrame) const
Definition: acctable.cxx:96
constexpr TypedWhichId< SwStringMsgPoolItem > RES_NAME_CHANGED(185)
static OUString GetResource(const char *pResId, const OUString *pArg1=nullptr, const OUString *pArg2=nullptr)
SwPaM * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
Definition: crsrsh.cxx:189
virtual void SAL_CALL selectAccessibleChild(sal_Int32 nChildIndex) override
Definition: acctable.cxx:1278
void GetSelection(const Point &rTabPos, const SwRect &rArea, const SwSelBoxes &rSelBoxes, const SwFrame *pFrame, SwAccTableSelHandler_Impl &rSelHdl, bool bColumns) const
Definition: acctable.cxx:218
virtual void InvalidateChildPosOrSize(const sw::access::SwAccessibleChild &rFrameOrObj, const SwRect &rFrame)
const SvxBrushItem & GetBackground(bool=true) const
Definition: frmatr.hxx:58
virtual void InvalidatePosOrSize(const SwRect &rOldBox) override
Definition: acctable.cxx:1176
virtual sal_Int32 SAL_CALL getAccessibleChildCount() override
Definition: acccontext.cxx:569
SwNodeIndex nNode
Definition: pam.hxx:37
bool IsTableMode() const
Definition: crsrsh.hxx:643
virtual OUString SAL_CALL getAccessibleRowDescription(sal_Int32 nRow) override
Definition: acctable.cxx:765
virtual sal_Bool SAL_CALL isAccessibleColumnSelected(sal_Int32 nColumn) override
Definition: acctable.cxx:987
const SwPosition * GetMark() const
Definition: pam.hxx:209
SwTabFrame is one table in the document layout, containing rows (which contain cells).
Definition: tabfrm.hxx:30
void NotRegisteredAtAccessibleMap()
Definition: acccontext.hxx:191
sal_Int64 n
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: acctable.cxx:707
Int32Set_Impl::const_iterator GetRowIter(sal_Int32 nRow) const
Definition: acctable.cxx:373
const SwShellTableCursor * GetTableCursor() const
Definition: crsrsh.hxx:645
Cells_t m_vecCellRemove
Definition: acctable.hxx:221
const SwFrame * GetCell(sal_Int32 nRow, sal_Int32 nColumn, SwAccessibleTable *pThis) const
Definition: acctable.cxx:283
const_iterator find(const Value &x) const
SwTableLine is one table row in the document model.
Definition: swtable.hxx:350
SwNode & GetNode() const
Definition: ndindex.hxx:119
virtual sal_Bool SAL_CALL supportsService(const OUString &sServiceName) override
Return whether the specified service is supported by this class.
Definition: acctable.cxx:1165
Cells_t m_vecCellAdd
Definition: acctable.hxx:220
virtual std::unique_ptr< SwAccessibleTableData_Impl > CreateNewTableData() override
Definition: acctable.cxx:1654
void Pos(const Point &rNew)
Definition: swrect.hxx:169
bool IsCellFrame() const
Definition: frame.hxx:1204
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
static sal_Int32 GetChildCount(SwAccessibleMap &rAccMap, const SwRect &rVisArea, const SwFrame *pFrame, bool bInPagePreviewr)
Definition: accframe.cxx:41
bool IsInPagePreview() const
Definition: accframe.hxx:87
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild(sal_Int32 nSelectedChildIndex) override
Definition: acctable.cxx:1410
virtual void Notify(const SfxHint &) override
Definition: acctable.cxx:636
void UpdateTableData()
Definition: acctable.cxx:727
SfxHintId GetId() const
virtual OUString SAL_CALL getImplementationName() override
Returns an identifier for the implementation of this object.
Definition: acctable.cxx:1160
virtual sal_Int32 SAL_CALL getAccessibleRowCount() override
Definition: acctable.cxx:747
const unsigned int SELECTION_WITH_NUM
Definition: acctable.cxx:60
bool GotoCurrTable(SwPaM &rCurrentCursor, SwMoveFnCollection const &fnPosTable, bool bInReadOnly)
Definition: trvltbl.cxx:632
constexpr::Color COL_AUTO(0xFF, 0xFF, 0xFF, 0xFF)
virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount() override
Definition: acctable.cxx:1393
SwCursorShell * GetCursorShell()
convenience method to get SwCursorShell through accessibility map
Definition: acccontext.cxx:101
OUString m_sDesc
Definition: acctable.hxx:50
static sw::access::SwAccessibleChild GetChild(SwAccessibleMap &rAccMap, const SwRect &rVisArea, const SwFrame &rFrame, sal_Int32 &rPos, bool bInPagePreview)
Definition: accframe.cxx:71
void Top(const long nTop)
Definition: swrect.hxx:204
void SetTablePos(const Point &rPos)
Definition: acctable.cxx:132
virtual sal_Int32 SAL_CALL getAccessibleIndex(sal_Int32 nRow, sal_Int32 nColumn) override
Definition: acctable.cxx:1069
const SwTableBox * GetTabBox() const
Definition: cellfrm.hxx:52
const SwFrame * GetFrame() const
Definition: accframe.hxx:103
enumrange< T >::Iterator begin(enumrange< T >)
const SwRect & getFrameArea() const
Definition: frame.hxx:177
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
const OUString & GetName() const
Definition: format.hxx:111
virtual OUString SAL_CALL getAccessibleDescription() override
Return this object's description.
Definition: acctable.cxx:738
int nCount
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
virtual sal_Bool SAL_CALL isAccessibleRowSelected(sal_Int32 nRow) override
Definition: acctable.cxx:962
void CollectData(const SwFrame *pFrame)
Definition: acctable.cxx:135
void CheckRowAndCol(sal_Int32 nRow, sal_Int32 nCol, SwAccessibleTable *pThis) const
Definition: acctable.cxx:397
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleCellAt(sal_Int32 nRow, sal_Int32 nColumn) override
Definition: acctable.cxx:1014
const SwTable & GetTable() const
Definition: node.hxx:505
const Int32Set_Impl & GetRows() const
Definition: acctable.cxx:108
const SwTableBox * GetTableBox(sal_Int32) const
get the SwTableBox* for the given child
Definition: acctable.cxx:536
virtual void DisposeChild(const sw::access::SwAccessibleChild &rFrameOrObj, bool bRecursive, bool bCanSkipInvisible)
void Right(const long nRight)
Definition: swrect.hxx:200
size_type size() const
virtual sal_Bool SAL_CALL isAccessibleSelected(sal_Int32 nRow, sal_Int32 nColumn) override
Definition: acctable.cxx:1043
const SwAttrSet * GetAttrSet() const
WARNING: this may not return correct RES_PAGEDESC/RES_BREAK items for SwTextFrame, use GetBreakItem()/GetPageDescItem() instead.
Definition: findfrm.cxx:674
bool Select(SwPaM *pPaM, SdrObject *pObj, bool bAdd)
o3tl::sorted_vector< sal_Int32 > Int32Set_Impl
Definition: acctable.cxx:58
const_iterator upper_bound(const Value &x) const
const Color & GetColor() const
void EndListeningAll()
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
Definition: acctable.cxx:1665
virtual void SAL_CALL deselectAccessibleChild(sal_Int32 nChildIndex) override
Definition: acctable.cxx:1437
const Point & GetTablePos() const
Definition: acctable.cxx:131
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
Definition: pam.cxx:501
SwAccessibleMap & mrAccMap
Definition: acctable.cxx:77
virtual sal_Int32 SAL_CALL getAccessibleRowExtentAt(sal_Int32 nRow, sal_Int32 nColumn) override
Definition: acctable.cxx:831
const SwTableNode * IsCursorInTable() const
Definition: crsrsh.hxx:889
const SwFrame * GetCellAtPos(sal_Int32 nLeft, sal_Int32 nTop) const
Definition: acctable.cxx:330
virtual sal_Bool SAL_CALL unselectColumn(sal_Int32 column) override
Definition: acctable.cxx:1614
Style of a layout element.
Definition: frmfmt.hxx:57
int i
bool GoInNode(SwPaM &rPam, SwMoveFnCollection const &fnMove)
Definition: pam.cxx:954
const SwPaM * GetTableCrs() const
Definition: crsrsh.hxx:904
Int32Set_Impl::const_iterator GetColumnIter(sal_Int32 nCol) const
Definition: acctable.cxx:385
std::unique_ptr< SwAccessibleTableData_Impl > mpTableData
Definition: acctable.hxx:49
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int32 nIndex) override
Return the specified child or NULL if index is invalid.
Definition: acctable.cxx:1708
const SwPosition * GetPoint() const
Definition: pam.hxx:207
void EndAction(const bool bIdleEnd=false, const bool DoSetPosX=false)
Definition: crsrsh.cxx:238
const_iterator begin() const
const OUString & GetName() const
Definition: acccontext.hxx:337
virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL getAccessibleColumnHeaders() override
Definition: acctable.cxx:899
bool FindCell(const Point &rPos, const SwFrame *pFrame, bool bExact, const SwFrame *&rFrame) const
Definition: acctable.cxx:169
void AddSelectionCell(SwAccessibleContext *, bool bAddOrRemove)
Definition: acctable.cxx:1548
static bool GetChildIndex(SwAccessibleMap &rAccMap, const SwRect &rVisArea, const SwFrame &rFrame, const sw::access::SwAccessibleChild &rChild, sal_Int32 &rPos, bool bInPagePreview)
Definition: accframe.cxx:138
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
unsigned char sal_Bool
bool IsRowFrame() const
Definition: frame.hxx:1200
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
Definition: acccontext.cxx:686
void SetMark()
Definition: crsrsh.hxx:875
virtual sal_Int32 SAL_CALL getAccessibleChildCount() override
Return the number of currently visible children.
Definition: acctable.cxx:1671
virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL getAccessibleColumnHeaders() override
Definition: acctable.cxx:1726
virtual void DisposeChild(const sw::access::SwAccessibleChild &rFrameOrObj, bool bRecursive, bool bCanSkipInvisible) override
Definition: acctable.cxx:1200
const_iterator end() const
virtual void InvalidatePosOrSize(const SwRect &rFrame)
bool StartListening(SvtBroadcaster &rBroadcaster)
const_iterator end() const
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int32 nIndex) override
Definition: acccontext.cxx:579
const char sAccessibleServiceName[]
Definition: acccontext.hxx:43
SwTableLines & GetTabLines()
Definition: swtable.hxx:199
virtual sal_Int32 SAL_CALL getAccessibleColumnExtentAt(sal_Int32 nRow, sal_Int32 nColumn) override
Definition: acctable.cxx:861
const_iterator begin() const
sal_Int32 GetColumnCount() const
Definition: acctable.cxx:348
void StartAction()
Definition: crsrsh.cxx:221
virtual void InvalidateChildPosOrSize(const sw::access::SwAccessibleChild &rFrameOrObj, const SwRect &rFrame) override
Definition: acctable.cxx:1223
sal_Int32 GetRowCount() const
Definition: acctable.cxx:341
sal_Int16 m_nCount
void Left(const long nLeft)
Definition: swrect.hxx:195
void Bottom(const long nBottom)
Definition: swrect.hxx:209
sal_Int32 GetIndexOfSelectedChild(sal_Int32 nSelectedChildIndex) const
Definition: acctable.cxx:574
const SwStartNode * GetSttNd() const
Definition: swtable.hxx:445
virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL getAccessibleRowHeaders() override
Definition: acctable.cxx:1720
virtual void SAL_CALL clearAccessibleSelection() override
Definition: acctable.cxx:1370
SwAccessibleTable(std::shared_ptr< SwAccessibleMap > const &pInitMap, const SwTabFrame *pTableFrame)
Definition: acctable.cxx:611
#define SAL_WARN_IF(condition, area, stream)
virtual void Dispose(bool bRecursive, bool bCanSkipInvisible=true)
sal_uInt16 GetPhyPageNum() const
Definition: trvlfrm.cxx:1694
OUString GetFormattedPageNumber() const
Definition: accframe.cxx:427
bool HasTableData() const
Definition: acctable.hxx:87
bool MoveTable(SwWhichTable, SwMoveFnCollection const &)
Definition: trvltbl.cxx:681
SwAccessibleTableData_Impl & GetTableData()
Definition: acctable.hxx:226
void ClearTableData()
Definition: acctable.cxx:733
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Returns a list of all supported services.
Definition: acctable.cxx:1171
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:254
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
Definition: paminit.cxx:59
virtual sal_Int32 SAL_CALL getAccessibleRow(sal_Int32 nChildIndex) override
Definition: acctable.cxx:1087
virtual void GetStates(::utl::AccessibleStateSetHelper &rStateSet)
Definition: acccontext.cxx:481
void FireTableChangeEvent(const SwAccessibleTableData_Impl &rTableData)
Definition: acctable.cxx:519
OUString aName
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
Definition: acctable.cxx:680
virtual ~SwAccessibleTable() override
Definition: acctable.cxx:629
SwTableBox is one table cell in the document model.
Definition: swtable.hxx:392
const SwSelBoxes * GetSelBoxes() const
Definition: acctable.cxx:507
void FireSelectionEvent()
Definition: acctable.cxx:1507
css::uno::Reference< css::accessibility::XAccessible > GetContext(const SwFrame *pFrame, bool bCreate=true)
Definition: accmap.cxx:1862
bool IsChildSelected(sal_Int32 nChildIndex) const
Definition: acctable.cxx:560
virtual void GetStates(::utl::AccessibleStateSetHelper &rStateSet) override
Definition: acctable.cxx:598
TABLE
css::uno::Sequence< css::uno::Type > SAL_CALL getTypes()
SwAccessibleMap * GetMap()
Definition: acccontext.hxx:113
virtual std::unique_ptr< SwAccessibleTableData_Impl > CreateNewTableData()
Definition: acctable.cxx:721
void ClearMark()
Definition: crsrsh.cxx:937
const SwStartNode * FindTableBoxStartNode() const
Definition: node.hxx:196
SwTableBox * GetUpper()
Definition: swtable.hxx:368
const Int32Set_Impl & GetColumns() const
Definition: acctable.cxx:109
bool CompareExtents(const SwAccessibleTableData_Impl &r) const
Definition: acctable.cxx:353
virtual OUString SAL_CALL getAccessibleColumnDescription(sal_Int32 nColumn) override
Definition: acctable.cxx:798
sal_uInt16 GetPos(const SwTableLine *pBox) const
Definition: swtable.hxx:96
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleSummary() override
Definition: acctable.cxx:1037
virtual sal_Bool SAL_CALL isAccessibleChildSelected(sal_Int32 nChildIndex) override
Definition: acctable.cxx:1357
SwAccessibleTableColHeaders(std::shared_ptr< SwAccessibleMap > const &pMap, const SwTabFrame *pTabFrame)
Definition: acctable.cxx:1633
virtual sal_Int32 SAL_CALL getAccessibleColumn(sal_Int32 nChildIndex) override
Definition: acctable.cxx:1123
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
Definition: pam.cxx:475
virtual sal_Int32 SAL_CALL getAccessibleColumnCount() override
Definition: acctable.cxx:756
const SwRect & GetVisArea() const
Definition: accframe.hxx:136
std::pair< const_iterator, bool > insert(Value &&x)
bool IsOver(const SwRect &rRect) const
Definition: swrect.cxx:123
virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL getAccessibleRowHeaders() override
Definition: acctable.cxx:892
virtual css::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleColumns() override
Definition: acctable.cxx:940
SwTableLine * GetUpper()
Definition: swtable.hxx:427
void AddState(sal_Int16 aState)
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: acctable.cxx:715
const SwTabFrame * mpTabFrame
Definition: acctable.cxx:81
void SetName(const OUString &rName)
Definition: acccontext.hxx:100
AnyEventRef aEvent
SwCellFrame is one table cell in the document layout.
Definition: cellfrm.hxx:30
void SetDesc(const OUString &sNewDesc)
Definition: acctable.hxx:70
virtual void Notify(const SfxHint &) override
Definition: acctable.cxx:1660
sal_uInt16 nPos
std::vector< Value >::const_iterator const_iterator
virtual css::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleRows() override
Definition: acctable.cxx:917
Int32Set_Impl maColumns
Definition: acctable.cxx:79
bool IsInHeadline(const SwFrame &rFrame) const
Definition: tabfrm.cxx:5442
virtual const SwFrameFormat * GetFormat() const
Definition: ssfrm.cxx:393
virtual sal_Bool SAL_CALL selectRow(sal_Int32 row) override
Definition: acctable.cxx:1563