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