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