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 {
917 return ScAccessibleCell::create(this, mpViewShell, aCellAddress, GetAccessibleIndexFormula(nRow, nColumn), meSplitPos, mpAccDoc);
918 }
919 }
920 else
921 {
922 ScAddress aCellAddress(static_cast<SCCOL>(maRange.aStart.Col() + nColumn),
923 static_cast<SCROW>(maRange.aStart.Row() + nRow), maRange.aStart.Tab());
924 if ((aCellAddress == maActiveCell) && mpAccCell.is())
925 {
926 return mpAccCell;
927 }
928 else
929 {
931 auto it = m_mapCells.find(aCellAddress);
932 if (it != m_mapCells.end())
933 xCell = it->second.get();
934 if (xCell)
935 return xCell;
936 xCell = ScAccessibleCell::create(this, mpViewShell, aCellAddress, getAccessibleIndex(nRow, nColumn), meSplitPos, mpAccDoc);
937 m_mapCells.insert(std::make_pair(aCellAddress, xCell));
938 return xCell;
939 }
940 }
941}
942
943uno::Reference< XAccessible > SAL_CALL ScAccessibleSpreadsheet::getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn )
944{
945 SolarMutexGuard aGuard;
947 if (!IsFormulaMode())
948 {
949 if (nRow > (maRange.aEnd.Row() - maRange.aStart.Row()) ||
950 nRow < 0 ||
951 nColumn > (maRange.aEnd.Col() - maRange.aStart.Col()) ||
952 nColumn < 0)
953 throw lang::IndexOutOfBoundsException();
954 }
955 rtl::Reference<ScAccessibleCell> pAccessibleCell = GetAccessibleCellAt(nRow, nColumn);
956 return pAccessibleCell;
957}
958
959sal_Bool SAL_CALL ScAccessibleSpreadsheet::isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn )
960{
961 SolarMutexGuard aGuard;
963
964 if (IsFormulaMode())
965 {
966 ScAddress addr(static_cast<SCCOL>(nColumn), nRow, 0);
967 return IsScAddrFormulaSel(addr);
968 }
969 if ((nColumn > (maRange.aEnd.Col() - maRange.aStart.Col())) || (nColumn < 0) ||
970 (nRow > (maRange.aEnd.Row() - maRange.aStart.Row())) || (nRow < 0))
971 throw lang::IndexOutOfBoundsException();
972
973 bool bResult(false);
974 if (mpViewShell)
975 {
976 const ScMarkData& rMarkdata = mpViewShell->GetViewData().GetMarkData();
977 bResult = rMarkdata.IsCellMarked(static_cast<SCCOL>(nColumn), static_cast<SCROW>(nRow));
978 }
979 return bResult;
980}
981
982 //===== XAccessibleComponent ============================================
983
984uno::Reference< XAccessible > SAL_CALL ScAccessibleSpreadsheet::getAccessibleAtPoint(const awt::Point& rPoint)
985{
986 uno::Reference< XAccessible > xAccessible;
987 if (containsPoint(rPoint))
988 {
989 SolarMutexGuard aGuard;
991 if (mpViewShell)
992 {
993 SCCOL nX;
994 SCROW nY;
995 mpViewShell->GetViewData().GetPosFromPixel( rPoint.X, rPoint.Y, meSplitPos, nX, nY);
996 try {
997 xAccessible = getAccessibleCellAt(nY, nX);
998 }
999 catch(const css::lang::IndexOutOfBoundsException &)
1000 {
1001 return nullptr;
1002 }
1003 }
1004 }
1005 return xAccessible;
1006}
1007
1009{
1010 if (getAccessibleParent().is())
1011 {
1012 uno::Reference<XAccessibleComponent> xAccessibleComponent(getAccessibleParent()->getAccessibleContext(), uno::UNO_QUERY);
1013 if (xAccessibleComponent.is())
1014 xAccessibleComponent->grabFocus();
1015 }
1016}
1017
1019{
1020 return sal_Int32(COL_BLACK);
1021}
1022
1024{
1025 SolarMutexGuard aGuard;
1026 IsObjectValid();
1027 return sal_Int32(SC_MOD()->GetColorConfig().GetColorValue( ::svtools::DOCCOLOR ).nColor);
1028}
1029
1030 //===== XAccessibleContext ==============================================
1031
1032uno::Reference<XAccessibleRelationSet> SAL_CALL ScAccessibleSpreadsheet::getAccessibleRelationSet()
1033{
1035 if(mpAccDoc)
1036 pRelationSet = mpAccDoc->GetRelationSet(nullptr);
1037 if (pRelationSet)
1038 return pRelationSet;
1040}
1041
1043{
1044 SolarMutexGuard aGuard;
1045 sal_Int64 nParentStates = 0;
1046 if (getAccessibleParent().is())
1047 {
1048 uno::Reference<XAccessibleContext> xParentContext = getAccessibleParent()->getAccessibleContext();
1049 nParentStates = xParentContext->getAccessibleStateSet();
1050 }
1051 sal_Int64 nStateSet = 0;
1052 if (IsDefunc(nParentStates))
1053 nStateSet |= AccessibleStateType::DEFUNC;
1054 else
1055 {
1056 nStateSet |= AccessibleStateType::MANAGES_DESCENDANTS;
1057 if (IsEditable())
1058 nStateSet |= AccessibleStateType::EDITABLE;
1059 nStateSet |= AccessibleStateType::ENABLED;
1060 nStateSet |= AccessibleStateType::FOCUSABLE;
1061 if (IsFocused())
1062 nStateSet |= AccessibleStateType::FOCUSED;
1063 nStateSet |= AccessibleStateType::MULTI_SELECTABLE;
1064 nStateSet |= AccessibleStateType::OPAQUE;
1065 nStateSet |= AccessibleStateType::SELECTABLE;
1067 nStateSet |= AccessibleStateType::SELECTED;
1068 if (isShowing())
1069 nStateSet |= AccessibleStateType::SHOWING;
1070 if (isVisible())
1071 nStateSet |= AccessibleStateType::VISIBLE;
1072 }
1073 return nStateSet;
1074}
1075
1077
1078void SAL_CALL ScAccessibleSpreadsheet::selectAccessibleChild( sal_Int64 nChildIndex )
1079{
1080 SolarMutexGuard aGuard;
1081 IsObjectValid();
1082 if (nChildIndex < 0 || nChildIndex >= getAccessibleChildCount())
1083 throw lang::IndexOutOfBoundsException();
1084
1085 if (mpViewShell)
1086 {
1087 sal_Int32 nCol(getAccessibleColumn(nChildIndex));
1088 sal_Int32 nRow(getAccessibleRow(nChildIndex));
1089
1090 SelectCell(nRow, nCol, false);
1091 }
1092}
1093
1094void SAL_CALL
1096{
1097 SolarMutexGuard aGuard;
1098 IsObjectValid();
1099 if (mpViewShell && !IsFormulaMode())
1101}
1102
1104{
1105 SolarMutexGuard aGuard;
1106 IsObjectValid();
1107 if (!mpViewShell)
1108 return;
1109
1110 if (IsFormulaMode())
1111 {
1113 ScViewData& rViewData = mpViewShell->GetViewData();
1114 mpViewShell->InitRefMode( 0, 0, rViewData.GetTabNo(), SC_REFTYPE_REF );
1115 rViewData.SetRefStart(0, 0, rViewData.GetTabNo());
1116 rViewData.SetRefEnd(pDoc->MaxCol(), pDoc->MaxRow(), rViewData.GetTabNo());
1117 mpViewShell->UpdateRef(pDoc->MaxCol(), pDoc->MaxRow(), rViewData.GetTabNo());
1118 }
1119 else
1121}
1122
1123sal_Int64 SAL_CALL
1125{
1126 SolarMutexGuard aGuard;
1127 IsObjectValid();
1128 sal_Int64 nResult(0);
1129 if (mpViewShell)
1130 {
1131 if (IsFormulaMode())
1132 {
1133 nResult = static_cast<sal_Int64>(GetRowAll()) * static_cast<sal_Int64>(GetColAll());
1134 }
1135 else
1136 {
1137 if (!mpMarkedRanges)
1138 {
1139 mpMarkedRanges.reset(new ScRangeList());
1141 aMarkData.FillRangeListWithMarks(mpMarkedRanges.get(), false);
1142 }
1143 // is possible, because there shouldn't be overlapped ranges in it
1144 if (mpMarkedRanges)
1145 nResult = mpMarkedRanges->GetCellCount();
1146 }
1147 }
1148 return nResult;
1149}
1150
1151uno::Reference<XAccessible > SAL_CALL
1153{
1154 SolarMutexGuard aGuard;
1155 IsObjectValid();
1156 uno::Reference < XAccessible > xAccessible;
1157 if (IsFormulaMode())
1158 {
1159 if(CheckChildIndex(nSelectedChildIndex))
1160 {
1161 ScAddress addr = GetChildIndexAddress(nSelectedChildIndex);
1162 xAccessible = getAccessibleCellAt(addr.Row(), addr.Col());
1163 }
1164 return xAccessible;
1165 }
1166 if (mpViewShell)
1167 {
1168 if (!mpMarkedRanges)
1169 {
1170 mpMarkedRanges.reset(new ScRangeList());
1172 }
1173 if (mpMarkedRanges)
1174 {
1175 if ((nSelectedChildIndex < 0) ||
1176 (mpMarkedRanges->GetCellCount() <= o3tl::make_unsigned(nSelectedChildIndex)))
1177 {
1178 throw lang::IndexOutOfBoundsException();
1179 }
1180 ScMyAddress addr = CalcScAddressFromRangeList(mpMarkedRanges.get(),nSelectedChildIndex);
1181 if( m_mapSelectionSend.find(addr) != m_mapSelectionSend.end() )
1182 xAccessible = m_mapSelectionSend[addr];
1183 else
1184 xAccessible = getAccessibleCellAt(addr.Row(), addr.Col());
1185 }
1186 }
1187 return xAccessible;
1188}
1189
1190void SAL_CALL ScAccessibleSpreadsheet::deselectAccessibleChild( sal_Int64 nChildIndex )
1191{
1192 SolarMutexGuard aGuard;
1193 IsObjectValid();
1194
1195 if (nChildIndex < 0 || nChildIndex >= getAccessibleChildCount())
1196 throw lang::IndexOutOfBoundsException();
1197
1198 if (!mpViewShell)
1199 return;
1200
1201 sal_Int32 nCol(getAccessibleColumn(nChildIndex));
1202 sal_Int32 nRow(getAccessibleRow(nChildIndex));
1203
1204 if (IsFormulaMode())
1205 {
1207 ScAddress(static_cast<SCCOL>(nCol), nRow,mpViewShell->GetViewData().GetTabNo()))
1208 )
1209 {
1210 SelectCell(nRow, nCol, true);
1211 }
1212 return ;
1213 }
1214 if (mpViewShell->GetViewData().GetMarkData().IsCellMarked(static_cast<SCCOL>(nCol), static_cast<SCROW>(nRow)))
1215 SelectCell(nRow, nCol, true);
1216}
1217
1218void ScAccessibleSpreadsheet::SelectCell(sal_Int32 nRow, sal_Int32 nCol, bool bDeselect)
1219{
1220 if (IsFormulaMode())
1221 {
1222 if (bDeselect)
1223 {//??
1224 return;
1225 }
1226 else
1227 {
1228 ScViewData& rViewData = mpViewShell->GetViewData();
1229
1230 mpViewShell->InitRefMode( static_cast<SCCOL>(nCol), nRow, rViewData.GetTabNo(), SC_REFTYPE_REF );
1231 mpViewShell->UpdateRef(static_cast<SCCOL>(nCol), nRow, rViewData.GetTabNo());
1232 }
1233 return ;
1234 }
1236
1237 mpViewShell->DoneBlockMode( true ); // continue selecting
1238 mpViewShell->InitBlockMode( static_cast<SCCOL>(nCol), static_cast<SCROW>(nRow), maRange.aStart.Tab(), bDeselect );
1239
1241}
1242
1243/*
1244void ScAccessibleSpreadsheet::CreateSortedMarkedCells()
1245{
1246 mpSortedMarkedCells = new std::vector<ScMyAddress>();
1247 mpSortedMarkedCells->reserve(mpMarkedRanges->GetCellCount());
1248 for ( size_t i = 0, ListSize = mpMarkedRanges->size(); i < ListSize; ++i )
1249 {
1250 ScRange* pRange = (*mpMarkedRanges)[i];
1251 if (pRange->aStart.Tab() != pRange->aEnd.Tab())
1252 {
1253 if ((maActiveCell.Tab() >= pRange->aStart.Tab()) ||
1254 maActiveCell.Tab() <= pRange->aEnd.Tab())
1255 {
1256 ScRange aRange(*pRange);
1257 aRange.aStart.SetTab(maActiveCell.Tab());
1258 aRange.aEnd.SetTab(maActiveCell.Tab());
1259 AddMarkedRange(aRange);
1260 }
1261 else
1262 {
1263 OSL_FAIL("Range of wrong table");
1264 }
1265 }
1266 else if(pRange->aStart.Tab() == maActiveCell.Tab())
1267 AddMarkedRange(*pRange);
1268 else
1269 {
1270 OSL_FAIL("Range of wrong table");
1271 }
1272 }
1273 std::sort(mpSortedMarkedCells->begin(), mpSortedMarkedCells->end());
1274}
1275
1276void ScAccessibleSpreadsheet::AddMarkedRange(const ScRange& rRange)
1277{
1278 for (SCROW nRow = rRange.aStart.Row(); nRow <= rRange.aEnd.Row(); ++nRow)
1279 {
1280 for (SCCOL nCol = rRange.aStart.Col(); nCol <= rRange.aEnd.Col(); ++nCol)
1281 {
1282 ScMyAddress aCell(nCol, nRow, maActiveCell.Tab());
1283 mpSortedMarkedCells->push_back(aCell);
1284 }
1285 }
1286}*/
1287
1288 //===== XServiceInfo ====================================================
1289
1291{
1292 return "ScAccessibleSpreadsheet";
1293}
1294
1295uno::Sequence< OUString> SAL_CALL
1297{
1298 const css::uno::Sequence<OUString> vals { "com.sun.star.AccessibleSpreadsheet" };
1300}
1301
1302//===== XTypeProvider =======================================================
1303
1304uno::Sequence<sal_Int8> SAL_CALL
1306{
1307 return css::uno::Sequence<sal_Int8>();
1308}
1309
1311
1312void SAL_CALL ScAccessibleSpreadsheet::addAccessibleEventListener(const uno::Reference<XAccessibleEventListener>& xListener)
1313{
1314 SolarMutexGuard aGuard;
1315 IsObjectValid();
1317
1318}
1319
1320//==== internal =========================================================
1321
1323{
1324 tools::Rectangle aRect;
1325 if (mpViewShell)
1326 {
1328 if (pWindow)
1329 aRect = pWindow->GetWindowExtentsAbsolute();
1330 }
1331 return aRect;
1332}
1333
1335{
1336 tools::Rectangle aRect;
1337 if (mpViewShell)
1338 {
1340 if (pWindow)
1341 //#101986#; extends to the same window, because the parent is the document and it has the same window
1342 aRect = pWindow->GetWindowExtentsRelative(*pWindow);
1343 }
1344 return aRect;
1345}
1346
1347bool ScAccessibleSpreadsheet::IsDefunc(sal_Int64 nParentStates)
1348{
1349 return ScAccessibleContextBase::IsDefunc() || (mpViewShell == nullptr) || !getAccessibleParent().is() ||
1350 (nParentStates & AccessibleStateType::DEFUNC);
1351}
1352
1354{
1355 if (IsFormulaMode())
1356 {
1357 return false;
1358 }
1359 bool bProtected(false);
1361 bProtected = true;
1362 return !bProtected;
1363}
1364
1366{
1367 bool bFocused(false);
1368 if (mpViewShell)
1369 {
1371 bFocused = mpViewShell->GetActiveWin()->HasFocus();
1372 }
1373 return bFocused;
1374}
1375
1377{
1378 if (IsFormulaMode())
1379 {
1380 return false;
1381 }
1382
1383 bool bResult(false);
1384 if(mpViewShell)
1385 {
1386 //#103800#; use a copy of MarkData
1388 if (aMarkData.IsAllMarked(maRange))
1389 bResult = true;
1390 }
1391 return bResult;
1392}
1393
1395{
1396 ScDocument* pDoc = nullptr;
1397 if (pViewShell)
1398 pDoc = &pViewShell->GetViewData().GetDocument();
1399 return pDoc;
1400}
1401
1403{
1405
1406 if (IsFormulaMode())
1407 {
1408 return false;
1409 }
1410
1413 mpViewShell->DoneBlockMode( true ); // continue selecting
1414 mpViewShell->InitBlockMode( 0, row, maRange.aStart.Tab(), false, false, true );
1415 mpViewShell->MarkCursor( pDoc->MaxCol(), row, maRange.aStart.Tab(), false, true );
1417 return true;
1418}
1419
1421{
1423
1424 if (IsFormulaMode())
1425 {
1426 return false;
1427 }
1428
1431 mpViewShell->DoneBlockMode( true ); // continue selecting
1432 mpViewShell->InitBlockMode( static_cast<SCCOL>(column), 0, maRange.aStart.Tab(), false, true );
1433 mpViewShell->MarkCursor( static_cast<SCCOL>(column), pDoc->MaxRow(), maRange.aStart.Tab(), true );
1435 return true;
1436}
1437
1439{
1441
1442 if (IsFormulaMode())
1443 {
1444 return false;
1445 }
1446
1449 mpViewShell->DoneBlockMode( true ); // continue selecting
1450 mpViewShell->InitBlockMode( 0, row, maRange.aStart.Tab(), false, false, true, true );
1451 mpViewShell->MarkCursor( pDoc->MaxCol(), row, maRange.aStart.Tab(), false, true );
1453 mpViewShell->DoneBlockMode( true );
1454 return true;
1455}
1456
1458{
1460
1461 if (IsFormulaMode())
1462 {
1463 return false;
1464 }
1465
1468 mpViewShell->DoneBlockMode( true ); // continue selecting
1469 mpViewShell->InitBlockMode( static_cast<SCCOL>(column), 0, maRange.aStart.Tab(), false, true, false, true );
1470 mpViewShell->MarkCursor( static_cast<SCCOL>(column), pDoc->MaxRow(), maRange.aStart.Tab(), true );
1472 mpViewShell->DoneBlockMode( true );
1473 return true;
1474}
1475
1477{
1478 if (IsFormulaMode())
1479 {
1480 return ;
1481 }
1482 if (mbIsFocusSend)
1483 {
1484 return ;
1485 }
1486 mbIsFocusSend = true;
1487 AccessibleEventObject aEvent;
1488 aEvent.EventId = AccessibleEventId::ACTIVE_DESCENDANT_CHANGED;
1489 aEvent.Source = uno::Reference< XAccessible >(this);
1492}
1493
1495{
1496 ScViewData& rViewData = mpViewShell->GetViewData();
1497 if (!rViewData.IsRefMode())
1498 // Not in reference mode. Bail out.
1499 return;
1500
1501 sal_uInt16 nRefStartX = rViewData.GetRefStartX();
1502 sal_Int32 nRefStartY = rViewData.GetRefStartY();
1503 sal_uInt16 nRefEndX = rViewData.GetRefEndX();
1504 sal_Int32 nRefEndY = rViewData.GetRefEndY();
1505 ScAddress aFormulaAddr;
1506 if(!GetFormulaCurrentFocusCell(aFormulaAddr))
1507 {
1508 return ;
1509 }
1510 if (m_aFormulaActiveCell != aFormulaAddr)
1511 {//New Focus
1512 m_nMinX =std::min(nRefStartX,nRefEndX);
1513 m_nMaxX =std::max(nRefStartX,nRefEndX);
1514 m_nMinY = std::min(nRefStartY,nRefEndY);
1515 m_nMaxY = std::max(nRefStartY,nRefEndY);
1517 AccessibleEventObject aEvent;
1518 aEvent.Source = uno::Reference< XAccessible >(this);
1519 aEvent.EventId = AccessibleEventId::ACTIVE_DESCENDANT_CHANGED;
1520 aEvent.OldValue <<= uno::Reference<XAccessible>(m_pAccFormulaCell);
1521 m_pAccFormulaCell = GetAccessibleCellAt(aFormulaAddr.Row(), aFormulaAddr.Col());
1522 uno::Reference< XAccessible > xNew = m_pAccFormulaCell;
1523 aEvent.NewValue <<= xNew;
1525 if (nRefStartX == nRefEndX && nRefStartY == nRefEndY)
1526 {//Selection Single
1527 aEvent.EventId = AccessibleEventId::SELECTION_CHANGED;
1528 aEvent.NewValue <<= xNew;
1530 m_mapFormulaSelectionSend.emplace(aFormulaAddr,xNew);
1531 m_vecFormulaLastMyAddr.clear();
1532 m_vecFormulaLastMyAddr.emplace_back(aFormulaAddr);
1533 }
1534 else
1535 {
1536 std::vector<ScMyAddress> vecCurSel;
1537 int nCurSize = (m_nMaxX - m_nMinX +1)*(m_nMaxY - m_nMinY +1) ;
1538 vecCurSel.reserve(nCurSize);
1539 for (sal_uInt16 x = m_nMinX ; x <= m_nMaxX ; ++x)
1540 {
1541 for (sal_Int32 y = m_nMinY ; y <= m_nMaxY ; ++y)
1542 {
1543 ScMyAddress aAddr(x,y,0);
1544 vecCurSel.push_back(aAddr);
1545 }
1546 }
1547 std::sort(vecCurSel.begin(), vecCurSel.end());
1548 std::vector<ScMyAddress> vecNew;
1549 std::set_difference(vecCurSel.begin(),vecCurSel.end(),
1551 std::back_insert_iterator(vecNew));
1552 int nNewSize = vecNew.size();
1553 if ( nNewSize > 10 )
1554 {
1555 aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_WITHIN;
1556 aEvent.NewValue.clear();
1558 }
1559 else
1560 {
1561 for(const auto& rAddr : vecNew)
1562 {
1563 uno::Reference< XAccessible > xChild;
1564 if (rAddr == aFormulaAddr)
1565 {
1566 xChild = m_pAccFormulaCell.get();
1567 }
1568 else
1569 {
1570 xChild = getAccessibleCellAt(rAddr.Row(),rAddr.Col());
1571 aEvent.EventId = AccessibleEventId::ACTIVE_DESCENDANT_CHANGED_NOFOCUS;
1572 aEvent.NewValue <<= xChild;
1574 }
1575 aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_ADD;
1576 aEvent.NewValue <<= xChild;
1578 m_mapFormulaSelectionSend.emplace(rAddr,xChild);
1579 }
1580 }
1581 m_vecFormulaLastMyAddr.swap(vecCurSel);
1582 }
1583 }
1584 m_aFormulaActiveCell = aFormulaAddr;
1585}
1586
1588{
1589 AccessibleEventObject aEvent;
1590 aEvent.Source = uno::Reference< XAccessible >(this);
1591 MAP_ADDR_XACC::iterator miRemove = m_mapFormulaSelectionSend.begin();
1592 while (miRemove != m_mapFormulaSelectionSend.end())
1593 {
1594 if( !bRemoveAll && IsScAddrFormulaSel(miRemove->first) )
1595 {
1596 ++miRemove;
1597 continue;
1598 }
1599 aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_REMOVE;
1600 aEvent.NewValue <<= miRemove->second;
1602 miRemove = m_mapFormulaSelectionSend.erase(miRemove);
1603 }
1604}
1605
1607{
1608 return addr.Col() >= m_nMinX && addr.Col() <= m_nMaxX &&
1609 addr.Row() >= m_nMinY && addr.Row() <= m_nMaxY &&
1610 addr.Tab() == mpViewShell->GetViewData().GetTabNo();
1611}
1612
1614{
1615 sal_Int64 nMaxIndex = static_cast<sal_Int64>(m_nMaxX - m_nMinX +1) * static_cast<sal_Int64>(m_nMaxY - m_nMinY +1) -1 ;
1616 return nIndex <= nMaxIndex && nIndex >= 0 ;
1617}
1618
1620{
1621 sal_Int64 nRowAll = GetRowAll();
1622 sal_Int64 nColAll = GetColAll();
1623 if (nIndex < 0 || nIndex >= nRowAll * nColAll)
1624 {
1625 return ScAddress();
1626 }
1627 return ScAddress(
1628 static_cast<SCCOL>((nIndex - nIndex % nRowAll) / nRowAll + + m_nMinX),
1629 nIndex % nRowAll + m_nMinY,
1631 );
1632}
1633
1634sal_Int64 ScAccessibleSpreadsheet::GetAccessibleIndexFormula( sal_Int32 nRow, sal_Int32 nColumn )
1635{
1636 sal_uInt16 nColRelative = sal_uInt16(nColumn) - GetColAll();
1637 sal_Int32 nRowRelative = nRow - GetRowAll();
1638 if (nRow < 0 || nColumn < 0 || nRowRelative >= GetRowAll() || nColRelative >= GetColAll() )
1639 {
1640 return -1;
1641 }
1642 return static_cast<sal_Int64>(GetRowAll()) * static_cast<sal_Int64>(nRowRelative) + nColRelative;
1643}
1644
1646{
1647 ScViewData& rViewData = mpViewShell->GetViewData();
1648 m_bFormulaMode = rViewData.IsRefMode() || SC_MOD()->IsFormulaMode();
1649 return m_bFormulaMode ;
1650}
1651
1653{
1654 ScViewData& rViewData = mpViewShell->GetViewData();
1655 sal_uInt16 nRefX=0;
1656 sal_Int32 nRefY=0;
1658 {
1659 nRefX=rViewData.GetRefEndX();
1660 nRefY=rViewData.GetRefEndY();
1661 }
1662 else
1663 {
1664 nRefX=rViewData.GetRefStartX();
1665 nRefY=rViewData.GetRefStartY();
1666 }
1668 if( /* Always true: nRefX >= 0 && */ nRefX <= pDoc->MaxCol() && nRefY >= 0 && nRefY <= pDoc->MaxRow())
1669 {
1670 addr = ScAddress(nRefX,nRefY,rViewData.GetTabNo());
1671 return true;
1672 }
1673 return false;
1674}
1675
1676/* 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)
std::map< ScAddress, unotools::WeakReference< ScAccessibleCell > > m_mapCells
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:1905
SC_DLLPUBLIC SCCOL MaxCol() const
Definition: document.hxx:892
SC_DLLPUBLIC SCROW MaxRow() const
Definition: document.hxx:893
SC_DLLPUBLIC std::optional< ScRange > GetRepeatColRange(SCTAB nTab)
Definition: document.cxx:6276
SC_DLLPUBLIC std::optional< ScRange > GetRepeatRowRange(SCTAB nTab)
Definition: document.cxx:6284
SC_DLLPUBLIC OUString GetString(SCCOL nCol, SCROW nRow, SCTAB nTab, const ScInterpreterContext *pContext=nullptr) const
Definition: document.cxx:3505
SC_DLLPUBLIC bool GetName(SCTAB nTab, OUString &rName) const
Definition: document.cxx:204
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:390
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:453
void DoneBlockMode(bool bContinue=false)
Definition: tabview2.cxx:509
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:549
ScViewData & GetViewData()
Definition: tabview.hxx:344
ScGridWindow * GetActiveWin()
Definition: tabview.cxx:878
void Unmark()
Definition: tabview3.cxx:1744
void SelectAll(bool bContinue=false)
Definition: tabview2.cxx:1201
vcl::Window * GetWindowByPos(ScSplitPos ePos) const
Definition: tabview.hxx:382
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:1819
ScMarkData & GetMarkData()
Definition: viewdata.cxx:3146
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:2785
void SetRefEnd(SCCOL nNewX, SCROW nNewY, SCTAB nNewZ)
Definition: viewdata.cxx:4129
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:4119
bool IsRefMode() const
Definition: viewdata.hxx:530
void SetRefStart(SCCOL nNewX, SCROW nNewY, SCTAB nNewZ)
Definition: viewdata.cxx:4124
SfxHintId GetId() const
tools::Rectangle GetWindowExtentsAbsolute() const
bool HasFocus() const
tools::Rectangle GetWindowExtentsRelative(const vcl::Window &rRelativeWindow) const
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
int nCount
float y
float x
@ URM_INSDEL
Definition: global.hxx:302
sal_Int32 nIndex
#define SAL_WARN(area, stream)
RttiCompleteObjectLocator col
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:247
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