LibreOffice Module sc (master)  1
AccessibleSpreadsheet.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 
21 #include <AccessibleCell.hxx>
22 #include <AccessibleDocument.hxx>
23 #include <tabvwsh.hxx>
24 #include <document.hxx>
25 #include <hints.hxx>
26 #include <scmod.hxx>
27 #include <markdata.hxx>
28 #include <gridwin.hxx>
29 
30 #include <o3tl/safeint.hxx>
33 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
34 #include <com/sun/star/accessibility/AccessibleEventId.hpp>
35 #include <com/sun/star/accessibility/AccessibleTableModelChangeType.hpp>
36 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
37 #include <sal/log.hxx>
38 #include <tools/gen.hxx>
39 #include <svtools/colorcfg.hxx>
40 #include <vcl/svapp.hxx>
41 #include <scresid.hxx>
42 #include <strings.hrc>
43 
44 #include <algorithm>
45 #include <cstdlib>
46 
47 using namespace ::com::sun::star;
48 using namespace ::com::sun::star::accessibility;
49 
50 static bool CompMinCol(const std::pair<sal_uInt16,sal_uInt16> & pc1,const std::pair<sal_uInt16,sal_uInt16> &pc2)
51 {
52  return pc1.first < pc2.first;
53 }
54 
56 {
57  if (pMarkedRanges->size() <= 1)
58  {
59  ScRange const & rRange = pMarkedRanges->front();
60  // MT IA2: Not used.
61  // const int nRowNum = rRange.aEnd.Row() - rRange.aStart.Row() + 1;
62  const int nColNum = rRange.aEnd.Col() - rRange.aStart.Col() + 1;
63  const int nCurCol = nSelectedChildIndex % nColNum;
64  const int nCurRow = (nSelectedChildIndex - nCurCol)/nColNum;
65  return ScMyAddress(static_cast<SCCOL>(rRange.aStart.Col() + nCurCol), rRange.aStart.Row() + nCurRow, maActiveCell.Tab());
66  }
67  else
68  {
70  sal_Int32 nMinRow = pDoc->MaxRow();
71  sal_Int32 nMaxRow = 0;
72  m_vecTempRange.clear();
73  size_t nSize = pMarkedRanges->size();
74  for (size_t i = 0; i < nSize; ++i)
75  {
76  ScRange const & rRange = (*pMarkedRanges)[i];
77  if (rRange.aStart.Tab() != rRange.aEnd.Tab())
78  {
79  if ((maActiveCell.Tab() >= rRange.aStart.Tab()) ||
80  maActiveCell.Tab() <= rRange.aEnd.Tab())
81  {
82  m_vecTempRange.push_back(rRange);
83  nMinRow = std::min(rRange.aStart.Row(),nMinRow);
84  nMaxRow = std::max(rRange.aEnd.Row(),nMaxRow);
85  }
86  else
87  SAL_WARN("sc", "Range of wrong table");
88  }
89  else if(rRange.aStart.Tab() == maActiveCell.Tab())
90  {
91  m_vecTempRange.push_back(rRange);
92  nMinRow = std::min(rRange.aStart.Row(),nMinRow);
93  nMaxRow = std::max(rRange.aEnd.Row(),nMaxRow);
94  }
95  else
96  SAL_WARN("sc", "Range of wrong table");
97  }
98  int nCurrentIndex = 0 ;
99  for(sal_Int32 row = nMinRow ; row <= nMaxRow ; ++row)
100  {
101  m_vecTempCol.clear();
102  {
103  for (ScRange const & r : m_vecTempRange)
104  {
105  if ( row >= r.aStart.Row() && row <= r.aEnd.Row())
106  {
107  m_vecTempCol.emplace_back(r.aStart.Col(),r.aEnd.Col());
108  }
109  }
110  }
111  std::sort(m_vecTempCol.begin(),m_vecTempCol.end(),CompMinCol);
112  {
113  for(const PAIR_COL &pairCol : m_vecTempCol)
114  {
115  sal_uInt16 nCol = pairCol.second - pairCol.first + 1;
116  if (nCol + nCurrentIndex > nSelectedChildIndex)
117  {
118  return ScMyAddress(static_cast<SCCOL>(pairCol.first + nSelectedChildIndex - nCurrentIndex), row, maActiveCell.Tab());
119  }
120  nCurrentIndex += nCol;
121  }
122  }
123  }
124  }
125  return ScMyAddress(0,0,maActiveCell.Tab());
126 }
127 
128 bool ScAccessibleSpreadsheet::CalcScRangeDifferenceMax(const ScRange & rSrc, const ScRange & rDest, int nMax,
129  std::vector<ScMyAddress> &vecRet, int &nSize)
130 {
131  //Src Must be :Src > Dest
132  if (rDest.In(rSrc))
133  {//Here is Src In Dest,Src <= Dest
134  return false;
135  }
136  if (!rDest.Intersects(rSrc))
137  {
138  int nCellCount = sal_uInt32(rDest.aEnd.Col() - rDest.aStart.Col() + 1)
139  * sal_uInt32(rDest.aEnd.Row() - rDest.aStart.Row() + 1)
140  * sal_uInt32(rDest.aEnd.Tab() - rDest.aStart.Tab() + 1);
141  if (nCellCount + nSize > nMax)
142  {
143  return true;
144  }
145  else if(nCellCount > 0)
146  {
147  for (sal_Int32 row = rDest.aStart.Row(); row <= rDest.aEnd.Row();++row)
148  {
149  for (sal_uInt16 col = rDest.aStart.Col(); col <= rDest.aEnd.Col();++col)
150  {
151  vecRet.emplace_back(col,row,rDest.aStart.Tab());
152  }
153  }
154  }
155  return false;
156  }
157  sal_Int32 nMinRow = rSrc.aStart.Row();
158  sal_Int32 nMaxRow = rSrc.aEnd.Row();
159  for (; nMinRow <= nMaxRow ; ++nMinRow,--nMaxRow)
160  {
161  for (sal_uInt16 col = rSrc.aStart.Col(); col <= rSrc.aEnd.Col();++col)
162  {
163  if (nSize > nMax)
164  {
165  return true;
166  }
167  ScMyAddress cell(col,nMinRow,rSrc.aStart.Tab());
168  if(!rDest.In(cell))
169  {//In Src ,Not In Dest
170  vecRet.push_back(cell);
171  ++nSize;
172  }
173  }
174  if (nMinRow != nMaxRow)
175  {
176  for (sal_uInt16 col = rSrc.aStart.Col(); col <= rSrc.aEnd.Col();++col)
177  {
178  if (nSize > nMax)
179  {
180  return true;
181  }
182  ScMyAddress cell(col,nMaxRow,rSrc.aStart.Tab());
183  if(!rDest.In(cell))
184  {//In Src ,Not In Dest
185  vecRet.push_back(cell);
186  ++nSize;
187  }
188  }
189  }
190  }
191  return false;
192 }
193 
194 //In Src , Not in Dest
196  int nMax, std::vector<ScMyAddress> &vecRet)
197 {
198  if (pSrc == nullptr || pDest == nullptr)
199  {
200  return false;
201  }
202  int nSize =0;
203  if (pDest->GetCellCount() == 0)//if the Dest Rang List is empty
204  {
205  if (pSrc->GetCellCount() > o3tl::make_unsigned(nMax))//if the Src Cell count is greater than nMax
206  {
207  return true;
208  }
209  //now the cell count is less than nMax
210  vecRet.reserve(10);
211  size_t nSrcSize = pSrc->size();
212  for (size_t i = 0; i < nSrcSize; ++i)
213  {
214  ScRange const & rRange = (*pSrc)[i];
215  for (sal_Int32 row = rRange.aStart.Row(); row <= rRange.aEnd.Row();++row)
216  {
217  for (sal_uInt16 col = rRange.aStart.Col(); col <= rRange.aEnd.Col();++col)
218  {
219  vecRet.emplace_back(col,row, rRange.aStart.Tab());
220  }
221  }
222  }
223  return false;
224  }
225  //the Dest Rang List is not empty
226  vecRet.reserve(10);
227  size_t nSizeSrc = pSrc->size();
228  for (size_t i = 0; i < nSizeSrc; ++i)
229  {
230  ScRange const & rRange = (*pSrc)[i];
231  size_t nSizeDest = pDest->size();
232  for (size_t j = 0; j < nSizeDest; ++j)
233  {
234  ScRange const & rRangeDest = (*pDest)[j];
235  if (CalcScRangeDifferenceMax(rRange,rRangeDest,nMax,vecRet,nSize))
236  {
237  return true;
238  }
239  }
240  }
241  return false;
242 }
243 
244 //===== internal ============================================================
245 
246 // FIXME: really unclear why we have an ScAccessibleTableBase with
247 // only this single sub-class
249  ScAccessibleDocument* pAccDoc,
250  ScTabViewShell* pViewShell,
251  SCTAB nTab,
252  ScSplitPos eSplitPos)
253  :
254  ScAccessibleTableBase( pAccDoc, GetDocument(pViewShell), ScRange( 0, 0, nTab, GetDocument(pViewShell)->MaxCol(), GetDocument(pViewShell)->MaxRow(), nTab)),
255  mbIsSpreadsheet( true ),
256  m_bFormulaMode( false ),
257  m_bFormulaLastMode( false ),
258  m_nMinX(0),m_nMaxX(0),m_nMinY(0),m_nMaxY(0)
259 {
260  ConstructScAccessibleSpreadsheet( pAccDoc, pViewShell, nTab, eSplitPos );
261 }
262 
264  ScAccessibleSpreadsheet& rParent, const ScRange& rRange ) :
265  ScAccessibleTableBase( rParent.mpAccDoc, rParent.mpDoc, rRange),
266  mbIsSpreadsheet( false ),
267  m_bFormulaMode( false ),
268  m_bFormulaLastMode( false ),
269  m_nMinX(0),m_nMaxX(0),m_nMinY(0),m_nMaxY(0)
270 {
271  ConstructScAccessibleSpreadsheet( rParent.mpAccDoc, rParent.mpViewShell, rParent.mnTab, rParent.meSplitPos );
272 }
273 
275 {
276  mpMarkedRanges.reset();
277  if (mpViewShell)
279 }
280 
282  ScAccessibleDocument* pAccDoc,
283  ScTabViewShell* pViewShell,
284  SCTAB nTab,
285  ScSplitPos eSplitPos)
286 {
287  mpViewShell = pViewShell;
288  mpMarkedRanges = nullptr;
289  mpAccDoc = pAccDoc;
290  mpAccCell.clear();
291  meSplitPos = eSplitPos;
292  mnTab = nTab;
293  mbDelIns = false;
294  mbIsFocusSend = false;
295  if (!mpViewShell)
296  return;
297 
299 
300  const ScViewData& rViewData = mpViewShell->GetViewData();
301  maActiveCell = rViewData.GetCurPos();
304  if (pScDoc)
305  {
306  pScDoc->GetName( maActiveCell.Tab(), m_strOldTabName );
307  }
308 }
309 
311 {
312  SolarMutexGuard aGuard;
313  if (mpViewShell)
314  {
316  mpViewShell = nullptr;
317  }
318  mpAccCell.clear();
319 
321 }
322 
324 {
325  if (IsFormulaMode())
326  {
327  return ;
328  }
329  mpMarkedRanges.reset();
330 
331  AccessibleEventObject aEvent;
332  aEvent.EventId = AccessibleEventId::STATE_CHANGED;
333  if (bNewState)
334  aEvent.NewValue <<= AccessibleStateType::SELECTED;
335  else
336  aEvent.OldValue <<= AccessibleStateType::SELECTED;
337  aEvent.Source = uno::Reference< XAccessibleContext >(this);
338 
339  CommitChange(aEvent);
340 }
341 
343 {
344  AccessibleEventObject aEvent;
345  aEvent.EventId = AccessibleEventId::ACTIVE_DESCENDANT_CHANGED;
346  aEvent.Source = uno::Reference< XAccessibleContext >(this);
347  aEvent.OldValue <<= uno::Reference<XAccessible>(mpAccCell);
348 
349  CommitChange(aEvent);
350 
351  CommitFocusLost();
352 }
353 
355 {
357  AccessibleEventObject aEvent;
358  aEvent.EventId = AccessibleEventId::ACTIVE_DESCENDANT_CHANGED;
359  aEvent.Source = uno::Reference< XAccessibleContext >(this);
360  uno::Reference< XAccessible > xNew;
361  if (IsFormulaMode())
362  {
364  {
365  ScAddress aFormulaAddr;
366  if(!GetFormulaCurrentFocusCell(aFormulaAddr))
367  {
368  return;
369  }
370  m_pAccFormulaCell = GetAccessibleCellAt(aFormulaAddr.Row(),aFormulaAddr.Col());
371  }
372  xNew = m_pAccFormulaCell.get();
373  }
374  else
375  {
376  if(mpAccCell->GetCellAddress() == maActiveCell)
377  {
378  xNew = mpAccCell.get();
379  }
380  else
381  {
383  return ;
384  }
385  }
386  aEvent.NewValue <<= xNew;
387 
388  CommitChange(aEvent);
389 }
390 
392 {
393  AccessibleEventObject aEvent;
394  aEvent.EventId = AccessibleEventId::BOUNDRECT_CHANGED;
395  aEvent.Source = uno::Reference< XAccessibleContext >(this);
396 
397  CommitChange(aEvent);
398 }
399 
401 {
402  AccessibleEventObject aEvent;
403  aEvent.EventId = AccessibleEventId::VISIBLE_DATA_CHANGED;
404  aEvent.Source = uno::Reference< XAccessibleContext >(this);
405 
406  CommitChange(aEvent);
407 }
408 
409  //===== SfxListener =====================================================
410 
412 {
413  if ( auto pRefHint = dynamic_cast<const ScUpdateRefHint*>(&rHint) )
414  {
415  if (pRefHint->GetMode() == URM_INSDEL && pRefHint->GetDz() == 0) //test whether table is inserted or deleted
416  {
417  if (((pRefHint->GetRange().aStart.Col() == maRange.aStart.Col()) &&
418  (pRefHint->GetRange().aEnd.Col() == maRange.aEnd.Col())) ||
419  ((pRefHint->GetRange().aStart.Row() == maRange.aStart.Row()) &&
420  (pRefHint->GetRange().aEnd.Row() == maRange.aEnd.Row())))
421  {
422  // ignore next SfxHintId::ScDataChanged notification
423  mbDelIns = true;
424 
425  sal_Int16 nId(0);
426  SCCOL nX(pRefHint->GetDx());
427  SCROW nY(pRefHint->GetDy());
428  ScRange aRange(pRefHint->GetRange());
429  if ((nX < 0) || (nY < 0))
430  {
431  OSL_ENSURE(!((nX < 0) && (nY < 0)), "should not be possible to remove row and column at the same time");
432  nId = AccessibleTableModelChangeType::DELETE;
433  if (nX < 0)
434  {
435  nX = -nX;
436  nY = aRange.aEnd.Row() - aRange.aStart.Row();
437  }
438  else
439  {
440  nY = -nY;
441  nX = aRange.aEnd.Col() - aRange.aStart.Col();
442  }
443  }
444  else if ((nX > 0) || (nY > 0))
445  {
446  OSL_ENSURE(!((nX > 0) && (nY > 0)), "should not be possible to add row and column at the same time");
447  nId = AccessibleTableModelChangeType::INSERT;
448  nX = aRange.aEnd.Col() - aRange.aStart.Col();
449  }
450  else
451  {
452  OSL_FAIL("is it a deletion or an insertion?");
453  }
454 
455  CommitTableModelChange(pRefHint->GetRange().aStart.Row(),
456  pRefHint->GetRange().aStart.Col(),
457  pRefHint->GetRange().aStart.Row() + nY,
458  pRefHint->GetRange().aStart.Col() + nX, nId);
459 
460  AccessibleEventObject aEvent;
461  aEvent.EventId = AccessibleEventId::ACTIVE_DESCENDANT_CHANGED;
462  aEvent.Source = uno::Reference< XAccessibleContext >(this);
463  aEvent.NewValue <<= uno::Reference<XAccessible>(mpAccCell);
464 
465  CommitChange(aEvent);
466  }
467  }
468  }
469  else
470  {
471  if (rHint.GetId() == SfxHintId::ScAccCursorChanged)
472  {
473  if (mpViewShell)
474  {
475  ScViewData& rViewData = mpViewShell->GetViewData();
476 
477  m_bFormulaMode = rViewData.IsRefMode() || SC_MOD()->IsFormulaMode();
478  if ( m_bFormulaMode )
479  {
480  NotifyRefMode();
481  m_bFormulaLastMode = true;
482  return;
483  }
484  if (m_bFormulaLastMode)
485  {//Last Notify Mode Is Formula Mode.
486  m_vecFormulaLastMyAddr.clear();
488  m_pAccFormulaCell.clear();
489  //Remove All Selection
490  }
492 
493  AccessibleEventObject aEvent;
494  aEvent.Source = uno::Reference< XAccessible >(this);
495  ScAddress aNewCell = rViewData.GetCurPos();
496  if(aNewCell.Tab() != maActiveCell.Tab())
497  {
498  aEvent.EventId = AccessibleEventId::PAGE_CHANGED;
499  auto pAccParent = getAccessibleParent();
500  ScAccessibleDocument *pAccDoc =
501  static_cast<ScAccessibleDocument*>(pAccParent.get());
502  if(pAccDoc)
503  {
504  pAccDoc->CommitChange(aEvent);
505  }
506  }
507  bool bNewPosCell = (aNewCell != maActiveCell) || mpViewShell->GetForceFocusOnCurCell(); // #i123629#
508  bool bNewPosCellFocus=false;
509  if ( bNewPosCell && IsFocused() && aNewCell.Tab() == maActiveCell.Tab() )
510  {//single Focus
511  bNewPosCellFocus=true;
512  }
513  ScMarkData &refScMarkData = rViewData.GetMarkData();
514  // MT IA2: Not used
515  // int nSelCount = refScMarkData.GetSelectCount();
516  bool bIsMark =refScMarkData.IsMarked();
517  bool bIsMultMark = refScMarkData.IsMultiMarked();
518  bool bNewMarked = refScMarkData.GetTableSelect(aNewCell.Tab()) && ( bIsMark || bIsMultMark );
519 // sal_Bool bNewCellSelected = isAccessibleSelected(aNewCell.Row(), aNewCell.Col());
520  sal_uInt16 nTab = rViewData.GetTabNo();
521  ScRange aMarkRange;
522  refScMarkData.GetMarkArea(aMarkRange);
523  aEvent.OldValue.clear();
525  //Mark All
526  if ( !bNewPosCellFocus &&
527  (bNewMarked || bIsMark || bIsMultMark ) &&
528  aMarkRange == ScRange( 0,0,nTab, pDoc->MaxCol(),pDoc->MaxRow(),nTab ) )
529  {
530  aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_WITHIN;
531  aEvent.NewValue.clear();
532  CommitChange(aEvent);
533  return ;
534  }
535  if (!mpMarkedRanges)
536  {
537  mpMarkedRanges.reset(new ScRangeList());
538  }
539  refScMarkData.FillRangeListWithMarks(mpMarkedRanges.get(), true);
540 
541  //For Whole Col Row
542  bool bWholeRow = std::abs(aMarkRange.aStart.Row() - aMarkRange.aEnd.Row()) == pDoc->MaxRow() ;
543  bool bWholeCol = ::abs(aMarkRange.aStart.Col() - aMarkRange.aEnd.Col()) == pDoc->MaxCol() ;
544  if ((bNewMarked || bIsMark || bIsMultMark ) && (bWholeCol || bWholeRow))
545  {
546  if ( aMarkRange != m_aLastWithInMarkRange )
547  {
548  RemoveSelection(refScMarkData);
549  if(bNewPosCell)
550  {
551  CommitFocusCell(aNewCell);
552  }
553  bool bLastIsWholeColRow =
554  (std::abs(m_aLastWithInMarkRange.aStart.Row() - m_aLastWithInMarkRange.aEnd.Row()) == pDoc->MaxRow() && bWholeRow) ||
555  (::abs(m_aLastWithInMarkRange.aStart.Col() - m_aLastWithInMarkRange.aEnd.Col()) == pDoc->MaxCol() && bWholeCol);
556  bool bSelSmaller=
557  bLastIsWholeColRow &&
558  !aMarkRange.In(m_aLastWithInMarkRange) &&
560  if( !bSelSmaller )
561  {
562  aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_WITHIN;
563  aEvent.NewValue.clear();
564  CommitChange(aEvent);
565  }
566  m_aLastWithInMarkRange = aMarkRange;
567  }
568  return ;
569  }
570  m_aLastWithInMarkRange = aMarkRange;
571  int nNewMarkCount = mpMarkedRanges->GetCellCount();
572  bool bSendSingle= (0 == nNewMarkCount) && bNewPosCell;
573  if (bSendSingle)
574  {
575  RemoveSelection(refScMarkData);
576  if(bNewPosCellFocus)
577  {
578  CommitFocusCell(aNewCell);
579  }
580  uno::Reference< XAccessible > xChild ;
581  if (bNewPosCellFocus)
582  {
583  xChild = mpAccCell.get();
584  }
585  else
586  {
587  mpAccCell = GetAccessibleCellAt(aNewCell.Row(),aNewCell.Col());
588  xChild = mpAccCell.get();
589 
590  maActiveCell = aNewCell;
591  aEvent.EventId = AccessibleEventId::ACTIVE_DESCENDANT_CHANGED_NOFOCUS;
592  aEvent.NewValue <<= xChild;
593  aEvent.OldValue <<= uno::Reference< XAccessible >();
594  CommitChange(aEvent);
595  }
596  aEvent.EventId = AccessibleEventId::SELECTION_CHANGED;
597  aEvent.NewValue <<= xChild;
598  CommitChange(aEvent);
599  OSL_ASSERT(m_mapSelectionSend.count(aNewCell) == 0 );
600  m_mapSelectionSend.emplace(aNewCell,xChild);
601 
602  }
603  else
604  {
605  ScRange aDelRange;
606  bool bIsDel = rViewData.GetDelMark( aDelRange );
607  if ( (!bIsDel || aMarkRange != aDelRange) &&
608  bNewMarked &&
609  nNewMarkCount > 0 &&
611  {
612  RemoveSelection(refScMarkData);
613  if(bNewPosCellFocus)
614  {
615  CommitFocusCell(aNewCell);
616  }
617  std::vector<ScMyAddress> vecNew;
619  {
620  aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_WITHIN;
621  aEvent.NewValue.clear();
622  CommitChange(aEvent);
623  }
624  else
625  {
626  for(const auto& rAddr : vecNew)
627  {
628  uno::Reference< XAccessible > xChild = getAccessibleCellAt(rAddr.Row(),rAddr.Col());
629  if (!(bNewPosCellFocus && rAddr == aNewCell) )
630  {
631  aEvent.EventId = AccessibleEventId::ACTIVE_DESCENDANT_CHANGED_NOFOCUS;
632  aEvent.NewValue <<= xChild;
633  CommitChange(aEvent);
634  }
635  aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_ADD;
636  aEvent.NewValue <<= xChild;
637  CommitChange(aEvent);
638  m_mapSelectionSend.emplace(rAddr,xChild);
639  }
640  }
641  }
642  }
643  if (bNewPosCellFocus && maActiveCell != aNewCell)
644  {
645  CommitFocusCell(aNewCell);
646  }
648  }
649  }
650  else if (rHint.GetId() == SfxHintId::ScDataChanged)
651  {
652  if (!mbDelIns)
653  CommitTableModelChange(maRange.aStart.Row(), maRange.aStart.Col(), maRange.aEnd.Row(), maRange.aEnd.Col(), AccessibleTableModelChangeType::UPDATE);
654  else
655  mbDelIns = false;
656  if (mpViewShell)
657  {
658  ScViewData& rViewData = mpViewShell->GetViewData();
659  ScAddress aNewCell = rViewData.GetCurPos();
660  if( maActiveCell == aNewCell)
661  {
663  if (pScDoc)
664  {
665  OUString valStr(pScDoc->GetString(aNewCell.Col(),aNewCell.Row(),aNewCell.Tab()));
666  if(m_strCurCellValue != valStr)
667  {
668  AccessibleEventObject aEvent;
669  aEvent.EventId = AccessibleEventId::VALUE_CHANGED;
670  mpAccCell->CommitChange(aEvent);
671  m_strCurCellValue=valStr;
672  }
673  OUString tabName;
674  pScDoc->GetName( maActiveCell.Tab(), tabName );
675  if( m_strOldTabName != tabName )
676  {
677  AccessibleEventObject aEvent;
678  aEvent.EventId = AccessibleEventId::NAME_CHANGED;
679  OUString sOldName(ScResId(STR_ACC_TABLE_NAME));
680  sOldName = sOldName.replaceFirst("%1", m_strOldTabName);
681  aEvent.OldValue <<= sOldName;
682  OUString sNewName(ScResId(STR_ACC_TABLE_NAME));
683  sOldName = sNewName.replaceFirst("%1", tabName);
684  aEvent.NewValue <<= sNewName;
685  CommitChange( aEvent );
686  m_strOldTabName = tabName;
687  }
688  }
689  }
690  }
691  }
692  // commented out, because to use a ModelChangeEvent is not the right way
693  // at the moment there is no way, but the Java/Gnome Api should be extended sometime
694 /* if (mpViewShell)
695  {
696  Rectangle aNewVisCells(GetVisCells(GetVisArea(mpViewShell, meSplitPos)));
697 
698  Rectangle aNewPos(aNewVisCells);
699 
700  if (aNewVisCells.IsOver(maVisCells))
701  aNewPos.Union(maVisCells);
702  else
703  CommitTableModelChange(maVisCells.Top(), maVisCells.Left(), maVisCells.Bottom(), maVisCells.Right(), AccessibleTableModelChangeType::UPDATE);
704 
705  maVisCells = aNewVisCells;
706 
707  CommitTableModelChange(aNewPos.Top(), aNewPos.Left(), aNewPos.Bottom(), aNewPos.Right(), AccessibleTableModelChangeType::UPDATE);
708  }
709  }*/
710  }
711 
712  ScAccessibleTableBase::Notify(rBC, rHint);
713 }
714 
716 {
717  AccessibleEventObject aEvent;
718  aEvent.Source = uno::Reference< XAccessible >(this);
719  MAP_ADDR_XACC::iterator miRemove = m_mapSelectionSend.begin();
720  for(; miRemove != m_mapSelectionSend.end() ;)
721  {
722  if (refScMarkData.IsCellMarked(miRemove->first.Col(),miRemove->first.Row(),true) ||
723  refScMarkData.IsCellMarked(miRemove->first.Col(),miRemove->first.Row()) )
724  {
725  ++miRemove;
726  continue;
727  }
728  aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_REMOVE;
729  aEvent.NewValue <<= miRemove->second;
730  CommitChange(aEvent);
731  miRemove = m_mapSelectionSend.erase(miRemove);
732  }
733 }
735 {
736  OSL_ASSERT(!IsFormulaMode());
737  if(IsFormulaMode())
738  {
739  return ;
740  }
741  AccessibleEventObject aEvent;
742  aEvent.EventId = AccessibleEventId::ACTIVE_DESCENDANT_CHANGED;
743  aEvent.Source = uno::Reference< XAccessible >(this);
744  aEvent.OldValue <<= uno::Reference<XAccessible>(mpAccCell);
745  mpAccCell.clear();
746  mpAccCell = GetAccessibleCellAt(aNewCell.Row(), aNewCell.Col());
747  aEvent.NewValue <<= uno::Reference<XAccessible>(mpAccCell);
748  maActiveCell = aNewCell;
750  if (pScDoc)
751  {
752  m_strCurCellValue = pScDoc->GetString(maActiveCell.Col(),maActiveCell.Row(),maActiveCell.Tab());
753  }
754  CommitChange(aEvent);
755 }
756 
757 //===== XAccessibleTable ================================================
758 
759 uno::Reference< XAccessibleTable > SAL_CALL ScAccessibleSpreadsheet::getAccessibleRowHeaders( )
760 {
761  SolarMutexGuard aGuard;
762  IsObjectValid();
763  uno::Reference< XAccessibleTable > xAccessibleTable;
764  if( mpDoc && mbIsSpreadsheet )
765  {
766  if( const ScRange* pRowRange = mpDoc->GetRepeatRowRange( mnTab ) )
767  {
768  SCROW nStart = pRowRange->aStart.Row();
769  SCROW nEnd = pRowRange->aEnd.Row();
771  if( (0 <= nStart) && (nStart <= nEnd) && (nEnd <= pDoc->MaxRow()) )
772  xAccessibleTable.set( new ScAccessibleSpreadsheet( *this, ScRange( 0, nStart, mnTab, pDoc->MaxCol(), nEnd, mnTab ) ) );
773  }
774  }
775  return xAccessibleTable;
776 }
777 
778 uno::Reference< XAccessibleTable > SAL_CALL ScAccessibleSpreadsheet::getAccessibleColumnHeaders( )
779 {
780  SolarMutexGuard aGuard;
781  IsObjectValid();
782  uno::Reference< XAccessibleTable > xAccessibleTable;
783  if( mpDoc && mbIsSpreadsheet )
784  {
785  if( const ScRange* pColRange = mpDoc->GetRepeatColRange( mnTab ) )
786  {
787  SCCOL nStart = pColRange->aStart.Col();
788  SCCOL nEnd = pColRange->aEnd.Col();
790  if( (0 <= nStart) && (nStart <= nEnd) && (nEnd <= pDoc->MaxCol()) )
791  xAccessibleTable.set( new ScAccessibleSpreadsheet( *this, ScRange( nStart, 0, mnTab, nEnd, pDoc->MaxRow(), mnTab ) ) );
792  }
793  }
794  return xAccessibleTable;
795 }
796 
797 uno::Sequence< sal_Int32 > SAL_CALL ScAccessibleSpreadsheet::getSelectedAccessibleRows( )
798 {
799  SolarMutexGuard aGuard;
800  IsObjectValid();
801  uno::Sequence<sal_Int32> aSequence;
802  if (IsFormulaMode())
803  {
804  return aSequence;
805  }
806  if (mpViewShell)
807  {
808  aSequence.realloc(maRange.aEnd.Row() - maRange.aStart.Row() + 1);
809  const ScMarkData& rMarkdata = mpViewShell->GetViewData().GetMarkData();
810  sal_Int32* pSequence = aSequence.getArray();
811  sal_Int32 nCount(0);
812  for (SCROW i = maRange.aStart.Row(); i <= maRange.aEnd.Row(); ++i)
813  {
814  if (rMarkdata.IsRowMarked(i))
815  {
816  pSequence[nCount] = i;
817  ++nCount;
818  }
819  }
820  aSequence.realloc(nCount);
821  }
822  else
823  aSequence.realloc(0);
824  return aSequence;
825 }
826 
827 uno::Sequence< sal_Int32 > SAL_CALL ScAccessibleSpreadsheet::getSelectedAccessibleColumns( )
828 {
829  SolarMutexGuard aGuard;
830  IsObjectValid();
831  uno::Sequence<sal_Int32> aSequence;
832  if (IsFormulaMode() || !mpViewShell)
833  return aSequence;
834 
835  aSequence.realloc(maRange.aEnd.Col() - maRange.aStart.Col() + 1);
836  sal_Int32* pSequence = aSequence.getArray();
837  sal_Int32 nCount(0);
838  const ScMarkData& rMarkdata = mpViewShell->GetViewData().GetMarkData();
839  for (SCCOL i = maRange.aStart.Col(); i <= maRange.aEnd.Col(); ++i)
840  {
841  if (rMarkdata.IsColumnMarked(i))
842  {
843  pSequence[nCount] = i;
844  ++nCount;
845  }
846  }
847  aSequence.realloc(nCount);
848  return aSequence;
849 }
850 
852 {
853  SolarMutexGuard aGuard;
854  IsObjectValid();
855  if (IsFormulaMode())
856  {
857  return false;
858  }
859 
860  if ((nRow > (maRange.aEnd.Row() - maRange.aStart.Row())) || (nRow < 0))
861  throw lang::IndexOutOfBoundsException();
862 
863  bool bResult(false);
864  if (mpViewShell)
865  {
866  const ScMarkData& rMarkdata = mpViewShell->GetViewData().GetMarkData();
867  bResult = rMarkdata.IsRowMarked(static_cast<SCROW>(nRow));
868  }
869  return bResult;
870 }
871 
873 {
874  SolarMutexGuard aGuard;
875  IsObjectValid();
876 
877  if (IsFormulaMode())
878  {
879  return false;
880  }
881  if ((nColumn > (maRange.aEnd.Col() - maRange.aStart.Col())) || (nColumn < 0))
882  throw lang::IndexOutOfBoundsException();
883 
884  bool bResult(false);
885  if (mpViewShell)
886  {
887  const ScMarkData& rMarkdata = mpViewShell->GetViewData().GetMarkData();
888  bResult = rMarkdata.IsColumnMarked(static_cast<SCCOL>(nColumn));
889  }
890  return bResult;
891 }
892 
894 {
895  if (IsFormulaMode())
896  {
897  ScAddress aCellAddress(static_cast<SCCOL>(nColumn), nRow, mpViewShell->GetViewData().GetTabNo());
898  if ((aCellAddress == m_aFormulaActiveCell) && m_pAccFormulaCell.is())
899  {
900  return m_pAccFormulaCell;
901  }
902  else
903  return ScAccessibleCell::create(this, mpViewShell, aCellAddress, GetAccessibleIndexFormula(nRow, nColumn), meSplitPos, mpAccDoc);
904  }
905  else
906  {
907  ScAddress aCellAddress(static_cast<SCCOL>(maRange.aStart.Col() + nColumn),
908  static_cast<SCROW>(maRange.aStart.Row() + nRow), maRange.aStart.Tab());
909  if ((aCellAddress == maActiveCell) && mpAccCell.is())
910  {
911  return mpAccCell;
912  }
913  else
914  return ScAccessibleCell::create(this, mpViewShell, aCellAddress, getAccessibleIndex(nRow, nColumn), meSplitPos, mpAccDoc);
915  }
916 }
917 
918 uno::Reference< XAccessible > SAL_CALL ScAccessibleSpreadsheet::getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn )
919 {
920  SolarMutexGuard aGuard;
921  IsObjectValid();
922  if (!IsFormulaMode())
923  {
924  if (nRow > (maRange.aEnd.Row() - maRange.aStart.Row()) ||
925  nRow < 0 ||
926  nColumn > (maRange.aEnd.Col() - maRange.aStart.Col()) ||
927  nColumn < 0)
928  throw lang::IndexOutOfBoundsException();
929  }
930  rtl::Reference<ScAccessibleCell> pAccessibleCell = GetAccessibleCellAt(nRow, nColumn);
931  return pAccessibleCell;
932 }
933 
934 sal_Bool SAL_CALL ScAccessibleSpreadsheet::isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn )
935 {
936  SolarMutexGuard aGuard;
937  IsObjectValid();
938 
939  if (IsFormulaMode())
940  {
941  ScAddress addr(static_cast<SCCOL>(nColumn), nRow, 0);
942  return IsScAddrFormulaSel(addr);
943  }
944  if ((nColumn > (maRange.aEnd.Col() - maRange.aStart.Col())) || (nColumn < 0) ||
945  (nRow > (maRange.aEnd.Row() - maRange.aStart.Row())) || (nRow < 0))
946  throw lang::IndexOutOfBoundsException();
947 
948  bool bResult(false);
949  if (mpViewShell)
950  {
951  const ScMarkData& rMarkdata = mpViewShell->GetViewData().GetMarkData();
952  bResult = rMarkdata.IsCellMarked(static_cast<SCCOL>(nColumn), static_cast<SCROW>(nRow));
953  }
954  return bResult;
955 }
956 
957  //===== XAccessibleComponent ============================================
958 
959 uno::Reference< XAccessible > SAL_CALL ScAccessibleSpreadsheet::getAccessibleAtPoint(const awt::Point& rPoint)
960 {
961  uno::Reference< XAccessible > xAccessible;
962  if (containsPoint(rPoint))
963  {
964  SolarMutexGuard aGuard;
965  IsObjectValid();
966  if (mpViewShell)
967  {
968  SCCOL nX;
969  SCROW nY;
970  mpViewShell->GetViewData().GetPosFromPixel( rPoint.X, rPoint.Y, meSplitPos, nX, nY);
971  try {
972  xAccessible = getAccessibleCellAt(nY, nX);
973  }
974  catch(const css::lang::IndexOutOfBoundsException &)
975  {
976  return nullptr;
977  }
978  }
979  }
980  return xAccessible;
981 }
982 
984 {
985  if (getAccessibleParent().is())
986  {
987  uno::Reference<XAccessibleComponent> xAccessibleComponent(getAccessibleParent()->getAccessibleContext(), uno::UNO_QUERY);
988  if (xAccessibleComponent.is())
989  xAccessibleComponent->grabFocus();
990  }
991 }
992 
994 {
995  return sal_Int32(COL_BLACK);
996 }
997 
999 {
1000  SolarMutexGuard aGuard;
1001  IsObjectValid();
1002  return sal_Int32(SC_MOD()->GetColorConfig().GetColorValue( ::svtools::DOCCOLOR ).nColor);
1003 }
1004 
1005  //===== XAccessibleContext ==============================================
1006 
1007 uno::Reference<XAccessibleRelationSet> SAL_CALL ScAccessibleSpreadsheet::getAccessibleRelationSet()
1008 {
1010  if(mpAccDoc)
1011  pRelationSet = mpAccDoc->GetRelationSet(nullptr);
1012  if (pRelationSet)
1013  return pRelationSet;
1014  return new utl::AccessibleRelationSetHelper();
1015 }
1016 
1017 uno::Reference<XAccessibleStateSet> SAL_CALL
1019 {
1020  SolarMutexGuard aGuard;
1021  uno::Reference<XAccessibleStateSet> xParentStates;
1022  if (getAccessibleParent().is())
1023  {
1024  uno::Reference<XAccessibleContext> xParentContext = getAccessibleParent()->getAccessibleContext();
1025  xParentStates = xParentContext->getAccessibleStateSet();
1026  }
1028  if (IsDefunc(xParentStates))
1029  pStateSet->AddState(AccessibleStateType::DEFUNC);
1030  else
1031  {
1032  pStateSet->AddState(AccessibleStateType::MANAGES_DESCENDANTS);
1033  if (IsEditable())
1034  pStateSet->AddState(AccessibleStateType::EDITABLE);
1035  pStateSet->AddState(AccessibleStateType::ENABLED);
1036  pStateSet->AddState(AccessibleStateType::FOCUSABLE);
1037  if (IsFocused())
1038  pStateSet->AddState(AccessibleStateType::FOCUSED);
1039  pStateSet->AddState(AccessibleStateType::MULTI_SELECTABLE);
1040  pStateSet->AddState(AccessibleStateType::OPAQUE);
1041  pStateSet->AddState(AccessibleStateType::SELECTABLE);
1043  pStateSet->AddState(AccessibleStateType::SELECTED);
1044  if (isShowing())
1045  pStateSet->AddState(AccessibleStateType::SHOWING);
1046  if (isVisible())
1047  pStateSet->AddState(AccessibleStateType::VISIBLE);
1048  }
1049  return pStateSet;
1050 }
1051 
1053 
1054 void SAL_CALL ScAccessibleSpreadsheet::selectAccessibleChild( sal_Int32 nChildIndex )
1055 {
1056  SolarMutexGuard aGuard;
1057  IsObjectValid();
1058  if (nChildIndex < 0 || nChildIndex >= getAccessibleChildCount())
1059  throw lang::IndexOutOfBoundsException();
1060 
1061  if (mpViewShell)
1062  {
1063  sal_Int32 nCol(getAccessibleColumn(nChildIndex));
1064  sal_Int32 nRow(getAccessibleRow(nChildIndex));
1065 
1066  SelectCell(nRow, nCol, false);
1067  }
1068 }
1069 
1070 void SAL_CALL
1072 {
1073  SolarMutexGuard aGuard;
1074  IsObjectValid();
1075  if (mpViewShell && !IsFormulaMode())
1076  mpViewShell->Unmark();
1077 }
1078 
1080 {
1081  SolarMutexGuard aGuard;
1082  IsObjectValid();
1083  if (!mpViewShell)
1084  return;
1085 
1086  if (IsFormulaMode())
1087  {
1089  ScViewData& rViewData = mpViewShell->GetViewData();
1090  mpViewShell->InitRefMode( 0, 0, rViewData.GetTabNo(), SC_REFTYPE_REF );
1091  rViewData.SetRefStart(0, 0, rViewData.GetTabNo());
1092  rViewData.SetRefEnd(pDoc->MaxCol(), pDoc->MaxRow(), rViewData.GetTabNo());
1093  mpViewShell->UpdateRef(pDoc->MaxCol(), pDoc->MaxRow(), rViewData.GetTabNo());
1094  }
1095  else
1097 }
1098 
1099 sal_Int32 SAL_CALL
1101 {
1102  SolarMutexGuard aGuard;
1103  IsObjectValid();
1104  sal_Int32 nResult(0);
1105  if (mpViewShell)
1106  {
1107  if (IsFormulaMode())
1108  {
1109  nResult = GetRowAll() * GetColAll() ;
1110  }
1111  else
1112  {
1113  if (!mpMarkedRanges)
1114  {
1115  mpMarkedRanges.reset(new ScRangeList());
1117  aMarkData.FillRangeListWithMarks(mpMarkedRanges.get(), false);
1118  }
1119  // is possible, because there shouldn't be overlapped ranges in it
1120  if (mpMarkedRanges)
1121  nResult = mpMarkedRanges->GetCellCount();
1122  }
1123  }
1124  return nResult;
1125 }
1126 
1127 uno::Reference<XAccessible > SAL_CALL
1129 {
1130  SolarMutexGuard aGuard;
1131  IsObjectValid();
1132  uno::Reference < XAccessible > xAccessible;
1133  if (IsFormulaMode())
1134  {
1135  if(CheckChildIndex(nSelectedChildIndex))
1136  {
1137  ScAddress addr = GetChildIndexAddress(nSelectedChildIndex);
1138  xAccessible = getAccessibleCellAt(addr.Row(), addr.Col());
1139  }
1140  return xAccessible;
1141  }
1142  if (mpViewShell)
1143  {
1144  if (!mpMarkedRanges)
1145  {
1146  mpMarkedRanges.reset(new ScRangeList());
1148  }
1149  if (mpMarkedRanges)
1150  {
1151  if ((nSelectedChildIndex < 0) ||
1152  (mpMarkedRanges->GetCellCount() <= o3tl::make_unsigned(nSelectedChildIndex)))
1153  {
1154  throw lang::IndexOutOfBoundsException();
1155  }
1156  ScMyAddress addr = CalcScAddressFromRangeList(mpMarkedRanges.get(),nSelectedChildIndex);
1157  if( m_mapSelectionSend.find(addr) != m_mapSelectionSend.end() )
1158  xAccessible = m_mapSelectionSend[addr];
1159  else
1160  xAccessible = getAccessibleCellAt(addr.Row(), addr.Col());
1161  }
1162  }
1163  return xAccessible;
1164 }
1165 
1166 void SAL_CALL ScAccessibleSpreadsheet::deselectAccessibleChild( sal_Int32 nChildIndex )
1167 {
1168  SolarMutexGuard aGuard;
1169  IsObjectValid();
1170 
1171  if (nChildIndex < 0 || nChildIndex >= getAccessibleChildCount())
1172  throw lang::IndexOutOfBoundsException();
1173 
1174  if (!mpViewShell)
1175  return;
1176 
1177  sal_Int32 nCol(getAccessibleColumn(nChildIndex));
1178  sal_Int32 nRow(getAccessibleRow(nChildIndex));
1179 
1180  if (IsFormulaMode())
1181  {
1182  if(IsScAddrFormulaSel(
1183  ScAddress(static_cast<SCCOL>(nCol), nRow,mpViewShell->GetViewData().GetTabNo()))
1184  )
1185  {
1186  SelectCell(nRow, nCol, true);
1187  }
1188  return ;
1189  }
1190  if (mpViewShell->GetViewData().GetMarkData().IsCellMarked(static_cast<SCCOL>(nCol), static_cast<SCROW>(nRow)))
1191  SelectCell(nRow, nCol, true);
1192 }
1193 
1194 void ScAccessibleSpreadsheet::SelectCell(sal_Int32 nRow, sal_Int32 nCol, bool bDeselect)
1195 {
1196  if (IsFormulaMode())
1197  {
1198  if (bDeselect)
1199  {//??
1200  return;
1201  }
1202  else
1203  {
1204  ScViewData& rViewData = mpViewShell->GetViewData();
1205 
1206  mpViewShell->InitRefMode( static_cast<SCCOL>(nCol), nRow, rViewData.GetTabNo(), SC_REFTYPE_REF );
1207  mpViewShell->UpdateRef(static_cast<SCCOL>(nCol), nRow, rViewData.GetTabNo());
1208  }
1209  return ;
1210  }
1212 
1213  mpViewShell->DoneBlockMode( true ); // continue selecting
1214  mpViewShell->InitBlockMode( static_cast<SCCOL>(nCol), static_cast<SCROW>(nRow), maRange.aStart.Tab(), bDeselect );
1215 
1217 }
1218 
1219 /*
1220 void ScAccessibleSpreadsheet::CreateSortedMarkedCells()
1221 {
1222  mpSortedMarkedCells = new std::vector<ScMyAddress>();
1223  mpSortedMarkedCells->reserve(mpMarkedRanges->GetCellCount());
1224  for ( size_t i = 0, ListSize = mpMarkedRanges->size(); i < ListSize; ++i )
1225  {
1226  ScRange* pRange = (*mpMarkedRanges)[i];
1227  if (pRange->aStart.Tab() != pRange->aEnd.Tab())
1228  {
1229  if ((maActiveCell.Tab() >= pRange->aStart.Tab()) ||
1230  maActiveCell.Tab() <= pRange->aEnd.Tab())
1231  {
1232  ScRange aRange(*pRange);
1233  aRange.aStart.SetTab(maActiveCell.Tab());
1234  aRange.aEnd.SetTab(maActiveCell.Tab());
1235  AddMarkedRange(aRange);
1236  }
1237  else
1238  {
1239  OSL_FAIL("Range of wrong table");
1240  }
1241  }
1242  else if(pRange->aStart.Tab() == maActiveCell.Tab())
1243  AddMarkedRange(*pRange);
1244  else
1245  {
1246  OSL_FAIL("Range of wrong table");
1247  }
1248  }
1249  std::sort(mpSortedMarkedCells->begin(), mpSortedMarkedCells->end());
1250 }
1251 
1252 void ScAccessibleSpreadsheet::AddMarkedRange(const ScRange& rRange)
1253 {
1254  for (SCROW nRow = rRange.aStart.Row(); nRow <= rRange.aEnd.Row(); ++nRow)
1255  {
1256  for (SCCOL nCol = rRange.aStart.Col(); nCol <= rRange.aEnd.Col(); ++nCol)
1257  {
1258  ScMyAddress aCell(nCol, nRow, maActiveCell.Tab());
1259  mpSortedMarkedCells->push_back(aCell);
1260  }
1261  }
1262 }*/
1263 
1264  //===== XServiceInfo ====================================================
1265 
1267 {
1268  return "ScAccessibleSpreadsheet";
1269 }
1270 
1271 uno::Sequence< OUString> SAL_CALL
1273 {
1274  const css::uno::Sequence<OUString> vals { "com.sun.star.AccessibleSpreadsheet" };
1276 }
1277 
1278 //===== XTypeProvider =======================================================
1279 
1280 uno::Sequence<sal_Int8> SAL_CALL
1282 {
1283  return css::uno::Sequence<sal_Int8>();
1284 }
1285 
1287 
1288 void SAL_CALL ScAccessibleSpreadsheet::addAccessibleEventListener(const uno::Reference<XAccessibleEventListener>& xListener)
1289 {
1290  SolarMutexGuard aGuard;
1291  IsObjectValid();
1293 
1294 }
1295 
1296 //==== internal =========================================================
1297 
1299 {
1300  tools::Rectangle aRect;
1301  if (mpViewShell)
1302  {
1304  if (pWindow)
1305  aRect = pWindow->GetWindowExtentsRelative(nullptr);
1306  }
1307  return aRect;
1308 }
1309 
1311 {
1312  tools::Rectangle aRect;
1313  if (mpViewShell)
1314  {
1316  if (pWindow)
1317  //#101986#; extends to the same window, because the parent is the document and it has the same window
1318  aRect = pWindow->GetWindowExtentsRelative(pWindow);
1319  }
1320  return aRect;
1321 }
1322 
1324  const uno::Reference<XAccessibleStateSet>& rxParentStates)
1325 {
1326  return ScAccessibleContextBase::IsDefunc() || (mpViewShell == nullptr) || !getAccessibleParent().is() ||
1327  (rxParentStates.is() && rxParentStates->contains(AccessibleStateType::DEFUNC));
1328 }
1329 
1331 {
1332  if (IsFormulaMode())
1333  {
1334  return false;
1335  }
1336  bool bProtected(false);
1338  bProtected = true;
1339  return !bProtected;
1340 }
1341 
1343 {
1344  bool bFocused(false);
1345  if (mpViewShell)
1346  {
1348  bFocused = mpViewShell->GetActiveWin()->HasFocus();
1349  }
1350  return bFocused;
1351 }
1352 
1354 {
1355  if (IsFormulaMode())
1356  {
1357  return false;
1358  }
1359 
1360  bool bResult(false);
1361  if(mpViewShell)
1362  {
1363  //#103800#; use a copy of MarkData
1365  aMarkData.MarkToMulti();
1366  if (aMarkData.IsAllMarked(maRange))
1367  bResult = true;
1368  }
1369  return bResult;
1370 }
1371 
1373 {
1374  ScDocument* pDoc = nullptr;
1375  if (pViewShell)
1376  pDoc = &pViewShell->GetViewData().GetDocument();
1377  return pDoc;
1378 }
1379 
1381 {
1382  SolarMutexGuard g;
1383 
1384  if (IsFormulaMode())
1385  {
1386  return false;
1387  }
1388 
1391  mpViewShell->DoneBlockMode( true ); // continue selecting
1392  mpViewShell->InitBlockMode( 0, row, maRange.aStart.Tab(), false, false, true );
1393  mpViewShell->MarkCursor( pDoc->MaxCol(), row, maRange.aStart.Tab(), false, true );
1395  return true;
1396 }
1397 
1399 {
1400  SolarMutexGuard g;
1401 
1402  if (IsFormulaMode())
1403  {
1404  return false;
1405  }
1406 
1409  mpViewShell->DoneBlockMode( true ); // continue selecting
1410  mpViewShell->InitBlockMode( static_cast<SCCOL>(column), 0, maRange.aStart.Tab(), false, true );
1411  mpViewShell->MarkCursor( static_cast<SCCOL>(column), pDoc->MaxRow(), maRange.aStart.Tab(), true );
1413  return true;
1414 }
1415 
1417 {
1418  SolarMutexGuard g;
1419 
1420  if (IsFormulaMode())
1421  {
1422  return false;
1423  }
1424 
1427  mpViewShell->DoneBlockMode( true ); // continue selecting
1428  mpViewShell->InitBlockMode( 0, row, maRange.aStart.Tab(), false, false, true, true );
1429  mpViewShell->MarkCursor( pDoc->MaxCol(), row, maRange.aStart.Tab(), false, true );
1431  mpViewShell->DoneBlockMode( true );
1432  return true;
1433 }
1434 
1436 {
1437  SolarMutexGuard g;
1438 
1439  if (IsFormulaMode())
1440  {
1441  return false;
1442  }
1443 
1446  mpViewShell->DoneBlockMode( true ); // continue selecting
1447  mpViewShell->InitBlockMode( static_cast<SCCOL>(column), 0, maRange.aStart.Tab(), false, true, false, true );
1448  mpViewShell->MarkCursor( static_cast<SCCOL>(column), pDoc->MaxRow(), maRange.aStart.Tab(), true );
1450  mpViewShell->DoneBlockMode( true );
1451  return true;
1452 }
1453 
1455 {
1456  if (IsFormulaMode())
1457  {
1458  return ;
1459  }
1460  if (mbIsFocusSend)
1461  {
1462  return ;
1463  }
1464  mbIsFocusSend = true;
1465  AccessibleEventObject aEvent;
1466  aEvent.EventId = AccessibleEventId::ACTIVE_DESCENDANT_CHANGED;
1467  aEvent.Source = uno::Reference< XAccessible >(this);
1468  aEvent.NewValue <<= getAccessibleCellAt(maActiveCell.Row(), maActiveCell.Col());
1469  CommitChange(aEvent);
1470 }
1471 
1473 {
1474  ScViewData& rViewData = mpViewShell->GetViewData();
1475  if (!rViewData.IsRefMode())
1476  // Not in reference mode. Bail out.
1477  return;
1478 
1479  sal_uInt16 nRefStartX = rViewData.GetRefStartX();
1480  sal_Int32 nRefStartY = rViewData.GetRefStartY();
1481  sal_uInt16 nRefEndX = rViewData.GetRefEndX();
1482  sal_Int32 nRefEndY = rViewData.GetRefEndY();
1483  ScAddress aFormulaAddr;
1484  if(!GetFormulaCurrentFocusCell(aFormulaAddr))
1485  {
1486  return ;
1487  }
1488  if (m_aFormulaActiveCell != aFormulaAddr)
1489  {//New Focus
1490  m_nMinX =std::min(nRefStartX,nRefEndX);
1491  m_nMaxX =std::max(nRefStartX,nRefEndX);
1492  m_nMinY = std::min(nRefStartY,nRefEndY);
1493  m_nMaxY = std::max(nRefStartY,nRefEndY);
1495  AccessibleEventObject aEvent;
1496  aEvent.Source = uno::Reference< XAccessible >(this);
1497  aEvent.EventId = AccessibleEventId::ACTIVE_DESCENDANT_CHANGED;
1498  aEvent.OldValue <<= uno::Reference<XAccessible>(m_pAccFormulaCell);
1499  m_pAccFormulaCell = GetAccessibleCellAt(aFormulaAddr.Row(), aFormulaAddr.Col());
1500  uno::Reference< XAccessible > xNew = m_pAccFormulaCell;
1501  aEvent.NewValue <<= xNew;
1502  CommitChange(aEvent);
1503  if (nRefStartX == nRefEndX && nRefStartY == nRefEndY)
1504  {//Selection Single
1505  aEvent.EventId = AccessibleEventId::SELECTION_CHANGED;
1506  aEvent.NewValue <<= xNew;
1507  CommitChange(aEvent);
1508  m_mapFormulaSelectionSend.emplace(aFormulaAddr,xNew);
1509  m_vecFormulaLastMyAddr.clear();
1510  m_vecFormulaLastMyAddr.emplace_back(aFormulaAddr);
1511  }
1512  else
1513  {
1514  std::vector<ScMyAddress> vecCurSel;
1515  int nCurSize = (m_nMaxX - m_nMinX +1)*(m_nMaxY - m_nMinY +1) ;
1516  vecCurSel.reserve(nCurSize);
1517  for (sal_uInt16 x = m_nMinX ; x <= m_nMaxX ; ++x)
1518  {
1519  for (sal_Int32 y = m_nMinY ; y <= m_nMaxY ; ++y)
1520  {
1521  ScMyAddress aAddr(x,y,0);
1522  vecCurSel.push_back(aAddr);
1523  }
1524  }
1525  std::sort(vecCurSel.begin(), vecCurSel.end());
1526  std::vector<ScMyAddress> vecNew;
1527  std::set_difference(vecCurSel.begin(),vecCurSel.end(),
1529  std::back_insert_iterator(vecNew));
1530  int nNewSize = vecNew.size();
1531  if ( nNewSize > 10 )
1532  {
1533  aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_WITHIN;
1534  aEvent.NewValue.clear();
1535  CommitChange(aEvent);
1536  }
1537  else
1538  {
1539  for(const auto& rAddr : vecNew)
1540  {
1541  uno::Reference< XAccessible > xChild;
1542  if (rAddr == aFormulaAddr)
1543  {
1544  xChild = m_pAccFormulaCell.get();
1545  }
1546  else
1547  {
1548  xChild = getAccessibleCellAt(rAddr.Row(),rAddr.Col());
1549  aEvent.EventId = AccessibleEventId::ACTIVE_DESCENDANT_CHANGED_NOFOCUS;
1550  aEvent.NewValue <<= xChild;
1551  CommitChange(aEvent);
1552  }
1553  aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_ADD;
1554  aEvent.NewValue <<= xChild;
1555  CommitChange(aEvent);
1556  m_mapFormulaSelectionSend.emplace(rAddr,xChild);
1557  }
1558  }
1559  m_vecFormulaLastMyAddr.swap(vecCurSel);
1560  }
1561  }
1562  m_aFormulaActiveCell = aFormulaAddr;
1563 }
1564 
1566 {
1567  AccessibleEventObject aEvent;
1568  aEvent.Source = uno::Reference< XAccessible >(this);
1569  MAP_ADDR_XACC::iterator miRemove = m_mapFormulaSelectionSend.begin();
1570  for(; miRemove != m_mapFormulaSelectionSend.end() ;)
1571  {
1572  if( !bRemoveAll && IsScAddrFormulaSel(miRemove->first) )
1573  {
1574  ++miRemove;
1575  continue;
1576  }
1577  aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_REMOVE;
1578  aEvent.NewValue <<= miRemove->second;
1579  CommitChange(aEvent);
1580  miRemove = m_mapFormulaSelectionSend.erase(miRemove);
1581  }
1582 }
1583 
1585 {
1586  return addr.Col() >= m_nMinX && addr.Col() <= m_nMaxX &&
1587  addr.Row() >= m_nMinY && addr.Row() <= m_nMaxY &&
1588  addr.Tab() == mpViewShell->GetViewData().GetTabNo();
1589 }
1590 
1591 bool ScAccessibleSpreadsheet::CheckChildIndex(sal_Int32 nIndex) const
1592 {
1593  sal_Int32 nMaxIndex = (m_nMaxX - m_nMinX +1)*(m_nMaxY - m_nMinY +1) -1 ;
1594  return nIndex <= nMaxIndex && nIndex >= 0 ;
1595 }
1596 
1598 {
1599  sal_Int32 nRowAll = GetRowAll();
1600  sal_uInt16 nColAll = GetColAll();
1601  if (nIndex < 0 || nIndex >= nRowAll * nColAll )
1602  {
1603  return ScAddress();
1604  }
1605  return ScAddress(
1606  static_cast<SCCOL>((nIndex - nIndex % nRowAll) / nRowAll + + m_nMinX),
1607  nIndex % nRowAll + m_nMinY,
1609  );
1610 }
1611 
1612 sal_Int32 ScAccessibleSpreadsheet::GetAccessibleIndexFormula( sal_Int32 nRow, sal_Int32 nColumn )
1613 {
1614  sal_uInt16 nColRelative = sal_uInt16(nColumn) - GetColAll();
1615  sal_Int32 nRowRelative = nRow - GetRowAll();
1616  if (nRow < 0 || nColumn < 0 || nRowRelative >= GetRowAll() || nColRelative >= GetColAll() )
1617  {
1618  return -1;
1619  }
1620  return GetRowAll() * nRowRelative + nColRelative;
1621 }
1622 
1624 {
1625  ScViewData& rViewData = mpViewShell->GetViewData();
1626  m_bFormulaMode = rViewData.IsRefMode() || SC_MOD()->IsFormulaMode();
1627  return m_bFormulaMode ;
1628 }
1629 
1631 {
1632  ScViewData& rViewData = mpViewShell->GetViewData();
1633  sal_uInt16 nRefX=0;
1634  sal_Int32 nRefY=0;
1635  if(m_bFormulaLastMode)
1636  {
1637  nRefX=rViewData.GetRefEndX();
1638  nRefY=rViewData.GetRefEndY();
1639  }
1640  else
1641  {
1642  nRefX=rViewData.GetRefStartX();
1643  nRefY=rViewData.GetRefStartY();
1644  }
1646  if( /* Always true: nRefX >= 0 && */ nRefX <= pDoc->MaxCol() && nRefY >= 0 && nRefY <= pDoc->MaxRow())
1647  {
1648  addr = ScAddress(nRefX,nRefY,rViewData.GetTabNo());
1649  return true;
1650  }
1651  return false;
1652 }
1653 
1654 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScMarkData & GetMarkData()
Definition: viewdata.cxx:3047
void InitRefMode(SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, ScRefType eType)
Definition: tabview4.cxx:309
void SelectAll(bool bContinue=false)
Definition: tabview2.cxx:1064
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &rPoint) override
===== XAccessibleComponent ============================================
virtual sal_Int32 SAL_CALL getAccessibleChildCount() override
Return the number of currently visible children.
SC_DLLPUBLIC const ScRange * GetRepeatColRange(SCTAB nTab)
Definition: document.cxx:6332
rtl::Reference< utl::AccessibleRelationSetHelper > GetRelationSet(const ScAddress *pAddress) const
======== internal =====================================================
ScAddress aStart
Definition: address.hxx:499
SC_DLLPUBLIC bool IsTabProtected(SCTAB nTab) const
Definition: documen3.cxx:1906
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
Definition: markdata.hxx:42
SCROW GetRefEndY() const
Definition: viewdata.hxx:518
virtual css::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleRows() override
Returns the selected rows in a table.
void CommitFocusCell(const ScAddress &aNewCell)
virtual void SAL_CALL addAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &xListener) override
===== XAccessibleEventBroadcaster =====================================
void RemoveSelection(const ScMarkData &refScMarkData)
SCROW Row() const
Definition: address.hxx:261
void MarkToMulti()
Definition: markdata.cxx:224
virtual void SAL_CALL clearAccessibleSelection() override
rtl::Reference< ScAccessibleCell > m_pAccFormulaCell
bool GetDelMark(ScRange &rRange) const
Definition: viewdata.hxx:531
static rtl::Reference< ScAccessibleCell > create(const css::uno::Reference< css::accessibility::XAccessible > &rxParent, ScTabViewShell *pViewShell, const ScAddress &rCellAddress, sal_Int32 nIndex, ScSplitPos eSplitPos, ScAccessibleDocument *pAccDoc)
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override
===== XAccessibleContext ==============================================
SC_DLLPUBLIC bool Intersects(const ScRange &rRange) const
Definition: address.cxx:1558
SCROW GetRefStartY() const
Definition: viewdata.hxx:515
void AddAccessibilityObject(SfxListener &rObject)
Definition: tabvwshh.cxx:210
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
===== SfxListener =====================================================
virtual sal_Bool SAL_CALL unselectColumn(sal_Int32 column) override
virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL getAccessibleColumnHeaders() override
Returns the column headers as an AccessibleTable.
void FillRangeListWithMarks(ScRangeList *pList, bool bClear, SCTAB nForTab=-1) const
Create a range list of marks.
Definition: markdata.cxx:387
sal_Int16 nId
virtual sal_Bool SAL_CALL isAccessibleSelected(sal_Int32 nRow, sal_Int32 nColumn) override
Returns a boolean value indicating whether the accessible at a specified row and column is selected...
bool GetForceFocusOnCurCell() const
Definition: tabvwsh.hxx:380
SCTAB GetTabNo() const
Definition: viewdata.hxx:394
virtual void SAL_CALL deselectAccessibleChild(sal_Int32 nChildIndex) override
static ScDocument * GetDocument(ScTabViewShell *pViewShell)
void Unmark()
Definition: tabview3.cxx:1721
ScAddress aEnd
Definition: address.hxx:500
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
Return a reference to the parent.
ScSplitPos GetActivePart() const
Definition: viewdata.hxx:397
ScDocument & GetDocument() const
Definition: viewdata.hxx:379
void ConstructScAccessibleSpreadsheet(ScAccessibleDocument *pAccDoc, ScTabViewShell *pViewShell, SCTAB nTab, ScSplitPos eSplitPos)
std::vector< PAIR_COL > m_vecTempCol
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleCellAt(sal_Int32 nRow, sal_Int32 nColumn) override
Returns the Accessible at a specified row and column in the table.
size_t GetCellCount() const
Definition: rangelst.cxx:1092
virtual sal_Bool SAL_CALL containsPoint(const css::awt::Point &rPoint) override
===== XAccessibleComponent ============================================
float x
virtual void SAL_CALL selectAccessibleChild(sal_Int32 nChildIndex) override
===== XAccessibleSelection ===========================================
SfxHintId GetId() const
ScSplitPos
Definition: viewdata.hxx:44
bool IsCellMarked(SCCOL nCol, SCROW nRow, bool bNoSimple=false) const
Definition: markdata.cxx:285
virtual sal_Int32 SAL_CALL getAccessibleColumn(sal_Int32 nChildIndex) override
Returns the column number of an index in the table.
void GetMarkArea(ScRange &rRange) const
Definition: markdata.cxx:112
void RemoveFormulaSelection(bool bRemoveAll=false)
SC_DLLPUBLIC SCROW MaxRow() const
Definition: document.hxx:871
ScAccessibleSpreadsheet(ScAccessibleDocument *pAccDoc, ScTabViewShell *pViewShell, SCTAB nTab, ScSplitPos eSplitPos)
bool IsMultiMarked() const
Definition: markdata.hxx:82
void SelectCell(sal_Int32 nRow, sal_Int32 nCol, bool bDeselect)
int nCount
SC_DLLPUBLIC OUString GetString(SCCOL nCol, SCROW nRow, SCTAB nTab, const ScInterpreterContext *pContext=nullptr) const
Definition: document.cxx:3536
virtual tools::Rectangle GetBoundingBox() const override
Return the object's current bounding box relative to the parent object.
SCTAB Tab() const
Definition: address.hxx:270
void DoneBlockMode(bool bContinue=false)
Definition: tabview2.cxx:409
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
===== SfxListener =====================================================
tools::Rectangle GetWindowExtentsRelative(const vcl::Window *pRelativeWindow) const
ScViewData & GetViewData()
Definition: tabview.hxx:333
ScGridWindow * GetActiveWin()
Definition: tabview.cxx:887
void SelectionChanged(bool bFromPaste=false)
Definition: tabview3.cxx:531
void SetRefStart(SCCOL nNewX, SCROW nNewY, SCTAB nNewZ)
Definition: viewdata.cxx:4028
virtual ~ScAccessibleSpreadsheet() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Returns a list of all supported services.
float y
bool IsRowMarked(SCROW nRow) const
Definition: markdata.cxx:318
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Returns a list of all supported services.
virtual sal_Bool SAL_CALL isAccessibleColumnSelected(sal_Int32 nColumn) override
Returns a boolean value indicating whether the specified column is selected.
std::unique_ptr< ScRangeList > mpMarkedRanges
void CommitTableModelChange(sal_Int32 nStartRow, sal_Int32 nStartCol, sal_Int32 nEndRow, sal_Int32 nEndCol, sal_uInt16 nId)
SC_DLLPUBLIC SCCOL MaxCol() const
Definition: document.hxx:870
vcl::Window * GetWindowByPos(ScSplitPos ePos) const
Definition: tabview.hxx:371
virtual void SAL_CALL addAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &xListener) override
===== XAccessibleEventBroadcaster =====================================
bool IsMarked() const
Definition: markdata.hxx:81
int i
bool IsColumnMarked(SCCOL nCol) const
Definition: markdata.cxx:302
std::vector< ScRange > m_vecTempRange
void GetPosFromPixel(tools::Long nClickX, tools::Long nClickY, ScSplitPos eWhich, SCCOL &rPosX, SCROW &rPosY, bool bTestMerge=true, bool bRepair=false, SCTAB nForTab=-1)
Definition: viewdata.cxx:2695
sal_Int16 SCCOL
Definition: types.hxx:21
rtl::Reference< ScAccessibleCell > GetAccessibleCellAt(sal_Int32 nRow, sal_Int32 nColumn)
#define SC_MOD()
Definition: scmod.hxx:249
virtual void SAL_CALL disposing() override
ScMyAddress CalcScAddressFromRangeList(ScRangeList *pMarkedRanges, sal_Int32 nSelectedChildIndex)
virtual sal_Bool SAL_CALL isAccessibleRowSelected(sal_Int32 nRow) override
Returns a boolean value indicating whether the specified row is selected.
std::vector< ScMyAddress > m_vecFormulaLastMyAddr
SC_DLLPUBLIC void SetTabNo(SCTAB nTab, bool bNew=false, bool bExtendSelection=false, bool bSameTabButMoved=false)
Definition: tabview3.cxx:1796
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
size_t size() const
Definition: rangelst.hxx:89
unsigned char sal_Bool
void CommitFocusGained() const
Calls all FocusListener to tell they that the focus is gained.
OUString ScResId(const char *pId)
Definition: scdll.cxx:89
virtual OUString SAL_CALL getImplementationName() override
===== XServiceInfo ====================================================
static bool CalcScRangeDifferenceMax(const ScRange &rSrc, const ScRange &rDest, int nMax, std::vector< ScMyAddress > &vecRet, int &nSize)
std::pair< sal_uInt16, sal_uInt16 > PAIR_COL
virtual sal_Bool SAL_CALL selectRow(sal_Int32 row) override
This base class provides an implementation of the AccessibleTable service.
virtual void SAL_CALL grabFocus() override
bool In(const ScAddress &) const
is Address& in Range?
Definition: address.hxx:732
SCCOL GetRefEndX() const
Definition: viewdata.hxx:517
css::uno::Sequence< T > concatSequences(const css::uno::Sequence< T > &rS1, const Ss &...rSn)
bool IsScAddrFormulaSel(const ScAddress &addr) const
SCCOL Col() const
Definition: address.hxx:266
SCCOL GetRefStartX() const
Definition: viewdata.hxx:514
ScAddress GetCurPos() const
Definition: viewdata.cxx:4023
virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount() override
virtual void SAL_CALL disposing() override
ScAccessibleDocument * mpAccDoc
ScAddress GetChildIndexAddress(sal_Int32) const
virtual sal_Int32 SAL_CALL getAccessibleRow(sal_Int32 nChildIndex) override
Returns the row number of an index in the table.
sal_Int32 SCROW
Definition: types.hxx:17
bool GetFormulaCurrentFocusCell(ScAddress &addr)
rtl::Reference< ScAccessibleCell > mpAccCell
SC_DLLPUBLIC const ScRange * GetRepeatRowRange(SCTAB nTab)
Definition: document.cxx:6340
virtual sal_Int32 SAL_CALL getForeground() override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
===== XTypeProvider ===================================================
void RemoveAccessibilityObject(SfxListener &rObject)
Definition: tabvwshh.cxx:220
virtual sal_Bool SAL_CALL selectColumn(sal_Int32 column) override
virtual css::uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet() override
Return the set of current states.
void CommitFocusLost() const
Calls all FocusListener to tell they that the focus is lost.
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_BLACK
virtual sal_Bool SAL_CALL unselectRow(sal_Int32 row) override
virtual sal_Int32 SAL_CALL getAccessibleIndex(sal_Int32 nRow, sal_Int32 nColumn) override
===== XAccessibleExtendedTable ========================================
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild(sal_Int32 nSelectedChildIndex) override
void SetRefEnd(SCCOL nNewX, SCROW nNewY, SCTAB nNewZ)
Definition: viewdata.cxx:4033
static bool CalcScRangeListDifferenceMax(ScRangeList *pSrc, ScRangeList *pDest, int nMax, std::vector< ScMyAddress > &vecRet)
sal_Int32 GetAccessibleIndexFormula(sal_Int32 nRow, sal_Int32 nColumn)
void CommitChange(const css::accessibility::AccessibleEventObject &rEvent) const
Calls all Listener to tell they the change.
ScRange & front()
Definition: rangelst.hxx:92
#define SAL_WARN(area, stream)
virtual tools::Rectangle GetBoundingBoxOnScreen() const override
Return the object's current bounding box relative to the desktop.
virtual css::uno::Reference< css::accessibility::XAccessibleTable > SAL_CALL getAccessibleRowHeaders() override
===== XAccessibleTable ================================================
Degree100 abs(Degree100 x)
void CompleteSelectionChanged(bool bNewState)
void UpdateRef(SCCOL nCurX, SCROW nCurY, SCTAB nCurZ)
Definition: tabview4.cxx:186
virtual void SAL_CALL selectAllAccessibleChildren() override
bool GetTableSelect(SCTAB nTab) const
Definition: markdata.cxx:184
void MarkCursor(SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, bool bCols=false, bool bRows=false, bool bCellSelection=false)
Definition: tabview2.cxx:449
bool HasFocus() const
bool IsRefMode() const
Definition: viewdata.hxx:512
virtual css::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleColumns() override
Returns the selected columns in a table.
static bool CompMinCol(const std::pair< sal_uInt16, sal_uInt16 > &pc1, const std::pair< sal_uInt16, sal_uInt16 > &pc2)
SC_DLLPUBLIC bool GetName(SCTAB nTab, OUString &rName) const
Definition: document.cxx:212
AnyEventRef aEvent
virtual sal_Int32 SAL_CALL getBackground() override
void InitBlockMode(SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, bool bTestNeg=false, bool bCols=false, bool bRows=false, bool bForceNeg=false)
Definition: tabview2.cxx:353
ScRange maRange
contains the range of the table, because it could be a subrange of the complete table ...
bool CheckChildIndex(sal_Int32) const
sal_Int16 SCTAB
Definition: types.hxx:22
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
===== XAccessible =====================================================