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