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 default:
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
1185 // tdf#152406 Disable anti-jitter code for scroll wheel events
1186 // After moving thousands of columns to the right via
1187 // horizontal scroll wheel or trackpad swipe events, most
1188 // vertical scroll wheel or trackpad swipe events will trigger
1189 // the anti-jitter code because nScrollPos and nPrevDragPos
1190 // will be equal and nDelta will be overridden and set to zero.
1191 // So, only use the anti-jitter code for mouse drag events.
1192 if ( eType == ScrollType::Drag )
1193 {
1194 if ( nScrollPos > nPrevDragPos )
1195 {
1196 if (nDelta<0) nDelta=0;
1197 }
1198 else if ( nScrollPos < nPrevDragPos )
1199 {
1200 if (nDelta>0) nDelta=0;
1201 }
1202 else
1203 nDelta = 0;
1204 }
1205
1206 nPrevDragPos = nScrollPos;
1207 }
1208 break;
1209 }
1210
1211 if (nDelta)
1212 {
1213 bool bUpdate = ( eType != ScrollType::Drag ); // don't alter the ranges while dragging
1214 if ( bHoriz )
1215 ScrollX( nDelta, (pScroll == aHScrollLeft.get()) ? SC_SPLIT_LEFT : SC_SPLIT_RIGHT, bUpdate );
1216 else
1217 ScrollY( nDelta, (pScroll == aVScrollTop.get()) ? SC_SPLIT_TOP : SC_SPLIT_BOTTOM, bUpdate );
1218 }
1219}
1220
1221void ScTabView::ScrollX( tools::Long nDeltaX, ScHSplitPos eWhich, bool bUpdBars )
1222{
1224 SCCOL nOldX = aViewData.GetPosX(eWhich);
1225 SCCOL nNewX = nOldX + static_cast<SCCOL>(nDeltaX);
1226 if ( nNewX < 0 )
1227 {
1228 nDeltaX -= nNewX;
1229 nNewX = 0;
1230 }
1231 if ( nNewX > rDoc.MaxCol() )
1232 {
1233 nDeltaX -= nNewX - rDoc.MaxCol();
1234 nNewX = rDoc.MaxCol();
1235 }
1236
1237 SCCOL nDir = ( nDeltaX > 0 ) ? 1 : -1;
1238 SCTAB nTab = aViewData.GetTabNo();
1239 while ( rDoc.ColHidden(nNewX, nTab) &&
1240 nNewX+nDir >= 0 && nNewX+nDir <= rDoc.MaxCol() )
1241 nNewX = sal::static_int_cast<SCCOL>( nNewX + nDir );
1242
1243 // freeze
1244
1246 {
1247 if (eWhich == SC_SPLIT_LEFT)
1248 nNewX = nOldX; // always keep the left part
1249 else
1250 {
1251 SCCOL nFixX = aViewData.GetFixPosX();
1252 if (nNewX < nFixX)
1253 nNewX = nFixX;
1254 }
1255 }
1256 if (nNewX == nOldX)
1257 return;
1258
1260
1261 if ( nNewX >= 0 && nNewX <= rDoc.MaxCol() && nDeltaX )
1262 {
1263 SCCOL nTrackX = std::max( nOldX, nNewX );
1264
1265 // with VCL Update() affects all windows at the moment, that is why
1266 // calling Update after scrolling of the GridWindow would possibly
1267 // already have painted the column/row bar with updated position. -
1268 // Therefore call Update once before on column/row bar
1269 if (pColBar[eWhich])
1270 pColBar[eWhich]->PaintImmediately();
1271
1272 tools::Long nOldPos = aViewData.GetScrPos( nTrackX, 0, eWhich ).X();
1273 aViewData.SetPosX( eWhich, nNewX );
1274 tools::Long nDiff = aViewData.GetScrPos( nTrackX, 0, eWhich ).X() - nOldPos;
1275
1276 if ( eWhich==SC_SPLIT_LEFT )
1277 {
1278 pGridWin[SC_SPLIT_BOTTOMLEFT]->ScrollPixel( nDiff, 0 );
1280 pGridWin[SC_SPLIT_TOPLEFT]->ScrollPixel( nDiff, 0 );
1281 }
1282 else
1283 {
1284 pGridWin[SC_SPLIT_BOTTOMRIGHT]->ScrollPixel( nDiff, 0 );
1286 pGridWin[SC_SPLIT_TOPRIGHT]->ScrollPixel( nDiff, 0 );
1287 }
1288 if (pColBar[eWhich]) { pColBar[eWhich]->Scroll( nDiff,0 ); pColBar[eWhich]->PaintImmediately(); }
1289 if (pColOutline[eWhich]) pColOutline[eWhich]->ScrollPixel( nDiff );
1290 if (bUpdBars)
1292 }
1293
1294 if (nDeltaX==1 || nDeltaX==-1)
1295 pGridWin[aViewData.GetActivePart()]->PaintImmediately();
1296
1298
1299 SetNewVisArea(); // MapMode must already be set
1300
1302}
1303
1304void ScTabView::ScrollY( tools::Long nDeltaY, ScVSplitPos eWhich, bool bUpdBars )
1305{
1307 SCROW nOldY = aViewData.GetPosY(eWhich);
1308 SCROW nNewY = nOldY + static_cast<SCROW>(nDeltaY);
1309 if ( nNewY < 0 )
1310 {
1311 nDeltaY -= nNewY;
1312 nNewY = 0;
1313 }
1314 if ( nNewY > rDoc.MaxRow() )
1315 {
1316 nDeltaY -= nNewY - rDoc.MaxRow();
1317 nNewY = rDoc.MaxRow();
1318 }
1319
1320 SCROW nDir = ( nDeltaY > 0 ) ? 1 : -1;
1321 SCTAB nTab = aViewData.GetTabNo();
1322 while ( rDoc.RowHidden(nNewY, nTab) &&
1323 nNewY+nDir >= 0 && nNewY+nDir <= rDoc.MaxRow() )
1324 nNewY += nDir;
1325
1326 // freeze
1327
1329 {
1330 if (eWhich == SC_SPLIT_TOP)
1331 nNewY = nOldY; // always keep the upper part
1332 else
1333 {
1334 SCROW nFixY = aViewData.GetFixPosY();
1335 if (nNewY < nFixY)
1336 nNewY = nFixY;
1337 }
1338 }
1339 if (nNewY == nOldY)
1340 return;
1341
1343
1344 if ( nNewY >= 0 && nNewY <= rDoc.MaxRow() && nDeltaY )
1345 {
1346 SCROW nTrackY = std::max( nOldY, nNewY );
1347
1348 // adjust row headers before the actual scrolling, so it does not get painted twice
1349 // PosY may then also not be set yet, pass on new value
1350 SCROW nUNew = nNewY;
1351 UpdateHeaderWidth( &eWhich, &nUNew ); // adjust row headers
1352
1353 if (pRowBar[eWhich])
1354 pRowBar[eWhich]->PaintImmediately();
1355
1356 tools::Long nOldPos = aViewData.GetScrPos( 0, nTrackY, eWhich ).Y();
1357 aViewData.SetPosY( eWhich, nNewY );
1358 tools::Long nDiff = aViewData.GetScrPos( 0, nTrackY, eWhich ).Y() - nOldPos;
1359
1360 if ( eWhich==SC_SPLIT_TOP )
1361 {
1362 pGridWin[SC_SPLIT_TOPLEFT]->ScrollPixel( 0, nDiff );
1364 pGridWin[SC_SPLIT_TOPRIGHT]->ScrollPixel( 0, nDiff );
1365 }
1366 else
1367 {
1368 pGridWin[SC_SPLIT_BOTTOMLEFT]->ScrollPixel( 0, nDiff );
1370 pGridWin[SC_SPLIT_BOTTOMRIGHT]->ScrollPixel( 0, nDiff );
1371 }
1372 if (pRowBar[eWhich]) { pRowBar[eWhich]->Scroll( 0,nDiff ); pRowBar[eWhich]->PaintImmediately(); }
1373 if (pRowOutline[eWhich]) pRowOutline[eWhich]->ScrollPixel( nDiff );
1374 if (bUpdBars)
1376 }
1377
1378 if (nDeltaY==1 || nDeltaY==-1)
1379 pGridWin[aViewData.GetActivePart()]->PaintImmediately();
1380
1382
1383 SetNewVisArea(); // MapMode must already be set
1384
1386}
1387
1389{
1391 if (nDeltaX)
1392 ScrollX(nDeltaX,WhichH(eWhich));
1393 if (nDeltaY)
1394 ScrollY(nDeltaY,WhichV(eWhich));
1395}
1396
1397namespace
1398{
1399
1400SCROW lcl_LastVisible( const ScViewData& rViewData )
1401{
1402 // If many rows are hidden at end of the document,
1403 // then there should not be a switch to wide row headers because of this
1404 ScDocument& rDoc = rViewData.GetDocument();
1405 SCTAB nTab = rViewData.GetTabNo();
1406
1407 SCROW nVis = rDoc.MaxRow();
1408 SCROW startRow;
1409 while ( nVis > 0 && rDoc.GetRowHeight( nVis, nTab, &startRow, nullptr ) == 0 )
1410 nVis = std::max<SCROW>( startRow - 1, 0 );
1411 return nVis;
1412}
1413
1414} // anonymous namespace
1415
1416void ScTabView::UpdateHeaderWidth( const ScVSplitPos* pWhich, const SCROW* pPosY )
1417{
1419 return;
1420
1422 SCROW nEndPos = rDoc.MaxRow();
1424 {
1425 // for OLE Inplace always MAXROW
1426
1427 if ( pWhich && *pWhich == SC_SPLIT_BOTTOM && pPosY )
1428 nEndPos = *pPosY;
1429 else
1430 nEndPos = aViewData.GetPosY( SC_SPLIT_BOTTOM );
1431 nEndPos += aViewData.CellsAtY( nEndPos, 1, SC_SPLIT_BOTTOM ); // VisibleCellsY
1432 if (nEndPos > rDoc.MaxRow())
1433 nEndPos = lcl_LastVisible( aViewData );
1434
1436 {
1437 SCROW nTopEnd;
1438 if ( pWhich && *pWhich == SC_SPLIT_TOP && pPosY )
1439 nTopEnd = *pPosY;
1440 else
1441 nTopEnd = aViewData.GetPosY( SC_SPLIT_TOP );
1442 nTopEnd += aViewData.CellsAtY( nTopEnd, 1, SC_SPLIT_TOP );// VisibleCellsY
1443 if (nTopEnd > rDoc.MaxRow())
1444 nTopEnd = lcl_LastVisible( aViewData );
1445
1446 if ( nTopEnd > nEndPos )
1447 nEndPos = nTopEnd;
1448 }
1449 }
1450
1451 tools::Long nSmall = pRowBar[SC_SPLIT_BOTTOM]->GetSmallWidth();
1452 tools::Long nBig = pRowBar[SC_SPLIT_BOTTOM]->GetBigWidth();
1453 tools::Long nDiff = nBig - nSmall;
1454
1455 if (nEndPos>10000)
1456 nEndPos = 10000;
1457 else if (nEndPos<1) // avoid extra step at 0 (when only one row is visible)
1458 nEndPos = 1;
1459 tools::Long nWidth = nBig - ( 10000 - nEndPos ) * nDiff / 10000;
1460
1461 if (nWidth == pRowBar[SC_SPLIT_BOTTOM]->GetWidth() || bInUpdateHeader)
1462 return;
1463
1464 bInUpdateHeader = true;
1465
1466 pRowBar[SC_SPLIT_BOTTOM]->SetWidth( nWidth );
1467 if (pRowBar[SC_SPLIT_TOP])
1468 pRowBar[SC_SPLIT_TOP]->SetWidth( nWidth );
1469
1470 RepeatResize();
1471
1472 // on VCL there are endless updates (each Update is valid for all windows)
1473 //aCornerButton->Update(); // otherwise this never gets an Update
1474
1475 bInUpdateHeader = false;
1476}
1477
1478static void ShowHide( vcl::Window* pWin, bool bShow )
1479{
1480 OSL_ENSURE(pWin || !bShow, "window is not present");
1481 if (pWin)
1482 pWin->Show(bShow);
1483}
1484
1486{
1487 bool bHScrollMode = aViewData.IsHScrollMode();
1488 bool bVScrollMode = aViewData.IsVScrollMode();
1489 bool bTabMode = aViewData.IsTabMode();
1490 bool bOutlMode = aViewData.IsOutlineMode();
1491 bool bHOutline = bOutlMode && lcl_HasColOutline(aViewData);
1492 bool bVOutline = bOutlMode && lcl_HasRowOutline(aViewData);
1493 bool bHeader = aViewData.IsHeaderMode();
1494
1495 bool bShowH = ( aViewData.GetHSplitMode() != SC_SPLIT_NONE );
1496 bool bShowV = ( aViewData.GetVSplitMode() != SC_SPLIT_NONE );
1497
1498 if ( aViewData.GetDocShell()->IsPreview() )
1499 bHScrollMode = bVScrollMode = bTabMode = bHeader = bHOutline = bVOutline = false;
1500
1501 // create Windows
1502
1503 if (bShowH && !pGridWin[SC_SPLIT_BOTTOMRIGHT])
1504 {
1507 }
1508 if (bShowV && !pGridWin[SC_SPLIT_TOPLEFT])
1509 {
1512 }
1513 if (bShowH && bShowV && !pGridWin[SC_SPLIT_TOPRIGHT])
1514 {
1517 }
1518
1519 if (bHOutline && !pColOutline[SC_SPLIT_LEFT])
1521 if (bShowH && bHOutline && !pColOutline[SC_SPLIT_RIGHT])
1523
1524 if (bVOutline && !pRowOutline[SC_SPLIT_BOTTOM])
1526 if (bShowV && bVOutline && !pRowOutline[SC_SPLIT_TOP])
1528
1529 if (bShowH && bHeader && !pColBar[SC_SPLIT_RIGHT])
1531 &aHdrFunc, pHdrSelEng.get(), this );
1532 if (bShowV && bHeader && !pRowBar[SC_SPLIT_TOP])
1534 &aHdrFunc, pHdrSelEng.get(), this );
1535
1536 // show Windows
1537
1538 ShowHide( aHScrollLeft.get(), bHScrollMode );
1539 ShowHide( aHScrollRight.get(), bShowH && bHScrollMode );
1540 ShowHide( aVScrollBottom.get(), bVScrollMode );
1541 ShowHide( aVScrollTop.get(), bShowV && bVScrollMode );
1542
1543 ShowHide( pHSplitter, bHScrollMode || bShowH ); // always generated
1544 ShowHide( pVSplitter, bVScrollMode || bShowV );
1545 ShowHide( pTabControl, bTabMode );
1546
1547 // from here dynamically generated
1548
1551 ShowHide( pGridWin[SC_SPLIT_TOPRIGHT], bShowH && bShowV );
1552
1553 ShowHide( pColOutline[SC_SPLIT_LEFT], bHOutline );
1554 ShowHide( pColOutline[SC_SPLIT_RIGHT], bShowH && bHOutline );
1555
1556 ShowHide( pRowOutline[SC_SPLIT_BOTTOM], bVOutline );
1557 ShowHide( pRowOutline[SC_SPLIT_TOP], bShowV && bVOutline );
1558
1559 ShowHide( pColBar[SC_SPLIT_RIGHT], bShowH && bHeader );
1560 ShowHide( pRowBar[SC_SPLIT_TOP], bShowV && bHeader );
1561
1563}
1564
1566{
1567 bool bChanged = false;
1568 for (VclPtr<ScGridWindow> & pWin : pGridWin)
1569 {
1570 if (!pWin || !pWin->IsVisible())
1571 continue;
1572
1573 if (pWin->UpdateVisibleRange())
1574 bChanged = true;
1575 }
1576
1577 return bChanged;
1578}
1579
1580// --- Splitter --------------------------------------------------------
1581
1582IMPL_LINK( ScTabView, SplitHdl, Splitter*, pSplitter, void )
1583{
1584 if ( pSplitter == pHSplitter )
1585 DoHSplit( pHSplitter->GetSplitPosPixel() );
1586 else
1587 DoVSplit( pVSplitter->GetSplitPosPixel() );
1588
1589 if ( aViewData.GetHSplitMode() == SC_SPLIT_FIX || aViewData.GetVSplitMode() == SC_SPLIT_FIX )
1590 FreezeSplitters( true );
1591
1592 DoResize( aBorderPos, aFrameSize );
1593}
1594
1596{
1597 // nSplitPos is the real pixel position on the frame window,
1598 // mirroring for RTL has to be done here.
1599
1600 bool bLayoutRTL = aViewData.GetDocument().IsLayoutRTL( aViewData.GetTabNo() );
1601 if ( bLayoutRTL )
1602 nSplitPos = pFrameWin->GetOutputSizePixel().Width() - nSplitPos - 1;
1603
1604 tools::Long nMinPos;
1605 tools::Long nMaxPos;
1606
1607 nMinPos = SPLIT_MARGIN;
1608 if ( pRowBar[SC_SPLIT_BOTTOM] && pRowBar[SC_SPLIT_BOTTOM]->GetSizePixel().Width() >= nMinPos )
1609 nMinPos = pRowBar[SC_SPLIT_BOTTOM]->GetSizePixel().Width() + 1;
1610 nMaxPos = aFrameSize.Width() - SPLIT_MARGIN;
1611
1612 ScSplitMode aOldMode = aViewData.GetHSplitMode();
1613 ScSplitMode aNewMode = SC_SPLIT_NORMAL;
1614
1615 aViewData.SetHSplitPos( nSplitPos );
1616 if ( nSplitPos < nMinPos || nSplitPos > nMaxPos )
1617 aNewMode = SC_SPLIT_NONE;
1618
1619 aViewData.SetHSplitMode( aNewMode );
1620
1621 if ( aNewMode == aOldMode )
1622 return;
1623
1624 UpdateShow(); // before ActivatePart !!
1625
1626 if ( aNewMode == SC_SPLIT_NONE )
1627 {
1632 }
1633 else
1634 {
1635 SCCOL nOldDelta = aViewData.GetPosX( SC_SPLIT_LEFT );
1636 tools::Long nLeftWidth = nSplitPos - pRowBar[SC_SPLIT_BOTTOM]->GetSizePixel().Width();
1637 if ( nLeftWidth < 0 ) nLeftWidth = 0;
1638 SCCOL nNewDelta = nOldDelta + aViewData.CellsAtX( nOldDelta, 1, SC_SPLIT_LEFT,
1639 static_cast<sal_uInt16>(nLeftWidth) );
1641 if ( nNewDelta > rDoc.MaxCol() )
1642 nNewDelta = rDoc.MaxCol();
1643 aViewData.SetPosX( SC_SPLIT_RIGHT, nNewDelta );
1644 if ( nNewDelta > aViewData.GetCurX() )
1647 else
1650 }
1651
1652 // Form Layer needs to know the visible part of all windows
1653 // that is why MapMode must already be correct here
1654 for (VclPtr<ScGridWindow> & pWin : pGridWin)
1655 if (pWin)
1656 pWin->SetMapMode( pWin->GetDrawMapMode() );
1657 SetNewVisArea();
1658
1659 PaintGrid();
1660 PaintTop();
1661
1663}
1664
1666{
1667 tools::Long nMinPos;
1668 tools::Long nMaxPos;
1669 SCROW nOldDelta;
1670
1671 nMinPos = SPLIT_MARGIN;
1672 if ( pColBar[SC_SPLIT_LEFT] && pColBar[SC_SPLIT_LEFT]->GetSizePixel().Height() >= nMinPos )
1673 nMinPos = pColBar[SC_SPLIT_LEFT]->GetSizePixel().Height() + 1;
1674 nMaxPos = aFrameSize.Height() - SPLIT_MARGIN;
1675
1676 ScSplitMode aOldMode = aViewData.GetVSplitMode();
1677 ScSplitMode aNewMode = SC_SPLIT_NORMAL;
1678
1679 aViewData.SetVSplitPos( nSplitPos );
1680 if ( nSplitPos < nMinPos || nSplitPos > nMaxPos )
1681 aNewMode = SC_SPLIT_NONE;
1682
1683 aViewData.SetVSplitMode( aNewMode );
1684
1685 if ( aNewMode == aOldMode )
1686 return;
1687
1688 UpdateShow(); // before ActivatePart !!
1689
1690 if ( aNewMode == SC_SPLIT_NONE )
1691 {
1692 nOldDelta = aViewData.GetPosY( SC_SPLIT_TOP );
1693 aViewData.SetPosY( SC_SPLIT_BOTTOM, nOldDelta );
1694
1699 }
1700 else
1701 {
1702 if ( aOldMode == SC_SPLIT_NONE )
1703 nOldDelta = aViewData.GetPosY( SC_SPLIT_BOTTOM );
1704 else
1705 nOldDelta = aViewData.GetPosY( SC_SPLIT_TOP );
1706
1707 aViewData.SetPosY( SC_SPLIT_TOP, nOldDelta );
1708 tools::Long nTopHeight = nSplitPos - pColBar[SC_SPLIT_LEFT]->GetSizePixel().Height();
1709 if ( nTopHeight < 0 ) nTopHeight = 0;
1710 SCROW nNewDelta = nOldDelta + aViewData.CellsAtY( nOldDelta, 1, SC_SPLIT_TOP,
1711 static_cast<sal_uInt16>(nTopHeight) );
1713 if ( nNewDelta > rDoc.MaxRow() )
1714 nNewDelta = rDoc.MaxRow();
1715 aViewData.SetPosY( SC_SPLIT_BOTTOM, nNewDelta );
1716 if ( nNewDelta > aViewData.GetCurY() )
1719 else
1722 }
1723
1724 // Form Layer needs to know the visible part of all windows
1725 // that is why MapMode must already be correct here
1726 for (VclPtr<ScGridWindow> & pWin : pGridWin)
1727 if (pWin)
1728 pWin->SetMapMode( pWin->GetDrawMapMode() );
1729 SetNewVisArea();
1730
1731 PaintGrid();
1732 PaintLeft();
1733
1735}
1736
1738{
1740 SCCOL nCol = aViewData.GetCurX();
1741 SCROW nRow = aViewData.GetCurY();
1742 SCTAB nTab = aViewData.GetTabNo();
1743 tools::Long nPosX = 0;
1744 for (SCCOL i=0; i<nCol; i++)
1745 nPosX += rDoc.GetColWidth(i,nTab);
1747 if ( rDoc.IsNegativePage( nTab ) )
1748 nPosX = -nPosX;
1749 tools::Long nPosY = rDoc.GetRowHeight( 0, nRow-1, nTab);
1751 return Point(nPosX,nPosY);
1752}
1753
1754Point ScTabView::GetChartInsertPos( const Size& rSize, const ScRange& rCellRange )
1755{
1756 Point aInsertPos;
1757 const tools::Long nBorder = 100; // leave 1mm for border
1758 tools::Long nNeededWidth = rSize.Width() + 2 * nBorder;
1759 tools::Long nNeededHeight = rSize.Height() + 2 * nBorder;
1760
1761 // use the active window, or lower/right if frozen (as in CalcZoom)
1762 ScSplitPos eUsedPart = aViewData.GetActivePart();
1764 eUsedPart = (WhichV(eUsedPart)==SC_SPLIT_TOP) ? SC_SPLIT_TOPRIGHT : SC_SPLIT_BOTTOMRIGHT;
1766 eUsedPart = (WhichH(eUsedPart)==SC_SPLIT_LEFT) ? SC_SPLIT_BOTTOMLEFT : SC_SPLIT_BOTTOMRIGHT;
1767
1768 ScGridWindow* pWin = pGridWin[eUsedPart].get();
1769 OSL_ENSURE( pWin, "Window not found" );
1770 if (pWin)
1771 {
1772 ActivatePart( eUsedPart );
1773
1774 // get the visible rectangle in logic units
1775 bool bLOKActive = comphelper::LibreOfficeKit::isActive();
1776 MapMode aDrawMode = pWin->GetDrawMapMode();
1777 tools::Rectangle aVisible(
1778 bLOKActive ?
1779 OutputDevice::LogicToLogic( aViewData.getLOKVisibleArea(), MapMode(MapUnit::MapTwip), MapMode(MapUnit::Map100thMM) )
1780 : pWin->PixelToLogic( tools::Rectangle( Point(0,0), pWin->GetOutputSizePixel() ), aDrawMode ) );
1781
1783 SCTAB nTab = aViewData.GetTabNo();
1784 bool bLayoutRTL = rDoc.IsLayoutRTL( nTab );
1785 tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
1786
1787 tools::Long nDocX = o3tl::convert(rDoc.GetColOffset(rDoc.MaxCol() + 1, nTab), o3tl::Length::twip, o3tl::Length::mm100) * nLayoutSign;
1789
1790 if ( aVisible.Left() * nLayoutSign > nDocX * nLayoutSign )
1791 aVisible.SetLeft( nDocX );
1792 if ( aVisible.Right() * nLayoutSign > nDocX * nLayoutSign )
1793 aVisible.SetRight( nDocX );
1794 if ( aVisible.Top() > nDocY )
1795 aVisible.SetTop( nDocY );
1796 if ( aVisible.Bottom() > nDocY )
1797 aVisible.SetBottom( nDocY );
1798
1799 // get the logic position of the selection
1800
1801 tools::Rectangle aSelection = rDoc.GetMMRect( rCellRange.aStart.Col(), rCellRange.aStart.Row(),
1802 rCellRange.aEnd.Col(), rCellRange.aEnd.Row(), nTab );
1803
1804 if (bLOKActive && bLayoutRTL)
1805 {
1806 // In this case we operate in negative X coordinates. The rectangle aSelection already
1807 // has negative X coordinates. So the x coordinates in the rectangle aVisible(from getLOKVisibleArea)
1808 // need be negated to match.
1809 aVisible = tools::Rectangle(-aVisible.Right(), aVisible.Top(), -aVisible.Left(), aVisible.Bottom());
1810 }
1811
1812 tools::Long nLeftSpace = aSelection.Left() - aVisible.Left();
1813 tools::Long nRightSpace = aVisible.Right() - aSelection.Right();
1814 tools::Long nTopSpace = aSelection.Top() - aVisible.Top();
1815 tools::Long nBottomSpace = aVisible.Bottom() - aSelection.Bottom();
1816
1817 bool bFitLeft = ( nLeftSpace >= nNeededWidth );
1818 bool bFitRight = ( nRightSpace >= nNeededWidth );
1819
1820 if ( bFitLeft || bFitRight )
1821 {
1822 // first preference: completely left or right of the selection
1823
1824 // if both fit, prefer left in RTL mode, right otherwise
1825 bool bPutLeft = bFitLeft && ( bLayoutRTL || !bFitRight );
1826
1827 if ( bPutLeft )
1828 aInsertPos.setX( aSelection.Left() - nNeededWidth );
1829 else
1830 aInsertPos.setX( aSelection.Right() + 1 );
1831
1832 // align with top of selection (is moved again if it doesn't fit)
1833 aInsertPos.setY( std::max( aSelection.Top(), aVisible.Top() ) );
1834 }
1835 else if ( nTopSpace >= nNeededHeight || nBottomSpace >= nNeededHeight )
1836 {
1837 // second preference: completely above or below the selection
1838 if ( nBottomSpace > nNeededHeight ) // bottom is preferred
1839 aInsertPos.setY( aSelection.Bottom() + 1 );
1840 else
1841 aInsertPos.setY( aSelection.Top() - nNeededHeight );
1842
1843 // align with (logic) left edge of selection (moved again if it doesn't fit)
1844 if ( bLayoutRTL )
1845 aInsertPos.setX( std::min( aSelection.Right(), aVisible.Right() ) - nNeededWidth + 1 );
1846 else
1847 aInsertPos.setX( std::max( aSelection.Left(), aVisible.Left() ) );
1848 }
1849 else
1850 {
1851 // place to the (logic) right of the selection and move so it fits
1852
1853 if ( bLayoutRTL )
1854 aInsertPos.setX( aSelection.Left() - nNeededWidth );
1855 else
1856 aInsertPos.setX( aSelection.Right() + 1 );
1857 aInsertPos.setY( std::max( aSelection.Top(), aVisible.Top() ) );
1858 }
1859
1860 // move the position if the object doesn't fit in the screen
1861
1862 tools::Rectangle aCompareRect( aInsertPos, Size( nNeededWidth, nNeededHeight ) );
1863 if ( aCompareRect.Right() > aVisible.Right() )
1864 aInsertPos.AdjustX( -(aCompareRect.Right() - aVisible.Right()) );
1865 if ( aCompareRect.Bottom() > aVisible.Bottom() )
1866 aInsertPos.AdjustY( -(aCompareRect.Bottom() - aVisible.Bottom()) );
1867
1868 if ( aInsertPos.X() < aVisible.Left() )
1869 aInsertPos.setX( aVisible.Left() );
1870 if ( aInsertPos.Y() < aVisible.Top() )
1871 aInsertPos.setY( aVisible.Top() );
1872
1873 // nNeededWidth / nNeededHeight includes all borders - move aInsertPos to the
1874 // object position, inside the border
1875
1876 aInsertPos.AdjustX(nBorder );
1877 aInsertPos.AdjustY(nBorder );
1878 }
1879 return aInsertPos;
1880}
1881
1882Point ScTabView::GetChartDialogPos( const Size& rDialogSize, const tools::Rectangle& rLogicChart )
1883{
1884 // rDialogSize must be in pixels, rLogicChart in 1/100 mm. Return value is in pixels.
1885
1886 Point aRet;
1887
1888 // use the active window, or lower/right if frozen (as in CalcZoom)
1889 ScSplitPos eUsedPart = aViewData.GetActivePart();
1891 eUsedPart = (WhichV(eUsedPart)==SC_SPLIT_TOP) ? SC_SPLIT_TOPRIGHT : SC_SPLIT_BOTTOMRIGHT;
1893 eUsedPart = (WhichH(eUsedPart)==SC_SPLIT_LEFT) ? SC_SPLIT_BOTTOMLEFT : SC_SPLIT_BOTTOMRIGHT;
1894
1895 ScGridWindow* pWin = pGridWin[eUsedPart].get();
1896 OSL_ENSURE( pWin, "Window not found" );
1897 if (pWin)
1898 {
1899 MapMode aDrawMode = pWin->GetDrawMapMode();
1900 tools::Rectangle aObjPixel = pWin->LogicToPixel( rLogicChart, aDrawMode );
1901 tools::Rectangle aObjAbs( pWin->OutputToAbsoluteScreenPixel( aObjPixel.TopLeft() ),
1902 pWin->OutputToAbsoluteScreenPixel( aObjPixel.BottomRight() ) );
1903
1904 tools::Rectangle aDesktop = pWin->GetDesktopRectPixel();
1905 Size aSpace = pWin->LogicToPixel( Size(8, 12), MapMode(MapUnit::MapAppFont));
1906
1908 SCTAB nTab = aViewData.GetTabNo();
1909 bool bLayoutRTL = rDoc.IsLayoutRTL( nTab );
1910
1911 bool bCenterHor = false;
1912
1913 if ( aDesktop.Bottom() - aObjAbs.Bottom() >= rDialogSize.Height() + aSpace.Height() )
1914 {
1915 // first preference: below the chart
1916
1917 aRet.setY( aObjAbs.Bottom() + aSpace.Height() );
1918 bCenterHor = true;
1919 }
1920 else if ( aObjAbs.Top() - aDesktop.Top() >= rDialogSize.Height() + aSpace.Height() )
1921 {
1922 // second preference: above the chart
1923
1924 aRet.setY( aObjAbs.Top() - rDialogSize.Height() - aSpace.Height() );
1925 bCenterHor = true;
1926 }
1927 else
1928 {
1929 bool bFitLeft = ( aObjAbs.Left() - aDesktop.Left() >= rDialogSize.Width() + aSpace.Width() );
1930 bool bFitRight = ( aDesktop.Right() - aObjAbs.Right() >= rDialogSize.Width() + aSpace.Width() );
1931
1932 if ( bFitLeft || bFitRight )
1933 {
1934 // if both fit, prefer right in RTL mode, left otherwise
1935 bool bPutRight = bFitRight && ( bLayoutRTL || !bFitLeft );
1936 if ( bPutRight )
1937 aRet.setX( aObjAbs.Right() + aSpace.Width() );
1938 else
1939 aRet.setX( aObjAbs.Left() - rDialogSize.Width() - aSpace.Width() );
1940
1941 // center vertically
1942 aRet.setY( aObjAbs.Top() + ( aObjAbs.GetHeight() - rDialogSize.Height() ) / 2 );
1943 }
1944 else
1945 {
1946 // doesn't fit on any edge - put at the bottom of the screen
1947 aRet.setY( aDesktop.Bottom() - rDialogSize.Height() );
1948 bCenterHor = true;
1949 }
1950 }
1951 if ( bCenterHor )
1952 aRet.setX( aObjAbs.Left() + ( aObjAbs.GetWidth() - rDialogSize.Width() ) / 2 );
1953
1954 // limit to screen (centering might lead to invalid positions)
1955 if ( aRet.X() + rDialogSize.Width() - 1 > aDesktop.Right() )
1956 aRet.setX( aDesktop.Right() - rDialogSize.Width() + 1 );
1957 if ( aRet.X() < aDesktop.Left() )
1958 aRet.setX( aDesktop.Left() );
1959 if ( aRet.Y() + rDialogSize.Height() - 1 > aDesktop.Bottom() )
1960 aRet.setY( aDesktop.Bottom() - rDialogSize.Height() + 1 );
1961 if ( aRet.Y() < aDesktop.Top() )
1962 aRet.setY( aDesktop.Top() );
1963 }
1964
1965 return aRet;
1966}
1967
1968void ScTabView::LockModifiers( sal_uInt16 nModifiers )
1969{
1970 pSelEngine->LockModifiers( nModifiers );
1971 pHdrSelEng->LockModifiers( nModifiers );
1972}
1973
1975{
1976 return pSelEngine->GetLockedModifiers();
1977}
1978
1980{
1981 Point aPos;
1982 ScGridWindow* pWin = GetActiveWin();
1983
1984 if ( pWin )
1985 aPos = pWin->GetMousePosPixel();
1986
1987 return aPos;
1988}
1989
1990void ScTabView::FreezeSplitters( bool bFreeze, SplitMethod eSplitMethod, SCCOLROW nFreezeIndex)
1991{
1992 if ((eSplitMethod == SC_SPLIT_METHOD_COL || eSplitMethod == SC_SPLIT_METHOD_ROW) && nFreezeIndex < 0)
1993 nFreezeIndex = 0;
1994
1997
1999 if ( eOldV != SC_SPLIT_NONE )
2001 vcl::Window* pWin = pGridWin[ePos];
2002
2003 bool bLayoutRTL = aViewData.GetDocument().IsLayoutRTL( aViewData.GetTabNo() );
2004 bool bUpdateFix = false;
2005
2006 if ( bFreeze )
2007 {
2008 Point aWinStart = pWin->GetPosPixel();
2010
2011 Point aSplit;
2012 SCCOL nPosX = 1;
2013 SCROW nPosY = 1;
2014 if (eOldV != SC_SPLIT_NONE || eOldH != SC_SPLIT_NONE)
2015 {
2016 if ( eOldV != SC_SPLIT_NONE && (eSplitMethod == SC_SPLIT_METHOD_ROW || eSplitMethod == SC_SPLIT_METHOD_CURSOR))
2017 aSplit.setY( aViewData.GetVSplitPos() - aWinStart.Y() );
2018
2019 if ( eOldH != SC_SPLIT_NONE && (eSplitMethod == SC_SPLIT_METHOD_COL || eSplitMethod == SC_SPLIT_METHOD_CURSOR))
2020 {
2021 tools::Long nSplitPos = aViewData.GetHSplitPos();
2022 if ( bLayoutRTL )
2023 nSplitPos = pFrameWin->GetOutputSizePixel().Width() - nSplitPos - 1;
2024 aSplit.setX( nSplitPos - aWinStart.X() );
2025 }
2026
2027 aViewData.GetPosFromPixel( aSplit.X(), aSplit.Y(), ePos, nPosX, nPosY );
2028 bool bLeft;
2029 bool bTop;
2030 aViewData.GetMouseQuadrant( aSplit, ePos, nPosX, nPosY, bLeft, bTop );
2031 if (eSplitMethod == SC_SPLIT_METHOD_COL)
2032 nPosX = static_cast<SCCOL>(nFreezeIndex);
2033 else if (!bLeft)
2034 ++nPosX;
2035 if (eSplitMethod == SC_SPLIT_METHOD_ROW)
2036 nPosY = static_cast<SCROW>(nFreezeIndex);
2037 else if (!bTop)
2038 ++nPosY;
2039 }
2040 else
2041 {
2042 switch(eSplitMethod)
2043 {
2045 {
2046 nPosX = 0;
2047 nPosY = static_cast<SCROW>(nFreezeIndex);
2048 }
2049 break;
2051 {
2052 nPosX = static_cast<SCCOL>(nFreezeIndex);
2053 nPosY = 0;
2054 }
2055 break;
2057 {
2058 nPosX = aViewData.GetCurX();
2059 nPosY = aViewData.GetCurY();
2060 }
2061 break;
2062 }
2063 }
2064
2066 SCROW nBottomPos = nPosY;
2068 SCCOL nRightPos = nPosX;
2069
2070 if (eSplitMethod == SC_SPLIT_METHOD_ROW || eSplitMethod == SC_SPLIT_METHOD_CURSOR)
2071 {
2072 if (eOldV != SC_SPLIT_NONE)
2073 {
2074 nTopPos = aViewData.GetPosY(SC_SPLIT_TOP);
2075 if (aViewData.GetPosY(SC_SPLIT_BOTTOM) > nBottomPos)
2076 nBottomPos = aViewData.GetPosY(SC_SPLIT_BOTTOM);
2077 }
2078 aSplit = aViewData.GetScrPos(nPosX, nPosY, ePos, true);
2079 if (aSplit.Y() > 0)
2080 {
2082 aViewData.SetVSplitPos(aSplit.Y() + aWinStart.Y());
2083 aViewData.SetFixPosY(nPosY);
2084
2085 aViewData.SetPosY(SC_SPLIT_TOP, nTopPos);
2086 aViewData.SetPosY(SC_SPLIT_BOTTOM, nBottomPos);
2087 }
2088 else if (nPosY == 1 && eSplitMethod == SC_SPLIT_METHOD_ROW)
2089 {
2090 // Freeze first row, but row 1 is not visible on screen now == special handling
2092 aViewData.SetFixPosY(nPosY);
2093
2095 bUpdateFix = true;
2096 }
2097 else
2099 }
2100
2101 if (eSplitMethod == SC_SPLIT_METHOD_COL || eSplitMethod == SC_SPLIT_METHOD_CURSOR)
2102 {
2103 if (eOldH != SC_SPLIT_NONE)
2104 {
2105 if (aViewData.GetPosX(SC_SPLIT_RIGHT) > nRightPos)
2106 nRightPos = aViewData.GetPosX(SC_SPLIT_RIGHT);
2107 }
2108 aSplit = aViewData.GetScrPos( nPosX, nPosY, ePos, true );
2109 if (nPosX > aViewData.GetPosX(SC_SPLIT_LEFT)) // (aSplit.X() > 0) doesn't work for RTL
2110 {
2111 tools::Long nSplitPos = aSplit.X() + aWinStart.X();
2112 if ( bLayoutRTL )
2113 nSplitPos = pFrameWin->GetOutputSizePixel().Width() - nSplitPos - 1;
2114
2116 aViewData.SetHSplitPos( nSplitPos );
2117 aViewData.SetFixPosX( nPosX );
2118
2119 aViewData.SetPosX(SC_SPLIT_LEFT, nLeftPos);
2120 aViewData.SetPosX(SC_SPLIT_RIGHT, nRightPos);
2121 }
2122 else if (nPosX == 1 && eSplitMethod == SC_SPLIT_METHOD_COL)
2123 {
2124 // Freeze first column, but col A is not visible on screen now == special handling
2126 aViewData.SetFixPosX(nPosX);
2127
2130 bUpdateFix = true;
2131 }
2132 else
2134 }
2135 }
2136 else // unfreeze
2137 {
2138 if ( eOldH == SC_SPLIT_FIX )
2140 if ( eOldV == SC_SPLIT_FIX )
2142 }
2143
2144 // Form Layer needs to know the visible part of all windows
2145 // that is why MapMode must already be correct here
2147 if (p)
2148 p->SetMapMode( p->GetDrawMapMode() );
2149 SetNewVisArea();
2150
2151 RepeatResize(bUpdateFix);
2152
2153 UpdateShow();
2154 PaintLeft();
2155 PaintTop();
2156 PaintGrid();
2157
2158 // SC_FOLLOW_NONE: only update active part
2161
2163}
2164
2166{
2169 DoHSplit( 0 );
2170 DoVSplit( 0 );
2171 RepeatResize();
2172}
2173
2175{
2179 vcl::Window* pWin = pGridWin[ePos];
2180 Point aWinStart = pWin->GetPosPixel();
2181
2182 SCCOL nPosX = aViewData.GetCurX();
2183 SCROW nPosY = aViewData.GetCurY();
2184 Point aSplit = aViewData.GetScrPos( nPosX, nPosY, ePos, true );
2185 if ( nPosX > 0 )
2186 DoHSplit( aSplit.X() + aWinStart.X() );
2187 else
2188 DoHSplit( 0 );
2189 if ( nPosY > 0 )
2190 DoVSplit( aSplit.Y() + aWinStart.Y() );
2191 else
2192 DoVSplit( 0 );
2193 RepeatResize();
2194}
2195
2196void ScTabView::SplitAtPixel( const Point& rPixel )
2197{
2198 // pixel is relative to the entire View, not to the first GridWin
2199
2200 if ( rPixel.X() > 0 )
2201 DoHSplit( rPixel.X() );
2202 else
2203 DoHSplit( 0 );
2204 if ( rPixel.Y() > 0 )
2205 DoVSplit( rPixel.Y() );
2206 else
2207 DoVSplit( 0 );
2208 RepeatResize();
2209}
2210
2212{
2213 SfxBindings& rBindings = aViewData.GetBindings();
2214 rBindings.Invalidate( SID_WINDOW_SPLIT );
2215 rBindings.Invalidate( SID_WINDOW_FIX );
2216 rBindings.Invalidate( SID_WINDOW_FIX_COL );
2217 rBindings.Invalidate( SID_WINDOW_FIX_ROW );
2218
2221}
2222
2224{
2225 // Draw-MapMode must be set for Controls when VisAreaChanged
2226 // (also when Edit-MapMode is set instead)
2227 MapMode aOldMode[4];
2228 MapMode aDrawMode[4];
2229 sal_uInt16 i;
2230 for (i=0; i<4; i++)
2231 if (pGridWin[i])
2232 {
2233 aOldMode[i] = pGridWin[i]->GetMapMode();
2234 aDrawMode[i] = pGridWin[i]->GetDrawMapMode();
2235 if (aDrawMode[i] != aOldMode[i])
2236 pGridWin[i]->SetMapMode(aDrawMode[i]);
2237 }
2238
2240 if (pActive)
2242 if (pDrawView)
2243 pDrawView->VisAreaChanged(nullptr); // no window passed on -> for all windows
2244
2245 UpdateAllOverlays(); // #i79909# with drawing MapMode set
2246
2247 for (i=0; i<4; i++)
2248 if (pGridWin[i] && aDrawMode[i] != aOldMode[i])
2249 {
2250 pGridWin[i]->flushOverlayManager(); // #i79909# flush overlays before switching to edit MapMode
2251 pGridWin[i]->SetMapMode(aOldMode[i]);
2252 }
2253
2255 SfxFrame& rFrame = rViewFrame.GetFrame();
2256 css::uno::Reference<css::frame::XController> xController = rFrame.GetController();
2257 if (xController.is())
2258 {
2259 ScTabViewObj* pImp = dynamic_cast<ScTabViewObj*>( xController.get() );
2260 if (pImp)
2261 pImp->VisAreaChanged();
2262 }
2264 aViewData.GetViewShell()->BroadcastAccessibility(SfxHint(SfxHintId::ScAccVisAreaChanged));
2265}
2266
2268{
2270 SCCOL nCol = aViewData.GetCurX();
2271 SCROW nRow = aViewData.GetCurY();
2272 if (pWin)
2273 return pWin->GetDPFieldOrientation( nCol, nRow ) == sheet::DataPilotFieldOrientation_PAGE;
2274
2275 return false;
2276}
2277
2279{
2281 SCCOL nCol = aViewData.GetCurX();
2282 SCROW nRow = aViewData.GetCurY();
2283
2284 if (!pWin)
2285 return;
2286
2287 switch (pWin->GetDPFieldOrientation(nCol, nRow))
2288 {
2289 case sheet::DataPilotFieldOrientation_PAGE:
2290 // #i36598# If the cursor is on a page field's data cell,
2291 // no meaningful input is possible anyway, so this function
2292 // can be used to select a page field entry.
2293 pWin->LaunchPageFieldMenu( nCol, nRow );
2294 return;
2295 case sheet::DataPilotFieldOrientation_COLUMN:
2296 case sheet::DataPilotFieldOrientation_ROW:
2297 pWin->LaunchDPFieldMenu( nCol, nRow );
2298 return;
2299 default:
2300 ;
2301 }
2302
2303 // Do autofilter if the current cell has autofilter button. Otherwise do
2304 // a normal data select popup.
2305 const ScMergeFlagAttr* pAttr =
2307 nCol, nRow, aViewData.GetTabNo(), ATTR_MERGE_FLAG);
2308
2309 if (pAttr->HasAutoFilter())
2310 pWin->LaunchAutoFilterMenu(nCol, nRow);
2311 else
2312 pWin->LaunchDataSelectMenu(nCol, nRow);
2313}
2314
2316{
2317 aHScrollLeft->EnableInput(bFlag);
2318 aHScrollRight->EnableInput(bFlag);
2319 aVScrollBottom->EnableInput(bFlag);
2320 aVScrollTop->EnableInput(bFlag);
2321
2322 // from here on dynamically created ones
2323
2324 if(pTabControl!=nullptr) pTabControl->EnableInput(bFlag);
2325
2326 for (auto& p : pGridWin)
2327 if (p)
2328 p->EnableInput(bFlag, false);
2329 for (auto& p : pColBar)
2330 if (p)
2331 p->EnableInput(bFlag, false);
2332 for (auto& p : pRowBar)
2333 if (p)
2334 p->EnableInput(bFlag, false);
2335}
2336
2337void ScTabView::EnableAutoSpell( bool bEnable )
2338{
2339 if (bEnable)
2341 std::make_shared<sc::SpellCheckContext>(&aViewData.GetDocument(),
2343 else
2344 mpSpellCheckCxt.reset();
2345
2346 for (VclPtr<ScGridWindow> & pWin : pGridWin)
2347 {
2348 if (!pWin)
2349 continue;
2350
2351 pWin->SetAutoSpellContext(mpSpellCheckCxt);
2352 }
2353}
2354
2356{
2357 for (VclPtr<ScGridWindow> & pWin : pGridWin)
2358 {
2359 if (!pWin)
2360 continue;
2361
2362 pWin->ResetAutoSpell();
2363 }
2364}
2365
2367{
2368 for (VclPtr<ScGridWindow> & pWin : pGridWin)
2369 {
2370 if (!pWin)
2371 continue;
2372
2373 pWin->ResetAutoSpellForContentChange();
2374 }
2375}
2376
2377void ScTabView::SetAutoSpellData( SCCOL nPosX, SCROW nPosY, const std::vector<editeng::MisspellRanges>* pRanges )
2378{
2379 for (VclPtr<ScGridWindow> & pWin: pGridWin)
2380 {
2381 if (!pWin)
2382 continue;
2383
2384 pWin->SetAutoSpellData(nPosX, nPosY, pRanges);
2385 }
2386}
2387
2388namespace
2389{
2390
2391tools::Long lcl_GetRowHeightPx(const ScViewData &rViewData, SCROW nRow, SCTAB nTab)
2392{
2393 const sal_uInt16 nSize = rViewData.GetDocument().GetRowHeight(nRow, nTab);
2394 return ScViewData::ToPixel(nSize, rViewData.GetPPTY());
2395}
2396
2397tools::Long lcl_GetColWidthPx(const ScViewData &rViewData, SCCOL nCol, SCTAB nTab)
2398{
2399 const sal_uInt16 nSize = rViewData.GetDocument().GetColWidth(nCol, nTab);
2400 return ScViewData::ToPixel(nSize, rViewData.GetPPTX());
2401}
2402
2403void lcl_getGroupIndexes(const ScOutlineArray& rArray, SCCOLROW nStart, SCCOLROW nEnd, std::vector<size_t>& rGroupIndexes)
2404{
2405 rGroupIndexes.clear();
2406 const size_t nGroupDepth = rArray.GetDepth();
2407 rGroupIndexes.resize(nGroupDepth);
2408
2409 // Get first group per each level
2410 for (size_t nLevel = 0; nLevel < nGroupDepth; ++nLevel)
2411 {
2412 if (rArray.GetCount(nLevel))
2413 {
2414 // look for a group inside the [nStartRow+1, nEndRow] range
2415 size_t nIndex;
2416 bool bFound = rArray.GetEntryIndexInRange(nLevel, nStart + 1, nEnd, nIndex);
2417 if (bFound)
2418 {
2419 if (nIndex > 0)
2420 {
2421 // is there a previous group not inside the range
2422 // but anyway intersecting it ?
2423 const ScOutlineEntry* pPrevEntry = rArray.GetEntry(nLevel, nIndex - 1);
2424 if (pPrevEntry && nStart < pPrevEntry->GetEnd())
2425 {
2426 --nIndex;
2427 }
2428 }
2429 }
2430 else
2431 {
2432 // look for a group which contains nStartRow+1
2433 bFound = rArray.GetEntryIndex(nLevel, nStart + 1, nIndex);
2434 if (!bFound)
2435 {
2436 // look for a group which contains nEndRow
2437 bFound = rArray.GetEntryIndex(nLevel, nEnd, nIndex);
2438 }
2439 }
2440
2441 if (bFound)
2442 {
2443 // skip groups with no visible control
2444 bFound = false;
2445 while (nIndex < rArray.GetCount(nLevel))
2446 {
2447 const ScOutlineEntry* pEntry = rArray.GetEntry(nLevel, nIndex);
2448 if (pEntry && pEntry->IsVisible())
2449 {
2450 bFound = true;
2451 break;
2452 }
2453 if (pEntry && pEntry->GetStart() > nEnd)
2454 {
2455 break;
2456 }
2457 ++nIndex;
2458 }
2459 }
2460
2461 rGroupIndexes[nLevel] = bFound ? nIndex : -1;
2462 }
2463 }
2464}
2465
2466void lcl_createGroupsData(
2467 SCCOLROW nHeaderIndex, SCCOLROW nEnd, tools::Long nSizePx, tools::Long nTotalPx,
2468 const ScOutlineArray& rArray, std::vector<size_t>& rGroupIndexes,
2469 std::vector<tools::Long>& rGroupStartPositions, OStringBuffer& rGroupsBuffer)
2470{
2471 const size_t nGroupDepth = rArray.GetDepth();
2472 // create string data for group controls
2473 for (size_t nLevel = nGroupDepth - 1; nLevel != size_t(-1); --nLevel)
2474 {
2475 size_t nIndex = rGroupIndexes[nLevel];
2476 if (nIndex == size_t(-1))
2477 continue;
2478 const ScOutlineEntry* pEntry = rArray.GetEntry(nLevel, nIndex);
2479 if (pEntry)
2480 {
2481 if (nHeaderIndex < pEntry->GetStart())
2482 {
2483 continue;
2484 }
2485 else if (nHeaderIndex == pEntry->GetStart())
2486 {
2487 rGroupStartPositions[nLevel] = nTotalPx - nSizePx;
2488 }
2489 else if (nHeaderIndex > pEntry->GetStart() && (nHeaderIndex < nEnd && nHeaderIndex < pEntry->GetEnd()))
2490 {
2491 // for handling group started before the current view range
2492 if (rGroupStartPositions[nLevel] < 0)
2493 rGroupStartPositions[nLevel] *= -1;
2494 break;
2495 }
2496 if (nHeaderIndex == pEntry->GetEnd() || (nHeaderIndex == nEnd && rGroupStartPositions[nLevel] != -1))
2497 {
2498 // nHeaderIndex is the end col/row of a group or is the last col/row and a group started and not yet ended
2499
2500 // append a new group control data
2501 auto len = rGroupsBuffer.getLength();
2502 if (len && rGroupsBuffer[len-1] == '}')
2503 {
2504 rGroupsBuffer.append(", ");
2505 }
2506
2507 bool bGroupHidden = pEntry->IsHidden();
2508
2509 rGroupsBuffer.append(
2510 "{ \"level\": " + OString::number(nLevel + 1) + ", "
2511 "\"index\": " + OString::number(nIndex) + ", "
2512 "\"startPos\": " + OString::number(rGroupStartPositions[nLevel]) + ", "
2513 "\"endPos\": " + OString::number(nTotalPx) + ", "
2514 "\"hidden\": " + OString::number(bGroupHidden ? 1 : 0) + " }");
2515
2516 // look for the next visible group control at level nLevel
2517 bool bFound = false;
2518 ++nIndex;
2519 while (nIndex < rArray.GetCount(nLevel))
2520 {
2521 pEntry = rArray.GetEntry(nLevel, nIndex);
2522 if (pEntry && pEntry->IsVisible())
2523 {
2524 bFound = true;
2525 break;
2526 }
2527 if (pEntry && pEntry->GetStart() > nEnd)
2528 {
2529 break;
2530 }
2531 ++nIndex;
2532 }
2533 rGroupIndexes[nLevel] = bFound ? nIndex : -1;
2534 rGroupStartPositions[nLevel] = -1;
2535 }
2536 }
2537 }
2538}
2539
2540class ScRangeProvider
2541{
2542public:
2543 ScRangeProvider(const tools::Rectangle& rArea, bool bInPixels,
2544 ScViewData& rViewData):
2545 mrViewData(rViewData)
2546 {
2547 tools::Rectangle aAreaPx = bInPixels ? rArea :
2548 tools::Rectangle(rArea.Left() * mrViewData.GetPPTX(),
2549 rArea.Top() * mrViewData.GetPPTY(),
2550 rArea.Right() * mrViewData.GetPPTX(),
2551 rArea.Bottom() * mrViewData.GetPPTY());
2552 calculateBounds(aAreaPx);
2553 }
2554
2555 const ScRange& getCellRange() const
2556 {
2557 return maRange;
2558 }
2559
2560 void getColPositions(tools::Long& rStartColPos, tools::Long& rEndColPos) const
2561 {
2562 rStartColPos = maBoundPositions.Left();
2563 rEndColPos = maBoundPositions.Right();
2564 }
2565
2566 void getRowPositions(tools::Long& rStartRowPos, tools::Long& rEndRowPos) const
2567 {
2568 rStartRowPos = maBoundPositions.Top();
2569 rEndRowPos = maBoundPositions.Bottom();
2570 }
2571
2572private:
2573 void calculateBounds(const tools::Rectangle& rAreaPx)
2574 {
2575 tools::Long nLeftPx = 0, nRightPx = 0;
2576 SCCOLROW nStartCol = -1, nEndCol = -1;
2577 calculateDimensionBounds(rAreaPx.Left(), rAreaPx.Right(), true,
2578 nStartCol, nEndCol, nLeftPx, nRightPx,
2579 mnEnlargeX, mrViewData);
2580 tools::Long nTopPx = 0, nBottomPx = 0;
2581 SCCOLROW nStartRow = -1, nEndRow = -1;
2582 calculateDimensionBounds(rAreaPx.Top(), rAreaPx.Bottom(), false,
2583 nStartRow, nEndRow, nTopPx, nBottomPx,
2584 mnEnlargeY, mrViewData);
2585
2586 maRange.aStart.Set(nStartCol, nStartRow, mrViewData.GetTabNo());
2587 maRange.aEnd.Set(nEndCol, nEndRow, mrViewData.GetTabNo());
2588
2589 maBoundPositions.SetLeft(nLeftPx);
2590 maBoundPositions.SetRight(nRightPx);
2591 maBoundPositions.SetTop(nTopPx);
2592 maBoundPositions.SetBottom(nBottomPx);
2593 }
2594
2595 // All positions are in pixels.
2596 static void calculateDimensionBounds(const tools::Long nStartPos, const tools::Long nEndPos,
2597 bool bColumns, SCCOLROW& rStartIndex,
2598 SCCOLROW& rEndIndex, tools::Long& rBoundStart,
2599 tools::Long& rBoundEnd, SCCOLROW nEnlarge,
2600 ScViewData& rViewData)
2601 {
2602 ScPositionHelper& rPosHelper = bColumns ? rViewData.GetLOKWidthHelper() :
2603 rViewData.GetLOKHeightHelper();
2604 const auto& rStartNearest = rPosHelper.getNearestByPosition(nStartPos);
2605 const auto& rEndNearest = rPosHelper.getNearestByPosition(nEndPos);
2606
2607 ScBoundsProvider aBoundsProvider(rViewData, rViewData.GetTabNo(), bColumns);
2608 aBoundsProvider.Compute(rStartNearest, rEndNearest, nStartPos, nEndPos);
2609 aBoundsProvider.EnlargeBy(nEnlarge);
2610 if (bColumns)
2611 {
2612 SCCOL nStartCol = -1, nEndCol = -1;
2613 aBoundsProvider.GetStartIndexAndPosition(nStartCol, rBoundStart);
2614 aBoundsProvider.GetEndIndexAndPosition(nEndCol, rBoundEnd);
2615 rStartIndex = nStartCol;
2616 rEndIndex = nEndCol;
2617 }
2618 else
2619 {
2620 SCROW nStartRow = -1, nEndRow = -1;
2621 aBoundsProvider.GetStartIndexAndPosition(nStartRow, rBoundStart);
2622 aBoundsProvider.GetEndIndexAndPosition(nEndRow, rBoundEnd);
2623 rStartIndex = nStartRow;
2624 rEndIndex = nEndRow;
2625 }
2626 }
2627
2628private:
2629
2631 tools::Rectangle maBoundPositions;
2632 ScViewData& mrViewData;
2633 static const SCCOLROW mnEnlargeX = 2;
2634 static const SCCOLROW mnEnlargeY = 2;
2635};
2636
2637void lcl_ExtendTiledDimension(bool bColumn, const SCCOLROW nEnd, const SCCOLROW nExtra,
2638 ScTabView& rTabView, ScViewData& rViewData)
2639{
2640 ScDocument& rDoc = rViewData.GetDocument();
2641 // If we are approaching current max tiled row/col, signal a size changed event
2642 // and invalidate the involved area
2643 SCCOLROW nMaxTiledIndex = bColumn ? rViewData.GetMaxTiledCol() : rViewData.GetMaxTiledRow();
2644 SCCOLROW nHardLimit = !bColumn ? MAXTILEDROW : rDoc.MaxCol();
2645
2646 if (nMaxTiledIndex >= nHardLimit)
2647 return;
2648
2649 if (nEnd <= nMaxTiledIndex - nExtra) // No need to extend.
2650 return;
2651
2652 ScDocShell* pDocSh = rViewData.GetDocShell();
2653 ScModelObj* pModelObj = pDocSh ? pDocSh->GetModel() : nullptr;
2654 Size aOldSize(0, 0);
2655 if (pModelObj)
2656 aOldSize = pModelObj->getDocumentSize();
2657
2658 SCCOLROW nNewMaxTiledIndex = std::min(std::max(nEnd, nMaxTiledIndex) + nExtra, nHardLimit);
2659
2660 if (bColumn)
2661 rViewData.SetMaxTiledCol(nNewMaxTiledIndex);
2662 else
2663 rViewData.SetMaxTiledRow(nNewMaxTiledIndex);
2664
2665 Size aNewSize(0, 0);
2666 if (pModelObj)
2667 aNewSize = pModelObj->getDocumentSize();
2668
2669 if (aOldSize == aNewSize)
2670 return;
2671
2672 if (!pDocSh)
2673 return;
2674
2675 // New area extended to the right/bottom of the sheet after last col/row
2676 // excluding overlapping area with aNewArea
2677 tools::Rectangle aNewArea = bColumn ?
2678 tools::Rectangle(aOldSize.getWidth(), 0, aNewSize.getWidth(), aNewSize.getHeight()):
2679 tools::Rectangle(0, aOldSize.getHeight(), aNewSize.getWidth(), aNewSize.getHeight());
2680
2681 // Only invalidate if spreadsheet has extended to the right or bottom
2682 if ((bColumn && aNewArea.getOpenWidth()) || (!bColumn && aNewArea.getOpenHeight()))
2683 {
2684 rTabView.UpdateSelectionOverlay();
2685 SfxLokHelper::notifyInvalidation(rViewData.GetViewShell(), &aNewArea);
2686 }
2687
2688 // Provide size in the payload, so clients don't have to query for that.
2690 ss << aNewSize.Width() << ", " << aNewSize.Height();
2691 OString sSize( ss.str() );
2692 ScModelObj* pModel = comphelper::getFromUnoTunnel<ScModelObj>(
2693 rViewData.GetViewShell()->GetCurrentDocument());
2694 SfxLokHelper::notifyDocumentSizeChanged(rViewData.GetViewShell(), sSize, pModel, false);
2695}
2696
2697} // anonymous namespace
2698
2700{
2702
2703 if (rRectangle.IsEmpty())
2704 return;
2705
2706 bool bRangeHeaderSupport = comphelper::LibreOfficeKit::isRangeHeaders();
2707
2708 rJsonWriter.put("commandName", ".uno:ViewRowColumnHeaders");
2709
2710 SCTAB nTab = aViewData.GetTabNo();
2711 SCROW nStartRow = -1;
2712 SCROW nEndRow = -1;
2713 tools::Long nStartHeightPx = 0;
2714 SCCOL nStartCol = -1;
2715 SCCOL nEndCol = -1;
2716 tools::Long nStartWidthPx = 0;
2717
2718 tools::Rectangle aOldVisArea(
2721
2722 ScRangeProvider aRangeProvider(rRectangle, /* bInPixels */ false, aViewData);
2723 const ScRange& rCellRange = aRangeProvider.getCellRange();
2724
2726
2728
2729 if (rRectangle.Top() < rRectangle.Bottom())
2730 {
2731 SAL_INFO("sc.lok.header", "Row Header: compute start/end rows.");
2732 tools::Long nEndHeightPx = 0;
2733 nStartRow = rCellRange.aStart.Row();
2734 nEndRow = rCellRange.aEnd.Row();
2735 aRangeProvider.getRowPositions(nStartHeightPx, nEndHeightPx);
2736
2739 aViewData.GetLOKHeightHelper().insert(nStartRow, nStartHeightPx);
2740 aViewData.GetLOKHeightHelper().insert(nEndRow, nEndHeightPx);
2741
2742 mnLOKStartHeaderRow = nStartRow;
2743 mnLOKEndHeaderRow = nEndRow;
2744 }
2745
2746 sal_Int32 nVisibleRows = nEndRow - nStartRow;
2747 if (nVisibleRows < 25)
2748 nVisibleRows = 25;
2749
2750 SAL_INFO("sc.lok.header", "Row Header: visible rows: " << nVisibleRows);
2751
2752
2753 // Get row groups
2754 // per each level store the index of the first group intersecting
2755 // [nStartRow, nEndRow] range
2756
2757 const ScOutlineTable* pTable = rDoc.GetOutlineTable(nTab);
2758 const ScOutlineArray* pRowArray = pTable ? &(pTable->GetRowArray()) : nullptr;
2759 size_t nRowGroupDepth = 0;
2760 std::vector<size_t> aRowGroupIndexes;
2761 if (bRangeHeaderSupport && pTable)
2762 {
2763 nRowGroupDepth = pRowArray->GetDepth();
2764 lcl_getGroupIndexes(*pRowArray, nStartRow, nEndRow, aRowGroupIndexes);
2765 }
2766
2769 lcl_ExtendTiledDimension(/* bColumn */ false, nEndRow, nVisibleRows, *this, aViewData);
2770
2772
2773 tools::Long nTotalPixels = nStartHeightPx;
2774 tools::Long nPrevSizePx = -1;
2775 OStringBuffer aRowGroupsBuffer = "\"rowGroups\": [\n";
2776 {
2777 auto rowsNode = rJsonWriter.startArray("rows");
2778
2779 SAL_INFO("sc.lok.header", "Row Header: [create string data for rows]: start row: "
2780 << nStartRow << " start height: " << nTotalPixels);
2781
2782 if (nStartRow != nEndRow)
2783 {
2784 auto node = rJsonWriter.startStruct();
2785 rJsonWriter.put("text", nStartRow + 1);
2786 rJsonWriter.put("size", nTotalPixels);
2787 rJsonWriter.put("groupLevels", static_cast<sal_Int64>(nRowGroupDepth));
2788 }
2789
2790 std::vector<tools::Long> aRowGroupStartPositions(nRowGroupDepth, -nTotalPixels);
2791 for (SCROW nRow = nStartRow + 1; nRow <= nEndRow; ++nRow)
2792 {
2793 // nSize will be 0 for hidden rows.
2794 const tools::Long nSizePx = lcl_GetRowHeightPx(aViewData, nRow, nTab);
2795 nTotalPixels += nSizePx;
2796
2797 if (bRangeHeaderSupport && nRowGroupDepth > 0)
2798 {
2799 lcl_createGroupsData(nRow, nEndRow, nSizePx, nTotalPixels,
2800 *pRowArray, aRowGroupIndexes, aRowGroupStartPositions,
2801 aRowGroupsBuffer);
2802 }
2803
2804 if (bRangeHeaderSupport && nRow < nEndRow && nSizePx == nPrevSizePx)
2805 continue;
2806 nPrevSizePx = nSizePx;
2807
2808 auto node = rJsonWriter.startStruct();
2809 rJsonWriter.put("text", pRowBar[SC_SPLIT_BOTTOM]->GetEntryText(nRow));
2810 rJsonWriter.put("size", nTotalPixels);
2811 }
2812
2813 aRowGroupsBuffer.append("]");
2814 }
2815 if (nRowGroupDepth > 0)
2816 {
2817 aRowGroupsBuffer.append(",\n");
2818 rJsonWriter.putRaw(aRowGroupsBuffer);
2819 }
2821
2822
2824
2826
2827 if (rRectangle.Left() < rRectangle.Right())
2828 {
2829 SAL_INFO("sc.lok.header", "Column Header: compute start/end columns.");
2830 tools::Long nEndWidthPx = 0;
2831 nStartCol = rCellRange.aStart.Col();
2832 nEndCol = rCellRange.aEnd.Col();
2833 aRangeProvider.getColPositions(nStartWidthPx, nEndWidthPx);
2834
2837 aViewData.GetLOKWidthHelper().insert(nStartCol, nStartWidthPx);
2838 aViewData.GetLOKWidthHelper().insert(nEndCol, nEndWidthPx);
2839
2840 mnLOKStartHeaderCol = nStartCol;
2841 mnLOKEndHeaderCol = nEndCol;
2842 }
2843
2844 sal_Int32 nVisibleCols = nEndCol - nStartCol;
2845 if (nVisibleCols < 10)
2846 nVisibleCols = 10;
2847
2848
2849 // Get column groups
2850 // per each level store the index of the first group intersecting
2851 // [nStartCol, nEndCol] range
2852
2853 const ScOutlineArray* pColArray = pTable ? &(pTable->GetColArray()) : nullptr;
2854 size_t nColGroupDepth = 0;
2855 std::vector<size_t> aColGroupIndexes;
2856 if (bRangeHeaderSupport && pTable)
2857 {
2858 nColGroupDepth = pColArray->GetDepth();
2859 lcl_getGroupIndexes(*pColArray, nStartCol, nEndCol, aColGroupIndexes);
2860 }
2861
2864 lcl_ExtendTiledDimension(/* bColumn */ true, nEndCol, nVisibleCols, *this, aViewData);
2865
2867 OStringBuffer aColGroupsBuffer = "\"columnGroups\": [\n";
2868 {
2869 auto columnsNode = rJsonWriter.startArray("columns");
2870
2871 nTotalPixels = nStartWidthPx;
2872 SAL_INFO("sc.lok.header", "Col Header: [create string data for cols]: start col: "
2873 << nStartRow << " start width: " << nTotalPixels);
2874
2875 if (nStartCol != nEndCol)
2876 {
2877 auto node = rJsonWriter.startStruct();
2878 rJsonWriter.put("text", static_cast<sal_Int64>(nStartCol + 1));
2879 rJsonWriter.put("size", nTotalPixels);
2880 rJsonWriter.put("groupLevels", static_cast<sal_Int64>(nColGroupDepth));
2881 }
2882
2883 std::vector<tools::Long> aColGroupStartPositions(nColGroupDepth, -nTotalPixels);
2884 nPrevSizePx = -1;
2885 for (SCCOL nCol = nStartCol + 1; nCol <= nEndCol; ++nCol)
2886 {
2887 // nSize will be 0 for hidden columns.
2888 const tools::Long nSizePx = lcl_GetColWidthPx(aViewData, nCol, nTab);
2889 nTotalPixels += nSizePx;
2890
2891 if (bRangeHeaderSupport && nColGroupDepth > 0)
2892 lcl_createGroupsData(nCol, nEndCol, nSizePx, nTotalPixels,
2893 *pColArray, aColGroupIndexes,
2894 aColGroupStartPositions, aColGroupsBuffer);
2895
2896 if (bRangeHeaderSupport && nCol < nEndCol && nSizePx == nPrevSizePx)
2897 continue;
2898 nPrevSizePx = nSizePx;
2899
2900 OUString aText = bRangeHeaderSupport ?
2901 OUString::number(nCol + 1) : pColBar[SC_SPLIT_LEFT]->GetEntryText(nCol);
2902
2903 auto node = rJsonWriter.startStruct();
2904 rJsonWriter.put("text", aText);
2905 rJsonWriter.put("size", nTotalPixels);
2906 }
2907
2908 aColGroupsBuffer.append("]");
2909 }
2910 if (nColGroupDepth > 0)
2911 {
2912 aColGroupsBuffer.append(",\n");
2913 rJsonWriter.putRaw(aColGroupsBuffer);
2914 }
2916
2917 vcl::Region aNewVisArea(
2920 aNewVisArea.Exclude(aOldVisArea);
2921 tools::Rectangle aChangedArea = aNewVisArea.GetBoundRect();
2922 if (!aChangedArea.IsEmpty())
2923 {
2925 UpdateFormulas(aChangedArea.Left(), aChangedArea.Top(), aChangedArea.Right(), aChangedArea.Bottom());
2926 }
2927}
2928
2929OString ScTabView::getSheetGeometryData(bool bColumns, bool bRows, bool bSizes, bool bHidden,
2930 bool bFiltered, bool bGroups)
2931{
2933
2934 boost::property_tree::ptree aTree;
2935 aTree.put("commandName", ".uno:SheetGeometryData");
2936 aTree.put("maxtiledcolumn", rDoc.MaxCol());
2937 aTree.put("maxtiledrow", MAXTILEDROW);
2938
2939 auto getJSONString = [](const boost::property_tree::ptree& rTree) {
2940 std::stringstream aStream;
2941 boost::property_tree::write_json(aStream, rTree);
2942 return aStream.str();
2943 };
2944
2945 if ((!bSizes && !bHidden && !bFiltered && !bGroups) ||
2946 (!bColumns && !bRows))
2947 {
2948 return OString(getJSONString(aTree));
2949 }
2950
2951 struct GeomEntry
2952 {
2954 const char* pKey;
2955 bool bEnabled;
2956 };
2957
2958 const GeomEntry aGeomEntries[] = {
2959 { SheetGeomType::SIZES, "sizes", bSizes },
2960 { SheetGeomType::HIDDEN, "hidden", bHidden },
2961 { SheetGeomType::FILTERED, "filtered", bFiltered },
2962 { SheetGeomType::GROUPS, "groups", bGroups }
2963 };
2964
2965 struct DimensionEntry
2966 {
2967 const char* pKey;
2968 bool bDimIsCol;
2969 bool bEnabled;
2970 };
2971
2972 const DimensionEntry aDimEntries[] = {
2973 { "columns", true, bColumns },
2974 { "rows", false, bRows }
2975 };
2976
2977 SCTAB nTab = aViewData.GetTabNo();
2978
2979 for (const auto& rDimEntry : aDimEntries)
2980 {
2981 if (!rDimEntry.bEnabled)
2982 continue;
2983
2984 bool bDimIsCol = rDimEntry.bDimIsCol;
2985
2986 boost::property_tree::ptree aDimTree;
2987 for (const auto& rGeomEntry : aGeomEntries)
2988 {
2989 if (!rGeomEntry.bEnabled)
2990 continue;
2991
2992 OString aGeomDataEncoding = rDoc.dumpSheetGeomData(nTab, bDimIsCol, rGeomEntry.eType);
2993 // TODO: Investigate if we can avoid the copy of the 'value' string in put().
2994 aDimTree.put(rGeomEntry.pKey, aGeomDataEncoding.getStr());
2995 }
2996
2997 aTree.add_child(rDimEntry.pKey, aDimTree);
2998 }
2999
3000 return OString(getJSONString(aTree));
3001}
3002
3004{
3005 SAL_INFO("sc.lok.header",
3006 "extendTiledAreaIfNeeded: START: ClientView: ColRange["
3008 << "] RowRange[" << mnLOKStartHeaderRow << "," << mnLOKEndHeaderRow
3009 << "] MaxTiledCol = " << aViewData.GetMaxTiledCol()
3010 << " MaxTiledRow = " << aViewData.GetMaxTiledRow());
3011
3012 const tools::Rectangle rVisArea = aViewData.getLOKVisibleArea();
3013 if (rVisArea.Top() >= rVisArea.Bottom() ||
3014 rVisArea.Left() >= rVisArea.Right())
3015 return;
3016
3017 // Needed for conditional updating of visible-range/formula.
3020
3021 ScRangeProvider aRangeProvider(rVisArea, /* bInPixels */ false, aViewData);
3022 // Index bounds.
3023 const ScRange& rCellRange = aRangeProvider.getCellRange();
3024 const SCCOL nStartCol = rCellRange.aStart.Col();
3025 const SCCOL nEndCol = rCellRange.aEnd.Col();
3026 const SCROW nStartRow = rCellRange.aStart.Row();
3027 const SCROW nEndRow = rCellRange.aEnd.Row();
3028
3029 // Column/Row positions.
3030 tools::Long nStartColPos, nEndColPos, nStartRowPos, nEndRowPos;
3031 aRangeProvider.getColPositions(nStartColPos, nEndColPos);
3032 aRangeProvider.getRowPositions(nStartRowPos, nEndRowPos);
3033
3036
3037 // Update mnLOKStartHeaderCol and mnLOKEndHeaderCol members.
3038 // These are consulted in some ScGridWindow methods.
3039 if (mnLOKStartHeaderCol != nStartCol)
3040 {
3041 rWidthHelper.removeByIndex(mnLOKStartHeaderCol);
3042 rWidthHelper.insert(nStartCol, nStartColPos);
3043 mnLOKStartHeaderCol = nStartCol;
3044 }
3045
3046 if (mnLOKEndHeaderCol != nEndCol)
3047 {
3048 rWidthHelper.removeByIndex(mnLOKEndHeaderCol);
3049 rWidthHelper.insert(nEndCol, nEndColPos);
3050 mnLOKEndHeaderCol = nEndCol;
3051 }
3052
3053 // Update mnLOKStartHeaderRow and mnLOKEndHeaderRow members.
3054 // These are consulted in some ScGridWindow methods.
3055 if (mnLOKStartHeaderRow != nStartRow)
3056 {
3057 rHeightHelper.removeByIndex(mnLOKStartHeaderRow);
3058 rHeightHelper.insert(nStartRow, nStartRowPos);
3059 mnLOKStartHeaderRow = nStartRow;
3060 }
3061
3062 if (mnLOKEndHeaderRow != nEndRow)
3063 {
3064 rHeightHelper.removeByIndex(mnLOKEndHeaderRow);
3065 rHeightHelper.insert(nEndRow, nEndRowPos);
3066 mnLOKEndHeaderRow = nEndRow;
3067 }
3068
3069 constexpr SCCOL nMinExtraCols = 10;
3070 SCCOL nExtraCols = std::max<SCCOL>(nMinExtraCols, nEndCol - nStartCol);
3071 // If we are approaching current max tiled column, signal a size changed event
3072 // and invalidate the involved area.
3073 lcl_ExtendTiledDimension(/* bColumn */ true, nEndCol, nExtraCols, *this, aViewData);
3074
3075 constexpr SCROW nMinExtraRows = 25;
3076 SCROW nExtraRows = std::max(nMinExtraRows, nEndRow - nStartRow);
3077 // If we are approaching current max tiled row, signal a size changed event
3078 // and invalidate the involved area.
3079 lcl_ExtendTiledDimension(/* bColumn */ false, nEndRow, nExtraRows, *this, aViewData);
3080
3081 vcl::Region aNewVisCellRange(
3084 aNewVisCellRange.Exclude(aOldVisCellRange);
3085 tools::Rectangle aChangedCellRange = aNewVisCellRange.GetBoundRect();
3086 if (!aChangedCellRange.IsEmpty())
3087 {
3089 UpdateFormulas(aChangedCellRange.Left(), aChangedCellRange.Top(),
3090 aChangedCellRange.Right(), aChangedCellRange.Bottom());
3091 }
3092
3093 SAL_INFO("sc.lok.header",
3094 "extendTiledAreaIfNeeded: END: ClientView: ColRange["
3096 << "] RowRange[" << mnLOKStartHeaderRow << "," << mnLOKEndHeaderRow
3097 << "] MaxTiledCol = " << aViewData.GetMaxTiledCol()
3098 << " MaxTiledRow = " << aViewData.GetMaxTiledRow());
3099}
3100
3101/* 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
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() 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:2982
ScModelObj * GetModel() const
Definition: docsh.hxx:432
SC_DLLPUBLIC sal_uInt16 GetRowHeight(SCROW nRow, SCTAB nTab, bool bHiddenAsZero=true) const
Definition: document.cxx:4161
SC_DLLPUBLIC sal_uInt16 GetColWidth(SCCOL nCol, SCTAB nTab, bool bHiddenAsZero=true) const
Definition: document.cxx:4122
SC_DLLPUBLIC tools::Long GetColOffset(SCCOL nCol, SCTAB nTab, bool bHiddenAsZero=true) const
Definition: document.cxx:4224
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:982
SC_DLLPUBLIC bool RowHidden(SCROW nRow, SCTAB nTab, SCROW *pFirstRow=nullptr, SCROW *pLastRow=nullptr) const
Definition: document.cxx:4416
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:737
SC_DLLPUBLIC bool ColHidden(SCCOL nCol, SCTAB nTab, SCCOL *pFirstCol=nullptr, SCCOL *pLastCol=nullptr) const
Definition: document.cxx:4430
SC_DLLPUBLIC bool IsLayoutRTL(SCTAB nTab) const
Definition: document.cxx:974
SC_DLLPUBLIC const SfxPoolItem * GetAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich) const
Definition: document.cxx:4684
SC_DLLPUBLIC tools::Rectangle GetMMRect(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, bool bHiddenAsZero=true) const
Definition: documen3.cxx:1986
SC_DLLPUBLIC tools::Long GetRowOffset(SCROW nRow, SCTAB nTab, bool bHiddenAsZero=true) const
Definition: document.cxx:4232
css::sheet::DataPilotFieldOrientation GetDPFieldOrientation(SCCOL nCol, SCROW nRow) const
Definition: gridwin2.cxx:56
MapMode GetDrawMapMode(bool bForce=false)
MapMode for the drawinglayer objects.
Definition: gridwin3.cxx:252
void LaunchDPFieldMenu(SCCOL nCol, SCROW nRow)
Definition: gridwin.cxx:1345
const Point & GetMousePosPixel() const
Definition: gridwin.hxx:393
void LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow)
Definition: gridwin.cxx:937
void LaunchDataSelectMenu(SCCOL nCol, SCROW nRow)
Definition: gridwin.cxx:1489
void LaunchPageFieldMenu(SCCOL nCol, SCROW nRow)
Definition: gridwin.cxx:1327
bool HasAutoFilter() const
Definition: attrib.hxx:106
virtual Size getDocumentSize() final override
Definition: docuno.cxx:663
bool IsModalMode(SfxObjectShell *pDocSh=nullptr)
Definition: scmod.cxx:1597
bool IsFormulaMode()
Definition: scmod.cxx:1681
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:1939
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:1968
sal_uInt16 GetLockedModifiers() const
Definition: tabview.cxx:1974
VclPtr< ScTabSplitter > pHSplitter
Definition: tabview.hxx:147
std::array< VclPtr< ScColBar >, 2 > pColBar
Definition: tabview.hxx:143
void PaintLeft()
Definition: tabview3.cxx:2734
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:1485
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:1316
void StartDataSelect()
Definition: tabview.cxx:2278
void extendTiledAreaIfNeeded()
Definition: tabview.cxx:3003
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:2699
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:1754
VclPtr< ScTabControl > pTabControl
Definition: tabview.hxx:149
bool bInUpdateHeader
Definition: tabview.hxx:205
void SplitAtCursor()
Definition: tabview.cxx:2174
void RemoveSplit()
Definition: tabview.cxx:2165
void SetAutoSpellData(SCCOL nPosX, SCROW nPosY, const std::vector< editeng::MisspellRanges > *pRanges)
Definition: tabview.cxx:2377
void DoAddWin(ScGridWindow *pWin)
Definition: tabview5.cxx:270
void EnableAutoSpell(bool bEnable)
Definition: tabview.cxx:2337
VclPtr< ScTabSplitter > pVSplitter
Definition: tabview.hxx:148
SC_DLLPUBLIC void ScrollLines(tools::Long nDeltaX, tools::Long nDeltaY)
Definition: tabview.cxx:1388
Point GetGridOffset() const
Definition: tabview.cxx:909
Point GetChartDialogPos(const Size &rDialogSize, const tools::Rectangle &rLogicChart)
Definition: tabview.cxx:1882
void FreezeSplitters(bool bFreeze, SplitMethod eSplitMethod=SC_SPLIT_METHOD_CURSOR, SCCOLROW nFreezeIndex=-1)
Definition: tabview.cxx:1990
void UpdateHeaderWidth(const ScVSplitPos *pWhich=nullptr, const SCROW *pPosY=nullptr)
Definition: tabview.cxx:1416
OString getSheetGeometryData(bool bColumns, bool bRows, bool bSizes, bool bHidden, bool bFiltered, bool bGroups)
Definition: tabview.cxx:2929
void SetZoomPercentFromCommand(sal_uInt16 nZoomPercent)
Definition: tabview.cxx:939
Point GetInsertPos() const
Definition: tabview.cxx:1737
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:344
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:1221
void ResetAutoSpell()
Definition: tabview.cxx:2355
void SetTimer(ScGridWindow *pWin, const MouseEvent &rMEvt)
Definition: tabview.cxx:237
void ResetAutoSpellForContentChange()
Definition: tabview.cxx:2366
bool bInZoomUpdate
Definition: tabview.hxx:207
SCROW mnLOKEndHeaderRow
Definition: tabview.hxx:200
void UpdateSelectionOverlay()
Definition: tabview2.cxx:1123
void InitScrollBar(ScrollAdaptor &rScrollBar, tools::Long nMaxVal, const Link< weld::Scrollbar &, void > &rLink)
Definition: tabview.cxx:223
Point GetMousePosPixel()
Definition: tabview.cxx:1979
void UpdateFormulas(SCCOL nStartCol=-1, SCROW nStartRow=-1, SCCOL nEndCol=-1, SCROW nEndRow=-1)
Definition: tabview3.cxx:2308
void SelectAll(bool bContinue=false)
Definition: tabview2.cxx:1201
std::unique_ptr< ScDrawView > pDrawView
Definition: tabview.hxx:130
void ActivatePart(ScSplitPos eWhich)
Definition: tabview3.cxx:2907
void HideListBox()
Definition: tabview3.cxx:2996
std::array< VclPtr< ScRowBar >, 2 > pRowBar
Definition: tabview.hxx:144
void HideNoteMarker()
Definition: tabview2.cxx:1522
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:2211
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:1304
void PaintTop()
Definition: tabview3.cxx:2667
void ActiveGrabFocus()
Definition: tabview.cxx:892
double mfLastZoomScale
Definition: tabview.hxx:217
void SetNewVisArea()
Definition: tabview.cxx:2223
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:1565
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:2196
void EnableRefInput(bool bFlag)
Definition: tabview.cxx:2315
@ SC_SPLIT_METHOD_COL
Definition: tabview.hxx:296
@ SC_SPLIT_METHOD_CURSOR
Definition: tabview.hxx:296
@ SC_SPLIT_METHOD_ROW
Definition: tabview.hxx:296
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:1595
void UpdateAllOverlays()
Definition: tabview2.cxx:1137
void RepeatResize(bool bUpdateFix=true)
Definition: tabview.cxx:763
VclPtr< ScCornerButton > aTopButton
Definition: tabview.hxx:155
void DoVSplit(tools::Long nSplitPos)
Definition: tabview.cxx:1665
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:2656
void ScrollHdl(ScrollAdaptor *rScrollBar)
Definition: tabview.cxx:1068
VclPtr< ScrollAdaptor > aHScrollLeft
Definition: tabview.hxx:152
bool HasPageFieldDataAtCursor() const
Definition: tabview.cxx:2267
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:2634
bool UpdateFixX(SCTAB nTab=MAXTAB+1)
Definition: viewdata.cxx:4018
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:2900
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:1417
SCCOL GetMaxTiledCol() const
Definition: viewdata.hxx:422
void SetPosY(ScVSplitPos eWhich, SCROW nNewPosY)
Definition: viewdata.cxx:2953
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:4053
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:2785
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:2717
ScSplitPos GetActivePart() const
Definition: viewdata.hxx:398
void SetMaxTiledCol(SCCOL nCol)
Definition: viewdata.cxx:1463
Point GetScrPos(SCCOL nWhereX, SCROW nWhereY, ScSplitPos eWhich, bool bAllowNeg=false, SCTAB nForTab=-1) const
Definition: viewdata.cxx:2380
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:2676
SCCOL PrevCellsX(ScHSplitPos eWhichX) const
Definition: viewdata.cxx:2722
SCCOL VisibleCellsX(ScHSplitPos eWhichX) const
Definition: viewdata.cxx:2712
void SetMaxTiledRow(SCROW nRow)
Definition: viewdata.cxx:1485
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:2727
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:2914
double GetPPTX() const
Definition: viewdata.hxx:468
tools::Long GetVSplitPos() const
Definition: viewdata.hxx:419
SfxBindings & GetBindings()
Definition: viewdata.cxx:3134
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:1403
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(std::u16string_view pPropName, const OUString &rPropValue)
ScopedJsonWriterStruct startStruct()
void putRaw(std::string_view)
ScopedJsonWriterArray startArray(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
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:247
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:1478
#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:1582
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