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