LibreOffice Module sc (master) 1
tabcont.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 <osl/diagnose.h>
21#include <sfx2/viewfrm.hxx>
22#include <sfx2/dispatch.hxx>
23#include <sfx2/docfile.hxx>
24#include <tools/urlobj.hxx>
25#include <vcl/commandevent.hxx>
26#include <vcl/svapp.hxx>
27#include <vcl/weldutils.hxx>
28#include <tabcont.hxx>
29#include <tabvwsh.hxx>
30#include <docsh.hxx>
31#include <scmod.hxx>
32#include <sc.hrc>
33#include <globstr.hrc>
34#include <transobj.hxx>
35#include <clipparam.hxx>
36#include <dragdata.hxx>
37#include <markdata.hxx>
38#include <gridwin.hxx>
39#include <LibreOfficeKit/LibreOfficeKitEnums.h>
40#include <comphelper/lok.hxx>
41
44 , DropTargetHelper(this)
45 , DragSourceHelper(this)
46 , pViewData(pData)
47 , nMouseClickPageId(TabBar::PAGE_NOT_FOUND)
48 , nSelPageIdByMouse(TabBar::PAGE_NOT_FOUND)
49 , bErrorShown(false)
50{
52
53 OUString aString;
54 Color aTabBgColor;
55 SCTAB nCount = rDoc.GetTableCount();
56 for (SCTAB i=0; i<nCount; i++)
57 {
58 if (rDoc.IsVisible(i))
59 {
60 if (rDoc.GetName(i,aString))
61 {
62 if ( rDoc.IsScenario(i) )
63 InsertPage( static_cast<sal_uInt16>(i)+1, aString, TabBarPageBits::Blue);
64 else
65 InsertPage( static_cast<sal_uInt16>(i)+1, aString );
66
67 if ( rDoc.IsTabProtected(i) )
68 SetProtectionSymbol(static_cast<sal_uInt16>(i)+1, true);
69
70 if ( !rDoc.IsDefaultTabBgColor(i) )
71 {
72 aTabBgColor = rDoc.GetTabBgColor(i);
73 SetTabBgColor( static_cast<sal_uInt16>(i)+1, aTabBgColor );
74 }
75 }
76 }
77 }
78
79 SetCurPageId( static_cast<sal_uInt16>(pViewData->GetTabNo()) + 1 );
80
81 SetSizePixel( Size(SC_TABBAR_DEFWIDTH, 0) );
82
83 SetSplitHdl( LINK( pViewData->GetView(), ScTabView, TabBarResize ) );
84
87
89
90 SetScrollAreaContextHdl( LINK( this, ScTabControl, ShowPageList ) );
91}
92
93IMPL_LINK(ScTabControl, ShowPageList, const CommandEvent &, rEvent, void)
94{
95 tools::Rectangle aRect(rEvent.GetMousePosPixel(), Size(1, 1));
96 weld::Window* pPopupParent = weld::GetPopupParent(*this, aRect);
97 std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(pPopupParent, "modules/scalc/ui/pagelistmenu.ui"));
98 std::unique_ptr<weld::Menu> xPopup(xBuilder->weld_menu("menu"));
99
100 sal_uInt16 nCurPageId = GetCurPageId();
101
102 ScDocument& rDoc = pViewData->GetDocument();
103 SCTAB nCount = rDoc.GetTableCount();
104 for (SCTAB i=0; i<nCount; ++i)
105 {
106 if (!rDoc.IsVisible(i))
107 continue;
108 OUString aString;
109 if (!rDoc.GetName(i, aString))
110 continue;
111 sal_uInt16 nId = static_cast<sal_uInt16>(i)+1;
112 OUString sId = OUString::number(nId);
113 xPopup->append_radio(sId, aString);
114 if (nId == nCurPageId)
115 xPopup->set_active(sId, true);
116 }
117
118 OUString sIdent(xPopup->popup_at_rect(pPopupParent, aRect));
119 if (!sIdent.isEmpty())
120 SwitchToPageId(sIdent.toUInt32());
121}
122
124{
125 disposeOnce();
126}
127
129{
130 DragSourceHelper::dispose();
131 DropTargetHelper::dispose();
133}
134
135sal_uInt16 ScTabControl::GetMaxId() const
136{
137 sal_uInt16 nVisCnt = GetPageCount();
138 if (nVisCnt)
139 return GetPageId(nVisCnt-1);
140
141 return 0;
142}
143
145{
146 sal_uInt16 nPos = ShowDropPos(rPos);
147
148 SCTAB nRealPos = static_cast<SCTAB>(nPos);
149
150 if(nPos !=0 )
151 {
153
154 SCTAB nCount = rDoc.GetTableCount();
155
156 sal_uInt16 nViewPos=0;
157 nRealPos = nCount;
158 for (SCTAB i=0; i<nCount; i++)
159 {
160 if (rDoc.IsVisible(i))
161 {
162 nViewPos++;
163 if(nViewPos==nPos)
164 {
165 SCTAB j;
166 for (j=i+1; j<nCount; j++)
167 {
168 if (rDoc.IsVisible(j))
169 {
170 break;
171 }
172 }
173 nRealPos =j;
174 break;
175 }
176 }
177 }
178 }
179 return nRealPos ;
180}
181
183{
184 ScModule* pScMod = SC_MOD();
185 if ( !pScMod->IsModalMode() && !pScMod->IsFormulaMode() && !IsInEditMode() )
186 {
187 // activate View
188 pViewData->GetViewShell()->SetActive(); // Appear and SetViewFrame
190 }
191
192 if (rMEvt.IsLeft() && rMEvt.GetModifier() == 0)
194
196}
197
199{
200 Point aPos = PixelToLogic( rMEvt.GetPosPixel() );
201
202 // mouse button down and up on same page?
203 if( nMouseClickPageId != GetPageId(aPos))
205
206 if ( rMEvt.GetClicks() == 2 && rMEvt.IsLeft() && nMouseClickPageId != 0 && nMouseClickPageId != TabBar::PAGE_NOT_FOUND )
207 {
209 pDispatcher->Execute( FID_TAB_MENU_RENAME, SfxCallMode::SYNCHRON | SfxCallMode::RECORD );
210 return;
211 }
212
213 if( nMouseClickPageId == 0 )
214 {
215 // Click in the area next to the existing tabs:
217 pDispatcher->Execute( FID_TAB_DESELECTALL, SfxCallMode::SYNCHRON | SfxCallMode::RECORD );
218 // forget page ID, to be really sure that the dialog is not called twice
220 }
221
222 TabBar::MouseButtonUp( rMEvt );
223}
224
226{
228
229 // Insert a new sheet at the right end, with default name.
231 ScModule* pScMod = SC_MOD();
232 if (!rDoc.IsDocEditable() || pScMod->IsTableLocked())
233 return;
234
235 // auto-accept any in-process input - which would otherwise end up on the new sheet
236 if (!pScMod->IsFormulaMode())
237 pScMod->InputEnterHandler();
238
239 OUString aName;
241 SCTAB nTabCount = rDoc.GetTableCount();
242 pViewData->GetViewShell()->InsertTable(aName, nTabCount);
243}
244
246{
247 /* Remember last clicked page ID. */
249 /* Reset nMouseClickPageId, so that next Select() call may invalidate
250 nSelPageIdByMouse (i.e. if called from keyboard). */
252
253 ScModule* pScMod = SC_MOD();
255 ScMarkData& rMark = pViewData->GetMarkData();
256 SCTAB nCount = rDoc.GetTableCount();
257 SCTAB i;
258
259 if ( pScMod->IsTableLocked() ) // may not be switched now ?
260 {
261 // restore the old state of TabControls
262
263 for (i=0; i<nCount; i++)
264 SelectPage( static_cast<sal_uInt16>(i)+1, rMark.GetTableSelect(i) );
265 SetCurPageId( static_cast<sal_uInt16>(pViewData->GetTabNo()) + 1 );
266
267 return;
268 }
269
270 sal_uInt16 nCurId = GetCurPageId();
271 if (!nCurId) return; // for Excel import it can happen that everything is hidden
272 sal_uInt16 nPage = nCurId - 1;
273
274 // OLE-inplace deactivate
275 if ( nPage != static_cast<sal_uInt16>(pViewData->GetTabNo()) )
277
278 // InputEnterHandler onlw when not reference input
279
280 bool bRefMode = pScMod->IsFormulaMode();
281 if (!bRefMode)
282 pScMod->InputEnterHandler();
283
284 for (i=0; i<nCount; i++)
285 rMark.SelectTable( i, IsPageSelected(static_cast<sal_uInt16>(i)+1) );
286
288 if (rDisp.IsLocked())
289 pViewData->GetView()->SetTabNo( static_cast<SCTAB>(nPage) );
290 else
291 {
292 // sheet for basic is 1-based
293 SfxUInt16Item aItem( SID_CURRENTTAB, nPage + 1 );
294 rDisp.ExecuteList(SID_CURRENTTAB,
295 SfxCallMode::SLOT | SfxCallMode::RECORD, { &aItem });
296 }
297
299 rBind.Invalidate( FID_FILL_TAB );
300 rBind.Invalidate( FID_TAB_DESELECTALL );
301
302 rBind.Invalidate( FID_INS_TABLE );
303 rBind.Invalidate( FID_TAB_APPEND );
304 rBind.Invalidate( FID_TAB_MOVE );
305 rBind.Invalidate( FID_TAB_DUPLICATE );
306 rBind.Invalidate( FID_TAB_RENAME );
307 rBind.Invalidate( FID_DELETE_TABLE );
308 rBind.Invalidate( FID_TABLE_SHOW );
309 rBind.Invalidate( FID_TABLE_HIDE );
310 rBind.Invalidate( FID_TAB_SET_TAB_BG_COLOR );
311
312 // Recalculate status bar functions.
313 rBind.Invalidate( SID_TABLE_CELL );
314
315 // SetReference onlw when the consolidate dialog is open
316 // (for references over multiple sheets)
317 // for others this is only needed fidgeting
318
319 if ( bRefMode && pViewData->GetRefType() == SC_REFTYPE_REF )
320 if ( pViewData->GetViewShell()->GetViewFrame().HasChildWindow(SID_OPENDLG_CONSOLIDATE) )
321 {
322 ScRange aRange(
325 pScMod->SetReference( aRange, rDoc, &rMark );
326 pScMod->EndReference(); // due to Auto-Hide
327 }
328}
329
331{
333 WinBits nStyle = GetStyle();
334 if (rDoc.GetDocumentShell()->IsReadOnly())
335 // no insert sheet tab for readonly doc.
336 SetStyle(nStyle & ~WB_INSERTTAB);
337 else
338 SetStyle(nStyle | WB_INSERTTAB);
339}
340
342{
344 ScMarkData& rMark = pViewData->GetMarkData();
345 bool bActive = pViewData->IsActive();
346
347 SCTAB nCount = rDoc.GetTableCount();
348 SCTAB i;
349 OUString aString;
350 SCTAB nMaxCnt = std::max( nCount, static_cast<SCTAB>(GetMaxId()) );
351 Color aTabBgColor;
352
353 bool bModified = false; // sheet name
354 for (i=0; i<nMaxCnt && !bModified; i++)
355 {
356 if (rDoc.IsVisible(i))
357 {
358 rDoc.GetName(i,aString);
359 aTabBgColor = rDoc.GetTabBgColor(i);
360 }
361 else
362 {
363 aString.clear();
364 }
365
366 if ( aString != GetPageText(static_cast<sal_uInt16>(i)+1) || (GetTabBgColor(static_cast<sal_uInt16>(i)+1) != aTabBgColor) )
367 bModified = true;
368 }
369
370 if (bModified)
371 {
372 Clear();
373 for (i=0; i<nCount; i++)
374 {
375 if (rDoc.IsVisible(i))
376 {
377 if (rDoc.GetName(i,aString))
378 {
379 if ( rDoc.IsScenario(i) )
380 InsertPage(static_cast<sal_uInt16>(i)+1, aString, TabBarPageBits::Blue);
381 else
382 InsertPage( static_cast<sal_uInt16>(i)+1, aString );
383
384 if ( rDoc.IsTabProtected(i) )
385 SetProtectionSymbol(static_cast<sal_uInt16>(i)+1, true);
386
387 if ( !rDoc.IsDefaultTabBgColor(i) )
388 {
389 aTabBgColor = rDoc.GetTabBgColor(i);
390 SetTabBgColor(static_cast<sal_uInt16>(i)+1, aTabBgColor );
391 }
392 }
393 }
394 }
395 }
396 SetCurPageId( static_cast<sal_uInt16>(pViewData->GetTabNo()) + 1 );
397
398 if (bActive)
399 {
400 bModified = false; // selection
401 for (i=0; i<nMaxCnt && !bModified; i++)
402 if ( rMark.GetTableSelect(i) != IsPageSelected(static_cast<sal_uInt16>(i)+1) )
403 bModified = true;
404
405 if ( bModified )
406 for (i=0; i<nCount; i++)
407 SelectPage( static_cast<sal_uInt16>(i)+1, rMark.GetTableSelect(i) );
408 }
409}
410
412{
413 SetEffectiveRTL( bSheetRTL );
415}
416
418{
419 if (!nId)
420 return;
421
422 bool bAlreadySelected = IsPageSelected( nId );
423 //make the clicked page the current one
424 SetCurPageId( nId );
425 //change the selection when the current one is not already
426 //selected or part of a multi selection
427 if(bAlreadySelected)
428 return;
429
430 sal_uInt16 nCount = GetMaxId();
431
432 for (sal_uInt16 i=1; i<=nCount; i++)
433 SelectPage( i, i==nId );
434 Select();
435
437 {
438 // notify LibreOfficeKit about changed page
439 OString aPayload = OString::number(nId - 1);
440 pViewData->GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_SET_PART, aPayload);
441 }
442}
443
445{
446 ScModule* pScMod = SC_MOD();
448 bool bDisable = pScMod->IsFormulaMode() || pScMod->IsModalMode();
449
450 // first activate ViewFrame (Bug 19493):
451 pViewSh->SetActive();
452
453 if (rCEvt.GetCommand() != CommandEventId::ContextMenu || bDisable)
454 return;
455
456 // #i18735# select the page that is under the mouse cursor
457 // if multiple tables are selected and the one under the cursor
458 // is not part of them then unselect them
459 sal_uInt16 nId = GetPageId( rCEvt.GetMousePosPixel() );
461
462 // #i52073# OLE inplace editing has to be stopped before showing the sheet tab context menu
463 pViewSh->DeactivateOle();
464
465 // Popup-Menu:
466 // get Dispatcher from ViewData (ViewFrame) instead of Shell (Frame), so it can't be null
467 pViewData->GetDispatcher().ExecutePopup( "sheettab" );
468}
469
470void ScTabControl::StartDrag( sal_Int8 /* nAction */, const Point& rPosPixel )
471{
472 ScModule* pScMod = SC_MOD();
473 bool bDisable = pScMod->IsFormulaMode() || pScMod->IsModalMode();
474
475 if (!bDisable)
476 {
477 vcl::Region aRegion( tools::Rectangle(0,0,0,0) );
478 CommandEvent aCEvt( rPosPixel, CommandEventId::StartDrag, true ); // needed for StartDrag
479 if (TabBar::StartDrag( aCEvt, aRegion ))
480 DoDrag();
481 }
482}
483
485{
486 ScDocShell* pDocSh = pViewData->GetDocShell();
487 ScDocument& rDoc = pDocSh->GetDocument();
488
489 SCTAB nTab = pViewData->GetTabNo();
490 ScRange aTabRange( 0, 0, nTab, rDoc.MaxCol(), rDoc.MaxRow(), nTab );
491 ScMarkData aTabMark = pViewData->GetMarkData();
492 aTabMark.ResetMark(); // doesn't change marked table information
493 aTabMark.SetMarkArea( aTabRange );
494
496 ScClipParam aClipParam(aTabRange, false);
497 rDoc.CopyToClip(aClipParam, pClipDoc.get(), &aTabMark, false, false);
498
500 pDocSh->FillTransferableObjectDescriptor( aObjDesc );
501 aObjDesc.maDisplayName = pDocSh->GetMedium()->GetURLObject().GetURLNoPass();
502 // maSize is set in ScTransferObj ctor
503
504 rtl::Reference<ScTransferObj> pTransferObj = new ScTransferObj( std::move(pClipDoc), std::move(aObjDesc) );
505
506 pTransferObj->SetDragSourceFlags(ScDragSrc::Table);
507
508 pTransferObj->SetDragSource( pDocSh, aTabMark );
509
510 pTransferObj->SetSourceCursorPos( pViewData->GetCurX(), pViewData->GetCurY() );
511
512 vcl::Window* pWindow = pViewData->GetActiveWin();
513 SC_MOD()->SetDragObject( pTransferObj.get(), nullptr ); // for internal D&D
514 pTransferObj->StartDrag( pWindow, DND_ACTION_COPYMOVE | DND_ACTION_LINK );
515}
516
517static sal_uInt16 lcl_DocShellNr( const ScDocument& rDoc )
518{
519 sal_uInt16 nShellCnt = 0;
521 while ( pShell )
522 {
523 if ( auto pDocShell = dynamic_cast<const ScDocShell *>(pShell) )
524 {
525 if ( &pDocShell->GetDocument() == &rDoc )
526 return nShellCnt;
527
528 ++nShellCnt;
529 }
530 pShell = SfxObjectShell::GetNext( *pShell );
531 }
532
533 OSL_FAIL("Document not found");
534 return 0;
535}
536
538{
540
542 const ScDragData& rData = SC_MOD()->GetDragData();
544 rData.pCellTransfer->GetSourceDocument() == &rDoc )
545 {
546 // moving of tables within the document
548 HideDropPos();
549
550 if ( nPos == rData.pCellTransfer->GetVisibleTab() && rEvt.mnAction == DND_ACTION_MOVE )
551 {
552 // #i83005# do nothing - don't move to the same position
553 // (too easily triggered unintentionally, and might take a long time in large documents)
554 }
555 else
556 {
557 if ( !rDoc.GetChangeTrack() && rDoc.IsDocEditable() )
558 {
561
562 rData.pCellTransfer->SetDragWasInternal(); // don't delete
563 return DND_ACTION_COPY;
564 }
565 }
566 }
567
568 return DND_ACTION_NONE;
569}
570
572{
573 if ( rEvt.mbLeaving )
574 {
576 HideDropPos();
577 return rEvt.mnAction;
578 }
579
580 const ScDocument& rDoc = pViewData->GetDocument();
581 const ScDragData& rData = SC_MOD()->GetDragData();
583 rData.pCellTransfer->GetSourceDocument() == &rDoc )
584 {
585 // moving of tables within the document
586 if ( !rDoc.GetChangeTrack() && rDoc.IsDocEditable() )
587 {
588 ShowDropPos( rEvt.maPosPixel );
589 return rEvt.mnAction;
590 }
591 }
592 else // switch sheets for all formats
593 {
594 SwitchPage( rEvt.maPosPixel ); // switch sheet after timeout
595 return 0; // nothing can be dropped here
596 }
597
598 return 0;
599}
600
602{
604}
605
607{
609 OSL_ENSURE( pViewSh, "pViewData->GetViewShell()" );
610
612 sal_uInt16 nId = GetEditPageId();
613 if ( nId )
614 {
615 SCTAB nTab = nId - 1;
616 OUString aNewName = GetEditText();
617 bool bDone = pViewSh->RenameTable( aNewName, nTab );
618 if ( bDone )
619 nRet = TABBAR_RENAMING_YES;
620 else if ( bErrorShown )
621 {
622 // if the error message from this TabControl is currently visible,
623 // don't end edit mode now, to avoid problems when returning to
624 // the other call (showing the error) - this should not happen
625 OSL_FAIL("ScTabControl::AllowRenaming: nested calls");
626 nRet = TABBAR_RENAMING_NO;
627 }
628 else if (pViewData->GetDocShell()->IsInModalMode())
629 {
630 // don't show error message above any modal dialog
631 // instead cancel renaming without error message
632 // e.g. start with default Sheet1, add another sheet
633 // alt+left click on Sheet2 tab, edit to say Sheet1
634 // ctrl+S to trigger modal file save dialog
636 }
637 else
638 {
639 bErrorShown = true;
640 pViewSh->ErrorMessage( STR_INVALIDTABNAME );
641 bErrorShown = false;
642 nRet = TABBAR_RENAMING_NO;
643 }
644 }
645 return nRet;
646}
647
649{
650 if ( HasFocus() )
652}
653
655{
658 {
660 if( !aRect.IsEmpty() )
661 SetPointerPosPixel( aRect.Center() );
662 nSelPageIdByMouse = TabBar::PAGE_NOT_FOUND; // only once after a Select()
663 }
664}
665
666/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static std::unique_ptr< weld::Builder > CreateBuilder(weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false, sal_uInt64 nLOKWindowId=0)
CommandEventId GetCommand() const
const Point & GetMousePosPixel() const
OUString GetURLNoPass(DecodeMechanism eMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
sal_uInt16 GetModifier() const
sal_uInt16 GetClicks() const
const Point & GetPosPixel() const
bool IsLeft() const
const ScDocument & GetDocument() const
Definition: docsh.hxx:219
SC_DLLPUBLIC bool IsScenario(SCTAB nTab) const
Definition: documen3.cxx:432
SC_DLLPUBLIC Color GetTabBgColor(SCTAB nTab) const
Definition: documen3.cxx:449
SC_DLLPUBLIC bool IsTabProtected(SCTAB nTab) const
Definition: documen3.cxx:1905
SC_DLLPUBLIC SCCOL MaxCol() const
Definition: document.hxx:892
SC_DLLPUBLIC SCROW MaxRow() const
Definition: document.hxx:893
bool IsDocEditable() const
Definition: documen3.cxx:1899
SC_DLLPUBLIC void CopyToClip(const ScClipParam &rClipParam, ScDocument *pClipDoc, const ScMarkData *pMarks, bool bKeepScenarioFlags, bool bIncludeObjects)
Definition: document.cxx:2142
SC_DLLPUBLIC void CreateValidTabName(OUString &rName) const
Definition: document.cxx:375
SfxObjectShell * GetDocumentShell() const
Definition: document.hxx:1083
SC_DLLPUBLIC bool IsVisible(SCTAB nTab) const
Definition: document.cxx:890
ScChangeTrack * GetChangeTrack() const
Definition: document.hxx:2494
SC_DLLPUBLIC bool GetName(SCTAB nTab, OUString &rName) const
Definition: document.cxx:204
SC_DLLPUBLIC bool IsDefaultTabBgColor(SCTAB nTab) const
Definition: documen3.cxx:462
SC_DLLPUBLIC SCTAB GetTableCount() const
Definition: document.cxx:297
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
Definition: markdata.hxx:43
void SelectTable(SCTAB nTab, bool bNew)
Definition: markdata.cxx:157
bool GetTableSelect(SCTAB nTab) const
Definition: markdata.cxx:169
void ResetMark()
Definition: markdata.cxx:80
void SetMarkArea(const ScRange &rRange)
Definition: markdata.cxx:92
void SetReference(const ScRange &rRef, ScDocument &rDoc, const ScMarkData *pMarkData=nullptr)
Definition: scmod.cxx:1736
bool IsModalMode(SfxObjectShell *pDocSh=nullptr)
Definition: scmod.cxx:1597
void EndReference()
Definition: scmod.cxx:1833
SC_DLLPUBLIC void InputEnterHandler(ScEnterMode nBlockMode=ScEnterMode::NORMAL, bool bBeforeSavingInLOK=false)
Definition: scmod.cxx:1411
bool IsTableLocked()
Definition: scmod.cxx:1635
bool IsFormulaMode()
Definition: scmod.cxx:1681
virtual TabBarAllowRenamingReturnCode AllowRenaming() override
Definition: tabcont.cxx:606
virtual void Command(const CommandEvent &rCEvt) override
Definition: tabcont.cxx:444
virtual void MouseButtonUp(const MouseEvent &rMEvt) override
Definition: tabcont.cxx:198
ScViewData * pViewData
Definition: tabcont.hxx:34
SCTAB GetPrivatDropPos(const Point &rPos)
Definition: tabcont.cxx:144
virtual bool StartRenaming() override
Definition: tabcont.cxx:601
virtual void EndRenaming() override
Definition: tabcont.cxx:648
bool bErrorShown
Selected page ID, if selected with mouse.
Definition: tabcont.hxx:37
virtual void StartDrag(sal_Int8 nAction, const Point &rPosPixel) override
Definition: tabcont.cxx:470
virtual void AddTabClick() override
Definition: tabcont.cxx:225
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
Definition: tabcont.cxx:182
ScTabControl(vcl::Window *pParent, ScViewData *pData)
Definition: tabcont.cxx:42
void SetSheetLayoutRTL(bool bSheetRTL)
Definition: tabcont.cxx:411
sal_uInt16 GetMaxId() const
Definition: tabcont.cxx:135
void DoDrag()
Definition: tabcont.cxx:484
virtual void dispose() override
Definition: tabcont.cxx:128
virtual sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt) override
Definition: tabcont.cxx:537
virtual ~ScTabControl() override
Definition: tabcont.cxx:123
void SwitchToPageId(sal_uInt16 nId)
Definition: tabcont.cxx:417
virtual void Select() override
Definition: tabcont.cxx:245
virtual sal_Int8 AcceptDrop(const AcceptDropEvent &rEvt) override
Definition: tabcont.cxx:571
void UpdateInputContext()
Definition: tabcont.cxx:330
sal_uInt16 nMouseClickPageId
Definition: tabcont.hxx:35
void UpdateStatus()
Definition: tabcont.cxx:341
virtual void Mirror() override
Definition: tabcont.cxx:654
sal_uInt16 nSelPageIdByMouse
Last page ID after mouse button down/up.
Definition: tabcont.hxx:36
void SetActive()
Definition: tabvwsh4.cxx:276
void DeactivateOle()
Definition: tabvwshb.cxx:308
void ErrorMessage(TranslateId pGlobStrId)
Definition: tabview2.cxx:1553
void ActiveGrabFocus()
Definition: tabview.cxx:892
SC_DLLPUBLIC void SetTabNo(SCTAB nTab, bool bNew=false, bool bExtendSelection=false, bool bSameTabButMoved=false)
Definition: tabview3.cxx:1819
void DrawMarkListHasChanged()
Definition: tabview5.cxx:483
void SetDragWasInternal()
Definition: transobj.cxx:618
SCTAB GetVisibleTab() const
Definition: transobj.hxx:90
ScDocument * GetSourceDocument()
Definition: transobj.cxx:628
ScDragSrc GetDragSourceFlags() const
Definition: transobj.hxx:91
SfxDispatcher & GetDispatcher()
Definition: viewdata.cxx:3140
ScMarkData & GetMarkData()
Definition: viewdata.cxx:3146
SCTAB GetTabNo() const
Definition: viewdata.hxx:395
ScDocument & GetDocument() const
Definition: viewdata.hxx:380
SCCOL GetRefStartX() const
Definition: viewdata.hxx:532
ScRefType GetRefType() const
Definition: viewdata.hxx:531
ScDocShell * GetDocShell() const
Definition: viewdata.hxx:354
ScGridWindow * GetActiveWin()
Definition: viewdata.cxx:3162
ScTabViewShell * GetViewShell() const
Definition: viewdata.hxx:357
ScDBFunc * GetView() const
Definition: viewdata.cxx:864
SCROW GetRefEndY() const
Definition: viewdata.hxx:536
SCTAB GetRefStartZ() const
Definition: viewdata.hxx:534
bool IsActive() const
Definition: viewdata.hxx:382
SCCOL GetRefEndX() const
Definition: viewdata.hxx:535
SCROW GetRefStartY() const
Definition: viewdata.hxx:533
SCTAB GetRefEndZ() const
Definition: viewdata.hxx:537
SfxBindings & GetBindings()
Definition: viewdata.cxx:3134
SCROW GetCurY() const
Definition: viewdata.hxx:402
SCCOL GetCurX() const
Definition: viewdata.hxx:401
void MoveTable(sal_uInt16 nDestDocNo, SCTAB nDestTab, bool bCopy, const OUString *pNewTabName=nullptr)
Definition: viewfun2.cxx:2846
bool RenameTable(const OUString &rName, SCTAB nTabNr)
Definition: viewfun2.cxx:2645
bool InsertTable(const OUString &rName, SCTAB nTabNr, bool bRecord=true)
Definition: viewfun2.cxx:2381
void Invalidate(sal_uInt16 nId)
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
bool IsLocked() const
void ExecutePopup(const OUString &rResName, vcl::Window *pWin=nullptr, const Point *pPos=nullptr)
const INetURLObject & GetURLObject() const
void FillTransferableObjectDescriptor(TransferableObjectDescriptor &rDesc) const
bool IsInModalMode() const
static SAL_WARN_UNUSED_RESULT SfxObjectShell * GetNext(const SfxObjectShell &rPrev, const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
bool IsReadOnly() const
SfxMedium * GetMedium() const
static SAL_WARN_UNUSED_RESULT SfxObjectShell * GetFirst(const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
bool HasChildWindow(sal_uInt16)
SfxDispatcher * GetDispatcher()
virtual void libreOfficeKitViewCallback(int nType, const OString &pPayload) const override
SfxViewFrame & GetViewFrame() const
sal_uInt16 GetEditPageId() const
void SetTabBgColor(sal_uInt16 nPageId, const Color &aTabBgColor)
bool IsInEditMode() const
bool IsPageSelected(sal_uInt16 nPageId) const
void SetCurPageId(sal_uInt16 nPageId)
sal_uInt16 ShowDropPos(const Point &rPos)
static const sal_uInt16 PAGE_NOT_FOUND
void SelectPage(sal_uInt16 nPageId, bool bSelect)
WinBits GetStyle() const
virtual void Mirror()
virtual void MouseButtonUp(const MouseEvent &rMEvt) override
void HideDropPos()
void SetScrollAlwaysEnabled(bool bScrollAlwaysEnabled)
void SetEffectiveRTL(bool bRTL)
void SetStyle(WinBits nStyle)
void Clear()
void EndSwitchPage()
tools::Rectangle GetPageRect(sal_uInt16 nPageId) const
const OUString & GetEditText() const
void SetScrollAreaContextHdl(const Link< const CommandEvent &, void > &rLink)
void EnableEditMode()
OUString GetPageText(sal_uInt16 nPageId) const
sal_uInt16 GetPageCount() const
virtual void InsertPage(sal_uInt16 nPageId, const OUString &rText, TabBarPageBits nBits=TabBarPageBits::NONE, sal_uInt16 nPos=TabBar::APPEND)
bool StartDrag(const CommandEvent &rCEvt, vcl::Region &rRegion)
sal_uInt16 GetPageId(sal_uInt16 nPos) const
void SwitchPage(const Point &rPos)
void SetSplitHdl(const Link< TabBar *, void > &rLink)
sal_uInt16 GetCurPageId() const
void SetProtectionSymbol(sal_uInt16 nPageId, bool bProtection)
Color GetTabBgColor(sal_uInt16 nPageId) const
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
virtual void AddTabClick()
virtual void dispose() override
constexpr Point Center() const
constexpr bool IsEmpty() const
int nCount
std::unique_ptr< ScDocument, o3tl::default_delete< ScDocument > > ScDocumentUniquePtr
Definition: document.hxx:2720
@ SCDOCMODE_CLIP
Definition: document.hxx:257
OUString aName
sal_uInt16 nPos
std::unique_ptr< sal_Int32[]> pData
int i
weld::Window * GetPopupParent(vcl::Window &rOutWin, tools::Rectangle &rRect)
sal_Int16 nId
#define SC_MOD()
Definition: scmod.hxx:247
sal_Int8 mnAction
This struct stores general clipboard parameters associated with a ScDocument instance created in clip...
Definition: clipparam.hxx:31
ScTransferObj * pCellTransfer
Definition: dragdata.hxx:20
TabBarAllowRenamingReturnCode
TABBAR_RENAMING_NO
TABBAR_RENAMING_CANCEL
TABBAR_RENAMING_YES
#define WB_INSERTTAB
#define WB_MULTISELECT
#define WB_RANGESELECT
#define WB_MINSCROLL
IMPL_LINK(ScTabControl, ShowPageList, const CommandEvent &, rEvent, void)
Definition: tabcont.cxx:93
static sal_uInt16 lcl_DocShellNr(const ScDocument &rDoc)
Definition: tabcont.cxx:517
#define SC_TABBAR_DEFWIDTH
Definition: tabcont.hxx:29
#define DND_ACTION_COPYMOVE
#define DND_ACTION_MOVE
#define DND_ACTION_COPY
#define DND_ACTION_LINK
#define DND_ACTION_NONE
signed char sal_Int8
sal_Int16 SCTAB
Definition: types.hxx:22
OUString sId
@ SC_REFTYPE_REF
Definition: viewdata.hxx:55
sal_Int64 WinBits
WinBits const WB_DRAG
WinBits const WB_3DLOOK
WinBits const WB_SCROLL