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 // StarCalc knows only paragraph- or cell format templates
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 ? comphelper::getFromUnoTunnel<ScModelObj>( 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* pViewFrm)
453{
454 ScModule* pScMod = SC_MOD();
455 if (!pScMod->IsRefDialogOpen())
456 return false;
457
458 auto nDlgId = pScMod->GetCurRefDlgId();
459 if (!pViewFrm->HasChildWindow(nDlgId))
460 return false;
461
462 SfxChildWindow* pChild = pViewFrm->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 if (pViewFrame)
536 {
537 uno::Reference<frame::XController> xController = pViewFrame->GetFrame().GetController();
538 if (xController.is())
539 {
540 ScTabViewObj* pImp = comphelper::getFromUnoTunnel<ScTabViewObj>( xController );
541 if (pImp)
542 pImp->SelectionChanged();
543 }
544 }
545
546 UpdateAutoFillMark(bFromPaste); // also calls CheckSelectionTransfer
547
548 SfxBindings& rBindings = aViewData.GetBindings();
549
550 rBindings.Invalidate( SID_CURRENTCELL ); // -> Navigator
551 rBindings.Invalidate( SID_AUTO_FILTER ); // -> Menu
552 rBindings.Invalidate( FID_NOTE_VISIBLE );
553 rBindings.Invalidate( FID_SHOW_NOTE );
554 rBindings.Invalidate( FID_HIDE_NOTE );
555 rBindings.Invalidate( FID_SHOW_ALL_NOTES );
556 rBindings.Invalidate( FID_HIDE_ALL_NOTES );
557 rBindings.Invalidate( SID_TOGGLE_NOTES );
558 rBindings.Invalidate( SID_DELETE_NOTE );
559 rBindings.Invalidate( SID_ROWCOL_SELCOUNT );
560
561 // functions than may need to be disabled
562
563 rBindings.Invalidate( FID_INS_ROWBRK );
564 rBindings.Invalidate( FID_INS_COLBRK );
565 rBindings.Invalidate( FID_DEL_ROWBRK );
566 rBindings.Invalidate( FID_DEL_COLBRK );
567 rBindings.Invalidate( FID_MERGE_ON );
568 rBindings.Invalidate( FID_MERGE_OFF );
569 rBindings.Invalidate( FID_MERGE_TOGGLE );
570 rBindings.Invalidate( SID_AUTOFILTER_HIDE );
571 rBindings.Invalidate( SID_UNFILTER );
572 rBindings.Invalidate( SID_REIMPORT_DATA );
573 rBindings.Invalidate( SID_REFRESH_DBAREA );
574 rBindings.Invalidate( SID_OUTLINE_SHOW );
575 rBindings.Invalidate( SID_OUTLINE_HIDE );
576 rBindings.Invalidate( SID_OUTLINE_REMOVE );
577 rBindings.Invalidate( FID_FILL_TO_BOTTOM );
578 rBindings.Invalidate( FID_FILL_TO_RIGHT );
579 rBindings.Invalidate( FID_FILL_TO_TOP );
580 rBindings.Invalidate( FID_FILL_TO_LEFT );
581 rBindings.Invalidate( FID_FILL_SERIES );
582 rBindings.Invalidate( SID_SCENARIOS );
583 rBindings.Invalidate( SID_AUTOFORMAT );
584 rBindings.Invalidate( SID_OPENDLG_TABOP );
585 rBindings.Invalidate( SID_DATA_SELECT );
586
587 rBindings.Invalidate( SID_CUT );
588 rBindings.Invalidate( SID_COPY );
589 rBindings.Invalidate( SID_PASTE );
590 rBindings.Invalidate( SID_PASTE_SPECIAL );
591 rBindings.Invalidate( SID_PASTE_UNFORMATTED );
592
593 rBindings.Invalidate( FID_INS_ROW );
594 rBindings.Invalidate( FID_INS_COLUMN );
595 rBindings.Invalidate( FID_INS_ROWS_BEFORE );
596 rBindings.Invalidate( FID_INS_COLUMNS_BEFORE );
597 rBindings.Invalidate( FID_INS_ROWS_AFTER );
598 rBindings.Invalidate( FID_INS_COLUMNS_AFTER );
599 rBindings.Invalidate( FID_INS_CELL );
600 rBindings.Invalidate( FID_INS_CELLSDOWN );
601 rBindings.Invalidate( FID_INS_CELLSRIGHT );
602
603 rBindings.Invalidate( FID_CHG_COMMENT );
604
605 // only due to protect cell:
606
607 rBindings.Invalidate( SID_CELL_FORMAT_RESET );
608 rBindings.Invalidate( SID_DELETE );
609 rBindings.Invalidate( SID_DELETE_CONTENTS );
610 rBindings.Invalidate( FID_DELETE_CELL );
611 rBindings.Invalidate( FID_CELL_FORMAT );
612 rBindings.Invalidate( SID_ENABLE_HYPHENATION );
613 rBindings.Invalidate( SID_INSERT_POSTIT );
614 rBindings.Invalidate( SID_CHARMAP );
615 rBindings.Invalidate( SID_OPENDLG_FUNCTION );
616 rBindings.Invalidate( FID_VALIDATION );
617 rBindings.Invalidate( SID_EXTERNAL_SOURCE );
618 rBindings.Invalidate( SID_TEXT_TO_COLUMNS );
619 rBindings.Invalidate( SID_SORT_ASCENDING );
620 rBindings.Invalidate( SID_SORT_DESCENDING );
621 rBindings.Invalidate( SID_SELECT_UNPROTECTED_CELLS );
622
624 aViewData.GetViewShell()->BroadcastAccessibility(SfxHint(SfxHintId::ScAccCursorChanged));
625
627}
628
630{
631 bool bRefMode = SC_MOD()->IsFormulaMode();
632 if ( !bRefMode ) // check that RefMode works when switching sheets
633 aViewData.GetDocShell()->Broadcast( SfxHint( SfxHintId::ScKillEditView ) );
634
635 // Broadcast, so that other Views of the document also switch
636
637 ScDocument& rDocument = aViewData.GetDocument();
638 bool bDataPilot = rDocument.HasDataPilotAtPosition(aViewData.GetCurPos());
639 aViewData.GetViewShell()->SetPivotShell(bDataPilot);
640
641 if (!bDataPilot)
642 {
643 bool bSparkline = rDocument.HasSparkline(aViewData.GetCurPos());
645 }
646
647 // UpdateInputHandler now in CellContentChanged
648
650
652}
653
654namespace {
655
656Point calcHintWindowPosition(
657 const Point& rCellPos, const Size& rCellSize, const Size& rFrameWndSize, const Size& rHintWndSize)
658{
659 const tools::Long nMargin = 20;
660
661 tools::Long nMLeft = rCellPos.X();
662 tools::Long nMRight = rFrameWndSize.Width() - rCellPos.X() - rCellSize.Width();
663 tools::Long nMTop = rCellPos.Y();
664 tools::Long nMBottom = rFrameWndSize.Height() - rCellPos.Y() - rCellSize.Height();
665
666 // First, see if we can fit the entire hint window in the visible region.
667
668 if (nMRight - nMargin >= rHintWndSize.Width())
669 {
670 // Right margin is wide enough.
671 if (rFrameWndSize.Height() >= rHintWndSize.Height())
672 {
673 // The frame has enough height. Take it.
674 Point aPos = rCellPos;
675 aPos.AdjustX(rCellSize.Width() + nMargin );
676 if (aPos.Y() + rHintWndSize.Height() > rFrameWndSize.Height())
677 {
678 // Push the hint window up a bit to make it fit.
679 aPos.setY( rFrameWndSize.Height() - rHintWndSize.Height() );
680 }
681 return aPos;
682 }
683 }
684
685 if (nMBottom - nMargin >= rHintWndSize.Height())
686 {
687 // Bottom margin is high enough.
688 if (rFrameWndSize.Width() >= rHintWndSize.Width())
689 {
690 // The frame has enough width. Take it.
691 Point aPos = rCellPos;
692 aPos.AdjustY(rCellSize.Height() + nMargin );
693 if (aPos.X() + rHintWndSize.Width() > rFrameWndSize.Width())
694 {
695 // Move the hint window to the left to make it fit.
696 aPos.setX( rFrameWndSize.Width() - rHintWndSize.Width() );
697 }
698 return aPos;
699 }
700 }
701
702 if (nMLeft - nMargin >= rHintWndSize.Width())
703 {
704 // Left margin is wide enough.
705 if (rFrameWndSize.Height() >= rHintWndSize.Height())
706 {
707 // The frame is high enough. Take it.
708 Point aPos = rCellPos;
709 aPos.AdjustX( -(rHintWndSize.Width() + nMargin) );
710 if (aPos.Y() + rHintWndSize.Height() > rFrameWndSize.Height())
711 {
712 // Push the hint window up a bit to make it fit.
713 aPos.setY( rFrameWndSize.Height() - rHintWndSize.Height() );
714 }
715 return aPos;
716 }
717 }
718
719 if (nMTop - nMargin >= rHintWndSize.Height())
720 {
721 // Top margin is high enough.
722 if (rFrameWndSize.Width() >= rHintWndSize.Width())
723 {
724 // The frame is wide enough. Take it.
725 Point aPos = rCellPos;
726 aPos.AdjustY( -(rHintWndSize.Height() + nMargin) );
727 if (aPos.X() + rHintWndSize.Width() > rFrameWndSize.Width())
728 {
729 // Move the hint window to the left to make it fit.
730 aPos.setX( rFrameWndSize.Width() - rHintWndSize.Width() );
731 }
732 return aPos;
733 }
734 }
735
736 // The popup doesn't fit in any direction in its entirety. Do our best.
737
738 if (nMRight - nMargin >= rHintWndSize.Width())
739 {
740 // Right margin is good enough.
741 Point aPos = rCellPos;
742 aPos.AdjustX(nMargin + rCellSize.Width() );
743 aPos.setY( 0 );
744 return aPos;
745 }
746
747 if (nMBottom - nMargin >= rHintWndSize.Height())
748 {
749 // Bottom margin is good enough.
750 Point aPos = rCellPos;
751 aPos.AdjustY(nMargin + rCellSize.Height() );
752 aPos.setX( 0 );
753 return aPos;
754 }
755
756 if (nMLeft - nMargin >= rHintWndSize.Width())
757 {
758 // Left margin is good enough.
759 Point aPos = rCellPos;
760 aPos.AdjustX( -(rHintWndSize.Width() + nMargin) );
761 aPos.setY( 0 );
762 return aPos;
763 }
764
765 if (nMTop - nMargin >= rHintWndSize.Height())
766 {
767 // Top margin is good enough.
768 Point aPos = rCellPos;
769 aPos.AdjustY( -(rHintWndSize.Height() + nMargin) );
770 aPos.setX( 0 );
771 return aPos;
772 }
773
774 // None of the above. Hopeless. At least try not to cover the current
775 // cell.
776 Point aPos = rCellPos;
777 aPos.AdjustX(rCellSize.Width() );
778 return aPos;
779}
780
781}
782
784{
785 // show input help window and list drop-down button for validity
786
787 mxInputHintOO.reset();
788
789 bool bListValButton = false;
790 ScAddress aListValPos;
791
793 const SfxUInt32Item* pItem = rDoc.GetAttr( aViewData.GetCurX(),
797 if ( pItem->GetValue() )
798 {
799 const ScValidationData* pData = rDoc.GetValidationEntry( pItem->GetValue() );
800 OSL_ENSURE(pData,"ValidationData not found");
801 OUString aTitle, aMessage;
802
803 if ( pData && pData->GetInput( aTitle, aMessage ) && !aMessage.isEmpty() )
804 {
806 ScGridWindow* pWin = pGridWin[eWhich].get();
807 SCCOL nCol = aViewData.GetCurX();
808 SCROW nRow = aViewData.GetCurY();
809 Point aPos = aViewData.GetScrPos( nCol, nRow, eWhich );
810 Size aWinSize = pWin->GetOutputSizePixel();
811 // cursor visible?
812 if ( nCol >= aViewData.GetPosX(WhichH(eWhich)) &&
813 nRow >= aViewData.GetPosY(WhichV(eWhich)) &&
814 aPos.X() < aWinSize.Width() && aPos.Y() < aWinSize.Height() )
815 {
816 const svtools::ColorConfig& rColorCfg = SC_MOD()->GetColorConfig();
817 Color aCommentColor = rColorCfg.GetColorValue(svtools::CALCNOTESBACKGROUND).nColor;
818 // create HintWindow, determines its size by itself
819 ScOverlayHint* pOverlay = new ScOverlayHint(aTitle, aMessage, aCommentColor, pFrameWin->GetFont());
820
822 mxInputHintOO->append(std::unique_ptr<sdr::overlay::OverlayObject>(pOverlay));
823
824 Size aHintWndSize = pOverlay->GetSizePixel();
825 tools::Long nCellSizeX = 0;
826 tools::Long nCellSizeY = 0;
827 aViewData.GetMergeSizePixel(nCol, nRow, nCellSizeX, nCellSizeY);
828
829 Point aHintPos = calcHintWindowPosition(
830 aPos, Size(nCellSizeX,nCellSizeY), aWinSize, aHintWndSize);
831
832 pOverlay->SetPos(pWin->PixelToLogic(aHintPos, pWin->GetDrawMapMode()), pWin->GetDrawMapMode());
833 for (VclPtr<ScGridWindow> & pWindow : pGridWin)
834 {
835 if (!pWindow)
836 continue;
837 if (!pWindow->IsVisible())
838 continue;
839 rtl::Reference<sdr::overlay::OverlayManager> xOverlayManager = pWindow->getOverlayManager();
840 if (!xOverlayManager.is())
841 continue;
842 if (pWindow == pWin)
843 {
844 xOverlayManager->add(*pOverlay);
845 pWindow->updateLOKInputHelp(aTitle, aMessage);
846 }
847 else
848 {
849 //tdf#92530 if the help tip doesn't fit into its allocated area in a split window
850 //scenario, then because here we place it into the other split windows as well the
851 //missing portions will be displayed in the other split windows to form an apparent
852 //single tip, albeit "under" the split lines
853 Point aOtherPos(pWindow->ScreenToOutputPixel(pWin->OutputToScreenPixel(aHintPos)));
854 std::unique_ptr<ScOverlayHint> pOtherOverlay(new ScOverlayHint(aTitle, aMessage, aCommentColor, pFrameWin->GetFont()));
855 Point aFooPos(pWindow->PixelToLogic(aOtherPos, pWindow->GetDrawMapMode()));
856 pOtherOverlay->SetPos(aFooPos, pWindow->GetDrawMapMode());
857 xOverlayManager->add(*pOtherOverlay);
858 mxInputHintOO->append(std::move(pOtherOverlay));
859 }
860 }
861 }
862 }
863
864 // list drop-down button
865 if ( pData && pData->HasSelectionList() )
866 {
867 aListValPos.Set( aViewData.GetCurX(), aViewData.GetCurY(), aViewData.GetTabNo() );
868 bListValButton = true;
869 }
870 }
871
872 for (VclPtr<ScGridWindow> const & pWin : pGridWin)
873 {
874 if (pWin && pWin->IsVisible())
875 pWin->UpdateListValPos(bListValButton, aListValPos);
876 }
877}
878
879bool ScTabView::HasHintWindow() const { return mxInputHintOO != nullptr; }
880
882{
883 mxInputHintOO.reset();
884}
885
886// find window that should not be over the cursor
888{
890
891 // search & replace
892 if (pViewFrm->HasChildWindow(SID_SEARCH_DLG))
893 {
894 SfxChildWindow* pChild = pViewFrm->GetChildWindow(SID_SEARCH_DLG);
895 if (pChild)
896 {
897 auto xDlgController = pChild->GetController();
898 if (xDlgController && xDlgController->getDialog()->get_visible())
899 return xDlgController->getDialog();
900 }
901 }
902
903 // apply changes
904 if ( pViewFrm->HasChildWindow(FID_CHG_ACCEPT) )
905 {
906 SfxChildWindow* pChild = pViewFrm->GetChildWindow(FID_CHG_ACCEPT);
907 if (pChild)
908 {
909 auto xDlgController = pChild->GetController();
910 if (xDlgController && xDlgController->getDialog()->get_visible())
911 return xDlgController->getDialog();
912 }
913 }
914
915 return nullptr;
916}
917
918 // adjust screen with respect to cursor position
919
921 const ScSplitPos* pWhich )
922{
923 // now switch active part here
924
926 ScHSplitPos eActiveX = WhichH(eActive);
927 ScVSplitPos eActiveY = WhichV(eActive);
928 bool bHFix = (aViewData.GetHSplitMode() == SC_SPLIT_FIX);
929 bool bVFix = (aViewData.GetVSplitMode() == SC_SPLIT_FIX);
930 if (bHFix && eActiveX == SC_SPLIT_LEFT && nCurX >= aViewData.GetFixPosX())
931 {
933 eActiveX = SC_SPLIT_RIGHT;
934 }
935 if (bVFix && eActiveY == SC_SPLIT_TOP && nCurY >= aViewData.GetFixPosY())
936 {
938 eActiveY = SC_SPLIT_BOTTOM;
939 }
940
941 // actual align
942
943 if ( eMode != SC_FOLLOW_NONE )
944 {
945 ScSplitPos eAlign;
946 if (pWhich)
947 eAlign = *pWhich;
948 else
949 eAlign = aViewData.GetActivePart();
950 ScHSplitPos eAlignX = WhichH(eAlign);
951 ScVSplitPos eAlignY = WhichV(eAlign);
952
953 SCCOL nDeltaX = aViewData.GetPosX(eAlignX);
954 SCROW nDeltaY = aViewData.GetPosY(eAlignY);
955 SCCOL nSizeX = aViewData.VisibleCellsX(eAlignX);
956 SCROW nSizeY = aViewData.VisibleCellsY(eAlignY);
957
958 tools::Long nCellSizeX;
959 tools::Long nCellSizeY;
960 if ( nCurX >= 0 && nCurY >= 0 )
961 aViewData.GetMergeSizePixel( nCurX, nCurY, nCellSizeX, nCellSizeY );
962 else
963 nCellSizeX = nCellSizeY = 0;
964 Size aScrSize = aViewData.GetScrSize();
965 tools::Long nSpaceX = ( aScrSize.Width() - nCellSizeX ) / 2;
966 tools::Long nSpaceY = ( aScrSize.Height() - nCellSizeY ) / 2;
967 // nSpaceY: desired start position of cell for FOLLOW_JUMP, modified if dialog interferes
968
969 bool bForceNew = false; // force new calculation of JUMP position (vertical only)
970
971 // VisibleCellsY == CellsAtY( GetPosY( eWhichY ), 1, eWhichY )
972
973 // when for instance a search dialog is open, don't put the cursor behind the dialog
974 // if possible, put the row with the cursor above or below the dialog
976
977 if ( eMode == SC_FOLLOW_JUMP )
978 {
980 if (pCare)
981 {
982 bool bLimit = false;
983 tools::Rectangle aDlgPixel;
984 Size aWinSize;
985 vcl::Window* pWin = GetActiveWin();
986 weld::Window* pFrame = pWin ? pWin->GetFrameWeld() : nullptr;
987 int x, y, width, height;
988 if (pFrame && pCare->get_extents_relative_to(*pFrame, x, y, width, height))
989 {
990 aDlgPixel = tools::Rectangle(Point(x, y), Size(width, height));
991 aWinSize = pWin->GetOutputSizePixel();
992 // dos the dialog cover the GridWin?
993 if ( aDlgPixel.Right() >= 0 && aDlgPixel.Left() < aWinSize.Width() )
994 {
995 if ( nCurX < nDeltaX || nCurX >= nDeltaX+nSizeX ||
996 nCurY < nDeltaY || nCurY >= nDeltaY+nSizeY )
997 bLimit = true; // scroll anyway
998 else
999 {
1000 // cursor is on the screen
1001 Point aStart = aViewData.GetScrPos( nCurX, nCurY, eAlign );
1002 tools::Long nCSX, nCSY;
1003 aViewData.GetMergeSizePixel( nCurX, nCurY, nCSX, nCSY );
1004 tools::Rectangle aCursor( aStart, Size( nCSX, nCSY ) );
1005 if ( aCursor.Overlaps( aDlgPixel ) )
1006 bLimit = true; // cell is covered by the dialog
1007 }
1008 }
1009 }
1010
1011 if (bLimit)
1012 {
1013 bool bBottom = false;
1014 tools::Long nTopSpace = aDlgPixel.Top();
1015 tools::Long nBotSpace = aWinSize.Height() - aDlgPixel.Bottom();
1016 if ( nBotSpace > 0 && nBotSpace > nTopSpace )
1017 {
1018 tools::Long nDlgBot = aDlgPixel.Bottom();
1019 SCCOL nWPosX;
1020 SCROW nWPosY;
1021 aViewData.GetPosFromPixel( 0,nDlgBot, eAlign, nWPosX, nWPosY );
1022 ++nWPosY; // below the last affected cell
1023
1024 SCROW nDiff = nWPosY - nDeltaY;
1025 if ( nCurY >= nDiff ) // position can not be negative
1026 {
1027 nSpaceY = nDlgBot + ( nBotSpace - nCellSizeY ) / 2;
1028 bBottom = true;
1029 bForceNew = true;
1030 }
1031 }
1032 if ( !bBottom && nTopSpace > 0 )
1033 {
1034 nSpaceY = ( nTopSpace - nCellSizeY ) / 2;
1035 bForceNew = true;
1036 }
1037 }
1038 }
1039 }
1040
1041 SCCOL nNewDeltaX = nDeltaX;
1042 SCROW nNewDeltaY = nDeltaY;
1043 bool bDoLine = false;
1044
1045 switch (eMode)
1046 {
1047 case SC_FOLLOW_JUMP:
1048 if ( nCurX < nDeltaX || nCurX >= nDeltaX+nSizeX )
1049 {
1050 nNewDeltaX = nCurX - aViewData.CellsAtX( nCurX, -1, eAlignX, static_cast<sal_uInt16>(nSpaceX) );
1051 if (nNewDeltaX < 0)
1052 nNewDeltaX = 0;
1053 nSizeX = aViewData.CellsAtX( nNewDeltaX, 1, eAlignX );
1054 }
1055 if ( nCurY < nDeltaY || nCurY >= nDeltaY+nSizeY || bForceNew )
1056 {
1057 nNewDeltaY = nCurY - aViewData.CellsAtY( nCurY, -1, eAlignY, static_cast<sal_uInt16>(nSpaceY) );
1058 if (nNewDeltaY < 0)
1059 nNewDeltaY = 0;
1060 nSizeY = aViewData.CellsAtY( nNewDeltaY, 1, eAlignY );
1061 }
1062 bDoLine = true;
1063 break;
1064
1065 case SC_FOLLOW_LINE:
1066 bDoLine = true;
1067 break;
1068
1069 case SC_FOLLOW_FIX:
1070 if ( nCurX < nDeltaX || nCurX >= nDeltaX+nSizeX )
1071 {
1072 nNewDeltaX = nDeltaX + nCurX - aViewData.GetCurX();
1073 if (nNewDeltaX < 0)
1074 nNewDeltaX = 0;
1075 nSizeX = aViewData.CellsAtX( nNewDeltaX, 1, eAlignX );
1076 }
1077 if ( nCurY < nDeltaY || nCurY >= nDeltaY+nSizeY )
1078 {
1079 nNewDeltaY = nDeltaY + nCurY - aViewData.GetCurY();
1080 if (nNewDeltaY < 0)
1081 nNewDeltaY = 0;
1082 nSizeY = aViewData.CellsAtY( nNewDeltaY, 1, eAlignY );
1083 }
1084
1085 // like old version of SC_FOLLOW_JUMP:
1086
1087 if ( nCurX < nNewDeltaX || nCurX >= nNewDeltaX+nSizeX )
1088 {
1089 nNewDeltaX = nCurX - (nSizeX / 2);
1090 if (nNewDeltaX < 0)
1091 nNewDeltaX = 0;
1092 nSizeX = aViewData.CellsAtX( nNewDeltaX, 1, eAlignX );
1093 }
1094 if ( nCurY < nNewDeltaY || nCurY >= nNewDeltaY+nSizeY )
1095 {
1096 nNewDeltaY = nCurY - (nSizeY / 2);
1097 if (nNewDeltaY < 0)
1098 nNewDeltaY = 0;
1099 nSizeY = aViewData.CellsAtY( nNewDeltaY, 1, eAlignY );
1100 }
1101
1102 bDoLine = true;
1103 break;
1104
1105 case SC_FOLLOW_NONE:
1106 break;
1107 default:
1108 OSL_FAIL("Wrong cursor mode");
1109 break;
1110 }
1111
1113 if (bDoLine)
1114 {
1115 while ( nCurX >= nNewDeltaX+nSizeX )
1116 {
1117 nNewDeltaX = nCurX-nSizeX+1;
1118 SCTAB nTab = aViewData.GetTabNo();
1119 while ( nNewDeltaX < rDoc.MaxCol() && !rDoc.GetColWidth( nNewDeltaX, nTab ) )
1120 ++nNewDeltaX;
1121 nSizeX = aViewData.CellsAtX( nNewDeltaX, 1, eAlignX );
1122 }
1123 while ( nCurY >= nNewDeltaY+nSizeY )
1124 {
1125 nNewDeltaY = nCurY-nSizeY+1;
1126 SCTAB nTab = aViewData.GetTabNo();
1127 while ( nNewDeltaY < rDoc.MaxRow() && !rDoc.GetRowHeight( nNewDeltaY, nTab ) )
1128 ++nNewDeltaY;
1129 nSizeY = aViewData.CellsAtY( nNewDeltaY, 1, eAlignY );
1130 }
1131 if ( nCurX < nNewDeltaX )
1132 nNewDeltaX = nCurX;
1133 if ( nCurY < nNewDeltaY )
1134 nNewDeltaY = nCurY;
1135 }
1136
1137 if ( nNewDeltaX != nDeltaX )
1138 nSizeX = aViewData.CellsAtX( nNewDeltaX, 1, eAlignX );
1139 if (nNewDeltaX+nSizeX-1 > rDoc.MaxCol())
1140 nNewDeltaX = rDoc.MaxCol()-nSizeX+1;
1141 if (nNewDeltaX < 0)
1142 nNewDeltaX = 0;
1143
1144 if ( nNewDeltaY != nDeltaY )
1145 nSizeY = aViewData.CellsAtY( nNewDeltaY, 1, eAlignY );
1146 if (nNewDeltaY+nSizeY-1 > rDoc.MaxRow())
1147 nNewDeltaY = rDoc.MaxRow()-nSizeY+1;
1148 if (nNewDeltaY < 0)
1149 nNewDeltaY = 0;
1150
1151 if ( nNewDeltaX != nDeltaX )
1152 ScrollX( nNewDeltaX - nDeltaX, eAlignX );
1153 if ( nNewDeltaY != nDeltaY )
1154 ScrollY( nNewDeltaY - nDeltaY, eAlignY );
1155 }
1156
1157 // switch active part again
1158
1159 if (bHFix)
1160 if (eActiveX == SC_SPLIT_RIGHT && nCurX < aViewData.GetFixPosX())
1161 {
1163 eActiveX = SC_SPLIT_LEFT;
1164 }
1165 if (bVFix)
1166 if (eActiveY == SC_SPLIT_BOTTOM && nCurY < aViewData.GetFixPosY())
1167 {
1169 }
1170}
1171
1173{
1174 bool bRet = false;
1175
1176 // #i3875# *Hack*
1177 bool bMod1Locked = (aViewData.GetViewShell()->GetLockedModifiers() & KEY_MOD1) != 0;
1178 aViewData.SetSelCtrlMouseClick( rMEvt.IsMod1() || bMod1Locked );
1179
1180 if ( pSelEngine )
1181 {
1182 bMoveIsShift = rMEvt.IsShift();
1183 bRet = pSelEngine->SelMouseButtonDown( rMEvt );
1184 bMoveIsShift = false;
1185 }
1186
1187 aViewData.SetSelCtrlMouseClick( false ); // #i3875# *Hack*
1188
1189 return bRet;
1190}
1191
1192 // MoveCursor - with adjustment of the view section
1193
1195 bool bShift, bool bControl, bool bKeepOld, bool bKeepSel )
1196{
1197 if (!bKeepOld)
1199
1201 // #i123629#
1203 aViewData.GetViewShell()->SetForceFocusOnCurCell( !rDoc.ValidColRow(nCurX, nCurY) );
1204
1205 if (nCurX < 0) nCurX = 0;
1206 if (nCurY < 0) nCurY = 0;
1207 if (nCurX > rDoc.MaxCol()) nCurX = rDoc.MaxCol();
1208 if (nCurY > rDoc.MaxRow()) nCurY = rDoc.MaxRow();
1209
1210 // FIXME: this is to limit the number of rows handled in the Online
1211 // to 1000; this will be removed again when the performance
1212 // bottlenecks are sorted out
1214 nCurY = std::min(nCurY, MAXTILEDROW);
1215
1217
1218 // switch of active now in AlignToCursor
1219
1220 AlignToCursor( nCurX, nCurY, eMode );
1221
1222 if (bKeepSel)
1223 {
1224 SetCursor( nCurX, nCurY ); // keep selection
1225
1226 // If the cursor is in existing selection, it's a cursor movement by
1227 // ENTER or TAB. If not, then it's a new selection during ADD
1228 // selection mode.
1229
1230 const ScMarkData& rMark = aViewData.GetMarkData();
1231 ScRangeList aSelList;
1232 rMark.FillRangeListWithMarks(&aSelList, false);
1233 if (!aSelList.Contains(ScRange(nCurX, nCurY, aViewData.GetTabNo())))
1234 // Cursor not in existing selection. Start a new selection.
1235 DoneBlockMode(true);
1236 }
1237 else
1238 {
1239 if (!bShift)
1240 {
1241 // Remove all marked data on cursor movement unless the Shift is
1242 // locked or while editing a formula. It is cheaper to check for
1243 // marks first and then formula mode.
1244 ScMarkData& rMark = aViewData.GetMarkData();
1245 bool bMarked = rMark.IsMarked() || rMark.IsMultiMarked();
1246 if (bMarked && !SC_MOD()->IsFormulaMode())
1247 {
1248 rMark.ResetMark();
1249 DoneBlockMode();
1250 InitOwnBlockMode( ScRange( nCurX, nCurY, aViewData.GetTabNo()));
1252 }
1253 }
1254
1255 bool bSame = ( nCurX == aViewData.GetCurX() && nCurY == aViewData.GetCurY() );
1256 bMoveIsShift = bShift;
1257 pSelEngine->CursorPosChanging( bShift, bControl );
1258 bMoveIsShift = false;
1259 aFunctionSet.SetCursorAtCell( nCurX, nCurY, false );
1260
1261 // If the cursor has not been moved, the SelectionChanged for canceling the
1262 // selection has to happen here individually:
1263 if (bSame)
1265 }
1266
1269}
1270
1272 bool bShift, bool bKeepSel )
1273{
1275 SCTAB nTab = aViewData.GetTabNo();
1276
1277 bool bSkipProtected = false, bSkipUnprotected = false;
1278 const ScTableProtection* pProtect = rDoc.GetTabProtection(nTab);
1279 if ( pProtect && pProtect->isProtected() )
1280 {
1281 bSkipProtected = !pProtect->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS);
1282 bSkipUnprotected = !pProtect->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS);
1283 }
1284
1285 if ( bSkipProtected && bSkipUnprotected )
1286 return;
1287
1288 SCCOL nOldX;
1289 SCROW nOldY;
1290 SCCOL nCurX;
1291 SCROW nCurY;
1292 if ( aViewData.IsRefMode() )
1293 {
1294 nOldX = aViewData.GetRefEndX();
1295 nOldY = aViewData.GetRefEndY();
1296 nCurX = nOldX + nMovX;
1297 nCurY = nOldY + nMovY;
1298 }
1299 else
1300 {
1301 nOldX = aViewData.GetCurX();
1302 nOldY = aViewData.GetCurY();
1303 nCurX = (nMovX != 0) ? nOldX+nMovX : aViewData.GetOldCurX();
1304 nCurY = (nMovY != 0) ? nOldY+nMovY : aViewData.GetOldCurY();
1305 }
1306
1307 if (nMovX < 0 && nOldX == 0)
1308 { // trying to go left from 1st column
1309 if (nMovY == 0) // done, because no vertical move is requested
1310 return;
1311 }
1312 if (nMovY < 0 && nOldY == 0)
1313 { // trying to go up from 1st row
1314 if (nMovX == 0) // done, because no horizontal move is requested
1315 return;
1316 }
1317
1319
1320 if (nMovX != 0 && rDoc.ValidColRow(nCurX,nCurY))
1321 SkipCursorHorizontal(nCurX, nCurY, nOldX, nMovX);
1322
1323 if (nMovY != 0 && rDoc.ValidColRow(nCurX,nCurY))
1324 SkipCursorVertical(nCurX, nCurY, nOldY, nMovY);
1325
1326 MoveCursorAbs( nCurX, nCurY, eMode, bShift, false, true, bKeepSel );
1327}
1328
1329void ScTabView::MoveCursorPage( SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, bool bShift, bool bKeepSel )
1330{
1331 SCCOL nPageX;
1332 SCROW nPageY;
1333 GetPageMoveEndPosition(nMovX, nMovY, nPageX, nPageY);
1334 MoveCursorRel( nPageX, nPageY, eMode, bShift, bKeepSel );
1335}
1336
1337void ScTabView::MoveCursorArea( SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, bool bShift, bool bKeepSel )
1338{
1339 SCCOL nNewX;
1340 SCROW nNewY;
1341 GetAreaMoveEndPosition(nMovX, nMovY, eMode, nNewX, nNewY, eMode);
1342 MoveCursorRel(nNewX, nNewY, eMode, bShift, bKeepSel);
1343}
1344
1345void ScTabView::MoveCursorEnd( SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, bool bShift, bool bKeepSel )
1346{
1348 SCTAB nTab = aViewData.GetTabNo();
1349
1350 SCCOL nCurX;
1351 SCROW nCurY;
1352 aViewData.GetMoveCursor( nCurX,nCurY );
1353 SCCOL nNewX = nCurX;
1354 SCROW nNewY = nCurY;
1355
1356 SCCOL nUsedX = 0;
1357 SCROW nUsedY = 0;
1358 if ( nMovX > 0 || nMovY > 0 )
1359 rDoc.GetPrintArea( nTab, nUsedX, nUsedY ); // get end
1360
1361 if (nMovX<0)
1362 nNewX=0;
1363 else if (nMovX>0)
1364 nNewX=nUsedX; // last used range
1365
1366 if (nMovY<0)
1367 nNewY=0;
1368 else if (nMovY>0)
1369 nNewY=nUsedY;
1370
1372 MoveCursorRel( nNewX-nCurX, nNewY-nCurY, eMode, bShift, bKeepSel );
1373}
1374
1375void ScTabView::MoveCursorScreen( SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, bool bShift )
1376{
1378 SCTAB nTab = aViewData.GetTabNo();
1379
1380 SCCOL nCurX;
1381 SCROW nCurY;
1382 aViewData.GetMoveCursor( nCurX,nCurY );
1383 SCCOL nNewX = nCurX;
1384 SCROW nNewY = nCurY;
1385
1387 SCCOL nPosX = aViewData.GetPosX( WhichH(eWhich) );
1388 SCROW nPosY = aViewData.GetPosY( WhichV(eWhich) );
1389
1390 SCCOL nAddX = aViewData.VisibleCellsX( WhichH(eWhich) );
1391 if (nAddX != 0)
1392 --nAddX;
1393 SCROW nAddY = aViewData.VisibleCellsY( WhichV(eWhich) );
1394 if (nAddY != 0)
1395 --nAddY;
1396
1397 if (nMovX<0)
1398 nNewX=nPosX;
1399 else if (nMovX>0)
1400 nNewX=nPosX+nAddX;
1401
1402 if (nMovY<0)
1403 nNewY=nPosY;
1404 else if (nMovY>0)
1405 nNewY=nPosY+nAddY;
1406
1407 aViewData.SetOldCursor( nNewX,nNewY );
1408 rDoc.SkipOverlapped(nNewX, nNewY, nTab);
1409 MoveCursorAbs( nNewX, nNewY, eMode, bShift, false, true );
1410}
1411
1412void ScTabView::MoveCursorEnter( bool bShift ) // bShift -> up/down
1413{
1414 const ScInputOptions& rOpt = SC_MOD()->GetInputOptions();
1415 if (!rOpt.GetMoveSelection())
1416 {
1418 return;
1419 }
1420
1421 SCCOL nMoveX = 0;
1422 SCROW nMoveY = 0;
1423 switch (static_cast<ScDirection>(rOpt.GetMoveDir()))
1424 {
1425 case DIR_BOTTOM:
1426 nMoveY = bShift ? -1 : 1;
1427 break;
1428 case DIR_RIGHT:
1429 nMoveX = bShift ? -1 : 1;
1430 break;
1431 case DIR_TOP:
1432 nMoveY = bShift ? 1 : -1;
1433 break;
1434 case DIR_LEFT:
1435 nMoveX = bShift ? 1 : -1;
1436 break;
1437 }
1438
1439 SCCOL nCurX;
1440 SCROW nCurY;
1441 aViewData.GetMoveCursor( nCurX,nCurY );
1442 SCCOL nNewX = nCurX;
1443 SCROW nNewY = nCurY;
1444 SCTAB nTab = aViewData.GetTabNo();
1445
1446 ScMarkData& rMark = aViewData.GetMarkData();
1448
1449 if (rMark.IsMarked() || rMark.IsMultiMarked())
1450 {
1451 rDoc.GetNextPos( nNewX, nNewY, nTab, nMoveX, nMoveY, true, false, rMark );
1452
1453 MoveCursorRel( nNewX - nCurX, nNewY - nCurY, SC_FOLLOW_LINE, false, true );
1454
1455 // update input line even if cursor was not moved
1456 if ( nNewX == nCurX && nNewY == nCurY )
1458 }
1459 else
1460 {
1461 // After Tab and Enter back to the starting column again.
1462 const SCCOL nTabStartCol = ((nMoveY != 0 && !nMoveX) ? aViewData.GetTabStartCol() : SC_TABSTART_NONE);
1463 rDoc.GetNextPos( nNewX, nNewY, nTab, nMoveX, nMoveY, false, true, rMark, nTabStartCol );
1464
1465 MoveCursorRel( nNewX - nCurX, nNewY - nCurY, SC_FOLLOW_LINE, false);
1466 }
1467}
1468
1470{
1471 const vcl::KeyCode& rKCode = rKeyEvent.GetKeyCode();
1472
1473 enum { MOD_NONE, MOD_CTRL, MOD_ALT, MOD_BOTH } eModifier =
1474 rKCode.IsMod1() ?
1475 (rKCode.IsMod2() ? MOD_BOTH : MOD_CTRL) :
1476 (rKCode.IsMod2() ? MOD_ALT : MOD_NONE);
1477
1478 bool bSel = rKCode.IsShift();
1479 sal_uInt16 nCode = rKCode.GetCode();
1480
1481 // CURSOR keys
1482 SCCOL nDX = 0;
1483 SCROW nDY = 0;
1484 switch( nCode )
1485 {
1486 case KEY_LEFT: nDX = -1; break;
1487 case KEY_RIGHT: nDX = 1; break;
1488 case KEY_UP: nDY = -1; break;
1489 case KEY_DOWN: nDY = 1; break;
1490 }
1491 if( nDX != 0 || nDY != 0 )
1492 {
1493 switch( eModifier )
1494 {
1495 case MOD_NONE: MoveCursorRel( nDX, nDY, SC_FOLLOW_LINE, bSel ); break;
1496 case MOD_CTRL: MoveCursorArea( nDX, nDY, SC_FOLLOW_JUMP, bSel ); break;
1497 default:
1498 {
1499 // added to avoid warnings
1500 }
1501 }
1502 // always true to suppress changes of col/row size (ALT+CURSOR)
1503 return true;
1504 }
1505
1506 // PAGEUP/PAGEDOWN
1507 if( (nCode == KEY_PAGEUP) || (nCode == KEY_PAGEDOWN) )
1508 {
1509 nDX = (nCode == KEY_PAGEUP) ? -1 : 1;
1510 switch( eModifier )
1511 {
1512 case MOD_NONE: MoveCursorPage( 0, static_cast<SCCOLROW>(nDX), SC_FOLLOW_FIX, bSel ); break;
1513 case MOD_ALT: MoveCursorPage( nDX, 0, SC_FOLLOW_FIX, bSel ); break;
1514 case MOD_CTRL: SelectNextTab( nDX, false ); break;
1515 default:
1516 {
1517 // added to avoid warnings
1518 }
1519 }
1520 return true;
1521 }
1522
1523 // HOME/END
1524 if( (nCode == KEY_HOME) || (nCode == KEY_END) )
1525 {
1526 nDX = (nCode == KEY_HOME) ? -1 : 1;
1528 switch( eModifier )
1529 {
1530 case MOD_NONE: MoveCursorEnd( nDX, 0, eMode, bSel ); break;
1531 case MOD_CTRL: MoveCursorEnd( nDX, static_cast<SCCOLROW>(nDX), eMode, bSel ); break;
1532 default:
1533 {
1534 // added to avoid warnings
1535 }
1536 }
1537 return true;
1538 }
1539
1540 return false;
1541}
1542
1543 // next/previous unprotected cell
1544void ScTabView::FindNextUnprot( bool bShift, bool bInSelection )
1545{
1546 short nMove = bShift ? -1 : 1;
1547
1548 ScMarkData& rMark = aViewData.GetMarkData();
1549 bool bMarked = bInSelection && (rMark.IsMarked() || rMark.IsMultiMarked());
1550
1551 SCCOL nCurX;
1552 SCROW nCurY;
1553 aViewData.GetMoveCursor( nCurX,nCurY );
1554 SCCOL nNewX = nCurX;
1555 SCROW nNewY = nCurY;
1556 SCTAB nTab = aViewData.GetTabNo();
1557
1559 rDoc.GetNextPos( nNewX,nNewY, nTab, nMove,0, bMarked, true, rMark );
1560
1561 SCCOL nTabCol = aViewData.GetTabStartCol();
1562 if ( nTabCol == SC_TABSTART_NONE )
1563 nTabCol = nCurX; // back to this column after Enter
1564
1565 MoveCursorRel( nNewX-nCurX, nNewY-nCurY, SC_FOLLOW_LINE, false, true );
1566
1567 // TabCol is reset in MoveCursorRel...
1568 aViewData.SetTabStartCol( nTabCol );
1569}
1570
1572{
1573 SCCOL nStartCol;
1574 SCCOL nEndCol;
1575
1576 ScMarkData& rMark = aViewData.GetMarkData();
1577 if (rMark.IsMarked())
1578 {
1579 const ScRange& aMarkRange = rMark.GetMarkArea();
1580 nStartCol = aMarkRange.aStart.Col();
1581 nEndCol = aMarkRange.aEnd.Col();
1582 }
1583 else
1584 {
1585 SCROW nDummy;
1586 aViewData.GetMoveCursor( nStartCol, nDummy );
1587 nEndCol=nStartCol;
1588 }
1589
1590 SCTAB nTab = aViewData.GetTabNo();
1592 DoneBlockMode();
1593 InitBlockMode( nStartCol,0, nTab );
1594 MarkCursor( nEndCol, rDoc.MaxRow(), nTab );
1596}
1597
1599{
1600 SCROW nStartRow;
1601 SCROW nEndRow;
1602
1603 ScMarkData& rMark = aViewData.GetMarkData();
1604 if (rMark.IsMarked())
1605 {
1606 const ScRange& aMarkRange = rMark.GetMarkArea();
1607 nStartRow = aMarkRange.aStart.Row();
1608 nEndRow = aMarkRange.aEnd.Row();
1609 }
1610 else
1611 {
1612 SCCOL nDummy;
1613 aViewData.GetMoveCursor( nDummy, nStartRow );
1614 nEndRow=nStartRow;
1615 }
1616
1617 SCTAB nTab = aViewData.GetTabNo();
1619 DoneBlockMode();
1620 InitBlockMode( 0,nStartRow, nTab );
1621 MarkCursor( rDoc.MaxCol(), nEndRow, nTab );
1623}
1624
1625
1626void ScTabView::MarkColumns(SCCOL nCol, sal_Int16 nModifier)
1627{
1629 SCCOL nStartCol = nCol;
1630 SCTAB nTab = aViewData.GetTabNo();
1631
1632 if ((nModifier & KEY_SHIFT) == KEY_SHIFT)
1633 bMoveIsShift = true;
1634
1635 if ( SC_MOD()->IsFormulaMode() )
1636 {
1637 DoneRefMode( nModifier != 0 );
1638 InitRefMode( nCol, 0, nTab, SC_REFTYPE_REF );
1639 UpdateRef( nCol, rDoc.MaxRow(), nTab );
1640 bMoveIsShift = false;
1641 }
1642 else
1643 {
1644 DoneBlockMode( nModifier != 0 );
1645 InitBlockMode( nStartCol, 0, nTab, true, true);
1646 MarkCursor( nCol, rDoc.MaxRow(), nTab );
1647 bMoveIsShift = false;
1648 SetCursor( nCol, 0 );
1650 }
1651}
1652
1653void ScTabView::MarkRows(SCROW nRow, sal_Int16 nModifier)
1654{
1656 SCROW nStartRow = nRow;
1657 SCTAB nTab = aViewData.GetTabNo();
1658
1659 if ((nModifier & KEY_SHIFT) == KEY_SHIFT)
1660 bMoveIsShift = true;
1661
1662 if ( SC_MOD()->IsFormulaMode() )
1663 {
1664 DoneRefMode( nModifier != 0 );
1665 InitRefMode( 0, nRow, nTab, SC_REFTYPE_REF );
1666 UpdateRef( rDoc.MaxCol(), nRow, nTab );
1667 bMoveIsShift = false;
1668 }
1669 else
1670 {
1671 DoneBlockMode( nModifier != 0 );
1672 InitBlockMode( 0, nStartRow, nTab, true, false, true );
1673 MarkCursor( rDoc.MaxCol(), nRow, nTab );
1674 bMoveIsShift = false;
1675 SetCursor( 0, nRow );
1677 }
1678}
1679
1680void ScTabView::MarkDataArea( bool bIncludeCursor )
1681{
1683 SCTAB nTab = aViewData.GetTabNo();
1684 SCCOL nStartCol = aViewData.GetCurX();
1685 SCROW nStartRow = aViewData.GetCurY();
1686 SCCOL nEndCol = nStartCol;
1687 SCROW nEndRow = nStartRow;
1688
1689 rDoc.GetDataArea( nTab, nStartCol, nStartRow, nEndCol, nEndRow, bIncludeCursor, false );
1690
1692 DoneBlockMode();
1693 InitBlockMode( nStartCol, nStartRow, nTab );
1694 MarkCursor( nEndCol, nEndRow, nTab );
1696
1698}
1699
1701{
1704 ScRange aMatrix;
1705 if ( rDoc.GetMatrixFormulaRange( aCursor, aMatrix ) )
1706 {
1707 MarkRange( aMatrix, false ); // cursor is already within the range
1708 }
1709}
1710
1711void ScTabView::MarkRange( const ScRange& rRange, bool bSetCursor, bool bContinue )
1712{
1714 SCTAB nTab = rRange.aStart.Tab();
1715 SetTabNo( nTab );
1716
1718 DoneBlockMode( bContinue ); // bContinue==true -> clear old mark
1719 if (bSetCursor) // if Cursor is set, also always align
1720 {
1721 SCCOL nAlignX = rRange.aStart.Col();
1722 SCROW nAlignY = rRange.aStart.Row();
1723 bool bCol = ( rRange.aStart.Col() == 0 && rRange.aEnd.Col() == rDoc.MaxCol() ) && !aViewData.GetDocument().IsInVBAMode();
1724 bool bRow = ( rRange.aStart.Row() == 0 && rRange.aEnd.Row() == rDoc.MaxRow() );
1725 if ( bCol )
1727 if ( bRow )
1729 AlignToCursor( nAlignX, nAlignY, SC_FOLLOW_JUMP );
1730 }
1731 InitBlockMode( rRange.aStart.Col(), rRange.aStart.Row(), nTab );
1732 MarkCursor( rRange.aEnd.Col(), rRange.aEnd.Row(), nTab );
1733 if (bSetCursor)
1734 {
1735 SCCOL nPosX = rRange.aStart.Col();
1736 SCROW nPosY = rRange.aStart.Row();
1737 rDoc.SkipOverlapped(nPosX, nPosY, nTab);
1738
1740 SetCursor( nPosX, nPosY );
1741 }
1743
1745}
1746
1748{
1749 ScMarkData& rMark = aViewData.GetMarkData();
1750 if ( rMark.IsMarked() || rMark.IsMultiMarked() )
1751 {
1752 SCCOL nCurX;
1753 SCROW nCurY;
1754 aViewData.GetMoveCursor( nCurX,nCurY );
1755 MoveCursorAbs( nCurX, nCurY, SC_FOLLOW_NONE, false, false );
1756
1758 }
1759}
1760
1762{
1763 DoneBlockMode();
1765 aViewData.GetMarkData() = rNew;
1766
1768}
1769
1771{
1772 // has to be called after making direct changes to mark data (not via MarkCursor etc)
1773
1775}
1776
1777void ScTabView::SelectNextTab( short nDir, bool bExtendSelection )
1778{
1779 if (!nDir)
1780 return;
1781 OSL_ENSURE( nDir==-1 || nDir==1, "SelectNextTab: invalid value");
1782
1784 SCTAB nTab = aViewData.GetTabNo();
1785 if (nDir<0)
1786 {
1787 if (!nTab)
1788 return;
1789 --nTab;
1790 while (!rDoc.IsVisible(nTab))
1791 {
1792 if (!nTab)
1793 return;
1794 --nTab;
1795 }
1796 }
1797 else
1798 {
1799 SCTAB nCount = rDoc.GetTableCount();
1800 ++nTab;
1801 if (nTab >= nCount)
1802 return;
1803 while (!rDoc.IsVisible(nTab))
1804 {
1805 ++nTab;
1806 if (nTab >= nCount)
1807 return;
1808 }
1809 }
1810
1811 SetTabNo( nTab, false, bExtendSelection );
1812 PaintExtras();
1813}
1814
1815void ScTabView::SelectTabPage( const sal_uInt16 nTab )
1816{
1817 pTabControl->SwitchToPageId( nTab );
1818}
1819
1820// SetTabNo - set the displayed sheet
1821
1822void ScTabView::SetTabNo( SCTAB nTab, bool bNew, bool bExtendSelection, bool bSameTabButMoved )
1823{
1824 if ( !ValidTab(nTab) )
1825 {
1826 OSL_FAIL("SetTabNo: invalid sheet");
1827 return;
1828 }
1829
1830 if (!bNew && nTab == aViewData.GetTabNo())
1831 return;
1832
1833 // FormShell would like to be informed before the switch
1835 if (pFormSh)
1836 {
1837 bool bAllowed = pFormSh->PrepareClose();
1838 if (!bAllowed)
1839 {
1842
1843 return; // FormShell says that it can not be switched
1844 }
1845 }
1846
1847 // not InputEnterHandler due to reference input
1848
1850
1851 rDoc.MakeTable( nTab );
1852
1853 // Update pending row heights before switching the sheet, so Reschedule from the progress bar
1854 // doesn't paint the new sheet with old heights
1856
1857 SCTAB nTabCount = rDoc.GetTableCount();
1858 SCTAB nOldPos = nTab;
1859 while (!rDoc.IsVisible(nTab)) // search for next visible
1860 {
1861 bool bUp = (nTab>=nOldPos);
1862 if (bUp)
1863 {
1864 ++nTab;
1865 if (nTab>=nTabCount)
1866 {
1867 nTab = nOldPos;
1868 bUp = false;
1869 }
1870 }
1871
1872 if (!bUp)
1873 {
1874 if (nTab != 0)
1875 --nTab;
1876 else
1877 {
1878 OSL_FAIL("no visible sheets");
1879 rDoc.SetVisible( 0, true );
1880 }
1881 }
1882 }
1883
1884 // #i71490# Deselect drawing objects before changing the sheet number in view data,
1885 // so the handling of notes still has the sheet selected on which the notes are.
1887
1888 ScModule* pScMod = SC_MOD();
1889 bool bRefMode = pScMod->IsFormulaMode();
1890 if ( !bRefMode ) // query, so that RefMode works when switching sheet
1891 {
1892 DoneBlockMode();
1893 pSelEngine->Reset(); // reset all flags, including locked modifiers
1894 aViewData.SetRefTabNo( nTab );
1895 }
1896
1897 ScSplitPos eOldActive = aViewData.GetActivePart(); // before switching
1898 bool bFocus = pGridWin[eOldActive] && pGridWin[eOldActive]->HasFocus();
1899
1900 aViewData.SetTabNo( nTab );
1901 if (mpSpellCheckCxt)
1902 mpSpellCheckCxt->setTabNo( nTab );
1903 // UpdateShow before SetCursor, so that UpdateAutoFillMark finds the correct
1904 // window (is called from SetCursor)
1905 UpdateShow();
1907
1908 SfxBindings& rBindings = aViewData.GetBindings();
1909 ScMarkData& rMark = aViewData.GetMarkData();
1910
1911 bool bAllSelected = true;
1912 for (SCTAB nSelTab = 0; nSelTab < nTabCount; ++nSelTab)
1913 {
1914 if (!rDoc.IsVisible(nSelTab) || rMark.GetTableSelect(nSelTab))
1915 {
1916 if (nTab == nSelTab)
1917 // This tab is already in selection. Keep the current
1918 // selection.
1919 bExtendSelection = true;
1920 }
1921 else
1922 {
1923 bAllSelected = false;
1924 if (bExtendSelection)
1925 // We got what we need. No need to stay in the loop.
1926 break;
1927 }
1928 }
1929 if (bAllSelected && !bNew)
1930 // #i6327# if all tables are selected, a selection event (#i6330#) will deselect all
1931 // (not if called with bNew to update settings)
1932 bExtendSelection = false;
1933
1934 if (bExtendSelection)
1935 rMark.SelectTable( nTab, true );
1936 else
1937 {
1938 rMark.SelectOneTable( nTab );
1939 rBindings.Invalidate( FID_FILL_TAB );
1940 rBindings.Invalidate( FID_TAB_DESELECTALL );
1941 }
1942
1943 bool bUnoRefDialog = pScMod->IsRefDialogOpen() && pScMod->GetCurRefDlgId() == WID_SIMPLE_REF;
1944
1945 // recalc zoom-dependent values (before TabChanged, before UpdateEditViewPos)
1946 RefreshZoom();
1947 UpdateVarZoom();
1948
1949 if ( bRefMode ) // hide EditView if necessary (after aViewData.SetTabNo !)
1950 {
1951 for (VclPtr<ScGridWindow> & pWin : pGridWin)
1952 {
1953 if (pWin && pWin->IsVisible())
1954 pWin->UpdateEditViewPos();
1955 }
1956 }
1957
1958 TabChanged(bSameTabButMoved); // DrawView
1959 collectUIInformation({{"TABLE", OUString::number(nTab)}});
1961
1962 aViewData.GetViewShell()->WindowChanged(); // if the active window has changed
1965
1966 if ( !bUnoRefDialog )
1967 aViewData.GetViewShell()->DisconnectAllClients(); // important for floating frames
1968 else
1969 {
1970 // hide / show inplace client
1971 ScClient* pClient = static_cast<ScClient*>(aViewData.GetViewShell()->GetIPClient());
1972 if ( pClient && pClient->IsObjectInPlaceActive() )
1973 {
1974 tools::Rectangle aObjArea = pClient->GetObjArea();
1975 if ( nTab == aViewData.GetRefTabNo() )
1976 {
1977 // move to its original position
1978
1979 SdrOle2Obj* pDrawObj = pClient->GetDrawObj();
1980 if ( pDrawObj )
1981 {
1982 tools::Rectangle aRect = pDrawObj->GetLogicRect();
1983 MapMode aMapMode( MapUnit::Map100thMM );
1984 Size aOleSize = pDrawObj->GetOrigObjSize( &aMapMode );
1985 aRect.SetSize( aOleSize );
1986 aObjArea = aRect;
1987 }
1988 }
1989 else
1990 {
1991 // move to an invisible position
1992
1993 aObjArea.SetPos( Point( 0, -2*aObjArea.GetHeight() ) );
1994 }
1995 pClient->SetObjArea( aObjArea );
1996 }
1997 }
1998
1999 if ( bFocus && aViewData.GetActivePart() != eOldActive && !bRefMode )
2000 ActiveGrabFocus(); // grab focus to the pane that's active now
2001
2002 // freeze
2003
2004 bool bResize = false;
2006 if (aViewData.UpdateFixX())
2007 bResize = true;
2009 if (aViewData.UpdateFixY())
2010 bResize = true;
2011 if (bResize)
2012 RepeatResize();
2014
2015 if ( aViewData.IsPagebreakMode() )
2017
2018 // Form Layer must know the visible area of the new sheet
2019 // that is why MapMode must already be correct here
2020 for (VclPtr<ScGridWindow> & pWin : pGridWin)
2021 {
2022 if (pWin)
2023 pWin->SetMapMode(pWin->GetDrawMapMode());
2024 }
2025 SetNewVisArea();
2026
2027 PaintGrid();
2028 PaintTop();
2029 PaintLeft();
2030 PaintExtras();
2031
2033 rBindings.Invalidate( SID_DELETE_PRINTAREA ); // Menu
2034 rBindings.Invalidate( FID_DEL_MANUALBREAKS );
2035 rBindings.Invalidate( FID_RESET_PRINTZOOM );
2036 rBindings.Invalidate( SID_STATUS_DOCPOS ); // Status bar
2037 rBindings.Invalidate( SID_ROWCOL_SELCOUNT ); // Status bar
2038 rBindings.Invalidate( SID_STATUS_PAGESTYLE ); // Status bar
2039 rBindings.Invalidate( SID_CURRENTTAB ); // Navigator
2040 rBindings.Invalidate( SID_STYLE_FAMILY2 ); // Designer
2041 rBindings.Invalidate( SID_STYLE_FAMILY4 ); // Designer
2042 rBindings.Invalidate( SID_TABLES_COUNT );
2043
2044 if (pScMod->IsRefDialogOpen())
2045 {
2046 sal_uInt16 nCurRefDlgId=pScMod->GetCurRefDlgId();
2048 SfxChildWindow* pChildWnd = pViewFrm->GetChildWindow( nCurRefDlgId );
2049 if (pChildWnd)
2050 {
2051 if (pChildWnd->GetController())
2052 {
2053 IAnyRefDialog* pRefDlg = dynamic_cast<IAnyRefDialog*>(pChildWnd->GetController().get());
2054 if (pRefDlg)
2055 pRefDlg->ViewShellChanged();
2056 }
2057 }
2058 }
2059
2061}
2062
2064{
2065 aExtraEditViewManager.Add(pViewShell, eWhich);
2066}
2067
2069{
2070 aExtraEditViewManager.Remove(pViewShell, eWhich);
2071}
2072
2074{
2076 return;
2077
2078 ScTabViewShell* pThisViewShell = aViewData.GetViewShell();
2079 SCTAB nThisTabNo = pThisViewShell->GetViewData().GetTabNo();
2080 auto lTabSwitch = [pThisViewShell, nThisTabNo] (ScTabViewShell* pOtherViewShell)
2081 {
2082 ScViewData& rOtherViewData = pOtherViewShell->GetViewData();
2083 SCTAB nOtherTabNo = rOtherViewData.GetTabNo();
2084 if (nThisTabNo == nOtherTabNo)
2085 {
2086 for (int i = 0; i < 4; ++i)
2087 {
2088 if (rOtherViewData.HasEditView(ScSplitPos(i)))
2089 {
2090 pThisViewShell->AddWindowToForeignEditView(pOtherViewShell, ScSplitPos(i));
2091 }
2092 }
2093 }
2094 else
2095 {
2096 for (int i = 0; i < 4; ++i)
2097 {
2098 if (rOtherViewData.HasEditView(ScSplitPos(i)))
2099 {
2100 pThisViewShell->RemoveWindowFromForeignEditView(pOtherViewShell, ScSplitPos(i));
2101 }
2102 }
2103 }
2104 };
2105
2106 SfxLokHelper::forEachOtherView(pThisViewShell, lTabSwitch);
2107
2108 pThisViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_HEADER, "all");
2109
2110 if (pThisViewShell->GetInputHandler())
2111 pThisViewShell->GetInputHandler()->UpdateLokReferenceMarks();
2112}
2113
2114// paint functions - only for this View
2115
2117{
2119
2120 if (pDrawView)
2121 DrawEnableAnim( false );
2122
2123 EditView* pSpellingView = aViewData.GetSpellingView();
2124
2125 for (sal_uInt16 i = 0; i < 4; i++)
2126 {
2127 if (pGridWin[i] && pGridWin[i]->IsVisible() && !aViewData.HasEditView(ScSplitPos(i)))
2128 {
2129 ScHSplitPos eHWhich = WhichH( static_cast<ScSplitPos>(i) );
2130 ScVSplitPos eVWhich = WhichV( static_cast<ScSplitPos>(i) );
2131 SCCOL nScrX = aViewData.GetPosX( eHWhich );
2132 SCROW nScrY = aViewData.GetPosY( eVWhich );
2133
2134 bool bPosVisible =
2135 ( nCol >= nScrX && nCol <= nScrX + aViewData.VisibleCellsX(eHWhich) - 1 &&
2136 nRow >= nScrY && nRow <= nScrY + aViewData.VisibleCellsY(eVWhich) - 1 );
2137
2138 // for the active part, create edit view even if outside the visible area,
2139 // so input isn't lost (and the edit view may be scrolled into the visible area)
2140
2141 // #i26433# during spelling, the spelling view must be active
2142 if ( bPosVisible || aViewData.GetActivePart() == static_cast<ScSplitPos>(i) ||
2143 ( pSpellingView && aViewData.GetEditView(static_cast<ScSplitPos>(i)) == pSpellingView ) )
2144 {
2145 pGridWin[i]->HideCursor();
2146
2147 pGridWin[i]->DeleteCursorOverlay();
2148 pGridWin[i]->DeleteAutoFillOverlay();
2149 pGridWin[i]->DeleteCopySourceOverlay();
2150
2151 // flush OverlayManager before changing MapMode to text edit
2152 pGridWin[i]->flushOverlayManager();
2153
2154 // MapMode must be set after HideCursor
2155 pGridWin[i]->SetMapMode(aViewData.GetLogicMode());
2156
2157 aViewData.SetEditEngine( static_cast<ScSplitPos>(i), pEngine, pGridWin[i], nCol, nRow );
2158
2159 if ( !bPosVisible )
2160 {
2161 // move the edit view area to the real (possibly negative) position,
2162 // or hide if completely above or left of the window
2163 pGridWin[i]->UpdateEditViewPos();
2164 }
2165 }
2166 }
2167 }
2168
2170 aViewData.GetViewShell()->BroadcastAccessibility(SfxHint(SfxHintId::ScAccEnterEditMode));
2171}
2172
2174{
2176 for (sal_uInt16 i = 0; i < 4; i++)
2177 {
2178 ScSplitPos eCurrent = ScSplitPos(i);
2179 if (aViewData.HasEditView(eCurrent))
2180 {
2181 EditView* pEditView = aViewData.GetEditView(eCurrent);
2182
2183 tools::Long nRefTabNo = GetViewData().GetRefTabNo();
2184 tools::Long nX = GetViewData().GetCurXForTab(nRefTabNo);
2185 tools::Long nY = GetViewData().GetCurYForTab(nRefTabNo);
2186
2187 aViewData.SetEditEngine(eCurrent,
2188 static_cast<ScEditEngineDefaulter*>(pEditView->GetEditEngine()),
2189 pGridWin[i], nX, nY );
2190 if (eCurrent == eActive)
2191 pEditView->ShowCursor( false );
2192 }
2193 }
2194}
2195
2196void ScTabView::KillEditView( bool bNoPaint )
2197{
2200 SCCOL nCol2 = aViewData.GetEditEndCol();
2201 SCROW nRow2 = aViewData.GetEditEndRow();
2202 bool bPaint[4];
2203 bool bNotifyAcc = false;
2204 tools::Rectangle aRectangle[4];
2205
2206 bool bExtended = nRow1 != nRow2; // column is painted to the end anyway
2207
2208 bool bAtCursor = nCol1 <= aViewData.GetCurX() &&
2209 nCol2 >= aViewData.GetCurX() &&
2210 nRow1 == aViewData.GetCurY();
2211 for (sal_uInt16 i = 0; i < 4; i++)
2212 {
2213 bPaint[i] = aViewData.HasEditView( static_cast<ScSplitPos>(i) );
2214 if (bPaint[i])
2215 {
2216 bNotifyAcc = true;
2217
2218 EditView* pView = aViewData.GetEditView( static_cast<ScSplitPos>(i) );
2219 aRectangle[i] = pView->GetInvalidateRect();
2220 }
2221 }
2222
2223 // notify accessibility before all things happen
2224 if (bNotifyAcc && aViewData.GetViewShell()->HasAccessibilityObjects())
2225 aViewData.GetViewShell()->BroadcastAccessibility(SfxHint(SfxHintId::ScAccLeaveEditMode));
2226
2228 for (sal_uInt16 i = 0; i < 4; i++)
2229 {
2230 if (pGridWin[i] && bPaint[i] && pGridWin[i]->IsVisible())
2231 {
2232 pGridWin[i]->ShowCursor();
2233
2234 pGridWin[i]->SetMapMode(pGridWin[i]->GetDrawMapMode());
2235
2237 {
2238 const tools::Rectangle& rInvRect = aRectangle[i];
2239 pGridWin[i]->Invalidate(rInvRect);
2240
2241 // invalidate other views
2242 auto lInvalidateWindows =
2243 [&rInvRect] (ScTabView* pTabView)
2244 {
2245 for (VclPtr<ScGridWindow> const & pWin: pTabView->pGridWin)
2246 {
2247 if (pWin)
2248 pWin->Invalidate(rInvRect);
2249 }
2250 };
2251
2252 SfxLokHelper::forEachOtherView(GetViewData().GetViewShell(), lInvalidateWindows);
2253 }
2254 // #i73567# the cell still has to be repainted
2255 else if (bExtended || ( bAtCursor && !bNoPaint ))
2256 {
2257 pGridWin[i]->Draw( nCol1, nRow1, nCol2, nRow2, ScUpdateMode::All );
2258 pGridWin[i]->UpdateSelectionOverlay();
2259 }
2260 }
2261 }
2262
2263 if (pDrawView)
2264 DrawEnableAnim( true );
2265
2266 // GrabFocus always when this View is active and
2267 // when the input row has the focus
2268
2269 bool bGrabFocus = false;
2270 if (aViewData.IsActive())
2271 {
2272 ScInputHandler* pInputHdl = SC_MOD()->GetInputHdl();
2273 if ( pInputHdl )
2274 {
2275 ScInputWindow* pInputWin = pInputHdl->GetInputWindow();
2276 if (pInputWin && pInputWin->IsInputActive())
2277 bGrabFocus = true;
2278 }
2279 }
2280
2281 if (bGrabFocus)
2282 {
2283// should be done like this, so that Sfx notice it, but it does not work:
2285// therefore first like this:
2287 }
2288
2289 // cursor query only after GrabFocus
2290
2291 for (sal_uInt16 i = 0; i < 4; i++)
2292 {
2293 if (pGridWin[i] && pGridWin[i]->IsVisible())
2294 {
2295 vcl::Cursor* pCur = pGridWin[i]->GetCursor();
2296 if (pCur && pCur->IsVisible())
2297 pCur->Hide();
2298
2299 if (bPaint[i])
2300 {
2301 pGridWin[i]->UpdateCursorOverlay();
2302 pGridWin[i]->UpdateAutoFillOverlay();
2303 }
2304 }
2305 }
2306}
2307
2308void ScTabView::UpdateFormulas(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow)
2309{
2311 return;
2312
2313 for (sal_uInt16 i = 0; i < 4; i++)
2314 {
2315 if (pGridWin[i] && pGridWin[i]->IsVisible())
2316 pGridWin[i]->UpdateFormulas(nStartCol, nStartRow, nEndCol, nEndRow);
2317 }
2318
2319 if ( aViewData.IsPagebreakMode() )
2321
2323
2324 // if in edit mode, adjust edit view area because widths/heights may have changed
2327}
2328
2329// PaintArea - repaint block
2330
2331void ScTabView::PaintArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
2332 ScUpdateMode eMode )
2333{
2334 SCCOL nCol1;
2335 SCROW nRow1;
2336 SCCOL nCol2;
2337 SCROW nRow2;
2338 bool bIsTiledRendering = comphelper::LibreOfficeKit::isActive();
2340
2341 PutInOrder( nStartCol, nEndCol );
2342 PutInOrder( nStartRow, nEndRow );
2343
2344 for (size_t i = 0; i < 4; ++i)
2345 {
2346 if (!pGridWin[i] || !pGridWin[i]->IsVisible())
2347 continue;
2348
2349 ScHSplitPos eHWhich = WhichH( static_cast<ScSplitPos>(i) );
2350 ScVSplitPos eVWhich = WhichV( static_cast<ScSplitPos>(i) );
2351 bool bOut = false;
2352
2353 nCol1 = nStartCol;
2354 nRow1 = nStartRow;
2355 nCol2 = nEndCol;
2356 nRow2 = nEndRow;
2357
2358 SCCOL nLastX = 0;
2359 SCROW nLastY = 0;
2360
2361 if (bIsTiledRendering)
2362 {
2363 nLastX = aViewData.GetMaxTiledCol();
2364 nLastY = aViewData.GetMaxTiledRow();
2365 }
2366 else
2367 {
2368
2369 SCCOL nScrX = aViewData.GetPosX( eHWhich );
2370 SCROW nScrY = aViewData.GetPosY( eVWhich );
2371
2372 if (nCol1 < nScrX)
2373 nCol1 = nScrX;
2374 if (nCol2 < nScrX)
2375 {
2376 if ( eMode == ScUpdateMode::All ) // for UPDATE_ALL, paint anyway
2377 nCol2 = nScrX; // (because of extending strings to the right)
2378 else
2379 bOut = true; // completely outside the window
2380 }
2381 if (nRow1 < nScrY)
2382 nRow1 = nScrY;
2383 if (nRow2 < nScrY)
2384 bOut = true;
2385
2386 nLastX = nScrX + aViewData.VisibleCellsX( eHWhich ) + 1;
2387 nLastY = nScrY + aViewData.VisibleCellsY( eVWhich ) + 1;
2388 }
2389
2390 if (nCol1 > nLastX)
2391 bOut = true;
2392 if (nCol2 > nLastX)
2393 nCol2 = nLastX;
2394 if (nRow1 > nLastY)
2395 bOut = true;
2396 if (nRow2 > nLastY)
2397 nRow2 = nLastY;
2398
2399 if (bOut)
2400 continue;
2401
2402 bool bLayoutRTL = aViewData.GetDocument().IsLayoutRTL( aViewData.GetTabNo() );
2403 tools::Long nLayoutSign = (!bIsTiledRendering && bLayoutRTL) ? -1 : 1;
2404
2405 Point aStart = aViewData.GetScrPos( nCol1, nRow1, static_cast<ScSplitPos>(i) );
2406 Point aEnd = aViewData.GetScrPos( nCol2+1, nRow2+1, static_cast<ScSplitPos>(i) );
2407
2408 if ( eMode == ScUpdateMode::All )
2409 {
2410 if (bIsTiledRendering)
2411 {
2412 // When a cell content is deleted we have no clue about
2413 // the width of the embedded text.
2414 // Anyway, clients will ask only for tiles that overlaps
2415 // the visible area.
2416 // Remember that wsd expects int and that aEnd.X() is
2417 // in pixels and will be converted in twips, before performing
2418 // the lok callback, so we need to avoid that an overflow occurs.
2419 aEnd.setX( std::numeric_limits<int>::max() / 1000 );
2420 }
2421 else
2422 {
2423 aEnd.setX( bLayoutRTL ? 0 : pGridWin[i]->GetOutputSizePixel().Width() );
2424 }
2425 }
2426 aEnd.AdjustX( -nLayoutSign );
2427 aEnd.AdjustY( -1 );
2428
2429 // #i85232# include area below cells (could be done in GetScrPos?)
2430 if ( eMode == ScUpdateMode::All && nRow2 >= rDoc.MaxRow() && !bIsTiledRendering )
2431 aEnd.setY( pGridWin[i]->GetOutputSizePixel().Height() );
2432
2433 aStart.AdjustX( -nLayoutSign ); // include change marks
2434 aStart.AdjustY( -1 );
2435
2436 bool bMarkClipped = aViewData.GetOptions().GetOption( VOPT_CLIPMARKS );
2437 if (bMarkClipped)
2438 {
2439 // ScColumn::IsEmptyData has to be optimized for this
2440 // (switch to Search() )
2444 tools::Long nMarkPixel = static_cast<tools::Long>( SC_CLIPMARK_SIZE * aViewData.GetPPTX() );
2445 aStart.AdjustX( -(nMarkPixel * nLayoutSign) );
2446 }
2447
2448 pGridWin[i]->Invalidate( pGridWin[i]->PixelToLogic( tools::Rectangle( aStart,aEnd ) ) );
2449 }
2450
2451 // #i79909# Calling UpdateAllOverlays here isn't necessary and would lead to overlay calls from a timer,
2452 // with a wrong MapMode if editing in a cell (reference input).
2453 // #i80499# Overlays need updates in a lot of cases, e.g. changing row/column size,
2454 // or showing/hiding outlines. TODO: selections in inactive windows are vanishing.
2455 // #i84689# With relative conditional formats, PaintArea may be called often (for each changed cell),
2456 // so UpdateAllOverlays was moved to ScTabViewShell::Notify and is called only if PaintPartFlags::Left/PaintPartFlags::Top
2457 // is set (width or height changed).
2458}
2459
2461{
2462 ScRange aRef = pData->aRef;
2463 aRef.PutInOrder(); // PutInOrder for the queries below
2464
2465 if ( aRef.aStart == aRef.aEnd )
2467
2468 if (aRef.aStart.Tab() < nTab || aRef.aEnd.Tab() > nTab)
2469 return;
2470
2471 SCCOL nCol1 = aRef.aStart.Col();
2472 SCROW nRow1 = aRef.aStart.Row();
2473 SCCOL nCol2 = aRef.aEnd.Col();
2474 SCROW nRow2 = aRef.aEnd.Row();
2475
2476 // remove -> repaint
2477 // ScUpdateMode::Marks: Invalidate, nothing until end of row
2478
2479 bool bHiddenEdge = false;
2480 SCROW nTmp;
2482 while ( nCol1 > 0 && rDoc.ColHidden(nCol1, nTab) )
2483 {
2484 --nCol1;
2485 bHiddenEdge = true;
2486 }
2487 while ( nCol2 < rDoc.MaxCol() && rDoc.ColHidden(nCol2, nTab) )
2488 {
2489 ++nCol2;
2490 bHiddenEdge = true;
2491 }
2492 nTmp = rDoc.LastVisibleRow(0, nRow1, nTab);
2493 if (!rDoc.ValidRow(nTmp))
2494 nTmp = 0;
2495 if (nTmp < nRow1)
2496 {
2497 nRow1 = nTmp;
2498 bHiddenEdge = true;
2499 }
2500 nTmp = rDoc.FirstVisibleRow(nRow2, rDoc.MaxRow(), nTab);
2501 if (!rDoc.ValidRow(nTmp))
2502 nTmp = rDoc.MaxRow();
2503 if (nTmp > nRow2)
2504 {
2505 nRow2 = nTmp;
2506 bHiddenEdge = true;
2507 }
2508
2509 if ( nCol2 - nCol1 > 1 && nRow2 - nRow1 > 1 && !bHiddenEdge )
2510 {
2511 // only along the edges
2512 PaintArea( nCol1, nRow1, nCol2, nRow1, ScUpdateMode::Marks );
2513 PaintArea( nCol1, nRow1+1, nCol1, nRow2-1, ScUpdateMode::Marks );
2514 PaintArea( nCol2, nRow1+1, nCol2, nRow2-1, ScUpdateMode::Marks );
2515 PaintArea( nCol1, nRow2, nCol2, nRow2, ScUpdateMode::Marks );
2516 }
2517 else // all in one
2518 PaintArea( nCol1, nRow1, nCol2, nRow2, ScUpdateMode::Marks );
2519}
2520
2522{
2523 ScInputHandler* pHdl = SC_MOD()->GetInputHdl( aViewData.GetViewShell() );
2524 if (!pHdl)
2525 return;
2526
2527 ScRangeFindList* pRangeFinder = pHdl->GetRangeFindList();
2528 if ( !(pRangeFinder && pRangeFinder->GetDocName() == aViewData.GetDocShell()->GetTitle()) )
2529 return;
2530
2531 SCTAB nTab = aViewData.GetTabNo();
2532 sal_uInt16 nCount = static_cast<sal_uInt16>(pRangeFinder->Count());
2533
2534 if (nNumber < 0)
2535 {
2536 for (sal_uInt16 i=0; i<nCount; i++)
2537 PaintRangeFinderEntry(&pRangeFinder->GetObject(i),nTab);
2538 }
2539 else
2540 {
2541 sal_uInt16 idx = nNumber;
2542 if (idx < nCount)
2543 PaintRangeFinderEntry(&pRangeFinder->GetObject(idx),nTab);
2544 }
2545}
2546
2547// for chart data selection
2548
2549void ScTabView::AddHighlightRange( const ScRange& rRange, const Color& rColor )
2550{
2551 maHighlightRanges.emplace_back( rRange, rColor );
2552
2553 SCTAB nTab = aViewData.GetTabNo();
2554 if ( nTab >= rRange.aStart.Tab() && nTab <= rRange.aEnd.Tab() )
2555 PaintArea( rRange.aStart.Col(), rRange.aStart.Row(),
2556 rRange.aEnd.Col(), rRange.aEnd.Row(), ScUpdateMode::Marks );
2557}
2558
2560{
2561 SCTAB nTab = aViewData.GetTabNo();
2562 for (ScHighlightEntry const & rEntry : maHighlightRanges)
2563 {
2564 ScRange aRange = rEntry.aRef;
2565 if ( nTab >= aRange.aStart.Tab() && nTab <= aRange.aEnd.Tab() )
2566 PaintArea( aRange.aStart.Col(), aRange.aStart.Row(),
2567 aRange.aEnd.Col(), aRange.aEnd.Row(), ScUpdateMode::Marks );
2568 }
2569
2570 maHighlightRanges.clear();
2571}
2572
2574 const uno::Sequence< chart2::data::HighlightedRange > & rHilightRanges )
2575{
2578 size_t nSize = 0;
2579 size_t nIndex = 0;
2580 std::vector<ReferenceMark> aReferenceMarks( nSize );
2581
2582 for (chart2::data::HighlightedRange const & rHighlightedRange : rHilightRanges)
2583 {
2584 Color aSelColor(ColorTransparency, rHighlightedRange.PreferredColor);
2585 ScRangeList aRangeList;
2588 aRangeList, rHighlightedRange.RangeRepresentation, rDoc, rDoc.GetAddressConvention(), sep ))
2589 {
2590 size_t nListSize = aRangeList.size();
2591 nSize += nListSize;
2592 aReferenceMarks.resize(nSize);
2593
2594 for ( size_t j = 0; j < nListSize; ++j )
2595 {
2596 ScRange& p = aRangeList[j];
2597 ScRange aTargetRange;
2598 if( rHighlightedRange.Index == - 1 )
2599 {
2600 aTargetRange = p;
2601 AddHighlightRange( aTargetRange, aSelColor );
2602 }
2603 else
2604 {
2605 aTargetRange = lcl_getSubRangeByIndex( p, rHighlightedRange.Index );
2606 AddHighlightRange( aTargetRange, aSelColor );
2607 }
2608
2610 {
2611 aTargetRange.PutInOrder();
2612
2613 tools::Long nX1 = aTargetRange.aStart.Col();
2614 tools::Long nX2 = aTargetRange.aEnd.Col();
2615 tools::Long nY1 = aTargetRange.aStart.Row();
2616 tools::Long nY2 = aTargetRange.aEnd.Row();
2617 tools::Long nTab = aTargetRange.aStart.Tab();
2618
2620 nX1, nX2, nY1, nY2,
2621 nTab, aSelColor );
2622 }
2623 }
2624 }
2625 }
2626
2629}
2630
2631void ScTabView::DoDPFieldPopup(std::u16string_view rPivotTableName, sal_Int32 nDimensionIndex, Point aPoint, Size aSize)
2632{
2633 ScDocument& rDocument = aViewData.GetDocShell()->GetDocument();
2635
2636 if (!pWin)
2637 return;
2638
2639 ScDPCollection* pDPCollection = rDocument.GetDPCollection();
2640 ScDPObject* pDPObject = pDPCollection->GetByName(rPivotTableName);
2641 if (!pDPObject)
2642 return;
2643
2644 pDPObject->BuildAllDimensionMembers();
2645
2646 Point aPos = pWin->LogicToPixel(aPoint);
2648 Point aScreenPoint = bLOK ? aPos : pWin->OutputToScreenPixel(aPos);
2649 Size aScreenSize = pWin->LogicToPixel(aSize);
2650
2651 pWin->DPLaunchFieldPopupMenu(aScreenPoint, aScreenSize, nDimensionIndex, pDPObject);
2652}
2653
2654// PaintGrid - repaint data range
2655
2657{
2658 for (sal_uInt16 i = 0; i < 4; i++)
2659 {
2660 if (pGridWin[i] && pGridWin[i]->IsVisible())
2661 pGridWin[i]->Invalidate();
2662 }
2663}
2664
2665// PaintTop - repaint top control elements
2666
2668{
2669 for (sal_uInt16 i = 0; i < 2; i++)
2670 {
2671 if (pColBar[i])
2672 pColBar[i]->Invalidate();
2673 if (pColOutline[i])
2674 pColOutline[i]->Invalidate();
2675 }
2676}
2677
2679{
2680 for (sal_uInt16 i = 0; i < 4; i++)
2681 {
2682 if(pGridWin[i] && pGridWin[i]->IsVisible())
2683 pGridWin[i]->CreateAnchorHandle(rHdl, rAddress);
2684 }
2685}
2686
2687void ScTabView::PaintTopArea( SCCOL nStartCol, SCCOL nEndCol )
2688{
2689 // pixel position of the left edge
2690
2691 if ( nStartCol < aViewData.GetPosX(SC_SPLIT_LEFT) ||
2692 nStartCol < aViewData.GetPosX(SC_SPLIT_RIGHT) )
2694
2695 // adjust freeze (UpdateFixX resets HSplitPos)
2696
2697 if ( aViewData.GetHSplitMode() == SC_SPLIT_FIX && nStartCol < aViewData.GetFixPosX() )
2698 if (aViewData.UpdateFixX())
2699 RepeatResize();
2700
2701 // paint
2702
2703 if (nStartCol>0)
2704 --nStartCol;
2705
2707 bool bLayoutRTL = rDoc.IsLayoutRTL( aViewData.GetTabNo() );
2708 tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
2709
2710 for (sal_uInt16 i = 0; i < 2; i++)
2711 {
2712 ScHSplitPos eWhich = ScHSplitPos(i);
2713 if (pColBar[eWhich])
2714 {
2715 Size aWinSize = pColBar[eWhich]->GetSizePixel();
2716 tools::Long nStartX = aViewData.GetScrPos( nStartCol, 0, eWhich ).X();
2717 tools::Long nEndX;
2718 if (nEndCol >= rDoc.MaxCol())
2719 nEndX = bLayoutRTL ? 0 : ( aWinSize.Width()-1 );
2720 else
2721 nEndX = aViewData.GetScrPos( nEndCol+1, 0, eWhich ).X() - nLayoutSign;
2722 if (nStartX > nEndX)
2723 std::swap(nStartX, nEndX);
2724 pColBar[eWhich]->Invalidate(
2725 tools::Rectangle( nStartX, 0, nEndX, aWinSize.Height()-1 ) );
2726 }
2727 if (pColOutline[eWhich])
2728 pColOutline[eWhich]->Invalidate();
2729 }
2730}
2731
2732// PaintLeft - repaint left control elements
2733
2735{
2736 for (sal_uInt16 i = 0; i < 2; i++)
2737 {
2738 if (pRowBar[i])
2739 pRowBar[i]->Invalidate();
2740 if (pRowOutline[i])
2741 pRowOutline[i]->Invalidate();
2742 }
2743}
2744
2745void ScTabView::PaintLeftArea( SCROW nStartRow, SCROW nEndRow )
2746{
2747 // pixel position of the upper edge
2748
2749 if ( nStartRow < aViewData.GetPosY(SC_SPLIT_TOP) ||
2750 nStartRow < aViewData.GetPosY(SC_SPLIT_BOTTOM) )
2752
2753 // adjust freeze (UpdateFixY reset VSplitPos)
2754
2755 if ( aViewData.GetVSplitMode() == SC_SPLIT_FIX && nStartRow < aViewData.GetFixPosY() )
2756 if (aViewData.UpdateFixY())
2757 RepeatResize();
2758
2759 // paint
2760
2761 if (nStartRow>0)
2762 --nStartRow;
2763
2765 for (sal_uInt16 i = 0; i < 2; i++)
2766 {
2767 ScVSplitPos eWhich = ScVSplitPos(i);
2768 if (pRowBar[eWhich])
2769 {
2770 Size aWinSize = pRowBar[eWhich]->GetSizePixel();
2771 tools::Long nStartY = aViewData.GetScrPos( 0, nStartRow, eWhich ).Y();
2772 tools::Long nEndY;
2773 if (nEndRow >= rDoc.MaxRow())
2774 nEndY = aWinSize.Height() - 1;
2775 else
2776 nEndY = aViewData.GetScrPos( 0, nEndRow+1, eWhich ).Y() - 1;
2777 if (nStartY > nEndY)
2778 std::swap(nStartY, nEndY);
2779 pRowBar[eWhich]->Invalidate(
2780 tools::Rectangle( 0, nStartY, aWinSize.Width()-1, nEndY ) );
2781 }
2782 if (pRowOutline[eWhich])
2783 pRowOutline[eWhich]->Invalidate();
2784 }
2785}
2786
2788{
2789 bool bRet = false;
2791 SCTAB nTab = aViewData.GetTabNo();
2792 if (!rDoc.HasTable(nTab)) // sheet is deleted?
2793 {
2794 SCTAB nCount = rDoc.GetTableCount();
2796 bRet = true;
2797 }
2798 pTabControl->UpdateStatus(); // true = active
2799 return bRet;
2800}
2801
2803{
2804 // called after changes that require the PPT values to be recalculated
2805 // (currently from detective operations)
2806
2807 double nOldX = aViewData.GetPPTX();
2808 double nOldY = aViewData.GetPPTY();
2809
2810 aViewData.RefreshZoom(); // pre-calculate new PPT values
2811
2812 bool bChangedX = ( aViewData.GetPPTX() != nOldX );
2813 bool bChangedY = ( aViewData.GetPPTY() != nOldY );
2814 if ( !(bChangedX || bChangedY) )
2815 return;
2816
2817 // call view SetZoom (including draw scale, split update etc)
2818 // and paint only if values changed
2819
2820 Fraction aZoomX = aViewData.GetZoomX();
2821 Fraction aZoomY = aViewData.GetZoomY();
2822 SetZoom( aZoomX, aZoomY, false );
2823
2824 PaintGrid();
2825 if (bChangedX)
2826 PaintTop();
2827 if (bChangedY)
2828 PaintLeft();
2829}
2830
2831void ScTabView::ActivateView( bool bActivate, bool bFirst )
2832{
2833 if ( bActivate == aViewData.IsActive() && !bFirst )
2834 {
2835 // no assertion anymore - occurs when previously in Drag&Drop switching over
2836 // to another document
2837 return;
2838 }
2839
2840 // is only called for MDI-(De)Activate
2841 // aViewData.Activate behind due to cursor show for KillEditView
2842 // don't delete selection - if Activate(false) is set in ViewData,
2843 // then the selection is not displayed
2844
2845 if (!bActivate)
2846 {
2847 ScModule* pScMod = SC_MOD();
2848 bool bRefMode = pScMod->IsFormulaMode();
2849
2850 // don't cancel reference input, to allow reference
2851 // to other document
2852
2853 if (!bRefMode)
2854 {
2855 // pass view to GetInputHdl, this view may not be current anymore
2856 ScInputHandler* pHdl = SC_MOD()->GetInputHdl(aViewData.GetViewShell());
2857 if (pHdl)
2858 pHdl->EnterHandler();
2859 }
2860 }
2861
2862 PaintExtras();
2863
2864 aViewData.Activate(bActivate);
2865
2866 PaintBlock(false); // repaint, selection after active status
2867
2868 if (!bActivate)
2869 HideAllCursors(); // Cursor
2870 else if (!bFirst)
2872
2873 if (bActivate)
2874 {
2875 if ( bFirst )
2876 {
2878 OSL_ENSURE( pGridWin[eWin], "Corrupted document, not all SplitPos in GridWin" );
2879 if ( !pGridWin[eWin] )
2880 {
2881 eWin = SC_SPLIT_BOTTOMLEFT;
2882 if ( !pGridWin[eWin] )
2883 {
2884 short i;
2885 for ( i=0; i<4; i++ )
2886 {
2887 if ( pGridWin[i] )
2888 {
2889 eWin = static_cast<ScSplitPos>(i);
2890 break; // for
2891 }
2892 }
2893 OSL_ENSURE( i<4, "and BOOM" );
2894 }
2895 aViewData.SetActivePart( eWin );
2896 }
2897 }
2898 // do not call GrabFocus from here!
2899 // if the document is processed, then Sfx calls GrabFocus in the window of the shell.
2900 // if it is a mail body for instance, then it can't get the focus
2902 }
2903 else
2904 pGridWin[aViewData.GetActivePart()]->ClickExtern();
2905}
2906
2908{
2910 if ( eOld == eWhich )
2911 return;
2912
2913 bInActivatePart = true;
2914
2915 bool bRefMode = SC_MOD()->IsFormulaMode();
2916
2917 // the HasEditView call during SetCursor would fail otherwise
2918 if ( aViewData.HasEditView(eOld) && !bRefMode )
2920
2921 ScHSplitPos eOldH = WhichH(eOld);
2922 ScVSplitPos eOldV = WhichV(eOld);
2923 ScHSplitPos eNewH = WhichH(eWhich);
2924 ScVSplitPos eNewV = WhichV(eWhich);
2925 bool bTopCap = pColBar[eOldH] && pColBar[eOldH]->IsMouseCaptured();
2926 bool bLeftCap = pRowBar[eOldV] && pRowBar[eOldV]->IsMouseCaptured();
2927
2928 bool bFocus = pGridWin[eOld]->HasFocus();
2929 bool bCapture = pGridWin[eOld]->IsMouseCaptured();
2930 if (bCapture)
2931 pGridWin[eOld]->ReleaseMouse();
2932 pGridWin[eOld]->ClickExtern();
2933 pGridWin[eOld]->HideCursor();
2934 pGridWin[eWhich]->HideCursor();
2935 aViewData.SetActivePart( eWhich );
2936
2938 pShell->WindowChanged();
2939
2940 pSelEngine->SetWindow(pGridWin[eWhich]);
2941 pSelEngine->SetWhich(eWhich);
2942 pSelEngine->SetVisibleArea( tools::Rectangle(Point(), pGridWin[eWhich]->GetOutputSizePixel()) );
2943
2944 pGridWin[eOld]->MoveMouseStatus(*pGridWin[eWhich]);
2945
2946 if ( bCapture || pGridWin[eWhich]->IsMouseCaptured() )
2947 {
2948 // tracking instead of CaptureMouse, so it can be cancelled cleanly
2949 // (SelectionEngine calls CaptureMouse for SetWindow)
2951 pGridWin[eWhich]->ReleaseMouse();
2952 pGridWin[eWhich]->StartTracking();
2953 }
2954
2955 if ( bTopCap && pColBar[eNewH] )
2956 {
2957 pColBar[eOldH]->SetIgnoreMove(true);
2958 pColBar[eNewH]->SetIgnoreMove(false);
2959 pHdrSelEng->SetWindow( pColBar[eNewH] );
2960 tools::Long nWidth = pColBar[eNewH]->GetOutputSizePixel().Width();
2961 pHdrSelEng->SetVisibleArea( tools::Rectangle( 0, LONG_MIN, nWidth-1, LONG_MAX ) );
2962 pColBar[eNewH]->CaptureMouse();
2963 }
2964 if ( bLeftCap && pRowBar[eNewV] )
2965 {
2966 pRowBar[eOldV]->SetIgnoreMove(true);
2967 pRowBar[eNewV]->SetIgnoreMove(false);
2968 pHdrSelEng->SetWindow( pRowBar[eNewV] );
2969 tools::Long nHeight = pRowBar[eNewV]->GetOutputSizePixel().Height();
2970 pHdrSelEng->SetVisibleArea( tools::Rectangle( LONG_MIN, 0, LONG_MAX, nHeight-1 ) );
2971 pRowBar[eNewV]->CaptureMouse();
2972 }
2973 aHdrFunc.SetWhich(eWhich);
2974
2975 pGridWin[eOld]->ShowCursor();
2976 pGridWin[eWhich]->ShowCursor();
2977
2979 bool bOleActive = ( pClient && pClient->IsObjectInPlaceActive() );
2980
2981 // don't switch ViewShell's active window during RefInput, because the focus
2982 // might change, and subsequent SetReference calls wouldn't find the right EditView
2983 if ( !bRefMode && !bOleActive )
2985
2986 if ( bFocus && !aViewData.IsAnyFillMode() && !bRefMode )
2987 {
2988 // GrabFocus only if previously the other GridWindow had the focus
2989 // (for instance due to search and replace)
2990 pGridWin[eWhich]->GrabFocus();
2991 }
2992
2993 bInActivatePart = false;
2994}
2995
2997{
2998 for (VclPtr<ScGridWindow> & pWin : pGridWin)
2999 {
3000 if (pWin)
3001 pWin->ClickExtern();
3002 }
3003}
3004
3006{
3008 if (pWin)
3009 pWin->UpdateInputContext();
3010
3011 if (pTabControl)
3012 pTabControl->UpdateInputContext();
3013}
3014
3015// GetGridWidth - width of an output range (for ViewData)
3016
3018{
3019 // at present only the size of the current pane is synchronized with
3020 // the size of the visible area in Online;
3021 // as a workaround we use the same width for all panes independently
3022 // from the eWhich value
3024 {
3025 ScGridWindow* pGridWindow = aViewData.GetActiveWin();
3026 if (pGridWindow)
3027 return pGridWindow->GetSizePixel().Width();
3028 }
3029
3031 if (pGridWin[eGridWhich])
3032 return pGridWin[eGridWhich]->GetSizePixel().Width();
3033 else
3034 return 0;
3035}
3036
3037// GetGridHeight - height of an output range (for ViewData)
3038
3040{
3041 // at present only the size of the current pane is synchronized with
3042 // the size of the visible area in Online;
3043 // as a workaround we use the same height for all panes independently
3044 // from the eWhich value
3046 {
3047 ScGridWindow* pGridWindow = aViewData.GetActiveWin();
3048 if (pGridWindow)
3049 return pGridWindow->GetSizePixel().Height();
3050 }
3051
3052 ScSplitPos eGridWhich = ( eWhich == SC_SPLIT_TOP ) ? SC_SPLIT_TOPLEFT : SC_SPLIT_BOTTOMLEFT;
3053 if (pGridWin[eGridWhich])
3054 return pGridWin[eGridWhich]->GetSizePixel().Height();
3055 else
3056 return 0;
3057}
3058
3060{
3061 SC_MOD()->InputEnterHandler();
3062}
3063
3065{
3066 ScInputHandler* pHdl = SC_MOD()->GetInputHdl(aViewData.GetViewShell());
3067 if (pHdl)
3069
3070 UpdateFixPos();
3071
3073
3074 // VisArea...
3075 // AW: Discussed with NN if there is a reason that new map mode was only set for one window,
3076 // but is not. Setting only on one window causes the first repaint to have the old mapMode
3077 // in three of four views, so the overlay will save the wrong content e.g. when zooming out.
3078 // Changing to setting map mode at all windows.
3079
3080 for (sal_uInt32 i = 0; i < 4; i++)
3081 {
3082 if (pGridWin[i])
3083 pGridWin[i]->SetMapMode(pGridWin[i]->GetDrawMapMode());
3084 }
3085
3086 SetNewVisArea();
3087
3088 InterpretVisible(); // have everything calculated before painting
3089
3090 SfxBindings& rBindings = aViewData.GetBindings();
3091 rBindings.Invalidate( SID_ATTR_ZOOM );
3092 rBindings.Invalidate( SID_ATTR_ZOOMSLIDER );
3093 rBindings.Invalidate(SID_ZOOM_IN);
3094 rBindings.Invalidate(SID_ZOOM_OUT);
3095
3097
3098 // To not change too much, use pWin here
3100
3101 if ( pWin && aViewData.HasEditView( aViewData.GetActivePart() ) )
3102 {
3103 // flush OverlayManager before changing the MapMode
3104 pWin->flushOverlayManager();
3105
3106 // make sure the EditView's position and size are updated
3107 // with the right (logic, not drawing) MapMode
3110 }
3111}
3112
3114{
3115 for (sal_uInt16 i = 0; i < 4; i++)
3116 {
3117 if (pGridWin[i] && pGridWin[i]->IsVisible())
3118 pGridWin[i]->CheckNeedsRepaint();
3119 }
3120}
3121
3123{
3124 for (VclPtr<ScGridWindow> & pWin : pGridWin)
3125 {
3126 if (pWin && pWin->IsVisible() && pWin->NeedsRepaint())
3127 return true;
3128 }
3129 return false;
3130}
3131
3132/* 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
SC_DLLPUBLIC sal_uInt16 GetRowHeight(SCROW nRow, SCTAB nTab, bool bHiddenAsZero=true) const
Definition: document.cxx:4225
SC_DLLPUBLIC bool GetMatrixFormulaRange(const ScAddress &rCellPos, ScRange &rMatrix)
Definition: document.cxx:5536
SC_DLLPUBLIC sal_uInt16 GetColWidth(SCCOL nCol, SCTAB nTab, bool bHiddenAsZero=true) const
Definition: document.cxx:4184
bool ValidRow(SCROW nRow) const
Definition: document.hxx:899
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:5676
SC_DLLPUBLIC SCCOL MaxCol() const
Definition: document.hxx:891
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:892
bool IsInVBAMode() const
Definition: document.cxx:6607
SC_DLLPUBLIC bool HasSparkline(ScAddress const &rPosition)
Definition: document.cxx:6636
SC_DLLPUBLIC void MakeTable(SCTAB nTab, bool _bNeedsNameCheck=true)
Definition: document.cxx:172
SC_DLLPUBLIC bool HasDataPilotAtPosition(ScAddress const &rAddress) const
Definition: document.hxx:847
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:6210
SC_DLLPUBLIC bool ColHidden(SCCOL nCol, SCTAB nTab, SCCOL *pFirstCol=nullptr, SCCOL *pLastCol=nullptr) const
Definition: document.cxx:4509
void SkipOverlapped(SCCOL &rCol, SCROW &rRow, SCTAB nTab) const
Definition: document.cxx:5829
SC_DLLPUBLIC bool GetPrintArea(SCTAB nTab, SCCOL &rEndCol, SCROW &rEndRow, bool bNotes=true) const
Definition: documen2.cxx:602
SC_DLLPUBLIC SCROW LastVisibleRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab) const
Definition: document.cxx:4547
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:1414
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:4778
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:4539
SC_DLLPUBLIC SCTAB GetTableCount() const
Definition: document.cxx:317
bool ValidColRow(SCCOL nCol, SCROW nRow) const
Definition: document.hxx:900
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:3659
void flushOverlayManager()
Definition: gridwin.cxx:6938
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:3035
sal_uInt16 GetMoveDir() const
Definition: inputopt.hxx:45
bool GetMoveSelection() const
Definition: inputopt.hxx:47
bool IsInputActive()
Definition: inputwin.cxx:612
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:644
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:1638
bool GetForceFocusOnCurCell() const
Definition: tabvwsh.hxx:388
virtual const FmFormShell * GetFormShell() const override
Definition: tabvwsh.hxx:342
void SetSparklineShell(bool bActive)
Definition: tabvwsh4.cxx:695
void UpdateInputHandler(bool bForce=false, bool bStopEditing=true)
Definition: tabvwsha.cxx:666
void SetPivotShell(bool bActive)
Definition: tabvwsh4.cxx:673
void SetForceFocusOnCurCell(bool bFlag)
Definition: tabvwsh.hxx:389
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:238
bool IsRefInputMode() const
Definition: tabvwsha.cxx:616
void AddHighlightRange(const ScRange &rRange, const Color &rColor)
Definition: tabview3.cxx:2549
void UpdatePageBreakData(bool bForcePaint=false)
Definition: tabview2.cxx:1479
sal_uInt16 GetLockedModifiers() const
Definition: tabview.cxx:1905
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:2734
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:1469
void GetAreaMoveEndPosition(SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, SCCOL &rAreaX, SCROW &rAreaY, ScFollowMode &rMode)
Definition: tabview2.cxx:649
void CheckNeedsRepaint()
Definition: tabview3.cxx:3113
std::unique_ptr< ScViewSelectionEngine > pSelEngine
Definition: tabview.hxx:124
void PaintTopArea(SCCOL nStartCol, SCCOL nEndCol)
Definition: tabview3.cxx:2687
void AddWindowToForeignEditView(SfxViewShell *pViewShell, ScSplitPos eWhich)
Definition: tabview3.cxx:2063
void SelectTabPage(const sal_uInt16 nTab)
Definition: tabview3.cxx:1815
void UpdateVarZoom()
Definition: tabview.cxx:720
void UpdateShow()
Definition: tabview.cxx:1416
void TestHintWindow()
Definition: tabview3.cxx:783
ScHeaderFunctionSet aHdrFunc
Definition: tabview.hxx:128
void MarkRows()
Definition: tabview3.cxx:1598
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:920
void DoChartSelection(const css::uno::Sequence< css::chart2::data::HighlightedRange > &rHilightRanges)
Definition: tabview3.cxx:2573
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:1680
void RemoveHintWindow()
Definition: tabview3.cxx:881
void DoneRefMode(bool bContinue=false)
Definition: tabview4.cxx:159
void DrawEnableAnim(bool bSet)
Definition: tabview5.cxx:504
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:1345
std::array< VclPtr< ScGridWindow >, 4 > pGridWin
Definition: tabview.hxx:142
VclPtr< ScTabControl > pTabControl
Definition: tabview.hxx:149
bool PaintExtras()
Definition: tabview3.cxx:2787
SC_DLLPUBLIC void RefreshZoom()
Definition: tabview5.cxx:435
void MarkRange(const ScRange &rRange, bool bSetCursor=true, bool bContinue=false)
Definition: tabview3.cxx:1711
void MakeEditView(ScEditEngineDefaulter *pEngine, SCCOL nCol, SCROW nRow)
Definition: tabview3.cxx:2116
void FindNextUnprot(bool bShift, bool bInSelection)
Definition: tabview3.cxx:1544
void CheckSelectionTransfer()
Definition: tabview3.cxx:474
bool SelMouseButtonDown(const MouseEvent &rMEvt)
Definition: tabview3.cxx:1172
void ClearHighlightRanges()
Definition: tabview3.cxx:2559
void ActivateView(bool bActivate, bool bFirst)
Definition: tabview3.cxx:2831
tools::Long GetGridWidth(ScHSplitPos eWhich)
Definition: tabview3.cxx:3017
void InitRefMode(SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, ScRefType eType)
Definition: tabview4.cxx:309
bool NeedsRepaint()
Definition: tabview3.cxx:3122
void UpdateHeaderWidth(const ScVSplitPos *pWhich=nullptr, const SCROW *pPosY=nullptr)
Definition: tabview.cxx:1347
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:1329
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:1271
void PaintArea(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, ScUpdateMode eMode=ScUpdateMode::All)
Definition: tabview3.cxx:2331
tools::Long GetGridHeight(ScVSplitPos eWhich)
Definition: tabview3.cxx:3039
SC_DLLPUBLIC void MoveCursorAbs(SCCOL nCurX, SCROW nCurY, ScFollowMode eMode, bool bShift, bool bControl, bool bKeepOld=false, bool bKeepSel=false)
Definition: tabview3.cxx:1194
static void UpdateInputLine()
Definition: tabview3.cxx:3059
ScViewData & GetViewData()
Definition: tabview.hxx:335
void SetZoom(const Fraction &rNewX, const Fraction &rNewY, bool bAll)
Definition: tabview5.cxx:427
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:877
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:274
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:1152
void Unmark()
Definition: tabview3.cxx:1747
void ZoomChanged()
Definition: tabview3.cxx:3064
void MoveCursorScreen(SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, bool bShift)
Definition: tabview3.cxx:1375
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:2308
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:1700
void ActivatePart(ScSplitPos eWhich)
Definition: tabview3.cxx:2907
void HideListBox()
Definition: tabview3.cxx:2996
std::array< VclPtr< ScRowBar >, 2 > pRowBar
Definition: tabview.hxx:144
void HideNoteMarker()
Definition: tabview2.cxx:1420
void RecalcPPT()
Definition: tabview3.cxx:2802
void DoDPFieldPopup(std::u16string_view rPivotTableName, sal_Int32 nDimensionIndex, Point aPoint, Size aSize)
Definition: tabview3.cxx:2631
void SelectNextTab(short nDir, bool bExtendSelection)
Definition: tabview3.cxx:1777
bool HasHintWindow() const
Definition: tabview3.cxx:879
void CreateAnchorHandles(SdrHdlList &rHdl, const ScAddress &rAddress)
Definition: tabview3.cxx:2678
void InvalidateSplit()
Definition: tabview.cxx:2142
std::unique_ptr< ScHeaderSelectionEngine > pHdrSelEng
Definition: tabview.hxx:127
void SetMarkData(const ScMarkData &rNew)
Definition: tabview3.cxx:1761
void MarkDataChanged()
Definition: tabview3.cxx:1770
void DrawDeselectAll()
Definition: tabview5.cxx:388
void ScrollY(tools::Long nDeltaY, ScVSplitPos eWhich, bool bUpdBars=true)
Definition: tabview.cxx:1235
void UpdateRef(SCCOL nCurX, SCROW nCurY, SCTAB nCurZ)
Definition: tabview4.cxx:186
void KillEditView(bool bNoPaint)
Definition: tabview3.cxx:2196
bool bInActivatePart
Definition: tabview.hxx:206
void MoveCursorEnter(bool bShift)
Definition: tabview3.cxx:1412
void PaintTop()
Definition: tabview3.cxx:2667
void ActiveGrabFocus()
Definition: tabview.cxx:891
void CursorPosChanged()
Definition: tabview3.cxx:629
void SetNewVisArea()
Definition: tabview.cxx:2154
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:1822
void InterpretVisible()
Definition: tabview4.cxx:498
void MarkColumns()
Definition: tabview3.cxx:1571
bool UpdateVisibleRange()
Definition: tabview.cxx:1496
void HideAllCursors()
Definition: tabview3.cxx:220
void OnLibreOfficeKitTabChanged()
Definition: tabview3.cxx:2073
void MoveCursorArea(SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, bool bShift, bool bKeepSel=false)
Definition: tabview3.cxx:1337
void SetTabProtectionSymbol(SCTAB nTab, const bool bProtect)
Definition: tabview3.cxx:527
void PaintRangeFinder(tools::Long nNumber)
Definition: tabview3.cxx:2521
void UpdateEditView()
Definition: tabview3.cxx:2173
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:2460
void RepeatResize(bool bUpdateFix=true)
Definition: tabview.cxx:762
ScViewFunctionSet aFunctionSet
Definition: tabview.hxx:125
void PaintLeftArea(SCROW nStartRow, SCROW nEndRow)
Definition: tabview3.cxx:2745
VclPtr< vcl::Window > pFrameWin
Definition: tabview.hxx:121
void UpdateInputContext()
Definition: tabview3.cxx:3005
void RemoveWindowFromForeignEditView(SfxViewShell *pViewShell, ScSplitPos eWhich)
Definition: tabview3.cxx:2068
void UpdateFixPos()
Definition: tabview.cxx:749
void PaintGrid()
Definition: tabview3.cxx:2656
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:4026
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:4015
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:4061
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:4127
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:88
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)
css::uno::Reference< css::frame::XModel3 > GetModel() const
OUString GetTitle(sal_uInt16 nMaxLen=0) const
bool HasChildWindow(sal_uInt16)
SfxChildWindow * GetChildWindow(sal_uInt16)
SfxFrame & GetFrame() const
void DisconnectAllClients()
virtual css::uno::Reference< css::frame::XModel > GetCurrentDocument() const
SfxViewFrame * GetViewFrame() const
SfxInPlaceClient * GetIPClient() const
void SetWindow(vcl::Window *pViewPort)
virtual void libreOfficeKitViewCallback(int nType, const char *pPayload) const override
constexpr tools::Long Height() 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 bool lcl_IsRefDlgActive(SfxViewFrame *pViewFrm)
Definition: tabview3.cxx:452
static weld::Window * lcl_GetCareWin(SfxViewFrame *pViewFrm)
Definition: tabview3.cxx:887
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:48
ScUpdateMode
Definition: viewutil.hxx:39