LibreOffice Module sc (master)  1
tabvwsh3.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 <sfx2/bindings.hxx>
21 #include <sfx2/dispatch.hxx>
22 #include <sfx2/passwd.hxx>
23 #include <sfx2/request.hxx>
24 #include <sfx2/sidebar/Sidebar.hxx>
25 #include <svl/ptitem.hxx>
26 #include <svl/stritem.hxx>
27 #include <tools/urlobj.hxx>
28 #include <sfx2/objface.hxx>
29 #include <vcl/vclenum.hxx>
30 
31 #include <globstr.hrc>
32 #include <strings.hrc>
33 #include <scmod.hxx>
34 #include <appoptio.hxx>
35 #include <tabvwsh.hxx>
36 #include <document.hxx>
37 #include <sc.hrc>
38 #include <helpids.h>
39 #include <inputwin.hxx>
40 #include <scresid.hxx>
41 #include <docsh.hxx>
42 #include <rangeutl.hxx>
43 #include <reffact.hxx>
44 #include <tabprotection.hxx>
45 #include <protectiondlg.hxx>
46 #include <markdata.hxx>
47 
48 #include <svl/ilstitem.hxx>
49 #include <vector>
50 
51 #include <svx/zoomslideritem.hxx>
52 #include <svx/svxdlg.hxx>
53 #include <comphelper/lok.hxx>
54 #include <comphelper/string.hxx>
55 #include <sfx2/lokhelper.hxx>
56 #include <scabstdlg.hxx>
57 
58 namespace
59 {
60  enum class DetectFlags
61  {
62  NONE,
63  RANGE,
64  ADDRESS
65  };
66 
67  struct ScRefFlagsAndType
68  {
69  ScRefFlags nResult;
70  DetectFlags eDetected;
71  };
72 
73  ScRefFlagsAndType lcl_ParseRangeOrAddress(ScRange& rScRange, ScAddress& rScAddress,
74  const OUString& aAddress, const ScDocument* pDoc)
75  {
76  ScRefFlagsAndType aRet;
77 
79 
80  // start with the address convention set in the document
81  eConv = pDoc->GetAddressConvention();
82  aRet.nResult = rScRange.Parse(aAddress, pDoc, eConv);
83  if (aRet.nResult & ScRefFlags::VALID)
84  {
85  aRet.eDetected = DetectFlags::RANGE;
86  return aRet;
87  }
88 
89  aRet.nResult = rScAddress.Parse(aAddress, pDoc, eConv);
90  if (aRet.nResult & ScRefFlags::VALID)
91  {
92  aRet.eDetected = DetectFlags::ADDRESS;
93  return aRet;
94  }
95 
96  // try the default Calc (A1) address convention
97  aRet.nResult = rScRange.Parse(aAddress, pDoc);
98  if (aRet.nResult & ScRefFlags::VALID)
99  {
100  aRet.eDetected = DetectFlags::RANGE;
101  return aRet;
102  }
103 
104  aRet.nResult = rScAddress.Parse(aAddress, pDoc);
105  if (aRet.nResult & ScRefFlags::VALID)
106  {
107  aRet.eDetected = DetectFlags::ADDRESS;
108  return aRet;
109  }
110 
111  // try the Excel A1 address convention
112  aRet.nResult = rScRange.Parse(aAddress, pDoc, formula::FormulaGrammar::CONV_XL_A1);
113  if (aRet.nResult & ScRefFlags::VALID)
114  {
115  aRet.eDetected = DetectFlags::RANGE;
116  return aRet;
117  }
118 
119  // try the Excel A1 address convention
120  aRet.nResult = rScAddress.Parse(aAddress, pDoc, formula::FormulaGrammar::CONV_XL_A1);
121  if (aRet.nResult & ScRefFlags::VALID)
122  {
123  aRet.eDetected = DetectFlags::ADDRESS;
124  return aRet;
125  }
126 
127  // try Excel R1C1 address convention
128  aRet.nResult = rScRange.Parse(aAddress, pDoc, formula::FormulaGrammar::CONV_XL_R1C1);
129  if (aRet.nResult & ScRefFlags::VALID)
130  {
131  aRet.eDetected = DetectFlags::RANGE;
132  return aRet;
133  }
134 
135  aRet.nResult = rScAddress.Parse(aAddress, pDoc, formula::FormulaGrammar::CONV_XL_R1C1);
136  if (aRet.nResult & ScRefFlags::VALID)
137  {
138  aRet.eDetected = DetectFlags::ADDRESS;
139  return aRet;
140  }
141 
142  aRet.nResult = ScRefFlags::ZERO;
143  aRet.eDetected = DetectFlags::NONE;
144 
145  return aRet;
146  }
147 }
148 
150 {
151  SfxViewFrame* pThisFrame = GetViewFrame();
152  SfxBindings& rBindings = pThisFrame->GetBindings();
153  ScModule* pScMod = SC_MOD();
154  const SfxItemSet* pReqArgs = rReq.GetArgs();
155  sal_uInt16 nSlot = rReq.GetSlot();
156 
157  if (nSlot != SID_CURRENTCELL) // comes with MouseButtonUp
158  HideListBox(); // Autofilter-DropDown-Listbox
159 
160  switch ( nSlot )
161  {
162  case FID_INSERT_FILE:
163  {
164  const SfxPoolItem* pItem;
165  if ( pReqArgs &&
166  pReqArgs->GetItemState(FID_INSERT_FILE,true,&pItem) == SfxItemState::SET )
167  {
168  OUString aFileName = static_cast<const SfxStringItem*>(pItem)->GetValue();
169 
170  // insert position
171 
172  Point aInsertPos;
173  if ( pReqArgs->GetItemState(FN_PARAM_1,true,&pItem) == SfxItemState::SET )
174  aInsertPos = static_cast<const SfxPointItem*>(pItem)->GetValue();
175  else
176  aInsertPos = GetInsertPos();
177 
178  // as Link?
179 
180  bool bAsLink = false;
181  if ( pReqArgs->GetItemState(FN_PARAM_2,true,&pItem) == SfxItemState::SET )
182  bAsLink = static_cast<const SfxBoolItem*>(pItem)->GetValue();
183 
184  // execute
185 
186  PasteFile( aInsertPos, aFileName, bAsLink );
187  }
188  }
189  break;
190 
191  case SID_OPENDLG_EDIT_PRINTAREA:
192  {
193  sal_uInt16 nId = ScPrintAreasDlgWrapper::GetChildWindowId();
194  SfxChildWindow* pWnd = pThisFrame->GetChildWindow( nId );
195 
196  pScMod->SetRefDialog( nId, pWnd == nullptr );
197  }
198  break;
199 
200  case SID_CHANGE_PRINTAREA:
201  {
202  if ( pReqArgs ) // OK from dialog
203  {
204  OUString aPrintStr;
205  OUString aRowStr;
206  OUString aColStr;
207  bool bEntire = false;
208  const SfxPoolItem* pItem;
209  if ( pReqArgs->GetItemState( SID_CHANGE_PRINTAREA, true, &pItem ) == SfxItemState::SET )
210  aPrintStr = static_cast<const SfxStringItem*>(pItem)->GetValue();
211  if ( pReqArgs->GetItemState( FN_PARAM_2, true, &pItem ) == SfxItemState::SET )
212  aRowStr = static_cast<const SfxStringItem*>(pItem)->GetValue();
213  if ( pReqArgs->GetItemState( FN_PARAM_3, true, &pItem ) == SfxItemState::SET )
214  aColStr = static_cast<const SfxStringItem*>(pItem)->GetValue();
215  if ( pReqArgs->GetItemState( FN_PARAM_4, true, &pItem ) == SfxItemState::SET )
216  bEntire = static_cast<const SfxBoolItem*>(pItem)->GetValue();
217 
218  SetPrintRanges( bEntire, &aPrintStr, &aColStr, &aRowStr, false );
219 
220  rReq.Done();
221  }
222  }
223  break;
224 
225  case SID_ADD_PRINTAREA:
226  case SID_DEFINE_PRINTAREA: // menu or basic
227  {
228  bool bAdd = ( nSlot == SID_ADD_PRINTAREA );
229  if ( pReqArgs )
230  {
231  OUString aPrintStr;
232  const SfxPoolItem* pItem;
233  if ( pReqArgs->GetItemState( SID_DEFINE_PRINTAREA, true, &pItem ) == SfxItemState::SET )
234  aPrintStr = static_cast<const SfxStringItem*>(pItem)->GetValue();
235  SetPrintRanges( false, &aPrintStr, nullptr, nullptr, bAdd );
236  }
237  else
238  {
239  SetPrintRanges( false, nullptr, nullptr, nullptr, bAdd ); // from selection
240  rReq.Done();
241  }
242  }
243  break;
244 
245  case SID_DELETE_PRINTAREA:
246  {
247  // Clear currently defined print range if any, and reset it to
248  // print entire sheet which is the default.
249  OUString aEmpty;
250  SetPrintRanges(true, &aEmpty, nullptr, nullptr, false);
251  rReq.Done();
252  }
253  break;
254 
255  case FID_DEL_MANUALBREAKS:
257  rReq.Done();
258  break;
259 
260  case FID_ADJUST_PRINTZOOM:
261  AdjustPrintZoom();
262  rReq.Done();
263  break;
264 
265  case FID_RESET_PRINTZOOM:
266  SetPrintZoom( 100 ); // 100%, not on pages
267  rReq.Done();
268  break;
269 
270  case SID_FORMATPAGE:
271  case SID_STATUS_PAGESTYLE:
272  case SID_HFEDIT:
274  ExecutePageStyle( *this, rReq, GetViewData().GetTabNo() );
275  break;
276 
277  case SID_JUMPTOMARK:
278  case SID_CURRENTCELL:
279  if ( pReqArgs )
280  {
281  OUString aAddress;
282  const SfxPoolItem* pItem;
283  if ( pReqArgs->GetItemState( nSlot, true, &pItem ) == SfxItemState::SET )
284  aAddress = static_cast<const SfxStringItem*>(pItem)->GetValue();
285  else if ( nSlot == SID_JUMPTOMARK && pReqArgs->GetItemState(
286  SID_JUMPTOMARK, true, &pItem ) == SfxItemState::SET )
287  aAddress = static_cast<const SfxStringItem*>(pItem)->GetValue();
288 
289  // #i14927# SID_CURRENTCELL with a single cell must unmark if FN_PARAM_1
290  // isn't set (for recorded macros, because IsAPI is no longer available).
291  // ScGridWindow::MouseButtonUp no longer executes the slot for a single
292  // cell if there is a multi selection.
293  bool bUnmark = ( nSlot == SID_CURRENTCELL );
294  if ( pReqArgs->GetItemState( FN_PARAM_1, true, &pItem ) == SfxItemState::SET )
295  bUnmark = static_cast<const SfxBoolItem*>(pItem)->GetValue();
296 
297  bool bAlignToCursor = true;
298  if (pReqArgs->GetItemState(FN_PARAM_2, true, &pItem) == SfxItemState::SET)
299  bAlignToCursor = static_cast<const SfxBoolItem*>(pItem)->GetValue();
300 
301  if ( nSlot == SID_JUMPTOMARK )
302  {
303  // URL has to be decoded for escaped characters (%20)
304  aAddress = INetURLObject::decode( aAddress,
306  }
307 
308  bool bFound = false;
309  ScViewData& rViewData = GetViewData();
310  ScDocument* pDoc = rViewData.GetDocument();
311  ScMarkData& rMark = rViewData.GetMarkData();
312  ScRange aScRange;
313  ScAddress aScAddress;
314  ScRefFlagsAndType aResult = lcl_ParseRangeOrAddress(aScRange, aScAddress, aAddress, pDoc);
315  ScRefFlags nResult = aResult.nResult;
316  SCTAB nTab = rViewData.GetTabNo();
317  bool bMark = true;
318 
319  // Is this a range ?
320  if (aResult.eDetected == DetectFlags::RANGE)
321  {
322  if ( nResult & ScRefFlags::TAB_3D )
323  {
324  if( aScRange.aStart.Tab() != nTab )
325  {
326  nTab = aScRange.aStart.Tab();
327  SetTabNo( nTab );
328  }
329  }
330  else
331  {
332  aScRange.aStart.SetTab( nTab );
333  aScRange.aEnd.SetTab( nTab );
334  }
335  }
336  // Is this a cell ?
337  else if (aResult.eDetected == DetectFlags::ADDRESS)
338  {
339  if ( nResult & ScRefFlags::TAB_3D )
340  {
341  if( aScAddress.Tab() != nTab )
342  {
343  nTab = aScAddress.Tab();
344  SetTabNo( nTab );
345  }
346  }
347  else
348  aScAddress.SetTab( nTab );
349 
350  aScRange = ScRange( aScAddress, aScAddress );
351  // cells should not be marked
352  bMark = false;
353  }
354  // Is it a named area (first named ranges then database ranges)?
355  else
356  {
358  if( ScRangeUtil::MakeRangeFromName( aAddress, pDoc, nTab, aScRange, RUTL_NAMES, eConv ) ||
359  ScRangeUtil::MakeRangeFromName( aAddress, pDoc, nTab, aScRange, RUTL_DBASE, eConv ) )
360  {
361  nResult |= ScRefFlags::VALID;
362  if( aScRange.aStart.Tab() != nTab )
363  {
364  nTab = aScRange.aStart.Tab();
365  SetTabNo( nTab );
366  }
367  }
368  }
369 
370  if ( !(nResult & ScRefFlags::VALID) && comphelper::string::isdigitAsciiString(aAddress) )
371  {
372  sal_Int32 nNumeric = aAddress.toInt32();
373  if ( nNumeric > 0 && nNumeric <= pDoc->MaxRow()+1 )
374  {
375  // one-based row numbers
376 
377  aScAddress.SetRow( static_cast<SCROW>(nNumeric - 1) );
378  aScAddress.SetCol( rViewData.GetCurX() );
379  aScAddress.SetTab( nTab );
380  aScRange = ScRange( aScAddress, aScAddress );
381  bMark = false;
382  nResult = ScRefFlags::VALID;
383  }
384  }
385 
386  if ( !pDoc->ValidRow(aScRange.aStart.Row()) || !pDoc->ValidRow(aScRange.aEnd.Row()) )
387  nResult = ScRefFlags::ZERO;
388 
389  // we have found something
390  if( nResult & ScRefFlags::VALID )
391  {
392  bFound = true;
393  SCCOL nCol = aScRange.aStart.Col();
394  SCROW nRow = aScRange.aStart.Row();
395  bool bNothing = ( rViewData.GetCurX()==nCol && rViewData.GetCurY()==nRow );
396 
397  // mark
398  if( bMark )
399  {
400  if (rMark.IsMarked()) // is the same range already marked?
401  {
402  ScRange aOldMark;
403  rMark.GetMarkArea( aOldMark );
404  aOldMark.PutInOrder();
405  ScRange aCurrent = aScRange;
406  aCurrent.PutInOrder();
407  bNothing = ( aCurrent == aOldMark );
408  }
409  else
410  bNothing = false;
411 
412  if (!bNothing)
413  MarkRange( aScRange, false ); // cursor comes after...
414  }
415  else
416  {
417  // remove old selection, unless bUnmark argument is sal_False (from navigator)
418  if( bUnmark )
419  {
420  MoveCursorAbs( nCol, nRow,
421  SC_FOLLOW_NONE, false, false );
422  }
423  }
424 
425  // and set cursor
426 
427  // consider merged cells:
428  pDoc->SkipOverlapped(nCol, nRow, nTab);
429 
430  // navigator calls are not part of the API!!!
431 
432  if( bNothing )
433  {
434  if (rReq.IsAPI())
435  rReq.Ignore(); // if macro, then nothing
436  else
437  rReq.Done(); // then at least paint it
438  }
439  else
440  {
441  rViewData.ResetOldCursor();
442  SetCursor( nCol, nRow );
443  rBindings.Invalidate( SID_CURRENTCELL );
444  rBindings.Update( nSlot );
445 
446  if (!rReq.IsAPI())
447  rReq.Done();
448  }
449 
450  if (bAlignToCursor)
451  {
452  // align to cursor even if the cursor position hasn't changed,
453  // because the cursor may be set outside the visible area.
454  AlignToCursor( nCol, nRow, SC_FOLLOW_JUMP );
455  }
456 
457  rReq.SetReturnValue( SfxStringItem( SID_CURRENTCELL, aAddress ) );
458  }
459 
460  if (!bFound) // no valid range
461  {
462  // if it is a sheet name, then switch (for Navigator/URL)
463 
464  SCTAB nNameTab;
465  if ( pDoc->GetTable( aAddress, nNameTab ) )
466  {
467  bFound = true;
468  if ( nNameTab != nTab )
469  SetTabNo( nNameTab );
470  }
471  }
472 
473  if ( !bFound && nSlot == SID_JUMPTOMARK )
474  {
475  // test graphics objects (only for URL)
476 
477  bFound = SelectObject( aAddress );
478  }
479 
480  if (!bFound && !rReq.IsAPI())
481  ErrorMessage( STR_ERR_INVALID_AREA );
482  }
483  break;
484 
485  case SID_CURRENTOBJECT:
486  if ( pReqArgs )
487  {
488  OUString aName = static_cast<const SfxStringItem&>(pReqArgs->Get(nSlot)).GetValue();
489  SelectObject( aName );
490  }
491  break;
492 
493  case SID_CURRENTTAB:
494  if ( pReqArgs )
495  {
496  // sheet for basic is one-based
497  SCTAB nTab = static_cast<const SfxUInt16Item&>(pReqArgs->Get(nSlot)).GetValue() - 1;
498  ScDocument* pDoc = GetViewData().GetDocument();
499  if ( nTab < pDoc->GetTableCount() )
500  {
501  SetTabNo( nTab );
502  rBindings.Update( nSlot );
503 
504  if( ! rReq.IsAPI() )
505  rReq.Done();
506  }
508  }
509  break;
510 
511  case SID_CURRENTDOC:
512  if ( pReqArgs )
513  {
514  OUString aStrDocName( static_cast<const SfxStringItem&>(pReqArgs->
515  Get(nSlot)).GetValue() );
516 
517  SfxViewFrame* pViewFrame = nullptr;
518  ScDocShell* pDocSh = static_cast<ScDocShell*>(SfxObjectShell::GetFirst());
519  bool bFound = false;
520 
521  // search for ViewFrame to be activated
522 
523  while ( pDocSh && !bFound )
524  {
525  if ( pDocSh->GetTitle() == aStrDocName )
526  {
527  pViewFrame = SfxViewFrame::GetFirst( pDocSh );
528  bFound = ( nullptr != pViewFrame );
529  }
530 
531  pDocSh = static_cast<ScDocShell*>(SfxObjectShell::GetNext( *pDocSh ));
532  }
533 
534  if ( bFound )
535  pViewFrame->GetFrame().Appear();
536 
537  rReq.Ignore();//XXX is handled by SFX
538  }
539  break;
540 
541  case SID_PRINTPREVIEW:
542  {
543  if ( !pThisFrame->GetFrame().IsInPlace() ) // not for OLE
544  {
545  // print preview is now always in the same frame as the tab view
546  // -> always switch this frame back to normal view
547  // (ScPreviewShell ctor reads view data)
548 
549  // #102785#; finish input
550  pScMod->InputEnterHandler();
551 
552  pThisFrame->GetDispatcher()->Execute( SID_VIEWSHELL1, SfxCallMode::ASYNCHRON );
553  }
554  // else error (e.g. Ole)
555  }
556  break;
557 
558  case SID_DETECTIVE_DEL_ALL:
559  DetectiveDelAll();
560  rReq.Done();
561  break;
562 
563  // SID_TABLE_ACTIVATE and SID_MARKAREA are called by basic for the
564  // hidden View, to mark/switch on the visible View:
565 
566  case SID_TABLE_ACTIVATE:
567  OSL_FAIL("old slot SID_TABLE_ACTIVATE");
568  break;
569 
570  case SID_REPAINT:
571  PaintGrid();
572  PaintTop();
573  PaintLeft();
574  PaintExtras();
575  rReq.Done();
576  break;
577 
578  case FID_NORMALVIEWMODE:
579  case FID_PAGEBREAKMODE:
580  {
581  bool bWantPageBreak = nSlot == FID_PAGEBREAKMODE;
582 
583  // check whether there is an explicit argument, use it
584  const SfxPoolItem* pItem;
585  if ( pReqArgs && pReqArgs->GetItemState(nSlot, true, &pItem) == SfxItemState::SET )
586  {
587  bool bItemValue = static_cast<const SfxBoolItem*>(pItem)->GetValue();
588  bWantPageBreak = (nSlot == FID_PAGEBREAKMODE) == bItemValue;
589  }
590 
591  if( GetViewData().IsPagebreakMode() != bWantPageBreak )
592  {
593  SetPagebreakMode( bWantPageBreak );
596  PaintGrid();
597  PaintTop();
598  PaintLeft();
599  rBindings.Invalidate( nSlot );
600  rReq.AppendItem( SfxBoolItem( nSlot, true ) );
601  rReq.Done();
602  }
603  }
604  break;
605 
606  case FID_FUNCTION_BOX:
607  {
608  // First make sure that the sidebar is visible
609  pThisFrame->ShowChildWindow(SID_SIDEBAR);
610 
611  ::sfx2::sidebar::Sidebar::ShowPanel("ScFunctionsPanel",
612  pThisFrame->GetFrame().GetFrameInterface());
613  rReq.Done ();
614  }
615  break;
616 
617  case FID_TOGGLESYNTAX:
618  {
619  bool bSet = !GetViewData().IsSyntaxMode();
620  const SfxPoolItem* pItem;
621  if ( pReqArgs && pReqArgs->GetItemState(nSlot, true, &pItem) == SfxItemState::SET )
622  bSet = static_cast<const SfxBoolItem*>(pItem)->GetValue();
623  GetViewData().SetSyntaxMode( bSet );
624  PaintGrid();
625  rBindings.Invalidate( FID_TOGGLESYNTAX );
626  rReq.AppendItem( SfxBoolItem( nSlot, bSet ) );
627  rReq.Done();
628  }
629  break;
630  case FID_TOGGLEHEADERS:
631  {
632  bool bSet = !GetViewData().IsHeaderMode();
633  const SfxPoolItem* pItem;
634  if ( pReqArgs && pReqArgs->GetItemState(nSlot, true, &pItem) == SfxItemState::SET )
635  bSet = static_cast<const SfxBoolItem*>(pItem)->GetValue();
636  GetViewData().SetHeaderMode( bSet );
637  RepeatResize();
638  rBindings.Invalidate( FID_TOGGLEHEADERS );
639  rReq.AppendItem( SfxBoolItem( nSlot, bSet ) );
640  rReq.Done();
641  }
642  break;
643 
644  case FID_TOGGLEFORMULA:
645  {
646  ScViewData& rViewData = GetViewData();
647  const ScViewOptions& rOpts = rViewData.GetOptions();
648  bool bFormulaMode = !rOpts.GetOption( VOPT_FORMULAS );
649  const SfxPoolItem *pItem;
650  if( pReqArgs && pReqArgs->GetItemState(nSlot, true, &pItem) == SfxItemState::SET )
651  bFormulaMode = static_cast<const SfxBoolItem *>(pItem)->GetValue();
652 
653  ScViewOptions aSetOpts = rOpts;
654  aSetOpts.SetOption( VOPT_FORMULAS, bFormulaMode );
655  rViewData.SetOptions( aSetOpts );
656 
657  rViewData.GetDocShell()->PostPaintGridAll();
658 
659  rBindings.Invalidate( FID_TOGGLEFORMULA );
660  rReq.AppendItem( SfxBoolItem( nSlot, bFormulaMode ) );
661  rReq.Done();
662  }
663  break;
664 
665  case FID_TOGGLEINPUTLINE:
666  {
667  sal_uInt16 nId = ScInputWindowWrapper::GetChildWindowId();
668  SfxChildWindow* pWnd = pThisFrame->GetChildWindow( nId );
669  bool bSet = ( pWnd == nullptr );
670  const SfxPoolItem* pItem;
671  if ( pReqArgs && pReqArgs->GetItemState(nSlot, true, &pItem) == SfxItemState::SET )
672  bSet = static_cast<const SfxBoolItem*>(pItem)->GetValue();
673 
674  pThisFrame->SetChildWindow( nId, bSet );
675  rBindings.Invalidate( FID_TOGGLEINPUTLINE );
676  rReq.AppendItem( SfxBoolItem( nSlot, bSet ) );
677  rReq.Done();
678  }
679  break;
680 
681  case SID_ATTR_ZOOM: // status row
682  case FID_SCALE:
683  {
684  bool bSyncZoom = SC_MOD()->GetAppOptions().GetSynchronizeZoom();
685  SvxZoomType eOldZoomType = GetZoomType();
686  SvxZoomType eNewZoomType = eOldZoomType;
687  const Fraction& rOldY = GetViewData().GetZoomY(); // Y is shown
688  sal_uInt16 nOldZoom = static_cast<sal_uInt16>(long( rOldY * 100 ));
689  sal_uInt16 nZoom = nOldZoom;
690  bool bCancel = false;
691 
692  if ( pReqArgs )
693  {
694  const SvxZoomItem& rZoomItem = pReqArgs->Get(SID_ATTR_ZOOM);
695 
696  eNewZoomType = rZoomItem.GetType();
697  nZoom = rZoomItem.GetValue();
698  }
699  else
700  {
702  SvxZoomItem aZoomItem( eOldZoomType, nOldZoom, SID_ATTR_ZOOM );
704  ScMarkData& rMark = GetViewData().GetMarkData();
705  SvxZoomEnableFlags nBtnFlags = SvxZoomEnableFlags::N50
706  | SvxZoomEnableFlags::N75
707  | SvxZoomEnableFlags::N100
708  | SvxZoomEnableFlags::N150
709  | SvxZoomEnableFlags::N200
710  | SvxZoomEnableFlags::WHOLEPAGE
711  | SvxZoomEnableFlags::PAGEWIDTH;
712 
713  if ( rMark.IsMarked() || rMark.IsMultiMarked() )
714  nBtnFlags = nBtnFlags | SvxZoomEnableFlags::OPTIMAL;
715 
716  aZoomItem.SetValueSet( nBtnFlags );
717  aSet.Put( aZoomItem );
719  pDlg.disposeAndReset(pFact->CreateSvxZoomDialog(GetFrameWeld(), aSet));
720  pDlg->SetLimits( MINZOOM, MAXZOOM );
721 
722  bCancel = ( RET_CANCEL == pDlg->Execute() );
723 
724  // bCancel is True only if we were in the previous if block,
725  // so no need to check again pDlg
726  if ( !bCancel )
727  {
728  const SvxZoomItem& rZoomItem = pDlg->GetOutputItemSet()->
729  Get( SID_ATTR_ZOOM );
730 
731  eNewZoomType = rZoomItem.GetType();
732  nZoom = rZoomItem.GetValue();
733  }
734  }
735 
736  if ( !bCancel )
737  {
738  if ( eNewZoomType == SvxZoomType::PERCENT )
739  {
740  if ( nZoom < MINZOOM ) nZoom = MINZOOM;
741  if ( nZoom > MAXZOOM ) nZoom = MAXZOOM;
742  }
743  else
744  {
745  nZoom = CalcZoom( eNewZoomType, nOldZoom );
746  bCancel = nZoom == 0;
747  }
748 
749  switch ( eNewZoomType )
750  {
751  case SvxZoomType::WHOLEPAGE:
752  case SvxZoomType::PAGEWIDTH:
753  SetZoomType( eNewZoomType, bSyncZoom );
754  break;
755 
756  default:
757  SetZoomType( SvxZoomType::PERCENT, bSyncZoom );
758  }
759  }
760 
761  if ( nZoom != nOldZoom && !bCancel )
762  {
763  if (!GetViewData().IsPagebreakMode())
764  {
765  ScAppOptions aNewOpt = pScMod->GetAppOptions();
766  aNewOpt.SetZoom( nZoom );
767  aNewOpt.SetZoomType( GetZoomType() );
768  pScMod->SetAppOptions( aNewOpt );
769  }
770  Fraction aFract( nZoom, 100 );
771  SetZoom( aFract, aFract, bSyncZoom );
772  PaintGrid();
773  PaintTop();
774  PaintLeft();
775  rBindings.Invalidate( SID_ATTR_ZOOM );
776  rReq.AppendItem( SvxZoomItem( GetZoomType(), nZoom, nSlot ) );
777  rReq.Done();
778  }
779  }
780  break;
781 
782  case SID_ATTR_ZOOMSLIDER:
783  {
784  const SfxPoolItem* pItem = nullptr;
785  bool bSyncZoom = SC_MOD()->GetAppOptions().GetSynchronizeZoom();
786  if ( pReqArgs && pReqArgs->GetItemState(SID_ATTR_ZOOMSLIDER, true, &pItem) == SfxItemState::SET )
787  {
788  const sal_uInt16 nCurrentZoom = static_cast<const SvxZoomSliderItem *>(pItem)->GetValue();
789  if( nCurrentZoom )
790  {
791  SetZoomType( SvxZoomType::PERCENT, bSyncZoom );
792  if (!GetViewData().IsPagebreakMode())
793  {
794  ScAppOptions aNewOpt = pScMod->GetAppOptions();
795  aNewOpt.SetZoom( nCurrentZoom );
796  aNewOpt.SetZoomType( GetZoomType() );
797  pScMod->SetAppOptions( aNewOpt );
798  }
799  Fraction aFract( nCurrentZoom,100 );
800  SetZoom( aFract, aFract, bSyncZoom );
801  PaintGrid();
802  PaintTop();
803  PaintLeft();
804  rBindings.Invalidate( SID_ATTR_ZOOMSLIDER );
805  rReq.Done();
806  }
807  }
808  }
809  break;
810 
811  case FID_TAB_SELECTALL:
812  SelectAllTables();
813  rReq.Done();
814  break;
815 
816  case FID_TAB_DESELECTALL:
818  rReq.Done();
819  break;
820 
821  case SID_SELECT_TABLES:
822  {
823  ScViewData& rViewData = GetViewData();
824  ScDocument& rDoc = *rViewData.GetDocument();
825  ScMarkData& rMark = rViewData.GetMarkData();
826  SCTAB nTabCount = rDoc.GetTableCount();
827  SCTAB nTab;
828 
829  ::std::vector < sal_Int32 > aIndexList;
830  const SfxIntegerListItem* pItem = rReq.GetArg<SfxIntegerListItem>(SID_SELECT_TABLES);
831  if ( pItem )
832  aIndexList = pItem->GetList();
833  else
834  {
836 
838  pDlg->SetDescription(
839  ScResId( STR_DLG_SELECTTABLES_TITLE ),
840  ScResId( STR_DLG_SELECTTABLES_LBNAME ),
841  GetStaticInterface()->GetSlot(SID_SELECT_TABLES)->GetCommand(), HID_SELECTTABLES );
842 
843  // fill all table names with selection state
844  OUString aTabName;
845  for( nTab = 0; nTab < nTabCount; ++nTab )
846  {
847  rDoc.GetName( nTab, aTabName );
848  pDlg->Insert( aTabName, rMark.GetTableSelect( nTab ) );
849  }
850 
851  if( pDlg->Execute() == RET_OK )
852  {
853  aIndexList = pDlg->GetSelectedRows();
854  pDlg.disposeAndClear();
855  rReq.AppendItem( SfxIntegerListItem( SID_SELECT_TABLES, aIndexList ) );
856  }
857  else
858  rReq.Ignore();
859  }
860 
861  if ( !aIndexList.empty() )
862  {
863  sal_uInt16 nSelCount = aIndexList.size();
864  sal_uInt16 nSelIx;
865  SCTAB nFirstVisTab = 0;
866 
867  // special case: only hidden tables selected -> do nothing
868  bool bVisSelected = false;
869  for( nSelIx = 0; !bVisSelected && (nSelIx < nSelCount); ++nSelIx )
870  {
871  nFirstVisTab = static_cast<SCTAB>(aIndexList[nSelIx]);
872  bVisSelected = rDoc.IsVisible( nFirstVisTab );
873  }
874  if( !bVisSelected )
875  nSelCount = 0;
876 
877  // select the tables
878  if( nSelCount )
879  {
880  for( nTab = 0; nTab < nTabCount; ++nTab )
881  rMark.SelectTable( nTab, false );
882 
883  for( nSelIx = 0; nSelIx < nSelCount; ++nSelIx )
884  rMark.SelectTable( static_cast<SCTAB>(aIndexList[nSelIx]), true );
885 
886  // activate another table, if current is deselected
887  if( !rMark.GetTableSelect( rViewData.GetTabNo() ) )
888  {
889  rMark.SelectTable( nFirstVisTab, true );
890  SetTabNo( nFirstVisTab );
891  }
892 
893  rViewData.GetDocShell()->PostPaintExtras();
894  SfxBindings& rBind = rViewData.GetBindings();
895  rBind.Invalidate( FID_FILL_TAB );
896  rBind.Invalidate( FID_TAB_DESELECTALL );
897  }
898 
899  rReq.Done();
900  }
901  }
902  break;
903 
904  case SID_OUTLINE_DELETEALL:
906  rReq.Done();
907  break;
908 
909  case SID_AUTO_OUTLINE:
910  AutoOutline();
911  rReq.Done();
912  break;
913 
914  case SID_WINDOW_SPLIT:
915  {
916  ScSplitMode eHSplit = GetViewData().GetHSplitMode();
917  ScSplitMode eVSplit = GetViewData().GetVSplitMode();
918  if ( eHSplit == SC_SPLIT_NORMAL || eVSplit == SC_SPLIT_NORMAL ) // remove
919  RemoveSplit();
920  else if ( eHSplit == SC_SPLIT_FIX || eVSplit == SC_SPLIT_FIX ) // normal
921  FreezeSplitters( false );
922  else // create
923  SplitAtCursor();
924  rReq.Done();
925 
926  InvalidateSplit();
927  }
928  break;
929 
930  case SID_WINDOW_FIX:
931  {
932  ScSplitMode eHSplit = GetViewData().GetHSplitMode();
933  ScSplitMode eVSplit = GetViewData().GetVSplitMode();
934  if ( eHSplit == SC_SPLIT_FIX || eVSplit == SC_SPLIT_FIX ) // remove
935  RemoveSplit();
936  else
937  FreezeSplitters( true, SC_SPLIT_METHOD_CURSOR); // create or fixate
938 
939  rReq.Done();
940  InvalidateSplit();
941  }
942  break;
943 
944  case SID_WINDOW_FIX_COL:
945  case SID_WINDOW_FIX_ROW:
946  {
947  bool bIsCol = (nSlot == SID_WINDOW_FIX_COL);
948  sal_Int32 nFreezeIndex = 1;
949  if (const SfxInt32Item* pItem = rReq.GetArg<SfxInt32Item>(nSlot))
950  {
951  nFreezeIndex = pItem->GetValue();
952  if (nFreezeIndex < 0)
953  nFreezeIndex = 0;
954  }
955 
957  {
958  ScViewData& rViewData = GetViewData();
959  SCTAB nThisTab = rViewData.GetTabNo();
960  bool bChanged = rViewData.SetLOKSheetFreezeIndex(nFreezeIndex, bIsCol);
961  rReq.Done();
962  if (bChanged)
963  {
964  rBindings.Invalidate(nSlot);
965  // Invalidate the slot for all views on the same tab of the document.
966  SfxLokHelper::forEachOtherView(this, [nSlot, nThisTab](ScTabViewShell* pOther) {
967  ScViewData& rOtherViewData = pOther->GetViewData();
968  if (rOtherViewData.GetTabNo() != nThisTab)
969  return;
970 
971  SfxBindings& rOtherBind = rOtherViewData.GetBindings();
972  rOtherBind.Invalidate(nSlot);
973  });
974  }
975  }
976  else
977  {
978  FreezeSplitters( true, bIsCol ? SC_SPLIT_METHOD_COL : SC_SPLIT_METHOD_ROW, nFreezeIndex);
979  rReq.Done();
980  InvalidateSplit();
981  }
982  }
983  break;
984 
985  case FID_CHG_SHOW:
986  {
987  sal_uInt16 nId = ScHighlightChgDlgWrapper::GetChildWindowId();
988  SfxChildWindow* pWnd = pThisFrame->GetChildWindow( nId );
989 
990  pScMod->SetRefDialog( nId, pWnd == nullptr );
991  }
992  break;
993 
994  case FID_CHG_ACCEPT:
995  {
996  pThisFrame->ToggleChildWindow(ScAcceptChgDlgWrapper::GetChildWindowId());
997  GetViewFrame()->GetBindings().Invalidate(FID_CHG_ACCEPT);
998  rReq.Done ();
999 
1000  /*
1001  sal_uInt16 nId = ScAcceptChgDlgWrapper::GetChildWindowId();
1002  SfxChildWindow* pWnd = pThisFrame->GetChildWindow( nId );
1003 
1004  pScMod->SetRefDialog( nId, pWnd ? sal_False : sal_True );
1005  */
1006  }
1007  break;
1008 
1009  case FID_CHG_COMMENT:
1010  {
1012  ScAddress aCursorPos( rData.GetCurX(), rData.GetCurY(), rData.GetTabNo() );
1013  ScDocShell* pDocSh = rData.GetDocShell();
1014 
1015  ScChangeAction* pAction = pDocSh->GetChangeAction( aCursorPos );
1016  if ( pAction )
1017  {
1018  const SfxPoolItem* pItem;
1019  if ( pReqArgs &&
1020  pReqArgs->GetItemState( nSlot, true, &pItem ) == SfxItemState::SET &&
1021  dynamic_cast<const SfxStringItem*>( pItem) != nullptr )
1022  {
1023  OUString aComment = static_cast<const SfxStringItem*>(pItem)->GetValue();
1024  pDocSh->SetChangeComment( pAction, aComment );
1025  rReq.Done();
1026  }
1027  else
1028  {
1029  pDocSh->ExecuteChangeCommentDialog(pAction, GetFrameWeld());
1030  rReq.Done();
1031  }
1032  }
1033  }
1034  break;
1035 
1036  case SID_CREATE_SW_DRAWVIEW:
1037  // is called by Forms, when the DrawView has to be created with all
1038  // the extras
1039  if (!GetScDrawView())
1040  {
1042  rBindings.InvalidateAll(false);
1043  }
1044  break;
1045 
1046  case FID_PROTECT_DOC:
1047  {
1048  ScDocument* pDoc = GetViewData().GetDocument();
1049 
1050  if( pReqArgs )
1051  {
1052  const SfxPoolItem* pItem;
1053  if( pReqArgs->HasItem( FID_PROTECT_DOC, &pItem ) &&
1054  static_cast<const SfxBoolItem*>(pItem)->GetValue() == pDoc->IsDocProtected() )
1055  {
1056  rReq.Ignore();
1057  break;
1058  }
1059  }
1060 
1061  ScDocProtection* pProtect = pDoc->GetDocProtection();
1062  if (pProtect && pProtect->isProtected())
1063  {
1064  bool bCancel = false;
1065  OUString aPassword;
1066 
1067  if (pProtect->isProtectedWithPass())
1068  {
1069  OUString aText(ScResId(SCSTR_PASSWORD));
1070 
1071  SfxPasswordDialog aDlg(GetFrameWeld(), &aText);
1072  aDlg.set_title(ScResId(SCSTR_UNPROTECTDOC));
1073  aDlg.SetMinLen(0);
1074  aDlg.set_help_id(GetStaticInterface()->GetSlot(FID_PROTECT_DOC)->GetCommand());
1076 
1077  if (aDlg.run() == RET_OK)
1078  aPassword = aDlg.GetPassword();
1079  else
1080  bCancel = true;
1081  }
1082  if (!bCancel)
1083  {
1084  Unprotect( TABLEID_DOC, aPassword );
1085  rReq.AppendItem( SfxBoolItem( FID_PROTECT_DOC, false ) );
1086  rReq.Done();
1087  }
1088  }
1089  else
1090  {
1091  OUString aText(ScResId(SCSTR_PASSWORDOPT));
1092 
1093  SfxPasswordDialog aDlg(GetFrameWeld(), &aText);
1094  aDlg.set_title(ScResId(SCSTR_PROTECTDOC));
1095  aDlg.SetMinLen( 0 );
1096  aDlg.set_help_id(GetStaticInterface()->GetSlot(FID_PROTECT_DOC)->GetCommand());
1098  aDlg.ShowExtras(SfxShowExtras::CONFIRM);
1100 
1101  if (aDlg.run() == RET_OK)
1102  {
1103  OUString aPassword = aDlg.GetPassword();
1104  Protect( TABLEID_DOC, aPassword );
1105  rReq.AppendItem( SfxBoolItem( FID_PROTECT_DOC, true ) );
1106  rReq.Done();
1107  }
1108  }
1109  rBindings.Invalidate( FID_PROTECT_DOC );
1110  }
1111  break;
1112 
1113  case FID_PROTECT_TABLE:
1114  {
1115  ScDocument* pDoc = GetViewData().GetDocument();
1116  SCTAB nTab = GetViewData().GetTabNo();
1117  bool bOldProtection = pDoc->IsTabProtected(nTab);
1118 
1119  if( pReqArgs )
1120  {
1121  const SfxPoolItem* pItem;
1122  bool bNewProtection = !bOldProtection;
1123  if( pReqArgs->HasItem( FID_PROTECT_TABLE, &pItem ) )
1124  bNewProtection = static_cast<const SfxBoolItem*>(pItem)->GetValue();
1125  if( bNewProtection == bOldProtection )
1126  {
1127  rReq.Ignore();
1128  break;
1129  }
1130  }
1131 
1132  if (bOldProtection)
1133  {
1134  // Unprotect a protected sheet.
1135 
1136  ScTableProtection* pProtect = pDoc->GetTabProtection(nTab);
1137  if (pProtect && pProtect->isProtectedWithPass())
1138  {
1139  OUString aText( ScResId(SCSTR_PASSWORDOPT) );
1140  SfxPasswordDialog aDlg(GetFrameWeld(), &aText);
1141  aDlg.set_title(ScResId(SCSTR_UNPROTECTTAB));
1142  aDlg.SetMinLen(0);
1143  aDlg.set_help_id(GetStaticInterface()->GetSlot(FID_PROTECT_TABLE)->GetCommand());
1145 
1146  if (aDlg.run() == RET_OK)
1147  {
1148  OUString aPassword = aDlg.GetPassword();
1149  Unprotect(nTab, aPassword);
1150  }
1151  }
1152  else
1153  // this sheet is not password-protected.
1154  Unprotect(nTab, OUString());
1155 
1156  if (!pReqArgs)
1157  {
1158  rReq.AppendItem( SfxBoolItem(FID_PROTECT_TABLE, false) );
1159  rReq.Done();
1160  }
1161  }
1162  else
1163  {
1164  // Protect a current sheet.
1165 
1167 
1168  ScTableProtection* pProtect = pDoc->GetTabProtection(nTab);
1169  if (pProtect)
1170  aDlg.SetDialogData(*pProtect);
1171 
1172  if (aDlg.run() == RET_OK)
1173  {
1174  pScMod->InputEnterHandler();
1175 
1176  ScTableProtection aNewProtect;
1177  aDlg.WriteData(aNewProtect);
1178  ProtectSheet(nTab, aNewProtect);
1179  if (!pReqArgs)
1180  {
1181  rReq.AppendItem( SfxBoolItem(FID_PROTECT_TABLE, true) );
1182  rReq.Done();
1183  }
1184  }
1185  }
1186  TabChanged();
1187  UpdateInputHandler(true); // to immediately enable input again
1188  SelectionChanged();
1189  }
1190  break;
1191 
1192  case SID_OPT_LOCALE_CHANGED :
1193  { // locale changed, SYSTEM number formats changed => repaint cell contents
1194  PaintGrid();
1195  rReq.Done();
1196  }
1197  break;
1198 
1199  default:
1200  OSL_FAIL("Unknown Slot at ScTabViewShell::Execute");
1201  break;
1202  }
1203 }
1204 
1205 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SC_DLLPUBLIC bool IsDocProtected() const
Definition: documen3.cxx:1860
#define MAXZOOM
Definition: global.hxx:76
ScMarkData & GetMarkData()
Definition: viewdata.cxx:3053
void SetEditHelpId(const OString &rId)
SfxViewFrame * GetViewFrame() const
SvxZoomType GetZoomType() const
Definition: tabview5.cxx:404
void SetOption(ScViewOption eOpt, bool bNew)
Definition: viewopti.hxx:87
void Appear()
ScAddress aStart
Definition: address.hxx:500
ScDocShell * GetDocShell() const
Definition: viewdata.hxx:354
void FreezeSplitters(bool bFreeze, SplitMethod eSplitMethod=SC_SPLIT_METHOD_CURSOR, SCCOLROW nFreezeIndex=-1)
Definition: tabview.cxx:1910
void RemoveManualBreaks()
Definition: viewfun2.cxx:975
SC_DLLPUBLIC bool IsTabProtected(SCTAB nTab) const
Definition: documen3.cxx:1871
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
Definition: markdata.hxx:43
SfxChildWindow * GetChildWindow(sal_uInt16)
static SfxInterface * GetStaticInterface()
SCROW Row() const
Definition: address.hxx:262
OUString GetTitle(sal_uInt16 nMaxLen=0) const
void PostPaintGridAll()
Definition: docsh3.cxx:181
void SetPrintRanges(bool bEntireSheet, const OUString *pPrint, const OUString *pRepCol, const OUString *pRepRow, bool bAddPrint)
Definition: viewfun2.cxx:1014
std::string GetValue
bool PaintExtras()
Definition: tabview3.cxx:2741
void MarkRange(const ScRange &rRange, bool bSetCursor=true, bool bContinue=false)
Definition: tabview3.cxx:1675
#define HID_PASSWD_TABLE
Definition: helpids.h:58
sheet protection state container
void SetHeaderMode(bool bNewMode)
Definition: viewdata.hxx:545
void SelectAllTables()
Definition: tabview2.cxx:1084
SfxDispatcher * GetDispatcher()
void SetPagebreakMode(bool bSet)
Definition: tabview5.cxx:430
static SvxAbstractDialogFactory * Create()
void RepeatResize(bool bUpdateFix=true)
Definition: tabview.cxx:768
SCROW GetCurY() const
Definition: viewdata.hxx:402
virtual bool isProtected() const override
sal_Int16 nId
const ContentProperties & rData
void PostPaintExtras()
Definition: docsh3.cxx:196
SCTAB GetTabNo() const
Definition: viewdata.hxx:395
void PaintGrid()
Definition: tabview3.cxx:2614
bool IsSyntaxMode() const
Definition: viewdata.hxx:542
ScAddress aEnd
Definition: address.hxx:501
void Done(bool bRemove=false)
virtual bool isProtectedWithPass() const override
virtual short run() override
const SfxItemSet * GetArgs() const
void Invalidate(sal_uInt16 nId)
void TabChanged(bool bSameTabButMoved=false)
Called after moving, copying, inserting or deleting a sheet.
Definition: tabview5.cxx:277
static void forEachOtherView(ViewShellType *pThisViewShell, FunctionType f)
SC_DLLPUBLIC void SetCursor(SCCOL nPosX, SCROW nPosY, bool bNew=false)
Definition: tabview3.cxx:358
RET_CANCEL
SC_DLLPUBLIC formula::FormulaGrammar::AddressConvention GetAddressConvention() const
Definition: documen3.cxx:475
virtual const SfxItemSet * GetOutputItemSet() const =0
SC_DLLPUBLIC void InputEnterHandler(ScEnterMode nBlockMode=ScEnterMode::NORMAL)
Definition: scmod.cxx:1359
SC_DLLPUBLIC void MoveCursorAbs(SCCOL nCurX, SCROW nCurY, ScFollowMode eMode, bool bShift, bool bControl, bool bKeepOld=false, bool bKeepSel=false)
Definition: tabview3.cxx:1178
NONE
void GetMarkArea(ScRange &rRange) const
Definition: markdata.cxx:112
void DeselectAllTables()
Definition: tabview2.cxx:1102
void ToggleChildWindow(sal_uInt16)
#define HID_PASSWD_DOC_CONFIRM
Definition: helpids.h:60
void disposeAndReset(reference_type *pBody)
void PaintLeft()
Definition: tabview3.cxx:2690
SC_DLLPUBLIC SCTAB GetTableCount() const
Definition: document.cxx:314
void SetConfirmHelpId(const OString &rId)
bool Unprotect(SCTAB nTab, const OUString &rPassword)
Definition: viewfunc.cxx:2553
bool IsMultiMarked() const
Definition: markdata.hxx:83
SfxFrame & GetFrame() const
SC_DLLPUBLIC void SetRefDialog(sal_uInt16 nId, bool bVis, SfxViewFrame *pViewFrm=nullptr)
Reference dialogs.
Definition: scmod.cxx:1467
void SetOptions(const ScViewOptions &rOpt)
Definition: viewdata.cxx:3886
SC_DLLPUBLIC bool GetTable(const OUString &rName, SCTAB &rTab) const
Definition: document.cxx:260
void UpdateInputHandler(bool bForce=false, bool bStopEditing=true)
Definition: tabvwsha.cxx:632
SCTAB Tab() const
Definition: address.hxx:271
void SetRow(SCROW nRowP)
Definition: address.hxx:275
ScDocument * GetDocument() const
Definition: viewdata.cxx:859
ScSplitMode GetHSplitMode() const
Definition: viewdata.hxx:416
bool isdigitAsciiString(const OString &rString)
const Fraction & GetZoomY() const
Definition: viewdata.hxx:460
void SetCol(SCCOL nColP)
Definition: address.hxx:279
ScDrawLayer * MakeDrawLayer()
Definition: docsh2.cxx:166
ScViewData & GetViewData()
Definition: tabview.hxx:332
void PaintTop()
Definition: tabview3.cxx:2625
void SelectionChanged(bool bFromPaste=false)
Definition: tabview3.cxx:522
SfxItemPool & GetPool() const
bool PasteFile(const Point &, const OUString &, bool bLink)
Definition: viewfun4.cxx:581
static bool MakeRangeFromName(const OUString &rName, const ScDocument *pDoc, SCTAB nCurTab, ScRange &rRange, RutlNameScope eScope=RUTL_NAMES, ScAddress::Details const &rDetails=ScAddress::detailsOOOa1)
Definition: rangeutl.cxx:235
SC_DLLPUBLIC void SetAppOptions(const ScAppOptions &rOpt)
Definition: scmod.cxx:719
void AutoOutline()
Definition: dbfunc3.cxx:212
SC_DLLPUBLIC ScDocProtection * GetDocProtection() const
Definition: documen3.cxx:1847
void SetTab(SCTAB nTabP)
Definition: address.hxx:283
void SetZoom(const Fraction &rNewX, const Fraction &rNewY, bool bAll)
Definition: tabview5.cxx:414
bool IsMarked() const
Definition: markdata.hxx:82
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
void SelectTable(SCTAB nTab, bool bNew)
Definition: markdata.cxx:172
SfxBindings & GetBindings()
Definition: viewdata.cxx:3041
virtual VclPtr< AbstractScShowTabDlg > CreateScShowTabDlg(weld::Window *pParent)=0
sal_Int16 SCCOL
Definition: types.hxx:22
#define SC_MOD()
Definition: scmod.hxx:253
SfxBindings & GetBindings()
SC_DLLPUBLIC void SetTabNo(SCTAB nTab, bool bNew=false, bool bExtendSelection=false, bool bSameTabButMoved=false)
Definition: tabview3.cxx:1786
SC_DLLPUBLIC const ScAppOptions & GetAppOptions()
Definition: scmod.cxx:732
const T * GetArg(sal_uInt16 nSlotId) const
void ShowExtras(SfxShowExtras nExtras)
OUString ScResId(const char *pId)
Definition: scdll.cxx:95
bool GetOption(ScViewOption eOpt) const
Definition: viewopti.hxx:88
static void ShowPanel(const OUString &rsPanelId, const css::uno::Reference< css::frame::XFrame > &rxFrame, bool bFocus=false)
void RemoveAllOutlines(bool bRecord=true)
Definition: dbfunc3.cxx:192
void InvalidateSplit()
Definition: tabview.cxx:2109
sal_uInt16 CalcZoom(SvxZoomType eType, sal_uInt16 nOldZoom)
Definition: tabview2.cxx:1180
void RemoveSplit()
Definition: tabview.cxx:2065
void SplitAtCursor()
Definition: tabview.cxx:2072
void SetDialogData(const ScTableProtection &rData)
void SetZoom(sal_uInt16 nNew)
Definition: appoptio.hxx:42
bool SetLOKSheetFreezeIndex(const SCCOLROW nFreezeIndex, bool bIsCol, SCTAB nForTab=-1)
Definition: viewdata.cxx:4121
SC_DLLPUBLIC ScRefFlags Parse(const OUString &, const ScDocument *=nullptr, const ScAddress::Details &rDetails=ScAddress::detailsOOOa1, ScAddress::ExternalInfo *pExtInfo=nullptr, const css::uno::Sequence< css::sheet::ExternalLinkInfo > *pExternalLinks=nullptr, const OUString *pErrRef=nullptr)
Definition: address.cxx:1737
const SCTAB TABLEID_DOC
Definition: address.hxx:85
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
SCCOL Col() const
Definition: address.hxx:267
#define HID_SELECTTABLES
Definition: helpids.h:64
void SetMinLen(sal_uInt16 Len)
virtual void SetLimits(sal_uInt16 nMin, sal_uInt16 nMax)=0
void DetectiveDelAll()
Definition: viewfun6.cxx:86
void SetReturnValue(const SfxPoolItem &)
void SetPrintZoom(sal_uInt16 nScale)
Definition: viewfun2.cxx:999
void Update(sal_uInt16 nId)
void SkipOverlapped(SCCOL &rCol, SCROW &rRow, SCTAB nTab) const
Definition: document.cxx:5724
sal_Int32 SCROW
Definition: types.hxx:18
sal_uInt16 GetSlot() const
SC_DLLPUBLIC void PutInOrder()
Definition: address.cxx:1577
bool ValidRow(SCROW nRow) const
Definition: document.hxx:876
weld::Window * GetFrameWeld() const
void SetCurSubShell(ObjectSelectionType eOST, bool bForce=false)
Definition: tabvwsh4.cxx:753
void ProtectSheet(SCTAB nTab, const ScTableProtection &rProtect)
Definition: viewfunc.cxx:2492
bool SelectObject(const OUString &rName)
Definition: tabvwsh2.cxx:449
ScDrawView * GetScDrawView()
Definition: tabview.hxx:340
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
SvxZoomEnableFlags
bool IsInPlace() const
static SfxObjectShell * GetFirst(const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
void ErrorMessage(const char *pGlobStrId)
Definition: tabview2.cxx:1412
SvxZoomType GetType() const
bool IsHeaderMode() const
Definition: viewdata.hxx:544
static SfxViewShell * Get(const css::uno::Reference< css::frame::XController > &i_rController)
OUString aName
static SC_DLLPUBLIC ScAbstractDialogFactory * Create()
Definition: scabstdlg.cxx:38
RET_OK
void SetChildWindow(sal_uInt16 nId, bool bVisible, bool bSetFocus=true)
bool HasItem(sal_uInt16 nWhich, const SfxPoolItem **ppItem=nullptr) const
void Protect(SCTAB nTab, const OUString &rPassword)
Definition: viewfunc.cxx:2523
OUString GetPassword() const
const ScViewOptions & GetOptions() const
Definition: viewdata.hxx:537
virtual short run()
void SetZoomType(SvxZoomType eNew)
Definition: appoptio.hxx:44
void AlignToCursor(SCCOL nCurX, SCROW nCurY, ScFollowMode eMode, const ScSplitPos *pWhich=nullptr)
Definition: tabview3.cxx:904
void ShowChildWindow(sal_uInt16, bool bVisible=true)
SC_DLLPUBLIC ScTableProtection * GetTabProtection(SCTAB nTab) const
Definition: documen3.cxx:1880
ScSplitMode
Definition: viewdata.hxx:43
void HideListBox()
Definition: tabview3.cxx:2950
void SetZoomType(SvxZoomType eNew, bool bAll)
Definition: tabview5.cxx:409
ObjectSelectionType GetCurObjectSelectionType() const
Definition: tabvwsh.hxx:299
void Execute(SfxRequest &rReq)
Definition: tabvwsh3.cxx:149
static SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
void InvalidateAll(bool bWithMsg)
SC_DLLPUBLIC bool IsVisible(SCTAB nTab) const
Definition: document.cxx:908
void AppendItem(const SfxPoolItem &)
Point GetInsertPos() const
Definition: tabview.cxx:1667
void SetSyntaxMode(bool bNewMode)
Definition: viewdata.hxx:543
DetectFlags
Definition: tabvwsh3.cxx:60
#define MINZOOM
Definition: global.hxx:75
static SfxObjectShell * GetNext(const SfxObjectShell &rPrev, const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
bool IsAPI() const
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
SvxZoomType
ScRefFlags
Definition: address.hxx:145
bool GetTableSelect(SCTAB nTab) const
Definition: markdata.cxx:184
bool IsPagebreakMode() const
Definition: viewdata.hxx:425
const std::vector< sal_Int32 > & GetList() const
void WriteData(ScTableProtection &rData) const
void Ignore()
SC_DLLPUBLIC ScRefFlags Parse(const OUString &, const ScDocument *=nullptr, const Details &rDetails=detailsOOOa1, ExternalInfo *pExtInfo=nullptr, const css::uno::Sequence< css::sheet::ExternalLinkInfo > *pExternalLinks=nullptr, sal_Int32 *pSheetEndPos=nullptr, const OUString *pErrRef=nullptr)
Definition: address.cxx:1543
SC_DLLPUBLIC bool GetName(SCTAB nTab, OUString &rName) const
Definition: document.cxx:213
void UpdatePageBreakData(bool bForcePaint=false)
Definition: tabview2.cxx:1445
ScSplitMode GetVSplitMode() const
Definition: viewdata.hxx:417
virtual VclPtr< AbstractSvxZoomDialog > CreateSvxZoomDialog(weld::Window *pParent, const SfxItemSet &rCoreSet)=0
virtual bool isProtectedWithPass() const override
sal_Int16 SCTAB
Definition: types.hxx:23
void AdjustPrintZoom()
Definition: viewfun2.cxx:1006
void ResetOldCursor()
Definition: viewdata.cxx:1339
SCCOL GetCurX() const
Definition: viewdata.hxx:401
#define HID_PASSWD_DOC
Definition: helpids.h:59
static OUString decode(OUString const &rText, DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)