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