LibreOffice Module sc (master) 1
tabview3.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 <rangelst.hxx>
21#include <scitems.hxx>
22
23#include <editeng/editview.hxx>
24#include <svx/fmshell.hxx>
26#include <svx/svdoole2.hxx>
27#include <sfx2/bindings.hxx>
28#include <sfx2/lokhelper.hxx>
29#include <sfx2/viewfrm.hxx>
30#include <vcl/cursor.hxx>
31#include <vcl/uitest/logger.hxx>
33#include <sal/log.hxx>
34#include <osl/diagnose.h>
35
36#include <IAnyRefDialog.hxx>
37#include <tabview.hxx>
38#include <tabvwsh.hxx>
39#include <docsh.hxx>
40#include <gridwin.hxx>
41#include <olinewin.hxx>
42#include <overlayobject.hxx>
43#include <colrowba.hxx>
44#include <tabcont.hxx>
45#include <scmod.hxx>
46#include <sc.hrc>
47#include <viewutil.hxx>
48#include <editutil.hxx>
49#include <inputhdl.hxx>
50#include <inputwin.hxx>
51#include <validat.hxx>
52#include <inputopt.hxx>
53#include <rfindlst.hxx>
54#include <hiranges.hxx>
55#include <viewuno.hxx>
56#include <dpobject.hxx>
57#include <seltrans.hxx>
58#include <fillinfo.hxx>
59#include <rangeutl.hxx>
60#include <client.hxx>
61#include <tabprotection.hxx>
62#include <spellcheckcontext.hxx>
63#include <markdata.hxx>
65#include <comphelper/lok.hxx>
66#include <LibreOfficeKit/LibreOfficeKitEnums.h>
67#include <output.hxx>
68
69#include <utility>
70
71#include <com/sun/star/chart2/data/HighlightedRange.hpp>
72
73namespace
74{
75
76ScRange lcl_getSubRangeByIndex( const ScRange& rRange, sal_Int32 nIndex )
77{
78 ScAddress aResult( rRange.aStart );
79
80 SCCOL nWidth = rRange.aEnd.Col() - rRange.aStart.Col() + 1;
81 SCROW nHeight = rRange.aEnd.Row() - rRange.aStart.Row() + 1;
82 SCTAB nDepth = rRange.aEnd.Tab() - rRange.aStart.Tab() + 1;
83 if( (nWidth > 0) && (nHeight > 0) && (nDepth > 0) )
84 {
85 // row by row from first to last sheet
86 sal_Int32 nArea = nWidth * nHeight;
87 aResult.IncCol( static_cast< SCCOL >( nIndex % nWidth ) );
88 aResult.IncRow( static_cast< SCROW >( (nIndex % nArea) / nWidth ) );
89 aResult.IncTab( static_cast< SCTAB >( nIndex / nArea ) );
90 if( !rRange.Contains( aResult ) )
91 aResult = rRange.aStart;
92 }
93
94 return ScRange( aResult );
95}
96
97} // anonymous namespace
98
99using namespace com::sun::star;
100
102{
103 DBG_ASSERT(nTotalWindows == 0, "ScExtraEditViewManager dtor: some out window has not yet been removed!");
104}
105
107{
108 Apply<Adder>(pViewShell, eWhich);
109}
110
112{
113 Apply<Remover>(pViewShell, eWhich);
114}
115
116
117template<ScExtraEditViewManager::ModifierTagType ModifierTag>
119{
120 ScTabViewShell* pOtherViewShell = dynamic_cast<ScTabViewShell*>(pViewShell);
121 if (pOtherViewShell == nullptr || pOtherViewShell == mpThisViewShell)
122 return;
123
124 mpOtherEditView = pOtherViewShell->GetViewData().GetEditView(eWhich);
125 if (mpOtherEditView != nullptr)
126 {
127 DBG_ASSERT(mpOtherEditView->GetEditEngine(), "Edit view has no valid engine.");
128 for (int i = 0; i < 4; ++i)
129 {
130 ScGridWindow* pWin = mpGridWin[i].get();
131 if (pWin != nullptr)
132 {
133 Modifier<ModifierTag>(pWin);
134 }
135 }
136 }
137}
138
139template<ScExtraEditViewManager::ModifierTagType ModifierTag>
141{
142 (void)this;
143 SAL_WARN("sc", "ScExtraEditViewManager::Modifier<ModifierTag>: non-specialized version should not be invoked.");
144}
145
146template<>
147void ScExtraEditViewManager::Modifier<ScExtraEditViewManager::Adder>(ScGridWindow* pWin)
148{
149 if (mpOtherEditView->AddOtherViewWindow(pWin))
150 ++nTotalWindows;
151}
152
153template<>
154void ScExtraEditViewManager::Modifier<ScExtraEditViewManager::Remover>(ScGridWindow* pWin)
155{
156 if (mpOtherEditView->RemoveOtherViewWindow(pWin))
157 --nTotalWindows;
158}
159
160// --- public functions
161
162void ScTabView::ClickCursor( SCCOL nPosX, SCROW nPosY, bool bControl )
163{
165 SCTAB nTab = aViewData.GetTabNo();
166 rDoc.SkipOverlapped(nPosX, nPosY, nTab);
167
168 bool bRefMode = SC_MOD()->IsFormulaMode();
169
170 if ( bRefMode )
171 {
172 DoneRefMode();
173
174 if (bControl)
175 SC_MOD()->AddRefEntry();
176
177 InitRefMode( nPosX, nPosY, nTab, SC_REFTYPE_REF );
178 }
179 else
180 {
181 DoneBlockMode( bControl );
183 SetCursor( nPosX, nPosY );
184 }
185}
186
187void ScTabView::UpdateAutoFillMark(bool bFromPaste)
188{
189 // single selection or cursor
190 ScRange aMarkRange;
191 ScMarkType eMarkType = aViewData.GetSimpleArea(aMarkRange);
192 bool bMarked = eMarkType == SC_MARK_SIMPLE || eMarkType == SC_MARK_SIMPLE_FILTERED;
193
194 for (sal_uInt16 i = 0; i < 4; i++)
195 {
196 if (pGridWin[i] && pGridWin[i]->IsVisible())
197 pGridWin[i]->UpdateAutoFillMark( bMarked, aMarkRange );
198 }
199
200 for (sal_uInt16 i = 0; i < 2; i++)
201 {
202 if (pColBar[i] && pColBar[i]->IsVisible())
203 pColBar[i]->SetMark( bMarked, aMarkRange.aStart.Col(), aMarkRange.aEnd.Col() );
204 if (pRowBar[i] && pRowBar[i]->IsVisible())
205 pRowBar[i]->SetMark( bMarked, aMarkRange.aStart.Row(), aMarkRange.aEnd.Row() );
206 }
207
208 // selection transfer object is checked together with AutoFill marks,
209 // because it has the same requirement of a single continuous block.
210 if (!bFromPaste)
211 CheckSelectionTransfer(); // update selection transfer object
212}
213
215{
216 if (pGridWin[eWhich])
217 pGridWin[eWhich]->FakeButtonUp();
218}
219
221{
222 for (VclPtr<ScGridWindow> & pWin : pGridWin)
223 {
224 if (pWin && pWin->IsVisible())
225 {
226 vcl::Cursor* pCur = pWin->GetCursor();
227 if (pCur && pCur->IsVisible())
228 pCur->Hide();
229 pWin->HideCursor();
230 }
231 }
232}
233
235{
236 for (VclPtr<ScGridWindow> & pWin : pGridWin)
237 {
238 if (pWin && pWin->IsVisible())
239 {
240 pWin->ShowCursor();
241 pWin->CursorChanged();
242 }
243 }
244}
245
247{
248 pGridWin[aViewData.GetActivePart()]->ShowCursor();
249 pGridWin[aViewData.GetActivePart()]->CursorChanged();
250}
251
253{
254 SfxBindings& rBindings = aViewData.GetBindings();
255
256 rBindings.Invalidate( SID_STYLE_APPLY );
257 rBindings.Invalidate( SID_STYLE_FAMILY2 );
258 rBindings.Invalidate( SID_STYLE_FAMILY3 );
259
260 rBindings.Invalidate( SID_ATTR_CHAR_FONT );
261 rBindings.Invalidate( SID_ATTR_CHAR_FONTHEIGHT );
262 rBindings.Invalidate( SID_ATTR_CHAR_COLOR );
263
264 rBindings.Invalidate( SID_ATTR_CHAR_WEIGHT );
265 rBindings.Invalidate( SID_ATTR_CHAR_POSTURE );
266 rBindings.Invalidate( SID_ATTR_CHAR_UNDERLINE );
267 rBindings.Invalidate( SID_ULINE_VAL_NONE );
268 rBindings.Invalidate( SID_ULINE_VAL_SINGLE );
269 rBindings.Invalidate( SID_ULINE_VAL_DOUBLE );
270 rBindings.Invalidate( SID_ULINE_VAL_DOTTED );
271
272 rBindings.Invalidate( SID_ATTR_CHAR_OVERLINE );
273
274 rBindings.Invalidate( SID_ATTR_CHAR_KERNING );
275 rBindings.Invalidate( SID_SET_SUPER_SCRIPT );
276 rBindings.Invalidate( SID_SET_SUB_SCRIPT );
277 rBindings.Invalidate( SID_ATTR_CHAR_STRIKEOUT );
278 rBindings.Invalidate( SID_ATTR_CHAR_SHADOWED );
279
280 rBindings.Invalidate( SID_ATTR_PARA_ADJUST_LEFT );
281 rBindings.Invalidate( SID_ATTR_PARA_ADJUST_RIGHT );
282 rBindings.Invalidate( SID_ATTR_PARA_ADJUST_BLOCK );
283 rBindings.Invalidate( SID_ATTR_PARA_ADJUST_CENTER);
284 rBindings.Invalidate( SID_NUMBER_TYPE_FORMAT);
285
286 rBindings.Invalidate( SID_ALIGNLEFT );
287 rBindings.Invalidate( SID_ALIGNRIGHT );
288 rBindings.Invalidate( SID_ALIGNBLOCK );
289 rBindings.Invalidate( SID_ALIGNCENTERHOR );
290
291 rBindings.Invalidate( SID_ALIGNTOP );
292 rBindings.Invalidate( SID_ALIGNBOTTOM );
293 rBindings.Invalidate( SID_ALIGNCENTERVER );
294
295 rBindings.Invalidate( SID_SCATTR_CELLPROTECTION );
296
297 // stuff for sidebar panels
298 {
299 rBindings.Invalidate( SID_H_ALIGNCELL );
300 rBindings.Invalidate( SID_V_ALIGNCELL );
301 rBindings.Invalidate( SID_ATTR_ALIGN_INDENT );
302 rBindings.Invalidate( SID_FRAME_LINECOLOR );
303 rBindings.Invalidate( SID_FRAME_LINESTYLE );
304 rBindings.Invalidate( SID_ATTR_BORDER_OUTER );
305 rBindings.Invalidate( SID_ATTR_BORDER_INNER );
306 rBindings.Invalidate( SID_ATTR_BORDER_DIAG_TLBR );
307 rBindings.Invalidate( SID_ATTR_BORDER_DIAG_BLTR );
308 rBindings.Invalidate( SID_NUMBER_TYPE_FORMAT );
309 }
310
311 rBindings.Invalidate( SID_BACKGROUND_COLOR );
312
313 rBindings.Invalidate( SID_ATTR_ALIGN_LINEBREAK );
314 rBindings.Invalidate( SID_NUMBER_FORMAT );
315
316 rBindings.Invalidate( SID_TEXTDIRECTION_LEFT_TO_RIGHT );
317 rBindings.Invalidate( SID_TEXTDIRECTION_TOP_TO_BOTTOM );
318 rBindings.Invalidate( SID_ATTR_PARA_LEFT_TO_RIGHT );
319 rBindings.Invalidate( SID_ATTR_PARA_RIGHT_TO_LEFT );
320
321 // pseudo slots for Format menu
322 rBindings.Invalidate( SID_ALIGN_ANY_HDEFAULT );
323 rBindings.Invalidate( SID_ALIGN_ANY_LEFT );
324 rBindings.Invalidate( SID_ALIGN_ANY_HCENTER );
325 rBindings.Invalidate( SID_ALIGN_ANY_RIGHT );
326 rBindings.Invalidate( SID_ALIGN_ANY_JUSTIFIED );
327 rBindings.Invalidate( SID_ALIGN_ANY_VDEFAULT );
328 rBindings.Invalidate( SID_ALIGN_ANY_TOP );
329 rBindings.Invalidate( SID_ALIGN_ANY_VCENTER );
330 rBindings.Invalidate( SID_ALIGN_ANY_BOTTOM );
331
332 rBindings.Invalidate( SID_NUMBER_CURRENCY );
333 rBindings.Invalidate( SID_NUMBER_SCIENTIFIC );
334 rBindings.Invalidate( SID_NUMBER_DATE );
335 rBindings.Invalidate( SID_NUMBER_CURRENCY );
336 rBindings.Invalidate( SID_NUMBER_PERCENT );
337 rBindings.Invalidate( SID_NUMBER_TWODEC );
338 rBindings.Invalidate( SID_NUMBER_TIME );
339 rBindings.Invalidate( SID_NUMBER_STANDARD );
340 rBindings.Invalidate( SID_NUMBER_THOUSANDS );
341}
342
343namespace {
344
345void collectUIInformation(std::map<OUString, OUString>&& aParameters)
346{
347 EventDescription aDescription;
348 aDescription.aID = "grid_window";
349 aDescription.aAction = "SELECT";
350 aDescription.aParameters = std::move(aParameters);
351 aDescription.aParent = "MainWindow";
352 aDescription.aKeyWord = "ScGridWinUIObject";
353
354 UITestLogger::getInstance().logEvent(aDescription);
355}
356
357}
358
359// SetCursor - Cursor, set, draw, update InputWin
360// or send reference
361// Optimising breaks the functionality
362
363void ScTabView::SetCursor( SCCOL nPosX, SCROW nPosY, bool bNew )
364{
365 SCCOL nOldX = aViewData.GetCurX();
366 SCROW nOldY = aViewData.GetCurY();
367
368 // DeactivateIP only for MarkListHasChanged
369
370 // FIXME: this is to limit the number of rows handled in the Online
371 // to 1000; this will be removed again when the performance
372 // bottlenecks are sorted out
374 nPosY = std::min(nPosY, MAXTILEDROW);
375
376 if ( !(nPosX != nOldX || nPosY != nOldY || bNew) )
377 return;
378
379 ScTabViewShell* pViewShell = aViewData.GetViewShell();
380 bool bRefMode = pViewShell && pViewShell->IsRefInputMode();
381 if ( aViewData.HasEditView( aViewData.GetActivePart() ) && !bRefMode ) // 23259 or so
382 {
384 }
385
387
388 aViewData.SetCurX( nPosX );
389 aViewData.SetCurY( nPosY );
390
392
394
395 OUString aCurrAddress = ScAddress(nPosX,nPosY,0).GetColRowString();
396 collectUIInformation({{"CELL", aCurrAddress}});
397
399 return;
400
401 if (nPosX <= aViewData.GetMaxTiledCol() - 10 && nPosY <= aViewData.GetMaxTiledRow() - 25)
402 return;
403
405 ScDocShell* pDocSh = aViewData.GetDocShell();
406 ScModelObj* pModelObj = pDocSh ? pDocSh->GetModel() : nullptr;
407 Size aOldSize(0, 0);
408 if (pModelObj)
409 aOldSize = pModelObj->getDocumentSize();
410
411 if (nPosX > aViewData.GetMaxTiledCol() - 10)
412 aViewData.SetMaxTiledCol(std::min<SCCOL>(std::max(nPosX, aViewData.GetMaxTiledCol()) + 10, rDoc.MaxCol()));
413
414 if (nPosY > aViewData.GetMaxTiledRow() - 25)
415 aViewData.SetMaxTiledRow(std::min<SCROW>(std::max(nPosY, aViewData.GetMaxTiledRow()) + 25, MAXTILEDROW));
416
417 Size aNewSize(0, 0);
418 if (pModelObj)
419 aNewSize = pModelObj->getDocumentSize();
420
421 if (!pDocSh)
422 return;
423
424 // New area extended to the right of the sheet after last column
425 // including overlapping area with aNewRowArea
426 tools::Rectangle aNewColArea(aOldSize.getWidth(), 0, aNewSize.getWidth(), aNewSize.getHeight());
427 // New area extended to the bottom of the sheet after last row
428 // excluding overlapping area with aNewColArea
429 tools::Rectangle aNewRowArea(0, aOldSize.getHeight(), aOldSize.getWidth(), aNewSize.getHeight());
430
431 // Only invalidate if spreadsheet extended to the right
432 if (aNewColArea.getOpenWidth())
433 {
435 }
436
437 // Only invalidate if spreadsheet extended to the bottom
438 if (aNewRowArea.getOpenHeight())
439 {
441 }
442
443 // Provide size in the payload, so clients don't have to
444 // call lok::Document::getDocumentSize().
446 ss << aNewSize.Width() << ", " << aNewSize.Height();
447 OString sSize = ss.str().c_str();
448 ScModelObj* pModel = comphelper::getFromUnoTunnel<ScModelObj>(aViewData.GetViewShell()->GetCurrentDocument());
450}
451
452static bool lcl_IsRefDlgActive(SfxViewFrame& rViewFrm)
453{
454 ScModule* pScMod = SC_MOD();
455 if (!pScMod->IsRefDialogOpen())
456 return false;
457
458 auto nDlgId = pScMod->GetCurRefDlgId();
459 if (!rViewFrm.HasChildWindow(nDlgId))
460 return false;
461
462 SfxChildWindow* pChild = rViewFrm.GetChildWindow(nDlgId);
463 if (!pChild)
464 return false;
465
466 auto xDlgController = pChild->GetController();
467 if (!xDlgController || !xDlgController->getDialog()->get_visible())
468 return false;
469
470 IAnyRefDialog* pRefDlg = dynamic_cast<IAnyRefDialog*>(xDlgController.get());
471 return pRefDlg && pRefDlg->IsRefInputMode();
472}
473
475{
476 if ( !aViewData.IsActive() ) // only for active view
477 return;
478
479 ScModule* pScMod = SC_MOD();
482 if ( !pNew )
483 return;
484
485 // create new selection
486
487 if (pOld)
488 pOld->ForgetView();
489
490 pScMod->SetSelectionTransfer( pNew.get() );
491
492 // tdf#124975/tdf#136242 changing the calc selection can trigger removal of the
493 // selection of an open RefDlg dialog, so don't inform the
494 // desktop clipboard of the changed selection if that dialog is open
496 pNew->CopyToPrimarySelection(); // may delete pOld
497
498 // Log the selection change
500 if (rMark.IsMarked())
501 {
502 const ScRange& aMarkRange = rMark.GetMarkArea();
503 OUString aStartAddress = aMarkRange.aStart.GetColRowString();
504 OUString aEndAddress = aMarkRange.aEnd.GetColRowString();
505 collectUIInformation({{"RANGE", aStartAddress + ":" + aEndAddress}});
506 }
507}
508
509// update input row / menus
510// CursorPosChanged calls SelectionChanged
511// SelectionChanged calls CellContentChanged
512
514{
515 SfxBindings& rBindings = aViewData.GetBindings();
516
517 rBindings.Invalidate( SID_ATTR_SIZE ); // -> show error message
518 rBindings.Invalidate( SID_THESAURUS );
519 rBindings.Invalidate( SID_HYPERLINK_GETLINK );
520 rBindings.Invalidate( SID_ROWCOL_SELCOUNT );
521
522 InvalidateAttribs(); // attributes updates
523
525}
526
527void ScTabView::SetTabProtectionSymbol( SCTAB nTab, const bool bProtect )
528{
529 pTabControl->SetProtectionSymbol( static_cast<sal_uInt16>(nTab)+1, bProtect);
530}
531
532void ScTabView::SelectionChanged(bool bFromPaste)
533{
535 uno::Reference<frame::XController> xController = rViewFrame.GetFrame().GetController();
536 if (xController.is())
537 {
538 ScTabViewObj* pImp = dynamic_cast<ScTabViewObj*>( xController.get() );
539 if (pImp)
540 pImp->SelectionChanged();
541 }
542
543 UpdateAutoFillMark(bFromPaste); // also calls CheckSelectionTransfer
544
545 SfxBindings& rBindings = aViewData.GetBindings();
546
547 rBindings.Invalidate( SID_CURRENTCELL ); // -> Navigator
548 rBindings.Invalidate( SID_AUTO_FILTER ); // -> Menu
549 rBindings.Invalidate( FID_NOTE_VISIBLE );
550 rBindings.Invalidate( FID_SHOW_NOTE );
551 rBindings.Invalidate( FID_HIDE_NOTE );
552 rBindings.Invalidate( FID_SHOW_ALL_NOTES );
553 rBindings.Invalidate( FID_HIDE_ALL_NOTES );
554 rBindings.Invalidate( SID_TOGGLE_NOTES );
555 rBindings.Invalidate( SID_DELETE_NOTE );
556 rBindings.Invalidate( SID_ROWCOL_SELCOUNT );
557
558 // functions than may need to be disabled
559
560 rBindings.Invalidate( FID_INS_ROWBRK );
561 rBindings.Invalidate( FID_INS_COLBRK );
562 rBindings.Invalidate( FID_DEL_ROWBRK );
563 rBindings.Invalidate( FID_DEL_COLBRK );
564 rBindings.Invalidate( FID_MERGE_ON );
565 rBindings.Invalidate( FID_MERGE_OFF );
566 rBindings.Invalidate( FID_MERGE_TOGGLE );
567 rBindings.Invalidate( SID_AUTOFILTER_HIDE );
568 rBindings.Invalidate( SID_UNFILTER );
569 rBindings.Invalidate( SID_REIMPORT_DATA );
570 rBindings.Invalidate( SID_REFRESH_DBAREA );
571 rBindings.Invalidate( SID_OUTLINE_SHOW );
572 rBindings.Invalidate( SID_OUTLINE_HIDE );
573 rBindings.Invalidate( SID_OUTLINE_REMOVE );
574 rBindings.Invalidate( FID_FILL_TO_BOTTOM );
575 rBindings.Invalidate( FID_FILL_TO_RIGHT );
576 rBindings.Invalidate( FID_FILL_TO_TOP );
577 rBindings.Invalidate( FID_FILL_TO_LEFT );
578 rBindings.Invalidate( FID_FILL_SERIES );
579 rBindings.Invalidate( SID_SCENARIOS );
580 rBindings.Invalidate( SID_AUTOFORMAT );
581 rBindings.Invalidate( SID_OPENDLG_TABOP );
582 rBindings.Invalidate( SID_DATA_SELECT );
583
584 rBindings.Invalidate( SID_CUT );
585 rBindings.Invalidate( SID_COPY );
586 rBindings.Invalidate( SID_PASTE );
587 rBindings.Invalidate( SID_PASTE_SPECIAL );
588 rBindings.Invalidate( SID_PASTE_UNFORMATTED );
589
590 rBindings.Invalidate( FID_INS_ROW );
591 rBindings.Invalidate( FID_INS_COLUMN );
592 rBindings.Invalidate( FID_INS_ROWS_BEFORE );
593 rBindings.Invalidate( FID_INS_COLUMNS_BEFORE );
594 rBindings.Invalidate( FID_INS_ROWS_AFTER );
595 rBindings.Invalidate( FID_INS_COLUMNS_AFTER );
596 rBindings.Invalidate( FID_INS_CELL );
597 rBindings.Invalidate( FID_INS_CELLSDOWN );
598 rBindings.Invalidate( FID_INS_CELLSRIGHT );
599
600 rBindings.Invalidate( FID_CHG_COMMENT );
601
602 // only due to protect cell:
603
604 rBindings.Invalidate( SID_CELL_FORMAT_RESET );
605 rBindings.Invalidate( SID_DELETE );
606 rBindings.Invalidate( SID_DELETE_CONTENTS );
607 rBindings.Invalidate( FID_DELETE_CELL );
608 rBindings.Invalidate( FID_CELL_FORMAT );
609 rBindings.Invalidate( SID_ENABLE_HYPHENATION );
610 rBindings.Invalidate( SID_INSERT_POSTIT );
611 rBindings.Invalidate( SID_CHARMAP );
612 rBindings.Invalidate( SID_OPENDLG_FUNCTION );
613 rBindings.Invalidate( FID_VALIDATION );
614 rBindings.Invalidate( SID_EXTERNAL_SOURCE );
615 rBindings.Invalidate( SID_TEXT_TO_COLUMNS );
616 rBindings.Invalidate( SID_SORT_ASCENDING );
617 rBindings.Invalidate( SID_SORT_DESCENDING );
618 rBindings.Invalidate( SID_SELECT_UNPROTECTED_CELLS );
619
621 aViewData.GetViewShell()->BroadcastAccessibility(SfxHint(SfxHintId::ScAccCursorChanged));
622
624}
625
627{
628 bool bRefMode = SC_MOD()->IsFormulaMode();
629 if ( !bRefMode ) // check that RefMode works when switching sheets
630 aViewData.GetDocShell()->Broadcast( SfxHint( SfxHintId::ScKillEditView ) );
631
632 // Broadcast, so that other Views of the document also switch
633
634 ScDocument& rDocument = aViewData.GetDocument();
635 bool bDataPilot = rDocument.HasDataPilotAtPosition(aViewData.GetCurPos());
636 aViewData.GetViewShell()->SetPivotShell(bDataPilot);
637
638 if (!bDataPilot)
639 {
640 bool bSparkline = rDocument.HasSparkline(aViewData.GetCurPos());
642 }
643
644 // UpdateInputHandler now in CellContentChanged
645
647
649}
650
651namespace {
652
653Point calcHintWindowPosition(
654 const Point& rCellPos, const Size& rCellSize, const Size& rFrameWndSize, const Size& rHintWndSize)
655{
656 const tools::Long nMargin = 20;
657
658 tools::Long nMLeft = rCellPos.X();
659 tools::Long nMRight = rFrameWndSize.Width() - rCellPos.X() - rCellSize.Width();
660 tools::Long nMTop = rCellPos.Y();
661 tools::Long nMBottom = rFrameWndSize.Height() - rCellPos.Y() - rCellSize.Height();
662
663 // First, see if we can fit the entire hint window in the visible region.
664
665 if (nMRight - nMargin >= rHintWndSize.Width())
666 {
667 // Right margin is wide enough.
668 if (rFrameWndSize.Height() >= rHintWndSize.Height())
669 {
670 // The frame has enough height. Take it.
671 Point aPos = rCellPos;
672 aPos.AdjustX(rCellSize.Width() + nMargin );
673 if (aPos.Y() + rHintWndSize.Height() > rFrameWndSize.Height())
674 {
675 // Push the hint window up a bit to make it fit.
676 aPos.setY( rFrameWndSize.Height() - rHintWndSize.Height() );
677 }
678 return aPos;
679 }
680 }
681
682 if (nMBottom - nMargin >= rHintWndSize.Height())
683 {
684 // Bottom margin is high enough.
685 if (rFrameWndSize.Width() >= rHintWndSize.Width())
686 {
687 // The frame has enough width. Take it.
688 Point aPos = rCellPos;
689 aPos.AdjustY(rCellSize.Height() + nMargin );
690 if (aPos.X() + rHintWndSize.Width() > rFrameWndSize.Width())
691 {
692 // Move the hint window to the left to make it fit.
693 aPos.setX( rFrameWndSize.Width() - rHintWndSize.Width() );
694 }
695 return aPos;
696 }
697 }
698
699 if (nMLeft - nMargin >= rHintWndSize.Width())
700 {
701 // Left margin is wide enough.
702 if (rFrameWndSize.Height() >= rHintWndSize.Height())
703 {
704 // The frame is high enough. Take it.
705 Point aPos = rCellPos;
706 aPos.AdjustX( -(rHintWndSize.Width() + nMargin) );
707 if (aPos.Y() + rHintWndSize.Height() > rFrameWndSize.Height())
708 {
709 // Push the hint window up a bit to make it fit.
710 aPos.setY( rFrameWndSize.Height() - rHintWndSize.Height() );
711 }
712 return aPos;
713 }
714 }
715
716 if (nMTop - nMargin >= rHintWndSize.Height())
717 {
718 // Top margin is high enough.
719 if (rFrameWndSize.Width() >= rHintWndSize.Width())
720 {
721 // The frame is wide enough. Take it.
722 Point aPos = rCellPos;
723 aPos.AdjustY( -(rHintWndSize.Height() + nMargin) );
724 if (aPos.X() + rHintWndSize.Width() > rFrameWndSize.Width())
725 {
726 // Move the hint window to the left to make it fit.
727 aPos.setX( rFrameWndSize.Width() - rHintWndSize.Width() );
728 }
729 return aPos;
730 }
731 }
732
733 // The popup doesn't fit in any direction in its entirety. Do our best.
734
735 if (nMRight - nMargin >= rHintWndSize.Width())
736 {
737 // Right margin is good enough.
738 Point aPos = rCellPos;
739 aPos.AdjustX(nMargin + rCellSize.Width() );
740 aPos.setY( 0 );
741 return aPos;
742 }
743
744 if (nMBottom - nMargin >= rHintWndSize.Height())
745 {
746 // Bottom margin is good enough.
747 Point aPos = rCellPos;
748 aPos.AdjustY(nMargin + rCellSize.Height() );
749 aPos.setX( 0 );
750 return aPos;
751 }
752
753 if (nMLeft - nMargin >= rHintWndSize.Width())
754 {
755 // Left margin is good enough.
756 Point aPos = rCellPos;
757 aPos.AdjustX( -(rHintWndSize.Width() + nMargin) );
758 aPos.setY( 0 );
759 return aPos;
760 }
761
762 if (nMTop - nMargin >= rHintWndSize.Height())
763 {
764 // Top margin is good enough.
765 Point aPos = rCellPos;
766 aPos.AdjustY( -(rHintWndSize.Height() + nMargin) );
767 aPos.setX( 0 );
768 return aPos;
769 }
770
771 // None of the above. Hopeless. At least try not to cover the current
772 // cell.
773 Point aPos = rCellPos;
774 aPos.AdjustX(rCellSize.Width() );
775 return aPos;
776}
777
778}
779
781{
782 // show input help window and list drop-down button for validity
783
784 mxInputHintOO.reset();
785
786 bool bListValButton = false;
787 ScAddress aListValPos;
788
790 const SfxUInt32Item* pItem = rDoc.GetAttr( aViewData.GetCurX(),
794 if ( pItem->GetValue() )
795 {
796 const ScValidationData* pData = rDoc.GetValidationEntry( pItem->GetValue() );
797 OSL_ENSURE(pData,"ValidationData not found");
798 OUString aTitle, aMessage;
799
800 if ( pData && pData->GetInput( aTitle, aMessage ) && !aMessage.isEmpty() )
801 {
803 ScGridWindow* pWin = pGridWin[eWhich].get();
804 SCCOL nCol = aViewData.GetCurX();
805 SCROW nRow = aViewData.GetCurY();
806 Point aPos = aViewData.GetScrPos( nCol, nRow, eWhich );
807 Size aWinSize = pWin->GetOutputSizePixel();
808 // cursor visible?
809 if ( nCol >= aViewData.GetPosX(WhichH(eWhich)) &&
810 nRow >= aViewData.GetPosY(WhichV(eWhich)) &&
811 aPos.X() < aWinSize.Width() && aPos.Y() < aWinSize.Height() )
812 {
813 const svtools::ColorConfig& rColorCfg = SC_MOD()->GetColorConfig();
814 Color aCommentColor = rColorCfg.GetColorValue(svtools::CALCNOTESBACKGROUND).nColor;
815 // create HintWindow, determines its size by itself
816 ScOverlayHint* pOverlay = new ScOverlayHint(aTitle, aMessage, aCommentColor, pFrameWin->GetFont());
817
819 mxInputHintOO->append(std::unique_ptr<sdr::overlay::OverlayObject>(pOverlay));
820
821 Size aHintWndSize = pOverlay->GetSizePixel();
822 tools::Long nCellSizeX = 0;
823 tools::Long nCellSizeY = 0;
824 aViewData.GetMergeSizePixel(nCol, nRow, nCellSizeX, nCellSizeY);
825
826 Point aHintPos = calcHintWindowPosition(
827 aPos, Size(nCellSizeX,nCellSizeY), aWinSize, aHintWndSize);
828
829 pOverlay->SetPos(pWin->PixelToLogic(aHintPos, pWin->GetDrawMapMode()), pWin->GetDrawMapMode());
830 for (VclPtr<ScGridWindow> & pWindow : pGridWin)
831 {
832 if (!pWindow)
833 continue;
834 if (!pWindow->IsVisible())
835 continue;
836 rtl::Reference<sdr::overlay::OverlayManager> xOverlayManager = pWindow->getOverlayManager();
837 if (!xOverlayManager.is())
838 continue;
839 if (pWindow == pWin)
840 {
841 xOverlayManager->add(*pOverlay);
842 pWindow->updateLOKInputHelp(aTitle, aMessage);
843 }
844 else
845 {
846 //tdf#92530 if the help tip doesn't fit into its allocated area in a split window
847 //scenario, then because here we place it into the other split windows as well the
848 //missing portions will be displayed in the other split windows to form an apparent
849 //single tip, albeit "under" the split lines
850 Point aOtherPos(pWindow->ScreenToOutputPixel(pWin->OutputToScreenPixel(aHintPos)));
851 std::unique_ptr<ScOverlayHint> pOtherOverlay(new ScOverlayHint(aTitle, aMessage, aCommentColor, pFrameWin->GetFont()));
852 Point aFooPos(pWindow->PixelToLogic(aOtherPos, pWindow->GetDrawMapMode()));
853 pOtherOverlay->SetPos(aFooPos, pWindow->GetDrawMapMode());
854 xOverlayManager->add(*pOtherOverlay);
855 mxInputHintOO->append(std::move(pOtherOverlay));
856 }
857 }
858 }
859 }
860
861 // list drop-down button
862 if ( pData && pData->HasSelectionList() )
863 {
864 aListValPos.Set( aViewData.GetCurX(), aViewData.GetCurY(), aViewData.GetTabNo() );
865 bListValButton = true;
866 }
867 }
868
869 for (VclPtr<ScGridWindow> const & pWin : pGridWin)
870 {
871 if (pWin && pWin->IsVisible())
872 pWin->UpdateListValPos(bListValButton, aListValPos);
873 }
874}
875
876bool ScTabView::HasHintWindow() const { return mxInputHintOO != nullptr; }
877
879{
880 mxInputHintOO.reset();
881}
882
883// find window that should not be over the cursor
885{
887
888 // search & replace
889 if (rViewFrm.HasChildWindow(SID_SEARCH_DLG))
890 {
891 SfxChildWindow* pChild = rViewFrm.GetChildWindow(SID_SEARCH_DLG);
892 if (pChild)
893 {
894 auto xDlgController = pChild->GetController();
895 if (xDlgController && xDlgController->getDialog()->get_visible())
896 return xDlgController->getDialog();
897 }
898 }
899
900 // apply changes
901 if ( rViewFrm.HasChildWindow(FID_CHG_ACCEPT) )
902 {
903 SfxChildWindow* pChild = rViewFrm.GetChildWindow(FID_CHG_ACCEPT);
904 if (pChild)
905 {
906 auto xDlgController = pChild->GetController();
907 if (xDlgController && xDlgController->getDialog()->get_visible())
908 return xDlgController->getDialog();
909 }
910 }
911
912 return nullptr;
913}
914
915 // adjust screen with respect to cursor position
916
918 const ScSplitPos* pWhich )
919{
920 // now switch active part here
921
923 ScHSplitPos eActiveX = WhichH(eActive);
924 ScVSplitPos eActiveY = WhichV(eActive);
925 bool bHFix = (aViewData.GetHSplitMode() == SC_SPLIT_FIX);
926 bool bVFix = (aViewData.GetVSplitMode() == SC_SPLIT_FIX);
927 if (bHFix && eActiveX == SC_SPLIT_LEFT && nCurX >= aViewData.GetFixPosX())
928 {
930 eActiveX = SC_SPLIT_RIGHT;
931 }
932 if (bVFix && eActiveY == SC_SPLIT_TOP && nCurY >= aViewData.GetFixPosY())
933 {
935 eActiveY = SC_SPLIT_BOTTOM;
936 }
937
938 // actual align
939
940 if ( eMode != SC_FOLLOW_NONE )
941 {
942 ScSplitPos eAlign;
943 if (pWhich)
944 eAlign = *pWhich;
945 else
946 eAlign = aViewData.GetActivePart();
947 ScHSplitPos eAlignX = WhichH(eAlign);
948 ScVSplitPos eAlignY = WhichV(eAlign);
949
950 SCCOL nDeltaX = aViewData.GetPosX(eAlignX);
951 SCROW nDeltaY = aViewData.GetPosY(eAlignY);
952 SCCOL nSizeX = aViewData.VisibleCellsX(eAlignX);
953 SCROW nSizeY = aViewData.VisibleCellsY(eAlignY);
954
955 tools::Long nCellSizeX;
956 tools::Long nCellSizeY;
957 if ( nCurX >= 0 && nCurY >= 0 )
958 aViewData.GetMergeSizePixel( nCurX, nCurY, nCellSizeX, nCellSizeY );
959 else
960 nCellSizeX = nCellSizeY = 0;
961 Size aScrSize = aViewData.GetScrSize();
962 tools::Long nSpaceX = ( aScrSize.Width() - nCellSizeX ) / 2;
963 tools::Long nSpaceY = ( aScrSize.Height() - nCellSizeY ) / 2;
964 // nSpaceY: desired start position of cell for FOLLOW_JUMP, modified if dialog interferes
965
966 bool bForceNew = false; // force new calculation of JUMP position (vertical only)
967
968 // VisibleCellsY == CellsAtY( GetPosY( eWhichY ), 1, eWhichY )
969
970 // when for instance a search dialog is open, don't put the cursor behind the dialog
971 // if possible, put the row with the cursor above or below the dialog
973
974 if ( eMode == SC_FOLLOW_JUMP )
975 {
977 if (pCare)
978 {
979 bool bLimit = false;
980 tools::Rectangle aDlgPixel;
981 Size aWinSize;
982 vcl::Window* pWin = GetActiveWin();
983 weld::Window* pFrame = pWin ? pWin->GetFrameWeld() : nullptr;
984 int x, y, width, height;
985 if (pFrame && pCare->get_extents_relative_to(*pFrame, x, y, width, height))
986 {
987 aDlgPixel = tools::Rectangle(Point(x, y), Size(width, height));
988 aWinSize = pWin->GetOutputSizePixel();
989 // dos the dialog cover the GridWin?
990 if ( aDlgPixel.Right() >= 0 && aDlgPixel.Left() < aWinSize.Width() )
991 {
992 if ( nCurX < nDeltaX || nCurX >= nDeltaX+nSizeX ||
993 nCurY < nDeltaY || nCurY >= nDeltaY+nSizeY )
994 bLimit = true; // scroll anyway
995 else
996 {
997 // cursor is on the screen
998 Point aStart = aViewData.GetScrPos( nCurX, nCurY, eAlign );
999 tools::Long nCSX, nCSY;
1000 aViewData.GetMergeSizePixel( nCurX, nCurY, nCSX, nCSY );
1001 tools::Rectangle aCursor( aStart, Size( nCSX, nCSY ) );
1002 if ( aCursor.Overlaps( aDlgPixel ) )
1003 bLimit = true; // cell is covered by the dialog
1004 }
1005 }
1006 }
1007
1008 if (bLimit)
1009 {
1010 bool bBottom = false;
1011 tools::Long nTopSpace = aDlgPixel.Top();
1012 tools::Long nBotSpace = aWinSize.Height() - aDlgPixel.Bottom();
1013 if ( nBotSpace > 0 && nBotSpace > nTopSpace )
1014 {
1015 tools::Long nDlgBot = aDlgPixel.Bottom();
1016 SCCOL nWPosX;
1017 SCROW nWPosY;
1018 aViewData.GetPosFromPixel( 0,nDlgBot, eAlign, nWPosX, nWPosY );
1019 ++nWPosY; // below the last affected cell
1020
1021 SCROW nDiff = nWPosY - nDeltaY;
1022 if ( nCurY >= nDiff ) // position can not be negative
1023 {
1024 nSpaceY = nDlgBot + ( nBotSpace - nCellSizeY ) / 2;
1025 bBottom = true;
1026 bForceNew = true;
1027 }
1028 }
1029 if ( !bBottom && nTopSpace > 0 )
1030 {
1031 nSpaceY = ( nTopSpace - nCellSizeY ) / 2;
1032 bForceNew = true;
1033 }
1034 }
1035 }
1036 }
1037
1038 SCCOL nNewDeltaX = nDeltaX;
1039 SCROW nNewDeltaY = nDeltaY;
1040 bool bDoLine = false;
1041
1042 switch (eMode)
1043 {
1044 case SC_FOLLOW_JUMP:
1045 if ( nCurX < nDeltaX || nCurX >= nDeltaX+nSizeX )
1046 {
1047 nNewDeltaX = nCurX - aViewData.CellsAtX( nCurX, -1, eAlignX, static_cast<sal_uInt16>(nSpaceX) );
1048 if (nNewDeltaX < 0)
1049 nNewDeltaX = 0;
1050 nSizeX = aViewData.CellsAtX( nNewDeltaX, 1, eAlignX );
1051 }
1052 if ( nCurY < nDeltaY || nCurY >= nDeltaY+nSizeY || bForceNew )
1053 {
1054 nNewDeltaY = nCurY - aViewData.CellsAtY( nCurY, -1, eAlignY, static_cast<sal_uInt16>(nSpaceY) );
1055 if (nNewDeltaY < 0)
1056 nNewDeltaY = 0;
1057 nSizeY = aViewData.CellsAtY( nNewDeltaY, 1, eAlignY );
1058 }
1059 bDoLine = true;
1060 break;
1061
1062 case SC_FOLLOW_LINE:
1063 bDoLine = true;
1064 break;
1065
1066 case SC_FOLLOW_FIX:
1067 if ( nCurX < nDeltaX || nCurX >= nDeltaX+nSizeX )
1068 {
1069 nNewDeltaX = nDeltaX + nCurX - aViewData.GetCurX();
1070 if (nNewDeltaX < 0)
1071 nNewDeltaX = 0;
1072 nSizeX = aViewData.CellsAtX( nNewDeltaX, 1, eAlignX );
1073 }
1074 if ( nCurY < nDeltaY || nCurY >= nDeltaY+nSizeY )
1075 {
1076 nNewDeltaY = nDeltaY + nCurY - aViewData.GetCurY();
1077 if (nNewDeltaY < 0)
1078 nNewDeltaY = 0;
1079 nSizeY = aViewData.CellsAtY( nNewDeltaY, 1, eAlignY );
1080 }
1081
1082 // like old version of SC_FOLLOW_JUMP:
1083
1084 if ( nCurX < nNewDeltaX || nCurX >= nNewDeltaX+nSizeX )
1085 {
1086 nNewDeltaX = nCurX - (nSizeX / 2);
1087 if (nNewDeltaX < 0)
1088 nNewDeltaX = 0;
1089 nSizeX = aViewData.CellsAtX( nNewDeltaX, 1, eAlignX );
1090 }
1091 if ( nCurY < nNewDeltaY || nCurY >= nNewDeltaY+nSizeY )
1092 {
1093 nNewDeltaY = nCurY - (nSizeY / 2);
1094 if (nNewDeltaY < 0)
1095 nNewDeltaY = 0;
1096 nSizeY = aViewData.CellsAtY( nNewDeltaY, 1, eAlignY );
1097 }
1098
1099 bDoLine = true;
1100 break;
1101
1102 case SC_FOLLOW_NONE:
1103 break;
1104 default:
1105 OSL_FAIL("Wrong cursor mode");
1106 break;
1107 }
1108
1110 if (bDoLine)
1111 {
1112 while ( nCurX >= nNewDeltaX+nSizeX )
1113 {
1114 nNewDeltaX = nCurX-nSizeX+1;
1115 SCTAB nTab = aViewData.GetTabNo();
1116 while ( nNewDeltaX < rDoc.MaxCol() && !rDoc.GetColWidth( nNewDeltaX, nTab ) )
1117 ++nNewDeltaX;
1118 nSizeX = aViewData.CellsAtX( nNewDeltaX, 1, eAlignX );
1119 }
1120 while ( nCurY >= nNewDeltaY+nSizeY )
1121 {
1122 nNewDeltaY = nCurY-nSizeY+1;
1123 SCTAB nTab = aViewData.GetTabNo();
1124 while ( nNewDeltaY < rDoc.MaxRow() && !rDoc.GetRowHeight( nNewDeltaY, nTab ) )
1125 ++nNewDeltaY;
1126 nSizeY = aViewData.CellsAtY( nNewDeltaY, 1, eAlignY );
1127 }
1128 if ( nCurX < nNewDeltaX )
1129 nNewDeltaX = nCurX;
1130 if ( nCurY < nNewDeltaY )
1131 nNewDeltaY = nCurY;
1132 }
1133
1134 if ( nNewDeltaX != nDeltaX )
1135 nSizeX = aViewData.CellsAtX( nNewDeltaX, 1, eAlignX );
1136 if (nNewDeltaX+nSizeX-1 > rDoc.MaxCol())
1137 nNewDeltaX = rDoc.MaxCol()-nSizeX+1;
1138 if (nNewDeltaX < 0)
1139 nNewDeltaX = 0;
1140
1141 if ( nNewDeltaY != nDeltaY )
1142 nSizeY = aViewData.CellsAtY( nNewDeltaY, 1, eAlignY );
1143 if (nNewDeltaY+nSizeY-1 > rDoc.MaxRow())
1144 nNewDeltaY = rDoc.MaxRow()-nSizeY+1;
1145 if (nNewDeltaY < 0)
1146 nNewDeltaY = 0;
1147
1148 if ( nNewDeltaX != nDeltaX )
1149 ScrollX( nNewDeltaX - nDeltaX, eAlignX );
1150 if ( nNewDeltaY != nDeltaY )
1151 ScrollY( nNewDeltaY - nDeltaY, eAlignY );
1152 }
1153
1154 // switch active part again
1155
1156 if (bHFix)
1157 if (eActiveX == SC_SPLIT_RIGHT && nCurX < aViewData.GetFixPosX())
1158 {
1160 eActiveX = SC_SPLIT_LEFT;
1161 }
1162 if (bVFix)
1163 if (eActiveY == SC_SPLIT_BOTTOM && nCurY < aViewData.GetFixPosY())
1164 {
1166 }
1167}
1168
1170{
1171 bool bRet = false;
1172
1173 // #i3875# *Hack*
1174 bool bMod1Locked = (aViewData.GetViewShell()->GetLockedModifiers() & KEY_MOD1) != 0;
1175 aViewData.SetSelCtrlMouseClick( rMEvt.IsMod1() || bMod1Locked );
1176
1177 if ( pSelEngine )
1178 {
1179 bMoveIsShift = rMEvt.IsShift();
1180 bRet = pSelEngine->SelMouseButtonDown( rMEvt );
1181 bMoveIsShift = false;
1182 }
1183
1184 aViewData.SetSelCtrlMouseClick( false ); // #i3875# *Hack*
1185
1186 return bRet;
1187}
1188
1189 // MoveCursor - with adjustment of the view section
1190
1192 bool bShift, bool bControl, bool bKeepOld, bool bKeepSel )
1193{
1194 if (!bKeepOld)
1196
1198 // #i123629#
1200 aViewData.GetViewShell()->SetForceFocusOnCurCell( !rDoc.ValidColRow(nCurX, nCurY) );
1201
1202 if (nCurX < 0) nCurX = 0;
1203 if (nCurY < 0) nCurY = 0;
1204 if (nCurX > rDoc.MaxCol()) nCurX = rDoc.MaxCol();
1205 if (nCurY > rDoc.MaxRow()) nCurY = rDoc.MaxRow();
1206
1207 // FIXME: this is to limit the number of rows handled in the Online
1208 // to 1000; this will be removed again when the performance
1209 // bottlenecks are sorted out
1211 nCurY = std::min(nCurY, MAXTILEDROW);
1212
1214
1215 // switch of active now in AlignToCursor
1216
1217 AlignToCursor( nCurX, nCurY, eMode );
1218
1219 if (bKeepSel)
1220 {
1221 SetCursor( nCurX, nCurY ); // keep selection
1222
1223 // If the cursor is in existing selection, it's a cursor movement by
1224 // ENTER or TAB. If not, then it's a new selection during ADD
1225 // selection mode.
1226
1227 const ScMarkData& rMark = aViewData.GetMarkData();
1228 ScRangeList aSelList;
1229 rMark.FillRangeListWithMarks(&aSelList, false);
1230 if (!aSelList.Contains(ScRange(nCurX, nCurY, aViewData.GetTabNo())))
1231 // Cursor not in existing selection. Start a new selection.
1232 DoneBlockMode(true);
1233 }
1234 else
1235 {
1236 if (!bShift)
1237 {
1238 // Remove all marked data on cursor movement unless the Shift is
1239 // locked or while editing a formula. It is cheaper to check for
1240 // marks first and then formula mode.
1241 ScMarkData& rMark = aViewData.GetMarkData();
1242 bool bMarked = rMark.IsMarked() || rMark.IsMultiMarked();
1243 if (bMarked && !SC_MOD()->IsFormulaMode())
1244 {
1245 rMark.ResetMark();
1246 DoneBlockMode();
1247 InitOwnBlockMode( ScRange( nCurX, nCurY, aViewData.GetTabNo()));
1249 }
1250 }
1251
1252 bool bSame = ( nCurX == aViewData.GetCurX() && nCurY == aViewData.GetCurY() );
1253 bMoveIsShift = bShift;
1254 pSelEngine->CursorPosChanging( bShift, bControl );
1255 bMoveIsShift = false;
1256 aFunctionSet.SetCursorAtCell( nCurX, nCurY, false );
1257
1258 // If the cursor has not been moved, the SelectionChanged for canceling the
1259 // selection has to happen here individually:
1260 if (bSame)
1262 }
1263
1266}
1267
1269 bool bShift, bool bKeepSel )
1270{
1272 SCTAB nTab = aViewData.GetTabNo();
1273
1274 bool bSkipProtected = false, bSkipUnprotected = false;
1275 const ScTableProtection* pProtect = rDoc.GetTabProtection(nTab);
1276 if ( pProtect && pProtect->isProtected() )
1277 {
1278 bSkipProtected = !pProtect->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS);
1279 bSkipUnprotected = !pProtect->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS);
1280 }
1281
1282 if ( bSkipProtected && bSkipUnprotected )
1283 return;
1284
1285 SCCOL nOldX;
1286 SCROW nOldY;
1287 SCCOL nCurX;
1288 SCROW nCurY;
1289 if ( aViewData.IsRefMode() )
1290 {
1291 nOldX = aViewData.GetRefEndX();
1292 nOldY = aViewData.GetRefEndY();
1293 nCurX = nOldX + nMovX;
1294 nCurY = nOldY + nMovY;
1295 }
1296 else
1297 {
1298 nOldX = aViewData.GetCurX();
1299 nOldY = aViewData.GetCurY();
1300 nCurX = (nMovX != 0) ? nOldX+nMovX : aViewData.GetOldCurX();
1301 nCurY = (nMovY != 0) ? nOldY+nMovY : aViewData.GetOldCurY();
1302 }
1303
1304 if (nMovX < 0 && nOldX == 0)
1305 { // trying to go left from 1st column
1306 if (nMovY == 0) // done, because no vertical move is requested
1307 return;
1308 }
1309 if (nMovY < 0 && nOldY == 0)
1310 { // trying to go up from 1st row
1311 if (nMovX == 0) // done, because no horizontal move is requested
1312 return;
1313 }
1314
1316
1317 if (nMovX != 0 && rDoc.ValidColRow(nCurX,nCurY))
1318 SkipCursorHorizontal(nCurX, nCurY, nOldX, nMovX);
1319
1320 if (nMovY != 0 && rDoc.ValidColRow(nCurX,nCurY))
1321 SkipCursorVertical(nCurX, nCurY, nOldY, nMovY);
1322
1323 MoveCursorAbs( nCurX, nCurY, eMode, bShift, false, true, bKeepSel );
1324}
1325
1326void ScTabView::MoveCursorPage( SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, bool bShift, bool bKeepSel )
1327{
1328 SCCOL nPageX;
1329 SCROW nPageY;
1330 GetPageMoveEndPosition(nMovX, nMovY, nPageX, nPageY);
1331 MoveCursorRel( nPageX, nPageY, eMode, bShift, bKeepSel );
1332}
1333
1334void ScTabView::MoveCursorArea( SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, bool bShift, bool bKeepSel )
1335{
1336 SCCOL nNewX;
1337 SCROW nNewY;
1338 GetAreaMoveEndPosition(nMovX, nMovY, eMode, nNewX, nNewY, eMode);
1339 MoveCursorRel(nNewX, nNewY, eMode, bShift, bKeepSel);
1340}
1341
1342void ScTabView::MoveCursorEnd( SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, bool bShift, bool bKeepSel )
1343{
1345 SCTAB nTab = aViewData.GetTabNo();
1346
1347 SCCOL nCurX;
1348 SCROW nCurY;
1349 aViewData.GetMoveCursor( nCurX,nCurY );
1350 SCCOL nNewX = nCurX;
1351 SCROW nNewY = nCurY;
1352
1353 SCCOL nUsedX = 0;
1354 SCROW nUsedY = 0;
1355 if ( nMovX > 0 || nMovY > 0 )
1356 rDoc.GetPrintArea( nTab, nUsedX, nUsedY ); // get end
1357
1358 if (nMovX<0)
1359 nNewX=0;
1360 else if (nMovX>0)
1361 nNewX=nUsedX; // last used range
1362
1363 if (nMovY<0)
1364 nNewY=0;
1365 else if (nMovY>0)
1366 nNewY=nUsedY;
1367
1369 MoveCursorRel( nNewX-nCurX, nNewY-nCurY, eMode, bShift, bKeepSel );
1370}
1371
1372void ScTabView::MoveCursorScreen( SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, bool bShift )
1373{
1375 SCTAB nTab = aViewData.GetTabNo();
1376
1377 SCCOL nCurX;
1378 SCROW nCurY;
1379 aViewData.GetMoveCursor( nCurX,nCurY );
1380 SCCOL nNewX = nCurX;
1381 SCROW nNewY = nCurY;
1382
1384 SCCOL nPosX = aViewData.GetPosX( WhichH(eWhich) );
1385 SCROW nPosY = aViewData.GetPosY( WhichV(eWhich) );
1386
1387 SCCOL nAddX = aViewData.VisibleCellsX( WhichH(eWhich) );
1388 if (nAddX != 0)
1389 --nAddX;
1390 SCROW nAddY = aViewData.VisibleCellsY( WhichV(eWhich) );
1391 if (nAddY != 0)
1392 --nAddY;
1393
1394 if (nMovX<0)
1395 nNewX=nPosX;
1396 else if (nMovX>0)
1397 nNewX=nPosX+nAddX;
1398
1399 if (nMovY<0)
1400 nNewY=nPosY;
1401 else if (nMovY>0)
1402 nNewY=nPosY+nAddY;
1403
1404 aViewData.SetOldCursor( nNewX,nNewY );
1405 rDoc.SkipOverlapped(nNewX, nNewY, nTab);
1406 MoveCursorAbs( nNewX, nNewY, eMode, bShift, false, true );
1407}
1408
1409void ScTabView::MoveCursorEnter( bool bShift ) // bShift -> up/down
1410{
1411 const ScInputOptions& rOpt = SC_MOD()->GetInputOptions();
1412 if (!rOpt.GetMoveSelection())
1413 {
1415 return;
1416 }
1417
1418 SCCOL nMoveX = 0;
1419 SCROW nMoveY = 0;
1420 switch (static_cast<ScDirection>(rOpt.GetMoveDir()))
1421 {
1422 case DIR_BOTTOM:
1423 nMoveY = bShift ? -1 : 1;
1424 break;
1425 case DIR_RIGHT:
1426 nMoveX = bShift ? -1 : 1;
1427 break;
1428 case DIR_TOP:
1429 nMoveY = bShift ? 1 : -1;
1430 break;
1431 case DIR_LEFT:
1432 nMoveX = bShift ? 1 : -1;
1433 break;
1434 }
1435
1436 SCCOL nCurX;
1437 SCROW nCurY;
1438 aViewData.GetMoveCursor( nCurX,nCurY );
1439 SCCOL nNewX = nCurX;
1440 SCROW nNewY = nCurY;
1441 SCTAB nTab = aViewData.GetTabNo();
1442
1443 ScMarkData& rMark = aViewData.GetMarkData();
1445
1446 if (rMark.IsMarked() || rMark.IsMultiMarked())
1447 {
1448 rDoc.GetNextPos( nNewX, nNewY, nTab, nMoveX, nMoveY, true, false, rMark );
1449
1450 MoveCursorRel( nNewX - nCurX, nNewY - nCurY, SC_FOLLOW_LINE, false, true );
1451
1452 // update input line even if cursor was not moved
1453 if ( nNewX == nCurX && nNewY == nCurY )
1455 }
1456 else
1457 {
1458 // After Tab and Enter back to the starting column again.
1459 const SCCOL nTabStartCol = ((nMoveY != 0 && !nMoveX) ? aViewData.GetTabStartCol() : SC_TABSTART_NONE);
1460 rDoc.GetNextPos( nNewX, nNewY, nTab, nMoveX, nMoveY, false, true, rMark, nTabStartCol );
1461
1462 MoveCursorRel( nNewX - nCurX, nNewY - nCurY, SC_FOLLOW_LINE, false);
1463 }
1464}
1465
1467{
1468 const vcl::KeyCode& rKCode = rKeyEvent.GetKeyCode();
1469
1470 enum { MOD_NONE, MOD_CTRL, MOD_ALT, MOD_BOTH } eModifier =
1471 rKCode.IsMod1() ?
1472 (rKCode.IsMod2() ? MOD_BOTH : MOD_CTRL) :
1473 (rKCode.IsMod2() ? MOD_ALT : MOD_NONE);
1474
1475 bool bSel = rKCode.IsShift();
1476 sal_uInt16 nCode = rKCode.GetCode();
1477
1478 // CURSOR keys
1479 SCCOL nDX = 0;
1480 SCROW nDY = 0;
1481 switch( nCode )
1482 {
1483 case KEY_LEFT: nDX = -1; break;
1484 case KEY_RIGHT: nDX = 1; break;
1485 case KEY_UP: nDY = -1; break;
1486 case KEY_DOWN: nDY = 1; break;
1487 }
1488 if( nDX != 0 || nDY != 0 )
1489 {
1490 switch( eModifier )
1491 {
1492 case MOD_NONE: MoveCursorRel( nDX, nDY, SC_FOLLOW_LINE, bSel ); break;
1493 case MOD_CTRL: MoveCursorArea( nDX, nDY, SC_FOLLOW_JUMP, bSel ); break;
1494 default:
1495 {
1496 // added to avoid warnings
1497 }
1498 }
1499 // always true to suppress changes of col/row size (ALT+CURSOR)
1500 return true;
1501 }
1502
1503 // PAGEUP/PAGEDOWN
1504 if( (nCode == KEY_PAGEUP) || (nCode == KEY_PAGEDOWN) )
1505 {
1506 nDX = (nCode == KEY_PAGEUP) ? -1 : 1;
1507 switch( eModifier )
1508 {
1509 case MOD_NONE: MoveCursorPage( 0, static_cast<SCCOLROW>(nDX), SC_FOLLOW_FIX, bSel ); break;
1510 case MOD_ALT: MoveCursorPage( nDX, 0, SC_FOLLOW_FIX, bSel ); break;
1511 case MOD_CTRL: SelectNextTab( nDX, false ); break;
1512 default:
1513 {
1514 // added to avoid warnings
1515 }
1516 }
1517 return true;
1518 }
1519
1520 // HOME/END
1521 if( (nCode == KEY_HOME) || (nCode == KEY_END) )
1522 {
1523 nDX = (nCode == KEY_HOME) ? -1 : 1;
1525 switch( eModifier )
1526 {
1527 case MOD_NONE: MoveCursorEnd( nDX, 0, eMode, bSel ); break;
1528 case MOD_CTRL: MoveCursorEnd( nDX, static_cast<SCCOLROW>(nDX), eMode, bSel ); break;
1529 default:
1530 {
1531 // added to avoid warnings
1532 }
1533 }
1534 return true;
1535 }
1536
1537 return false;
1538}
1539
1540 // next/previous unprotected cell
1541void ScTabView::FindNextUnprot( bool bShift, bool bInSelection )
1542{
1543 short nMove = bShift ? -1 : 1;
1544
1545 ScMarkData& rMark = aViewData.GetMarkData();
1546 bool bMarked = bInSelection && (rMark.IsMarked() || rMark.IsMultiMarked());
1547
1548 SCCOL nCurX;
1549 SCROW nCurY;
1550 aViewData.GetMoveCursor( nCurX,nCurY );
1551 SCCOL nNewX = nCurX;
1552 SCROW nNewY = nCurY;
1553 SCTAB nTab = aViewData.GetTabNo();
1554
1556 rDoc.GetNextPos( nNewX,nNewY, nTab, nMove,0, bMarked, true, rMark );
1557
1558 SCCOL nTabCol = aViewData.GetTabStartCol();
1559 if ( nTabCol == SC_TABSTART_NONE )
1560 nTabCol = nCurX; // back to this column after Enter
1561
1562 MoveCursorRel( nNewX-nCurX, nNewY-nCurY, SC_FOLLOW_LINE, false, true );
1563
1564 // TabCol is reset in MoveCursorRel...
1565 aViewData.SetTabStartCol( nTabCol );
1566}
1567
1569{
1570 SCCOL nStartCol;
1571 SCCOL nEndCol;
1572
1573 ScMarkData& rMark = aViewData.GetMarkData();
1574 if (rMark.IsMarked())
1575 {
1576 const ScRange& aMarkRange = rMark.GetMarkArea();
1577 nStartCol = aMarkRange.aStart.Col();
1578 nEndCol = aMarkRange.aEnd.Col();
1579 }
1580 else
1581 {
1582 SCROW nDummy;
1583 aViewData.GetMoveCursor( nStartCol, nDummy );
1584 nEndCol=nStartCol;
1585 }
1586
1587 SCTAB nTab = aViewData.GetTabNo();
1589 DoneBlockMode();
1590 InitBlockMode( nStartCol,0, nTab );
1591 MarkCursor( nEndCol, rDoc.MaxRow(), nTab );
1593}
1594
1596{
1597 SCROW nStartRow;
1598 SCROW nEndRow;
1599
1600 ScMarkData& rMark = aViewData.GetMarkData();
1601 if (rMark.IsMarked())
1602 {
1603 const ScRange& aMarkRange = rMark.GetMarkArea();
1604 nStartRow = aMarkRange.aStart.Row();
1605 nEndRow = aMarkRange.aEnd.Row();
1606 }
1607 else
1608 {
1609 SCCOL nDummy;
1610 aViewData.GetMoveCursor( nDummy, nStartRow );
1611 nEndRow=nStartRow;
1612 }
1613
1614 SCTAB nTab = aViewData.GetTabNo();
1616 DoneBlockMode();
1617 InitBlockMode( 0,nStartRow, nTab );
1618 MarkCursor( rDoc.MaxCol(), nEndRow, nTab );
1620}
1621
1622
1623void ScTabView::MarkColumns(SCCOL nCol, sal_Int16 nModifier)
1624{
1626 SCCOL nStartCol = nCol;
1627 SCTAB nTab = aViewData.GetTabNo();
1628
1629 if ((nModifier & KEY_SHIFT) == KEY_SHIFT)
1630 bMoveIsShift = true;
1631
1632 if ( SC_MOD()->IsFormulaMode() )
1633 {
1634 DoneRefMode( nModifier != 0 );
1635 InitRefMode( nCol, 0, nTab, SC_REFTYPE_REF );
1636 UpdateRef( nCol, rDoc.MaxRow(), nTab );
1637 bMoveIsShift = false;
1638 }
1639 else
1640 {
1641 DoneBlockMode( nModifier != 0 );
1642 InitBlockMode( nStartCol, 0, nTab, true, true);
1643 MarkCursor( nCol, rDoc.MaxRow(), nTab );
1644 bMoveIsShift = false;
1645 SetCursor( nCol, 0 );
1647 }
1648}
1649
1650void ScTabView::MarkRows(SCROW nRow, sal_Int16 nModifier)
1651{
1653 SCROW nStartRow = nRow;
1654 SCTAB nTab = aViewData.GetTabNo();
1655
1656 if ((nModifier & KEY_SHIFT) == KEY_SHIFT)
1657 bMoveIsShift = true;
1658
1659 if ( SC_MOD()->IsFormulaMode() )
1660 {
1661 DoneRefMode( nModifier != 0 );
1662 InitRefMode( 0, nRow, nTab, SC_REFTYPE_REF );
1663 UpdateRef( rDoc.MaxCol(), nRow, nTab );
1664 bMoveIsShift = false;
1665 }
1666 else
1667 {
1668 DoneBlockMode( nModifier != 0 );
1669 InitBlockMode( 0, nStartRow, nTab, true, false, true );
1670 MarkCursor( rDoc.MaxCol(), nRow, nTab );
1671 bMoveIsShift = false;
1672 SetCursor( 0, nRow );
1674 }
1675}
1676
1677void ScTabView::MarkDataArea( bool bIncludeCursor )
1678{
1680 SCTAB nTab = aViewData.GetTabNo();
1681 SCCOL nStartCol = aViewData.GetCurX();
1682 SCROW nStartRow = aViewData.GetCurY();
1683 SCCOL nEndCol = nStartCol;
1684 SCROW nEndRow = nStartRow;
1685
1686 rDoc.GetDataArea( nTab, nStartCol, nStartRow, nEndCol, nEndRow, bIncludeCursor, false );
1687
1689 DoneBlockMode();
1690 InitBlockMode( nStartCol, nStartRow, nTab );
1691 MarkCursor( nEndCol, nEndRow, nTab );
1693
1695}
1696
1698{
1701 ScRange aMatrix;
1702 if ( rDoc.GetMatrixFormulaRange( aCursor, aMatrix ) )
1703 {
1704 MarkRange( aMatrix, false ); // cursor is already within the range
1705 }
1706}
1707
1708void ScTabView::MarkRange( const ScRange& rRange, bool bSetCursor, bool bContinue )
1709{
1711 SCTAB nTab = rRange.aStart.Tab();
1712 SetTabNo( nTab );
1713
1715 DoneBlockMode( bContinue ); // bContinue==true -> clear old mark
1716 if (bSetCursor) // if Cursor is set, also always align
1717 {
1718 SCCOL nAlignX = rRange.aStart.Col();
1719 SCROW nAlignY = rRange.aStart.Row();
1720 bool bCol = ( rRange.aStart.Col() == 0 && rRange.aEnd.Col() == rDoc.MaxCol() ) && !aViewData.GetDocument().IsInVBAMode();
1721 bool bRow = ( rRange.aStart.Row() == 0 && rRange.aEnd.Row() == rDoc.MaxRow() );
1722 if ( bCol )
1724 if ( bRow )
1726 AlignToCursor( nAlignX, nAlignY, SC_FOLLOW_JUMP );
1727 }
1728 InitBlockMode( rRange.aStart.Col(), rRange.aStart.Row(), nTab );
1729 MarkCursor( rRange.aEnd.Col(), rRange.aEnd.Row(), nTab );
1730 if (bSetCursor)
1731 {
1732 SCCOL nPosX = rRange.aStart.Col();
1733 SCROW nPosY = rRange.aStart.Row();
1734 rDoc.SkipOverlapped(nPosX, nPosY, nTab);
1735
1737 SetCursor( nPosX, nPosY );
1738 }
1740
1742}
1743
1745{
1746 ScMarkData& rMark = aViewData.GetMarkData();
1747 if ( rMark.IsMarked() || rMark.IsMultiMarked() )
1748 {
1749 SCCOL nCurX;
1750 SCROW nCurY;
1751 aViewData.GetMoveCursor( nCurX,nCurY );
1752 MoveCursorAbs( nCurX, nCurY, SC_FOLLOW_NONE, false, false );
1753
1755 }
1756}
1757
1759{
1760 DoneBlockMode();
1762 aViewData.GetMarkData() = rNew;
1763
1765}
1766
1768{
1769 // has to be called after making direct changes to mark data (not via MarkCursor etc)
1770
1772}
1773
1774void ScTabView::SelectNextTab( short nDir, bool bExtendSelection )
1775{
1776 if (!nDir)
1777 return;
1778 OSL_ENSURE( nDir==-1 || nDir==1, "SelectNextTab: invalid value");
1779
1781 SCTAB nTab = aViewData.GetTabNo();
1782 if (nDir<0)
1783 {
1784 if (!nTab)
1785 return;
1786 --nTab;
1787 while (!rDoc.IsVisible(nTab))
1788 {
1789 if (!nTab)
1790 return;
1791 --nTab;
1792 }
1793 }
1794 else
1795 {
1796 SCTAB nCount = rDoc.GetTableCount();
1797 ++nTab;
1798 if (nTab >= nCount)
1799 return;
1800 while (!rDoc.IsVisible(nTab))
1801 {
1802 ++nTab;
1803 if (nTab >= nCount)
1804 return;
1805 }
1806 }
1807
1808 SetTabNo( nTab, false, bExtendSelection );
1809 PaintExtras();
1810}
1811
1812void ScTabView::SelectTabPage( const sal_uInt16 nTab )
1813{
1814 pTabControl->SwitchToPageId( nTab );
1815}
1816
1817// SetTabNo - set the displayed sheet
1818
1819void ScTabView::SetTabNo( SCTAB nTab, bool bNew, bool bExtendSelection, bool bSameTabButMoved )
1820{
1821 if ( !ValidTab(nTab) )
1822 {
1823 OSL_FAIL("SetTabNo: invalid sheet");
1824 return;
1825 }
1826
1827 if (!bNew && nTab == aViewData.GetTabNo())
1828 return;
1829
1830 // FormShell would like to be informed before the switch
1832 if (pFormSh)
1833 {
1834 bool bAllowed = pFormSh->PrepareClose();
1835 if (!bAllowed)
1836 {
1839
1840 return; // FormShell says that it can not be switched
1841 }
1842 }
1843
1844 // not InputEnterHandler due to reference input
1845
1847
1848 rDoc.MakeTable( nTab );
1849
1850 // Update pending row heights before switching the sheet, so Reschedule from the progress bar
1851 // doesn't paint the new sheet with old heights
1853
1854 SCTAB nTabCount = rDoc.GetTableCount();
1855 SCTAB nOldPos = nTab;
1856 while (!rDoc.IsVisible(nTab)) // search for next visible
1857 {
1858 bool bUp = (nTab>=nOldPos);
1859 if (bUp)
1860 {
1861 ++nTab;
1862 if (nTab>=nTabCount)
1863 {
1864 nTab = nOldPos;
1865 bUp = false;
1866 }
1867 }
1868
1869 if (!bUp)
1870 {
1871 if (nTab != 0)
1872 --nTab;
1873 else
1874 {
1875 OSL_FAIL("no visible sheets");
1876 rDoc.SetVisible( 0, true );
1877 }
1878 }
1879 }
1880
1881 // #i71490# Deselect drawing objects before changing the sheet number in view data,
1882 // so the handling of notes still has the sheet selected on which the notes are.
1884
1885 ScModule* pScMod = SC_MOD();
1886 bool bRefMode = pScMod->IsFormulaMode();
1887 if ( !bRefMode ) // query, so that RefMode works when switching sheet
1888 {
1889 DoneBlockMode();
1890 pSelEngine->Reset(); // reset all flags, including locked modifiers
1891 aViewData.SetRefTabNo( nTab );
1892 }
1893
1894 ScSplitPos eOldActive = aViewData.GetActivePart(); // before switching
1895 bool bFocus = pGridWin[eOldActive] && pGridWin[eOldActive]->HasFocus();
1896
1897 aViewData.SetTabNo( nTab );
1898 if (mpSpellCheckCxt)
1899 mpSpellCheckCxt->setTabNo( nTab );
1900 // UpdateShow before SetCursor, so that UpdateAutoFillMark finds the correct
1901 // window (is called from SetCursor)
1902 UpdateShow();
1904
1905 SfxBindings& rBindings = aViewData.GetBindings();
1906 ScMarkData& rMark = aViewData.GetMarkData();
1907
1908 bool bAllSelected = true;
1909 for (SCTAB nSelTab = 0; nSelTab < nTabCount; ++nSelTab)
1910 {
1911 if (!rDoc.IsVisible(nSelTab) || rMark.GetTableSelect(nSelTab))
1912 {
1913 if (nTab == nSelTab)
1914 // This tab is already in selection. Keep the current
1915 // selection.
1916 bExtendSelection = true;
1917 }
1918 else
1919 {
1920 bAllSelected = false;
1921 if (bExtendSelection)
1922 // We got what we need. No need to stay in the loop.
1923 break;
1924 }
1925 }
1926 if (bAllSelected && !bNew)
1927 // #i6327# if all tables are selected, a selection event (#i6330#) will deselect all
1928 // (not if called with bNew to update settings)
1929 bExtendSelection = false;
1930
1931 if (bExtendSelection)
1932 rMark.SelectTable( nTab, true );
1933 else
1934 {
1935 rMark.SelectOneTable( nTab );
1936 rBindings.Invalidate( FID_FILL_TAB );
1937 rBindings.Invalidate( FID_TAB_DESELECTALL );
1938 }
1939
1940 bool bUnoRefDialog = pScMod->IsRefDialogOpen() && pScMod->GetCurRefDlgId() == WID_SIMPLE_REF;
1941
1942 // recalc zoom-dependent values (before TabChanged, before UpdateEditViewPos)
1943 RefreshZoom();
1944 UpdateVarZoom();
1945
1946 if ( bRefMode ) // hide EditView if necessary (after aViewData.SetTabNo !)
1947 {
1948 for (VclPtr<ScGridWindow> & pWin : pGridWin)
1949 {
1950 if (pWin && pWin->IsVisible())
1951 pWin->UpdateEditViewPos();
1952 }
1953 }
1954
1955 TabChanged(bSameTabButMoved); // DrawView
1956 collectUIInformation({{"TABLE", OUString::number(nTab)}});
1958
1959 aViewData.GetViewShell()->WindowChanged(); // if the active window has changed
1962
1963 if ( !bUnoRefDialog )
1964 aViewData.GetViewShell()->DisconnectAllClients(); // important for floating frames
1965 else
1966 {
1967 // hide / show inplace client
1968 ScClient* pClient = static_cast<ScClient*>(aViewData.GetViewShell()->GetIPClient());
1969 if ( pClient && pClient->IsObjectInPlaceActive() )
1970 {
1971 tools::Rectangle aObjArea = pClient->GetObjArea();
1972 if ( nTab == aViewData.GetRefTabNo() )
1973 {
1974 // move to its original position
1975
1976 SdrOle2Obj* pDrawObj = pClient->GetDrawObj();
1977 if ( pDrawObj )
1978 {
1979 tools::Rectangle aRect = pDrawObj->GetLogicRect();
1980 MapMode aMapMode( MapUnit::Map100thMM );
1981 Size aOleSize = pDrawObj->GetOrigObjSize( &aMapMode );
1982 aRect.SetSize( aOleSize );
1983 aObjArea = aRect;
1984 }
1985 }
1986 else
1987 {
1988 // move to an invisible position
1989
1990 aObjArea.SetPos( Point( 0, -2*aObjArea.GetHeight() ) );
1991 }
1992 pClient->SetObjArea( aObjArea );
1993 }
1994 }
1995
1996 if ( bFocus && aViewData.GetActivePart() != eOldActive && !bRefMode )
1997 ActiveGrabFocus(); // grab focus to the pane that's active now
1998
1999 // freeze
2000
2001 bool bResize = false;
2003 if (aViewData.UpdateFixX())
2004 bResize = true;
2006 if (aViewData.UpdateFixY())
2007 bResize = true;
2008 if (bResize)
2009 RepeatResize();
2011
2012 if ( aViewData.IsPagebreakMode() )
2014
2015 // Form Layer must know the visible area of the new sheet
2016 // that is why MapMode must already be correct here
2017 for (VclPtr<ScGridWindow> & pWin : pGridWin)
2018 {
2019 if (pWin)
2020 pWin->SetMapMode(pWin->GetDrawMapMode());
2021 }
2022 SetNewVisArea();
2023
2024 PaintGrid();
2025 PaintTop();
2026 PaintLeft();
2027 PaintExtras();
2028
2030 rBindings.Invalidate( SID_DELETE_PRINTAREA ); // Menu
2031 rBindings.Invalidate( FID_DEL_MANUALBREAKS );
2032 rBindings.Invalidate( FID_RESET_PRINTZOOM );
2033 rBindings.Invalidate( SID_STATUS_DOCPOS ); // Status bar
2034 rBindings.Invalidate( SID_ROWCOL_SELCOUNT ); // Status bar
2035 rBindings.Invalidate( SID_STATUS_PAGESTYLE ); // Status bar
2036 rBindings.Invalidate( SID_CURRENTTAB ); // Navigator
2037 rBindings.Invalidate( SID_STYLE_FAMILY2 ); // Designer
2038 rBindings.Invalidate( SID_STYLE_FAMILY4 ); // Designer
2039 rBindings.Invalidate( SID_TABLES_COUNT );
2040
2041 if (pScMod->IsRefDialogOpen())
2042 {
2043 sal_uInt16 nCurRefDlgId=pScMod->GetCurRefDlgId();
2045 SfxChildWindow* pChildWnd = rViewFrm.GetChildWindow( nCurRefDlgId );
2046 if (pChildWnd)
2047 {
2048 if (pChildWnd->GetController())
2049 {
2050 IAnyRefDialog* pRefDlg = dynamic_cast<IAnyRefDialog*>(pChildWnd->GetController().get());
2051 if (pRefDlg)
2052 pRefDlg->ViewShellChanged();
2053 }
2054 }
2055 }
2056
2058}
2059
2061{
2062 aExtraEditViewManager.Add(pViewShell, eWhich);
2063}
2064
2066{
2067 aExtraEditViewManager.Remove(pViewShell, eWhich);
2068}
2069
2071{
2073 return;
2074
2075 ScTabViewShell* pThisViewShell = aViewData.GetViewShell();
2076 SCTAB nThisTabNo = pThisViewShell->GetViewData().GetTabNo();
2077 auto lTabSwitch = [pThisViewShell, nThisTabNo] (ScTabViewShell* pOtherViewShell)
2078 {
2079 ScViewData& rOtherViewData = pOtherViewShell->GetViewData();
2080 SCTAB nOtherTabNo = rOtherViewData.GetTabNo();
2081 if (nThisTabNo == nOtherTabNo)
2082 {
2083 for (int i = 0; i < 4; ++i)
2084 {
2085 if (rOtherViewData.HasEditView(ScSplitPos(i)))
2086 {
2087 pThisViewShell->AddWindowToForeignEditView(pOtherViewShell, ScSplitPos(i));
2088 }
2089 }
2090 }
2091 else
2092 {
2093 for (int i = 0; i < 4; ++i)
2094 {
2095 if (rOtherViewData.HasEditView(ScSplitPos(i)))
2096 {
2097 pThisViewShell->RemoveWindowFromForeignEditView(pOtherViewShell, ScSplitPos(i));
2098 }
2099 }
2100 }
2101 };
2102
2103 SfxLokHelper::forEachOtherView(pThisViewShell, lTabSwitch);
2104
2105 pThisViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_HEADER, "all");
2106
2107 if (pThisViewShell->GetInputHandler())
2108 pThisViewShell->GetInputHandler()->UpdateLokReferenceMarks();
2109}
2110
2111// paint functions - only for this View
2112
2114{
2116
2117 if (pDrawView)
2118 DrawEnableAnim( false );
2119
2120 EditView* pSpellingView = aViewData.GetSpellingView();
2121
2122 for (sal_uInt16 i = 0; i < 4; i++)
2123 {
2124 if (pGridWin[i] && pGridWin[i]->IsVisible() && !aViewData.HasEditView(ScSplitPos(i)))
2125 {
2126 ScHSplitPos eHWhich = WhichH( static_cast<ScSplitPos>(i) );
2127 ScVSplitPos eVWhich = WhichV( static_cast<ScSplitPos>(i) );
2128 SCCOL nScrX = aViewData.GetPosX( eHWhich );
2129 SCROW nScrY = aViewData.GetPosY( eVWhich );
2130
2131 bool bPosVisible =
2132 ( nCol >= nScrX && nCol <= nScrX + aViewData.VisibleCellsX(eHWhich) - 1 &&
2133 nRow >= nScrY && nRow <= nScrY + aViewData.VisibleCellsY(eVWhich) - 1 );
2134
2135 // for the active part, create edit view even if outside the visible area,
2136 // so input isn't lost (and the edit view may be scrolled into the visible area)
2137
2138 // #i26433# during spelling, the spelling view must be active
2139 if ( bPosVisible || aViewData.GetActivePart() == static_cast<ScSplitPos>(i) ||
2140 ( pSpellingView && aViewData.GetEditView(static_cast<ScSplitPos>(i)) == pSpellingView ) )
2141 {
2142 pGridWin[i]->HideCursor();
2143
2144 pGridWin[i]->DeleteCursorOverlay();
2145 pGridWin[i]->DeleteAutoFillOverlay();
2146 pGridWin[i]->DeleteCopySourceOverlay();
2147
2148 // flush OverlayManager before changing MapMode to text edit
2149 pGridWin[i]->flushOverlayManager();
2150
2151 // MapMode must be set after HideCursor
2152 pGridWin[i]->SetMapMode(aViewData.GetLogicMode());
2153
2154 aViewData.SetEditEngine( static_cast<ScSplitPos>(i), pEngine, pGridWin[i], nCol, nRow );
2155
2156 if ( !bPosVisible )
2157 {
2158 // move the edit view area to the real (possibly negative) position,
2159 // or hide if completely above or left of the window
2160 pGridWin[i]->UpdateEditViewPos();
2161 }
2162 }
2163 }
2164 }
2165
2167 aViewData.GetViewShell()->BroadcastAccessibility(SfxHint(SfxHintId::ScAccEnterEditMode));
2168}
2169
2171{
2173 for (sal_uInt16 i = 0; i < 4; i++)
2174 {
2175 ScSplitPos eCurrent = ScSplitPos(i);
2176 if (aViewData.HasEditView(eCurrent))
2177 {
2178 EditView* pEditView = aViewData.GetEditView(eCurrent);
2179
2180 tools::Long nRefTabNo = GetViewData().GetRefTabNo();
2181 tools::Long nX = GetViewData().GetCurXForTab(nRefTabNo);
2182 tools::Long nY = GetViewData().GetCurYForTab(nRefTabNo);
2183
2184 aViewData.SetEditEngine(eCurrent,
2185 static_cast<ScEditEngineDefaulter*>(pEditView->GetEditEngine()),
2186 pGridWin[i], nX, nY );
2187 if (eCurrent == eActive)
2188 pEditView->ShowCursor( false );
2189 }
2190 }
2191}
2192
2193void ScTabView::KillEditView( bool bNoPaint )
2194{
2197 SCCOL nCol2 = aViewData.GetEditEndCol();
2198 SCROW nRow2 = aViewData.GetEditEndRow();
2199 bool bPaint[4];
2200 bool bNotifyAcc = false;
2201 tools::Rectangle aRectangle[4];
2202
2203 bool bExtended = nRow1 != nRow2; // column is painted to the end anyway
2204
2205 bool bAtCursor = nCol1 <= aViewData.GetCurX() &&
2206 nCol2 >= aViewData.GetCurX() &&
2207 nRow1 == aViewData.GetCurY();
2208 for (sal_uInt16 i = 0; i < 4; i++)
2209 {
2210 bPaint[i] = aViewData.HasEditView( static_cast<ScSplitPos>(i) );
2211 if (bPaint[i])
2212 {
2213 bNotifyAcc = true;
2214
2215 EditView* pView = aViewData.GetEditView( static_cast<ScSplitPos>(i) );
2216 aRectangle[i] = pView->GetInvalidateRect();
2217 }
2218 }
2219
2220 // notify accessibility before all things happen
2221 if (bNotifyAcc && aViewData.GetViewShell()->HasAccessibilityObjects())
2222 aViewData.GetViewShell()->BroadcastAccessibility(SfxHint(SfxHintId::ScAccLeaveEditMode));
2223
2225 for (sal_uInt16 i = 0; i < 4; i++)
2226 {
2227 if (pGridWin[i] && bPaint[i] && pGridWin[i]->IsVisible())
2228 {
2229 pGridWin[i]->ShowCursor();
2230
2231 pGridWin[i]->SetMapMode(pGridWin[i]->GetDrawMapMode());
2232
2234 {
2235 const tools::Rectangle& rInvRect = aRectangle[i];
2236 pGridWin[i]->Invalidate(rInvRect);
2237
2238 // invalidate other views
2239 auto lInvalidateWindows =
2240 [&rInvRect] (ScTabView* pTabView)
2241 {
2242 for (VclPtr<ScGridWindow> const & pWin: pTabView->pGridWin)
2243 {
2244 if (pWin)
2245 pWin->Invalidate(rInvRect);
2246 }
2247 };
2248
2249 SfxLokHelper::forEachOtherView(GetViewData().GetViewShell(), lInvalidateWindows);
2250 }
2251 // #i73567# the cell still has to be repainted
2252 else if (bExtended || ( bAtCursor && !bNoPaint ))
2253 {
2254 pGridWin[i]->Draw( nCol1, nRow1, nCol2, nRow2, ScUpdateMode::All );
2255 pGridWin[i]->UpdateSelectionOverlay();
2256 }
2257 }
2258 }
2259
2260 if (pDrawView)
2261 DrawEnableAnim( true );
2262
2263 // GrabFocus always when this View is active and
2264 // when the input row has the focus
2265
2266 bool bGrabFocus = false;
2267 if (aViewData.IsActive())
2268 {
2269 ScInputHandler* pInputHdl = SC_MOD()->GetInputHdl();
2270 if ( pInputHdl )
2271 {
2272 ScInputWindow* pInputWin = pInputHdl->GetInputWindow();
2273 if (pInputWin && pInputWin->IsInputActive())
2274 bGrabFocus = true;
2275 }
2276 }
2277
2278 if (bGrabFocus)
2279 {
2280// should be done like this, so that Sfx notice it, but it does not work:
2282// therefore first like this:
2284 }
2285
2286 // cursor query only after GrabFocus
2287
2288 for (sal_uInt16 i = 0; i < 4; i++)
2289 {
2290 if (pGridWin[i] && pGridWin[i]->IsVisible())
2291 {
2292 vcl::Cursor* pCur = pGridWin[i]->GetCursor();
2293 if (pCur && pCur->IsVisible())
2294 pCur->Hide();
2295
2296 if (bPaint[i])
2297 {
2298 pGridWin[i]->UpdateCursorOverlay();
2299 pGridWin[i]->UpdateAutoFillOverlay();
2300 }
2301 }
2302 }
2303}
2304
2305void ScTabView::UpdateFormulas(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow)
2306{
2308 return;
2309
2310 for (sal_uInt16 i = 0; i < 4; i++)
2311 {
2312 if (pGridWin[i] && pGridWin[i]->IsVisible())
2313 pGridWin[i]->UpdateFormulas(nStartCol, nStartRow, nEndCol, nEndRow);
2314 }
2315
2316 if ( aViewData.IsPagebreakMode() )
2318
2320
2321 // if in edit mode, adjust edit view area because widths/heights may have changed
2324}
2325
2326// PaintArea - repaint block
2327
2328void ScTabView::PaintArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
2329 ScUpdateMode eMode )
2330{
2331 SCCOL nCol1;
2332 SCROW nRow1;
2333 SCCOL nCol2;
2334 SCROW nRow2;
2335 bool bIsTiledRendering = comphelper::LibreOfficeKit::isActive();
2337
2338 PutInOrder( nStartCol, nEndCol );
2339 PutInOrder( nStartRow, nEndRow );
2340
2341 for (size_t i = 0; i < 4; ++i)
2342 {
2343 if (!pGridWin[i] || !pGridWin[i]->IsVisible())
2344 continue;
2345
2346 ScHSplitPos eHWhich = WhichH( static_cast<ScSplitPos>(i) );
2347 ScVSplitPos eVWhich = WhichV( static_cast<ScSplitPos>(i) );
2348 bool bOut = false;
2349
2350 nCol1 = nStartCol;
2351 nRow1 = nStartRow;
2352 nCol2 = nEndCol;
2353 nRow2 = nEndRow;
2354
2355 SCCOL nLastX = 0;
2356 SCROW nLastY = 0;
2357
2358 if (bIsTiledRendering)
2359 {
2360 nLastX = aViewData.GetMaxTiledCol();
2361 nLastY = aViewData.GetMaxTiledRow();
2362 }
2363 else
2364 {
2365
2366 SCCOL nScrX = aViewData.GetPosX( eHWhich );
2367 SCROW nScrY = aViewData.GetPosY( eVWhich );
2368
2369 if (nCol1 < nScrX)
2370 nCol1 = nScrX;
2371 if (nCol2 < nScrX)
2372 {
2373 if ( eMode == ScUpdateMode::All ) // for UPDATE_ALL, paint anyway
2374 nCol2 = nScrX; // (because of extending strings to the right)
2375 else
2376 bOut = true; // completely outside the window
2377 }
2378 if (nRow1 < nScrY)
2379 nRow1 = nScrY;
2380 if (nRow2 < nScrY)
2381 bOut = true;
2382
2383 nLastX = nScrX + aViewData.VisibleCellsX( eHWhich ) + 1;
2384 nLastY = nScrY + aViewData.VisibleCellsY( eVWhich ) + 1;
2385 }
2386
2387 if (nCol1 > nLastX)
2388 bOut = true;
2389 if (nCol2 > nLastX)
2390 nCol2 = nLastX;
2391 if (nRow1 > nLastY)
2392 bOut = true;
2393 if (nRow2 > nLastY)
2394 nRow2 = nLastY;
2395
2396 if (bOut)
2397 continue;
2398
2399 bool bLayoutRTL = aViewData.GetDocument().IsLayoutRTL( aViewData.GetTabNo() );
2400 tools::Long nLayoutSign = (!bIsTiledRendering && bLayoutRTL) ? -1 : 1;
2401
2402 Point aStart = aViewData.GetScrPos( nCol1, nRow1, static_cast<ScSplitPos>(i) );
2403 Point aEnd = aViewData.GetScrPos( nCol2+1, nRow2+1, static_cast<ScSplitPos>(i) );
2404
2405 if ( eMode == ScUpdateMode::All )
2406 {
2407 if (bIsTiledRendering)
2408 {
2409 // When a cell content is deleted we have no clue about
2410 // the width of the embedded text.
2411 // Anyway, clients will ask only for tiles that overlaps
2412 // the visible area.
2413 // Remember that wsd expects int and that aEnd.X() is
2414 // in pixels and will be converted in twips, before performing
2415 // the lok callback, so we need to avoid that an overflow occurs.
2416 aEnd.setX( std::numeric_limits<int>::max() / 1000 );
2417 }
2418 else
2419 {
2420 aEnd.setX( bLayoutRTL ? 0 : pGridWin[i]->GetOutputSizePixel().Width() );
2421 }
2422 }
2423 aEnd.AdjustX( -nLayoutSign );
2424 aEnd.AdjustY( -1 );
2425
2426 // #i85232# include area below cells (could be done in GetScrPos?)
2427 if ( eMode == ScUpdateMode::All && nRow2 >= rDoc.MaxRow() && !bIsTiledRendering )
2428 aEnd.setY( pGridWin[i]->GetOutputSizePixel().Height() );
2429
2430 aStart.AdjustX( -nLayoutSign ); // include change marks
2431 aStart.AdjustY( -1 );
2432
2433 bool bMarkClipped = aViewData.GetOptions().GetOption( VOPT_CLIPMARKS );
2434 if (bMarkClipped)
2435 {
2436 // ScColumn::IsEmptyData has to be optimized for this
2437 // (switch to Search() )
2441 tools::Long nMarkPixel = static_cast<tools::Long>( SC_CLIPMARK_SIZE * aViewData.GetPPTX() );
2442 aStart.AdjustX( -(nMarkPixel * nLayoutSign) );
2443 }
2444
2445 pGridWin[i]->Invalidate( pGridWin[i]->PixelToLogic( tools::Rectangle( aStart,aEnd ) ) );
2446 }
2447
2448 // #i79909# Calling UpdateAllOverlays here isn't necessary and would lead to overlay calls from a timer,
2449 // with a wrong MapMode if editing in a cell (reference input).
2450 // #i80499# Overlays need updates in a lot of cases, e.g. changing row/column size,
2451 // or showing/hiding outlines. TODO: selections in inactive windows are vanishing.
2452 // #i84689# With relative conditional formats, PaintArea may be called often (for each changed cell),
2453 // so UpdateAllOverlays was moved to ScTabViewShell::Notify and is called only if PaintPartFlags::Left/PaintPartFlags::Top
2454 // is set (width or height changed).
2455}
2456
2458{
2459 ScRange aRef = pData->aRef;
2460 aRef.PutInOrder(); // PutInOrder for the queries below
2461
2462 if ( aRef.aStart == aRef.aEnd )
2464
2465 if (aRef.aStart.Tab() < nTab || aRef.aEnd.Tab() > nTab)
2466 return;
2467
2468 SCCOL nCol1 = aRef.aStart.Col();
2469 SCROW nRow1 = aRef.aStart.Row();
2470 SCCOL nCol2 = aRef.aEnd.Col();
2471 SCROW nRow2 = aRef.aEnd.Row();
2472
2473 // remove -> repaint
2474 // ScUpdateMode::Marks: Invalidate, nothing until end of row
2475
2476 bool bHiddenEdge = false;
2477 SCROW nTmp;
2479 while ( nCol1 > 0 && rDoc.ColHidden(nCol1, nTab) )
2480 {
2481 --nCol1;
2482 bHiddenEdge = true;
2483 }
2484 while ( nCol2 < rDoc.MaxCol() && rDoc.ColHidden(nCol2, nTab) )
2485 {
2486 ++nCol2;
2487 bHiddenEdge = true;
2488 }
2489 nTmp = rDoc.LastVisibleRow(0, nRow1, nTab);
2490 if (!rDoc.ValidRow(nTmp))
2491 nTmp = 0;
2492 if (nTmp < nRow1)
2493 {
2494 nRow1 = nTmp;
2495 bHiddenEdge = true;
2496 }
2497 nTmp = rDoc.FirstVisibleRow(nRow2, rDoc.MaxRow(), nTab);
2498 if (!rDoc.ValidRow(nTmp))
2499 nTmp = rDoc.MaxRow();
2500 if (nTmp > nRow2)
2501 {
2502 nRow2 = nTmp;
2503 bHiddenEdge = true;
2504 }
2505
2506 if ( nCol2 - nCol1 > 1 && nRow2 - nRow1 > 1 && !bHiddenEdge )
2507 {
2508 // only along the edges
2509 PaintArea( nCol1, nRow1, nCol2, nRow1, ScUpdateMode::Marks );
2510 PaintArea( nCol1, nRow1+1, nCol1, nRow2-1, ScUpdateMode::Marks );
2511 PaintArea( nCol2, nRow1+1, nCol2, nRow2-1, ScUpdateMode::Marks );
2512 PaintArea( nCol1, nRow2, nCol2, nRow2, ScUpdateMode::Marks );
2513 }
2514 else // all in one
2515 PaintArea( nCol1, nRow1, nCol2, nRow2, ScUpdateMode::Marks );
2516}
2517
2519{
2520 ScInputHandler* pHdl = SC_MOD()->GetInputHdl( aViewData.GetViewShell() );
2521 if (!pHdl)
2522 return;
2523
2524 ScRangeFindList* pRangeFinder = pHdl->GetRangeFindList();
2525 if ( !(pRangeFinder && pRangeFinder->GetDocName() == aViewData.GetDocShell()->GetTitle()) )
2526 return;
2527
2528 SCTAB nTab = aViewData.GetTabNo();
2529 sal_uInt16 nCount = static_cast<sal_uInt16>(pRangeFinder->Count());
2530
2531 if (nNumber < 0)
2532 {
2533 for (sal_uInt16 i=0; i<nCount; i++)
2534 PaintRangeFinderEntry(&pRangeFinder->GetObject(i),nTab);
2535 }
2536 else
2537 {
2538 sal_uInt16 idx = nNumber;
2539 if (idx < nCount)
2540 PaintRangeFinderEntry(&pRangeFinder->GetObject(idx),nTab);
2541 }
2542}
2543
2544// for chart data selection
2545
2546void ScTabView::AddHighlightRange( const ScRange& rRange, const Color& rColor )
2547{
2548 maHighlightRanges.emplace_back( rRange, rColor );
2549
2550 SCTAB nTab = aViewData.GetTabNo();
2551 if ( nTab >= rRange.aStart.Tab() && nTab <= rRange.aEnd.Tab() )
2552 PaintArea( rRange.aStart.Col(), rRange.aStart.Row(),
2553 rRange.aEnd.Col(), rRange.aEnd.Row(), ScUpdateMode::Marks );
2554}
2555
2557{
2558 SCTAB nTab = aViewData.GetTabNo();
2559 for (ScHighlightEntry const & rEntry : maHighlightRanges)
2560 {
2561 ScRange aRange = rEntry.aRef;
2562 if ( nTab >= aRange.aStart.Tab() && nTab <= aRange.aEnd.Tab() )
2563 PaintArea( aRange.aStart.Col(), aRange.aStart.Row(),
2564 aRange.aEnd.Col(), aRange.aEnd.Row(), ScUpdateMode::Marks );
2565 }
2566
2567 maHighlightRanges.clear();
2568}
2569
2571 const uno::Sequence< chart2::data::HighlightedRange > & rHilightRanges )
2572{
2575 size_t nSize = 0;
2576 size_t nIndex = 0;
2577 std::vector<ReferenceMark> aReferenceMarks( nSize );
2578
2579 for (chart2::data::HighlightedRange const & rHighlightedRange : rHilightRanges)
2580 {
2581 Color aSelColor(ColorTransparency, rHighlightedRange.PreferredColor);
2582 ScRangeList aRangeList;
2585 aRangeList, rHighlightedRange.RangeRepresentation, rDoc, rDoc.GetAddressConvention(), sep ))
2586 {
2587 size_t nListSize = aRangeList.size();
2588 nSize += nListSize;
2589 aReferenceMarks.resize(nSize);
2590
2591 for ( size_t j = 0; j < nListSize; ++j )
2592 {
2593 ScRange& p = aRangeList[j];
2594 ScRange aTargetRange;
2595 if( rHighlightedRange.Index == - 1 )
2596 {
2597 aTargetRange = p;
2598 AddHighlightRange( aTargetRange, aSelColor );
2599 }
2600 else
2601 {
2602 aTargetRange = lcl_getSubRangeByIndex( p, rHighlightedRange.Index );
2603 AddHighlightRange( aTargetRange, aSelColor );
2604 }
2605
2607 {
2608 aTargetRange.PutInOrder();
2609
2610 tools::Long nX1 = aTargetRange.aStart.Col();
2611 tools::Long nX2 = aTargetRange.aEnd.Col();
2612 tools::Long nY1 = aTargetRange.aStart.Row();
2613 tools::Long nY2 = aTargetRange.aEnd.Row();
2614 tools::Long nTab = aTargetRange.aStart.Tab();
2615
2617 nX1, nX2, nY1, nY2,
2618 nTab, aSelColor );
2619 }
2620 }
2621 }
2622 }
2623
2626}
2627
2628void ScTabView::DoDPFieldPopup(std::u16string_view rPivotTableName, sal_Int32 nDimensionIndex, Point aPoint, Size aSize)
2629{
2630 ScDocument& rDocument = aViewData.GetDocShell()->GetDocument();
2632
2633 if (!pWin)
2634 return;
2635
2636 ScDPCollection* pDPCollection = rDocument.GetDPCollection();
2637 ScDPObject* pDPObject = pDPCollection->GetByName(rPivotTableName);
2638 if (!pDPObject)
2639 return;
2640
2641 pDPObject->BuildAllDimensionMembers();
2642
2643 Point aPos = pWin->LogicToPixel(aPoint);
2645 Point aScreenPoint = bLOK ? aPos : pWin->OutputToScreenPixel(aPos);
2646 Size aScreenSize = pWin->LogicToPixel(aSize);
2647
2648 pWin->DPLaunchFieldPopupMenu(aScreenPoint, aScreenSize, nDimensionIndex, pDPObject);
2649}
2650
2651// PaintGrid - repaint data range
2652
2654{
2655 for (sal_uInt16 i = 0; i < 4; i++)
2656 {
2657 if (pGridWin[i] && pGridWin[i]->IsVisible())
2658 pGridWin[i]->Invalidate();
2659 }
2660}
2661
2662// PaintTop - repaint top control elements
2663
2665{
2666 for (sal_uInt16 i = 0; i < 2; i++)
2667 {
2668 if (pColBar[i])
2669 pColBar[i]->Invalidate();
2670 if (pColOutline[i])
2671 pColOutline[i]->Invalidate();
2672 }
2673}
2674
2676{
2677 for (sal_uInt16 i = 0; i < 4; i++)
2678 {
2679 if(pGridWin[i] && pGridWin[i]->IsVisible())
2680 pGridWin[i]->CreateAnchorHandle(rHdl, rAddress);
2681 }
2682}
2683
2684void ScTabView::PaintTopArea( SCCOL nStartCol, SCCOL nEndCol )
2685{
2686 // pixel position of the left edge
2687
2688 if ( nStartCol < aViewData.GetPosX(SC_SPLIT_LEFT) ||
2689 nStartCol < aViewData.GetPosX(SC_SPLIT_RIGHT) )
2691
2692 // adjust freeze (UpdateFixX resets HSplitPos)
2693
2694 if ( aViewData.GetHSplitMode() == SC_SPLIT_FIX && nStartCol < aViewData.GetFixPosX() )
2695 if (aViewData.UpdateFixX())
2696 RepeatResize();
2697
2698 // paint
2699
2700 if (nStartCol>0)
2701 --nStartCol;
2702
2704 bool bLayoutRTL = rDoc.IsLayoutRTL( aViewData.GetTabNo() );
2705 tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
2706
2707 for (sal_uInt16 i = 0; i < 2; i++)
2708 {
2709 ScHSplitPos eWhich = ScHSplitPos(i);
2710 if (pColBar[eWhich])
2711 {
2712 Size aWinSize = pColBar[eWhich]->GetSizePixel();
2713 tools::Long nStartX = aViewData.GetScrPos( nStartCol, 0, eWhich ).X();
2714 tools::Long nEndX;
2715 if (nEndCol >= rDoc.MaxCol())
2716 nEndX = bLayoutRTL ? 0 : ( aWinSize.Width()-1 );
2717 else
2718 nEndX = aViewData.GetScrPos( nEndCol+1, 0, eWhich ).X() - nLayoutSign;
2719 if (nStartX > nEndX)
2720 std::swap(nStartX, nEndX);
2721 pColBar[eWhich]->Invalidate(
2722 tools::Rectangle( nStartX, 0, nEndX, aWinSize.Height()-1 ) );
2723 }
2724 if (pColOutline[eWhich])
2725 pColOutline[eWhich]->Invalidate();
2726 }
2727}
2728
2729// PaintLeft - repaint left control elements
2730
2732{
2733 for (sal_uInt16 i = 0; i < 2; i++)
2734 {
2735 if (pRowBar[i])
2736 pRowBar[i]->Invalidate();
2737 if (pRowOutline[i])
2738 pRowOutline[i]->Invalidate();
2739 }
2740}
2741
2742void ScTabView::PaintLeftArea( SCROW nStartRow, SCROW nEndRow )
2743{
2744 // pixel position of the upper edge
2745
2746 if ( nStartRow < aViewData.GetPosY(SC_SPLIT_TOP) ||
2747 nStartRow < aViewData.GetPosY(SC_SPLIT_BOTTOM) )
2749
2750 // adjust freeze (UpdateFixY reset VSplitPos)
2751
2752 if ( aViewData.GetVSplitMode() == SC_SPLIT_FIX && nStartRow < aViewData.GetFixPosY() )
2753 if (aViewData.UpdateFixY())
2754 RepeatResize();
2755
2756 // paint
2757
2758 if (nStartRow>0)
2759 --nStartRow;
2760
2762 for (sal_uInt16 i = 0; i < 2; i++)
2763 {
2764 ScVSplitPos eWhich = ScVSplitPos(i);
2765 if (pRowBar[eWhich])
2766 {
2767 Size aWinSize = pRowBar[eWhich]->GetSizePixel();
2768 tools::Long nStartY = aViewData.GetScrPos( 0, nStartRow, eWhich ).Y();
2769 tools::Long nEndY;
2770 if (nEndRow >= rDoc.MaxRow())
2771 nEndY = aWinSize.Height() - 1;
2772 else
2773 nEndY = aViewData.GetScrPos( 0, nEndRow+1, eWhich ).Y() - 1;
2774 if (nStartY > nEndY)
2775 std::swap(nStartY, nEndY);
2776 pRowBar[eWhich]->Invalidate(
2777 tools::Rectangle( 0, nStartY, aWinSize.Width()-1, nEndY ) );
2778 }
2779 if (pRowOutline[eWhich])
2780 pRowOutline[eWhich]->Invalidate();
2781 }
2782}
2783
2785{
2786 bool bRet = false;
2788 SCTAB nTab = aViewData.GetTabNo();
2789 if (!rDoc.HasTable(nTab)) // sheet is deleted?
2790 {
2791 SCTAB nCount = rDoc.GetTableCount();
2793 bRet = true;
2794 }
2795 pTabControl->UpdateStatus(); // true = active
2796 return bRet;
2797}
2798
2800{
2801 // called after changes that require the PPT values to be recalculated
2802 // (currently from detective operations)
2803
2804 double nOldX = aViewData.GetPPTX();
2805 double nOldY = aViewData.GetPPTY();
2806
2807 aViewData.RefreshZoom(); // pre-calculate new PPT values
2808
2809 bool bChangedX = ( aViewData.GetPPTX() != nOldX );
2810 bool bChangedY = ( aViewData.GetPPTY() != nOldY );
2811 if ( !(bChangedX || bChangedY) )
2812 return;
2813
2814 // call view SetZoom (including draw scale, split update etc)
2815 // and paint only if values changed
2816
2817 Fraction aZoomX = aViewData.GetZoomX();
2818 Fraction aZoomY = aViewData.GetZoomY();
2819 SetZoom( aZoomX, aZoomY, false );
2820
2821 PaintGrid();
2822 if (bChangedX)
2823 PaintTop();
2824 if (bChangedY)
2825 PaintLeft();
2826}
2827
2828void ScTabView::ActivateView( bool bActivate, bool bFirst )
2829{
2830 if ( bActivate == aViewData.IsActive() && !bFirst )
2831 {
2832 // no assertion anymore - occurs when previously in Drag&Drop switching over
2833 // to another document
2834 return;
2835 }
2836
2837 // is only called for MDI-(De)Activate
2838 // aViewData.Activate behind due to cursor show for KillEditView
2839 // don't delete selection - if Activate(false) is set in ViewData,
2840 // then the selection is not displayed
2841
2842 if (!bActivate)
2843 {
2844 ScModule* pScMod = SC_MOD();
2845 bool bRefMode = pScMod->IsFormulaMode();
2846
2847 // don't cancel reference input, to allow reference
2848 // to other document
2849
2850 if (!bRefMode)
2851 {
2852 // pass view to GetInputHdl, this view may not be current anymore
2853 ScInputHandler* pHdl = SC_MOD()->GetInputHdl(aViewData.GetViewShell());
2854 if (pHdl)
2855 pHdl->EnterHandler();
2856 }
2857 }
2858
2859 PaintExtras();
2860
2861 aViewData.Activate(bActivate);
2862
2863 PaintBlock(false); // repaint, selection after active status
2864
2865 if (!bActivate)
2866 HideAllCursors(); // Cursor
2867 else if (!bFirst)
2869
2870 if (bActivate)
2871 {
2872 if ( bFirst )
2873 {
2875 OSL_ENSURE( pGridWin[eWin], "Corrupted document, not all SplitPos in GridWin" );
2876 if ( !pGridWin[eWin] )
2877 {
2878 eWin = SC_SPLIT_BOTTOMLEFT;
2879 if ( !pGridWin[eWin] )
2880 {
2881 short i;
2882 for ( i=0; i<4; i++ )
2883 {
2884 if ( pGridWin[i] )
2885 {
2886 eWin = static_cast<ScSplitPos>(i);
2887 break; // for
2888 }
2889 }
2890 OSL_ENSURE( i<4, "and BOOM" );
2891 }
2892 aViewData.SetActivePart( eWin );
2893 }
2894 }
2895 // do not call GrabFocus from here!
2896 // if the document is processed, then Sfx calls GrabFocus in the window of the shell.
2897 // if it is a mail body for instance, then it can't get the focus
2899 }
2900 else
2901 pGridWin[aViewData.GetActivePart()]->ClickExtern();
2902}
2903
2905{
2907 if ( eOld == eWhich )
2908 return;
2909
2910 bInActivatePart = true;
2911
2912 bool bRefMode = SC_MOD()->IsFormulaMode();
2913
2914 // the HasEditView call during SetCursor would fail otherwise
2915 if ( aViewData.HasEditView(eOld) && !bRefMode )
2917
2918 ScHSplitPos eOldH = WhichH(eOld);
2919 ScVSplitPos eOldV = WhichV(eOld);
2920 ScHSplitPos eNewH = WhichH(eWhich);
2921 ScVSplitPos eNewV = WhichV(eWhich);
2922 bool bTopCap = pColBar[eOldH] && pColBar[eOldH]->IsMouseCaptured();
2923 bool bLeftCap = pRowBar[eOldV] && pRowBar[eOldV]->IsMouseCaptured();
2924
2925 bool bFocus = pGridWin[eOld]->HasFocus();
2926 bool bCapture = pGridWin[eOld]->IsMouseCaptured();
2927 if (bCapture)
2928 pGridWin[eOld]->ReleaseMouse();
2929 pGridWin[eOld]->ClickExtern();
2930 pGridWin[eOld]->HideCursor();
2931 pGridWin[eWhich]->HideCursor();
2932 aViewData.SetActivePart( eWhich );
2933
2935 pShell->WindowChanged();
2936
2937 pSelEngine->SetWindow(pGridWin[eWhich]);
2938 pSelEngine->SetWhich(eWhich);
2939 pSelEngine->SetVisibleArea( tools::Rectangle(Point(), pGridWin[eWhich]->GetOutputSizePixel()) );
2940
2941 pGridWin[eOld]->MoveMouseStatus(*pGridWin[eWhich]);
2942
2943 if ( bCapture || pGridWin[eWhich]->IsMouseCaptured() )
2944 {
2945 // tracking instead of CaptureMouse, so it can be cancelled cleanly
2946 // (SelectionEngine calls CaptureMouse for SetWindow)
2948 pGridWin[eWhich]->ReleaseMouse();
2949 pGridWin[eWhich]->StartTracking();
2950 }
2951
2952 if ( bTopCap && pColBar[eNewH] )
2953 {
2954 pColBar[eOldH]->SetIgnoreMove(true);
2955 pColBar[eNewH]->SetIgnoreMove(false);
2956 pHdrSelEng->SetWindow( pColBar[eNewH] );
2957 tools::Long nWidth = pColBar[eNewH]->GetOutputSizePixel().Width();
2958 pHdrSelEng->SetVisibleArea( tools::Rectangle( 0, LONG_MIN, nWidth-1, LONG_MAX ) );
2959 pColBar[eNewH]->CaptureMouse();
2960 }
2961 if ( bLeftCap && pRowBar[eNewV] )
2962 {
2963 pRowBar[eOldV]->SetIgnoreMove(true);
2964 pRowBar[eNewV]->SetIgnoreMove(false);
2965 pHdrSelEng->SetWindow( pRowBar[eNewV] );
2966 tools::Long nHeight = pRowBar[eNewV]->GetOutputSizePixel().Height();
2967 pHdrSelEng->SetVisibleArea( tools::Rectangle( LONG_MIN, 0, LONG_MAX, nHeight-1 ) );
2968 pRowBar[eNewV]->CaptureMouse();
2969 }
2970 aHdrFunc.SetWhich(eWhich);
2971
2972 pGridWin[eOld]->ShowCursor();
2973 pGridWin[eWhich]->ShowCursor();
2974
2976 bool bOleActive = ( pClient && pClient->IsObjectInPlaceActive() );
2977
2978 // don't switch ViewShell's active window during RefInput, because the focus
2979 // might change, and subsequent SetReference calls wouldn't find the right EditView
2980 if ( !bRefMode && !bOleActive )
2982
2983 if ( bFocus && !aViewData.IsAnyFillMode() && !bRefMode )
2984 {
2985 // GrabFocus only if previously the other GridWindow had the focus
2986 // (for instance due to search and replace)
2987 pGridWin[eWhich]->GrabFocus();
2988 }
2989
2990 bInActivatePart = false;
2991}
2992
2994{
2995 for (VclPtr<ScGridWindow> & pWin : pGridWin)
2996 {
2997 if (pWin)
2998 pWin->ClickExtern();
2999 }
3000}
3001
3003{
3005 if (pWin)
3006 pWin->UpdateInputContext();
3007
3008 if (pTabControl)
3009 pTabControl->UpdateInputContext();
3010}
3011
3012// GetGridWidth - width of an output range (for ViewData)
3013
3015{
3016 // at present only the size of the current pane is synchronized with
3017 // the size of the visible area in Online;
3018 // as a workaround we use the same width for all panes independently
3019 // from the eWhich value
3021 {
3022 ScGridWindow* pGridWindow = aViewData.GetActiveWin();
3023 if (pGridWindow)
3024 return pGridWindow->GetSizePixel().Width();
3025 }
3026
3028 if (pGridWin[eGridWhich])
3029 return pGridWin[eGridWhich]->GetSizePixel().Width();
3030 else
3031 return 0;
3032}
3033
3034// GetGridHeight - height of an output range (for ViewData)
3035
3037{
3038 // at present only the size of the current pane is synchronized with
3039 // the size of the visible area in Online;
3040 // as a workaround we use the same height for all panes independently
3041 // from the eWhich value
3043 {
3044 ScGridWindow* pGridWindow = aViewData.GetActiveWin();
3045 if (pGridWindow)
3046 return pGridWindow->GetSizePixel().Height();
3047 }
3048
3049 ScSplitPos eGridWhich = ( eWhich == SC_SPLIT_TOP ) ? SC_SPLIT_TOPLEFT : SC_SPLIT_BOTTOMLEFT;
3050 if (pGridWin[eGridWhich])
3051 return pGridWin[eGridWhich]->GetSizePixel().Height();
3052 else
3053 return 0;
3054}
3055
3057{
3058 SC_MOD()->InputEnterHandler();
3059}
3060
3062{
3063 ScInputHandler* pHdl = SC_MOD()->GetInputHdl(aViewData.GetViewShell());
3064 if (pHdl)
3066
3067 UpdateFixPos();
3068
3070
3071 // VisArea...
3072 // AW: Discussed with NN if there is a reason that new map mode was only set for one window,
3073 // but is not. Setting only on one window causes the first repaint to have the old mapMode
3074 // in three of four views, so the overlay will save the wrong content e.g. when zooming out.
3075 // Changing to setting map mode at all windows.
3076
3077 for (sal_uInt32 i = 0; i < 4; i++)
3078 {
3079 if (pGridWin[i])
3080 pGridWin[i]->SetMapMode(pGridWin[i]->GetDrawMapMode());
3081 }
3082
3083 SetNewVisArea();
3084
3085 InterpretVisible(); // have everything calculated before painting
3086
3087 SfxBindings& rBindings = aViewData.GetBindings();
3088 rBindings.Invalidate( SID_ATTR_ZOOM );
3089 rBindings.Invalidate( SID_ATTR_ZOOMSLIDER );
3090 rBindings.Invalidate(SID_ZOOM_IN);
3091 rBindings.Invalidate(SID_ZOOM_OUT);
3092
3094
3095 // To not change too much, use pWin here
3097
3098 if ( pWin && aViewData.HasEditView( aViewData.GetActivePart() ) )
3099 {
3100 // flush OverlayManager before changing the MapMode
3101 pWin->flushOverlayManager();
3102
3103 // make sure the EditView's position and size are updated
3104 // with the right (logic, not drawing) MapMode
3107 }
3108}
3109
3111{
3112 for (sal_uInt16 i = 0; i < 4; i++)
3113 {
3114 if (pGridWin[i] && pGridWin[i]->IsVisible())
3115 pGridWin[i]->CheckNeedsRepaint();
3116 }
3117}
3118
3120{
3121 for (VclPtr<ScGridWindow> & pWin : pGridWin)
3122 {
3123 if (pWin && pWin->IsVisible() && pWin->NeedsRepaint())
3124 return true;
3125 }
3126 return false;
3127}
3128
3129/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool ValidTab(SCTAB nTab)
Definition: address.hxx:111
const SCROW MAXTILEDROW
Definition: address.hxx:77
const SCCOL SC_TABSTART_NONE
Definition: address.hxx:95
void PutInOrder(T &nStart, T &nEnd)
Definition: address.hxx:150
sal_uInt32 GetValue() const
void ShowCursor(bool bGotoCursor=true, bool bForceVisCursor=true, bool bActivate=false)
EditEngine * GetEditEngine() const
tools::Rectangle GetInvalidateRect() const
bool PrepareClose(bool bUI=true)
const vcl::KeyCode & GetKeyCode() const
bool IsMod1() const
bool IsShift() const
SCTAB Tab() const
Definition: address.hxx:283
void Set(SCCOL nCol, SCROW nRow, SCTAB nTab)
Definition: address.hxx:403
SCROW Row() const
Definition: address.hxx:274
OUString GetColRowString() const
Create a human-readable string representation of the cell address.
Definition: address.cxx:2467
SCCOL Col() const
Definition: address.hxx:279
SdrOle2Obj * GetDrawObj()
Definition: client.cxx:49
ScDPObject * GetByName(std::u16string_view rName) const
Definition: dpobject.cxx:3704
void BuildAllDimensionMembers()
Definition: dpobject.cxx:960
const ScDocument & GetDocument() const
Definition: docsh.hxx:220
void UpdatePendingRowHeights(SCTAB nUpdateTab, bool bBefore=false)
Definition: docsh5.cxx:432
ScModelObj * GetModel() const
Definition: docsh.hxx:434
SC_DLLPUBLIC sal_uInt16 GetRowHeight(SCROW nRow, SCTAB nTab, bool bHiddenAsZero=true) const
Definition: document.cxx:4228
SC_DLLPUBLIC bool GetMatrixFormulaRange(const ScAddress &rCellPos, ScRange &rMatrix)
Definition: document.cxx:5547
SC_DLLPUBLIC sal_uInt16 GetColWidth(SCCOL nCol, SCTAB nTab, bool bHiddenAsZero=true) const
Definition: document.cxx:4187
bool ValidRow(SCROW nRow) const
Definition: document.hxx:900
SC_DLLPUBLIC const ScTableProtection * GetTabProtection(SCTAB nTab) const
Definition: documen3.cxx:1928
SC_DLLPUBLIC bool ExtendMerge(SCCOL nStartCol, SCROW nStartRow, SCCOL &rEndCol, SCROW &rEndRow, SCTAB nTab, bool bRefresh=false)
Definition: document.cxx:5687
SC_DLLPUBLIC SCCOL MaxCol() const
Definition: document.hxx:892
SC_DLLPUBLIC const ScValidationData * GetValidationEntry(sal_uInt32 nIndex) const
Definition: documen4.cxx:881
SC_DLLPUBLIC formula::FormulaGrammar::AddressConvention GetAddressConvention() const
Definition: documen3.cxx:500
SC_DLLPUBLIC SCROW MaxRow() const
Definition: document.hxx:893
bool IsInVBAMode() const
Definition: document.cxx:6618
SC_DLLPUBLIC bool HasSparkline(ScAddress const &rPosition)
Definition: document.cxx:6647
SC_DLLPUBLIC void MakeTable(SCTAB nTab, bool _bNeedsNameCheck=true)
Definition: document.cxx:172
SC_DLLPUBLIC bool HasDataPilotAtPosition(ScAddress const &rAddress) const
Definition: document.hxx:848
SC_DLLPUBLIC void GetNextPos(SCCOL &rCol, SCROW &rRow, SCTAB nTab, SCCOL nMovX, SCROW nMovY, bool bMarked, bool bUnprotected, const ScMarkData &rMark, SCCOL nTabStartCol=SC_TABSTART_NONE) const
Definition: document.cxx:6221
SC_DLLPUBLIC bool ColHidden(SCCOL nCol, SCTAB nTab, SCCOL *pFirstCol=nullptr, SCCOL *pLastCol=nullptr) const
Definition: document.cxx:4512
void SkipOverlapped(SCCOL &rCol, SCROW &rRow, SCTAB nTab) const
Definition: document.cxx:5840
SC_DLLPUBLIC bool GetPrintArea(SCTAB nTab, SCCOL &rEndCol, SCROW &rEndRow, bool bNotes=true) const
Definition: documen2.cxx:613
SC_DLLPUBLIC SCROW LastVisibleRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab) const
Definition: document.cxx:4550
SC_DLLPUBLIC bool IsVisible(SCTAB nTab) const
Definition: document.cxx:920
SC_DLLPUBLIC bool IsLayoutRTL(SCTAB nTab) const
Definition: document.cxx:998
SC_DLLPUBLIC bool HasTable(SCTAB nTab) const
Definition: document.cxx:195
bool IsAutoCalcShellDisabled() const
Definition: document.hxx:1415
SC_DLLPUBLIC void GetDataArea(SCTAB nTab, SCCOL &rStartCol, SCROW &rStartRow, SCCOL &rEndCol, SCROW &rEndRow, bool bIncludeOld, bool bOnlyDown) const
Return the smallest area containing at least all contiguous cells having data.
Definition: document.cxx:1100
SC_DLLPUBLIC const SfxPoolItem * GetAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich) const
Definition: document.cxx:4789
SC_DLLPUBLIC ScDPCollection * GetDPCollection()
Definition: documen3.cxx:371
SC_DLLPUBLIC void SetVisible(SCTAB nTab, bool bVisible)
Definition: document.cxx:913
SC_DLLPUBLIC SCROW FirstVisibleRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab) const
Definition: document.cxx:4542
SC_DLLPUBLIC SCTAB GetTableCount() const
Definition: document.cxx:317
bool ValidColRow(SCCOL nCol, SCROW nRow) const
Definition: document.hxx:901
EditView * mpOtherEditView
Definition: tabview.hxx:112
ScTabViewShell * mpThisViewShell
Definition: tabview.hxx:110
void Apply(SfxViewShell *pViewShell, ScSplitPos eWhich)
Definition: tabview3.cxx:118
void Add(SfxViewShell *pViewShell, ScSplitPos eWhich)
Definition: tabview3.cxx:106
void Remove(SfxViewShell *pViewShell, ScSplitPos eWhich)
Definition: tabview3.cxx:111
std::array< VclPtr< ScGridWindow >, 4 > const & mpGridWin
Definition: tabview.hxx:111
void Modifier(ScGridWindow *pWin)
Definition: tabview3.cxx:140
void DPLaunchFieldPopupMenu(const Point &rScrPos, const Size &rScrSize, const ScAddress &rPos, ScDPObject *pDPObj)
Definition: gridwin2.cxx:439
MapMode GetDrawMapMode(bool bForce=false)
MapMode for the drawinglayer objects.
Definition: gridwin3.cxx:252
void UpdateInputContext()
Definition: gridwin.cxx:3682
void flushOverlayManager()
Definition: gridwin.cxx:6961
void SetWhich(ScSplitPos eNew)
Definition: select.cxx:807
static void SendReferenceMarks(const SfxViewShell *pViewShell, const std::vector< ReferenceMark > &rReferenceMarks)
Definition: inputhdl.cxx:306
ScInputWindow * GetInputWindow()
Definition: inputhdl.hxx:264
void UpdateLokReferenceMarks()
Definition: inputhdl.cxx:519
ScRangeFindList * GetRangeFindList()
Definition: inputhdl.hxx:253
static ReferenceMark GetReferenceMark(const ScViewData &rViewData, ScDocShell *pDocSh, tools::Long nX1, tools::Long nX2, tools::Long nY1, tools::Long nY2, tools::Long nTab, const Color &rColor)
Definition: inputhdl.cxx:469
void SetRefScale(const Fraction &rX, const Fraction &rY)
Definition: inputhdl.cxx:861
void EnterHandler(ScEnterMode nBlockMode=ScEnterMode::NORMAL, bool bBeforeSavingInLOK=false)
Definition: inputhdl.cxx:3045
sal_uInt16 GetMoveDir() const
Definition: inputopt.hxx:45
bool GetMoveSelection() const
Definition: inputopt.hxx:47
bool IsInputActive()
Definition: inputwin.cxx:621
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
Definition: markdata.hxx:43
void SelectTable(SCTAB nTab, bool bNew)
Definition: markdata.cxx:157
const ScRange & GetMarkArea() const
Definition: markdata.hxx:83
void SelectOneTable(SCTAB nTab)
Definition: markdata.cxx:174
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
void ResetMark()
Definition: markdata.cxx:80
bool IsMarked() const
Definition: markdata.hxx:80
virtual Size getDocumentSize() override
Definition: docuno.cxx:655
sal_uInt16 GetCurRefDlgId() const
Definition: scmod.hxx:228
void SetSelectionTransfer(ScSelectionTransferObj *pNew)
Definition: scmod.cxx:692
bool IsFormulaMode()
Definition: scmod.cxx:1678
bool IsRefDialogOpen()
Definition: scmod.cxx:1662
ScSelectionTransferObj * GetSelectionTransfer() const
Definition: scmod.hxx:151
void SetPos(const Point &rPos, const MapMode &rMode)
Definition: hintwin.cxx:175
Size GetSizePixel() const
Definition: hintwin.cxx:168
sal_uLong Count() const
Definition: rfindlst.hxx:50
ScRangeFindData & GetObject(sal_uLong nIndex)
Definition: rfindlst.hxx:53
const OUString & GetDocName() const
Definition: rfindlst.hxx:57
bool Contains(const ScRange &) const
Definition: rangelst.cxx:1082
size_t size() const
Definition: rangelst.hxx:89
static bool GetRangeListFromString(ScRangeList &rRangeList, std::u16string_view rRangeListStr, const ScDocument &rDocument, formula::FormulaGrammar::AddressConvention eConv, sal_Unicode cSeparator=' ', sal_Unicode cQuote='\'')
Definition: rangeutl.cxx:552
void PutInOrder()
Definition: address.hxx:622
ScAddress aEnd
Definition: address.hxx:498
bool Contains(const ScAddress &) const
is Address& fully in Range?
Definition: address.hxx:718
ScAddress aStart
Definition: address.hxx:497
static rtl::Reference< ScSelectionTransferObj > CreateFromView(ScTabView *pSource)
Definition: seltrans.cxx:70
void SelectionChanged()
Definition: viewuno.cxx:1645
bool GetForceFocusOnCurCell() const
Definition: tabvwsh.hxx:390
virtual const FmFormShell * GetFormShell() const override
Definition: tabvwsh.hxx:344
void SetSparklineShell(bool bActive)
Definition: tabvwsh4.cxx:695
void UpdateInputHandler(bool bForce=false, bool bStopEditing=true)
Definition: tabvwsha.cxx:674
void SetPivotShell(bool bActive)
Definition: tabvwsh4.cxx:673
void SetForceFocusOnCurCell(bool bFlag)
Definition: tabvwsh.hxx:391
void BroadcastAccessibility(const SfxHint &rHint)
Definition: tabvwshh.cxx:236
bool HasAccessibilityObjects() const
Definition: tabvwshh.cxx:242
void WindowChanged()
Definition: tabvwsh2.cxx:54
const ScInputHandler * GetInputHandler() const
Definition: tabvwsh.hxx:237
bool IsRefInputMode() const
Definition: tabvwsha.cxx:624
void AddHighlightRange(const ScRange &rRange, const Color &rColor)
Definition: tabview3.cxx:2546
void UpdatePageBreakData(bool bForcePaint=false)
Definition: tabview2.cxx:1479
sal_uInt16 GetLockedModifiers() const
Definition: tabview.cxx:1973
void TabChanged(bool bSameTabButMoved=false)
Called after moving, copying, inserting or deleting a sheet.
Definition: tabview5.cxx:280
void InitBlockMode(SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, bool bTestNeg=false, bool bCols=false, bool bRows=false, bool bForceNeg=false)
Definition: tabview2.cxx:353
std::array< VclPtr< ScColBar >, 2 > pColBar
Definition: tabview.hxx:143
void PaintLeft()
Definition: tabview3.cxx:2731
void FakeButtonUp(ScSplitPos eWhich)
Definition: tabview3.cxx:214
std::array< VclPtr< ScOutlineWindow >, 2 > pRowOutline
Definition: tabview.hxx:146
void UpdateAutoFillMark(bool bFromPaste=false)
Definition: tabview3.cxx:187
bool MoveCursorKeyInput(const KeyEvent &rKeyEvent)
Definition: tabview3.cxx:1466
void GetAreaMoveEndPosition(SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, SCCOL &rAreaX, SCROW &rAreaY, ScFollowMode &rMode)
Definition: tabview2.cxx:649
void CheckNeedsRepaint()
Definition: tabview3.cxx:3110
std::unique_ptr< ScViewSelectionEngine > pSelEngine
Definition: tabview.hxx:124
void PaintTopArea(SCCOL nStartCol, SCCOL nEndCol)
Definition: tabview3.cxx:2684
void AddWindowToForeignEditView(SfxViewShell *pViewShell, ScSplitPos eWhich)
Definition: tabview3.cxx:2060
void SelectTabPage(const sal_uInt16 nTab)
Definition: tabview3.cxx:1812
void UpdateVarZoom()
Definition: tabview.cxx:721
void UpdateShow()
Definition: tabview.cxx:1484
void TestHintWindow()
Definition: tabview3.cxx:780
ScHeaderFunctionSet aHdrFunc
Definition: tabview.hxx:128
void MarkRows()
Definition: tabview3.cxx:1595
std::shared_ptr< sc::SpellCheckContext > mpSpellCheckCxt
Definition: tabview.hxx:157
void AlignToCursor(SCCOL nCurX, SCROW nCurY, ScFollowMode eMode, const ScSplitPos *pWhich=nullptr)
Definition: tabview3.cxx:917
void DoChartSelection(const css::uno::Sequence< css::chart2::data::HighlightedRange > &rHilightRanges)
Definition: tabview3.cxx:2570
bool bMoveIsShift
Definition: tabview.hxx:208
void DoneBlockMode(bool bContinue=false)
Definition: tabview2.cxx:409
Size aFrameSize
Definition: tabview.hxx:132
void MarkDataArea(bool bIncludeCursor=true)
Definition: tabview3.cxx:1677
void RemoveHintWindow()
Definition: tabview3.cxx:878
void DoneRefMode(bool bContinue=false)
Definition: tabview4.cxx:159
void DrawEnableAnim(bool bSet)
Definition: tabview5.cxx:501
void SelectionChanged(bool bFromPaste=false)
Definition: tabview3.cxx:532
void MoveCursorEnd(SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, bool bShift, bool bKeepSel=false)
Definition: tabview3.cxx:1342
std::array< VclPtr< ScGridWindow >, 4 > pGridWin
Definition: tabview.hxx:142
VclPtr< ScTabControl > pTabControl
Definition: tabview.hxx:149
bool PaintExtras()
Definition: tabview3.cxx:2784
SC_DLLPUBLIC void RefreshZoom()
Definition: tabview5.cxx:432
void MarkRange(const ScRange &rRange, bool bSetCursor=true, bool bContinue=false)
Definition: tabview3.cxx:1708
void MakeEditView(ScEditEngineDefaulter *pEngine, SCCOL nCol, SCROW nRow)
Definition: tabview3.cxx:2113
void FindNextUnprot(bool bShift, bool bInSelection)
Definition: tabview3.cxx:1541
void CheckSelectionTransfer()
Definition: tabview3.cxx:474
bool SelMouseButtonDown(const MouseEvent &rMEvt)
Definition: tabview3.cxx:1169
void ClearHighlightRanges()
Definition: tabview3.cxx:2556
void ActivateView(bool bActivate, bool bFirst)
Definition: tabview3.cxx:2828
tools::Long GetGridWidth(ScHSplitPos eWhich)
Definition: tabview3.cxx:3014
void InitRefMode(SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, ScRefType eType)
Definition: tabview4.cxx:309
bool NeedsRepaint()
Definition: tabview3.cxx:3119
void UpdateHeaderWidth(const ScVSplitPos *pWhich=nullptr, const SCROW *pPosY=nullptr)
Definition: tabview.cxx:1415
void MarkCursor(SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, bool bCols=false, bool bRows=false, bool bCellSelection=false)
Definition: tabview2.cxx:449
void MoveCursorPage(SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, bool bShift, bool bKeepSel=false)
Definition: tabview3.cxx:1326
std::unique_ptr< sdr::overlay::OverlayObjectList > mxInputHintOO
Definition: tabview.hxx:159
void MoveCursorRel(SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, bool bShift, bool bKeepSel=false)
Definition: tabview3.cxx:1268
void PaintArea(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, ScUpdateMode eMode=ScUpdateMode::All)
Definition: tabview3.cxx:2328
tools::Long GetGridHeight(ScVSplitPos eWhich)
Definition: tabview3.cxx:3036
SC_DLLPUBLIC void MoveCursorAbs(SCCOL nCurX, SCROW nCurY, ScFollowMode eMode, bool bShift, bool bControl, bool bKeepOld=false, bool bKeepSel=false)
Definition: tabview3.cxx:1191
static void UpdateInputLine()
Definition: tabview3.cxx:3056
ScViewData & GetViewData()
Definition: tabview.hxx:341
void SetZoom(const Fraction &rNewX, const Fraction &rNewY, bool bAll)
Definition: tabview5.cxx:424
void SkipCursorHorizontal(SCCOL &rCurX, SCROW &rCurY, SCCOL nOldX, SCCOL nMovX)
Definition: tabview2.cxx:727
void ShowAllCursors()
Definition: tabview3.cxx:234
ScGridWindow * GetActiveWin()
Definition: tabview.cxx:878
ScViewData aViewData
Definition: tabview.hxx:122
std::vector< ScHighlightEntry > maHighlightRanges
Definition: tabview.hxx:162
void DoResize(const Point &rOffset, const Size &rSize, bool bInner=false)
Definition: tabview.cxx:275
SC_DLLPUBLIC void SetCursor(SCCOL nPosX, SCROW nPosY, bool bNew=false)
Definition: tabview3.cxx:363
void ScrollX(tools::Long nDeltaX, ScHSplitPos eWhich, bool bUpdBars=true)
Definition: tabview.cxx:1220
void Unmark()
Definition: tabview3.cxx:1744
void ZoomChanged()
Definition: tabview3.cxx:3061
void MoveCursorScreen(SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, bool bShift)
Definition: tabview3.cxx:1372
void UpdateSelectionOverlay()
Definition: tabview2.cxx:1021
void ClickCursor(SCCOL nPosX, SCROW nPosY, bool bControl)
Definition: tabview3.cxx:162
void UpdateFormulas(SCCOL nStartCol=-1, SCROW nStartRow=-1, SCCOL nEndCol=-1, SCROW nEndRow=-1)
Definition: tabview3.cxx:2305
SC_DLLPUBLIC void CellContentChanged()
Definition: tabview3.cxx:513
std::unique_ptr< ScDrawView > pDrawView
Definition: tabview.hxx:130
ScExtraEditViewManager aExtraEditViewManager
Definition: tabview.hxx:171
void MarkMatrixFormula()
Definition: tabview3.cxx:1697
void ActivatePart(ScSplitPos eWhich)
Definition: tabview3.cxx:2904
void HideListBox()
Definition: tabview3.cxx:2993
std::array< VclPtr< ScRowBar >, 2 > pRowBar
Definition: tabview.hxx:144
void HideNoteMarker()
Definition: tabview2.cxx:1420
void RecalcPPT()
Definition: tabview3.cxx:2799
void DoDPFieldPopup(std::u16string_view rPivotTableName, sal_Int32 nDimensionIndex, Point aPoint, Size aSize)
Definition: tabview3.cxx:2628
void SelectNextTab(short nDir, bool bExtendSelection)
Definition: tabview3.cxx:1774
bool HasHintWindow() const
Definition: tabview3.cxx:876
void CreateAnchorHandles(SdrHdlList &rHdl, const ScAddress &rAddress)
Definition: tabview3.cxx:2675
void InvalidateSplit()
Definition: tabview.cxx:2210
std::unique_ptr< ScHeaderSelectionEngine > pHdrSelEng
Definition: tabview.hxx:127
void SetMarkData(const ScMarkData &rNew)
Definition: tabview3.cxx:1758
void MarkDataChanged()
Definition: tabview3.cxx:1767
void DrawDeselectAll()
Definition: tabview5.cxx:385
void ScrollY(tools::Long nDeltaY, ScVSplitPos eWhich, bool bUpdBars=true)
Definition: tabview.cxx:1303
void UpdateRef(SCCOL nCurX, SCROW nCurY, SCTAB nCurZ)
Definition: tabview4.cxx:186
void KillEditView(bool bNoPaint)
Definition: tabview3.cxx:2193
bool bInActivatePart
Definition: tabview.hxx:206
void MoveCursorEnter(bool bShift)
Definition: tabview3.cxx:1409
void PaintTop()
Definition: tabview3.cxx:2664
void ActiveGrabFocus()
Definition: tabview.cxx:892
void CursorPosChanged()
Definition: tabview3.cxx:626
void SetNewVisArea()
Definition: tabview.cxx:2222
void InitOwnBlockMode(const ScRange &rMarkRange)
Definition: tabview2.cxx:332
Point aBorderPos
Definition: tabview.hxx:133
void UpdateScrollBars(HeaderType eHeaderType=BOTH_HEADERS)
Definition: tabview4.cxx:389
void ShowCursor()
Definition: tabview3.cxx:246
void SkipCursorVertical(SCCOL &rCurX, SCROW &rCurY, SCROW nOldY, SCROW nMovY)
Definition: tabview2.cxx:796
SC_DLLPUBLIC void SetTabNo(SCTAB nTab, bool bNew=false, bool bExtendSelection=false, bool bSameTabButMoved=false)
Definition: tabview3.cxx:1819
void InterpretVisible()
Definition: tabview4.cxx:498
void MarkColumns()
Definition: tabview3.cxx:1568
bool UpdateVisibleRange()
Definition: tabview.cxx:1564
void HideAllCursors()
Definition: tabview3.cxx:220
void OnLibreOfficeKitTabChanged()
Definition: tabview3.cxx:2070
void MoveCursorArea(SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, bool bShift, bool bKeepSel=false)
Definition: tabview3.cxx:1334
void SetTabProtectionSymbol(SCTAB nTab, const bool bProtect)
Definition: tabview3.cxx:527
void PaintRangeFinder(tools::Long nNumber)
Definition: tabview3.cxx:2518
void UpdateEditView()
Definition: tabview3.cxx:2170
void InvalidateAttribs()
Definition: tabview3.cxx:252
std::array< VclPtr< ScOutlineWindow >, 2 > pColOutline
Definition: tabview.hxx:145
void GetPageMoveEndPosition(SCCOL nMovX, SCROW nMovY, SCCOL &rPageX, SCROW &rPageY)
Definition: tabview2.cxx:599
void PaintBlock(bool bReset)
divide PaintBlock into two methods: RepaintBlock and RemoveBlock or similar
Definition: tabview2.cxx:1046
void PaintRangeFinderEntry(const ScRangeFindData *pData, SCTAB nTab)
Update marks for a selected Range.
Definition: tabview3.cxx:2457
void RepeatResize(bool bUpdateFix=true)
Definition: tabview.cxx:763
ScViewFunctionSet aFunctionSet
Definition: tabview.hxx:125
void PaintLeftArea(SCROW nStartRow, SCROW nEndRow)
Definition: tabview3.cxx:2742
VclPtr< vcl::Window > pFrameWin
Definition: tabview.hxx:121
void UpdateInputContext()
Definition: tabview3.cxx:3002
void RemoveWindowFromForeignEditView(SfxViewShell *pViewShell, ScSplitPos eWhich)
Definition: tabview3.cxx:2065
void UpdateFixPos()
Definition: tabview.cxx:750
void PaintGrid()
Definition: tabview3.cxx:2653
sheet protection state container
bool isOptionEnabled(Option eOption) const
virtual bool isProtected() const override
void RefreshZoom()
Definition: viewdata.cxx:1115
SCROW GetOldCurY() const
Definition: viewdata.cxx:1382
SCCOL GetEditEndCol() const
Definition: viewdata.hxx:607
SCROW GetEditEndRow() const
Definition: viewdata.hxx:608
SCCOL CellsAtX(SCCOL nPosX, SCCOL nDir, ScHSplitPos eWhichX, sal_uInt16 nScrSizeY=SC_SIZE_NONE) const
Definition: viewdata.cxx:2629
bool GetMergeSizePixel(SCCOL nX, SCROW nY, tools::Long &rSizeXPix, tools::Long &rSizeYPix) const
Definition: viewdata.cxx:2727
bool UpdateFixX(SCTAB nTab=MAXTAB+1)
Definition: viewdata.cxx:4030
const ScViewOptions & GetOptions() const
Definition: viewdata.hxx:554
SCROW GetFixPosY() const
Definition: viewdata.hxx:421
ScMarkData & GetMarkData()
Definition: viewdata.cxx:3141
SCROW GetCurYForTab(SCTAB nTabIndex) const
Definition: viewdata.cxx:1438
SCCOL GetTabStartCol() const
Definition: viewdata.hxx:660
SCCOL GetCurXForTab(SCTAB nTabIndex) const
Definition: viewdata.cxx:1430
const Fraction & GetZoomY() const
Definition: viewdata.hxx:460
SCROW GetEditStartRow() const
Definition: viewdata.hxx:606
void RecalcPixPos()
Definition: viewdata.cxx:2991
SCROW GetMaxTiledRow() const
Definition: viewdata.hxx:423
SCTAB GetTabNo() const
Definition: viewdata.hxx:395
void SetTabNo(SCTAB nNewTab)
Definition: viewdata.cxx:2314
ScDocument & GetDocument() const
Definition: viewdata.hxx:380
void GetMoveCursor(SCCOL &rCurX, SCROW &rCurY)
Definition: viewdata.hxx:708
SCROW GetPosY(ScVSplitPos eWhich, SCTAB nForTab=-1) const
Definition: viewdata.cxx:1416
const Size & GetScrSize() const
Definition: viewdata.hxx:644
SCCOL GetMaxTiledCol() const
Definition: viewdata.hxx:422
ScSplitMode GetHSplitMode() const
Definition: viewdata.hxx:416
SCCOL GetEditStartCol() const
Definition: viewdata.hxx:605
double GetPPTY() const
Definition: viewdata.hxx:469
const MapMode & GetLogicMode(ScSplitPos eWhich)
Definition: viewdata.cxx:3015
void UpdateInputHandler(bool bForce=false)
Definition: viewdata.cxx:4019
ScDocShell * GetDocShell() const
Definition: viewdata.hxx:354
SCCOL GetOldCurX() const
Definition: viewdata.cxx:1374
ScGridWindow * GetActiveWin()
Definition: viewdata.cxx:3157
bool UpdateFixY(SCTAB nTab=MAXTAB+1)
Definition: viewdata.cxx:4065
void GetPosFromPixel(tools::Long nClickX, tools::Long nClickY, ScSplitPos eWhich, SCCOL &rPosX, SCROW &rPosY, bool bTestMerge=true, bool bRepair=false, SCTAB nForTab=-1)
Definition: viewdata.cxx:2780
ScTabViewShell * GetViewShell() const
Definition: viewdata.hxx:357
ScMarkType GetSimpleArea(SCCOL &rStartCol, SCROW &rStartRow, SCTAB &rStartTab, SCCOL &rEndCol, SCROW &rEndRow, SCTAB &rEndTab) const
Definition: viewdata.cxx:1181
void SetTabStartCol(SCCOL nNew)
Definition: viewdata.hxx:661
ScDBFunc * GetView() const
Definition: viewdata.cxx:863
SCROW VisibleCellsY(ScVSplitPos eWhichY) const
Definition: viewdata.cxx:2712
ScSplitPos GetActivePart() const
Definition: viewdata.hxx:398
void SetMaxTiledCol(SCCOL nCol)
Definition: viewdata.cxx:1462
void ResetOldCursor()
Definition: viewdata.cxx:1397
void GetEditView(ScSplitPos eWhich, EditView *&rViewPtr, SCCOL &rCol, SCROW &rRow)
Definition: viewdata.cxx:2279
SCROW GetRefEndY() const
Definition: viewdata.hxx:536
Point GetScrPos(SCCOL nWhereX, SCROW nWhereY, ScSplitPos eWhich, bool bAllowNeg=false, SCTAB nForTab=-1) const
Definition: viewdata.cxx:2375
void SetActivePart(ScSplitPos eNewActive)
Definition: viewdata.cxx:2350
void ResetEditView()
Definition: viewdata.cxx:2243
SCROW CellsAtY(SCROW nPosY, SCROW nDir, ScVSplitPos eWhichY, sal_uInt16 nScrSizeX=SC_SIZE_NONE) const
Definition: viewdata.cxx:2671
bool IsActive() const
Definition: viewdata.hxx:382
SCCOL GetRefEndX() const
Definition: viewdata.hxx:535
SCCOL VisibleCellsX(ScHSplitPos eWhichX) const
Definition: viewdata.cxx:2707
void SetMaxTiledRow(SCROW nRow)
Definition: viewdata.cxx:1484
void SetOldCursor(SCCOL nNewX, SCROW nNewY)
Definition: viewdata.cxx:1390
ScSplitMode GetVSplitMode() const
Definition: viewdata.hxx:417
const Fraction & GetZoomX() const
Definition: viewdata.hxx:459
SCTAB GetRefTabNo() const
Definition: viewdata.hxx:392
SCCOL GetFixPosX() const
Definition: viewdata.hxx:420
void SetSelCtrlMouseClick(bool bTmp)
Definition: viewdata.hxx:456
bool IsPagebreakMode() const
Definition: viewdata.hxx:425
ScAddress GetCurPos() const
Definition: viewdata.cxx:4131
bool IsRefMode() const
Definition: viewdata.hxx:530
double GetPPTX() const
Definition: viewdata.hxx:468
void SetEditEngine(ScSplitPos eWhich, ScEditEngineDefaulter *pNewEngine, vcl::Window *pWin, SCCOL nNewX, SCROW nNewY)
Definition: viewdata.cxx:1520
void SetRefTabNo(SCTAB nNewTab)
Definition: viewdata.hxx:393
EditView * GetSpellingView() const
Definition: viewdata.hxx:651
SfxBindings & GetBindings()
Definition: viewdata.cxx:3129
bool HasEditView(ScSplitPos eWhich) const
Definition: viewdata.hxx:582
SCROW GetCurY() const
Definition: viewdata.hxx:402
void Activate(bool bActivate)
Definition: viewdata.hxx:383
void SetCurX(SCCOL nNewCurX)
Definition: viewdata.hxx:431
SCCOL GetCurX() const
Definition: viewdata.hxx:401
bool IsAnyFillMode() const
Definition: viewdata.hxx:514
SCCOL GetPosX(ScHSplitPos eWhich, SCTAB nForTab=-1) const
Definition: viewdata.cxx:1402
void SetCurY(SCROW nNewCurY)
Definition: viewdata.hxx:432
bool SetCursorAtCell(SCCOL nPosX, SCROW nPosY, bool bScroll)
Definition: select.cxx:434
bool GetOption(ScViewOption eOpt) const
Definition: viewopti.hxx:89
Size GetOrigObjSize(MapMode const *pTargetMapMode=nullptr) const
virtual const tools::Rectangle & GetLogicRect() const override
void Invalidate(sal_uInt16 nId)
std::shared_ptr< SfxDialogController > & GetController()
css::uno::Reference< css::frame::XController > GetController() const
bool SetObjArea(const tools::Rectangle &)
const tools::Rectangle & GetObjArea() const
bool IsObjectInPlaceActive() const
static void notifyInvalidation(SfxViewShell const *pThisView, tools::Rectangle const *)
static void forEachOtherView(ViewShellType *pThisViewShell, FunctionType f)
static void notifyDocumentSizeChanged(SfxViewShell const *pThisView, const OString &rPayload, vcl::ITiledRenderable *pDoc, bool bInvalidateAll=true)
OUString GetTitle(sal_uInt16 nMaxLen=0) const
bool HasChildWindow(sal_uInt16)
SfxChildWindow * GetChildWindow(sal_uInt16)
SfxFrame & GetFrame() const
void DisconnectAllClients()
SfxViewFrame & GetViewFrame() const
virtual css::uno::Reference< css::frame::XModel > GetCurrentDocument() const
SfxInPlaceClient * GetIPClient() const
void SetWindow(vcl::Window *pViewPort)
virtual void libreOfficeKitViewCallback(int nType, const char *pPayload) const override
constexpr tools::Long getHeight() const
constexpr tools::Long Height() const
constexpr tools::Long getWidth() const
constexpr tools::Long Width() const
static UITestLogger & getInstance()
void logEvent(const EventDescription &rDescription)
static sal_Unicode GetNativeSymbolChar(OpCode eOp)
ColorConfigValue GetColorValue(ColorConfigEntry eEntry, bool bSmart=true) const
bool Overlaps(const tools::Rectangle &rRect) const
constexpr tools::Long Top() const
void SetSize(const Size &)
void SetPos(const Point &rPoint)
constexpr tools::Long Right() const
constexpr tools::Long GetHeight() const
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
bool IsVisible() const
bool IsMod1() const
sal_uInt16 GetCode() const
bool IsShift() const
bool IsMod2() const
Point OutputToScreenPixel(const Point &rPos) const
Point LogicToPixel(const Point &rLogicPt) const
void GrabFocus()
void SetMapMode()
Point PixelToLogic(const Point &rDevicePt) const
virtual Size GetSizePixel() const
Size GetOutputSizePixel() const
weld::Window * GetFrameWeld() const
virtual bool get_extents_relative_to(const Widget &rRelative, int &x, int &y, int &width, int &height) const=0
ColorTransparency
int nCount
#define DBG_ASSERT(sCon, aError)
float y
float x
const sal_uInt8 SC_CLIPMARK_SIZE
Definition: fillinfo.hxx:51
ScDirection
Definition: global.hxx:342
@ DIR_LEFT
Definition: global.hxx:346
@ DIR_TOP
Definition: global.hxx:345
@ DIR_RIGHT
Definition: global.hxx:344
@ DIR_BOTTOM
Definition: global.hxx:343
const sal_uInt16 idx[]
sal_Int32 nIndex
Mode eMode
void * p
constexpr sal_uInt16 KEY_MOD1
constexpr sal_uInt16 KEY_HOME
constexpr sal_uInt16 KEY_LEFT
constexpr sal_uInt16 KEY_PAGEDOWN
constexpr sal_uInt16 KEY_UP
constexpr sal_uInt16 KEY_RIGHT
constexpr sal_uInt16 KEY_DOWN
constexpr sal_uInt16 KEY_PAGEUP
constexpr sal_uInt16 KEY_SHIFT
constexpr sal_uInt16 KEY_END
const long LONG_MAX
#define SAL_WARN(area, stream)
std::unique_ptr< sal_Int32[]> pData
sal_uInt16 nCode
int i
CALCNOTESBACKGROUND
long Long
ocSep
constexpr TypedWhichId< SfxUInt32Item > ATTR_VALIDDATA(153)
#define SC_MOD()
Definition: scmod.hxx:249
std::map< OUString, OUString > aParameters
Reference< XController > xController
static weld::Window * lcl_GetCareWin(SfxViewFrame &rViewFrm)
Definition: tabview3.cxx:884
static bool lcl_IsRefDlgActive(SfxViewFrame &rViewFrm)
Definition: tabview3.cxx:452
sal_uInt16 sal_Unicode
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
Definition: types.hxx:23
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17
#define stringstream
Definition: utils.hxx:45
ScSplitPos
Definition: viewdata.hxx:44
@ SC_SPLIT_BOTTOMRIGHT
Definition: viewdata.hxx:44
@ SC_SPLIT_TOPLEFT
Definition: viewdata.hxx:44
@ SC_SPLIT_BOTTOMLEFT
Definition: viewdata.hxx:44
@ SC_SPLIT_TOPRIGHT
Definition: viewdata.hxx:44
ScHSplitPos WhichH(ScSplitPos ePos)
Definition: viewdata.hxx:722
ScMarkType
States GetSimpleArea() returns for the underlying selection marks, so the caller can react if the res...
Definition: viewdata.hxx:61
@ SC_MARK_SIMPLE
Definition: viewdata.hxx:65
@ SC_MARK_SIMPLE_FILTERED
Definition: viewdata.hxx:67
ScFollowMode
Screen behavior related to cursor movements.
Definition: viewdata.hxx:52
@ SC_FOLLOW_JUMP
Definition: viewdata.hxx:52
@ SC_FOLLOW_NONE
Definition: viewdata.hxx:52
@ SC_FOLLOW_LINE
Definition: viewdata.hxx:52
@ SC_FOLLOW_FIX
Definition: viewdata.hxx:52
@ SC_SPLIT_FIX
Definition: viewdata.hxx:42
@ SC_REFTYPE_REF
Definition: viewdata.hxx:55
ScHSplitPos
Definition: viewdata.hxx:45
@ SC_SPLIT_LEFT
Definition: viewdata.hxx:45
@ SC_SPLIT_RIGHT
Definition: viewdata.hxx:45
ScVSplitPos WhichV(ScSplitPos ePos)
Definition: viewdata.hxx:728
ScVSplitPos
Definition: viewdata.hxx:46
@ SC_SPLIT_TOP
Definition: viewdata.hxx:46
@ SC_SPLIT_BOTTOM
Definition: viewdata.hxx:46
@ VOPT_CLIPMARKS
Definition: viewopti.hxx:49
ScUpdateMode
Definition: viewutil.hxx:39