LibreOffice Module sc (master) 1
tabview.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <scitems.hxx>
21#include <sfx2/viewfrm.hxx>
22#include <sfx2/bindings.hxx>
23#include <vcl/commandevent.hxx>
24#include <vcl/help.hxx>
25#include <vcl/settings.hxx>
26#include <sal/log.hxx>
27#include <tools/svborder.hxx>
28#include <tools/json_writer.hxx>
30
31#include <pagedata.hxx>
32#include <tabview.hxx>
33#include <tabvwsh.hxx>
34#include <document.hxx>
35#include <gridwin.hxx>
36#include <olinewin.hxx>
37#include <olinetab.hxx>
38#include <tabsplit.hxx>
39#include <colrowba.hxx>
40#include <tabcont.hxx>
41#include <scmod.hxx>
42#include <sc.hrc>
43#include <globstr.hrc>
44#include <scresid.hxx>
45#include <drawview.hxx>
46#include <docsh.hxx>
47#include <viewuno.hxx>
48#include <appoptio.hxx>
49#include <attrib.hxx>
50#include <spellcheckcontext.hxx>
51#include <comphelper/lok.hxx>
52#include <sfx2/lokhelper.hxx>
53#include <osl/diagnose.h>
54
55#include <boost/property_tree/ptree.hpp>
56#include <boost/property_tree/json_parser.hpp>
57
58#include <com/sun/star/sheet/DataPilotFieldOrientation.hpp>
59
60#include <algorithm>
61
63
64#define SPLIT_MARGIN 30
65#define SPLIT_HANDLE_SIZE 5
66constexpr sal_Int32 TAB_HEIGHT_MARGIN = 10;
67
68#define SC_ICONSIZE 36
69
70#define SC_SCROLLBAR_MIN 30
71#define SC_TABBAR_MIN 6
72
73using namespace ::com::sun::star;
74
75// Corner-Button
76
78 Window( pParent, WinBits( 0 ) ),
79 pViewData( pData )
80{
81 EnableRTL( false );
82}
83
85{
86}
87
89{
90 const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
91 SetBackground(rStyleSettings.GetFaceColor());
92
93 Size aSize(GetOutputSizePixel());
94 tools::Long nPosX = aSize.Width() - 1;
95 tools::Long nPosY = aSize.Height() - 1;
96
97 Window::Paint(rRenderContext, rRect);
98
99 bool bLayoutRTL = pViewData->GetDocument().IsLayoutRTL( pViewData->GetTabNo() );
100 tools::Long nDarkX = bLayoutRTL ? 0 : nPosX;
101
102 // both buttons have the same look now - only dark right/bottom lines
103 rRenderContext.SetLineColor(rStyleSettings.GetDarkShadowColor());
104 rRenderContext.DrawLine(Point(0, nPosY), Point(nPosX, nPosY));
105 rRenderContext.DrawLine(Point(nDarkX, 0), Point(nDarkX, nPosY));
106}
107
109{
110 Window::StateChanged( nType );
111
112 const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
113 SetBackground( rStyleSettings.GetFaceColor() );
114 Invalidate();
115}
116
118{
119 Window::DataChanged( rDCEvt );
120
121 const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
122 SetBackground( rStyleSettings.GetFaceColor() );
123 Invalidate();
124}
125
127{
128 Invalidate();
129}
130
132{
133 ScModule* pScMod = SC_MOD();
134 bool bDisable = pScMod->IsFormulaMode() || pScMod->IsModalMode();
135 if (!bDisable)
136 {
138 pViewSh->SetActive(); // Appear and SetViewFrame
139 pViewSh->ActiveGrabFocus();
140
141 bool bControl = rMEvt.IsMod1();
142 pViewSh->SelectAll( bControl );
143 }
144}
145namespace
146{
147
148bool lcl_HasColOutline( const ScViewData& rViewData )
149{
150 const ScOutlineTable* pTable = rViewData.GetDocument().GetOutlineTable(rViewData.GetTabNo());
151 if (pTable)
152 {
153 const ScOutlineArray& rArray = pTable->GetColArray();
154 if ( rArray.GetDepth() > 0 )
155 return true;
156 }
157 return false;
158}
159
160bool lcl_HasRowOutline( const ScViewData& rViewData )
161{
162 const ScOutlineTable* pTable = rViewData.GetDocument().GetOutlineTable(rViewData.GetTabNo());
163 if (pTable)
164 {
165 const ScOutlineArray& rArray = pTable->GetRowArray();
166 if ( rArray.GetDepth() > 0 )
167 return true;
168 }
169 return false;
170}
171
172} // anonymous namespace
173
175 pFrameWin( pParent ),
176 aViewData( rDocSh, pViewShell ),
177 aFunctionSet( &aViewData ),
178 aHdrFunc( &aViewData ),
179 aVScrollTop( VclPtr<ScrollAdaptor>::Create( pFrameWin, false ) ),
180 aVScrollBottom( VclPtr<ScrollAdaptor>::Create( pFrameWin, false ) ),
181 aHScrollLeft( VclPtr<ScrollAdaptor>::Create( pFrameWin, true ) ),
182 aHScrollRight( VclPtr<ScrollAdaptor>::Create( pFrameWin, true ) ),
183 aCornerButton( VclPtr<ScCornerButton>::Create( pFrameWin, &aViewData ) ),
184 aTopButton( VclPtr<ScCornerButton>::Create( pFrameWin, &aViewData ) ),
185 aScrollTimer("ScTabView aScrollTimer"),
186 pTimerWindow( nullptr ),
187 aExtraEditViewManager( pViewShell, pGridWin ),
188 nTipVisible( nullptr ),
189 nTipAlign( QuickHelpFlags::NONE ),
190 nPrevDragPos( 0 ),
191 meBlockMode(None),
192 nBlockStartX( 0 ),
193 nBlockStartXOrig( 0 ),
194 nBlockEndX( 0 ),
195 nBlockStartY( 0 ),
196 nBlockStartYOrig( 0 ),
197 nBlockEndY( 0 ),
198 nBlockStartZ( 0 ),
199 nBlockEndZ( 0 ),
200 nOldCurX( 0 ),
201 nOldCurY( 0 ),
202 mfPendingTabBarWidth( -1.0 ),
203 mnLOKStartHeaderRow( -2 ),
204 mnLOKEndHeaderRow( -1 ),
205 mnLOKStartHeaderCol( -2 ),
206 mnLOKEndHeaderCol( -1 ),
207 bMinimized( false ),
208 bInUpdateHeader( false ),
209 bInActivatePart( false ),
210 bInZoomUpdate( false ),
211 bMoveIsShift( false ),
212 bDrawSelMode( false ),
213 bLockPaintBrush( false ),
214 bDragging( false ),
215 bBlockNeg( false ),
216 bBlockCols( false ),
217 bBlockRows( false ),
218 mbInlineWithScrollbar( false )
219{
220 Init();
221}
222
224{
225 rScrollBar.SetRange( Range( 0, nMaxVal ) );
226 rScrollBar.SetLineSize( 1 );
227 rScrollBar.SetPageSize( 1 ); // is queried separately
228 rScrollBar.SetVisibleSize( 10 ); // is reset by Resize
229
230 rScrollBar.SetScrollHdl(rLink);
231 rScrollBar.SetMouseReleaseHdl(LINK(this, ScTabView, EndScrollHdl));
232
234}
235
236// Scroll-Timer
237void ScTabView::SetTimer( ScGridWindow* pWin, const MouseEvent& rMEvt )
238{
239 pTimerWindow = pWin;
240 aTimerMEvt = rMEvt;
242}
243
245{
247 pTimerWindow = nullptr;
248}
249
250IMPL_LINK_NOARG(ScTabView, TimerHdl, Timer *, void)
251{
252 if (pTimerWindow)
253 pTimerWindow->MouseMove( aTimerMEvt );
254}
255
256// --- Resize ---------------------------------------------------------------------
257
258static void lcl_SetPosSize( vcl::Window& rWindow, const Point& rPos, const Size& rSize,
259 tools::Long nTotalWidth, bool bLayoutRTL )
260{
261 Point aNewPos = rPos;
262 if ( bLayoutRTL )
263 {
264 aNewPos.setX( nTotalWidth - rPos.X() - rSize.Width() );
265 if ( aNewPos == rWindow.GetPosPixel() && rSize.Width() != rWindow.GetSizePixel().Width() )
266 {
267 // Document windows are manually painted right-to-left, so they need to
268 // be repainted if the size changes.
269 rWindow.Invalidate();
270 }
271 }
272 rWindow.SetPosSizePixel( aNewPos, rSize );
273}
274
275void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
276{
277 HideListBox();
278
279 bool bHasHint = HasHintWindow();
280 if (bHasHint)
282
283 bool bLayoutRTL = aViewData.GetDocument().IsLayoutRTL( aViewData.GetTabNo() );
284 tools::Long nTotalWidth = rSize.Width();
285 if ( bLayoutRTL )
286 nTotalWidth += 2*rOffset.X();
287
288 bool bVScroll = aViewData.IsVScrollMode();
289 bool bHScroll = aViewData.IsHScrollMode();
290 bool bTabControl = aViewData.IsTabMode();
291 bool bHeaders = aViewData.IsHeaderMode();
292 bool bOutlMode = aViewData.IsOutlineMode();
293 bool bHOutline = bOutlMode && lcl_HasColOutline(aViewData);
294 bool bVOutline = bOutlMode && lcl_HasRowOutline(aViewData);
295
297 bHScroll = bVScroll = bTabControl = bHeaders = bHOutline = bVOutline = false;
298
299 tools::Long nBarX = 0;
300 tools::Long nBarY = 0;
301 tools::Long nOutlineX = 0;
302 tools::Long nOutlineY = 0;
303 tools::Long nOutPosX;
304 tools::Long nOutPosY;
305
306 tools::Long nPosX = rOffset.X();
307 tools::Long nPosY = rOffset.Y();
308 tools::Long nSizeX = rSize.Width();
309 tools::Long nSizeY = rSize.Height();
310
311 bMinimized = ( nSizeX<=SC_ICONSIZE || nSizeY<=SC_ICONSIZE );
312 if ( bMinimized )
313 return;
314
315 float fScaleFactor = pFrameWin->GetDPIScaleFactor();
316
317 tools::Long nSplitSizeX = SPLIT_HANDLE_SIZE * fScaleFactor;
319 nSplitSizeX = 1;
320 tools::Long nSplitSizeY = SPLIT_HANDLE_SIZE * fScaleFactor;
322 nSplitSizeY = 1;
323
324 aBorderPos = rOffset;
325 aFrameSize = rSize;
326
327 const StyleSettings& rStyleSettings = pFrameWin->GetSettings().GetStyleSettings();
328
329
330 Size aFontSize = rStyleSettings.GetTabFont().GetFontSize();
331 MapMode aPtMapMode(MapUnit::MapPoint);
332 aFontSize = pFrameWin->LogicToPixel(aFontSize, aPtMapMode);
333 sal_Int32 nTabHeight = aFontSize.Height() + TAB_HEIGHT_MARGIN;
334
336 {
337 if ( aViewData.GetHSplitPos() > nSizeX - SPLIT_MARGIN )
338 {
343 }
344 }
346 {
347 if ( aViewData.GetVSplitPos() > nSizeY - SPLIT_MARGIN )
348 {
353 }
354 }
355
356 UpdateShow();
357
358 if (bHScroll || bVScroll) // Scrollbars horizontal or vertical
359 {
360 tools::Long nScrollBarSize = rStyleSettings.GetScrollBarSize();
361 if (bVScroll)
362 {
363 nBarX = nScrollBarSize;
364 nSizeX -= nBarX;
365 }
366 if (bHScroll)
367 {
368 nBarY = nTabHeight;
369
371 nBarY += nScrollBarSize;
372
373 nSizeY -= nBarY;
374 }
375
376 if (bHScroll) // Scrollbars horizontal
377 {
378 tools::Long nSizeLt = 0; // left scroll bar
379 tools::Long nSizeRt = 0; // right scroll bar
380 tools::Long nSizeSp = 0; // splitter
381
382 switch (aViewData.GetHSplitMode())
383 {
384 case SC_SPLIT_NONE:
385 nSizeSp = nSplitSizeX;
386 nSizeLt = nSizeX - nSizeSp; // Convert the corner
387 break;
388 case SC_SPLIT_NORMAL:
389 nSizeSp = nSplitSizeX;
390 nSizeLt = aViewData.GetHSplitPos();
391 break;
392 case SC_SPLIT_FIX:
393 nSizeSp = 0;
394 nSizeLt = 0;
395 break;
396 }
397 nSizeRt = nSizeX - nSizeLt - nSizeSp;
398
400
401 if (bTabControl)
402 {
403 // pending relative tab bar width from extended document options
404 if( mfPendingTabBarWidth >= 0.0 )
405 {
408 }
409
411 {
412 nTabSize = pTabControl->GetSizePixel().Width();
413
414 if ( aViewData.GetHSplitMode() != SC_SPLIT_FIX ) // left Scrollbar
415 {
416 if (nTabSize > nSizeLt-SC_SCROLLBAR_MIN)
417 nTabSize = nSizeLt-SC_SCROLLBAR_MIN;
420 nSizeLt -= nTabSize;
421 }
422 else // right Scrollbar
423 {
424 if (nTabSize > nSizeRt-SC_SCROLLBAR_MIN)
425 nTabSize = nSizeRt-SC_SCROLLBAR_MIN;
428 nSizeRt -= nTabSize;
429 }
430 }
431 }
432
434 {
435 Point aTabPoint(nPosX, nPosY + nSizeY);
436 Size aTabSize(nTabSize, nBarY);
437 lcl_SetPosSize(*pTabControl, aTabPoint, aTabSize, nTotalWidth, bLayoutRTL);
438 pTabControl->SetSheetLayoutRTL(bLayoutRTL);
439
440 Point aHScrollLeftPoint(nPosX + nTabSize, nPosY + nSizeY);
441 Size aHScrollLeftSize(nSizeLt, nBarY);
442 lcl_SetPosSize(*aHScrollLeft, aHScrollLeftPoint, aHScrollLeftSize, nTotalWidth, bLayoutRTL);
443
444 Point aHSplitterPoint(nPosX + nTabSize + nSizeLt, nPosY + nSizeY);
445 Size aHSplitterSize(nSizeSp, nBarY);
446 lcl_SetPosSize(*pHSplitter, aHSplitterPoint, aHSplitterSize, nTotalWidth, bLayoutRTL);
447
448 Point aHScrollRightPoint(nPosX + nTabSize + nSizeLt + nSizeSp, nPosY + nSizeY);
449 Size aHScrollRightSize(nSizeRt, nBarY);
450 lcl_SetPosSize(*aHScrollRight, aHScrollRightPoint, aHScrollRightSize, nTotalWidth, bLayoutRTL);
451 }
452 else
453 {
454 Point aTabPoint(nPosX, nPosY + nSizeY + nScrollBarSize);
455 Size aTabSize(nSizeX, nTabHeight);
456 lcl_SetPosSize(*pTabControl, aTabPoint, aTabSize, nTotalWidth, bLayoutRTL);
457 pTabControl->SetSheetLayoutRTL(bLayoutRTL);
458
459 Point aHScrollLeftPoint(nPosX, nPosY + nSizeY);
460 Size aHScrollLeftSize(nSizeLt, nScrollBarSize);
461 lcl_SetPosSize(*aHScrollLeft, aHScrollLeftPoint, aHScrollLeftSize, nTotalWidth, bLayoutRTL);
462
463 Point aHSplitterPoint(nPosX + nSizeLt, nPosY + nSizeY);
464 Size aHSplitterSize(nSizeSp, nScrollBarSize);
465 lcl_SetPosSize(*pHSplitter, aHSplitterPoint, aHSplitterSize, nTotalWidth, bLayoutRTL);
466
467 Point aHScrollRightPoint(nPosX + nSizeLt + nSizeSp, nPosY + nSizeY);
468 Size aHScrollRightSize(nSizeRt, nScrollBarSize);
469 lcl_SetPosSize(*aHScrollRight, aHScrollRightPoint, aHScrollRightSize, nTotalWidth, bLayoutRTL);
470 }
471 // SetDragRectPixel is done below
472 }
473
474 if (bVScroll)
475 {
476 tools::Long nSizeUp = 0; // upper scroll bar
477 tools::Long nSizeSp = 0; // splitter
478 tools::Long nSizeDn; // lower scroll bar
479
480 switch (aViewData.GetVSplitMode())
481 {
482 case SC_SPLIT_NONE:
483 nSizeUp = 0;
484 nSizeSp = nSplitSizeY;
485 break;
486 case SC_SPLIT_NORMAL:
487 nSizeUp = aViewData.GetVSplitPos();
488 nSizeSp = nSplitSizeY;
489 break;
490 case SC_SPLIT_FIX:
491 nSizeUp = 0;
492 nSizeSp = 0;
493 break;
494 }
495 nSizeDn = nSizeY - nSizeUp - nSizeSp;
496
497 lcl_SetPosSize( *aVScrollTop, Point(nPosX + nSizeX, nPosY),
498 Size(nBarX, nSizeUp), nTotalWidth, bLayoutRTL );
499 lcl_SetPosSize( *pVSplitter, Point( nPosX + nSizeX, nPosY+nSizeUp ),
500 Size( nBarX, nSizeSp ), nTotalWidth, bLayoutRTL );
501 lcl_SetPosSize( *aVScrollBottom, Point(nPosX + nSizeX,
502 nPosY + nSizeUp + nSizeSp),
503 Size(nBarX, nSizeDn), nTotalWidth, bLayoutRTL );
504
505 // SetDragRectPixel is done below
506 }
507 }
508
509 // SetDragRectPixel also without Scrollbars etc., when already split
510 if ( bHScroll || aViewData.GetHSplitMode() != SC_SPLIT_NONE )
511 pHSplitter->SetDragRectPixel(
512 tools::Rectangle( nPosX, nPosY, nPosX+nSizeX, nPosY+nSizeY ), pFrameWin );
513 if ( bVScroll || aViewData.GetVSplitMode() != SC_SPLIT_NONE )
514 pVSplitter->SetDragRectPixel(
515 tools::Rectangle( nPosX, nPosY, nPosX+nSizeX, nPosY+nSizeY ), pFrameWin );
516
517 if (bTabControl && ! bHScroll )
518 {
519 nBarY = aHScrollLeft->GetSizePixel().Height();
520
521 tools::Long nSize1 = nSizeX;
522
523 tools::Long nTabSize = nSize1;
524 if (nTabSize < 0) nTabSize = 0;
525
526 lcl_SetPosSize( *pTabControl, Point(nPosX, nPosY+nSizeY-nBarY),
527 Size(nTabSize, nBarY), nTotalWidth, bLayoutRTL );
528 nSizeY -= nBarY;
529
530 if( bVScroll )
531 {
532 Size aVScrSize = aVScrollBottom->GetSizePixel();
533 aVScrSize.AdjustHeight( -nBarY );
534 aVScrollBottom->SetSizePixel( aVScrSize );
535 }
536 }
537
538 nOutPosX = nPosX;
539 nOutPosY = nPosY;
540
541 // Outline-Controls
542 if (bVOutline && pRowOutline[SC_SPLIT_BOTTOM])
543 {
544 nOutlineX = pRowOutline[SC_SPLIT_BOTTOM]->GetDepthSize();
545 nSizeX -= nOutlineX;
546 nPosX += nOutlineX;
547 }
548 if (bHOutline && pColOutline[SC_SPLIT_LEFT])
549 {
550 nOutlineY = pColOutline[SC_SPLIT_LEFT]->GetDepthSize();
551 nSizeY -= nOutlineY;
552 nPosY += nOutlineY;
553 }
554
555 if (bHeaders) // column/row header
556 {
557 nBarX = pRowBar[SC_SPLIT_BOTTOM]->GetSizePixel().Width();
558 nBarY = pColBar[SC_SPLIT_LEFT]->GetSizePixel().Height();
559 nSizeX -= nBarX;
560 nSizeY -= nBarY;
561 nPosX += nBarX;
562 nPosY += nBarY;
563 }
564 else
565 nBarX = nBarY = 0;
566
567 // evaluate splitter
568
569 tools::Long nLeftSize = nSizeX;
570 tools::Long nRightSize = 0;
571 tools::Long nTopSize = 0;
572 tools::Long nBottomSize = nSizeY;
573 tools::Long nSplitPosX = nPosX;
574 tools::Long nSplitPosY = nPosY;
575
577 {
578 tools::Long nSplitHeight = rSize.Height();
580 {
581 // Do not allow freeze splitter to overlap scroll bar/tab bar
582 if ( bHScroll )
583 nSplitHeight -= aHScrollLeft->GetSizePixel().Height();
584 else if ( bTabControl && pTabControl )
585 nSplitHeight -= pTabControl->GetSizePixel().Height();
586 }
587 nSplitPosX = aViewData.GetHSplitPos();
589 Point(nSplitPosX, nOutPosY),
590 Size(nSplitSizeX, nSplitHeight - nTabHeight), nTotalWidth, bLayoutRTL);
591 nLeftSize = nSplitPosX - nPosX;
592 nSplitPosX += nSplitSizeX;
593 nRightSize = nSizeX - nLeftSize - nSplitSizeX;
594 }
596 {
597 tools::Long nSplitWidth = rSize.Width();
598 if ( aViewData.GetVSplitMode() == SC_SPLIT_FIX && bVScroll )
599 nSplitWidth -= aVScrollBottom->GetSizePixel().Width();
600 nSplitPosY = aViewData.GetVSplitPos();
602 Point( nOutPosX, nSplitPosY ), Size( nSplitWidth, nSplitSizeY ), nTotalWidth, bLayoutRTL );
603 nTopSize = nSplitPosY - nPosY;
604 nSplitPosY += nSplitSizeY;
605 nBottomSize = nSizeY - nTopSize - nSplitSizeY;
606 }
607
608 // ShowHide for pColOutline / pRowOutline happens in UpdateShow
609
610 if (bHOutline) // Outline-Controls
611 {
613 {
614 pColOutline[SC_SPLIT_LEFT]->SetHeaderSize( nBarX );
616 Point(nPosX-nBarX,nOutPosY), Size(nLeftSize+nBarX,nOutlineY), nTotalWidth, bLayoutRTL );
617 }
619 {
620 pColOutline[SC_SPLIT_RIGHT]->SetHeaderSize( 0 ); // always call to update RTL flag
622 Point(nSplitPosX,nOutPosY), Size(nRightSize,nOutlineY), nTotalWidth, bLayoutRTL );
623 }
624 }
625 if (bVOutline)
626 {
627 if (nTopSize)
628 {
630 {
631 pRowOutline[SC_SPLIT_TOP]->SetHeaderSize( nBarY );
633 Point(nOutPosX,nPosY-nBarY), Size(nOutlineX,nTopSize+nBarY), nTotalWidth, bLayoutRTL );
634 pRowOutline[SC_SPLIT_BOTTOM]->SetHeaderSize( 0 );
636 Point(nOutPosX,nSplitPosY), Size(nOutlineX,nBottomSize), nTotalWidth, bLayoutRTL );
637 }
638 }
640 {
641 pRowOutline[SC_SPLIT_BOTTOM]->SetHeaderSize( nBarY );
643 Point(nOutPosX,nSplitPosY-nBarY), Size(nOutlineX,nBottomSize+nBarY), nTotalWidth, bLayoutRTL );
644 }
645 }
646 if (bHOutline && bVOutline)
647 {
648 lcl_SetPosSize( *aTopButton, Point(nOutPosX,nOutPosY), Size(nOutlineX,nOutlineY), nTotalWidth, bLayoutRTL );
649 aTopButton->Show();
650 }
651 else
652 aTopButton->Hide();
653
654 if (bHeaders) // column/row header
655 {
657 Point(nPosX,nPosY-nBarY), Size(nLeftSize,nBarY), nTotalWidth, bLayoutRTL );
660 Point(nSplitPosX,nPosY-nBarY), Size(nRightSize,nBarY), nTotalWidth, bLayoutRTL );
661
664 Point(nPosX-nBarX,nPosY), Size(nBarX,nTopSize), nTotalWidth, bLayoutRTL );
666 Point(nPosX-nBarX,nSplitPosY), Size(nBarX,nBottomSize), nTotalWidth, bLayoutRTL );
667
668 lcl_SetPosSize( *aCornerButton, Point(nPosX-nBarX,nPosY-nBarY), Size(nBarX,nBarY), nTotalWidth, bLayoutRTL );
669 aCornerButton->Show();
670 pColBar[SC_SPLIT_LEFT]->Show();
671 pRowBar[SC_SPLIT_BOTTOM]->Show();
672 }
673 else
674 {
675 aCornerButton->Hide();
676 pColBar[SC_SPLIT_LEFT]->Hide(); // always here
677 pRowBar[SC_SPLIT_BOTTOM]->Hide();
678 }
679
680 // Grid-Windows
681
682 if (bInner)
683 {
684 tools::Long nInnerPosX = bLayoutRTL ? ( nTotalWidth - nPosX - nLeftSize ) : nPosX;
685 pGridWin[SC_SPLIT_BOTTOMLEFT]->SetPosPixel( Point(nInnerPosX,nSplitPosY) );
686 }
687 else
688 {
690 Point(nPosX,nSplitPosY), Size(nLeftSize,nBottomSize), nTotalWidth, bLayoutRTL );
693 Point(nSplitPosX,nSplitPosY), Size(nRightSize,nBottomSize), nTotalWidth, bLayoutRTL );
696 Point(nPosX,nPosY), Size(nLeftSize,nTopSize), nTotalWidth, bLayoutRTL );
699 Point(nSplitPosX,nPosY), Size(nRightSize,nTopSize), nTotalWidth, bLayoutRTL );
700 }
701
702 // update scroll bars
703
704 if (!bInUpdateHeader)
705 {
706 UpdateScrollBars(); // don't reset scroll bars when scrolling
708
709 InterpretVisible(); // have everything calculated before painting
710 }
711
712 if (bHasHint)
713 TestHintWindow(); // reposition
714
715 UpdateVarZoom(); // update variable zoom types (after resizing GridWindows)
716
718 aViewData.GetViewShell()->BroadcastAccessibility(SfxHint(SfxHintId::ScAccWindowResized));
719}
720
722{
723 // update variable zoom types
724
725 SvxZoomType eZoomType = GetZoomType();
726 if (eZoomType == SvxZoomType::PERCENT || bInZoomUpdate)
727 return;
728
729 bInZoomUpdate = true;
730 const Fraction& rOldX = GetViewData().GetZoomX();
731 const Fraction& rOldY = GetViewData().GetZoomY();
732 tools::Long nOldPercent = tools::Long(rOldY * 100);
733 sal_uInt16 nNewZoom = CalcZoom( eZoomType, static_cast<sal_uInt16>(nOldPercent) );
734 Fraction aNew( nNewZoom, 100 );
735
736 if ( aNew != rOldX || aNew != rOldY )
737 {
738 SetZoom( aNew, aNew, false ); // always separately per sheet
739 PaintGrid();
740 PaintTop();
741 PaintLeft();
743 aViewData.GetViewShell()->GetViewFrame().GetBindings().Invalidate( SID_ATTR_ZOOMSLIDER );
744 aViewData.GetBindings().Invalidate(SID_ZOOM_IN);
745 aViewData.GetBindings().Invalidate(SID_ZOOM_OUT);
746 }
747 bInZoomUpdate = false;
748}
749
751{
752 bool bResize = false;
754 if (aViewData.UpdateFixX())
755 bResize = true;
757 if (aViewData.UpdateFixY())
758 bResize = true;
759 if (bResize)
760 RepeatResize(false);
761}
762
763void ScTabView::RepeatResize( bool bUpdateFix )
764{
765 if ( bUpdateFix )
766 {
769
770 // #i46796# UpdateFixX / UpdateFixY uses GetGridOffset, which requires the
771 // outline windows to be available. So UpdateShow has to be called before
772 // (also called from DoResize).
773 if ( eHSplit == SC_SPLIT_FIX || eVSplit == SC_SPLIT_FIX )
774 UpdateShow();
775
776 if ( eHSplit == SC_SPLIT_FIX )
778 if ( eVSplit == SC_SPLIT_FIX )
780 }
781
783
785}
786
787void ScTabView::GetBorderSize( SvBorder& rBorder, const Size& /* rSize */ )
788{
789 bool bScrollBars = aViewData.IsVScrollMode();
790 bool bHeaders = aViewData.IsHeaderMode();
791 bool bOutlMode = aViewData.IsOutlineMode();
792 bool bHOutline = bOutlMode && lcl_HasColOutline(aViewData);
793 bool bVOutline = bOutlMode && lcl_HasRowOutline(aViewData);
794 bool bLayoutRTL = aViewData.GetDocument().IsLayoutRTL( aViewData.GetTabNo() );
795
796 rBorder = SvBorder();
797
798 if (bScrollBars) // Scrollbars horizontal or vertical
799 {
800 rBorder.Right() += aVScrollBottom->GetSizePixel().Width();
801 rBorder.Bottom() += aHScrollLeft->GetSizePixel().Height();
802 }
803
804 // Outline-Controls
805 if (bVOutline && pRowOutline[SC_SPLIT_BOTTOM])
806 rBorder.Left() += pRowOutline[SC_SPLIT_BOTTOM]->GetDepthSize();
807 if (bHOutline && pColOutline[SC_SPLIT_LEFT])
808 rBorder.Top() += pColOutline[SC_SPLIT_LEFT]->GetDepthSize();
809
810 if (bHeaders) // column/row headers
811 {
812 rBorder.Left() += pRowBar[SC_SPLIT_BOTTOM]->GetSizePixel().Width();
813 rBorder.Top() += pColBar[SC_SPLIT_LEFT]->GetSizePixel().Height();
814 }
815
816 if ( bLayoutRTL )
817 ::std::swap( rBorder.Left(), rBorder.Right() );
818}
819
820IMPL_LINK_NOARG(ScTabView, TabBarResize, TabBar*, void)
821{
822 if (!aViewData.IsHScrollMode())
823 return;
824
825 tools::Long nSize = pTabControl->GetSplitSize();
826
827 if (aViewData.GetHSplitMode() != SC_SPLIT_FIX)
828 {
829 tools::Long nMax = pHSplitter->GetPosPixel().X();
830 if( pTabControl->IsEffectiveRTL() )
831 nMax = pFrameWin->GetSizePixel().Width() - nMax;
832 --nMax;
833 if (nSize>nMax) nSize = nMax;
834 }
835
836 if ( nSize != pTabControl->GetSizePixel().Width() )
837 {
838 pTabControl->SetSizePixel( Size( nSize,
839 pTabControl->GetSizePixel().Height() ) );
840 RepeatResize();
841 }
842}
843
845{
846 Size aSize = pTabControl->GetSizePixel();
847
848 if ( aSize.Width() != nNewWidth )
849 {
850 aSize.setWidth( nNewWidth );
851 pTabControl->SetSizePixel( aSize );
852 }
853}
854
855void ScTabView::SetRelTabBarWidth( double fRelTabBarWidth )
856{
857 if( (0.0 <= fRelTabBarWidth) && (fRelTabBarWidth <= 1.0) )
858 if( tools::Long nFrameWidth = pFrameWin->GetSizePixel().Width() )
859 SetTabBarWidth( static_cast< tools::Long >( fRelTabBarWidth * nFrameWidth + 0.5 ) );
860}
861
862void ScTabView::SetPendingRelTabBarWidth( double fRelTabBarWidth )
863{
864 mfPendingTabBarWidth = fRelTabBarWidth;
865 SetRelTabBarWidth( fRelTabBarWidth );
866}
867
869{
870 return pTabControl->GetSizePixel().Width();
871}
872
874{
875 return 0.5;
876}
877
879{
881 OSL_ENSURE(pGridWin[ePos],"no active window");
882 return pGridWin[ePos];
883}
884
886{
887 for (VclPtr<ScGridWindow> & pWin : pGridWin)
888 if (pWin)
889 pWin->SetPointer( nPointer );
890}
891
893{
895 if (pGridWin[ePos])
896 pGridWin[ePos]->GrabFocus();
897}
898
900{
901 ScSplitPos eVal = SC_SPLIT_BOTTOMLEFT; // Default
902 for (sal_uInt16 i=0; i<4; i++)
903 if ( pGridWin[i] == pWindow )
904 eVal = static_cast<ScSplitPos>(i);
905
906 return eVal;
907}
908
910{
911 Point aPos;
912
913 // size as in DoResize
914
915 bool bHeaders = aViewData.IsHeaderMode();
916 bool bOutlMode = aViewData.IsOutlineMode();
917 bool bHOutline = bOutlMode && lcl_HasColOutline(aViewData);
918 bool bVOutline = bOutlMode && lcl_HasRowOutline(aViewData);
919
920 // Outline-Controls
921 if (bVOutline && pRowOutline[SC_SPLIT_BOTTOM])
922 aPos.AdjustX(pRowOutline[SC_SPLIT_BOTTOM]->GetDepthSize() );
923 if (bHOutline && pColOutline[SC_SPLIT_LEFT])
924 aPos.AdjustY(pColOutline[SC_SPLIT_LEFT]->GetDepthSize() );
925
926 if (bHeaders) // column/row headers
927 {
929 aPos.AdjustX(pRowBar[SC_SPLIT_BOTTOM]->GetSizePixel().Width() );
931 aPos.AdjustY(pColBar[SC_SPLIT_LEFT]->GetSizePixel().Height() );
932 }
933
934 return aPos;
935}
936
937// --- Scroll-Bars --------------------------------------------------------
938
939void ScTabView::SetZoomPercentFromCommand(sal_uInt16 nZoomPercent)
940{
941 // scroll wheel doesn't set the AppOptions default
942
943 bool bSyncZoom = SC_MOD()->GetAppOptions().GetSynchronizeZoom();
944 SetZoomType(SvxZoomType::PERCENT, bSyncZoom);
945 Fraction aFract(nZoomPercent, 100);
946 SetZoom(aFract, aFract, bSyncZoom);
947 PaintGrid();
948 PaintTop();
949 PaintLeft();
950 aViewData.GetBindings().Invalidate( SID_ATTR_ZOOM);
951 aViewData.GetBindings().Invalidate( SID_ATTR_ZOOMSLIDER);
952 aViewData.GetBindings().Invalidate( SID_ZOOM_IN);
953 aViewData.GetBindings().Invalidate( SID_ZOOM_OUT);
954}
955
957{
959
960 bool bDone = false;
961 const CommandWheelData* pData = rCEvt.GetWheelData();
962 if (pData && pData->GetMode() == CommandWheelMode::ZOOM)
963 {
965 {
966 // for ole inplace editing, the scale is defined by the visarea and client size
967 // and can't be changed directly
968
969 const Fraction& rOldY = aViewData.GetZoomY();
970 sal_uInt16 nOld = static_cast<tools::Long>( rOldY * 100 );
971 sal_uInt16 nNew;
972 if ( pData->GetDelta() < 0 )
973 nNew = std::max( MINZOOM, basegfx::zoomtools::zoomOut( nOld ));
974 else
975 nNew = std::min( MAXZOOM, basegfx::zoomtools::zoomIn( nOld ));
976 if ( nNew != nOld )
977 {
979 }
980
981 bDone = true;
982 }
983 }
984 else
985 {
986 ScHSplitPos eHPos = WhichH(ePos);
987 ScVSplitPos eVPos = WhichV(ePos);
988 ScrollAdaptor* pHScroll = ( eHPos == SC_SPLIT_LEFT ) ? aHScrollLeft.get() : aHScrollRight.get();
989 ScrollAdaptor* pVScroll = ( eVPos == SC_SPLIT_TOP ) ? aVScrollTop.get() : aVScrollBottom.get();
990 if ( pGridWin[ePos] )
991 bDone = pGridWin[ePos]->HandleScrollCommand( rCEvt, pHScroll, pVScroll );
992 }
993 return bDone;
994}
995
997{
999
1001 if (!pData)
1002 return false;
1003
1005 return false;
1006
1007 if (pData->meEventType == GestureEventZoomType::Begin)
1008 {
1009 mfLastZoomScale = pData->mfScaleDelta;
1010 return true;
1011 }
1012
1013 if (pData->meEventType == GestureEventZoomType::Update)
1014 {
1015 double deltaBetweenEvents = (pData->mfScaleDelta - mfLastZoomScale) / mfLastZoomScale;
1016 mfLastZoomScale = pData->mfScaleDelta;
1017
1018 // Accumulate fractional zoom to avoid small zoom changes from being ignored
1019 mfAccumulatedZoom += deltaBetweenEvents;
1020 int nZoomChangePercent = mfAccumulatedZoom * 100;
1021 mfAccumulatedZoom -= nZoomChangePercent / 100.0;
1022
1023 const Fraction& rOldY = aViewData.GetZoomY();
1024 sal_uInt16 nOld = static_cast<tools::Long>(rOldY * 100);
1025 sal_uInt16 nNew = nOld + nZoomChangePercent;
1026 nNew = std::clamp<sal_uInt16>(nNew, MINZOOM, MAXZOOM);
1027
1028 if (nNew != nOld)
1029 {
1031 }
1032
1033 return true;
1034 }
1035 return true;
1036}
1037
1039{
1040 ScrollHdl(aHScrollLeft.get());
1041}
1042
1044{
1045 ScrollHdl(aHScrollRight.get());
1046}
1047
1049{
1050 ScrollHdl(aVScrollTop.get());
1051}
1052
1054{
1055 ScrollHdl(aVScrollBottom.get());
1056}
1057
1058IMPL_LINK_NOARG(ScTabView, EndScrollHdl, const MouseEvent&, bool)
1059{
1060 if (bDragging)
1061 {
1062 UpdateScrollBars();
1063 bDragging = false;
1064 }
1065 return false;
1066}
1067
1069{
1070 bool bHoriz = ( pScroll == aHScrollLeft.get() || pScroll == aHScrollRight.get() );
1071 tools::Long nViewPos;
1072 if ( bHoriz )
1073 nViewPos = aViewData.GetPosX( (pScroll == aHScrollLeft.get()) ?
1075 else
1076 nViewPos = aViewData.GetPosY( (pScroll == aVScrollTop.get()) ?
1078
1079 bool bLayoutRTL = aViewData.GetDocument().IsLayoutRTL( aViewData.GetTabNo() );
1080
1081 ScrollType eType = pScroll->GetScrollType();
1082 if ( eType == ScrollType::Drag )
1083 {
1084 if (!bDragging)
1085 {
1086 bDragging = true;
1087 nPrevDragPos = nViewPos;
1088 }
1089
1090 // show scroll position
1091 // (only QuickHelp, there is no entry for it in the status bar)
1092
1094 {
1095 Size aSize = pScroll->GetSizePixel();
1096
1097 /* Convert scrollbar mouse position to screen position. If RTL
1098 mode of scrollbar differs from RTL mode of its parent, then the
1099 direct call to Window::OutputToNormalizedScreenPixel() will
1100 give unusable results, because calculation of screen position
1101 is based on parent orientation and expects equal orientation of
1102 the child position. Need to mirror mouse position before. */
1103 Point aMousePos = pScroll->GetPointerPosPixel();
1104 if( pScroll->IsRTLEnabled() != pScroll->GetParent()->IsRTLEnabled() )
1105 aMousePos.setX( aSize.Width() - aMousePos.X() - 1 );
1106 aMousePos = pScroll->OutputToNormalizedScreenPixel( aMousePos );
1107
1108 // convert top-left position of scrollbar to screen position
1109 Point aPos = pScroll->OutputToNormalizedScreenPixel( Point() );
1110
1111 // get scrollbar scroll position for help text (row number/column name)
1112 tools::Long nScrollMin = 0; // simulate RangeMin
1113 if ( aViewData.GetHSplitMode()==SC_SPLIT_FIX && pScroll == aHScrollRight.get() )
1114 nScrollMin = aViewData.GetFixPosX();
1115 if ( aViewData.GetVSplitMode()==SC_SPLIT_FIX && pScroll == aVScrollBottom.get() )
1116 nScrollMin = aViewData.GetFixPosY();
1117 tools::Long nScrollPos = GetScrollBarPos( *pScroll ) + nScrollMin;
1118
1119 OUString aHelpStr;
1120 tools::Rectangle aRect;
1121 QuickHelpFlags nAlign;
1122 if (bHoriz)
1123 {
1124 aHelpStr = ScResId(STR_COLUMN) +
1125 " " + ScColToAlpha(static_cast<SCCOL>(nScrollPos));
1126
1127 aRect.SetLeft( aMousePos.X() );
1128 aRect.SetTop( aPos.Y() - 4 );
1129 nAlign = QuickHelpFlags::Bottom|QuickHelpFlags::Center;
1130 }
1131 else
1132 {
1133 aHelpStr = ScResId(STR_ROW) +
1134 " " + OUString::number(nScrollPos + 1);
1135
1136 // show quicktext always inside sheet area
1137 aRect.SetLeft( bLayoutRTL ? (aPos.X() + aSize.Width() + 8) : (aPos.X() - 8) );
1138 aRect.SetTop( aMousePos.Y() );
1139 nAlign = (bLayoutRTL ? QuickHelpFlags::Left : QuickHelpFlags::Right) | QuickHelpFlags::VCenter;
1140 }
1141 aRect.SetRight( aRect.Left() );
1142 aRect.SetBottom( aRect.Top() );
1143
1144 Help::ShowQuickHelp(pScroll->GetParent(), aRect, aHelpStr, nAlign);
1145 }
1146 }
1147 else
1148 bDragging = false;
1149
1150 tools::Long nDelta(0);
1151 switch ( eType )
1152 {
1153 case ScrollType::LineUp:
1154 nDelta = -1;
1155 break;
1156 case ScrollType::LineDown:
1157 nDelta = 1;
1158 break;
1159 case ScrollType::PageUp:
1160 if ( pScroll == aHScrollLeft.get() ) nDelta = -static_cast<tools::Long>(aViewData.PrevCellsX( SC_SPLIT_LEFT ));
1161 if ( pScroll == aHScrollRight.get() ) nDelta = -static_cast<tools::Long>(aViewData.PrevCellsX( SC_SPLIT_RIGHT ));
1162 if ( pScroll == aVScrollTop.get() ) nDelta = -static_cast<tools::Long>(aViewData.PrevCellsY( SC_SPLIT_TOP ));
1163 if ( pScroll == aVScrollBottom.get() ) nDelta = -static_cast<tools::Long>(aViewData.PrevCellsY( SC_SPLIT_BOTTOM ));
1164 if (nDelta==0) nDelta=-1;
1165 break;
1166 case ScrollType::PageDown:
1167 if ( pScroll == aHScrollLeft.get() ) nDelta = aViewData.VisibleCellsX( SC_SPLIT_LEFT );
1168 if ( pScroll == aHScrollRight.get() ) nDelta = aViewData.VisibleCellsX( SC_SPLIT_RIGHT );
1169 if ( pScroll == aVScrollTop.get() ) nDelta = aViewData.VisibleCellsY( SC_SPLIT_TOP );
1170 if ( pScroll == aVScrollBottom.get() ) nDelta = aViewData.VisibleCellsY( SC_SPLIT_BOTTOM );
1171 if (nDelta==0) nDelta=1;
1172 break;
1173 case ScrollType::Drag:
1174 {
1175 // only scroll in the correct direction, do not jitter around hidden ranges
1176 tools::Long nScrollMin = 0; // simulate RangeMin
1177 if ( aViewData.GetHSplitMode()==SC_SPLIT_FIX && pScroll == aHScrollRight.get() )
1178 nScrollMin = aViewData.GetFixPosX();
1179 if ( aViewData.GetVSplitMode()==SC_SPLIT_FIX && pScroll == aVScrollBottom.get() )
1180 nScrollMin = aViewData.GetFixPosY();
1181
1182 tools::Long nScrollPos = GetScrollBarPos( *pScroll ) + nScrollMin;
1183 nDelta = nScrollPos - nViewPos;
1184 if ( nScrollPos > nPrevDragPos )
1185 {
1186 if (nDelta<0) nDelta=0;
1187 }
1188 else if ( nScrollPos < nPrevDragPos )
1189 {
1190 if (nDelta>0) nDelta=0;
1191 }
1192 else
1193 nDelta = 0;
1194 nPrevDragPos = nScrollPos;
1195 }
1196 break;
1197 default:
1198 // Note tdf#152406 no anti-jitter code, unlike ScrollType::Drag,
1199 // for scroll wheel events.
1200 // After moving thousands of columns to the right via horizontal
1201 // scroll wheel or trackpad swipe events, most vertical scroll
1202 // wheel or trackpad swipe events would trigger the anti-jitter
1203 // code because nScrollPos and nPrevDragPos would be equal and
1204 // nDelta will be overridden and set to zero. So, only use the
1205 // anti-jitter code for mouse drag events.
1206 nDelta = GetScrollBarPos(*pScroll) - nViewPos;
1207 break;
1208 }
1209
1210 if (nDelta)
1211 {
1212 bool bUpdate = ( eType != ScrollType::Drag ); // don't alter the ranges while dragging
1213 if ( bHoriz )
1214 ScrollX( nDelta, (pScroll == aHScrollLeft.get()) ? SC_SPLIT_LEFT : SC_SPLIT_RIGHT, bUpdate );
1215 else
1216 ScrollY( nDelta, (pScroll == aVScrollTop.get()) ? SC_SPLIT_TOP : SC_SPLIT_BOTTOM, bUpdate );
1217 }
1218}
1219
1220void ScTabView::ScrollX( tools::Long nDeltaX, ScHSplitPos eWhich, bool bUpdBars )
1221{
1223 SCCOL nOldX = aViewData.GetPosX(eWhich);
1224 SCCOL nNewX = nOldX + static_cast<SCCOL>(nDeltaX);
1225 if ( nNewX < 0 )
1226 {
1227 nDeltaX -= nNewX;
1228 nNewX = 0;
1229 }
1230 if ( nNewX > rDoc.MaxCol() )
1231 {
1232 nDeltaX -= nNewX - rDoc.MaxCol();
1233 nNewX = rDoc.MaxCol();
1234 }
1235
1236 SCCOL nDir = ( nDeltaX > 0 ) ? 1 : -1;
1237 SCTAB nTab = aViewData.GetTabNo();
1238 while ( rDoc.ColHidden(nNewX, nTab) &&
1239 nNewX+nDir >= 0 && nNewX+nDir <= rDoc.MaxCol() )
1240 nNewX = sal::static_int_cast<SCCOL>( nNewX + nDir );
1241
1242 // freeze
1243
1245 {
1246 if (eWhich == SC_SPLIT_LEFT)
1247 nNewX = nOldX; // always keep the left part
1248 else
1249 {
1250 SCCOL nFixX = aViewData.GetFixPosX();
1251 if (nNewX < nFixX)
1252 nNewX = nFixX;
1253 }
1254 }
1255 if (nNewX == nOldX)
1256 return;
1257
1259
1260 if ( nNewX >= 0 && nNewX <= rDoc.MaxCol() && nDeltaX )
1261 {
1262 SCCOL nTrackX = std::max( nOldX, nNewX );
1263
1264 // with VCL Update() affects all windows at the moment, that is why
1265 // calling Update after scrolling of the GridWindow would possibly
1266 // already have painted the column/row bar with updated position. -
1267 // Therefore call Update once before on column/row bar
1268 if (pColBar[eWhich])
1269 pColBar[eWhich]->PaintImmediately();
1270
1271 tools::Long nOldPos = aViewData.GetScrPos( nTrackX, 0, eWhich ).X();
1272 aViewData.SetPosX( eWhich, nNewX );
1273 tools::Long nDiff = aViewData.GetScrPos( nTrackX, 0, eWhich ).X() - nOldPos;
1274
1275 if ( eWhich==SC_SPLIT_LEFT )
1276 {
1277 pGridWin[SC_SPLIT_BOTTOMLEFT]->ScrollPixel( nDiff, 0 );
1279 pGridWin[SC_SPLIT_TOPLEFT]->ScrollPixel( nDiff, 0 );
1280 }
1281 else
1282 {
1283 pGridWin[SC_SPLIT_BOTTOMRIGHT]->ScrollPixel( nDiff, 0 );
1285 pGridWin[SC_SPLIT_TOPRIGHT]->ScrollPixel( nDiff, 0 );
1286 }
1287 if (pColBar[eWhich]) { pColBar[eWhich]->Scroll( nDiff,0 ); pColBar[eWhich]->PaintImmediately(); }
1288 if (pColOutline[eWhich]) pColOutline[eWhich]->ScrollPixel( nDiff );
1289 if (bUpdBars)
1291 }
1292
1293 if (nDeltaX==1 || nDeltaX==-1)
1294 pGridWin[aViewData.GetActivePart()]->PaintImmediately();
1295
1297
1298 SetNewVisArea(); // MapMode must already be set
1299
1301}
1302
1303void ScTabView::ScrollY( tools::Long nDeltaY, ScVSplitPos eWhich, bool bUpdBars )
1304{
1306 SCROW nOldY = aViewData.GetPosY(eWhich);
1307 SCROW nNewY = nOldY + static_cast<SCROW>(nDeltaY);
1308 if ( nNewY < 0 )
1309 {
1310 nDeltaY -= nNewY;
1311 nNewY = 0;
1312 }
1313 if ( nNewY > rDoc.MaxRow() )
1314 {
1315 nDeltaY -= nNewY - rDoc.MaxRow();
1316 nNewY = rDoc.MaxRow();
1317 }
1318
1319 SCROW nDir = ( nDeltaY > 0 ) ? 1 : -1;
1320 SCTAB nTab = aViewData.GetTabNo();
1321 while ( rDoc.RowHidden(nNewY, nTab) &&
1322 nNewY+nDir >= 0 && nNewY+nDir <= rDoc.MaxRow() )
1323 nNewY += nDir;
1324
1325 // freeze
1326
1328 {
1329 if (eWhich == SC_SPLIT_TOP)
1330 nNewY = nOldY; // always keep the upper part
1331 else
1332 {
1333 SCROW nFixY = aViewData.GetFixPosY();
1334 if (nNewY < nFixY)
1335 nNewY = nFixY;
1336 }
1337 }
1338 if (nNewY == nOldY)
1339 return;
1340
1342
1343 if ( nNewY >= 0 && nNewY <= rDoc.MaxRow() && nDeltaY )
1344 {
1345 SCROW nTrackY = std::max( nOldY, nNewY );
1346
1347 // adjust row headers before the actual scrolling, so it does not get painted twice
1348 // PosY may then also not be set yet, pass on new value
1349 SCROW nUNew = nNewY;
1350 UpdateHeaderWidth( &eWhich, &nUNew ); // adjust row headers
1351
1352 if (pRowBar[eWhich])
1353 pRowBar[eWhich]->PaintImmediately();
1354
1355 tools::Long nOldPos = aViewData.GetScrPos( 0, nTrackY, eWhich ).Y();
1356 aViewData.SetPosY( eWhich, nNewY );
1357 tools::Long nDiff = aViewData.GetScrPos( 0, nTrackY, eWhich ).Y() - nOldPos;
1358
1359 if ( eWhich==SC_SPLIT_TOP )
1360 {
1361 pGridWin[SC_SPLIT_TOPLEFT]->ScrollPixel( 0, nDiff );
1363 pGridWin[SC_SPLIT_TOPRIGHT]->ScrollPixel( 0, nDiff );
1364 }
1365 else
1366 {
1367 pGridWin[SC_SPLIT_BOTTOMLEFT]->ScrollPixel( 0, nDiff );
1369 pGridWin[SC_SPLIT_BOTTOMRIGHT]->ScrollPixel( 0, nDiff );
1370 }
1371 if (pRowBar[eWhich]) { pRowBar[eWhich]->Scroll( 0,nDiff ); pRowBar[eWhich]->PaintImmediately(); }
1372 if (pRowOutline[eWhich]) pRowOutline[eWhich]->ScrollPixel( nDiff );
1373 if (bUpdBars)
1375 }
1376
1377 if (nDeltaY==1 || nDeltaY==-1)
1378 pGridWin[aViewData.GetActivePart()]->PaintImmediately();
1379
1381
1382 SetNewVisArea(); // MapMode must already be set
1383
1385}
1386
1388{
1390 if (nDeltaX)
1391 ScrollX(nDeltaX,WhichH(eWhich));
1392 if (nDeltaY)
1393 ScrollY(nDeltaY,WhichV(eWhich));
1394}
1395
1396namespace
1397{
1398
1399SCROW lcl_LastVisible( const ScViewData& rViewData )
1400{
1401 // If many rows are hidden at end of the document,
1402 // then there should not be a switch to wide row headers because of this
1403 ScDocument& rDoc = rViewData.GetDocument();
1404 SCTAB nTab = rViewData.GetTabNo();
1405
1406 SCROW nVis = rDoc.MaxRow();
1407 SCROW startRow;
1408 while ( nVis > 0 && rDoc.GetRowHeight( nVis, nTab, &startRow, nullptr ) == 0 )
1409 nVis = std::max<SCROW>( startRow - 1, 0 );
1410 return nVis;
1411}
1412
1413} // anonymous namespace
1414
1415void ScTabView::UpdateHeaderWidth( const ScVSplitPos* pWhich, const SCROW* pPosY )
1416{
1418 return;
1419
1421 SCROW nEndPos = rDoc.MaxRow();
1423 {
1424 // for OLE Inplace always MAXROW
1425
1426 if ( pWhich && *pWhich == SC_SPLIT_BOTTOM && pPosY )
1427 nEndPos = *pPosY;
1428 else
1429 nEndPos = aViewData.GetPosY( SC_SPLIT_BOTTOM );
1430 nEndPos += aViewData.CellsAtY( nEndPos, 1, SC_SPLIT_BOTTOM ); // VisibleCellsY
1431 if (nEndPos > rDoc.MaxRow())
1432 nEndPos = lcl_LastVisible( aViewData );
1433
1435 {
1436 SCROW nTopEnd;
1437 if ( pWhich && *pWhich == SC_SPLIT_TOP && pPosY )
1438 nTopEnd = *pPosY;
1439 else
1440 nTopEnd = aViewData.GetPosY( SC_SPLIT_TOP );
1441 nTopEnd += aViewData.CellsAtY( nTopEnd, 1, SC_SPLIT_TOP );// VisibleCellsY
1442 if (nTopEnd > rDoc.MaxRow())
1443 nTopEnd = lcl_LastVisible( aViewData );
1444
1445 if ( nTopEnd > nEndPos )
1446 nEndPos = nTopEnd;
1447 }
1448 }
1449
1450 tools::Long nSmall = pRowBar[SC_SPLIT_BOTTOM]->GetSmallWidth();
1451 tools::Long nBig = pRowBar[SC_SPLIT_BOTTOM]->GetBigWidth();
1452 tools::Long nDiff = nBig - nSmall;
1453
1454 if (nEndPos>10000)
1455 nEndPos = 10000;
1456 else if (nEndPos<1) // avoid extra step at 0 (when only one row is visible)
1457 nEndPos = 1;
1458 tools::Long nWidth = nBig - ( 10000 - nEndPos ) * nDiff / 10000;
1459
1460 if (nWidth == pRowBar[SC_SPLIT_BOTTOM]->GetWidth() || bInUpdateHeader)
1461 return;
1462
1463 bInUpdateHeader = true;
1464
1465 pRowBar[SC_SPLIT_BOTTOM]->SetWidth( nWidth );
1466 if (pRowBar[SC_SPLIT_TOP])
1467 pRowBar[SC_SPLIT_TOP]->SetWidth( nWidth );
1468
1469 RepeatResize();
1470
1471 // on VCL there are endless updates (each Update is valid for all windows)
1472 //aCornerButton->Update(); // otherwise this never gets an Update
1473
1474 bInUpdateHeader = false;
1475}
1476
1477static void ShowHide( vcl::Window* pWin, bool bShow )
1478{
1479 OSL_ENSURE(pWin || !bShow, "window is not present");
1480 if (pWin)
1481 pWin->Show(bShow);
1482}
1483
1485{
1486 bool bHScrollMode = aViewData.IsHScrollMode();
1487 bool bVScrollMode = aViewData.IsVScrollMode();
1488 bool bTabMode = aViewData.IsTabMode();
1489 bool bOutlMode = aViewData.IsOutlineMode();
1490 bool bHOutline = bOutlMode && lcl_HasColOutline(aViewData);
1491 bool bVOutline = bOutlMode && lcl_HasRowOutline(aViewData);
1492 bool bHeader = aViewData.IsHeaderMode();
1493
1494 bool bShowH = ( aViewData.GetHSplitMode() != SC_SPLIT_NONE );
1495 bool bShowV = ( aViewData.GetVSplitMode() != SC_SPLIT_NONE );
1496
1497 if ( aViewData.GetDocShell()->IsPreview() )
1498 bHScrollMode = bVScrollMode = bTabMode = bHeader = bHOutline = bVOutline = false;
1499
1500 // create Windows
1501
1502 if (bShowH && !pGridWin[SC_SPLIT_BOTTOMRIGHT])
1503 {
1506 }
1507 if (bShowV && !pGridWin[SC_SPLIT_TOPLEFT])
1508 {
1511 }
1512 if (bShowH && bShowV && !pGridWin[SC_SPLIT_TOPRIGHT])
1513 {
1516 }
1517
1518 if (bHOutline && !pColOutline[SC_SPLIT_LEFT])
1520 if (bShowH && bHOutline && !pColOutline[SC_SPLIT_RIGHT])
1522
1523 if (bVOutline && !pRowOutline[SC_SPLIT_BOTTOM])
1525 if (bShowV && bVOutline && !pRowOutline[SC_SPLIT_TOP])
1527
1528 if (bShowH && bHeader && !pColBar[SC_SPLIT_RIGHT])
1530 &aHdrFunc, pHdrSelEng.get(), this );
1531 if (bShowV && bHeader && !pRowBar[SC_SPLIT_TOP])
1533 &aHdrFunc, pHdrSelEng.get(), this );
1534
1535 // show Windows
1536
1537 ShowHide( aHScrollLeft.get(), bHScrollMode );
1538 ShowHide( aHScrollRight.get(), bShowH && bHScrollMode );
1539 ShowHide( aVScrollBottom.get(), bVScrollMode );
1540 ShowHide( aVScrollTop.get(), bShowV && bVScrollMode );
1541
1542 ShowHide( pHSplitter, bHScrollMode || bShowH ); // always generated
1543 ShowHide( pVSplitter, bVScrollMode || bShowV );
1544 ShowHide( pTabControl, bTabMode );
1545
1546 // from here dynamically generated
1547
1550 ShowHide( pGridWin[SC_SPLIT_TOPRIGHT], bShowH && bShowV );
1551
1552 ShowHide( pColOutline[SC_SPLIT_LEFT], bHOutline );
1553 ShowHide( pColOutline[SC_SPLIT_RIGHT], bShowH && bHOutline );
1554
1555 ShowHide( pRowOutline[SC_SPLIT_BOTTOM], bVOutline );
1556 ShowHide( pRowOutline[SC_SPLIT_TOP], bShowV && bVOutline );
1557
1558 ShowHide( pColBar[SC_SPLIT_RIGHT], bShowH && bHeader );
1559 ShowHide( pRowBar[SC_SPLIT_TOP], bShowV && bHeader );
1560
1562}
1563
1565{
1566 bool bChanged = false;
1567 for (VclPtr<ScGridWindow> & pWin : pGridWin)
1568 {
1569 if (!pWin || !pWin->IsVisible())
1570 continue;
1571
1572 if (pWin->UpdateVisibleRange())
1573 bChanged = true;
1574 }
1575
1576 return bChanged;
1577}
1578
1579// --- Splitter --------------------------------------------------------
1580
1581IMPL_LINK( ScTabView, SplitHdl, Splitter*, pSplitter, void )
1582{
1583 if ( pSplitter == pHSplitter )
1584 DoHSplit( pHSplitter->GetSplitPosPixel() );
1585 else
1586 DoVSplit( pVSplitter->GetSplitPosPixel() );
1587
1588 if ( aViewData.GetHSplitMode() == SC_SPLIT_FIX || aViewData.GetVSplitMode() == SC_SPLIT_FIX )
1589 FreezeSplitters( true );
1590
1591 DoResize( aBorderPos, aFrameSize );
1592}
1593
1595{
1596 // nSplitPos is the real pixel position on the frame window,
1597 // mirroring for RTL has to be done here.
1598
1599 bool bLayoutRTL = aViewData.GetDocument().IsLayoutRTL( aViewData.GetTabNo() );
1600 if ( bLayoutRTL )
1601 nSplitPos = pFrameWin->GetOutputSizePixel().Width() - nSplitPos - 1;
1602
1603 tools::Long nMinPos;
1604 tools::Long nMaxPos;
1605
1606 nMinPos = SPLIT_MARGIN;
1607 if ( pRowBar[SC_SPLIT_BOTTOM] && pRowBar[SC_SPLIT_BOTTOM]->GetSizePixel().Width() >= nMinPos )
1608 nMinPos = pRowBar[SC_SPLIT_BOTTOM]->GetSizePixel().Width() + 1;
1609 nMaxPos = aFrameSize.Width() - SPLIT_MARGIN;
1610
1611 ScSplitMode aOldMode = aViewData.GetHSplitMode();
1612 ScSplitMode aNewMode = SC_SPLIT_NORMAL;
1613
1614 aViewData.SetHSplitPos( nSplitPos );
1615 if ( nSplitPos < nMinPos || nSplitPos > nMaxPos )
1616 aNewMode = SC_SPLIT_NONE;
1617
1618 aViewData.SetHSplitMode( aNewMode );
1619
1620 if ( aNewMode == aOldMode )
1621 return;
1622
1623 UpdateShow(); // before ActivatePart !!
1624
1625 if ( aNewMode == SC_SPLIT_NONE )
1626 {
1631 }
1632 else
1633 {
1634 SCCOL nOldDelta = aViewData.GetPosX( SC_SPLIT_LEFT );
1635 tools::Long nLeftWidth = nSplitPos - pRowBar[SC_SPLIT_BOTTOM]->GetSizePixel().Width();
1636 if ( nLeftWidth < 0 ) nLeftWidth = 0;
1637 SCCOL nNewDelta = nOldDelta + aViewData.CellsAtX( nOldDelta, 1, SC_SPLIT_LEFT,
1638 static_cast<sal_uInt16>(nLeftWidth) );
1640 if ( nNewDelta > rDoc.MaxCol() )
1641 nNewDelta = rDoc.MaxCol();
1642 aViewData.SetPosX( SC_SPLIT_RIGHT, nNewDelta );
1643 if ( nNewDelta > aViewData.GetCurX() )
1646 else
1649 }
1650
1651 // Form Layer needs to know the visible part of all windows
1652 // that is why MapMode must already be correct here
1653 for (VclPtr<ScGridWindow> & pWin : pGridWin)
1654 if (pWin)
1655 pWin->SetMapMode( pWin->GetDrawMapMode() );
1656 SetNewVisArea();
1657
1658 PaintGrid();
1659 PaintTop();
1660
1662}
1663
1665{
1666 tools::Long nMinPos;
1667 tools::Long nMaxPos;
1668 SCROW nOldDelta;
1669
1670 nMinPos = SPLIT_MARGIN;
1671 if ( pColBar[SC_SPLIT_LEFT] && pColBar[SC_SPLIT_LEFT]->GetSizePixel().Height() >= nMinPos )
1672 nMinPos = pColBar[SC_SPLIT_LEFT]->GetSizePixel().Height() + 1;
1673 nMaxPos = aFrameSize.Height() - SPLIT_MARGIN;
1674
1675 ScSplitMode aOldMode = aViewData.GetVSplitMode();
1676 ScSplitMode aNewMode = SC_SPLIT_NORMAL;
1677
1678 aViewData.SetVSplitPos( nSplitPos );
1679 if ( nSplitPos < nMinPos || nSplitPos > nMaxPos )
1680 aNewMode = SC_SPLIT_NONE;
1681
1682 aViewData.SetVSplitMode( aNewMode );
1683
1684 if ( aNewMode == aOldMode )
1685 return;
1686
1687 UpdateShow(); // before ActivatePart !!
1688
1689 if ( aNewMode == SC_SPLIT_NONE )
1690 {
1691 nOldDelta = aViewData.GetPosY( SC_SPLIT_TOP );
1692 aViewData.SetPosY( SC_SPLIT_BOTTOM, nOldDelta );
1693
1698 }
1699 else
1700 {
1701 if ( aOldMode == SC_SPLIT_NONE )
1702 nOldDelta = aViewData.GetPosY( SC_SPLIT_BOTTOM );
1703 else
1704 nOldDelta = aViewData.GetPosY( SC_SPLIT_TOP );
1705
1706 aViewData.SetPosY( SC_SPLIT_TOP, nOldDelta );
1707 tools::Long nTopHeight = nSplitPos - pColBar[SC_SPLIT_LEFT]->GetSizePixel().Height();
1708 if ( nTopHeight < 0 ) nTopHeight = 0;
1709 SCROW nNewDelta = nOldDelta + aViewData.CellsAtY( nOldDelta, 1, SC_SPLIT_TOP,
1710 static_cast<sal_uInt16>(nTopHeight) );
1712 if ( nNewDelta > rDoc.MaxRow() )
1713 nNewDelta = rDoc.MaxRow();
1714 aViewData.SetPosY( SC_SPLIT_BOTTOM, nNewDelta );
1715 if ( nNewDelta > aViewData.GetCurY() )
1718 else
1721 }
1722
1723 // Form Layer needs to know the visible part of all windows
1724 // that is why MapMode must already be correct here
1725 for (VclPtr<ScGridWindow> & pWin : pGridWin)
1726 if (pWin)
1727 pWin->SetMapMode( pWin->GetDrawMapMode() );
1728 SetNewVisArea();
1729
1730 PaintGrid();
1731 PaintLeft();
1732
1734}
1735
1737{
1739 SCCOL nCol = aViewData.GetCurX();
1740 SCROW nRow = aViewData.GetCurY();
1741 SCTAB nTab = aViewData.GetTabNo();
1742 tools::Long nPosX = 0;
1743 for (SCCOL i=0; i<nCol; i++)
1744 nPosX += rDoc.GetColWidth(i,nTab);
1746 if ( rDoc.IsNegativePage( nTab ) )
1747 nPosX = -nPosX;
1748 tools::Long nPosY = rDoc.GetRowHeight( 0, nRow-1, nTab);
1750 return Point(nPosX,nPosY);
1751}
1752
1753Point ScTabView::GetChartInsertPos( const Size& rSize, const ScRange& rCellRange )
1754{
1755 Point aInsertPos;
1756 const tools::Long nBorder = 100; // leave 1mm for border
1757 tools::Long nNeededWidth = rSize.Width() + 2 * nBorder;
1758 tools::Long nNeededHeight = rSize.Height() + 2 * nBorder;
1759
1760 // use the active window, or lower/right if frozen (as in CalcZoom)
1761 ScSplitPos eUsedPart = aViewData.GetActivePart();
1763 eUsedPart = (WhichV(eUsedPart)==SC_SPLIT_TOP) ? SC_SPLIT_TOPRIGHT : SC_SPLIT_BOTTOMRIGHT;
1765 eUsedPart = (WhichH(eUsedPart)==SC_SPLIT_LEFT) ? SC_SPLIT_BOTTOMLEFT : SC_SPLIT_BOTTOMRIGHT;
1766
1767 ScGridWindow* pWin = pGridWin[eUsedPart].get();
1768 OSL_ENSURE( pWin, "Window not found" );
1769 if (pWin)
1770 {
1771 ActivatePart( eUsedPart );
1772
1773 // get the visible rectangle in logic units
1774 bool bLOKActive = comphelper::LibreOfficeKit::isActive();
1775 MapMode aDrawMode = pWin->GetDrawMapMode();
1776 tools::Rectangle aVisible(
1777 bLOKActive ?
1778 OutputDevice::LogicToLogic( aViewData.getLOKVisibleArea(), MapMode(MapUnit::MapTwip), MapMode(MapUnit::Map100thMM) )
1779 : pWin->PixelToLogic( tools::Rectangle( Point(0,0), pWin->GetOutputSizePixel() ), aDrawMode ) );
1780
1782 SCTAB nTab = aViewData.GetTabNo();
1783 bool bLayoutRTL = rDoc.IsLayoutRTL( nTab );
1784 tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
1785
1786 tools::Long nDocX = o3tl::convert(rDoc.GetColOffset(rDoc.MaxCol() + 1, nTab), o3tl::Length::twip, o3tl::Length::mm100) * nLayoutSign;
1788
1789 if ( aVisible.Left() * nLayoutSign > nDocX * nLayoutSign )
1790 aVisible.SetLeft( nDocX );
1791 if ( aVisible.Right() * nLayoutSign > nDocX * nLayoutSign )
1792 aVisible.SetRight( nDocX );
1793 if ( aVisible.Top() > nDocY )
1794 aVisible.SetTop( nDocY );
1795 if ( aVisible.Bottom() > nDocY )
1796 aVisible.SetBottom( nDocY );
1797
1798 // get the logic position of the selection
1799
1800 tools::Rectangle aSelection = rDoc.GetMMRect( rCellRange.aStart.Col(), rCellRange.aStart.Row(),
1801 rCellRange.aEnd.Col(), rCellRange.aEnd.Row(), nTab );
1802
1803 if (bLOKActive && bLayoutRTL)
1804 {
1805 // In this case we operate in negative X coordinates. The rectangle aSelection already
1806 // has negative X coordinates. So the x coordinates in the rectangle aVisible(from getLOKVisibleArea)
1807 // need be negated to match.
1808 aVisible = tools::Rectangle(-aVisible.Right(), aVisible.Top(), -aVisible.Left(), aVisible.Bottom());
1809 }
1810
1811 tools::Long nLeftSpace = aSelection.Left() - aVisible.Left();
1812 tools::Long nRightSpace = aVisible.Right() - aSelection.Right();
1813 tools::Long nTopSpace = aSelection.Top() - aVisible.Top();
1814 tools::Long nBottomSpace = aVisible.Bottom() - aSelection.Bottom();
1815
1816 bool bFitLeft = ( nLeftSpace >= nNeededWidth );
1817 bool bFitRight = ( nRightSpace >= nNeededWidth );
1818
1819 if ( bFitLeft || bFitRight )
1820 {
1821 // first preference: completely left or right of the selection
1822
1823 // if both fit, prefer left in RTL mode, right otherwise
1824 bool bPutLeft = bFitLeft && ( bLayoutRTL || !bFitRight );
1825
1826 if ( bPutLeft )
1827 aInsertPos.setX( aSelection.Left() - nNeededWidth );
1828 else
1829 aInsertPos.setX( aSelection.Right() + 1 );
1830
1831 // align with top of selection (is moved again if it doesn't fit)
1832 aInsertPos.setY( std::max( aSelection.Top(), aVisible.Top() ) );
1833 }
1834 else if ( nTopSpace >= nNeededHeight || nBottomSpace >= nNeededHeight )
1835 {
1836 // second preference: completely above or below the selection
1837 if ( nBottomSpace > nNeededHeight ) // bottom is preferred
1838 aInsertPos.setY( aSelection.Bottom() + 1 );
1839 else
1840 aInsertPos.setY( aSelection.Top() - nNeededHeight );
1841
1842 // align with (logic) left edge of selection (moved again if it doesn't fit)
1843 if ( bLayoutRTL )
1844 aInsertPos.setX( std::min( aSelection.Right(), aVisible.Right() ) - nNeededWidth + 1 );
1845 else
1846 aInsertPos.setX( std::max( aSelection.Left(), aVisible.Left() ) );
1847 }
1848 else
1849 {
1850 // place to the (logic) right of the selection and move so it fits
1851
1852 if ( bLayoutRTL )
1853 aInsertPos.setX( aSelection.Left() - nNeededWidth );
1854 else
1855 aInsertPos.setX( aSelection.Right() + 1 );
1856 aInsertPos.setY( std::max( aSelection.Top(), aVisible.Top() ) );
1857 }
1858
1859 // move the position if the object doesn't fit in the screen
1860
1861 tools::Rectangle aCompareRect( aInsertPos, Size( nNeededWidth, nNeededHeight ) );
1862 if ( aCompareRect.Right() > aVisible.Right() )
1863 aInsertPos.AdjustX( -(aCompareRect.Right() - aVisible.Right()) );
1864 if ( aCompareRect.Bottom() > aVisible.Bottom() )
1865 aInsertPos.AdjustY( -(aCompareRect.Bottom() - aVisible.Bottom()) );
1866
1867 if ( aInsertPos.X() < aVisible.Left() )
1868 aInsertPos.setX( aVisible.Left() );
1869 if ( aInsertPos.Y() < aVisible.Top() )
1870 aInsertPos.setY( aVisible.Top() );
1871
1872 // nNeededWidth / nNeededHeight includes all borders - move aInsertPos to the
1873 // object position, inside the border
1874
1875 aInsertPos.AdjustX(nBorder );
1876 aInsertPos.AdjustY(nBorder );
1877 }
1878 return aInsertPos;
1879}
1880
1881Point ScTabView::GetChartDialogPos( const Size& rDialogSize, const tools::Rectangle& rLogicChart )
1882{
1883 // rDialogSize must be in pixels, rLogicChart in 1/100 mm. Return value is in pixels.
1884
1885 Point aRet;
1886
1887 // use the active window, or lower/right if frozen (as in CalcZoom)
1888 ScSplitPos eUsedPart = aViewData.GetActivePart();
1890 eUsedPart = (WhichV(eUsedPart)==SC_SPLIT_TOP) ? SC_SPLIT_TOPRIGHT : SC_SPLIT_BOTTOMRIGHT;
1892 eUsedPart = (WhichH(eUsedPart)==SC_SPLIT_LEFT) ? SC_SPLIT_BOTTOMLEFT : SC_SPLIT_BOTTOMRIGHT;
1893
1894 ScGridWindow* pWin = pGridWin[eUsedPart].get();
1895 OSL_ENSURE( pWin, "Window not found" );
1896 if (pWin)
1897 {
1898 MapMode aDrawMode = pWin->GetDrawMapMode();
1899 tools::Rectangle aObjPixel = pWin->LogicToPixel( rLogicChart, aDrawMode );
1900 tools::Rectangle aObjAbs( pWin->OutputToAbsoluteScreenPixel( aObjPixel.TopLeft() ),
1901 pWin->OutputToAbsoluteScreenPixel( aObjPixel.BottomRight() ) );
1902
1903 tools::Rectangle aDesktop = pWin->GetDesktopRectPixel();
1904 Size aSpace = pWin->LogicToPixel( Size(8, 12), MapMode(MapUnit::MapAppFont));
1905
1907 SCTAB nTab = aViewData.GetTabNo();
1908 bool bLayoutRTL = rDoc.IsLayoutRTL( nTab );
1909
1910 bool bCenterHor = false;
1911
1912 if ( aDesktop.Bottom() - aObjAbs.Bottom() >= rDialogSize.Height() + aSpace.Height() )
1913 {
1914 // first preference: below the chart
1915
1916 aRet.setY( aObjAbs.Bottom() + aSpace.Height() );
1917 bCenterHor = true;
1918 }
1919 else if ( aObjAbs.Top() - aDesktop.Top() >= rDialogSize.Height() + aSpace.Height() )
1920 {
1921 // second preference: above the chart
1922
1923 aRet.setY( aObjAbs.Top() - rDialogSize.Height() - aSpace.Height() );
1924 bCenterHor = true;
1925 }
1926 else
1927 {
1928 bool bFitLeft = ( aObjAbs.Left() - aDesktop.Left() >= rDialogSize.Width() + aSpace.Width() );
1929 bool bFitRight = ( aDesktop.Right() - aObjAbs.Right() >= rDialogSize.Width() + aSpace.Width() );
1930
1931 if ( bFitLeft || bFitRight )
1932 {
1933 // if both fit, prefer right in RTL mode, left otherwise
1934 bool bPutRight = bFitRight && ( bLayoutRTL || !bFitLeft );
1935 if ( bPutRight )
1936 aRet.setX( aObjAbs.Right() + aSpace.Width() );
1937 else
1938 aRet.setX( aObjAbs.Left() - rDialogSize.Width() - aSpace.Width() );
1939
1940 // center vertically
1941 aRet.setY( aObjAbs.Top() + ( aObjAbs.GetHeight() - rDialogSize.Height() ) / 2 );
1942 }
1943 else
1944 {
1945 // doesn't fit on any edge - put at the bottom of the screen
1946 aRet.setY( aDesktop.Bottom() - rDialogSize.Height() );
1947 bCenterHor = true;
1948 }
1949 }
1950 if ( bCenterHor )
1951 aRet.setX( aObjAbs.Left() + ( aObjAbs.GetWidth() - rDialogSize.Width() ) / 2 );
1952
1953 // limit to screen (centering might lead to invalid positions)
1954 if ( aRet.X() + rDialogSize.Width() - 1 > aDesktop.Right() )
1955 aRet.setX( aDesktop.Right() - rDialogSize.Width() + 1 );
1956 if ( aRet.X() < aDesktop.Left() )
1957 aRet.setX( aDesktop.Left() );
1958 if ( aRet.Y() + rDialogSize.Height() - 1 > aDesktop.Bottom() )
1959 aRet.setY( aDesktop.Bottom() - rDialogSize.Height() + 1 );
1960 if ( aRet.Y() < aDesktop.Top() )
1961 aRet.setY( aDesktop.Top() );
1962 }
1963
1964 return aRet;
1965}
1966
1967void ScTabView::LockModifiers( sal_uInt16 nModifiers )
1968{
1969 pSelEngine->LockModifiers( nModifiers );
1970 pHdrSelEng->LockModifiers( nModifiers );
1971}
1972
1974{
1975 return pSelEngine->GetLockedModifiers();
1976}
1977
1979{
1980 Point aPos;
1981 ScGridWindow* pWin = GetActiveWin();
1982
1983 if ( pWin )
1984 aPos = pWin->GetMousePosPixel();
1985
1986 return aPos;
1987}
1988
1989void ScTabView::FreezeSplitters( bool bFreeze, SplitMethod eSplitMethod, SCCOLROW nFreezeIndex)
1990{
1991 if ((eSplitMethod == SC_SPLIT_METHOD_COL || eSplitMethod == SC_SPLIT_METHOD_ROW) && nFreezeIndex < 0)
1992 nFreezeIndex = 0;
1993
1996
1998 if ( eOldV != SC_SPLIT_NONE )
2000 vcl::Window* pWin = pGridWin[ePos];
2001
2002 bool bLayoutRTL = aViewData.GetDocument().IsLayoutRTL( aViewData.GetTabNo() );
2003 bool bUpdateFix = false;
2004
2005 if ( bFreeze )
2006 {
2007 Point aWinStart = pWin->GetPosPixel();
2009
2010 Point aSplit;
2011 SCCOL nPosX = 1;
2012 SCROW nPosY = 1;
2013 if (eOldV != SC_SPLIT_NONE || eOldH != SC_SPLIT_NONE)
2014 {
2015 if ( eOldV != SC_SPLIT_NONE && (eSplitMethod == SC_SPLIT_METHOD_ROW || eSplitMethod == SC_SPLIT_METHOD_CURSOR))
2016 aSplit.setY( aViewData.GetVSplitPos() - aWinStart.Y() );
2017
2018 if ( eOldH != SC_SPLIT_NONE && (eSplitMethod == SC_SPLIT_METHOD_COL || eSplitMethod == SC_SPLIT_METHOD_CURSOR))
2019 {
2020 tools::Long nSplitPos = aViewData.GetHSplitPos();
2021 if ( bLayoutRTL )
2022 nSplitPos = pFrameWin->GetOutputSizePixel().Width() - nSplitPos - 1;
2023 aSplit.setX( nSplitPos - aWinStart.X() );
2024 }
2025
2026 aViewData.GetPosFromPixel( aSplit.X(), aSplit.Y(), ePos, nPosX, nPosY );
2027 bool bLeft;
2028 bool bTop;
2029 aViewData.GetMouseQuadrant( aSplit, ePos, nPosX, nPosY, bLeft, bTop );
2030 if (eSplitMethod == SC_SPLIT_METHOD_COL)
2031 nPosX = static_cast<SCCOL>(nFreezeIndex);
2032 else if (!bLeft)
2033 ++nPosX;
2034 if (eSplitMethod == SC_SPLIT_METHOD_ROW)
2035 nPosY = static_cast<SCROW>(nFreezeIndex);
2036 else if (!bTop)
2037 ++nPosY;
2038 }
2039 else
2040 {
2041 switch(eSplitMethod)
2042 {
2044 {
2045 nPosX = 0;
2046 nPosY = static_cast<SCROW>(nFreezeIndex);
2047 }
2048 break;
2050 {
2051 nPosX = static_cast<SCCOL>(nFreezeIndex);
2052 nPosY = 0;
2053 }
2054 break;
2056 {
2057 nPosX = aViewData.GetCurX();
2058 nPosY = aViewData.GetCurY();
2059 }
2060 break;
2061 }
2062 }
2063
2065 SCROW nBottomPos = nPosY;
2067 SCCOL nRightPos = nPosX;
2068
2069 if (eSplitMethod == SC_SPLIT_METHOD_ROW || eSplitMethod == SC_SPLIT_METHOD_CURSOR)
2070 {
2071 if (eOldV != SC_SPLIT_NONE)
2072 {
2073 nTopPos = aViewData.GetPosY(SC_SPLIT_TOP);
2074 if (aViewData.GetPosY(SC_SPLIT_BOTTOM) > nBottomPos)
2075 nBottomPos = aViewData.GetPosY(SC_SPLIT_BOTTOM);
2076 }
2077 aSplit = aViewData.GetScrPos(nPosX, nPosY, ePos, true);
2078 if (aSplit.Y() > 0)
2079 {
2081 aViewData.SetVSplitPos(aSplit.Y() + aWinStart.Y());
2082 aViewData.SetFixPosY(nPosY);
2083
2084 aViewData.SetPosY(SC_SPLIT_TOP, nTopPos);
2085 aViewData.SetPosY(SC_SPLIT_BOTTOM, nBottomPos);
2086 }
2087 else if (nPosY == 1 && eSplitMethod == SC_SPLIT_METHOD_ROW)
2088 {
2089 // Freeze first row, but row 1 is not visible on screen now == special handling
2091 aViewData.SetFixPosY(nPosY);
2092
2094 bUpdateFix = true;
2095 }
2096 else
2098 }
2099
2100 if (eSplitMethod == SC_SPLIT_METHOD_COL || eSplitMethod == SC_SPLIT_METHOD_CURSOR)
2101 {
2102 if (eOldH != SC_SPLIT_NONE)
2103 {
2104 if (aViewData.GetPosX(SC_SPLIT_RIGHT) > nRightPos)
2105 nRightPos = aViewData.GetPosX(SC_SPLIT_RIGHT);
2106 }
2107 aSplit = aViewData.GetScrPos( nPosX, nPosY, ePos, true );
2108 if (nPosX > aViewData.GetPosX(SC_SPLIT_LEFT)) // (aSplit.X() > 0) doesn't work for RTL
2109 {
2110 tools::Long nSplitPos = aSplit.X() + aWinStart.X();
2111 if ( bLayoutRTL )
2112 nSplitPos = pFrameWin->GetOutputSizePixel().Width() - nSplitPos - 1;
2113
2115 aViewData.SetHSplitPos( nSplitPos );
2116 aViewData.SetFixPosX( nPosX );
2117
2118 aViewData.SetPosX(SC_SPLIT_LEFT, nLeftPos);
2119 aViewData.SetPosX(SC_SPLIT_RIGHT, nRightPos);
2120 }
2121 else if (nPosX == 1 && eSplitMethod == SC_SPLIT_METHOD_COL)
2122 {
2123 // Freeze first column, but col A is not visible on screen now == special handling
2125 aViewData.SetFixPosX(nPosX);
2126
2129 bUpdateFix = true;
2130 }
2131 else
2133 }
2134 }
2135 else // unfreeze
2136 {
2137 if ( eOldH == SC_SPLIT_FIX )
2139 if ( eOldV == SC_SPLIT_FIX )
2141 }
2142
2143 // Form Layer needs to know the visible part of all windows
2144 // that is why MapMode must already be correct here
2146 if (p)
2147 p->SetMapMode( p->GetDrawMapMode() );
2148 SetNewVisArea();
2149
2150 RepeatResize(bUpdateFix);
2151
2152 UpdateShow();
2153 PaintLeft();
2154 PaintTop();
2155 PaintGrid();
2156
2157 // SC_FOLLOW_NONE: only update active part
2160
2162}
2163
2165{
2168 DoHSplit( 0 );
2169 DoVSplit( 0 );
2170 RepeatResize();
2171}
2172
2174{
2178 vcl::Window* pWin = pGridWin[ePos];
2179 Point aWinStart = pWin->GetPosPixel();
2180
2181 SCCOL nPosX = aViewData.GetCurX();
2182 SCROW nPosY = aViewData.GetCurY();
2183 Point aSplit = aViewData.GetScrPos( nPosX, nPosY, ePos, true );
2184 if ( nPosX > 0 )
2185 DoHSplit( aSplit.X() + aWinStart.X() );
2186 else
2187 DoHSplit( 0 );
2188 if ( nPosY > 0 )
2189 DoVSplit( aSplit.Y() + aWinStart.Y() );
2190 else
2191 DoVSplit( 0 );
2192 RepeatResize();
2193}
2194
2195void ScTabView::SplitAtPixel( const Point& rPixel )
2196{
2197 // pixel is relative to the entire View, not to the first GridWin
2198
2199 if ( rPixel.X() > 0 )
2200 DoHSplit( rPixel.X() );
2201 else
2202 DoHSplit( 0 );
2203 if ( rPixel.Y() > 0 )
2204 DoVSplit( rPixel.Y() );
2205 else
2206 DoVSplit( 0 );
2207 RepeatResize();
2208}
2209
2211{
2212 SfxBindings& rBindings = aViewData.GetBindings();
2213 rBindings.Invalidate( SID_WINDOW_SPLIT );
2214 rBindings.Invalidate( SID_WINDOW_FIX );
2215 rBindings.Invalidate( SID_WINDOW_FIX_COL );
2216 rBindings.Invalidate( SID_WINDOW_FIX_ROW );
2217
2220}
2221
2223{
2224 // Draw-MapMode must be set for Controls when VisAreaChanged
2225 // (also when Edit-MapMode is set instead)
2226 MapMode aOldMode[4];
2227 MapMode aDrawMode[4];
2228 sal_uInt16 i;
2229 for (i=0; i<4; i++)
2230 if (pGridWin[i])
2231 {
2232 aOldMode[i] = pGridWin[i]->GetMapMode();
2233 aDrawMode[i] = pGridWin[i]->GetDrawMapMode();
2234 if (aDrawMode[i] != aOldMode[i])
2235 pGridWin[i]->SetMapMode(aDrawMode[i]);
2236 }
2237
2239 if (pActive)
2241 if (pDrawView)
2242 pDrawView->VisAreaChanged(nullptr); // no window passed on -> for all windows
2243
2244 UpdateAllOverlays(); // #i79909# with drawing MapMode set
2245
2246 for (i=0; i<4; i++)
2247 if (pGridWin[i] && aDrawMode[i] != aOldMode[i])
2248 {
2249 pGridWin[i]->flushOverlayManager(); // #i79909# flush overlays before switching to edit MapMode
2250 pGridWin[i]->SetMapMode(aOldMode[i]);
2251 }
2252
2254 SfxFrame& rFrame = rViewFrame.GetFrame();
2255 css::uno::Reference<css::frame::XController> xController = rFrame.GetController();
2256 if (xController.is())
2257 {
2258 ScTabViewObj* pImp = dynamic_cast<ScTabViewObj*>( xController.get() );
2259 if (pImp)
2260 pImp->VisAreaChanged();
2261 }
2263 aViewData.GetViewShell()->BroadcastAccessibility(SfxHint(SfxHintId::ScAccVisAreaChanged));
2264}
2265
2267{
2269 SCCOL nCol = aViewData.GetCurX();
2270 SCROW nRow = aViewData.GetCurY();
2271 if (pWin)
2272 return pWin->GetDPFieldOrientation( nCol, nRow ) == sheet::DataPilotFieldOrientation_PAGE;
2273
2274 return false;
2275}
2276
2278{
2280 SCCOL nCol = aViewData.GetCurX();
2281 SCROW nRow = aViewData.GetCurY();
2282
2283 if (!pWin)
2284 return;
2285
2286 switch (pWin->GetDPFieldOrientation(nCol, nRow))
2287 {
2288 case sheet::DataPilotFieldOrientation_PAGE:
2289 // #i36598# If the cursor is on a page field's data cell,
2290 // no meaningful input is possible anyway, so this function
2291 // can be used to select a page field entry.
2292 pWin->LaunchPageFieldMenu( nCol, nRow );
2293 return;
2294 case sheet::DataPilotFieldOrientation_COLUMN:
2295 case sheet::DataPilotFieldOrientation_ROW:
2296 pWin->LaunchDPFieldMenu( nCol, nRow );
2297 return;
2298 default:
2299 ;
2300 }
2301
2302 // Do autofilter if the current cell has autofilter button. Otherwise do
2303 // a normal data select popup.
2304 const ScMergeFlagAttr* pAttr =
2306 nCol, nRow, aViewData.GetTabNo(), ATTR_MERGE_FLAG);
2307
2308 if (pAttr->HasAutoFilter())
2309 pWin->LaunchAutoFilterMenu(nCol, nRow);
2310 else
2311 pWin->LaunchDataSelectMenu(nCol, nRow);
2312}
2313
2315{
2316 aHScrollLeft->EnableInput(bFlag);
2317 aHScrollRight->EnableInput(bFlag);
2318 aVScrollBottom->EnableInput(bFlag);
2319 aVScrollTop->EnableInput(bFlag);
2320
2321 // from here on dynamically created ones
2322
2323 if(pTabControl!=nullptr) pTabControl->EnableInput(bFlag);
2324
2325 for (auto& p : pGridWin)
2326 if (p)
2327 p->EnableInput(bFlag, false);
2328 for (auto& p : pColBar)
2329 if (p)
2330 p->EnableInput(bFlag, false);
2331 for (auto& p : pRowBar)
2332 if (p)
2333 p->EnableInput(bFlag, false);
2334}
2335
2336void ScTabView::EnableAutoSpell( bool bEnable )
2337{
2338 if (bEnable)
2340 std::make_shared<sc::SpellCheckContext>(&aViewData.GetDocument(),
2342 else
2343 mpSpellCheckCxt.reset();
2344
2345 for (VclPtr<ScGridWindow> & pWin : pGridWin)
2346 {
2347 if (!pWin)
2348 continue;
2349
2350 pWin->SetAutoSpellContext(mpSpellCheckCxt);
2351 }
2352}
2353
2355{
2356 for (VclPtr<ScGridWindow> & pWin : pGridWin)
2357 {
2358 if (!pWin)
2359 continue;
2360
2361 pWin->ResetAutoSpell();
2362 }
2363}
2364
2366{
2367 for (VclPtr<ScGridWindow> & pWin : pGridWin)
2368 {
2369 if (!pWin)
2370 continue;
2371
2372 pWin->ResetAutoSpellForContentChange();
2373 }
2374}
2375
2376void ScTabView::SetAutoSpellData( SCCOL nPosX, SCROW nPosY, const std::vector<editeng::MisspellRanges>* pRanges )
2377{
2378 for (VclPtr<ScGridWindow> & pWin: pGridWin)
2379 {
2380 if (!pWin)
2381 continue;
2382
2383 pWin->SetAutoSpellData(nPosX, nPosY, pRanges);
2384 }
2385}
2386
2387namespace
2388{
2389
2390tools::Long lcl_GetRowHeightPx(const ScViewData &rViewData, SCROW nRow, SCTAB nTab)
2391{
2392 const sal_uInt16 nSize = rViewData.GetDocument().GetRowHeight(nRow, nTab);
2393 return ScViewData::ToPixel(nSize, rViewData.GetPPTY());
2394}
2395
2396tools::Long lcl_GetColWidthPx(const ScViewData &rViewData, SCCOL nCol, SCTAB nTab)
2397{
2398 const sal_uInt16 nSize = rViewData.GetDocument().GetColWidth(nCol, nTab);
2399 return ScViewData::ToPixel(nSize, rViewData.GetPPTX());
2400}
2401
2402void lcl_getGroupIndexes(const ScOutlineArray& rArray, SCCOLROW nStart, SCCOLROW nEnd, std::vector<size_t>& rGroupIndexes)
2403{
2404 rGroupIndexes.clear();
2405 const size_t nGroupDepth = rArray.GetDepth();
2406 rGroupIndexes.resize(nGroupDepth);
2407
2408 // Get first group per each level
2409 for (size_t nLevel = 0; nLevel < nGroupDepth; ++nLevel)
2410 {
2411 if (rArray.GetCount(nLevel))
2412 {
2413 // look for a group inside the [nStartRow+1, nEndRow] range
2414 size_t nIndex;
2415 bool bFound = rArray.GetEntryIndexInRange(nLevel, nStart + 1, nEnd, nIndex);
2416 if (bFound)
2417 {
2418 if (nIndex > 0)
2419 {
2420 // is there a previous group not inside the range
2421 // but anyway intersecting it ?
2422 const ScOutlineEntry* pPrevEntry = rArray.GetEntry(nLevel, nIndex - 1);
2423 if (pPrevEntry && nStart < pPrevEntry->GetEnd())
2424 {
2425 --nIndex;
2426 }
2427 }
2428 }
2429 else
2430 {
2431 // look for a group which contains nStartRow+1
2432 bFound = rArray.GetEntryIndex(nLevel, nStart + 1, nIndex);
2433 if (!bFound)
2434 {
2435 // look for a group which contains nEndRow
2436 bFound = rArray.GetEntryIndex(nLevel, nEnd, nIndex);
2437 }
2438 }
2439
2440 if (bFound)
2441 {
2442 // skip groups with no visible control
2443 bFound = false;
2444 while (nIndex < rArray.GetCount(nLevel))
2445 {
2446 const ScOutlineEntry* pEntry = rArray.GetEntry(nLevel, nIndex);
2447 if (pEntry && pEntry->IsVisible())
2448 {
2449 bFound = true;
2450 break;
2451 }
2452 if (pEntry && pEntry->GetStart() > nEnd)
2453 {
2454 break;
2455 }
2456 ++nIndex;
2457 }
2458 }
2459
2460 rGroupIndexes[nLevel] = bFound ? nIndex : -1;
2461 }
2462 }
2463}
2464
2465void lcl_createGroupsData(
2466 SCCOLROW nHeaderIndex, SCCOLROW nEnd, tools::Long nSizePx, tools::Long nTotalPx,
2467 const ScOutlineArray& rArray, std::vector<size_t>& rGroupIndexes,
2468 std::vector<tools::Long>& rGroupStartPositions, OStringBuffer& rGroupsBuffer)
2469{
2470 const size_t nGroupDepth = rArray.GetDepth();
2471 // create string data for group controls
2472 for (size_t nLevel = nGroupDepth - 1; nLevel != size_t(-1); --nLevel)
2473 {
2474 size_t nIndex = rGroupIndexes[nLevel];
2475 if (nIndex == size_t(-1))
2476 continue;
2477 const ScOutlineEntry* pEntry = rArray.GetEntry(nLevel, nIndex);
2478 if (pEntry)
2479 {
2480 if (nHeaderIndex < pEntry->GetStart())
2481 {
2482 continue;
2483 }
2484 else if (nHeaderIndex == pEntry->GetStart())
2485 {
2486 rGroupStartPositions[nLevel] = nTotalPx - nSizePx;
2487 }
2488 else if (nHeaderIndex > pEntry->GetStart() && (nHeaderIndex < nEnd && nHeaderIndex < pEntry->GetEnd()))
2489 {
2490 // for handling group started before the current view range
2491 if (rGroupStartPositions[nLevel] < 0)
2492 rGroupStartPositions[nLevel] *= -1;
2493 break;
2494 }
2495 if (nHeaderIndex == pEntry->GetEnd() || (nHeaderIndex == nEnd && rGroupStartPositions[nLevel] != -1))
2496 {
2497 // nHeaderIndex is the end col/row of a group or is the last col/row and a group started and not yet ended
2498
2499 // append a new group control data
2500 auto len = rGroupsBuffer.getLength();
2501 if (len && rGroupsBuffer[len-1] == '}')
2502 {
2503 rGroupsBuffer.append(", ");
2504 }
2505
2506 bool bGroupHidden = pEntry->IsHidden();
2507
2508 rGroupsBuffer.append(
2509 "{ \"level\": " + OString::number(nLevel + 1) + ", "
2510 "\"index\": " + OString::number(nIndex) + ", "
2511 "\"startPos\": " + OString::number(rGroupStartPositions[nLevel]) + ", "
2512 "\"endPos\": " + OString::number(nTotalPx) + ", "
2513 "\"hidden\": " + OString::number(bGroupHidden ? 1 : 0) + " }");
2514
2515 // look for the next visible group control at level nLevel
2516 bool bFound = false;
2517 ++nIndex;
2518 while (nIndex < rArray.GetCount(nLevel))
2519 {
2520 pEntry = rArray.GetEntry(nLevel, nIndex);
2521 if (pEntry && pEntry->IsVisible())
2522 {
2523 bFound = true;
2524 break;
2525 }
2526 if (pEntry && pEntry->GetStart() > nEnd)
2527 {
2528 break;
2529 }
2530 ++nIndex;
2531 }
2532 rGroupIndexes[nLevel] = bFound ? nIndex : -1;
2533 rGroupStartPositions[nLevel] = -1;
2534 }
2535 }
2536 }
2537}
2538
2539class ScRangeProvider
2540{
2541public:
2542 ScRangeProvider(const tools::Rectangle& rArea, bool bInPixels,
2543 ScViewData& rViewData):
2544 mrViewData(rViewData)
2545 {
2546 tools::Rectangle aAreaPx = bInPixels ? rArea :
2547 tools::Rectangle(rArea.Left() * mrViewData.GetPPTX(),
2548 rArea.Top() * mrViewData.GetPPTY(),
2549 rArea.Right() * mrViewData.GetPPTX(),
2550 rArea.Bottom() * mrViewData.GetPPTY());
2551 calculateBounds(aAreaPx);
2552 }
2553
2554 const ScRange& getCellRange() const
2555 {
2556 return maRange;
2557 }
2558
2559 void getColPositions(tools::Long& rStartColPos, tools::Long& rEndColPos) const
2560 {
2561 rStartColPos = maBoundPositions.Left();
2562 rEndColPos = maBoundPositions.Right();
2563 }
2564
2565 void getRowPositions(tools::Long& rStartRowPos, tools::Long& rEndRowPos) const
2566 {
2567 rStartRowPos = maBoundPositions.Top();
2568 rEndRowPos = maBoundPositions.Bottom();
2569 }
2570
2571private:
2572 void calculateBounds(const tools::Rectangle& rAreaPx)
2573 {
2574 tools::Long nLeftPx = 0, nRightPx = 0;
2575 SCCOLROW nStartCol = -1, nEndCol = -1;
2576 calculateDimensionBounds(rAreaPx.Left(), rAreaPx.Right(), true,
2577 nStartCol, nEndCol, nLeftPx, nRightPx,
2578 mnEnlargeX, mrViewData);
2579 tools::Long nTopPx = 0, nBottomPx = 0;
2580 SCCOLROW nStartRow = -1, nEndRow = -1;
2581 calculateDimensionBounds(rAreaPx.Top(), rAreaPx.Bottom(), false,
2582 nStartRow, nEndRow, nTopPx, nBottomPx,
2583 mnEnlargeY, mrViewData);
2584
2585 maRange.aStart.Set(nStartCol, nStartRow, mrViewData.GetTabNo());
2586 maRange.aEnd.Set(nEndCol, nEndRow, mrViewData.GetTabNo());
2587
2588 maBoundPositions.SetLeft(nLeftPx);
2589 maBoundPositions.SetRight(nRightPx);
2590 maBoundPositions.SetTop(nTopPx);
2591 maBoundPositions.SetBottom(nBottomPx);
2592 }
2593
2594 // All positions are in pixels.
2595 static void calculateDimensionBounds(const tools::Long nStartPos, const tools::Long nEndPos,
2596 bool bColumns, SCCOLROW& rStartIndex,
2597 SCCOLROW& rEndIndex, tools::Long& rBoundStart,
2598 tools::Long& rBoundEnd, SCCOLROW nEnlarge,
2599 ScViewData& rViewData)
2600 {
2601 ScPositionHelper& rPosHelper = bColumns ? rViewData.GetLOKWidthHelper() :
2602 rViewData.GetLOKHeightHelper();
2603 const auto& rStartNearest = rPosHelper.getNearestByPosition(nStartPos);
2604 const auto& rEndNearest = rPosHelper.getNearestByPosition(nEndPos);
2605
2606 ScBoundsProvider aBoundsProvider(rViewData, rViewData.GetTabNo(), bColumns);
2607 aBoundsProvider.Compute(rStartNearest, rEndNearest, nStartPos, nEndPos);
2608 aBoundsProvider.EnlargeBy(nEnlarge);
2609 if (bColumns)
2610 {
2611 SCCOL nStartCol = -1, nEndCol = -1;
2612 aBoundsProvider.GetStartIndexAndPosition(nStartCol, rBoundStart);
2613 aBoundsProvider.GetEndIndexAndPosition(nEndCol, rBoundEnd);
2614 rStartIndex = nStartCol;
2615 rEndIndex = nEndCol;
2616 }
2617 else
2618 {
2619 SCROW nStartRow = -1, nEndRow = -1;
2620 aBoundsProvider.GetStartIndexAndPosition(nStartRow, rBoundStart);
2621 aBoundsProvider.GetEndIndexAndPosition(nEndRow, rBoundEnd);
2622 rStartIndex = nStartRow;
2623 rEndIndex = nEndRow;
2624 }
2625 }
2626
2627private:
2628
2630 tools::Rectangle maBoundPositions;
2631 ScViewData& mrViewData;
2632 static const SCCOLROW mnEnlargeX = 2;
2633 static const SCCOLROW mnEnlargeY = 2;
2634};
2635
2636void lcl_ExtendTiledDimension(bool bColumn, const SCCOLROW nEnd, const SCCOLROW nExtra,
2637 ScTabView& rTabView, ScViewData& rViewData)
2638{
2639 ScDocument& rDoc = rViewData.GetDocument();
2640 // If we are approaching current max tiled row/col, signal a size changed event
2641 // and invalidate the involved area
2642 SCCOLROW nMaxTiledIndex = bColumn ? rViewData.GetMaxTiledCol() : rViewData.GetMaxTiledRow();
2643 SCCOLROW nHardLimit = !bColumn ? MAXTILEDROW : rDoc.MaxCol();
2644
2645 if (nMaxTiledIndex >= nHardLimit)
2646 return;
2647
2648 if (nEnd <= nMaxTiledIndex - nExtra) // No need to extend.
2649 return;
2650
2651 ScDocShell* pDocSh = rViewData.GetDocShell();
2652 ScModelObj* pModelObj = pDocSh ? pDocSh->GetModel() : nullptr;
2653 Size aOldSize(0, 0);
2654 if (pModelObj)
2655 aOldSize = pModelObj->getDocumentSize();
2656
2657 SCCOLROW nNewMaxTiledIndex = std::min(std::max(nEnd, nMaxTiledIndex) + nExtra, nHardLimit);
2658
2659 if (bColumn)
2660 rViewData.SetMaxTiledCol(nNewMaxTiledIndex);
2661 else
2662 rViewData.SetMaxTiledRow(nNewMaxTiledIndex);
2663
2664 Size aNewSize(0, 0);
2665 if (pModelObj)
2666 aNewSize = pModelObj->getDocumentSize();
2667
2668 if (aOldSize == aNewSize)
2669 return;
2670
2671 if (!pDocSh)
2672 return;
2673
2674 // New area extended to the right/bottom of the sheet after last col/row
2675 // excluding overlapping area with aNewArea
2676 tools::Rectangle aNewArea = bColumn ?
2677 tools::Rectangle(aOldSize.getWidth(), 0, aNewSize.getWidth(), aNewSize.getHeight()):
2678 tools::Rectangle(0, aOldSize.getHeight(), aNewSize.getWidth(), aNewSize.getHeight());
2679
2680 // Only invalidate if spreadsheet has extended to the right or bottom
2681 if ((bColumn && aNewArea.getOpenWidth()) || (!bColumn && aNewArea.getOpenHeight()))
2682 {
2683 rTabView.UpdateSelectionOverlay();
2684 SfxLokHelper::notifyInvalidation(rViewData.GetViewShell(), &aNewArea);
2685 }
2686
2687 // Provide size in the payload, so clients don't have to query for that.
2689 ss << aNewSize.Width() << ", " << aNewSize.Height();
2690 OString sSize = ss.str().c_str();
2691 ScModelObj* pModel = comphelper::getFromUnoTunnel<ScModelObj>(
2692 rViewData.GetViewShell()->GetCurrentDocument());
2693 SfxLokHelper::notifyDocumentSizeChanged(rViewData.GetViewShell(), sSize, pModel, false);
2694}
2695
2696} // anonymous namespace
2697
2699{
2701
2702 if (rRectangle.IsEmpty())
2703 return;
2704
2705 bool bRangeHeaderSupport = comphelper::LibreOfficeKit::isRangeHeaders();
2706
2707 rJsonWriter.put("commandName", ".uno:ViewRowColumnHeaders");
2708
2709 SCTAB nTab = aViewData.GetTabNo();
2710 SCROW nStartRow = -1;
2711 SCROW nEndRow = -1;
2712 tools::Long nStartHeightPx = 0;
2713 SCCOL nStartCol = -1;
2714 SCCOL nEndCol = -1;
2715 tools::Long nStartWidthPx = 0;
2716
2717 tools::Rectangle aOldVisArea(
2720
2721 ScRangeProvider aRangeProvider(rRectangle, /* bInPixels */ false, aViewData);
2722 const ScRange& rCellRange = aRangeProvider.getCellRange();
2723
2725
2727
2728 if (rRectangle.Top() < rRectangle.Bottom())
2729 {
2730 SAL_INFO("sc.lok.header", "Row Header: compute start/end rows.");
2731 tools::Long nEndHeightPx = 0;
2732 nStartRow = rCellRange.aStart.Row();
2733 nEndRow = rCellRange.aEnd.Row();
2734 aRangeProvider.getRowPositions(nStartHeightPx, nEndHeightPx);
2735
2738 aViewData.GetLOKHeightHelper().insert(nStartRow, nStartHeightPx);
2739 aViewData.GetLOKHeightHelper().insert(nEndRow, nEndHeightPx);
2740
2741 mnLOKStartHeaderRow = nStartRow;
2742 mnLOKEndHeaderRow = nEndRow;
2743 }
2744
2745 sal_Int32 nVisibleRows = nEndRow - nStartRow;
2746 if (nVisibleRows < 25)
2747 nVisibleRows = 25;
2748
2749 SAL_INFO("sc.lok.header", "Row Header: visible rows: " << nVisibleRows);
2750
2751
2752 // Get row groups
2753 // per each level store the index of the first group intersecting
2754 // [nStartRow, nEndRow] range
2755
2756 const ScOutlineTable* pTable = rDoc.GetOutlineTable(nTab);
2757 const ScOutlineArray* pRowArray = pTable ? &(pTable->GetRowArray()) : nullptr;
2758 size_t nRowGroupDepth = 0;
2759 std::vector<size_t> aRowGroupIndexes;
2760 if (bRangeHeaderSupport && pTable)
2761 {
2762 nRowGroupDepth = pRowArray->GetDepth();
2763 lcl_getGroupIndexes(*pRowArray, nStartRow, nEndRow, aRowGroupIndexes);
2764 }
2765
2768 lcl_ExtendTiledDimension(/* bColumn */ false, nEndRow, nVisibleRows, *this, aViewData);
2769
2771
2772 tools::Long nTotalPixels = nStartHeightPx;
2773 tools::Long nPrevSizePx = -1;
2774 OStringBuffer aRowGroupsBuffer = "\"rowGroups\": [\n";
2775 {
2776 auto rowsNode = rJsonWriter.startArray("rows");
2777
2778 SAL_INFO("sc.lok.header", "Row Header: [create string data for rows]: start row: "
2779 << nStartRow << " start height: " << nTotalPixels);
2780
2781 if (nStartRow != nEndRow)
2782 {
2783 auto node = rJsonWriter.startStruct();
2784 rJsonWriter.put("text", nStartRow + 1);
2785 rJsonWriter.put("size", nTotalPixels);
2786 rJsonWriter.put("groupLevels", static_cast<sal_Int64>(nRowGroupDepth));
2787 }
2788
2789 std::vector<tools::Long> aRowGroupStartPositions(nRowGroupDepth, -nTotalPixels);
2790 for (SCROW nRow = nStartRow + 1; nRow <= nEndRow; ++nRow)
2791 {
2792 // nSize will be 0 for hidden rows.
2793 const tools::Long nSizePx = lcl_GetRowHeightPx(aViewData, nRow, nTab);
2794 nTotalPixels += nSizePx;
2795
2796 if (bRangeHeaderSupport && nRowGroupDepth > 0)
2797 {
2798 lcl_createGroupsData(nRow, nEndRow, nSizePx, nTotalPixels,
2799 *pRowArray, aRowGroupIndexes, aRowGroupStartPositions,
2800 aRowGroupsBuffer);
2801 }
2802
2803 if (bRangeHeaderSupport && nRow < nEndRow && nSizePx == nPrevSizePx)
2804 continue;
2805 nPrevSizePx = nSizePx;
2806
2807 auto node = rJsonWriter.startStruct();
2808 rJsonWriter.put("text", pRowBar[SC_SPLIT_BOTTOM]->GetEntryText(nRow));
2809 rJsonWriter.put("size", nTotalPixels);
2810 }
2811
2812 aRowGroupsBuffer.append("]");
2813 }
2814 if (nRowGroupDepth > 0)
2815 {
2816 aRowGroupsBuffer.append(",\n");
2817 rJsonWriter.putRaw(aRowGroupsBuffer);
2818 }
2820
2821
2823
2825
2826 if (rRectangle.Left() < rRectangle.Right())
2827 {
2828 SAL_INFO("sc.lok.header", "Column Header: compute start/end columns.");
2829 tools::Long nEndWidthPx = 0;
2830 nStartCol = rCellRange.aStart.Col();
2831 nEndCol = rCellRange.aEnd.Col();
2832 aRangeProvider.getColPositions(nStartWidthPx, nEndWidthPx);
2833
2836 aViewData.GetLOKWidthHelper().insert(nStartCol, nStartWidthPx);
2837 aViewData.GetLOKWidthHelper().insert(nEndCol, nEndWidthPx);
2838
2839 mnLOKStartHeaderCol = nStartCol;
2840 mnLOKEndHeaderCol = nEndCol;
2841 }
2842
2843 sal_Int32 nVisibleCols = nEndCol - nStartCol;
2844 if (nVisibleCols < 10)
2845 nVisibleCols = 10;
2846
2847
2848 // Get column groups
2849 // per each level store the index of the first group intersecting
2850 // [nStartCol, nEndCol] range
2851
2852 const ScOutlineArray* pColArray = pTable ? &(pTable->GetColArray()) : nullptr;
2853 size_t nColGroupDepth = 0;
2854 std::vector<size_t> aColGroupIndexes;
2855 if (bRangeHeaderSupport && pTable)
2856 {
2857 nColGroupDepth = pColArray->GetDepth();
2858 lcl_getGroupIndexes(*pColArray, nStartCol, nEndCol, aColGroupIndexes);
2859 }
2860
2863 lcl_ExtendTiledDimension(/* bColumn */ true, nEndCol, nVisibleCols, *this, aViewData);
2864
2866 OStringBuffer aColGroupsBuffer = "\"columnGroups\": [\n";
2867 {
2868 auto columnsNode = rJsonWriter.startArray("columns");
2869
2870 nTotalPixels = nStartWidthPx;
2871 SAL_INFO("sc.lok.header", "Col Header: [create string data for cols]: start col: "
2872 << nStartRow << " start width: " << nTotalPixels);
2873
2874 if (nStartCol != nEndCol)
2875 {
2876 auto node = rJsonWriter.startStruct();
2877 rJsonWriter.put("text", static_cast<sal_Int64>(nStartCol + 1));
2878 rJsonWriter.put("size", nTotalPixels);
2879 rJsonWriter.put("groupLevels", static_cast<sal_Int64>(nColGroupDepth));
2880 }
2881
2882 std::vector<tools::Long> aColGroupStartPositions(nColGroupDepth, -nTotalPixels);
2883 nPrevSizePx = -1;
2884 for (SCCOL nCol = nStartCol + 1; nCol <= nEndCol; ++nCol)
2885 {
2886 // nSize will be 0 for hidden columns.
2887 const tools::Long nSizePx = lcl_GetColWidthPx(aViewData, nCol, nTab);
2888 nTotalPixels += nSizePx;
2889
2890 if (bRangeHeaderSupport && nColGroupDepth > 0)
2891 lcl_createGroupsData(nCol, nEndCol, nSizePx, nTotalPixels,
2892 *pColArray, aColGroupIndexes,
2893 aColGroupStartPositions, aColGroupsBuffer);
2894
2895 if (bRangeHeaderSupport && nCol < nEndCol && nSizePx == nPrevSizePx)
2896 continue;
2897 nPrevSizePx = nSizePx;
2898
2899 OUString aText = bRangeHeaderSupport ?
2900 OUString::number(nCol + 1) : pColBar[SC_SPLIT_LEFT]->GetEntryText(nCol);
2901
2902 auto node = rJsonWriter.startStruct();
2903 rJsonWriter.put("text", aText);
2904 rJsonWriter.put("size", nTotalPixels);
2905 }
2906
2907 aColGroupsBuffer.append("]");
2908 }
2909 if (nColGroupDepth > 0)
2910 {
2911 aColGroupsBuffer.append(",\n");
2912 rJsonWriter.putRaw(aColGroupsBuffer);
2913 }
2915
2916 vcl::Region aNewVisArea(
2919 aNewVisArea.Exclude(aOldVisArea);
2920 tools::Rectangle aChangedArea = aNewVisArea.GetBoundRect();
2921 if (!aChangedArea.IsEmpty())
2922 {
2924 UpdateFormulas(aChangedArea.Left(), aChangedArea.Top(), aChangedArea.Right(), aChangedArea.Bottom());
2925 }
2926}
2927
2928OString ScTabView::getSheetGeometryData(bool bColumns, bool bRows, bool bSizes, bool bHidden,
2929 bool bFiltered, bool bGroups)
2930{
2932
2933 boost::property_tree::ptree aTree;
2934 aTree.put("commandName", ".uno:SheetGeometryData");
2935 aTree.put("maxtiledcolumn", rDoc.MaxCol());
2936 aTree.put("maxtiledrow", MAXTILEDROW);
2937
2938 auto getJSONString = [](const boost::property_tree::ptree& rTree) {
2939 std::stringstream aStream;
2940 boost::property_tree::write_json(aStream, rTree);
2941 return aStream.str();
2942 };
2943
2944 if ((!bSizes && !bHidden && !bFiltered && !bGroups) ||
2945 (!bColumns && !bRows))
2946 {
2947 return getJSONString(aTree).c_str();
2948 }
2949
2950 struct GeomEntry
2951 {
2953 const char* pKey;
2954 bool bEnabled;
2955 };
2956
2957 const GeomEntry aGeomEntries[] = {
2958 { SheetGeomType::SIZES, "sizes", bSizes },
2959 { SheetGeomType::HIDDEN, "hidden", bHidden },
2960 { SheetGeomType::FILTERED, "filtered", bFiltered },
2961 { SheetGeomType::GROUPS, "groups", bGroups }
2962 };
2963
2964 struct DimensionEntry
2965 {
2966 const char* pKey;
2967 bool bDimIsCol;
2968 bool bEnabled;
2969 };
2970
2971 const DimensionEntry aDimEntries[] = {
2972 { "columns", true, bColumns },
2973 { "rows", false, bRows }
2974 };
2975
2976 SCTAB nTab = aViewData.GetTabNo();
2977
2978 for (const auto& rDimEntry : aDimEntries)
2979 {
2980 if (!rDimEntry.bEnabled)
2981 continue;
2982
2983 bool bDimIsCol = rDimEntry.bDimIsCol;
2984
2985 boost::property_tree::ptree aDimTree;
2986 for (const auto& rGeomEntry : aGeomEntries)
2987 {
2988 if (!rGeomEntry.bEnabled)
2989 continue;
2990
2991 OString aGeomDataEncoding = rDoc.dumpSheetGeomData(nTab, bDimIsCol, rGeomEntry.eType);
2992 // TODO: Investigate if we can avoid the copy of the 'value' string in put().
2993 aDimTree.put(rGeomEntry.pKey, aGeomDataEncoding.getStr());
2994 }
2995
2996 aTree.add_child(rDimEntry.pKey, aDimTree);
2997 }
2998
2999 return getJSONString(aTree).c_str();
3000}
3001
3003{
3004 SAL_INFO("sc.lok.header",
3005 "extendTiledAreaIfNeeded: START: ClientView: ColRange["
3007 << "] RowRange[" << mnLOKStartHeaderRow << "," << mnLOKEndHeaderRow
3008 << "] MaxTiledCol = " << aViewData.GetMaxTiledCol()
3009 << " MaxTiledRow = " << aViewData.GetMaxTiledRow());
3010
3011 const tools::Rectangle rVisArea = aViewData.getLOKVisibleArea();
3012 if (rVisArea.Top() >= rVisArea.Bottom() ||
3013 rVisArea.Left() >= rVisArea.Right())
3014 return;
3015
3016 // Needed for conditional updating of visible-range/formula.
3019
3020 ScRangeProvider aRangeProvider(rVisArea, /* bInPixels */ false, aViewData);
3021 // Index bounds.
3022 const ScRange& rCellRange = aRangeProvider.getCellRange();
3023 const SCCOL nStartCol = rCellRange.aStart.Col();
3024 const SCCOL nEndCol = rCellRange.aEnd.Col();
3025 const SCROW nStartRow = rCellRange.aStart.Row();
3026 const SCROW nEndRow = rCellRange.aEnd.Row();
3027
3028 // Column/Row positions.
3029 tools::Long nStartColPos, nEndColPos, nStartRowPos, nEndRowPos;
3030 aRangeProvider.getColPositions(nStartColPos, nEndColPos);
3031 aRangeProvider.getRowPositions(nStartRowPos, nEndRowPos);
3032
3035
3036 // Update mnLOKStartHeaderCol and mnLOKEndHeaderCol members.
3037 // These are consulted in some ScGridWindow methods.
3038 if (mnLOKStartHeaderCol != nStartCol)
3039 {
3040 rWidthHelper.removeByIndex(mnLOKStartHeaderCol);
3041 rWidthHelper.insert(nStartCol, nStartColPos);
3042 mnLOKStartHeaderCol = nStartCol;
3043 }
3044
3045 if (mnLOKEndHeaderCol != nEndCol)
3046 {
3047 rWidthHelper.removeByIndex(mnLOKEndHeaderCol);
3048 rWidthHelper.insert(nEndCol, nEndColPos);
3049 mnLOKEndHeaderCol = nEndCol;
3050 }
3051
3052 // Update mnLOKStartHeaderRow and mnLOKEndHeaderRow members.
3053 // These are consulted in some ScGridWindow methods.
3054 if (mnLOKStartHeaderRow != nStartRow)
3055 {
3056 rHeightHelper.removeByIndex(mnLOKStartHeaderRow);
3057 rHeightHelper.insert(nStartRow, nStartRowPos);
3058 mnLOKStartHeaderRow = nStartRow;
3059 }
3060
3061 if (mnLOKEndHeaderRow != nEndRow)
3062 {
3063 rHeightHelper.removeByIndex(mnLOKEndHeaderRow);
3064 rHeightHelper.insert(nEndRow, nEndRowPos);
3065 mnLOKEndHeaderRow = nEndRow;
3066 }
3067
3068 constexpr SCCOL nMinExtraCols = 10;
3069 SCCOL nExtraCols = std::max<SCCOL>(nMinExtraCols, nEndCol - nStartCol);
3070 // If we are approaching current max tiled column, signal a size changed event
3071 // and invalidate the involved area.
3072 lcl_ExtendTiledDimension(/* bColumn */ true, nEndCol, nExtraCols, *this, aViewData);
3073
3074 constexpr SCROW nMinExtraRows = 25;
3075 SCROW nExtraRows = std::max(nMinExtraRows, nEndRow - nStartRow);
3076 // If we are approaching current max tiled row, signal a size changed event
3077 // and invalidate the involved area.
3078 lcl_ExtendTiledDimension(/* bColumn */ false, nEndRow, nExtraRows, *this, aViewData);
3079
3080 vcl::Region aNewVisCellRange(
3083 aNewVisCellRange.Exclude(aOldVisCellRange);
3084 tools::Rectangle aChangedCellRange = aNewVisCellRange.GetBoundRect();
3085 if (!aChangedCellRange.IsEmpty())
3086 {
3088 UpdateFormulas(aChangedCellRange.Left(), aChangedCellRange.Top(),
3089 aChangedCellRange.Right(), aChangedCellRange.Bottom());
3090 }
3091
3092 SAL_INFO("sc.lok.header",
3093 "extendTiledAreaIfNeeded: END: ClientView: ColRange["
3095 << "] RowRange[" << mnLOKStartHeaderRow << "," << mnLOKEndHeaderRow
3096 << "] MaxTiledCol = " << aViewData.GetMaxTiledCol()
3097 << " MaxTiledRow = " << aViewData.GetMaxTiledRow());
3098}
3099
3100/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::chart::ChartAxisLabelPosition ePos
void ScColToAlpha(OUStringBuffer &rBuf, SCCOL nCol)
append alpha representation of column to buffer
Definition: address.cxx:1884
const SCROW MAXTILEDROW
Definition: address.hxx:77
B2DRange maRange
const StyleSettings & GetStyleSettings() const
const CommandGestureZoomData * GetGestureZoomData() const
const CommandWheelData * GetWheelData() const
static bool IsQuickHelpEnabled()
static void ShowQuickHelp(vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rHelpText, QuickHelpFlags nStyle=QuickHelpFlags::NONE)
bool IsMod1() const
void DrawLine(const Point &rStartPt, const Point &rEndPt)
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
void SetLineColor()
const AllSettings & GetSettings() const
SCROW Row() const
Definition: address.hxx:274
SCCOL Col() const
Definition: address.hxx:279
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
Definition: tabview.cxx:131
virtual ~ScCornerButton() override
Definition: tabview.cxx:84
virtual void Resize() override
Definition: tabview.cxx:126
virtual void StateChanged(StateChangedType nType) override
Definition: tabview.cxx:108
ScCornerButton(vcl::Window *pParent, ScViewData *pData)
Definition: tabview.cxx:77
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
Definition: tabview.cxx:88
ScViewData * pViewData
Definition: tabview.hxx:69
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
Definition: tabview.cxx:117
void SetDocumentModified()
Definition: docsh.cxx:2977
ScModelObj * GetModel() const
Definition: docsh.hxx:434
SC_DLLPUBLIC sal_uInt16 GetRowHeight(SCROW nRow, SCTAB nTab, bool bHiddenAsZero=true) const
Definition: document.cxx:4228
SC_DLLPUBLIC sal_uInt16 GetColWidth(SCCOL nCol, SCTAB nTab, bool bHiddenAsZero=true) const
Definition: document.cxx:4187
SC_DLLPUBLIC tools::Long GetColOffset(SCCOL nCol, SCTAB nTab, bool bHiddenAsZero=true) const
Definition: document.cxx:4291
SC_DLLPUBLIC SCCOL MaxCol() const
Definition: document.hxx:892
SC_DLLPUBLIC SCROW MaxRow() const
Definition: document.hxx:893
SC_DLLPUBLIC bool IsNegativePage(SCTAB nTab) const
Definition: document.cxx:1006
SC_DLLPUBLIC bool RowHidden(SCROW nRow, SCTAB nTab, SCROW *pFirstRow=nullptr, SCROW *pLastRow=nullptr) const
Definition: document.cxx:4496
OString dumpSheetGeomData(SCTAB nTab, bool bColumns, SheetGeomType eGeomType)
Serializes the specified sheet's geometry data.
SC_DLLPUBLIC ScOutlineTable * GetOutlineTable(SCTAB nTab, bool bCreate=false)
Definition: documen3.cxx:745
SC_DLLPUBLIC bool ColHidden(SCCOL nCol, SCTAB nTab, SCCOL *pFirstCol=nullptr, SCCOL *pLastCol=nullptr) const
Definition: document.cxx:4512
SC_DLLPUBLIC bool IsLayoutRTL(SCTAB nTab) const
Definition: document.cxx:998
SC_DLLPUBLIC const SfxPoolItem * GetAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich) const
Definition: document.cxx:4789
SC_DLLPUBLIC tools::Rectangle GetMMRect(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, bool bHiddenAsZero=true) const
Definition: documen3.cxx:2002
SC_DLLPUBLIC tools::Long GetRowOffset(SCROW nRow, SCTAB nTab, bool bHiddenAsZero=true) const
Definition: document.cxx:4299
css::sheet::DataPilotFieldOrientation GetDPFieldOrientation(SCCOL nCol, SCROW nRow) const
Definition: gridwin2.cxx:54
MapMode GetDrawMapMode(bool bForce=false)
MapMode for the drawinglayer objects.
Definition: gridwin3.cxx:252
void LaunchDPFieldMenu(SCCOL nCol, SCROW nRow)
Definition: gridwin.cxx:1243
const Point & GetMousePosPixel() const
Definition: gridwin.hxx:383
void LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow)
Definition: gridwin.cxx:838
void LaunchDataSelectMenu(SCCOL nCol, SCROW nRow)
Definition: gridwin.cxx:1387
void LaunchPageFieldMenu(SCCOL nCol, SCROW nRow)
Definition: gridwin.cxx:1225
bool HasAutoFilter() const
Definition: attrib.hxx:103
virtual Size getDocumentSize() override
Definition: docuno.cxx:655
bool IsModalMode(SfxObjectShell *pDocSh=nullptr)
Definition: scmod.cxx:1594
bool IsFormulaMode()
Definition: scmod.cxx:1678
size_t GetCount(size_t nLevel) const
Definition: olinetab.cxx:456
ScOutlineEntry * GetEntry(size_t nLevel, size_t nIndex)
Definition: olinetab.cxx:428
bool GetEntryIndex(size_t nLevel, SCCOLROW nPos, size_t &rnIndex) const
Definition: olinetab.cxx:481
size_t GetDepth() const
Definition: olinetab.hxx:110
bool GetEntryIndexInRange(size_t nLevel, SCCOLROW nBlockStart, SCCOLROW nBlockEnd, size_t &rnIndex) const
Definition: olinetab.cxx:501
SC_DLLPUBLIC SCCOLROW GetStart() const
Definition: olinetab.hxx:42
SC_DLLPUBLIC bool IsHidden() const
Definition: olinetab.hxx:49
SC_DLLPUBLIC bool IsVisible() const
Definition: olinetab.hxx:54
SC_DLLPUBLIC SCCOLROW GetEnd() const
Definition: olinetab.cxx:42
const ScOutlineArray & GetColArray() const
Definition: olinetab.hxx:158
const ScOutlineArray & GetRowArray() const
Definition: olinetab.hxx:160
void removeByIndex(index_type nIndex)
Definition: viewdata.cxx:150
const value_type & getNearestByPosition(tools::Long nPos) const
Definition: viewdata.cxx:224
void insert(index_type nIndex, tools::Long nPos)
Definition: viewdata.cxx:138
ScAddress aEnd
Definition: address.hxx:498
ScAddress aStart
Definition: address.hxx:497
void VisAreaChanged()
Definition: viewuno.cxx:1932
void BroadcastAccessibility(const SfxHint &rHint)
Definition: tabvwshh.cxx:236
void SetActive()
Definition: tabvwsh4.cxx:276
bool HasAccessibilityObjects() const
Definition: tabvwshh.cxx:242
SCCOL mnLOKStartHeaderCol
Definition: tabview.hxx:201
void LockModifiers(sal_uInt16 nModifiers)
Definition: tabview.cxx:1967
sal_uInt16 GetLockedModifiers() const
Definition: tabview.cxx:1973
VclPtr< ScTabSplitter > pHSplitter
Definition: tabview.hxx:147
std::array< VclPtr< ScColBar >, 2 > pColBar
Definition: tabview.hxx:143
void PaintLeft()
Definition: tabview3.cxx:2731
std::array< VclPtr< ScOutlineWindow >, 2 > pRowOutline
Definition: tabview.hxx:146
VclPtr< ScCornerButton > aCornerButton
Definition: tabview.hxx:154
void UpdateAutoFillMark(bool bFromPaste=false)
Definition: tabview3.cxx:187
VclPtr< ScGridWindow > pTimerWindow
Definition: tabview.hxx:168
std::unique_ptr< ScViewSelectionEngine > pSelEngine
Definition: tabview.hxx:124
void UpdateVarZoom()
Definition: tabview.cxx:721
void UpdateShow()
Definition: tabview.cxx:1484
void TestHintWindow()
Definition: tabview3.cxx:780
ScHeaderFunctionSet aHdrFunc
Definition: tabview.hxx:128
std::shared_ptr< sc::SpellCheckContext > mpSpellCheckCxt
Definition: tabview.hxx:157
bool bMinimized
Definition: tabview.hxx:204
void AlignToCursor(SCCOL nCurX, SCROW nCurY, ScFollowMode eMode, const ScSplitPos *pWhich=nullptr)
Definition: tabview3.cxx:917
MouseEvent aTimerMEvt
Definition: tabview.hxx:169
ScSplitPos FindWindow(const vcl::Window *pWindow) const
Definition: tabview.cxx:899
Size aFrameSize
Definition: tabview.hxx:132
bool ScrollCommand(const CommandEvent &rCEvt, ScSplitPos ePos)
Definition: tabview.cxx:956
void RemoveHintWindow()
Definition: tabview3.cxx:878
SC_DLLPUBLIC void SetRelTabBarWidth(double fRelTabBarWidth)
Sets a relative tab bar width.
Definition: tabview.cxx:855
Timer aScrollTimer
Definition: tabview.hxx:167
sal_uInt16 CalcZoom(SvxZoomType eType, sal_uInt16 nOldZoom)
Definition: tabview2.cxx:1214
void StartDataSelect()
Definition: tabview.cxx:2277
void extendTiledAreaIfNeeded()
Definition: tabview.cxx:3002
VclPtr< ScrollAdaptor > aHScrollRight
Definition: tabview.hxx:153
static SC_DLLPUBLIC double GetRelTabBarWidth()
Returns the current tab bar width relative to the frame window width (0.0 ... 1.0).
Definition: tabview.cxx:873
VclPtr< ScrollAdaptor > aVScrollTop
Definition: tabview.hxx:150
void getRowColumnHeaders(const tools::Rectangle &rRectangle, tools::JsonWriter &rJsonWriter)
Definition: tabview.cxx:2698
VclPtr< ScrollAdaptor > aVScrollBottom
Definition: tabview.hxx:151
std::array< VclPtr< ScGridWindow >, 4 > pGridWin
Definition: tabview.hxx:142
Point GetChartInsertPos(const Size &rSize, const ScRange &rCellRange)
Definition: tabview.cxx:1753
VclPtr< ScTabControl > pTabControl
Definition: tabview.hxx:149
bool bInUpdateHeader
Definition: tabview.hxx:205
void SplitAtCursor()
Definition: tabview.cxx:2173
void RemoveSplit()
Definition: tabview.cxx:2164
void SetAutoSpellData(SCCOL nPosX, SCROW nPosY, const std::vector< editeng::MisspellRanges > *pRanges)
Definition: tabview.cxx:2376
void DoAddWin(ScGridWindow *pWin)
Definition: tabview5.cxx:270
void EnableAutoSpell(bool bEnable)
Definition: tabview.cxx:2336
VclPtr< ScTabSplitter > pVSplitter
Definition: tabview.hxx:148
SC_DLLPUBLIC void ScrollLines(tools::Long nDeltaX, tools::Long nDeltaY)
Definition: tabview.cxx:1387
Point GetGridOffset() const
Definition: tabview.cxx:909
Point GetChartDialogPos(const Size &rDialogSize, const tools::Rectangle &rLogicChart)
Definition: tabview.cxx:1881
void FreezeSplitters(bool bFreeze, SplitMethod eSplitMethod=SC_SPLIT_METHOD_CURSOR, SCCOLROW nFreezeIndex=-1)
Definition: tabview.cxx:1989
void UpdateHeaderWidth(const ScVSplitPos *pWhich=nullptr, const SCROW *pPosY=nullptr)
Definition: tabview.cxx:1415
OString getSheetGeometryData(bool bColumns, bool bRows, bool bSizes, bool bHidden, bool bFiltered, bool bGroups)
Definition: tabview.cxx:2928
void SetZoomPercentFromCommand(sal_uInt16 nZoomPercent)
Definition: tabview.cxx:939
Point GetInsertPos() const
Definition: tabview.cxx:1736
void Init()
Definition: tabview5.cxx:59
void SetTabBarWidth(tools::Long nNewWidth)
Sets an absolute tab bar width (in pixels).
Definition: tabview.cxx:844
ScViewData & GetViewData()
Definition: tabview.hxx:341
void SetZoom(const Fraction &rNewX, const Fraction &rNewY, bool bAll)
Definition: tabview5.cxx:424
SvxZoomType GetZoomType() const
Definition: tabview5.cxx:414
bool mbInlineWithScrollbar
Definition: tabview.hxx:215
void ShowAllCursors()
Definition: tabview3.cxx:234
ScGridWindow * GetActiveWin()
Definition: tabview.cxx:878
ScViewData aViewData
Definition: tabview.hxx:122
void DoResize(const Point &rOffset, const Size &rSize, bool bInner=false)
Definition: tabview.cxx:275
SCROW mnLOKStartHeaderRow
Definition: tabview.hxx:199
void ScrollX(tools::Long nDeltaX, ScHSplitPos eWhich, bool bUpdBars=true)
Definition: tabview.cxx:1220
void ResetAutoSpell()
Definition: tabview.cxx:2354
void SetTimer(ScGridWindow *pWin, const MouseEvent &rMEvt)
Definition: tabview.cxx:237
void ResetAutoSpellForContentChange()
Definition: tabview.cxx:2365
bool bInZoomUpdate
Definition: tabview.hxx:207
SCROW mnLOKEndHeaderRow
Definition: tabview.hxx:200
void UpdateSelectionOverlay()
Definition: tabview2.cxx:1021
void InitScrollBar(ScrollAdaptor &rScrollBar, tools::Long nMaxVal, const Link< weld::Scrollbar &, void > &rLink)
Definition: tabview.cxx:223
Point GetMousePosPixel()
Definition: tabview.cxx:1978
void UpdateFormulas(SCCOL nStartCol=-1, SCROW nStartRow=-1, SCCOL nEndCol=-1, SCROW nEndRow=-1)
Definition: tabview3.cxx:2305
void SelectAll(bool bContinue=false)
Definition: tabview2.cxx:1099
std::unique_ptr< ScDrawView > pDrawView
Definition: tabview.hxx:130
void ActivatePart(ScSplitPos eWhich)
Definition: tabview3.cxx:2904
void HideListBox()
Definition: tabview3.cxx:2993
std::array< VclPtr< ScRowBar >, 2 > pRowBar
Definition: tabview.hxx:144
void HideNoteMarker()
Definition: tabview2.cxx:1420
tools::Long nPrevDragPos
Definition: tabview.hxx:179
bool HasHintWindow() const
Definition: tabview3.cxx:876
void ResetTimer()
Definition: tabview.cxx:244
tools::Long GetTabBarWidth() const
Returns the current tab bar width in pixels.
Definition: tabview.cxx:868
SCCOL mnLOKEndHeaderCol
Definition: tabview.hxx:202
void InvalidateSplit()
Definition: tabview.cxx:2210
double mfAccumulatedZoom
Definition: tabview.hxx:218
std::unique_ptr< ScHeaderSelectionEngine > pHdrSelEng
Definition: tabview.hxx:127
bool bDragging
Definition: tabview.hxx:211
void ScrollY(tools::Long nDeltaY, ScVSplitPos eWhich, bool bUpdBars=true)
Definition: tabview.cxx:1303
void PaintTop()
Definition: tabview3.cxx:2664
void ActiveGrabFocus()
Definition: tabview.cxx:892
double mfLastZoomScale
Definition: tabview.hxx:217
void SetNewVisArea()
Definition: tabview.cxx:2222
Point aBorderPos
Definition: tabview.hxx:133
ScTabView(const ScTabView &)=delete
make noncopyable
void UpdateScrollBars(HeaderType eHeaderType=BOTH_HEADERS)
Definition: tabview4.cxx:389
static tools::Long GetScrollBarPos(const ScrollAdaptor &rScroll)
Definition: tabview4.cxx:355
void InterpretVisible()
Definition: tabview4.cxx:498
bool UpdateVisibleRange()
Definition: tabview.cxx:1564
void HideAllCursors()
Definition: tabview3.cxx:220
void SetActivePointer(PointerStyle nPointer)
Definition: tabview.cxx:885
double mfPendingTabBarWidth
Definition: tabview.hxx:197
void SplitAtPixel(const Point &rPixel)
Definition: tabview.cxx:2195
void EnableRefInput(bool bFlag)
Definition: tabview.cxx:2314
@ SC_SPLIT_METHOD_COL
Definition: tabview.hxx:293
@ SC_SPLIT_METHOD_CURSOR
Definition: tabview.hxx:293
@ SC_SPLIT_METHOD_ROW
Definition: tabview.hxx:293
bool GestureZoomCommand(const CommandEvent &rCEvt)
Definition: tabview.cxx:996
std::array< VclPtr< ScOutlineWindow >, 2 > pColOutline
Definition: tabview.hxx:145
void DoHSplit(tools::Long nSplitPos)
Definition: tabview.cxx:1594
void UpdateAllOverlays()
Definition: tabview2.cxx:1035
void RepeatResize(bool bUpdateFix=true)
Definition: tabview.cxx:763
VclPtr< ScCornerButton > aTopButton
Definition: tabview.hxx:155
void DoVSplit(tools::Long nSplitPos)
Definition: tabview.cxx:1664
void GetBorderSize(SvBorder &rBorder, const Size &rSize)
Definition: tabview.cxx:787
VclPtr< vcl::Window > pFrameWin
Definition: tabview.hxx:121
void SetPendingRelTabBarWidth(double fRelTabBarWidth)
Sets a relative tab bar width.
Definition: tabview.cxx:862
void UpdateFixPos()
Definition: tabview.cxx:750
void PaintGrid()
Definition: tabview3.cxx:2653
void ScrollHdl(ScrollAdaptor *rScrollBar)
Definition: tabview.cxx:1068
VclPtr< ScrollAdaptor > aHScrollLeft
Definition: tabview.hxx:152
bool HasPageFieldDataAtCursor() const
Definition: tabview.cxx:2266
void SetZoomType(SvxZoomType eNew, bool bAll)
Definition: tabview5.cxx:419
void SetHSplitPos(tools::Long nPos)
Definition: viewdata.hxx:440
bool IsHeaderMode() const
Definition: viewdata.hxx:560
SCCOL CellsAtX(SCCOL nPosX, SCCOL nDir, ScHSplitPos eWhichX, sal_uInt16 nScrSizeY=SC_SIZE_NONE) const
Definition: viewdata.cxx:2629
bool UpdateFixX(SCTAB nTab=MAXTAB+1)
Definition: viewdata.cxx:4030
SCROW GetFixPosY() const
Definition: viewdata.hxx:421
void GetMouseQuadrant(const Point &rClickPos, ScSplitPos eWhich, SCCOL nPosX, SCROW nPosY, bool &rLeft, bool &rTop)
Definition: viewdata.cxx:2895
bool IsOutlineMode() const
Definition: viewdata.hxx:565
void SetFixPosY(SCROW nPos)
Definition: viewdata.hxx:443
const Fraction & GetZoomY() const
Definition: viewdata.hxx:460
void SetFixPosX(SCCOL nPos)
Definition: viewdata.hxx:442
SCROW GetMaxTiledRow() const
Definition: viewdata.hxx:423
SCTAB GetTabNo() const
Definition: viewdata.hxx:395
bool IsTabMode() const
Definition: viewdata.hxx:562
ScDocument & GetDocument() const
Definition: viewdata.hxx:380
ScPositionHelper & GetLOKHeightHelper()
Definition: viewdata.hxx:411
SCROW GetPosY(ScVSplitPos eWhich, SCTAB nForTab=-1) const
Definition: viewdata.cxx:1416
SCCOL GetMaxTiledCol() const
Definition: viewdata.hxx:422
void SetPosY(ScVSplitPos eWhich, SCROW nNewPosY)
Definition: viewdata.cxx:2948
ScSplitMode GetHSplitMode() const
Definition: viewdata.hxx:416
void SetVSplitMode(ScSplitMode eMode)
Definition: viewdata.hxx:439
double GetPPTY() const
Definition: viewdata.hxx:469
void SetVSplitPos(tools::Long nPos)
Definition: viewdata.hxx:441
ScDocShell * GetDocShell() const
Definition: viewdata.hxx:354
bool UpdateFixY(SCTAB nTab=MAXTAB+1)
Definition: viewdata.cxx:4065
bool IsVScrollMode() const
Definition: viewdata.hxx:563
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
tools::Long GetHSplitPos() const
Definition: viewdata.hxx:418
static tools::Long ToPixel(sal_uInt16 nTwips, double nFactor)
Definition: viewdata.hxx:700
SCROW VisibleCellsY(ScVSplitPos eWhichY) const
Definition: viewdata.cxx:2712
ScSplitPos GetActivePart() const
Definition: viewdata.hxx:398
void SetMaxTiledCol(SCCOL nCol)
Definition: viewdata.cxx:1462
Point GetScrPos(SCCOL nWhereX, SCROW nWhereY, ScSplitPos eWhich, bool bAllowNeg=false, SCTAB nForTab=-1) const
Definition: viewdata.cxx:2375
bool IsHScrollMode() const
Definition: viewdata.hxx:564
ScPositionHelper & GetLOKWidthHelper()
Definition: viewdata.hxx:410
SCROW CellsAtY(SCROW nPosY, SCROW nDir, ScVSplitPos eWhichY, sal_uInt16 nScrSizeX=SC_SIZE_NONE) const
Definition: viewdata.cxx:2671
SCCOL PrevCellsX(ScHSplitPos eWhichX) const
Definition: viewdata.cxx:2717
SCCOL VisibleCellsX(ScHSplitPos eWhichX) const
Definition: viewdata.cxx:2707
void SetMaxTiledRow(SCROW nRow)
Definition: viewdata.cxx:1484
ScSplitMode GetVSplitMode() const
Definition: viewdata.hxx:417
const Fraction & GetZoomX() const
Definition: viewdata.hxx:459
SCCOL GetFixPosX() const
Definition: viewdata.hxx:420
SCROW PrevCellsY(ScVSplitPos eWhichY) const
Definition: viewdata.cxx:2722
const tools::Rectangle & getLOKVisibleArea() const
The visible area in the client (set by setClientVisibleArea).
Definition: viewdata.hxx:573
void SetPosX(ScHSplitPos eWhich, SCCOL nNewPosX)
Definition: viewdata.cxx:2909
double GetPPTX() const
Definition: viewdata.hxx:468
tools::Long GetVSplitPos() const
Definition: viewdata.hxx:419
SfxBindings & GetBindings()
Definition: viewdata.cxx:3129
SCROW GetCurY() const
Definition: viewdata.hxx:402
void SetHSplitMode(ScSplitMode eMode)
Definition: viewdata.hxx:438
SCCOL GetCurX() const
Definition: viewdata.hxx:401
SCCOL GetPosX(ScHSplitPos eWhich, SCTAB nForTab=-1) const
Definition: viewdata.cxx:1402
void SetScrollHdl(const Link< weld::Scrollbar &, void > &rLink)
virtual void SetRange(const Range &rRange) override
virtual void EnableRTL(bool bEnable=true) override
ScrollType GetScrollType() const
virtual void SetPageSize(tools::Long nNewSize) override
void SetMouseReleaseHdl(const Link< const MouseEvent &, bool > &rLink)
virtual void SetVisibleSize(tools::Long nNewSize) override
virtual void SetLineSize(tools::Long nNewSize) override
void Invalidate(sal_uInt16 nId)
bool IsInPlace() const
css::uno::Reference< css::frame::XController > GetController() const
static void notifyInvalidation(SfxViewShell const *pThisView, tools::Rectangle const *)
static void notifyDocumentSizeChanged(SfxViewShell const *pThisView, const OString &rPayload, vcl::ITiledRenderable *pDoc, bool bInvalidateAll=true)
bool IsPreview() const
SfxBindings & GetBindings()
SfxFrame & GetFrame() const
SfxViewFrame & GetViewFrame() const
void VisAreaChanged()
virtual css::uno::Reference< css::frame::XModel > GetCurrentDocument() const
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
void setWidth(tools::Long nWidth)
constexpr tools::Long Width() const
sal_Int32 GetScrollBarSize() const
const Color & GetDarkShadowColor() const
const vcl::Font & GetTabFont() const
const Color & GetFaceColor() const
tools::Long & Left()
tools::Long & Top()
tools::Long & Right()
tools::Long & Bottom()
void Stop()
virtual void Start(bool bStartTimer=true) override
reference_type * get() const
static VclPtr< reference_type > Create(Arg &&... arg)
void put(const char *pPropName, const OUString &rPropValue)
ScopedJsonWriterArray startArray(const char *)
ScopedJsonWriterStruct startStruct()
void putRaw(std::string_view)
constexpr tools::Long GetWidth() const
constexpr void SetLeft(tools::Long v)
constexpr void SetTop(tools::Long v)
constexpr tools::Long Top() const
constexpr Point TopLeft() const
tools::Long getOpenHeight() const
constexpr void SetRight(tools::Long v)
constexpr tools::Long Right() const
constexpr void SetBottom(tools::Long v)
constexpr Point BottomRight() const
constexpr tools::Long GetHeight() const
tools::Long getOpenWidth() const
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
constexpr bool IsEmpty() const
const Size & GetFontSize() const
tools::Rectangle GetBoundRect() const
void Exclude(const tools::Rectangle &rRegion)
Point LogicToPixel(const Point &rLogicPt) const
tools::Rectangle GetDesktopRectPixel() const
virtual Point GetPosPixel() const
virtual void EnableRTL(bool bEnable=true)
const AllSettings & GetSettings() const
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
Point PixelToLogic(const Point &rDevicePt) const
virtual Size GetSizePixel() const
Size GetOutputSizePixel() const
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
Point OutputToAbsoluteScreenPixel(const Point &rPos) const
virtual void SetPosSizePixel(const Point &rNewPos, const Size &rNewSize)
void SetBackground()
SheetGeomType
Represents the type of sheet geometry data.
Definition: document.hxx:277
DocumentType eType
const sal_uInt16 MINZOOM
Definition: global.hxx:79
const sal_uInt16 MAXZOOM
Definition: global.hxx:80
QuickHelpFlags
sal_Int32 nIndex
void * p
#define SAL_INFO(area, stream)
std::unique_ptr< sal_Int32[]> pData
tools::Long const nBorder
sal_uInt16 zoomIn(sal_uInt16 nCurrent)
sal_uInt16 zoomOut(sal_uInt16 nCurrent)
int i
void Create(SwFormatVertOrient &rItem, SvStream &rStrm, sal_uInt16 nVersionAbusedAsSize)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
None
long Long
@ SC_OUTLINE_HOR
Definition: olinewin.hxx:28
@ SC_OUTLINE_VER
Definition: olinewin.hxx:28
const size_t nTabSize
PointerStyle
QPRO_FUNC_TYPE nType
Definition: qproform.cxx:398
OUString ScResId(TranslateId aId)
Definition: scdll.cxx:90
constexpr TypedWhichId< ScMergeFlagAttr > ATTR_MERGE_FLAG(145)
#define SC_MOD()
Definition: scmod.hxx:249
Reference< XController > xController
#define SC_ICONSIZE
Definition: tabview.cxx:68
#define SC_TABBAR_MIN
Definition: tabview.cxx:71
static void lcl_SetPosSize(vcl::Window &rWindow, const Point &rPos, const Size &rSize, tools::Long nTotalWidth, bool bLayoutRTL)
Definition: tabview.cxx:258
static void ShowHide(vcl::Window *pWin, bool bShow)
Definition: tabview.cxx:1477
#define SPLIT_HANDLE_SIZE
Definition: tabview.cxx:65
#define SPLIT_MARGIN
Definition: tabview.cxx:64
#define SC_SCROLLBAR_MIN
Definition: tabview.cxx:70
IMPL_LINK(ScTabView, SplitHdl, Splitter *, pSplitter, void)
Definition: tabview.cxx:1581
constexpr sal_Int32 TAB_HEIGHT_MARGIN
Definition: tabview.cxx:66
IMPL_LINK_NOARG(ScTabView, TimerHdl, Timer *, void)
Definition: tabview.cxx:250
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
Definition: types.hxx:23
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17
#define stringstream
Definition: utils.hxx:45
ScrollType
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
@ SC_FOLLOW_NONE
Definition: viewdata.hxx:52
ScSplitMode
Definition: viewdata.hxx:42
@ SC_SPLIT_FIX
Definition: viewdata.hxx:42
@ SC_SPLIT_NORMAL
Definition: viewdata.hxx:42
@ SC_SPLIT_NONE
Definition: viewdata.hxx:42
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
StateChangedType
sal_Int64 WinBits
SvxZoomType