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;
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.getWidth())
433 {
435 }
436
437 // Only invalidate if spreadsheet extended to the bottom
438 if (aNewRowArea.getHeight())
439 {
441 }
442
443 // Provide size in the payload, so clients don't have to
444 // call lok::Document::getDocumentSize().
445 std::stringstream ss;
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 DoneBlockMode( nModifier != 0 );
1636 InitBlockMode( nStartCol, 0, nTab, true, true);
1637 MarkCursor( nCol, rDoc.MaxRow(), nTab );
1638 bMoveIsShift = false;
1639 SetCursor( nCol, 0 );
1641}
1642
1643void ScTabView::MarkRows(SCROW nRow, sal_Int16 nModifier)
1644{
1646 SCROW nStartRow = nRow;
1647 SCTAB nTab = aViewData.GetTabNo();
1648
1649 if ((nModifier & KEY_SHIFT) == KEY_SHIFT)
1650 bMoveIsShift = true;
1651
1652 DoneBlockMode( nModifier != 0 );
1653 InitBlockMode( 0, nStartRow, nTab, true, false, true );
1654 MarkCursor( rDoc.MaxCol(), nRow, nTab );
1655 bMoveIsShift = false;
1656 SetCursor( 0, nRow );
1658}
1659
1660void ScTabView::MarkDataArea( bool bIncludeCursor )
1661{
1663 SCTAB nTab = aViewData.GetTabNo();
1664 SCCOL nStartCol = aViewData.GetCurX();
1665 SCROW nStartRow = aViewData.GetCurY();
1666 SCCOL nEndCol = nStartCol;
1667 SCROW nEndRow = nStartRow;
1668
1669 rDoc.GetDataArea( nTab, nStartCol, nStartRow, nEndCol, nEndRow, bIncludeCursor, false );
1670
1672 DoneBlockMode();
1673 InitBlockMode( nStartCol, nStartRow, nTab );
1674 MarkCursor( nEndCol, nEndRow, nTab );
1676
1678}
1679
1681{
1684 ScRange aMatrix;
1685 if ( rDoc.GetMatrixFormulaRange( aCursor, aMatrix ) )
1686 {
1687 MarkRange( aMatrix, false ); // cursor is already within the range
1688 }
1689}
1690
1691void ScTabView::MarkRange( const ScRange& rRange, bool bSetCursor, bool bContinue )
1692{
1694 SCTAB nTab = rRange.aStart.Tab();
1695 SetTabNo( nTab );
1696
1698 DoneBlockMode( bContinue ); // bContinue==true -> clear old mark
1699 if (bSetCursor) // if Cursor is set, also always align
1700 {
1701 SCCOL nAlignX = rRange.aStart.Col();
1702 SCROW nAlignY = rRange.aStart.Row();
1703 bool bCol = ( rRange.aStart.Col() == 0 && rRange.aEnd.Col() == rDoc.MaxCol() ) && !aViewData.GetDocument().IsInVBAMode();
1704 bool bRow = ( rRange.aStart.Row() == 0 && rRange.aEnd.Row() == rDoc.MaxRow() );
1705 if ( bCol )
1707 if ( bRow )
1709 AlignToCursor( nAlignX, nAlignY, SC_FOLLOW_JUMP );
1710 }
1711 InitBlockMode( rRange.aStart.Col(), rRange.aStart.Row(), nTab );
1712 MarkCursor( rRange.aEnd.Col(), rRange.aEnd.Row(), nTab );
1713 if (bSetCursor)
1714 {
1715 SCCOL nPosX = rRange.aStart.Col();
1716 SCROW nPosY = rRange.aStart.Row();
1717 rDoc.SkipOverlapped(nPosX, nPosY, nTab);
1718
1720 SetCursor( nPosX, nPosY );
1721 }
1723
1725}
1726
1728{
1729 ScMarkData& rMark = aViewData.GetMarkData();
1730 if ( rMark.IsMarked() || rMark.IsMultiMarked() )
1731 {
1732 SCCOL nCurX;
1733 SCROW nCurY;
1734 aViewData.GetMoveCursor( nCurX,nCurY );
1735 MoveCursorAbs( nCurX, nCurY, SC_FOLLOW_NONE, false, false );
1736
1738 }
1739}
1740
1742{
1743 DoneBlockMode();
1745 aViewData.GetMarkData() = rNew;
1746
1748}
1749
1751{
1752 // has to be called after making direct changes to mark data (not via MarkCursor etc)
1753
1755}
1756
1757void ScTabView::SelectNextTab( short nDir, bool bExtendSelection )
1758{
1759 if (!nDir)
1760 return;
1761 OSL_ENSURE( nDir==-1 || nDir==1, "SelectNextTab: invalid value");
1762
1764 SCTAB nTab = aViewData.GetTabNo();
1765 if (nDir<0)
1766 {
1767 if (!nTab)
1768 return;
1769 --nTab;
1770 while (!rDoc.IsVisible(nTab))
1771 {
1772 if (!nTab)
1773 return;
1774 --nTab;
1775 }
1776 }
1777 else
1778 {
1779 SCTAB nCount = rDoc.GetTableCount();
1780 ++nTab;
1781 if (nTab >= nCount)
1782 return;
1783 while (!rDoc.IsVisible(nTab))
1784 {
1785 ++nTab;
1786 if (nTab >= nCount)
1787 return;
1788 }
1789 }
1790
1791 SetTabNo( nTab, false, bExtendSelection );
1792 PaintExtras();
1793}
1794
1795void ScTabView::SelectTabPage( const sal_uInt16 nTab )
1796{
1797 pTabControl->SwitchToPageId( nTab );
1798}
1799
1800// SetTabNo - set the displayed sheet
1801
1802void ScTabView::SetTabNo( SCTAB nTab, bool bNew, bool bExtendSelection, bool bSameTabButMoved )
1803{
1804 if ( !ValidTab(nTab) )
1805 {
1806 OSL_FAIL("SetTabNo: invalid sheet");
1807 return;
1808 }
1809
1810 if (!bNew && nTab == aViewData.GetTabNo())
1811 return;
1812
1813 // FormShell would like to be informed before the switch
1815 if (pFormSh)
1816 {
1817 bool bAllowed = pFormSh->PrepareClose();
1818 if (!bAllowed)
1819 {
1822
1823 return; // FormShell says that it can not be switched
1824 }
1825 }
1826
1827 // not InputEnterHandler due to reference input
1828
1830
1831 rDoc.MakeTable( nTab );
1832
1833 // Update pending row heights before switching the sheet, so Reschedule from the progress bar
1834 // doesn't paint the new sheet with old heights
1836
1837 SCTAB nTabCount = rDoc.GetTableCount();
1838 SCTAB nOldPos = nTab;
1839 while (!rDoc.IsVisible(nTab)) // search for next visible
1840 {
1841 bool bUp = (nTab>=nOldPos);
1842 if (bUp)
1843 {
1844 ++nTab;
1845 if (nTab>=nTabCount)
1846 {
1847 nTab = nOldPos;
1848 bUp = false;
1849 }
1850 }
1851
1852 if (!bUp)
1853 {
1854 if (nTab != 0)
1855 --nTab;
1856 else
1857 {
1858 OSL_FAIL("no visible sheets");
1859 rDoc.SetVisible( 0, true );
1860 }
1861 }
1862 }
1863
1864 // #i71490# Deselect drawing objects before changing the sheet number in view data,
1865 // so the handling of notes still has the sheet selected on which the notes are.
1867
1868 ScModule* pScMod = SC_MOD();
1869 bool bRefMode = pScMod->IsFormulaMode();
1870 if ( !bRefMode ) // query, so that RefMode works when switching sheet
1871 {
1872 DoneBlockMode();
1873 pSelEngine->Reset(); // reset all flags, including locked modifiers
1874 aViewData.SetRefTabNo( nTab );
1875 }
1876
1877 ScSplitPos eOldActive = aViewData.GetActivePart(); // before switching
1878 bool bFocus = pGridWin[eOldActive] && pGridWin[eOldActive]->HasFocus();
1879
1880 aViewData.SetTabNo( nTab );
1881 if (mpSpellCheckCxt)
1882 mpSpellCheckCxt->setTabNo( nTab );
1883 // UpdateShow before SetCursor, so that UpdateAutoFillMark finds the correct
1884 // window (is called from SetCursor)
1885 UpdateShow();
1886
1887 SfxBindings& rBindings = aViewData.GetBindings();
1888 ScMarkData& rMark = aViewData.GetMarkData();
1889
1890 bool bAllSelected = true;
1891 for (SCTAB nSelTab = 0; nSelTab < nTabCount; ++nSelTab)
1892 {
1893 if (!rDoc.IsVisible(nSelTab) || rMark.GetTableSelect(nSelTab))
1894 {
1895 if (nTab == nSelTab)
1896 // This tab is already in selection. Keep the current
1897 // selection.
1898 bExtendSelection = true;
1899 }
1900 else
1901 {
1902 bAllSelected = false;
1903 if (bExtendSelection)
1904 // We got what we need. No need to stay in the loop.
1905 break;
1906 }
1907 }
1908 if (bAllSelected && !bNew)
1909 // #i6327# if all tables are selected, a selection event (#i6330#) will deselect all
1910 // (not if called with bNew to update settings)
1911 bExtendSelection = false;
1912
1913 if (bExtendSelection)
1914 rMark.SelectTable( nTab, true );
1915 else
1916 {
1917 rMark.SelectOneTable( nTab );
1918 rBindings.Invalidate( FID_FILL_TAB );
1919 rBindings.Invalidate( FID_TAB_DESELECTALL );
1920 }
1921
1922 bool bUnoRefDialog = pScMod->IsRefDialogOpen() && pScMod->GetCurRefDlgId() == WID_SIMPLE_REF;
1923
1924 // recalc zoom-dependent values (before TabChanged, before UpdateEditViewPos)
1925 RefreshZoom();
1926 UpdateVarZoom();
1927
1928 if ( bRefMode ) // hide EditView if necessary (after aViewData.SetTabNo !)
1929 {
1930 for (VclPtr<ScGridWindow> & pWin : pGridWin)
1931 {
1932 if (pWin && pWin->IsVisible())
1933 pWin->UpdateEditViewPos();
1934 }
1935 }
1936
1937 TabChanged(bSameTabButMoved); // DrawView
1938 collectUIInformation({{"TABLE", OUString::number(nTab)}});
1940
1941 aViewData.GetViewShell()->WindowChanged(); // if the active window has changed
1944
1945 if ( !bUnoRefDialog )
1946 aViewData.GetViewShell()->DisconnectAllClients(); // important for floating frames
1947 else
1948 {
1949 // hide / show inplace client
1950 ScClient* pClient = static_cast<ScClient*>(aViewData.GetViewShell()->GetIPClient());
1951 if ( pClient && pClient->IsObjectInPlaceActive() )
1952 {
1953 tools::Rectangle aObjArea = pClient->GetObjArea();
1954 if ( nTab == aViewData.GetRefTabNo() )
1955 {
1956 // move to its original position
1957
1958 SdrOle2Obj* pDrawObj = pClient->GetDrawObj();
1959 if ( pDrawObj )
1960 {
1961 tools::Rectangle aRect = pDrawObj->GetLogicRect();
1962 MapMode aMapMode( MapUnit::Map100thMM );
1963 Size aOleSize = pDrawObj->GetOrigObjSize( &aMapMode );
1964 aRect.SetSize( aOleSize );
1965 aObjArea = aRect;
1966 }
1967 }
1968 else
1969 {
1970 // move to an invisible position
1971
1972 aObjArea.SetPos( Point( 0, -2*aObjArea.GetHeight() ) );
1973 }
1974 pClient->SetObjArea( aObjArea );
1975 }
1976 }
1977
1978 if ( bFocus && aViewData.GetActivePart() != eOldActive && !bRefMode )
1979 ActiveGrabFocus(); // grab focus to the pane that's active now
1980
1981 // freeze
1982
1983 bool bResize = false;
1985 if (aViewData.UpdateFixX())
1986 bResize = true;
1988 if (aViewData.UpdateFixY())
1989 bResize = true;
1990 if (bResize)
1991 RepeatResize();
1993
1994 if ( aViewData.IsPagebreakMode() )
1996
1997 // Form Layer must know the visible area of the new sheet
1998 // that is why MapMode must already be correct here
1999 for (VclPtr<ScGridWindow> & pWin : pGridWin)
2000 {
2001 if (pWin)
2002 pWin->SetMapMode(pWin->GetDrawMapMode());
2003 }
2004 SetNewVisArea();
2005
2006 PaintGrid();
2007 PaintTop();
2008 PaintLeft();
2009 PaintExtras();
2010
2012 rBindings.Invalidate( SID_DELETE_PRINTAREA ); // Menu
2013 rBindings.Invalidate( FID_DEL_MANUALBREAKS );
2014 rBindings.Invalidate( FID_RESET_PRINTZOOM );
2015 rBindings.Invalidate( SID_STATUS_DOCPOS ); // Status bar
2016 rBindings.Invalidate( SID_ROWCOL_SELCOUNT ); // Status bar
2017 rBindings.Invalidate( SID_STATUS_PAGESTYLE ); // Status bar
2018 rBindings.Invalidate( SID_CURRENTTAB ); // Navigator
2019 rBindings.Invalidate( SID_STYLE_FAMILY2 ); // Designer
2020 rBindings.Invalidate( SID_STYLE_FAMILY4 ); // Designer
2021 rBindings.Invalidate( SID_TABLES_COUNT );
2022
2023 if (pScMod->IsRefDialogOpen())
2024 {
2025 sal_uInt16 nCurRefDlgId=pScMod->GetCurRefDlgId();
2027 SfxChildWindow* pChildWnd = pViewFrm->GetChildWindow( nCurRefDlgId );
2028 if (pChildWnd)
2029 {
2030 if (pChildWnd->GetController())
2031 {
2032 IAnyRefDialog* pRefDlg = dynamic_cast<IAnyRefDialog*>(pChildWnd->GetController().get());
2033 if (pRefDlg)
2034 pRefDlg->ViewShellChanged();
2035 }
2036 }
2037 }
2038
2040}
2041
2043{
2044 aExtraEditViewManager.Add(pViewShell, eWhich);
2045}
2046
2048{
2049 aExtraEditViewManager.Remove(pViewShell, eWhich);
2050}
2051
2053{
2055 return;
2056
2057 ScTabViewShell* pThisViewShell = aViewData.GetViewShell();
2058 SCTAB nThisTabNo = pThisViewShell->GetViewData().GetTabNo();
2059 auto lTabSwitch = [pThisViewShell, nThisTabNo] (ScTabViewShell* pOtherViewShell)
2060 {
2061 ScViewData& rOtherViewData = pOtherViewShell->GetViewData();
2062 SCTAB nOtherTabNo = rOtherViewData.GetTabNo();
2063 if (nThisTabNo == nOtherTabNo)
2064 {
2065 for (int i = 0; i < 4; ++i)
2066 {
2067 if (rOtherViewData.HasEditView(ScSplitPos(i)))
2068 {
2069 pThisViewShell->AddWindowToForeignEditView(pOtherViewShell, ScSplitPos(i));
2070 }
2071 }
2072 }
2073 else
2074 {
2075 for (int i = 0; i < 4; ++i)
2076 {
2077 if (rOtherViewData.HasEditView(ScSplitPos(i)))
2078 {
2079 pThisViewShell->RemoveWindowFromForeignEditView(pOtherViewShell, ScSplitPos(i));
2080 }
2081 }
2082 }
2083 };
2084
2085 SfxLokHelper::forEachOtherView(pThisViewShell, lTabSwitch);
2086
2087 pThisViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_HEADER, "all");
2088
2089 if (pThisViewShell->GetInputHandler())
2090 pThisViewShell->GetInputHandler()->UpdateLokReferenceMarks();
2091}
2092
2093// paint functions - only for this View
2094
2096{
2098
2099 if (pDrawView)
2100 DrawEnableAnim( false );
2101
2102 EditView* pSpellingView = aViewData.GetSpellingView();
2103
2104 for (sal_uInt16 i = 0; i < 4; i++)
2105 {
2106 if (pGridWin[i] && pGridWin[i]->IsVisible() && !aViewData.HasEditView(ScSplitPos(i)))
2107 {
2108 ScHSplitPos eHWhich = WhichH( static_cast<ScSplitPos>(i) );
2109 ScVSplitPos eVWhich = WhichV( static_cast<ScSplitPos>(i) );
2110 SCCOL nScrX = aViewData.GetPosX( eHWhich );
2111 SCROW nScrY = aViewData.GetPosY( eVWhich );
2112
2113 bool bPosVisible =
2114 ( nCol >= nScrX && nCol <= nScrX + aViewData.VisibleCellsX(eHWhich) - 1 &&
2115 nRow >= nScrY && nRow <= nScrY + aViewData.VisibleCellsY(eVWhich) - 1 );
2116
2117 // for the active part, create edit view even if outside the visible area,
2118 // so input isn't lost (and the edit view may be scrolled into the visible area)
2119
2120 // #i26433# during spelling, the spelling view must be active
2121 if ( bPosVisible || aViewData.GetActivePart() == static_cast<ScSplitPos>(i) ||
2122 ( pSpellingView && aViewData.GetEditView(static_cast<ScSplitPos>(i)) == pSpellingView ) )
2123 {
2124 pGridWin[i]->HideCursor();
2125
2126 pGridWin[i]->DeleteCursorOverlay();
2127 pGridWin[i]->DeleteAutoFillOverlay();
2128 pGridWin[i]->DeleteCopySourceOverlay();
2129
2130 // flush OverlayManager before changing MapMode to text edit
2131 pGridWin[i]->flushOverlayManager();
2132
2133 // MapMode must be set after HideCursor
2134 pGridWin[i]->SetMapMode(aViewData.GetLogicMode());
2135
2136 aViewData.SetEditEngine( static_cast<ScSplitPos>(i), pEngine, pGridWin[i], nCol, nRow );
2137
2138 if ( !bPosVisible )
2139 {
2140 // move the edit view area to the real (possibly negative) position,
2141 // or hide if completely above or left of the window
2142 pGridWin[i]->UpdateEditViewPos();
2143 }
2144 }
2145 }
2146 }
2147
2149 aViewData.GetViewShell()->BroadcastAccessibility(SfxHint(SfxHintId::ScAccEnterEditMode));
2150}
2151
2153{
2155 for (sal_uInt16 i = 0; i < 4; i++)
2156 {
2157 ScSplitPos eCurrent = ScSplitPos(i);
2158 if (aViewData.HasEditView(eCurrent))
2159 {
2160 EditView* pEditView = aViewData.GetEditView(eCurrent);
2161
2162 tools::Long nRefTabNo = GetViewData().GetRefTabNo();
2163 tools::Long nX = GetViewData().GetCurXForTab(nRefTabNo);
2164 tools::Long nY = GetViewData().GetCurYForTab(nRefTabNo);
2165
2166 aViewData.SetEditEngine(eCurrent,
2167 static_cast<ScEditEngineDefaulter*>(pEditView->GetEditEngine()),
2168 pGridWin[i], nX, nY );
2169 if (eCurrent == eActive)
2170 pEditView->ShowCursor( false );
2171 }
2172 }
2173}
2174
2175void ScTabView::KillEditView( bool bNoPaint )
2176{
2179 SCCOL nCol2 = aViewData.GetEditEndCol();
2180 SCROW nRow2 = aViewData.GetEditEndRow();
2181 bool bPaint[4];
2182 bool bNotifyAcc = false;
2183 tools::Rectangle aRectangle[4];
2184
2185 bool bExtended = nRow1 != nRow2; // column is painted to the end anyway
2186
2187 bool bAtCursor = nCol1 <= aViewData.GetCurX() &&
2188 nCol2 >= aViewData.GetCurX() &&
2189 nRow1 == aViewData.GetCurY();
2190 for (sal_uInt16 i = 0; i < 4; i++)
2191 {
2192 bPaint[i] = aViewData.HasEditView( static_cast<ScSplitPos>(i) );
2193 if (bPaint[i])
2194 {
2195 bNotifyAcc = true;
2196
2197 EditView* pView = aViewData.GetEditView( static_cast<ScSplitPos>(i) );
2198 aRectangle[i] = pView->GetInvalidateRect();
2199 }
2200 }
2201
2202 // notify accessibility before all things happen
2203 if (bNotifyAcc && aViewData.GetViewShell()->HasAccessibilityObjects())
2204 aViewData.GetViewShell()->BroadcastAccessibility(SfxHint(SfxHintId::ScAccLeaveEditMode));
2205
2207 for (sal_uInt16 i = 0; i < 4; i++)
2208 {
2209 if (pGridWin[i] && bPaint[i] && pGridWin[i]->IsVisible())
2210 {
2211 pGridWin[i]->ShowCursor();
2212
2213 pGridWin[i]->SetMapMode(pGridWin[i]->GetDrawMapMode());
2214
2216 {
2217 const tools::Rectangle& rInvRect = aRectangle[i];
2218 pGridWin[i]->Invalidate(rInvRect);
2219
2220 // invalidate other views
2221 auto lInvalidateWindows =
2222 [&rInvRect] (ScTabView* pTabView)
2223 {
2224 for (VclPtr<ScGridWindow> const & pWin: pTabView->pGridWin)
2225 {
2226 if (pWin)
2227 pWin->Invalidate(rInvRect);
2228 }
2229 };
2230
2231 SfxLokHelper::forEachOtherView(GetViewData().GetViewShell(), lInvalidateWindows);
2232 }
2233 // #i73567# the cell still has to be repainted
2234 else if (bExtended || ( bAtCursor && !bNoPaint ))
2235 {
2236 pGridWin[i]->Draw( nCol1, nRow1, nCol2, nRow2, ScUpdateMode::All );
2237 pGridWin[i]->UpdateSelectionOverlay();
2238 }
2239 }
2240 }
2241
2242 if (pDrawView)
2243 DrawEnableAnim( true );
2244
2245 // GrabFocus always when this View is active and
2246 // when the input row has the focus
2247
2248 bool bGrabFocus = false;
2249 if (aViewData.IsActive())
2250 {
2251 ScInputHandler* pInputHdl = SC_MOD()->GetInputHdl();
2252 if ( pInputHdl )
2253 {
2254 ScInputWindow* pInputWin = pInputHdl->GetInputWindow();
2255 if (pInputWin && pInputWin->IsInputActive())
2256 bGrabFocus = true;
2257 }
2258 }
2259
2260 if (bGrabFocus)
2261 {
2262// should be done like this, so that Sfx notice it, but it does not work:
2264// therefore first like this:
2266 }
2267
2268 // cursor query only after GrabFocus
2269
2270 for (sal_uInt16 i = 0; i < 4; i++)
2271 {
2272 if (pGridWin[i] && pGridWin[i]->IsVisible())
2273 {
2274 vcl::Cursor* pCur = pGridWin[i]->GetCursor();
2275 if (pCur && pCur->IsVisible())
2276 pCur->Hide();
2277
2278 if (bPaint[i])
2279 {
2280 pGridWin[i]->UpdateCursorOverlay();
2281 pGridWin[i]->UpdateAutoFillOverlay();
2282 }
2283 }
2284 }
2285}
2286
2287void ScTabView::UpdateFormulas(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow)
2288{
2290 return;
2291
2292 for (sal_uInt16 i = 0; i < 4; i++)
2293 {
2294 if (pGridWin[i] && pGridWin[i]->IsVisible())
2295 pGridWin[i]->UpdateFormulas(nStartCol, nStartRow, nEndCol, nEndRow);
2296 }
2297
2298 if ( aViewData.IsPagebreakMode() )
2300
2302
2303 // if in edit mode, adjust edit view area because widths/heights may have changed
2306}
2307
2308// PaintArea - repaint block
2309
2310void ScTabView::PaintArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
2311 ScUpdateMode eMode )
2312{
2313 SCCOL nCol1;
2314 SCROW nRow1;
2315 SCCOL nCol2;
2316 SCROW nRow2;
2317 bool bIsTiledRendering = comphelper::LibreOfficeKit::isActive();
2319
2320 PutInOrder( nStartCol, nEndCol );
2321 PutInOrder( nStartRow, nEndRow );
2322
2323 for (size_t i = 0; i < 4; ++i)
2324 {
2325 if (!pGridWin[i] || !pGridWin[i]->IsVisible())
2326 continue;
2327
2328 ScHSplitPos eHWhich = WhichH( static_cast<ScSplitPos>(i) );
2329 ScVSplitPos eVWhich = WhichV( static_cast<ScSplitPos>(i) );
2330 bool bOut = false;
2331
2332 nCol1 = nStartCol;
2333 nRow1 = nStartRow;
2334 nCol2 = nEndCol;
2335 nRow2 = nEndRow;
2336
2337 SCCOL nLastX = 0;
2338 SCROW nLastY = 0;
2339
2340 if (bIsTiledRendering)
2341 {
2342 nLastX = aViewData.GetMaxTiledCol();
2343 nLastY = aViewData.GetMaxTiledRow();
2344 }
2345 else
2346 {
2347
2348 SCCOL nScrX = aViewData.GetPosX( eHWhich );
2349 SCROW nScrY = aViewData.GetPosY( eVWhich );
2350
2351 if (nCol1 < nScrX)
2352 nCol1 = nScrX;
2353 if (nCol2 < nScrX)
2354 {
2355 if ( eMode == ScUpdateMode::All ) // for UPDATE_ALL, paint anyway
2356 nCol2 = nScrX; // (because of extending strings to the right)
2357 else
2358 bOut = true; // completely outside the window
2359 }
2360 if (nRow1 < nScrY)
2361 nRow1 = nScrY;
2362 if (nRow2 < nScrY)
2363 bOut = true;
2364
2365 nLastX = nScrX + aViewData.VisibleCellsX( eHWhich ) + 1;
2366 nLastY = nScrY + aViewData.VisibleCellsY( eVWhich ) + 1;
2367 }
2368
2369 if (nCol1 > nLastX)
2370 bOut = true;
2371 if (nCol2 > nLastX)
2372 nCol2 = nLastX;
2373 if (nRow1 > nLastY)
2374 bOut = true;
2375 if (nRow2 > nLastY)
2376 nRow2 = nLastY;
2377
2378 if (bOut)
2379 continue;
2380
2381 bool bLayoutRTL = aViewData.GetDocument().IsLayoutRTL( aViewData.GetTabNo() );
2382 tools::Long nLayoutSign = (!bIsTiledRendering && bLayoutRTL) ? -1 : 1;
2383
2384 Point aStart = aViewData.GetScrPos( nCol1, nRow1, static_cast<ScSplitPos>(i) );
2385 Point aEnd = aViewData.GetScrPos( nCol2+1, nRow2+1, static_cast<ScSplitPos>(i) );
2386
2387 if ( eMode == ScUpdateMode::All )
2388 {
2389 if (bIsTiledRendering)
2390 {
2391 // When a cell content is deleted we have no clue about
2392 // the width of the embedded text.
2393 // Anyway, clients will ask only for tiles that overlaps
2394 // the visible area.
2395 // Remember that wsd expects int and that aEnd.X() is
2396 // in pixels and will be converted in twips, before performing
2397 // the lok callback, so we need to avoid that an overflow occurs.
2398 aEnd.setX( std::numeric_limits<int>::max() / 1000 );
2399 }
2400 else
2401 {
2402 aEnd.setX( bLayoutRTL ? 0 : pGridWin[i]->GetOutputSizePixel().Width() );
2403 }
2404 }
2405 aEnd.AdjustX( -nLayoutSign );
2406 aEnd.AdjustY( -1 );
2407
2408 // #i85232# include area below cells (could be done in GetScrPos?)
2409 if ( eMode == ScUpdateMode::All && nRow2 >= rDoc.MaxRow() && !bIsTiledRendering )
2410 aEnd.setY( pGridWin[i]->GetOutputSizePixel().Height() );
2411
2412 aStart.AdjustX( -nLayoutSign ); // include change marks
2413 aStart.AdjustY( -1 );
2414
2415 bool bMarkClipped = aViewData.GetOptions().GetOption( VOPT_CLIPMARKS );
2416 if (bMarkClipped)
2417 {
2418 // ScColumn::IsEmptyData has to be optimized for this
2419 // (switch to Search() )
2423 tools::Long nMarkPixel = static_cast<tools::Long>( SC_CLIPMARK_SIZE * aViewData.GetPPTX() );
2424 aStart.AdjustX( -(nMarkPixel * nLayoutSign) );
2425 }
2426
2427 pGridWin[i]->Invalidate( pGridWin[i]->PixelToLogic( tools::Rectangle( aStart,aEnd ) ) );
2428 }
2429
2430 // #i79909# Calling UpdateAllOverlays here isn't necessary and would lead to overlay calls from a timer,
2431 // with a wrong MapMode if editing in a cell (reference input).
2432 // #i80499# Overlays need updates in a lot of cases, e.g. changing row/column size,
2433 // or showing/hiding outlines. TODO: selections in inactive windows are vanishing.
2434 // #i84689# With relative conditional formats, PaintArea may be called often (for each changed cell),
2435 // so UpdateAllOverlays was moved to ScTabViewShell::Notify and is called only if PaintPartFlags::Left/PaintPartFlags::Top
2436 // is set (width or height changed).
2437}
2438
2440{
2441 ScRange aRef = pData->aRef;
2442 aRef.PutInOrder(); // PutInOrder for the queries below
2443
2444 if ( aRef.aStart == aRef.aEnd )
2446
2447 if (aRef.aStart.Tab() < nTab || aRef.aEnd.Tab() > nTab)
2448 return;
2449
2450 SCCOL nCol1 = aRef.aStart.Col();
2451 SCROW nRow1 = aRef.aStart.Row();
2452 SCCOL nCol2 = aRef.aEnd.Col();
2453 SCROW nRow2 = aRef.aEnd.Row();
2454
2455 // remove -> repaint
2456 // ScUpdateMode::Marks: Invalidate, nothing until end of row
2457
2458 bool bHiddenEdge = false;
2459 SCROW nTmp;
2461 while ( nCol1 > 0 && rDoc.ColHidden(nCol1, nTab) )
2462 {
2463 --nCol1;
2464 bHiddenEdge = true;
2465 }
2466 while ( nCol2 < rDoc.MaxCol() && rDoc.ColHidden(nCol2, nTab) )
2467 {
2468 ++nCol2;
2469 bHiddenEdge = true;
2470 }
2471 nTmp = rDoc.LastVisibleRow(0, nRow1, nTab);
2472 if (!rDoc.ValidRow(nTmp))
2473 nTmp = 0;
2474 if (nTmp < nRow1)
2475 {
2476 nRow1 = nTmp;
2477 bHiddenEdge = true;
2478 }
2479 nTmp = rDoc.FirstVisibleRow(nRow2, rDoc.MaxRow(), nTab);
2480 if (!rDoc.ValidRow(nTmp))
2481 nTmp = rDoc.MaxRow();
2482 if (nTmp > nRow2)
2483 {
2484 nRow2 = nTmp;
2485 bHiddenEdge = true;
2486 }
2487
2488 if ( nCol2 - nCol1 > 1 && nRow2 - nRow1 > 1 && !bHiddenEdge )
2489 {
2490 // only along the edges
2491 PaintArea( nCol1, nRow1, nCol2, nRow1, ScUpdateMode::Marks );
2492 PaintArea( nCol1, nRow1+1, nCol1, nRow2-1, ScUpdateMode::Marks );
2493 PaintArea( nCol2, nRow1+1, nCol2, nRow2-1, ScUpdateMode::Marks );
2494 PaintArea( nCol1, nRow2, nCol2, nRow2, ScUpdateMode::Marks );
2495 }
2496 else // all in one
2497 PaintArea( nCol1, nRow1, nCol2, nRow2, ScUpdateMode::Marks );
2498}
2499
2501{
2502 ScInputHandler* pHdl = SC_MOD()->GetInputHdl( aViewData.GetViewShell() );
2503 if (!pHdl)
2504 return;
2505
2506 ScRangeFindList* pRangeFinder = pHdl->GetRangeFindList();
2507 if ( !(pRangeFinder && pRangeFinder->GetDocName() == aViewData.GetDocShell()->GetTitle()) )
2508 return;
2509
2510 SCTAB nTab = aViewData.GetTabNo();
2511 sal_uInt16 nCount = static_cast<sal_uInt16>(pRangeFinder->Count());
2512
2513 if (nNumber < 0)
2514 {
2515 for (sal_uInt16 i=0; i<nCount; i++)
2516 PaintRangeFinderEntry(&pRangeFinder->GetObject(i),nTab);
2517 }
2518 else
2519 {
2520 sal_uInt16 idx = nNumber;
2521 if (idx < nCount)
2522 PaintRangeFinderEntry(&pRangeFinder->GetObject(idx),nTab);
2523 }
2524}
2525
2526// for chart data selection
2527
2528void ScTabView::AddHighlightRange( const ScRange& rRange, const Color& rColor )
2529{
2530 maHighlightRanges.emplace_back( rRange, rColor );
2531
2532 SCTAB nTab = aViewData.GetTabNo();
2533 if ( nTab >= rRange.aStart.Tab() && nTab <= rRange.aEnd.Tab() )
2534 PaintArea( rRange.aStart.Col(), rRange.aStart.Row(),
2535 rRange.aEnd.Col(), rRange.aEnd.Row(), ScUpdateMode::Marks );
2536}
2537
2539{
2540 SCTAB nTab = aViewData.GetTabNo();
2541 for (ScHighlightEntry const & rEntry : maHighlightRanges)
2542 {
2543 ScRange aRange = rEntry.aRef;
2544 if ( nTab >= aRange.aStart.Tab() && nTab <= aRange.aEnd.Tab() )
2545 PaintArea( aRange.aStart.Col(), aRange.aStart.Row(),
2546 aRange.aEnd.Col(), aRange.aEnd.Row(), ScUpdateMode::Marks );
2547 }
2548
2549 maHighlightRanges.clear();
2550}
2551
2553 const uno::Sequence< chart2::data::HighlightedRange > & rHilightRanges )
2554{
2557 size_t nSize = 0;
2558 size_t nIndex = 0;
2559 std::vector<ReferenceMark> aReferenceMarks( nSize );
2560
2561 for (chart2::data::HighlightedRange const & rHighlightedRange : rHilightRanges)
2562 {
2563 Color aSelColor(ColorTransparency, rHighlightedRange.PreferredColor);
2564 ScRangeList aRangeList;
2567 aRangeList, rHighlightedRange.RangeRepresentation, rDoc, rDoc.GetAddressConvention(), sep ))
2568 {
2569 size_t nListSize = aRangeList.size();
2570 nSize += nListSize;
2571 aReferenceMarks.resize(nSize);
2572
2573 for ( size_t j = 0; j < nListSize; ++j )
2574 {
2575 ScRange& p = aRangeList[j];
2576 ScRange aTargetRange;
2577 if( rHighlightedRange.Index == - 1 )
2578 {
2579 aTargetRange = p;
2580 AddHighlightRange( aTargetRange, aSelColor );
2581 }
2582 else
2583 {
2584 aTargetRange = lcl_getSubRangeByIndex( p, rHighlightedRange.Index );
2585 AddHighlightRange( aTargetRange, aSelColor );
2586 }
2587
2589 {
2590 aTargetRange.PutInOrder();
2591
2592 tools::Long nX1 = aTargetRange.aStart.Col();
2593 tools::Long nX2 = aTargetRange.aEnd.Col();
2594 tools::Long nY1 = aTargetRange.aStart.Row();
2595 tools::Long nY2 = aTargetRange.aEnd.Row();
2596 tools::Long nTab = aTargetRange.aStart.Tab();
2597
2599 nX1, nX2, nY1, nY2,
2600 nTab, aSelColor );
2601 }
2602 }
2603 }
2604 }
2605
2608}
2609
2610void ScTabView::DoDPFieldPopup(std::u16string_view rPivotTableName, sal_Int32 nDimensionIndex, Point aPoint, Size aSize)
2611{
2612 ScDocument& rDocument = aViewData.GetDocShell()->GetDocument();
2614
2615 if (!pWin)
2616 return;
2617
2618 ScDPCollection* pDPCollection = rDocument.GetDPCollection();
2619 ScDPObject* pDPObject = pDPCollection->GetByName(rPivotTableName);
2620 if (!pDPObject)
2621 return;
2622
2623 pDPObject->BuildAllDimensionMembers();
2624
2625 Point aPos = pWin->LogicToPixel(aPoint);
2627 Point aScreenPoint = bLOK ? aPos : pWin->OutputToScreenPixel(aPos);
2628 Size aScreenSize = pWin->LogicToPixel(aSize);
2629
2630 pWin->DPLaunchFieldPopupMenu(aScreenPoint, aScreenSize, nDimensionIndex, pDPObject);
2631}
2632
2633// PaintGrid - repaint data range
2634
2636{
2637 for (sal_uInt16 i = 0; i < 4; i++)
2638 {
2639 if (pGridWin[i] && pGridWin[i]->IsVisible())
2640 pGridWin[i]->Invalidate();
2641 }
2642}
2643
2644// PaintTop - repaint top control elements
2645
2647{
2648 for (sal_uInt16 i = 0; i < 2; i++)
2649 {
2650 if (pColBar[i])
2651 pColBar[i]->Invalidate();
2652 if (pColOutline[i])
2653 pColOutline[i]->Invalidate();
2654 }
2655}
2656
2658{
2659 for (sal_uInt16 i = 0; i < 4; i++)
2660 {
2661 if(pGridWin[i] && pGridWin[i]->IsVisible())
2662 pGridWin[i]->CreateAnchorHandle(rHdl, rAddress);
2663 }
2664}
2665
2666void ScTabView::PaintTopArea( SCCOL nStartCol, SCCOL nEndCol )
2667{
2668 // pixel position of the left edge
2669
2670 if ( nStartCol < aViewData.GetPosX(SC_SPLIT_LEFT) ||
2671 nStartCol < aViewData.GetPosX(SC_SPLIT_RIGHT) )
2673
2674 // adjust freeze (UpdateFixX resets HSplitPos)
2675
2676 if ( aViewData.GetHSplitMode() == SC_SPLIT_FIX && nStartCol < aViewData.GetFixPosX() )
2677 if (aViewData.UpdateFixX())
2678 RepeatResize();
2679
2680 // paint
2681
2682 if (nStartCol>0)
2683 --nStartCol;
2684
2686 bool bLayoutRTL = rDoc.IsLayoutRTL( aViewData.GetTabNo() );
2687 tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
2688
2689 for (sal_uInt16 i = 0; i < 2; i++)
2690 {
2691 ScHSplitPos eWhich = ScHSplitPos(i);
2692 if (pColBar[eWhich])
2693 {
2694 Size aWinSize = pColBar[eWhich]->GetSizePixel();
2695 tools::Long nStartX = aViewData.GetScrPos( nStartCol, 0, eWhich ).X();
2696 tools::Long nEndX;
2697 if (nEndCol >= rDoc.MaxCol())
2698 nEndX = bLayoutRTL ? 0 : ( aWinSize.Width()-1 );
2699 else
2700 nEndX = aViewData.GetScrPos( nEndCol+1, 0, eWhich ).X() - nLayoutSign;
2701 if (nStartX > nEndX)
2702 std::swap(nStartX, nEndX);
2703 pColBar[eWhich]->Invalidate(
2704 tools::Rectangle( nStartX, 0, nEndX, aWinSize.Height()-1 ) );
2705 }
2706 if (pColOutline[eWhich])
2707 pColOutline[eWhich]->Invalidate();
2708 }
2709}
2710
2711// PaintLeft - repaint left control elements
2712
2714{
2715 for (sal_uInt16 i = 0; i < 2; i++)
2716 {
2717 if (pRowBar[i])
2718 pRowBar[i]->Invalidate();
2719 if (pRowOutline[i])
2720 pRowOutline[i]->Invalidate();
2721 }
2722}
2723
2724void ScTabView::PaintLeftArea( SCROW nStartRow, SCROW nEndRow )
2725{
2726 // pixel position of the upper edge
2727
2728 if ( nStartRow < aViewData.GetPosY(SC_SPLIT_TOP) ||
2729 nStartRow < aViewData.GetPosY(SC_SPLIT_BOTTOM) )
2731
2732 // adjust freeze (UpdateFixY reset VSplitPos)
2733
2734 if ( aViewData.GetVSplitMode() == SC_SPLIT_FIX && nStartRow < aViewData.GetFixPosY() )
2735 if (aViewData.UpdateFixY())
2736 RepeatResize();
2737
2738 // paint
2739
2740 if (nStartRow>0)
2741 --nStartRow;
2742
2744 for (sal_uInt16 i = 0; i < 2; i++)
2745 {
2746 ScVSplitPos eWhich = ScVSplitPos(i);
2747 if (pRowBar[eWhich])
2748 {
2749 Size aWinSize = pRowBar[eWhich]->GetSizePixel();
2750 tools::Long nStartY = aViewData.GetScrPos( 0, nStartRow, eWhich ).Y();
2751 tools::Long nEndY;
2752 if (nEndRow >= rDoc.MaxRow())
2753 nEndY = aWinSize.Height() - 1;
2754 else
2755 nEndY = aViewData.GetScrPos( 0, nEndRow+1, eWhich ).Y() - 1;
2756 if (nStartY > nEndY)
2757 std::swap(nStartY, nEndY);
2758 pRowBar[eWhich]->Invalidate(
2759 tools::Rectangle( 0, nStartY, aWinSize.Width()-1, nEndY ) );
2760 }
2761 if (pRowOutline[eWhich])
2762 pRowOutline[eWhich]->Invalidate();
2763 }
2764}
2765
2767{
2768 bool bRet = false;
2770 SCTAB nTab = aViewData.GetTabNo();
2771 if (!rDoc.HasTable(nTab)) // sheet is deleted?
2772 {
2773 SCTAB nCount = rDoc.GetTableCount();
2775 bRet = true;
2776 }
2777 pTabControl->UpdateStatus(); // true = active
2778 return bRet;
2779}
2780
2782{
2783 // called after changes that require the PPT values to be recalculated
2784 // (currently from detective operations)
2785
2786 double nOldX = aViewData.GetPPTX();
2787 double nOldY = aViewData.GetPPTY();
2788
2789 aViewData.RefreshZoom(); // pre-calculate new PPT values
2790
2791 bool bChangedX = ( aViewData.GetPPTX() != nOldX );
2792 bool bChangedY = ( aViewData.GetPPTY() != nOldY );
2793 if ( !(bChangedX || bChangedY) )
2794 return;
2795
2796 // call view SetZoom (including draw scale, split update etc)
2797 // and paint only if values changed
2798
2799 Fraction aZoomX = aViewData.GetZoomX();
2800 Fraction aZoomY = aViewData.GetZoomY();
2801 SetZoom( aZoomX, aZoomY, false );
2802
2803 PaintGrid();
2804 if (bChangedX)
2805 PaintTop();
2806 if (bChangedY)
2807 PaintLeft();
2808}
2809
2810void ScTabView::ActivateView( bool bActivate, bool bFirst )
2811{
2812 if ( bActivate == aViewData.IsActive() && !bFirst )
2813 {
2814 // no assertion anymore - occurs when previously in Drag&Drop switching over
2815 // to another document
2816 return;
2817 }
2818
2819 // is only called for MDI-(De)Activate
2820 // aViewData.Activate behind due to cursor show for KillEditView
2821 // don't delete selection - if Activate(false) is set in ViewData,
2822 // then the selection is not displayed
2823
2824 if (!bActivate)
2825 {
2826 ScModule* pScMod = SC_MOD();
2827 bool bRefMode = pScMod->IsFormulaMode();
2828
2829 // don't cancel reference input, to allow reference
2830 // to other document
2831
2832 if (!bRefMode)
2833 {
2834 // pass view to GetInputHdl, this view may not be current anymore
2835 ScInputHandler* pHdl = SC_MOD()->GetInputHdl(aViewData.GetViewShell());
2836 if (pHdl)
2837 pHdl->EnterHandler();
2838 }
2839 }
2840
2841 PaintExtras();
2842
2843 aViewData.Activate(bActivate);
2844
2845 PaintBlock(false); // repaint, selection after active status
2846
2847 if (!bActivate)
2848 HideAllCursors(); // Cursor
2849 else if (!bFirst)
2851
2852 if (bActivate)
2853 {
2854 if ( bFirst )
2855 {
2857 OSL_ENSURE( pGridWin[eWin], "Corrupted document, not all SplitPos in GridWin" );
2858 if ( !pGridWin[eWin] )
2859 {
2860 eWin = SC_SPLIT_BOTTOMLEFT;
2861 if ( !pGridWin[eWin] )
2862 {
2863 short i;
2864 for ( i=0; i<4; i++ )
2865 {
2866 if ( pGridWin[i] )
2867 {
2868 eWin = static_cast<ScSplitPos>(i);
2869 break; // for
2870 }
2871 }
2872 OSL_ENSURE( i<4, "and BOOM" );
2873 }
2874 aViewData.SetActivePart( eWin );
2875 }
2876 }
2877 // do not call GrabFocus from here!
2878 // if the document is processed, then Sfx calls GrabFocus in the window of the shell.
2879 // if it is a mail body for instance, then it can't get the focus
2881 }
2882 else
2883 pGridWin[aViewData.GetActivePart()]->ClickExtern();
2884}
2885
2887{
2889 if ( eOld == eWhich )
2890 return;
2891
2892 bInActivatePart = true;
2893
2894 bool bRefMode = SC_MOD()->IsFormulaMode();
2895
2896 // the HasEditView call during SetCursor would fail otherwise
2897 if ( aViewData.HasEditView(eOld) && !bRefMode )
2899
2900 ScHSplitPos eOldH = WhichH(eOld);
2901 ScVSplitPos eOldV = WhichV(eOld);
2902 ScHSplitPos eNewH = WhichH(eWhich);
2903 ScVSplitPos eNewV = WhichV(eWhich);
2904 bool bTopCap = pColBar[eOldH] && pColBar[eOldH]->IsMouseCaptured();
2905 bool bLeftCap = pRowBar[eOldV] && pRowBar[eOldV]->IsMouseCaptured();
2906
2907 bool bFocus = pGridWin[eOld]->HasFocus();
2908 bool bCapture = pGridWin[eOld]->IsMouseCaptured();
2909 if (bCapture)
2910 pGridWin[eOld]->ReleaseMouse();
2911 pGridWin[eOld]->ClickExtern();
2912 pGridWin[eOld]->HideCursor();
2913 pGridWin[eWhich]->HideCursor();
2914 aViewData.SetActivePart( eWhich );
2915
2917 pShell->WindowChanged();
2918
2919 pSelEngine->SetWindow(pGridWin[eWhich]);
2920 pSelEngine->SetWhich(eWhich);
2921 pSelEngine->SetVisibleArea( tools::Rectangle(Point(), pGridWin[eWhich]->GetOutputSizePixel()) );
2922
2923 pGridWin[eOld]->MoveMouseStatus(*pGridWin[eWhich]);
2924
2925 if ( bCapture || pGridWin[eWhich]->IsMouseCaptured() )
2926 {
2927 // tracking instead of CaptureMouse, so it can be cancelled cleanly
2928 // (SelectionEngine calls CaptureMouse for SetWindow)
2930 pGridWin[eWhich]->ReleaseMouse();
2931 pGridWin[eWhich]->StartTracking();
2932 }
2933
2934 if ( bTopCap && pColBar[eNewH] )
2935 {
2936 pColBar[eOldH]->SetIgnoreMove(true);
2937 pColBar[eNewH]->SetIgnoreMove(false);
2938 pHdrSelEng->SetWindow( pColBar[eNewH] );
2939 tools::Long nWidth = pColBar[eNewH]->GetOutputSizePixel().Width();
2940 pHdrSelEng->SetVisibleArea( tools::Rectangle( 0, LONG_MIN, nWidth-1, LONG_MAX ) );
2941 pColBar[eNewH]->CaptureMouse();
2942 }
2943 if ( bLeftCap && pRowBar[eNewV] )
2944 {
2945 pRowBar[eOldV]->SetIgnoreMove(true);
2946 pRowBar[eNewV]->SetIgnoreMove(false);
2947 pHdrSelEng->SetWindow( pRowBar[eNewV] );
2948 tools::Long nHeight = pRowBar[eNewV]->GetOutputSizePixel().Height();
2949 pHdrSelEng->SetVisibleArea( tools::Rectangle( LONG_MIN, 0, LONG_MAX, nHeight-1 ) );
2950 pRowBar[eNewV]->CaptureMouse();
2951 }
2952 aHdrFunc.SetWhich(eWhich);
2953
2954 pGridWin[eOld]->ShowCursor();
2955 pGridWin[eWhich]->ShowCursor();
2956
2958 bool bOleActive = ( pClient && pClient->IsObjectInPlaceActive() );
2959
2960 // don't switch ViewShell's active window during RefInput, because the focus
2961 // might change, and subsequent SetReference calls wouldn't find the right EditView
2962 if ( !bRefMode && !bOleActive )
2964
2965 if ( bFocus && !aViewData.IsAnyFillMode() && !bRefMode )
2966 {
2967 // GrabFocus only if previously the other GridWindow had the focus
2968 // (for instance due to search and replace)
2969 pGridWin[eWhich]->GrabFocus();
2970 }
2971
2972 bInActivatePart = false;
2973}
2974
2976{
2977 for (VclPtr<ScGridWindow> & pWin : pGridWin)
2978 {
2979 if (pWin)
2980 pWin->ClickExtern();
2981 }
2982}
2983
2985{
2987 if (pWin)
2988 pWin->UpdateInputContext();
2989
2990 if (pTabControl)
2991 pTabControl->UpdateInputContext();
2992}
2993
2994// GetGridWidth - width of an output range (for ViewData)
2995
2997{
2998 // at present only the size of the current pane is synchronized with
2999 // the size of the visible area in Online;
3000 // as a workaround we use the same width for all panes independently
3001 // from the eWhich value
3003 {
3004 ScGridWindow* pGridWindow = aViewData.GetActiveWin();
3005 if (pGridWindow)
3006 return pGridWindow->GetSizePixel().Width();
3007 }
3008
3010 if (pGridWin[eGridWhich])
3011 return pGridWin[eGridWhich]->GetSizePixel().Width();
3012 else
3013 return 0;
3014}
3015
3016// GetGridHeight - height of an output range (for ViewData)
3017
3019{
3020 // at present only the size of the current pane is synchronized with
3021 // the size of the visible area in Online;
3022 // as a workaround we use the same height for all panes independently
3023 // from the eWhich value
3025 {
3026 ScGridWindow* pGridWindow = aViewData.GetActiveWin();
3027 if (pGridWindow)
3028 return pGridWindow->GetSizePixel().Height();
3029 }
3030
3031 ScSplitPos eGridWhich = ( eWhich == SC_SPLIT_TOP ) ? SC_SPLIT_TOPLEFT : SC_SPLIT_BOTTOMLEFT;
3032 if (pGridWin[eGridWhich])
3033 return pGridWin[eGridWhich]->GetSizePixel().Height();
3034 else
3035 return 0;
3036}
3037
3039{
3040 SC_MOD()->InputEnterHandler();
3041}
3042
3044{
3045 ScInputHandler* pHdl = SC_MOD()->GetInputHdl(aViewData.GetViewShell());
3046 if (pHdl)
3048
3049 UpdateFixPos();
3050
3052
3053 // VisArea...
3054 // AW: Discussed with NN if there is a reason that new map mode was only set for one window,
3055 // but is not. Setting only on one window causes the first repaint to have the old mapMode
3056 // in three of four views, so the overlay will save the wrong content e.g. when zooming out.
3057 // Changing to setting map mode at all windows.
3058
3059 for (sal_uInt32 i = 0; i < 4; i++)
3060 {
3061 if (pGridWin[i])
3062 pGridWin[i]->SetMapMode(pGridWin[i]->GetDrawMapMode());
3063 }
3064
3065 SetNewVisArea();
3066
3067 InterpretVisible(); // have everything calculated before painting
3068
3069 SfxBindings& rBindings = aViewData.GetBindings();
3070 rBindings.Invalidate( SID_ATTR_ZOOM );
3071 rBindings.Invalidate( SID_ATTR_ZOOMSLIDER );
3072 rBindings.Invalidate(SID_ZOOM_IN);
3073 rBindings.Invalidate(SID_ZOOM_OUT);
3074
3076
3077 // To not change too much, use pWin here
3079
3080 if ( pWin && aViewData.HasEditView( aViewData.GetActivePart() ) )
3081 {
3082 // flush OverlayManager before changing the MapMode
3083 pWin->flushOverlayManager();
3084
3085 // make sure the EditView's position and size are updated
3086 // with the right (logic, not drawing) MapMode
3089 }
3090}
3091
3093{
3094 for (sal_uInt16 i = 0; i < 4; i++)
3095 {
3096 if (pGridWin[i] && pGridWin[i]->IsVisible())
3097 pGridWin[i]->CheckNeedsRepaint();
3098 }
3099}
3100
3102{
3103 for (VclPtr<ScGridWindow> & pWin : pGridWin)
3104 {
3105 if (pWin && pWin->IsVisible() && pWin->NeedsRepaint())
3106 return true;
3107 }
3108 return false;
3109}
3110
3111/* 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)
virtual void ViewShellChanged()=0
virtual bool IsRefInputMode() const =0
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:4218
SC_DLLPUBLIC bool GetMatrixFormulaRange(const ScAddress &rCellPos, ScRange &rMatrix)
Definition: document.cxx:5529
SC_DLLPUBLIC sal_uInt16 GetColWidth(SCCOL nCol, SCTAB nTab, bool bHiddenAsZero=true) const
Definition: document.cxx:4177
bool ValidRow(SCROW nRow) const
Definition: document.hxx:899
SC_DLLPUBLIC const ScTableProtection * GetTabProtection(SCTAB nTab) const
Definition: documen3.cxx:1922
SC_DLLPUBLIC bool ExtendMerge(SCCOL nStartCol, SCROW nStartRow, SCCOL &rEndCol, SCROW &rEndRow, SCTAB nTab, bool bRefresh=false)
Definition: document.cxx:5669
SC_DLLPUBLIC SCCOL MaxCol() const
Definition: document.hxx:891
SC_DLLPUBLIC formula::FormulaGrammar::AddressConvention GetAddressConvention() const
Definition: documen3.cxx:494
SC_DLLPUBLIC SCROW MaxRow() const
Definition: document.hxx:892
bool IsInVBAMode() const
Definition: document.cxx:6600
SC_DLLPUBLIC const ScValidationData * GetValidationEntry(sal_uLong nIndex) const
Definition: documen4.cxx:881
SC_DLLPUBLIC bool HasSparkline(ScAddress const &rPosition)
Definition: document.cxx:6629
SC_DLLPUBLIC void MakeTable(SCTAB nTab, bool _bNeedsNameCheck=true)
Definition: document.cxx:170
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:6203
SC_DLLPUBLIC bool ColHidden(SCCOL nCol, SCTAB nTab, SCCOL *pFirstCol=nullptr, SCCOL *pLastCol=nullptr) const
Definition: document.cxx:4502
void SkipOverlapped(SCCOL &rCol, SCROW &rRow, SCTAB nTab) const
Definition: document.cxx:5822
SC_DLLPUBLIC bool GetPrintArea(SCTAB nTab, SCCOL &rEndCol, SCROW &rEndRow, bool bNotes=true) const
Definition: documen2.cxx:595
SC_DLLPUBLIC SCROW LastVisibleRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab) const
Definition: document.cxx:4540
SC_DLLPUBLIC bool IsVisible(SCTAB nTab) const
Definition: document.cxx:918
SC_DLLPUBLIC bool IsLayoutRTL(SCTAB nTab) const
Definition: document.cxx:996
SC_DLLPUBLIC bool HasTable(SCTAB nTab) const
Definition: document.cxx:193
bool IsAutoCalcShellDisabled() const
Definition: document.hxx:1412
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:1098
SC_DLLPUBLIC const SfxPoolItem * GetAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich) const
Definition: document.cxx:4771
SC_DLLPUBLIC ScDPCollection * GetDPCollection()
Definition: documen3.cxx:365
SC_DLLPUBLIC void SetVisible(SCTAB nTab, bool bVisible)
Definition: document.cxx:911
SC_DLLPUBLIC SCROW FirstVisibleRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab) const
Definition: document.cxx:4532
SC_DLLPUBLIC SCTAB GetTableCount() const
Definition: document.cxx:315
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:3788
void flushOverlayManager()
Definition: gridwin.cxx:7067
void SetWhich(ScSplitPos eNew)
Definition: select.cxx:807
static void SendReferenceMarks(const SfxViewShell *pViewShell, const std::vector< ReferenceMark > &rReferenceMarks)
Definition: inputhdl.cxx:309
ScInputWindow * GetInputWindow()
Definition: inputhdl.hxx:265
void UpdateLokReferenceMarks()
Definition: inputhdl.cxx:522
ScRangeFindList * GetRangeFindList()
Definition: inputhdl.hxx:254
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:472
void SetRefScale(const Fraction &rX, const Fraction &rY)
Definition: inputhdl.cxx:864
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:603
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:657
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:174
Size GetSizePixel() const
Definition: hintwin.cxx:167
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, const OUString &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:1639
bool GetForceFocusOnCurCell() const
Definition: tabvwsh.hxx:388
virtual const FmFormShell * GetFormShell() const override
Definition: tabvwsh.hxx:342
void SetSparklineShell(bool bActive)
Definition: tabvwsh4.cxx:694
void UpdateInputHandler(bool bForce=false, bool bStopEditing=true)
Definition: tabvwsha.cxx:666
void SetPivotShell(bool bActive)
Definition: tabvwsh4.cxx:672
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:2528
void UpdatePageBreakData(bool bForcePaint=false)
Definition: tabview2.cxx:1479
sal_uInt16 GetLockedModifiers() const
Definition: tabview.cxx:1906
void TabChanged(bool bSameTabButMoved=false)
Called after moving, copying, inserting or deleting a sheet.
Definition: tabview5.cxx:281
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:2713
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:3092
std::unique_ptr< ScViewSelectionEngine > pSelEngine
Definition: tabview.hxx:124
void PaintTopArea(SCCOL nStartCol, SCCOL nEndCol)
Definition: tabview3.cxx:2666
void AddWindowToForeignEditView(SfxViewShell *pViewShell, ScSplitPos eWhich)
Definition: tabview3.cxx:2042
void SelectTabPage(const sal_uInt16 nTab)
Definition: tabview3.cxx:1795
void UpdateVarZoom()
Definition: tabview.cxx:730
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:158
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:2552
bool bMoveIsShift
Definition: tabview.hxx:209
void DoneBlockMode(bool bContinue=false)
Definition: tabview2.cxx:409
Size aFrameSize
Definition: tabview.hxx:132
void MarkDataArea(bool bIncludeCursor=true)
Definition: tabview3.cxx:1660
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:2766
SC_DLLPUBLIC void RefreshZoom()
Definition: tabview5.cxx:435
void MarkRange(const ScRange &rRange, bool bSetCursor=true, bool bContinue=false)
Definition: tabview3.cxx:1691
void MakeEditView(ScEditEngineDefaulter *pEngine, SCCOL nCol, SCROW nRow)
Definition: tabview3.cxx:2095
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:2538
void ActivateView(bool bActivate, bool bFirst)
Definition: tabview3.cxx:2810
tools::Long GetGridWidth(ScHSplitPos eWhich)
Definition: tabview3.cxx:2996
void InitRefMode(SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, ScRefType eType)
Definition: tabview4.cxx:309
bool NeedsRepaint()
Definition: tabview3.cxx:3101
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:160
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:2310
tools::Long GetGridHeight(ScVSplitPos eWhich)
Definition: tabview3.cxx:3018
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:3038
ScViewData & GetViewData()
Definition: tabview.hxx:333
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:887
ScViewData aViewData
Definition: tabview.hxx:122
std::vector< ScHighlightEntry > maHighlightRanges
Definition: tabview.hxx:163
void DoResize(const Point &rOffset, const Size &rSize, bool bInner=false)
Definition: tabview.cxx:277
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:1727
void ZoomChanged()
Definition: tabview3.cxx:3043
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:2287
SC_DLLPUBLIC void CellContentChanged()
Definition: tabview3.cxx:513
std::unique_ptr< ScDrawView > pDrawView
Definition: tabview.hxx:130
ScExtraEditViewManager aExtraEditViewManager
Definition: tabview.hxx:172
void MarkMatrixFormula()
Definition: tabview3.cxx:1680
void ActivatePart(ScSplitPos eWhich)
Definition: tabview3.cxx:2886
void HideListBox()
Definition: tabview3.cxx:2975
std::array< VclPtr< ScRowBar >, 2 > pRowBar
Definition: tabview.hxx:144
void HideNoteMarker()
Definition: tabview2.cxx:1420
void RecalcPPT()
Definition: tabview3.cxx:2781
void DoDPFieldPopup(std::u16string_view rPivotTableName, sal_Int32 nDimensionIndex, Point aPoint, Size aSize)
Definition: tabview3.cxx:2610
void SelectNextTab(short nDir, bool bExtendSelection)
Definition: tabview3.cxx:1757
bool HasHintWindow() const
Definition: tabview3.cxx:879
void CreateAnchorHandles(SdrHdlList &rHdl, const ScAddress &rAddress)
Definition: tabview3.cxx:2657
void InvalidateSplit()
Definition: tabview.cxx:2121
std::unique_ptr< ScHeaderSelectionEngine > pHdrSelEng
Definition: tabview.hxx:127
void SetMarkData(const ScMarkData &rNew)
Definition: tabview3.cxx:1741
void MarkDataChanged()
Definition: tabview3.cxx:1750
void DrawDeselectAll()
Definition: tabview5.cxx:388
void ScrollY(tools::Long nDeltaY, ScVSplitPos eWhich, bool bUpdBars=true)
Definition: tabview.cxx:1235
void KillEditView(bool bNoPaint)
Definition: tabview3.cxx:2175
bool bInActivatePart
Definition: tabview.hxx:207
void MoveCursorEnter(bool bShift)
Definition: tabview3.cxx:1412
void PaintTop()
Definition: tabview3.cxx:2646
void ActiveGrabFocus()
Definition: tabview.cxx:901
void CursorPosChanged()
Definition: tabview3.cxx:629
void SetNewVisArea()
Definition: tabview.cxx:2133
void InitOwnBlockMode(const ScRange &rMarkRange)
Definition: tabview2.cxx:332
Point aBorderPos
Definition: tabview.hxx:133
void UpdateScrollBars(HeaderType eHeaderType=BOTH_HEADERS)
Definition: tabview4.cxx:390
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:1802
void InterpretVisible()
Definition: tabview4.cxx:499
void MarkColumns()
Definition: tabview3.cxx:1571
bool UpdateVisibleRange()
Definition: tabview.cxx:1497
void HideAllCursors()
Definition: tabview3.cxx:220
void OnLibreOfficeKitTabChanged()
Definition: tabview3.cxx:2052
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:2500
void UpdateEditView()
Definition: tabview3.cxx:2152
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:2439
void RepeatResize(bool bUpdateFix=true)
Definition: tabview.cxx:772
ScViewFunctionSet aFunctionSet
Definition: tabview.hxx:125
void PaintLeftArea(SCROW nStartRow, SCROW nEndRow)
Definition: tabview3.cxx:2724
VclPtr< vcl::Window > pFrameWin
Definition: tabview.hxx:121
void UpdateInputContext()
Definition: tabview3.cxx:2984
void RemoveWindowFromForeignEditView(SfxViewShell *pViewShell, ScSplitPos eWhich)
Definition: tabview3.cxx:2047
void UpdateFixPos()
Definition: tabview.cxx:759
void PaintGrid()
Definition: tabview3.cxx:2635
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
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:341
@ DIR_LEFT
Definition: global.hxx:345
@ DIR_TOP
Definition: global.hxx:344
@ DIR_RIGHT
Definition: global.hxx:343
@ DIR_BOTTOM
Definition: global.hxx:342
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
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