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.toUtf8(), true);
116 }
117
118 OString 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:
216 // #i70320# if several sheets are selected, deselect all except the current sheet,
217 // otherwise add new sheet
218 sal_uInt16 nSlot = ( GetSelectPageCount() > 1 ) ? FID_TAB_DESELECTALL : FID_INS_TABLE;
220 pDispatcher->Execute( nSlot, SfxCallMode::SYNCHRON | SfxCallMode::RECORD );
221 // forget page ID, to be really sure that the dialog is not called twice
223 }
224
225 TabBar::MouseButtonUp( rMEvt );
226}
227
229{
231
232 // Insert a new sheet at the right end, with default name.
234 ScModule* pScMod = SC_MOD();
235 if (!rDoc.IsDocEditable() || pScMod->IsTableLocked())
236 return;
237
238 // auto-accept any in-process input - which would otherwise end up on the new sheet
239 if (!pScMod->IsFormulaMode())
240 pScMod->InputEnterHandler();
241
242 OUString aName;
244 SCTAB nTabCount = rDoc.GetTableCount();
245 pViewData->GetViewShell()->InsertTable(aName, nTabCount);
246}
247
249{
250 /* Remember last clicked page ID. */
252 /* Reset nMouseClickPageId, so that next Select() call may invalidate
253 nSelPageIdByMouse (i.e. if called from keyboard). */
255
256 ScModule* pScMod = SC_MOD();
258 ScMarkData& rMark = pViewData->GetMarkData();
259 SCTAB nCount = rDoc.GetTableCount();
260 SCTAB i;
261
262 if ( pScMod->IsTableLocked() ) // may not be switched now ?
263 {
264 // restore the old state of TabControls
265
266 for (i=0; i<nCount; i++)
267 SelectPage( static_cast<sal_uInt16>(i)+1, rMark.GetTableSelect(i) );
268 SetCurPageId( static_cast<sal_uInt16>(pViewData->GetTabNo()) + 1 );
269
270 return;
271 }
272
273 sal_uInt16 nCurId = GetCurPageId();
274 if (!nCurId) return; // for Excel import it can happen that everything is hidden
275 sal_uInt16 nPage = nCurId - 1;
276
277 // OLE-inplace deactivate
278 if ( nPage != static_cast<sal_uInt16>(pViewData->GetTabNo()) )
280
281 // InputEnterHandler onlw when not reference input
282
283 bool bRefMode = pScMod->IsFormulaMode();
284 if (!bRefMode)
285 pScMod->InputEnterHandler();
286
287 for (i=0; i<nCount; i++)
288 rMark.SelectTable( i, IsPageSelected(static_cast<sal_uInt16>(i)+1) );
289
291 if (rDisp.IsLocked())
292 pViewData->GetView()->SetTabNo( static_cast<SCTAB>(nPage) );
293 else
294 {
295 // sheet for basic is 1-based
296 SfxUInt16Item aItem( SID_CURRENTTAB, nPage + 1 );
297 rDisp.ExecuteList(SID_CURRENTTAB,
298 SfxCallMode::SLOT | SfxCallMode::RECORD, { &aItem });
299 }
300
302 rBind.Invalidate( FID_FILL_TAB );
303 rBind.Invalidate( FID_TAB_DESELECTALL );
304
305 rBind.Invalidate( FID_INS_TABLE );
306 rBind.Invalidate( FID_TAB_APPEND );
307 rBind.Invalidate( FID_TAB_MOVE );
308 rBind.Invalidate( FID_TAB_DUPLICATE );
309 rBind.Invalidate( FID_TAB_RENAME );
310 rBind.Invalidate( FID_DELETE_TABLE );
311 rBind.Invalidate( FID_TABLE_SHOW );
312 rBind.Invalidate( FID_TABLE_HIDE );
313 rBind.Invalidate( FID_TAB_SET_TAB_BG_COLOR );
314
315 // Recalculate status bar functions.
316 rBind.Invalidate( SID_TABLE_CELL );
317
318 // SetReference onlw when the consolidate dialog is open
319 // (for references over multiple sheets)
320 // for others this is only needed fidgeting
321
322 if ( bRefMode && pViewData->GetRefType() == SC_REFTYPE_REF )
323 if ( pViewData->GetViewShell()->GetViewFrame()->HasChildWindow(SID_OPENDLG_CONSOLIDATE) )
324 {
325 ScRange aRange(
328 pScMod->SetReference( aRange, rDoc, &rMark );
329 pScMod->EndReference(); // due to Auto-Hide
330 }
331}
332
334{
336 WinBits nStyle = GetStyle();
337 if (rDoc.GetDocumentShell()->IsReadOnly())
338 // no insert sheet tab for readonly doc.
339 SetStyle(nStyle & ~WB_INSERTTAB);
340 else
341 SetStyle(nStyle | WB_INSERTTAB);
342}
343
345{
347 ScMarkData& rMark = pViewData->GetMarkData();
348 bool bActive = pViewData->IsActive();
349
350 SCTAB nCount = rDoc.GetTableCount();
351 SCTAB i;
352 OUString aString;
353 SCTAB nMaxCnt = std::max( nCount, static_cast<SCTAB>(GetMaxId()) );
354 Color aTabBgColor;
355
356 bool bModified = false; // sheet name
357 for (i=0; i<nMaxCnt && !bModified; i++)
358 {
359 if (rDoc.IsVisible(i))
360 {
361 rDoc.GetName(i,aString);
362 aTabBgColor = rDoc.GetTabBgColor(i);
363 }
364 else
365 {
366 aString.clear();
367 }
368
369 if ( aString != GetPageText(static_cast<sal_uInt16>(i)+1) || (GetTabBgColor(static_cast<sal_uInt16>(i)+1) != aTabBgColor) )
370 bModified = true;
371 }
372
373 if (bModified)
374 {
375 Clear();
376 for (i=0; i<nCount; i++)
377 {
378 if (rDoc.IsVisible(i))
379 {
380 if (rDoc.GetName(i,aString))
381 {
382 if ( rDoc.IsScenario(i) )
383 InsertPage(static_cast<sal_uInt16>(i)+1, aString, TabBarPageBits::Blue);
384 else
385 InsertPage( static_cast<sal_uInt16>(i)+1, aString );
386
387 if ( rDoc.IsTabProtected(i) )
388 SetProtectionSymbol(static_cast<sal_uInt16>(i)+1, true);
389
390 if ( !rDoc.IsDefaultTabBgColor(i) )
391 {
392 aTabBgColor = rDoc.GetTabBgColor(i);
393 SetTabBgColor(static_cast<sal_uInt16>(i)+1, aTabBgColor );
394 }
395 }
396 }
397 }
398 }
399 SetCurPageId( static_cast<sal_uInt16>(pViewData->GetTabNo()) + 1 );
400
401 if (bActive)
402 {
403 bModified = false; // selection
404 for (i=0; i<nMaxCnt && !bModified; i++)
405 if ( rMark.GetTableSelect(i) != IsPageSelected(static_cast<sal_uInt16>(i)+1) )
406 bModified = true;
407
408 if ( bModified )
409 for (i=0; i<nCount; i++)
410 SelectPage( static_cast<sal_uInt16>(i)+1, rMark.GetTableSelect(i) );
411 }
412}
413
415{
416 SetEffectiveRTL( bSheetRTL );
418}
419
421{
422 if (!nId)
423 return;
424
425 bool bAlreadySelected = IsPageSelected( nId );
426 //make the clicked page the current one
427 SetCurPageId( nId );
428 //change the selection when the current one is not already
429 //selected or part of a multi selection
430 if(bAlreadySelected)
431 return;
432
433 sal_uInt16 nCount = GetMaxId();
434
435 for (sal_uInt16 i=1; i<=nCount; i++)
436 SelectPage( i, i==nId );
437 Select();
438
440 {
441 // notify LibreOfficeKit about changed page
442 OString aPayload = OString::number(nId - 1);
443 pViewData->GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_SET_PART, aPayload.getStr());
444 }
445}
446
448{
449 ScModule* pScMod = SC_MOD();
451 bool bDisable = pScMod->IsFormulaMode() || pScMod->IsModalMode();
452
453 // first activate ViewFrame (Bug 19493):
454 pViewSh->SetActive();
455
456 if (rCEvt.GetCommand() != CommandEventId::ContextMenu || bDisable)
457 return;
458
459 // #i18735# select the page that is under the mouse cursor
460 // if multiple tables are selected and the one under the cursor
461 // is not part of them then unselect them
462 sal_uInt16 nId = GetPageId( rCEvt.GetMousePosPixel() );
464
465 // #i52073# OLE inplace editing has to be stopped before showing the sheet tab context menu
466 pViewSh->DeactivateOle();
467
468 // Popup-Menu:
469 // get Dispatcher from ViewData (ViewFrame) instead of Shell (Frame), so it can't be null
470 pViewData->GetDispatcher().ExecutePopup( "sheettab" );
471}
472
473void ScTabControl::StartDrag( sal_Int8 /* nAction */, const Point& rPosPixel )
474{
475 ScModule* pScMod = SC_MOD();
476 bool bDisable = pScMod->IsFormulaMode() || pScMod->IsModalMode();
477
478 if (!bDisable)
479 {
480 vcl::Region aRegion( tools::Rectangle(0,0,0,0) );
481 CommandEvent aCEvt( rPosPixel, CommandEventId::StartDrag, true ); // needed for StartDrag
482 if (TabBar::StartDrag( aCEvt, aRegion ))
483 DoDrag();
484 }
485}
486
488{
489 ScDocShell* pDocSh = pViewData->GetDocShell();
490 ScDocument& rDoc = pDocSh->GetDocument();
491
492 SCTAB nTab = pViewData->GetTabNo();
493 ScRange aTabRange( 0, 0, nTab, rDoc.MaxCol(), rDoc.MaxRow(), nTab );
494 ScMarkData aTabMark = pViewData->GetMarkData();
495 aTabMark.ResetMark(); // doesn't change marked table information
496 aTabMark.SetMarkArea( aTabRange );
497
499 ScClipParam aClipParam(aTabRange, false);
500 rDoc.CopyToClip(aClipParam, pClipDoc.get(), &aTabMark, false, false);
501
503 pDocSh->FillTransferableObjectDescriptor( aObjDesc );
504 aObjDesc.maDisplayName = pDocSh->GetMedium()->GetURLObject().GetURLNoPass();
505 // maSize is set in ScTransferObj ctor
506
507 rtl::Reference<ScTransferObj> pTransferObj = new ScTransferObj( std::move(pClipDoc), std::move(aObjDesc) );
508
509 pTransferObj->SetDragSourceFlags(ScDragSrc::Table);
510
511 pTransferObj->SetDragSource( pDocSh, aTabMark );
512
513 pTransferObj->SetSourceCursorPos( pViewData->GetCurX(), pViewData->GetCurY() );
514
515 vcl::Window* pWindow = pViewData->GetActiveWin();
516 SC_MOD()->SetDragObject( pTransferObj.get(), nullptr ); // for internal D&D
517 pTransferObj->StartDrag( pWindow, DND_ACTION_COPYMOVE | DND_ACTION_LINK );
518}
519
520static sal_uInt16 lcl_DocShellNr( const ScDocument& rDoc )
521{
522 sal_uInt16 nShellCnt = 0;
524 while ( pShell )
525 {
526 if ( auto pDocShell = dynamic_cast<const ScDocShell *>(pShell) )
527 {
528 if ( &pDocShell->GetDocument() == &rDoc )
529 return nShellCnt;
530
531 ++nShellCnt;
532 }
533 pShell = SfxObjectShell::GetNext( *pShell );
534 }
535
536 OSL_FAIL("Document not found");
537 return 0;
538}
539
541{
543
545 const ScDragData& rData = SC_MOD()->GetDragData();
547 rData.pCellTransfer->GetSourceDocument() == &rDoc )
548 {
549 // moving of tables within the document
551 HideDropPos();
552
553 if ( nPos == rData.pCellTransfer->GetVisibleTab() && rEvt.mnAction == DND_ACTION_MOVE )
554 {
555 // #i83005# do nothing - don't move to the same position
556 // (too easily triggered unintentionally, and might take a long time in large documents)
557 }
558 else
559 {
560 if ( !rDoc.GetChangeTrack() && rDoc.IsDocEditable() )
561 {
564
565 rData.pCellTransfer->SetDragWasInternal(); // don't delete
566 return DND_ACTION_COPY;
567 }
568 }
569 }
570
571 return DND_ACTION_NONE;
572}
573
575{
576 if ( rEvt.mbLeaving )
577 {
579 HideDropPos();
580 return rEvt.mnAction;
581 }
582
583 const ScDocument& rDoc = pViewData->GetDocument();
584 const ScDragData& rData = SC_MOD()->GetDragData();
586 rData.pCellTransfer->GetSourceDocument() == &rDoc )
587 {
588 // moving of tables within the document
589 if ( !rDoc.GetChangeTrack() && rDoc.IsDocEditable() )
590 {
591 ShowDropPos( rEvt.maPosPixel );
592 return rEvt.mnAction;
593 }
594 }
595 else // switch sheets for all formats
596 {
597 SwitchPage( rEvt.maPosPixel ); // switch sheet after timeout
598 return 0; // nothing can be dropped here
599 }
600
601 return 0;
602}
603
605{
607}
608
610{
612 OSL_ENSURE( pViewSh, "pViewData->GetViewShell()" );
613
615 sal_uInt16 nId = GetEditPageId();
616 if ( nId )
617 {
618 SCTAB nTab = nId - 1;
619 OUString aNewName = GetEditText();
620 bool bDone = pViewSh->RenameTable( aNewName, nTab );
621 if ( bDone )
622 nRet = TABBAR_RENAMING_YES;
623 else if ( bErrorShown )
624 {
625 // if the error message from this TabControl is currently visible,
626 // don't end edit mode now, to avoid problems when returning to
627 // the other call (showing the error) - this should not happen
628 OSL_FAIL("ScTabControl::AllowRenaming: nested calls");
629 nRet = TABBAR_RENAMING_NO;
630 }
631 else if (pViewData->GetDocShell()->IsInModalMode())
632 {
633 // don't show error message above any modal dialog
634 // instead cancel renaming without error message
635 // e.g. start with default Sheet1, add another sheet
636 // alt+left click on Sheet2 tab, edit to say Sheet1
637 // ctrl+S to trigger modal file save dialog
639 }
640 else
641 {
642 bErrorShown = true;
643 pViewSh->ErrorMessage( STR_INVALIDTABNAME );
644 bErrorShown = false;
645 nRet = TABBAR_RENAMING_NO;
646 }
647 }
648 return nRet;
649}
650
652{
653 if ( HasFocus() )
655}
656
658{
661 {
663 if( !aRect.IsEmpty() )
664 SetPointerPosPixel( aRect.Center() );
665 nSelPageIdByMouse = TabBar::PAGE_NOT_FOUND; // only once after a Select()
666 }
667}
668
669/* 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:220
SC_DLLPUBLIC bool IsScenario(SCTAB nTab) const
Definition: documen3.cxx:438
SC_DLLPUBLIC Color GetTabBgColor(SCTAB nTab) const
Definition: documen3.cxx:454
SC_DLLPUBLIC bool IsTabProtected(SCTAB nTab) const
Definition: documen3.cxx:1919
SC_DLLPUBLIC SCCOL MaxCol() const
Definition: document.hxx:891
SC_DLLPUBLIC SCROW MaxRow() const
Definition: document.hxx:892
bool IsDocEditable() const
Definition: documen3.cxx:1913
SC_DLLPUBLIC void CopyToClip(const ScClipParam &rClipParam, ScDocument *pClipDoc, const ScMarkData *pMarks, bool bKeepScenarioFlags, bool bIncludeObjects)
Definition: document.cxx:2173
SC_DLLPUBLIC void CreateValidTabName(OUString &rName) const
Definition: document.cxx:395
SfxObjectShell * GetDocumentShell() const
Definition: document.hxx:1081
SC_DLLPUBLIC bool IsVisible(SCTAB nTab) const
Definition: document.cxx:920
ScChangeTrack * GetChangeTrack() const
Definition: document.hxx:2487
SC_DLLPUBLIC bool GetName(SCTAB nTab, OUString &rName) const
Definition: document.cxx:217
SC_DLLPUBLIC bool IsDefaultTabBgColor(SCTAB nTab) const
Definition: documen3.cxx:467
SC_DLLPUBLIC SCTAB GetTableCount() const
Definition: document.cxx:317
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:1733
bool IsModalMode(SfxObjectShell *pDocSh=nullptr)
Definition: scmod.cxx:1594
void EndReference()
Definition: scmod.cxx:1830
SC_DLLPUBLIC void InputEnterHandler(ScEnterMode nBlockMode=ScEnterMode::NORMAL, bool bBeforeSavingInLOK=false)
Definition: scmod.cxx:1408
bool IsTableLocked()
Definition: scmod.cxx:1632
bool IsFormulaMode()
Definition: scmod.cxx:1678
virtual TabBarAllowRenamingReturnCode AllowRenaming() override
Definition: tabcont.cxx:609
virtual void Command(const CommandEvent &rCEvt) override
Definition: tabcont.cxx:447
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:604
virtual void EndRenaming() override
Definition: tabcont.cxx:651
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:473
virtual void AddTabClick() override
Definition: tabcont.cxx:228
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:414
sal_uInt16 GetMaxId() const
Definition: tabcont.cxx:135
void DoDrag()
Definition: tabcont.cxx:487
virtual void dispose() override
Definition: tabcont.cxx:128
virtual sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt) override
Definition: tabcont.cxx:540
virtual ~ScTabControl() override
Definition: tabcont.cxx:123
void SwitchToPageId(sal_uInt16 nId)
Definition: tabcont.cxx:420
virtual void Select() override
Definition: tabcont.cxx:248
virtual sal_Int8 AcceptDrop(const AcceptDropEvent &rEvt) override
Definition: tabcont.cxx:574
void UpdateInputContext()
Definition: tabcont.cxx:333
sal_uInt16 nMouseClickPageId
Definition: tabcont.hxx:35
void UpdateStatus()
Definition: tabcont.cxx:344
virtual void Mirror() override
Definition: tabcont.cxx:657
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:1446
void ActiveGrabFocus()
Definition: tabview.cxx:891
SC_DLLPUBLIC void SetTabNo(SCTAB nTab, bool bNew=false, bool bExtendSelection=false, bool bSameTabButMoved=false)
Definition: tabview3.cxx:1822
void DrawMarkListHasChanged()
Definition: tabview5.cxx:486
void SetDragWasInternal()
Definition: transobj.cxx:618
SCTAB GetVisibleTab() const
Definition: transobj.hxx:88
ScDocument * GetSourceDocument()
Definition: transobj.cxx:628
ScDragSrc GetDragSourceFlags() const
Definition: transobj.hxx:89
SfxDispatcher & GetDispatcher()
Definition: viewdata.cxx:3135
ScMarkData & GetMarkData()
Definition: viewdata.cxx:3141
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:3157
ScTabViewShell * GetViewShell() const
Definition: viewdata.hxx:357
ScDBFunc * GetView() const
Definition: viewdata.cxx:863
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:3129
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:2848
bool RenameTable(const OUString &rName, SCTAB nTabNr)
Definition: viewfun2.cxx:2647
bool InsertTable(const OUString &rName, SCTAB nTabNr, bool bRecord=true)
Definition: viewfun2.cxx:2383
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 SfxObjectShell * GetNext(const SfxObjectShell &rPrev, const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
bool IsReadOnly() const
SfxMedium * GetMedium() const
static SfxObjectShell * GetFirst(const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
bool HasChildWindow(sal_uInt16)
SfxDispatcher * GetDispatcher()
SfxViewFrame * GetViewFrame() const
virtual void libreOfficeKitViewCallback(int nType, const char *pPayload) const override
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()
sal_uInt16 GetSelectPageCount() const
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:2717
@ SCDOCMODE_CLIP
Definition: document.hxx:256
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:249
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:520
#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