LibreOffice Module sc (master)  1
tabview2.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <scitems.hxx>
21 #include <vcl/svapp.hxx>
22 #include <vcl/weld.hxx>
23 #include <sfx2/bindings.hxx>
24 
25 #include <attrib.hxx>
26 #include <pagedata.hxx>
27 #include <tabview.hxx>
28 #include <tabvwsh.hxx>
29 #include <printfun.hxx>
30 #include <stlpool.hxx>
31 #include <docsh.hxx>
32 #include <gridwin.hxx>
33 #include <sc.hrc>
34 #include <viewutil.hxx>
35 #include <colrowba.hxx>
36 #include <globstr.hrc>
37 #include <scresid.hxx>
38 #include <scmod.hxx>
39 #include <tabprotection.hxx>
40 #include <markdata.hxx>
41 #include <inputopt.hxx>
42 #include <comphelper/lok.hxx>
43 
44 namespace {
45 
46 bool isCellQualified(const ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, bool bSelectLocked, bool bSelectUnlocked)
47 {
48  bool bCellProtected = pDoc->HasAttrib(
49  nCol, nRow, nTab, nCol, nRow, nTab, HasAttrFlags::Protected);
50 
51  if (bCellProtected && !bSelectLocked)
52  return false;
53 
54  if (!bCellProtected && !bSelectUnlocked)
55  return false;
56 
57  return true;
58 }
59 
60 void moveCursorByProtRule(
61  SCCOL& rCol, SCROW& rRow, SCCOL nMovX, SCROW nMovY, SCTAB nTab, const ScDocument* pDoc)
62 {
63  bool bSelectLocked = true;
64  bool bSelectUnlocked = true;
65  ScTableProtection* pTabProtection = pDoc->GetTabProtection(nTab);
66  if (pTabProtection && pTabProtection->isProtected())
67  {
68  bSelectLocked = pTabProtection->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS);
69  bSelectUnlocked = pTabProtection->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS);
70  }
71 
72  if (nMovX > 0)
73  {
74  for (SCCOL i = 0; i < nMovX && rCol < pDoc->MaxCol(); ++i)
75  {
76  SCCOL nNewUnhiddenCol = rCol + 1;
77  SCCOL nEndCol = 0;
78  while(pDoc->ColHidden(nNewUnhiddenCol, nTab, nullptr, &nEndCol))
79  {
80  if(nNewUnhiddenCol >= pDoc->MaxCol())
81  return;
82 
83  i += nEndCol - nNewUnhiddenCol + 1;
84  nNewUnhiddenCol = nEndCol +1;
85  }
86 
87  if (!isCellQualified(pDoc, nNewUnhiddenCol, rRow, nTab, bSelectLocked, bSelectUnlocked))
88  break;
89  rCol = nNewUnhiddenCol;
90  }
91  }
92  else if (nMovX < 0)
93  {
94  for (SCCOL i = 0; i > nMovX && rCol > 0; --i)
95  {
96  SCCOL nNewUnhiddenCol = rCol - 1;
97  SCCOL nStartCol = 0;
98  while(pDoc->ColHidden(nNewUnhiddenCol, nTab, &nStartCol))
99  {
100  if(nNewUnhiddenCol <= 0)
101  return;
102 
103  i -= nNewUnhiddenCol - nStartCol + 1;
104  nNewUnhiddenCol = nStartCol - 1;
105  }
106 
107  if (!isCellQualified(pDoc, nNewUnhiddenCol, rRow, nTab, bSelectLocked, bSelectUnlocked))
108  break;
109  rCol = nNewUnhiddenCol;
110  }
111  }
112 
113  if (nMovY > 0)
114  {
115  for (SCROW i = 0; i < nMovY && rRow < pDoc->MaxRow(); ++i)
116  {
117  SCROW nNewUnhiddenRow = rRow + 1;
118  SCROW nEndRow = 0;
119  while(pDoc->RowHidden(nNewUnhiddenRow, nTab, nullptr, &nEndRow))
120  {
121  if(nNewUnhiddenRow >= pDoc->MaxRow())
122  return;
123 
124  i += nEndRow - nNewUnhiddenRow + 1;
125  nNewUnhiddenRow = nEndRow + 1;
126  }
127 
128  if (!isCellQualified(pDoc, rCol, nNewUnhiddenRow, nTab, bSelectLocked, bSelectUnlocked))
129  break;
130  rRow = nNewUnhiddenRow;
131  }
132  }
133  else if (nMovY < 0)
134  {
135  for (SCROW i = 0; i > nMovY && rRow > 0; --i)
136  {
137  SCROW nNewUnhiddenRow = rRow - 1;
138  SCROW nStartRow = 0;
139  while(pDoc->RowHidden(nNewUnhiddenRow, nTab, &nStartRow))
140  {
141  if(nNewUnhiddenRow <= 0)
142  return;
143 
144  i -= nNewUnhiddenRow - nStartRow + 1;
145  nNewUnhiddenRow = nStartRow - 1;
146  }
147 
148  if (!isCellQualified(pDoc, rCol, nNewUnhiddenRow, nTab, bSelectLocked, bSelectUnlocked))
149  break;
150  rRow = nNewUnhiddenRow;
151  }
152  }
153 }
154 
155 bool checkBoundary(const ScDocument* pDoc, SCCOL& rCol, SCROW& rRow)
156 {
157  bool bGood = true;
158  if (rCol < 0)
159  {
160  rCol = 0;
161  bGood = false;
162  }
163  else if (rCol > pDoc->MaxCol())
164  {
165  rCol = pDoc->MaxCol();
166  bGood = false;
167  }
168 
169  if (rRow < 0)
170  {
171  rRow = 0;
172  bGood = false;
173  }
174  else if (rRow > pDoc->MaxRow())
175  {
176  rRow = pDoc->MaxRow();
177  bGood = false;
178  }
179  return bGood;
180 }
181 
182 void moveCursorByMergedCell(
183  SCCOL& rCol, SCROW& rRow, SCCOL nMovX, SCROW nMovY, SCTAB nTab,
184  const ScDocument* pDoc, const ScViewData& rViewData)
185 {
186  SCCOL nOrigX = rViewData.GetCurX();
187  SCROW nOrigY = rViewData.GetCurY();
188 
189  ScTableProtection* pTabProtection = pDoc->GetTabProtection(nTab);
190  bool bSelectLocked = true;
191  bool bSelectUnlocked = true;
192  if (pTabProtection && pTabProtection->isProtected())
193  {
194  bSelectLocked = pTabProtection->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS);
195  bSelectUnlocked = pTabProtection->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS);
196  }
197 
198  const ScMergeAttr* pMergeAttr = pDoc->GetAttr(nOrigX, nOrigY, nTab, ATTR_MERGE);
199 
200  bool bOriginMerged = false;
201  SCCOL nColSpan = 1;
202  SCROW nRowSpan = 1;
203  if (pMergeAttr && pMergeAttr->IsMerged())
204  {
205  nColSpan = pMergeAttr->GetColMerge();
206  nRowSpan = pMergeAttr->GetRowMerge();
207  bOriginMerged = true;
208  }
209 
210  if (nMovX > 0)
211  {
212  SCCOL nOld = rCol;
213  if (bOriginMerged)
214  {
215  // Original cell is merged. Push the block end outside the merged region.
216  if (nOrigX < pDoc->MaxCol() && nOrigX < rCol && rCol <= nOrigX + nColSpan - 1)
217  rCol = nOrigX + nColSpan;
218  }
219  else
220  {
221  pDoc->SkipOverlapped(rCol, rRow, nTab);
222  }
223 
224  if (nOld < rCol)
225  {
226  // The block end has moved. Check the protection setting and move back if needed.
227  checkBoundary(pDoc, rCol, rRow);
228  if (!isCellQualified(pDoc, rCol, rRow, nTab, bSelectLocked, bSelectUnlocked))
229  --rCol;
230  }
231  }
232  if (nMovX < 0)
233  {
234  SCCOL nOld = rCol;
235  if (bOriginMerged)
236  {
237  if (nOrigX > 0 && nOrigX <= rCol && rCol < nOrigX + nColSpan - 1)
238  // Block end is still within the merged region. Push it outside.
239  rCol = nOrigX - 1;
240  }
241  else
242  {
243  pDoc->SkipOverlapped(rCol, rRow, nTab);
244  }
245 
246  if (nOld > rCol)
247  {
248  // The block end has moved. Check the protection setting and move back if needed.
249  checkBoundary(pDoc, rCol, rRow);
250  if (!isCellQualified(pDoc, rCol, rRow, nTab, bSelectLocked, bSelectUnlocked))
251  ++rCol;
252  }
253  }
254  if (nMovY > 0)
255  {
256  SCROW nOld = rRow;
257  if (bOriginMerged)
258  {
259  // Original cell is merged. Push the block end outside the merged region.
260  if (nOrigY < pDoc->MaxRow() && nOrigY < rRow && rRow <= nOrigY + nRowSpan - 1)
261  rRow = nOrigY + nRowSpan;
262  }
263  else
264  {
265  pDoc->SkipOverlapped(rCol, rRow, nTab);
266  }
267 
268  if (nOld < rRow)
269  {
270  // The block end has moved. Check the protection setting and move back if needed.
271  checkBoundary(pDoc, rCol, rRow);
272  if (!isCellQualified(pDoc, rCol, rRow, nTab, bSelectLocked, bSelectUnlocked))
273  --rRow;
274  }
275  }
276  if (nMovY >= 0)
277  return;
278 
279  SCROW nOld = rRow;
280  if (bOriginMerged)
281  {
282  if (nOrigY > 0 && nOrigY <= rRow && rRow < nOrigY + nRowSpan - 1)
283  // Block end is still within the merged region. Push it outside.
284  rRow = nOrigY - 1;
285  }
286  else
287  {
288  pDoc->SkipOverlapped(rCol, rRow, nTab);
289  }
290 
291  if (nOld > rRow)
292  {
293  // The block end has moved. Check the protection setting and move back if needed.
294  checkBoundary(pDoc, rCol, rRow);
295  if (!isCellQualified(pDoc, rCol, rRow, nTab, bSelectLocked, bSelectUnlocked))
296  ++rRow;
297  }
298 }
299 
300 }
301 
302 void ScTabView::PaintMarks(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow )
303 {
304  auto pDoc = aViewData.GetDocument();
305  if (!pDoc->ValidCol(nStartCol)) nStartCol = pDoc->MaxCol();
306  if (!pDoc->ValidRow(nStartRow)) nStartRow = pDoc->MaxRow();
307  if (!pDoc->ValidCol(nEndCol)) nEndCol = pDoc->MaxCol();
308  if (!pDoc->ValidRow(nEndRow)) nEndRow = pDoc->MaxRow();
309 
310  bool bLeft = (nStartCol==0 && nEndCol==pDoc->MaxCol());
311  bool bTop = (nStartRow==0 && nEndRow==pDoc->MaxRow());
312 
313  if (bLeft)
314  PaintLeftArea( nStartRow, nEndRow );
315  if (bTop)
316  PaintTopArea( nStartCol, nEndCol );
317 
318  aViewData.GetDocument()->ExtendMerge( nStartCol, nStartRow, nEndCol, nEndRow,
319  aViewData.GetTabNo() );
320  PaintArea( nStartCol, nStartRow, nEndCol, nEndRow, ScUpdateMode::Marks );
321 }
322 
323 bool ScTabView::IsMarking( SCCOL nCol, SCROW nRow, SCTAB nTab ) const
324 {
325  return IsBlockMode()
326  && nBlockStartX == nCol
327  && nBlockStartY == nRow
328  && nBlockStartZ == nTab;
329 }
330 
332 {
333  if (IsBlockMode())
334  return;
335 
336  // when there is no (old) selection anymore, delete anchor in SelectionEngine:
337  ScMarkData& rMark = aViewData.GetMarkData();
338  if (!rMark.IsMarked() && !rMark.IsMultiMarked())
339  GetSelEngine()->CursorPosChanging( false, false );
340 
341  meBlockMode = Own;
342  nBlockStartX = 0;
343  nBlockStartY = 0;
344  nBlockStartZ = 0;
345  nBlockEndX = 0;
346  nBlockEndY = 0;
347  nBlockEndZ = 0;
348 
349  SelectionChanged(); // status is checked with mark set
350 }
351 
352 void ScTabView::InitBlockMode( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
353  bool bTestNeg, bool bCols, bool bRows, bool bForceNeg )
354 {
355  if (IsBlockMode())
356  return;
357 
358  auto pDoc = aViewData.GetDocument();
359  if (!pDoc->ValidCol(nCurX)) nCurX = pDoc->MaxCol();
360  if (!pDoc->ValidRow(nCurY)) nCurY = pDoc->MaxRow();
361 
362  ScMarkData& rMark = aViewData.GetMarkData();
363  SCTAB nTab = aViewData.GetTabNo();
364 
365  // unmark part?
366  if (bForceNeg)
367  bBlockNeg = true;
368  else if (bTestNeg)
369  {
370  if ( bCols )
371  bBlockNeg = rMark.IsColumnMarked( nCurX );
372  else if ( bRows )
373  bBlockNeg = rMark.IsRowMarked( nCurY );
374  else
375  bBlockNeg = rMark.IsCellMarked( nCurX, nCurY );
376  }
377  else
378  bBlockNeg = false;
379  rMark.SetMarkNegative(bBlockNeg);
380 
382  bBlockCols = bCols;
383  bBlockRows = bRows;
384  nBlockStartX = nBlockStartXOrig = nCurX;
385  nBlockStartY = nBlockStartYOrig = nCurY;
386  nBlockStartZ = nCurZ;
390 
391  if (bBlockCols)
392  {
394  nBlockEndY = pDoc->MaxRow();
395  }
396 
397  if (bBlockRows)
398  {
400  nBlockEndX = pDoc->MaxCol();
401  }
402 
404 
406 }
407 
408 void ScTabView::DoneBlockMode( bool bContinue )
409 {
410  // When switching between sheet and header SelectionEngine DeselectAll may be called,
411  // because the other engine does not have any anchor.
412  // bMoveIsShift prevents the selection to be canceled.
413 
414  if (!IsBlockMode() || bMoveIsShift)
415  return;
416 
417  ScMarkData& rMark = aViewData.GetMarkData();
418  bool bFlag = rMark.GetMarkingFlag();
419  rMark.SetMarking(false);
420 
421  if (bBlockNeg && !bContinue)
422  rMark.MarkToMulti();
423 
424  if (bContinue)
425  rMark.MarkToMulti();
426  else
427  {
428  // the sheet may be invalid at this point because DoneBlockMode from SetTabNo is
429  // called (for example, when the current sheet is closed from another View)
430  SCTAB nTab = aViewData.GetTabNo();
431  ScDocument* pDoc = aViewData.GetDocument();
432  if ( pDoc->HasTable(nTab) )
433  PaintBlock( true ); // true -> delete block
434  else
435  rMark.ResetMark();
436  }
437  meBlockMode = None;
438 
439  rMark.SetMarking(bFlag);
440  rMark.SetMarkNegative(false);
441 }
442 
444 {
445  return meBlockMode != None;
446 }
447 
448 void ScTabView::MarkCursor( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
449  bool bCols, bool bRows, bool bCellSelection )
450 {
451  ScDocument* pDocument = aViewData.GetDocument();
452  if (!pDocument->ValidCol(nCurX)) nCurX = pDocument->MaxCol();
453  if (!pDocument->ValidRow(nCurY)) nCurY = pDocument->MaxRow();
454 
455  if (!IsBlockMode())
456  {
457  OSL_FAIL( "MarkCursor not in BlockMode" );
458  InitBlockMode( nCurX, nCurY, nCurZ, false, bCols, bRows );
459  }
460 
461  if (bCols)
462  nCurY = pDocument->MaxRow();
463  if (bRows)
464  nCurX = pDocument->MaxCol();
465 
466  ScMarkData& rMark = aViewData.GetMarkData();
467  OSL_ENSURE(rMark.IsMarked() || rMark.IsMultiMarked(), "MarkCursor, !IsMarked()");
468  ScRange aMarkRange;
469  rMark.GetMarkArea(aMarkRange);
470  if (( aMarkRange.aStart.Col() != nBlockStartX && aMarkRange.aEnd.Col() != nBlockStartX ) ||
471  ( aMarkRange.aStart.Row() != nBlockStartY && aMarkRange.aEnd.Row() != nBlockStartY ) ||
472  ( meBlockMode == Own ))
473  {
474  // Mark has been changed
475  // (Eg MarkToSimple if by negative everything was erased, except for a rectangle)
476  // or after InitOwnBlockMode is further marked with shift-
477  bool bOldShift = bMoveIsShift;
478  bMoveIsShift = false; // really move
479  DoneBlockMode();
480  bMoveIsShift = bOldShift;
481 
482  InitBlockMode( aMarkRange.aStart.Col(), aMarkRange.aStart.Row(),
483  nBlockStartZ, rMark.IsMarkNegative(), bCols, bRows );
484  }
485 
486  if ( nCurX != nOldCurX || nCurY != nOldCurY )
487  {
488  // Current cursor has moved
489 
490  SCTAB nTab = nCurZ;
491 
492  if ( bCellSelection )
493  {
494  // Expand selection area accordingly when the current selection ends
495  // with a merged cell.
496  SCCOL nCurXOffset = 0;
497  SCCOL nBlockStartXOffset = 0;
498  SCROW nCurYOffset = 0;
499  SCROW nBlockStartYOffset = 0;
500  bool bBlockStartMerged = false;
501 
502  // The following block checks whether or not the "BlockStart" (anchor)
503  // cell is merged. If it's merged, it'll then move the position of the
504  // anchor cell to the corner that's diagonally opposite of the
505  // direction of a current selection area. For instance, if a current
506  // selection is moving in the upperleft direction, the anchor cell will
507  // move to the lower-right corner of the merged anchor cell, and so on.
508 
509  const ScMergeAttr* pMergeAttr =
510  pDocument->GetAttr( nBlockStartXOrig, nBlockStartYOrig, nTab, ATTR_MERGE );
511  if ( pMergeAttr->IsMerged() )
512  {
513  SCCOL nColSpan = pMergeAttr->GetColMerge();
514  SCROW nRowSpan = pMergeAttr->GetRowMerge();
515 
516  if ( nCurX < nBlockStartXOrig + nColSpan - 1 || nCurY < nBlockStartYOrig + nRowSpan - 1 )
517  {
518  nBlockStartX = nCurX >= nBlockStartXOrig ? nBlockStartXOrig : nBlockStartXOrig + nColSpan - 1;
519  nBlockStartY = nCurY >= nBlockStartYOrig ? nBlockStartYOrig : nBlockStartYOrig + nRowSpan - 1;
520  nCurXOffset = (nCurX >= nBlockStartXOrig && nCurX < nBlockStartXOrig + nColSpan - 1) ?
521  nBlockStartXOrig - nCurX + nColSpan - 1 : 0;
522  nCurYOffset = (nCurY >= nBlockStartYOrig && nCurY < nBlockStartYOrig + nRowSpan - 1) ?
523  nBlockStartYOrig - nCurY + nRowSpan - 1 : 0;
524  bBlockStartMerged = true;
525  }
526  }
527 
528  // The following block checks whether or not the current cell is
529  // merged. If it is, it'll then set the appropriate X & Y offset
530  // values (nCurXOffset & nCurYOffset) such that the selection area will
531  // grow by those specified offset amounts. Note that the values of
532  // nCurXOffset/nCurYOffset may also be specified in the previous code
533  // block, in which case whichever value is greater will take on.
534 
535  pMergeAttr = pDocument->GetAttr( nCurX, nCurY, nTab, ATTR_MERGE );
536  if ( pMergeAttr->IsMerged() )
537  {
538  SCCOL nColSpan = pMergeAttr->GetColMerge();
539  SCROW nRowSpan = pMergeAttr->GetRowMerge();
540 
541  if ( nBlockStartX < nCurX + nColSpan - 1 || nBlockStartY < nCurY + nRowSpan - 1 )
542  {
543  if ( nBlockStartX <= nCurX + nColSpan - 1 )
544  {
545  SCCOL nCurXOffsetTemp = (nCurX < nCurX + nColSpan - 1) ? nColSpan - 1 : 0;
546  nCurXOffset = std::max(nCurXOffset, nCurXOffsetTemp);
547  }
548  if ( nBlockStartY <= nCurY + nRowSpan - 1 )
549  {
550  SCROW nCurYOffsetTemp = (nCurY < nCurY + nRowSpan - 1) ? nRowSpan - 1 : 0;
551  nCurYOffset = std::max(nCurYOffset, nCurYOffsetTemp);
552  }
553  if ( ( nBlockStartX > nCurX || nBlockStartY > nCurY ) &&
554  ( nBlockStartX <= nCurX + nColSpan - 1 || nBlockStartY <= nCurY + nRowSpan - 1 ) )
555  {
556  nBlockStartXOffset = (nBlockStartX > nCurX && nBlockStartX <= nCurX + nColSpan - 1) ? nCurX - nBlockStartX : 0;
557  nBlockStartYOffset = (nBlockStartY > nCurY && nBlockStartY <= nCurY + nRowSpan - 1) ? nCurY - nBlockStartY : 0;
558  }
559  }
560  }
561  else
562  {
563  // The current cell is not merged. Move the anchor cell to its
564  // original position.
565  if ( !bBlockStartMerged )
566  {
569  }
570  }
571 
572  nBlockStartX = nBlockStartX + nBlockStartXOffset >= 0 ? nBlockStartX + nBlockStartXOffset : 0;
573  nBlockStartY = nBlockStartY + nBlockStartYOffset >= 0 ? nBlockStartY + nBlockStartYOffset : 0;
574  nBlockEndX = std::min<SCCOL>(nCurX + nCurXOffset, pDocument->MaxCol());
575  nBlockEndY = std::min(nCurY + nCurYOffset, pDocument->MaxRow());
576  }
577  else
578  {
579  nBlockEndX = nCurX;
580  nBlockEndY = nCurY;
581  }
582 
583  // Set new selection area
585 
588 
589  nOldCurX = nCurX;
590  nOldCurY = nCurY;
591 
593  }
594 
595  if ( !bCols && !bRows )
596  aHdrFunc.SetAnchorFlag( false );
597 }
598 
599 void ScTabView::GetPageMoveEndPosition(SCCOL nMovX, SCROW nMovY, SCCOL& rPageX, SCROW& rPageY)
600 {
601  SCCOL nCurX;
602  SCROW nCurY;
603  if (aViewData.IsRefMode())
604  {
605  nCurX = aViewData.GetRefEndX();
606  nCurY = aViewData.GetRefEndY();
607  }
608  else if (IsBlockMode())
609  {
610  // block end position.
611  nCurX = nBlockEndX;
612  nCurY = nBlockEndY;
613  }
614  else
615  {
616  // cursor position
617  nCurX = aViewData.GetCurX();
618  nCurY = aViewData.GetCurY();
619  }
620 
622  ScHSplitPos eWhichX = WhichH( eWhich );
623  ScVSplitPos eWhichY = WhichV( eWhich );
624 
625  sal_uInt16 nScrSizeY = SC_SIZE_NONE;
628  }
629 
630  SCCOL nPageX;
631  SCROW nPageY;
632  if (nMovX >= 0)
633  nPageX = aViewData.CellsAtX( nCurX, 1, eWhichX ) * nMovX;
634  else
635  nPageX = aViewData.CellsAtX( nCurX, -1, eWhichX ) * nMovX;
636 
637  if (nMovY >= 0)
638  nPageY = aViewData.CellsAtY( nCurY, 1, eWhichY, nScrSizeY ) * nMovY;
639  else
640  nPageY = aViewData.CellsAtY( nCurY, -1, eWhichY, nScrSizeY ) * nMovY;
641 
642  if (nMovX != 0 && nPageX == 0) nPageX = (nMovX>0) ? 1 : -1;
643  if (nMovY != 0 && nPageY == 0) nPageY = (nMovY>0) ? 1 : -1;
644 
645  rPageX = nPageX;
646  rPageY = nPageY;
647 }
648 
650  SCCOL& rAreaX, SCROW& rAreaY, ScFollowMode& rMode)
651 {
652  SCCOL nNewX = -1;
653  SCROW nNewY = -1;
654 
655  // current cursor position.
656  SCCOL nCurX = aViewData.GetCurX();
657  SCROW nCurY = aViewData.GetCurY();
658 
659  if (aViewData.IsRefMode())
660  {
661  nNewX = aViewData.GetRefEndX();
662  nNewY = aViewData.GetRefEndY();
663  nCurX = aViewData.GetRefStartX();
664  nCurY = aViewData.GetRefStartY();
665  }
666  else if (IsBlockMode())
667  {
668  // block end position.
669  nNewX = nBlockEndX;
670  nNewY = nBlockEndY;
671  }
672  else
673  {
674  nNewX = nCurX;
675  nNewY = nCurY;
676  }
677 
678  ScDocument* pDoc = aViewData.GetDocument();
679  SCTAB nTab = aViewData.GetTabNo();
680 
681  // FindAreaPos knows only -1 or 1 as direction
682  ScModule* pScModule = SC_MOD();
683  bool bLegacyCellSelection = pScModule->GetInputOptions().GetLegacyCellSelection();
684  SCCOL nVirtualX = bLegacyCellSelection ? nNewX : nCurX;
685  SCROW nVirtualY = bLegacyCellSelection ? nNewY : nCurY;
686 
687  SCCOLROW i;
688  if ( nMovX > 0 )
689  for ( i=0; i<nMovX; i++ )
690  pDoc->FindAreaPos( nNewX, nVirtualY, nTab, SC_MOVE_RIGHT );
691  if ( nMovX < 0 )
692  for ( i=0; i<-nMovX; i++ )
693  pDoc->FindAreaPos( nNewX, nVirtualY, nTab, SC_MOVE_LEFT );
694  if ( nMovY > 0 )
695  for ( i=0; i<nMovY; i++ )
696  pDoc->FindAreaPos( nVirtualX, nNewY, nTab, SC_MOVE_DOWN );
697  if ( nMovY < 0 )
698  for ( i=0; i<-nMovY; i++ )
699  pDoc->FindAreaPos( nVirtualX, nNewY, nTab, SC_MOVE_UP );
700 
701  if (eMode==SC_FOLLOW_JUMP) // bottom right do not show too much grey
702  {
703  if (nMovX != 0 && nNewX == pDoc->MaxCol())
704  eMode = SC_FOLLOW_LINE;
705  if (nMovY != 0 && nNewY == pDoc->MaxRow())
706  eMode = SC_FOLLOW_LINE;
707  }
708 
709  if (aViewData.IsRefMode())
710  {
711  rAreaX = nNewX - aViewData.GetRefEndX();
712  rAreaY = nNewY - aViewData.GetRefEndY();
713  }
714  else if (IsBlockMode())
715  {
716  rAreaX = nNewX - nBlockEndX;
717  rAreaY = nNewY - nBlockEndY;
718  }
719  else
720  {
721  rAreaX = nNewX - nCurX;
722  rAreaY = nNewY - nCurY;
723  }
724  rMode = eMode;
725 }
726 
727 void ScTabView::SkipCursorHorizontal(SCCOL& rCurX, SCROW& rCurY, SCCOL nOldX, SCCOL nMovX)
728 {
729  ScDocument* pDoc = aViewData.GetDocument();
730  SCTAB nTab = aViewData.GetTabNo();
731 
732  bool bSkipProtected = false, bSkipUnprotected = false;
733  ScTableProtection* pProtect = pDoc->GetTabProtection(nTab);
734  if (pProtect && pProtect->isProtected())
735  {
736  bSkipProtected = !pProtect->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS);
737  bSkipUnprotected = !pProtect->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS);
738  }
739 
740  bool bSkipCell = false;
741  bool bHFlip = false;
742  auto nMaxCol = pDoc->ClampToAllocatedColumns(nTab, pDoc->MaxCol());
743  do
744  {
745  bSkipCell = pDoc->ColHidden(rCurX, nTab) || pDoc->IsHorOverlapped(rCurX, rCurY, nTab);
746  if (bSkipProtected && !bSkipCell)
747  bSkipCell = pDoc->HasAttrib(rCurX, rCurY, nTab, rCurX, rCurY, nTab, HasAttrFlags::Protected);
748  if (bSkipUnprotected && !bSkipCell)
749  bSkipCell = !pDoc->HasAttrib(rCurX, rCurY, nTab, rCurX, rCurY, nTab, HasAttrFlags::Protected);
750 
751  if (bSkipCell)
752  {
753  if (rCurX <= 0 || rCurX >= nMaxCol)
754  {
755  if (bHFlip)
756  {
757  rCurX = nOldX;
758  bSkipCell = false;
759  }
760  else
761  {
762  nMovX = -nMovX;
763  if (nMovX > 0)
764  ++rCurX;
765  else
766  --rCurX;
767  bHFlip = true;
768  }
769  }
770  else
771  if (nMovX > 0)
772  ++rCurX;
773  else
774  --rCurX;
775  }
776  }
777  while (bSkipCell);
778 
779  if (pDoc->IsVerOverlapped(rCurX, rCurY, nTab))
780  {
781  aViewData.SetOldCursor(rCurX, rCurY);
782  while (pDoc->IsVerOverlapped(rCurX, rCurY, nTab))
783  --rCurY;
784  }
785 }
786 
787 void ScTabView::SkipCursorVertical(SCCOL& rCurX, SCROW& rCurY, SCROW nOldY, SCROW nMovY)
788 {
789  ScDocument* pDoc = aViewData.GetDocument();
790  SCTAB nTab = aViewData.GetTabNo();
791 
792  bool bSkipProtected = false, bSkipUnprotected = false;
793  ScTableProtection* pProtect = pDoc->GetTabProtection(nTab);
794  if (pProtect && pProtect->isProtected())
795  {
796  bSkipProtected = !pProtect->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS);
797  bSkipUnprotected = !pProtect->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS);
798  }
799 
800  bool bSkipCell = false;
801  bool bVFlip = false;
802  do
803  {
804  SCROW nLastRow = -1;
805  bSkipCell = pDoc->RowHidden(rCurY, nTab, nullptr, &nLastRow) || pDoc->IsVerOverlapped( rCurX, rCurY, nTab );
806  if (bSkipProtected && !bSkipCell)
807  bSkipCell = pDoc->HasAttrib(rCurX, rCurY, nTab, rCurX, rCurY, nTab, HasAttrFlags::Protected);
808  if (bSkipUnprotected && !bSkipCell)
809  bSkipCell = !pDoc->HasAttrib(rCurX, rCurY, nTab, rCurX, rCurY, nTab, HasAttrFlags::Protected);
810 
811  if (bSkipCell)
812  {
813  if (rCurY <= 0 || rCurY >= pDoc->MaxRow())
814  {
815  if (bVFlip)
816  {
817  rCurY = nOldY;
818  bSkipCell = false;
819  }
820  else
821  {
822  nMovY = -nMovY;
823  if (nMovY > 0)
824  ++rCurY;
825  else
826  --rCurY;
827  bVFlip = true;
828  }
829  }
830  else
831  if (nMovY > 0)
832  ++rCurY;
833  else
834  --rCurY;
835  }
836  }
837  while (bSkipCell);
838 
839  if (pDoc->IsHorOverlapped(rCurX, rCurY, nTab))
840  {
841  aViewData.SetOldCursor(rCurX, rCurY);
842  while (pDoc->IsHorOverlapped(rCurX, rCurY, nTab))
843  --rCurX;
844  }
845 }
846 
848 {
849  if (!nMovX && !nMovY)
850  // Nothing to do. Bail out.
851  return;
852 
853  ScTabViewShell* pViewShell = aViewData.GetViewShell();
854  bool bRefInputMode = pViewShell && pViewShell->IsRefInputMode();
855  if (bRefInputMode && !aViewData.IsRefMode())
856  // initialize formula reference mode if it hasn't already.
858 
859  ScDocument* pDoc = aViewData.GetDocument();
860 
861  if (aViewData.IsRefMode())
862  {
863  // formula reference mode
864 
865  SCCOL nNewX = aViewData.GetRefEndX();
866  SCROW nNewY = aViewData.GetRefEndY();
867  SCTAB nRefTab = aViewData.GetRefEndZ();
868 
869  bool bSelectLocked = true;
870  bool bSelectUnlocked = true;
871  ScTableProtection* pTabProtection = pDoc->GetTabProtection(nRefTab);
872  if (pTabProtection && pTabProtection->isProtected())
873  {
874  bSelectLocked = pTabProtection->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS);
875  bSelectUnlocked = pTabProtection->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS);
876  }
877 
878  moveCursorByProtRule(nNewX, nNewY, nMovX, nMovY, nRefTab, pDoc);
879  checkBoundary(pDoc, nNewX, nNewY);
880 
881  if (nMovX)
882  {
883  SCCOL nTempX = nNewX;
884  while (pDoc->IsHorOverlapped(nTempX, nNewY, nRefTab))
885  {
886  if (nMovX > 0)
887  ++nTempX;
888  else
889  --nTempX;
890  if (!checkBoundary(pDoc, nTempX, nNewY))
891  break;
892  }
893  if (isCellQualified(pDoc, nTempX, nNewY, nRefTab, bSelectLocked, bSelectUnlocked))
894  nNewX = nTempX;
895  }
896 
897  if (nMovY)
898  {
899  SCROW nTempY = nNewY;
900  while (pDoc->IsVerOverlapped(nNewX, nTempY, nRefTab))
901  {
902  if (nMovY > 0)
903  ++nTempY;
904  else
905  --nTempY;
906  if (!checkBoundary(pDoc, nNewX, nTempY))
907  break;
908  }
909  if (isCellQualified(pDoc, nNewX, nTempY, nRefTab, bSelectLocked, bSelectUnlocked))
910  nNewY = nTempY;
911  }
912 
913  pDoc->SkipOverlapped(nNewX, nNewY, nRefTab);
914  UpdateRef(nNewX, nNewY, nRefTab);
915  SCCOL nTargetCol = nNewX;
916  SCROW nTargetRow = nNewY;
917  if (((aViewData.GetRefStartX() == 0) || (aViewData.GetRefStartY() == 0)) &&
918  ((nNewX != pDoc->MaxCol()) || (nNewY != pDoc->MaxRow())))
919  {
920  // Row selection
921  if ((aViewData.GetRefStartX() == 0) && (nNewX == pDoc->MaxCol()))
922  nTargetCol = aViewData.GetCurX();
923  // Column selection
924  if ((aViewData.GetRefStartY() == 0) && (nNewY == pDoc->MaxRow()))
925  nTargetRow = aViewData.GetCurY();
926  }
927  AlignToCursor(nTargetCol, nTargetRow, eMode);
928  }
929  else
930  {
931  // normal selection mode
932 
933  SCTAB nTab = aViewData.GetTabNo();
934  SCCOL nOrigX = aViewData.GetCurX();
935  SCROW nOrigY = aViewData.GetCurY();
936 
937  // Note that the origin position *never* moves during selection.
938 
939  if (!IsBlockMode())
940  InitBlockMode(nOrigX, nOrigY, nTab, true);
941 
942  moveCursorByProtRule(nBlockEndX, nBlockEndY, nMovX, nMovY, nTab, pDoc);
943  checkBoundary(pDoc, nBlockEndX, nBlockEndY);
944  moveCursorByMergedCell(nBlockEndX, nBlockEndY, nMovX, nMovY, nTab, pDoc, aViewData);
945  checkBoundary(pDoc, nBlockEndX, nBlockEndY);
946 
947  MarkCursor(nBlockEndX, nBlockEndY, nTab, false, false, true);
948 
949  // Check if the entire row(s) or column(s) are selected.
950  ScSplitPos eActive = aViewData.GetActivePart();
951  bool bRowSelected = (nBlockStartX == 0 && nBlockEndX == pDoc->MaxCol());
952  bool bColSelected = (nBlockStartY == 0 && nBlockEndY == pDoc->MaxRow());
953  SCCOL nAlignX = bRowSelected ? aViewData.GetPosX(WhichH(eActive)) : nBlockEndX;
954  SCROW nAlignY = bColSelected ? aViewData.GetPosY(WhichV(eActive)) : nBlockEndY;
955  AlignToCursor(nAlignX, nAlignY, eMode);
956 
958  }
959 }
960 
962 {
963  SCCOL nPageX;
964  SCROW nPageY;
965  GetPageMoveEndPosition(nMovX, nMovY, nPageX, nPageY);
966  ExpandBlock(nPageX, nPageY, SC_FOLLOW_FIX);
967 }
968 
970 {
971  SCCOL nAreaX;
972  SCROW nAreaY;
974  GetAreaMoveEndPosition(nMovX, nMovY, SC_FOLLOW_JUMP, nAreaX, nAreaY, eMode);
975  ExpandBlock(nAreaX, nAreaY, eMode);
976 }
977 
979 {
980  for (VclPtr<ScGridWindow> & pWin : pGridWin)
981  if (pWin && pWin->IsVisible())
982  pWin->UpdateCopySourceOverlay();
983 }
984 
986 {
987  for (VclPtr<ScGridWindow> & pWin : pGridWin)
988  if ( pWin && pWin->IsVisible() )
989  pWin->UpdateSelectionOverlay();
990 }
991 
993 {
994  for (VclPtr<ScGridWindow> & pWin : pGridWin)
995  if ( pWin && pWin->IsVisible() )
996  pWin->UpdateShrinkOverlay();
997 }
998 
1000 {
1001  for (VclPtr<ScGridWindow> & pWin : pGridWin)
1002  if ( pWin && pWin->IsVisible() )
1003  pWin->UpdateAllOverlays();
1004 }
1005 
1009 
1010 void ScTabView::PaintBlock( bool bReset )
1011 {
1012  ScMarkData& rMark = aViewData.GetMarkData();
1013  SCTAB nTab = aViewData.GetTabNo();
1014  bool bMulti = rMark.IsMultiMarked();
1015  if (!(rMark.IsMarked() || bMulti))
1016  return;
1017 
1018  ScRange aMarkRange;
1019  HideAllCursors();
1020  if (bMulti)
1021  {
1022  bool bFlag = rMark.GetMarkingFlag();
1023  rMark.SetMarking(false);
1024  rMark.MarkToMulti();
1025  rMark.GetMultiMarkArea(aMarkRange);
1026  rMark.MarkToSimple();
1027  rMark.SetMarking(bFlag);
1028  }
1029  else
1030  rMark.GetMarkArea(aMarkRange);
1031 
1032  nBlockStartX = aMarkRange.aStart.Col();
1033  nBlockStartY = aMarkRange.aStart.Row();
1034  nBlockStartZ = aMarkRange.aStart.Tab();
1035  nBlockEndX = aMarkRange.aEnd.Col();
1036  nBlockEndY = aMarkRange.aEnd.Row();
1037  nBlockEndZ = aMarkRange.aEnd.Tab();
1038 
1039  bool bDidReset = false;
1040 
1041  if ( nTab>=nBlockStartZ && nTab<=nBlockEndZ )
1042  {
1043  if ( bReset )
1044  {
1045  // Inverting when deleting only on active View
1046  if ( aViewData.IsActive() )
1047  {
1048  rMark.ResetMark();
1050  bDidReset = true;
1051  }
1052  }
1053  else
1055  }
1056 
1057  if ( bReset && !bDidReset )
1058  rMark.ResetMark();
1059 
1060  ShowAllCursors();
1061 }
1062 
1063 void ScTabView::SelectAll( bool bContinue )
1064 {
1065  ScDocument* pDoc = aViewData.GetDocument();
1066  ScMarkData& rMark = aViewData.GetMarkData();
1067  SCTAB nTab = aViewData.GetTabNo();
1068 
1069  if (rMark.IsMarked())
1070  {
1071  ScRange aMarkRange;
1072  rMark.GetMarkArea( aMarkRange );
1073  if ( aMarkRange == ScRange( 0,0,nTab, pDoc->MaxCol(),pDoc->MaxRow(),nTab ) )
1074  return;
1075  }
1076 
1077  DoneBlockMode( bContinue );
1078  InitBlockMode( 0,0,nTab );
1079  MarkCursor( pDoc->MaxCol(),pDoc->MaxRow(),nTab );
1080 
1081  SelectionChanged();
1082 }
1083 
1085 {
1086  ScDocument* pDoc = aViewData.GetDocument();
1087  ScMarkData& rMark = aViewData.GetMarkData();
1088  SCTAB nCount = pDoc->GetTableCount();
1089 
1090  if (nCount>1)
1091  {
1092  for (SCTAB i=0; i<nCount; i++)
1093  rMark.SelectTable( i, true );
1094 
1096  SfxBindings& rBind = aViewData.GetBindings();
1097  rBind.Invalidate( FID_FILL_TAB );
1098  rBind.Invalidate( FID_TAB_DESELECTALL );
1099  }
1100 }
1101 
1103 {
1104  ScDocument* pDoc = aViewData.GetDocument();
1105  ScMarkData& rMark = aViewData.GetMarkData();
1106  SCTAB nTab = aViewData.GetTabNo();
1107  SCTAB nCount = pDoc->GetTableCount();
1108 
1109  for (SCTAB i=0; i<nCount; i++)
1110  rMark.SelectTable( i, ( i == nTab ) );
1111 
1113  SfxBindings& rBind = aViewData.GetBindings();
1114  rBind.Invalidate( FID_FILL_TAB );
1115  rBind.Invalidate( FID_TAB_DESELECTALL );
1116 }
1117 
1118 static bool lcl_FitsInWindow( double fScaleX, double fScaleY, sal_uInt16 nZoom,
1119  long nWindowX, long nWindowY, const ScDocument* pDoc, SCTAB nTab,
1120  SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
1121  SCCOL nFixPosX, SCROW nFixPosY )
1122 {
1123  double fZoomFactor = static_cast<double>(Fraction(nZoom,100));
1124  fScaleX *= fZoomFactor;
1125  fScaleY *= fZoomFactor;
1126 
1127  long nBlockX = 0;
1128  SCCOL nCol;
1129  for (nCol=0; nCol<nFixPosX; nCol++)
1130  {
1131  // for frozen panes, add both parts
1132  sal_uInt16 nColTwips = pDoc->GetColWidth( nCol, nTab );
1133  if (nColTwips)
1134  {
1135  nBlockX += static_cast<long>(nColTwips * fScaleX);
1136  if (nBlockX > nWindowX)
1137  return false;
1138  }
1139  }
1140  for (nCol=nStartCol; nCol<=nEndCol; nCol++)
1141  {
1142  sal_uInt16 nColTwips = pDoc->GetColWidth( nCol, nTab );
1143  if (nColTwips)
1144  {
1145  nBlockX += static_cast<long>(nColTwips * fScaleX);
1146  if (nBlockX > nWindowX)
1147  return false;
1148  }
1149  }
1150 
1151  long nBlockY = 0;
1152  for (SCROW nRow = 0; nRow <= nFixPosY-1; ++nRow)
1153  {
1154  if (pDoc->RowHidden(nRow, nTab))
1155  continue;
1156 
1157  // for frozen panes, add both parts
1158  sal_uInt16 nRowTwips = pDoc->GetRowHeight(nRow, nTab);
1159  if (nRowTwips)
1160  {
1161  nBlockY += static_cast<long>(nRowTwips * fScaleY);
1162  if (nBlockY > nWindowY)
1163  return false;
1164  }
1165  }
1166  for (SCROW nRow = nStartRow; nRow <= nEndRow; ++nRow)
1167  {
1168  sal_uInt16 nRowTwips = pDoc->GetRowHeight(nRow, nTab);
1169  if (nRowTwips)
1170  {
1171  nBlockY += static_cast<long>(nRowTwips * fScaleY);
1172  if (nBlockY > nWindowY)
1173  return false;
1174  }
1175  }
1176 
1177  return true;
1178 }
1179 
1180 sal_uInt16 ScTabView::CalcZoom( SvxZoomType eType, sal_uInt16 nOldZoom )
1181 {
1182  sal_uInt16 nZoom = 100;
1183 
1184  switch ( eType )
1185  {
1186  case SvxZoomType::PERCENT: // rZoom is no particular percent value
1187  nZoom = nOldZoom;
1188  break;
1189 
1190  case SvxZoomType::OPTIMAL: // nZoom corresponds to the optimal size
1191  {
1192  ScMarkData& rMark = aViewData.GetMarkData();
1193  ScDocument* pDoc = aViewData.GetDocument();
1194 
1195  if (!rMark.IsMarked() && !rMark.IsMultiMarked())
1196  nZoom = 100; // nothing selected
1197  else
1198  {
1199  SCTAB nTab = aViewData.GetTabNo();
1200  ScRange aMarkRange;
1201  if ( aViewData.GetSimpleArea( aMarkRange ) != SC_MARK_SIMPLE )
1202  rMark.GetMultiMarkArea( aMarkRange );
1203 
1204  SCCOL nStartCol = aMarkRange.aStart.Col();
1205  SCROW nStartRow = aMarkRange.aStart.Row();
1206  SCTAB nStartTab = aMarkRange.aStart.Tab();
1207  SCCOL nEndCol = aMarkRange.aEnd.Col();
1208  SCROW nEndRow = aMarkRange.aEnd.Row();
1209  SCTAB nEndTab = aMarkRange.aEnd.Tab();
1210 
1211  if ( nTab < nStartTab && nTab > nEndTab )
1212  nTab = nStartTab;
1213 
1214  ScSplitPos eUsedPart = aViewData.GetActivePart();
1215 
1216  SCCOL nFixPosX = 0;
1217  SCROW nFixPosY = 0;
1219  {
1220  // use right part
1221  eUsedPart = (WhichV(eUsedPart)==SC_SPLIT_TOP) ? SC_SPLIT_TOPRIGHT : SC_SPLIT_BOTTOMRIGHT;
1222  nFixPosX = aViewData.GetFixPosX();
1223  if ( nStartCol < nFixPosX )
1224  nStartCol = nFixPosX;
1225  }
1227  {
1228  // use bottom part
1229  eUsedPart = (WhichH(eUsedPart)==SC_SPLIT_LEFT) ? SC_SPLIT_BOTTOMLEFT : SC_SPLIT_BOTTOMRIGHT;
1230  nFixPosY = aViewData.GetFixPosY();
1231  if ( nStartRow < nFixPosY )
1232  nStartRow = nFixPosY;
1233  }
1234 
1235  if (pGridWin[eUsedPart])
1236  {
1237  // Because scale is rounded to pixels, the only reliable way to find
1238  // the right scale is to check if a zoom fits
1239 
1240  Size aWinSize = pGridWin[eUsedPart]->GetOutputSizePixel();
1241 
1242  // for frozen panes, use sum of both parts for calculation
1243 
1244  if ( nFixPosX != 0 )
1245  aWinSize.AdjustWidth(GetGridWidth( SC_SPLIT_LEFT ) );
1246  if ( nFixPosY != 0 )
1247  aWinSize.AdjustHeight(GetGridHeight( SC_SPLIT_TOP ) );
1248 
1249  ScDocShell* pDocSh = aViewData.GetDocShell();
1250  double nPPTX = ScGlobal::nScreenPPTX / pDocSh->GetOutputFactor();
1251  double nPPTY = ScGlobal::nScreenPPTY;
1252 
1253  sal_uInt16 nMin = MINZOOM;
1254  sal_uInt16 nMax = MAXZOOM;
1255  while ( nMax > nMin )
1256  {
1257  sal_uInt16 nTest = (nMin+nMax+1)/2;
1258  if ( lcl_FitsInWindow(
1259  nPPTX, nPPTY, nTest, aWinSize.Width(), aWinSize.Height(),
1260  pDoc, nTab, nStartCol, nStartRow, nEndCol, nEndRow,
1261  nFixPosX, nFixPosY ) )
1262  nMin = nTest;
1263  else
1264  nMax = nTest-1;
1265  }
1266  OSL_ENSURE( nMin == nMax, "Nesting is wrong" );
1267  nZoom = nMin;
1268 
1269  if ( nZoom != nOldZoom )
1270  {
1271  // scroll to block only in active split part
1272  // (the part for which the size was calculated)
1273 
1274  if ( nStartCol <= nEndCol )
1275  aViewData.SetPosX( WhichH(eUsedPart), nStartCol );
1276  if ( nStartRow <= nEndRow )
1277  aViewData.SetPosY( WhichV(eUsedPart), nStartRow );
1278  }
1279  }
1280  }
1281  }
1282  break;
1283 
1284  case SvxZoomType::WHOLEPAGE: // nZoom corresponds to the whole page or
1285  case SvxZoomType::PAGEWIDTH: // nZoom corresponds to the page width
1286  {
1287  SCTAB nCurTab = aViewData.GetTabNo();
1288  ScDocument* pDoc = aViewData.GetDocument();
1289  ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool();
1290  SfxStyleSheetBase* pStyleSheet =
1291  pStylePool->Find( pDoc->GetPageStyle( nCurTab ),
1292  SfxStyleFamily::Page );
1293 
1294  OSL_ENSURE( pStyleSheet, "PageStyle not found :-/" );
1295 
1296  if ( pStyleSheet )
1297  {
1298  ScPrintFunc aPrintFunc( aViewData.GetDocShell(),
1300  nCurTab );
1301 
1302  Size aPageSize = aPrintFunc.GetDataSize();
1303 
1304  // use the size of the largest GridWin for normal split,
1305  // or both combined for frozen panes, with the (document) size
1306  // of the frozen part added to the page size
1307  // (with frozen panes, the size of the individual parts
1308  // depends on the scale that is to be calculated)
1309 
1311  return nZoom;
1312 
1313  Size aWinSize = pGridWin[SC_SPLIT_BOTTOMLEFT]->GetOutputSizePixel();
1314  ScSplitMode eHMode = aViewData.GetHSplitMode();
1315  if ( eHMode != SC_SPLIT_NONE && pGridWin[SC_SPLIT_BOTTOMRIGHT] )
1316  {
1317  long nOtherWidth = pGridWin[SC_SPLIT_BOTTOMRIGHT]->
1318  GetOutputSizePixel().Width();
1319  if ( eHMode == SC_SPLIT_FIX )
1320  {
1321  aWinSize.AdjustWidth(nOtherWidth );
1322  for ( SCCOL nCol = aViewData.GetPosX(SC_SPLIT_LEFT);
1323  nCol < aViewData.GetFixPosX(); nCol++ )
1324  aPageSize.AdjustWidth(pDoc->GetColWidth( nCol, nCurTab ) );
1325  }
1326  else if ( nOtherWidth > aWinSize.Width() )
1327  aWinSize.setWidth( nOtherWidth );
1328  }
1329  ScSplitMode eVMode = aViewData.GetVSplitMode();
1330  if ( eVMode != SC_SPLIT_NONE && pGridWin[SC_SPLIT_TOPLEFT] )
1331  {
1332  long nOtherHeight = pGridWin[SC_SPLIT_TOPLEFT]->
1333  GetOutputSizePixel().Height();
1334  if ( eVMode == SC_SPLIT_FIX )
1335  {
1336  aWinSize.AdjustHeight(nOtherHeight );
1337  aPageSize.AdjustHeight(pDoc->GetRowHeight(
1339  aViewData.GetFixPosY()-1, nCurTab) );
1340  }
1341  else if ( nOtherHeight > aWinSize.Height() )
1342  aWinSize.setHeight( nOtherHeight );
1343  }
1344 
1346  double nPPTY = ScGlobal::nScreenPPTY;
1347 
1348  long nZoomX = static_cast<long>( aWinSize.Width() * 100 /
1349  ( aPageSize.Width() * nPPTX ) );
1350  long nZoomY = static_cast<long>( aWinSize.Height() * 100 /
1351  ( aPageSize.Height() * nPPTY ) );
1352 
1353  if (nZoomX > 0)
1354  nZoom = static_cast<sal_uInt16>(nZoomX);
1355 
1356  if (eType == SvxZoomType::WHOLEPAGE && nZoomY > 0 && nZoomY < nZoom)
1357  nZoom = static_cast<sal_uInt16>(nZoomY);
1358  }
1359  }
1360  break;
1361 
1362  default:
1363  OSL_FAIL("Unknown Zoom-Revision");
1364  }
1365 
1366  return nZoom;
1367 }
1368 
1369 // is called for instance when the view window is shifted:
1370 
1372 {
1373  ScSplitPos eActive = aViewData.GetActivePart();
1374  if (pGridWin[eActive])
1375  pGridWin[eActive]->StopMarking();
1376 
1377  ScHSplitPos eH = WhichH(eActive);
1378  if (pColBar[eH])
1379  pColBar[eH]->StopMarking();
1380 
1381  ScVSplitPos eV = WhichV(eActive);
1382  if (pRowBar[eV])
1383  pRowBar[eV]->StopMarking();
1384 }
1385 
1387 {
1388  for (VclPtr<ScGridWindow> & pWin : pGridWin)
1389  if (pWin && pWin->IsVisible())
1390  pWin->HideNoteMarker();
1391 }
1392 
1394 {
1395  if (pDrawView)
1396  return;
1397 
1399 
1400  // pDrawView is set per Notify
1401  OSL_ENSURE(pDrawView,"ScTabView::MakeDrawLayer does not work");
1402 
1403  for(VclPtr<ScGridWindow> & pWin : pGridWin)
1404  {
1405  if(pWin)
1406  {
1407  pWin->DrawLayerCreated();
1408  }
1409  }
1410 }
1411 
1412 void ScTabView::ErrorMessage(const char* pGlobStrId)
1413 {
1414  if ( SC_MOD()->IsInExecuteDrop() )
1415  {
1416  // #i28468# don't show error message when called from Drag&Drop, silently abort instead
1417  return;
1418  }
1419 
1420  StopMarking(); // if called by Focus from MouseButtonDown
1421 
1422  weld::Window* pParent = aViewData.GetDialogParent();
1423  weld::WaitObject aWaitOff( pParent );
1424  bool bFocus = pParent && pParent->has_focus();
1425 
1426  if (pGlobStrId && strcmp(pGlobStrId, STR_PROTECTIONERR) == 0)
1427  {
1428  if (aViewData.GetDocShell()->IsReadOnly())
1429  {
1430  pGlobStrId = STR_READONLYERR;
1431  }
1432  }
1433 
1435  VclMessageType::Info, VclButtonsType::Ok,
1436  ScResId(pGlobStrId)));
1437  weld::Window* pGrabOnClose = bFocus ? pParent : nullptr;
1438  m_xMessageBox->runAsync(m_xMessageBox, [this, pGrabOnClose](sal_Int32 /*nResult*/) {
1439  m_xMessageBox.reset();
1440  if (pGrabOnClose)
1441  pGrabOnClose->grab_focus();
1442  });
1443 }
1444 
1445 void ScTabView::UpdatePageBreakData( bool bForcePaint )
1446 {
1447  std::unique_ptr<ScPageBreakData> pNewData;
1448 
1449  if (aViewData.IsPagebreakMode())
1450  {
1451  ScDocShell* pDocSh = aViewData.GetDocShell();
1452  ScDocument& rDoc = pDocSh->GetDocument();
1453  SCTAB nTab = aViewData.GetTabNo();
1454 
1455  sal_uInt16 nCount = rDoc.GetPrintRangeCount(nTab);
1456  if (!nCount)
1457  nCount = 1;
1458  pNewData.reset( new ScPageBreakData(nCount) );
1459 
1460  ScPrintFunc aPrintFunc( pDocSh, pDocSh->GetPrinter(), nTab, 0,0,nullptr, nullptr, pNewData.get() );
1461  // ScPrintFunc fills the PageBreakData in ctor
1462  if ( nCount > 1 )
1463  {
1464  aPrintFunc.ResetBreaks(nTab);
1465  pNewData->AddPages();
1466  }
1467 
1468  // print area changed?
1469  if ( bForcePaint || ( pPageBreakData && !( *pPageBreakData == *pNewData ) ) )
1470  PaintGrid();
1471  }
1472 
1473  pPageBreakData = std::move(pNewData);
1474 }
1475 
1476 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define MAXZOOM
Definition: global.hxx:76
ScMarkData & GetMarkData()
Definition: viewdata.cxx:3053
long Width() const
constexpr double nPPTY
SCCOL GetColMerge() const
Definition: attrib.hxx:69
void InitRefMode(SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, ScRefType eType)
Definition: tabview4.cxx:311
void SelectAll(bool bContinue=false)
Definition: tabview2.cxx:1063
void MarkToSimple()
Definition: markdata.cxx:237
ScDocShell * GetDocShell() const
Definition: viewdata.hxx:354
ScAddress aStart
Definition: address.hxx:500
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
Definition: markdata.hxx:43
std::array< VclPtr< ScRowBar >, 2 > pRowBar
Definition: tabview.hxx:145
SfxPrinter * GetPrinter(bool bCreateIfNotExist=true)
Definition: docsh3.cxx:450
SCROW GetRefEndY() const
Definition: viewdata.hxx:519
bool bBlockCols
Definition: tabview.hxx:213
ScVSplitPos WhichV(ScSplitPos ePos)
Definition: viewdata.hxx:714
SCROW Row() const
Definition: address.hxx:262
ScVSplitPos
Definition: viewdata.hxx:47
long AdjustWidth(long n)
void MarkToMulti()
Definition: markdata.cxx:224
long Height() const
long GetPageUpDownOffset() const
Definition: viewdata.hxx:557
sheet protection state container
bool bBlockRows
Definition: tabview.hxx:214
void ResetMark()
Definition: markdata.cxx:85
void SelectAllTables()
Definition: tabview2.cxx:1084
SCROW GetRefStartY() const
Definition: viewdata.hxx:516
void HideNoteMarker()
Definition: tabview2.cxx:1386
SCROW GetCurY() const
Definition: viewdata.hxx:402
ScHSplitPos WhichH(ScSplitPos ePos)
Definition: viewdata.hxx:708
void ResetBreaks(SCTAB nTab)
Definition: printfun.cxx:2978
SCTAB nBlockEndZ
Definition: tabview.hxx:192
double GetOutputFactor() const
Definition: docsh.hxx:352
ScFollowMode
Screen behavior related to cursor movements.
Definition: viewdata.hxx:53
double GetPPTX() const
Definition: viewdata.hxx:468
void PostPaintExtras()
Definition: docsh3.cxx:196
SCROW GetFixPosY() const
Definition: viewdata.hxx:421
SCTAB GetTabNo() const
Definition: viewdata.hxx:395
void PaintGrid()
Definition: tabview3.cxx:2614
ScAddress aEnd
Definition: address.hxx:501
ScSplitPos GetActivePart() const
Definition: viewdata.hxx:398
std::shared_ptr< weld::MessageDialog > m_xMessageBox
Definition: tabview.hxx:141
void UpdateAllOverlays()
Definition: tabview2.cxx:999
bool IsHorOverlapped(SCCOL nCol, SCROW nRow, SCTAB nTab) const
Definition: document.cxx:5732
void Invalidate(sal_uInt16 nId)
void CursorPosChanging(bool bShift, bool bMod1)
long AdjustHeight(long n)
SCCOL GetPosX(ScHSplitPos eWhich, SCTAB nForTab=-1) const
Definition: viewdata.cxx:1344
SC_DLLPUBLIC bool HasAttrib(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, HasAttrFlags nMask) const
Definition: document.cxx:5182
SCCOL CellsAtX(SCCOL nPosX, SCCOL nDir, ScHSplitPos eWhichX, sal_uInt16 nScrSizeY=SC_SIZE_NONE) const
Definition: viewdata.cxx:2549
constexpr TypedWhichId< ScMergeAttr > ATTR_MERGE(144)
SC_DLLPUBLIC sal_uInt16 GetRowHeight(SCROW nRow, SCTAB nTab, bool bHiddenAsZero=true) const
Definition: document.cxx:4164
ScSplitPos
Definition: viewdata.hxx:45
bool IsCellMarked(SCCOL nCol, SCROW nRow, bool bNoSimple=false) const
Definition: markdata.cxx:285
SCCOL nBlockStartXOrig
Definition: tabview.hxx:184
void GetMarkArea(ScRange &rRange) const
Definition: markdata.cxx:112
void DeselectAllTables()
Definition: tabview2.cxx:1102
void UpdateCopySourceOverlay()
Definition: tabview2.cxx:978
BlockMode meBlockMode
Definition: tabview.hxx:181
bool isOptionEnabled(Option eOption) const
void PaintLeftArea(SCROW nStartRow, SCROW nEndRow)
Definition: tabview3.cxx:2701
long GetGridWidth(ScHSplitPos eWhich)
Definition: tabview3.cxx:2971
SC_DLLPUBLIC SCROW MaxRow() const
Definition: document.hxx:873
std::array< VclPtr< ScGridWindow >, 4 > pGridWin
Definition: tabview.hxx:143
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
Definition: types.hxx:24
SC_DLLPUBLIC SCTAB GetTableCount() const
Definition: document.cxx:314
long GetGridHeight(ScVSplitPos eWhich)
Definition: tabview3.cxx:2982
void SetPosX(ScHSplitPos eWhich, SCCOL nNewPosX)
Definition: viewdata.cxx:2827
bool IsMultiMarked() const
Definition: markdata.hxx:83
SCROW nOldCurY
Definition: tabview.hxx:195
int nCount
void PaintBlock(bool bReset)
divide PaintBlock into two methods: RepaintBlock and RemoveBlock or similar
Definition: tabview2.cxx:1010
void UpdateShrinkOverlay()
Definition: tabview2.cxx:992
SC_DLLPUBLIC bool HasTable(SCTAB nTab) const
Definition: document.cxx:191
Mode eMode
void UpdateInputHandler(bool bForce=false, bool bStopEditing=true)
Definition: tabvwsha.cxx:632
SCTAB Tab() const
Definition: address.hxx:271
ScDocument * GetDocument() const
Definition: viewdata.cxx:859
void DoneBlockMode(bool bContinue=false)
Definition: tabview2.cxx:408
SCROW GetPosY(ScVSplitPos eWhich, SCTAB nForTab=-1) const
Definition: viewdata.cxx:1358
ScSplitMode GetHSplitMode() const
Definition: viewdata.hxx:416
bool IsBlockMode() const
Definition: tabview2.cxx:443
void SkipCursorVertical(SCCOL &rCurX, SCROW &rCurY, SCROW nOldY, SCROW nMovY)
Definition: tabview2.cxx:787
ScDrawLayer * MakeDrawLayer()
Definition: docsh2.cxx:166
SCCOL nBlockEndX
Definition: tabview.hxx:185
void SelectionChanged(bool bFromPaste=false)
Definition: tabview3.cxx:522
SC_DLLPUBLIC const SfxPoolItem * GetAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich) const
Definition: document.cxx:4717
bool IsRowMarked(SCROW nRow) const
Definition: markdata.cxx:318
void PaintArea(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, ScUpdateMode eMode=ScUpdateMode::All)
Definition: tabview3.cxx:2292
ScTabViewShell * GetViewShell() const
Definition: viewdata.hxx:357
constexpr double nPPTX
std::unique_ptr< ScPageBreakData > pPageBreakData
Definition: tabview.hxx:161
void ExpandBlock(SCCOL nMovX, SCROW nMovY, ScFollowMode eMode)
Definition: tabview2.cxx:847
void SetMarkArea(const ScRange &rRange)
Definition: markdata.cxx:97
SC_DLLPUBLIC SCCOL MaxCol() const
Definition: document.hxx:872
SCROW nBlockStartYOrig
Definition: tabview.hxx:188
SC_DLLPUBLIC bool ColHidden(SCCOL nCol, SCTAB nTab, SCCOL *pFirstCol=nullptr, SCCOL *pLastCol=nullptr) const
Definition: document.cxx:4448
SC_DLLPUBLIC sal_uInt16 GetPrintRangeCount(SCTAB nTab)
Definition: document.cxx:6274
bool IsMarked() const
Definition: markdata.hxx:82
SCTAB GetRefEndZ() const
Definition: viewdata.hxx:520
int i
bool IsColumnMarked(SCCOL nCol) const
Definition: markdata.cxx:302
SCTAB nBlockStartZ
Definition: tabview.hxx:191
static bool lcl_FitsInWindow(double fScaleX, double fScaleY, sal_uInt16 nZoom, long nWindowX, long nWindowY, const ScDocument *pDoc, SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCCOL nFixPosX, SCROW nFixPosY)
Definition: tabview2.cxx:1118
void SelectTable(SCTAB nTab, bool bNew)
Definition: markdata.cxx:172
SfxBindings & GetBindings()
Definition: viewdata.cxx:3041
sal_Int16 SCCOL
Definition: types.hxx:22
bool ValidCol(SCCOL nCol) const
Definition: document.hxx:875
bool GetLegacyCellSelection() const
Definition: inputopt.hxx:70
static SC_DLLPUBLIC double nScreenPPTY
Vertical pixel per twips factor.
Definition: global.hxx:579
virtual bool has_focus() const =0
#define SC_MOD()
Definition: scmod.hxx:253
void ExpandBlockArea(SCCOL nMovX, SCROW nMovY)
Definition: tabview2.cxx:969
SC_DLLPUBLIC SCCOL ClampToAllocatedColumns(SCTAB nTab, SCCOL nCol) const
Definition: documen3.cxx:2105
OUString ScResId(const char *pId)
Definition: scdll.cxx:95
ScMarkType GetSimpleArea(SCCOL &rStartCol, SCROW &rStartRow, SCTAB &rStartTab, SCCOL &rEndCol, SCROW &rEndRow, SCTAB &rEndTab) const
Definition: viewdata.cxx:1173
bool IsActive() const
Definition: viewdata.hxx:382
SC_DLLPUBLIC OUString GetPageStyle(SCTAB nTab) const
Definition: document.cxx:6189
#define SC_SIZE_NONE
Definition: viewdata.hxx:32
void InitOwnBlockMode()
Definition: tabview2.cxx:331
SCCOL nBlockStartX
Definition: tabview.hxx:183
sal_uInt16 CalcZoom(SvxZoomType eType, sal_uInt16 nOldZoom)
Definition: tabview2.cxx:1180
weld::Window * GetDialogParent()
Definition: viewdata.cxx:3063
SCCOL GetRefEndX() const
Definition: viewdata.hxx:518
void UpdateSelectionOverlay()
Definition: tabview2.cxx:985
SC_DLLPUBLIC bool ExtendMerge(SCCOL nStartCol, SCROW nStartRow, SCCOL &rEndCol, SCROW &rEndRow, SCTAB nTab, bool bRefresh=false)
Definition: document.cxx:5571
bool IsMarkNegative() const
Definition: markdata.hxx:102
virtual bool isProtected() const override
SCCOL Col() const
Definition: address.hxx:267
bool IsReadOnly() const
void SetAnchorFlag(bool bSet)
Definition: select.hxx:99
SCCOL GetRefStartX() const
Definition: viewdata.hxx:515
bool IsMerged() const
Definition: attrib.hxx:72
SCCOL GetFixPosX() const
Definition: viewdata.hxx:420
void PaintMarks(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow)
Definition: tabview2.cxx:302
ScHSplitPos
Definition: viewdata.hxx:46
void SkipOverlapped(SCCOL &rCol, SCROW &rRow, SCTAB nTab) const
Definition: document.cxx:5724
sal_Int32 SCROW
Definition: types.hxx:18
void MakeDrawLayer()
Definition: tabview2.cxx:1393
bool IsVerOverlapped(SCCOL nCol, SCROW nRow, SCTAB nTab) const
Definition: document.cxx:5744
bool ValidRow(SCROW nRow) const
Definition: document.hxx:876
void HideAllCursors()
Definition: tabview3.cxx:215
void ErrorMessage(const char *pGlobStrId)
Definition: tabview2.cxx:1412
void FindAreaPos(SCCOL &rCol, SCROW &rRow, SCTAB nTab, ScMoveDirection eDirection) const
Definition: document.cxx:6091
virtual void grab_focus()=0
ScHeaderFunctionSet aHdrFunc
Definition: tabview.hxx:129
void StopMarking()
Definition: tabview2.cxx:1371
bool bBlockNeg
Definition: tabview.hxx:212
bool GetMarkingFlag() const
Definition: markdata.hxx:104
void SetPosY(ScVSplitPos eWhich, SCROW nNewPosY)
Definition: viewdata.cxx:2866
SC_DLLPUBLIC const ScInputOptions & GetInputOptions()
Definition: scmod.cxx:780
static SC_DLLPUBLIC double nScreenPPTX
Horizontal pixel per twips factor.
Definition: global.hxx:577
const ScDocument & GetDocument() const
Definition: docsh.hxx:216
void GetPageMoveEndPosition(SCCOL nMovX, SCROW nMovY, SCCOL &rPageX, SCROW &rPageY)
Definition: tabview2.cxx:599
void GetAreaMoveEndPosition(SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, SCCOL &rAreaX, SCROW &rAreaY, ScFollowMode &rMode)
Definition: tabview2.cxx:649
ScViewSelectionEngine * GetSelEngine()
Definition: tabview.hxx:336
SC_DLLPUBLIC ScStyleSheetPool * GetStyleSheetPool() const
Definition: document.cxx:6069
std::array< VclPtr< ScColBar >, 2 > pColBar
Definition: tabview.hxx:144
void AlignToCursor(SCCOL nCurX, SCROW nCurY, ScFollowMode eMode, const ScSplitPos *pWhich=nullptr)
Definition: tabview3.cxx:904
void SetMarking(bool bFlag)
Definition: markdata.hxx:103
void SetMarkNegative(bool bFlag)
Definition: markdata.hxx:101
SC_DLLPUBLIC ScTableProtection * GetTabProtection(SCTAB nTab) const
Definition: documen3.cxx:1880
ScSplitMode
Definition: viewdata.hxx:43
SC_DLLPUBLIC bool RowHidden(SCROW nRow, SCTAB nTab, SCROW *pFirstRow=nullptr, SCROW *pLastRow=nullptr) const
Definition: document.cxx:4432
SCCOL nOldCurX
Definition: tabview.hxx:194
SCROW CellsAtY(SCROW nPosY, SCROW nDir, ScVSplitPos eWhichY, sal_uInt16 nScrSizeX=SC_SIZE_NONE) const
Definition: viewdata.cxx:2591
void SetOldCursor(SCCOL nNewX, SCROW nNewY)
Definition: viewdata.cxx:1332
#define MINZOOM
Definition: global.hxx:75
void SkipCursorHorizontal(SCCOL &rCurX, SCROW &rCurY, SCCOL nOldX, SCCOL nMovX)
Definition: tabview2.cxx:727
bool IsRefInputMode() const
Definition: tabvwsha.cxx:579
SCROW GetRowMerge() const
Definition: attrib.hxx:70
void GetMultiMarkArea(ScRange &rRange) const
Definition: markdata.cxx:117
ScViewData aViewData
Definition: tabview.hxx:123
virtual SfxPrinter * GetPrinter(bool bCreate=false) override
Definition: tabvwsh4.cxx:1028
SvxZoomType
void UpdateRef(SCCOL nCurX, SCROW nCurY, SCTAB nCurZ)
Definition: tabview4.cxx:188
std::unique_ptr< ScDrawView > pDrawView
Definition: tabview.hxx:131
void PaintTopArea(SCCOL nStartCol, SCCOL nEndCol)
Definition: tabview3.cxx:2645
SC_DLLPUBLIC sal_uInt16 GetColWidth(SCCOL nCol, SCTAB nTab, bool bHiddenAsZero=true) const
Definition: document.cxx:4123
bool IsPagebreakMode() const
Definition: viewdata.hxx:425
void MarkCursor(SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, bool bCols=false, bool bRows=false, bool bCellSelection=false)
Definition: tabview2.cxx:448
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
static long ToPixel(sal_uInt16 nTwips, double nFactor)
Definition: viewdata.hxx:686
SCROW nBlockStartY
Definition: tabview.hxx:187
void setWidth(long nWidth)
void ExpandBlockPage(SCCOL nMovX, SCROW nMovY)
Definition: tabview2.cxx:961
bool IsRefMode() const
Definition: viewdata.hxx:513
void UpdatePageBreakData(bool bForcePaint=false)
Definition: tabview2.cxx:1445
SCROW nBlockEndY
Definition: tabview.hxx:189
bool bMoveIsShift
Definition: tabview.hxx:208
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, bool bMobile=false)
ScSplitMode GetVSplitMode() const
Definition: viewdata.hxx:417
void InitBlockMode(SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, bool bTestNeg=false, bool bCols=false, bool bRows=false, bool bForceNeg=false)
Definition: tabview2.cxx:352
bool IsMarking(SCCOL nCol, SCROW nRow, SCTAB nTab) const
Definition: tabview2.cxx:323
sal_Int16 SCTAB
Definition: types.hxx:23
void ShowAllCursors()
Definition: tabview3.cxx:229
SCCOL GetCurX() const
Definition: viewdata.hxx:401
void setHeight(long nHeight)