LibreOffice Module sc (master)  1
cellsh3.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <scitems.hxx>
21 #include <editeng/editview.hxx>
22 #include <editeng/editeng.hxx>
24 #include <sfx2/viewfrm.hxx>
25 #include <sfx2/bindings.hxx>
26 #include <sfx2/dispatch.hxx>
27 #include <sfx2/request.hxx>
28 #include <svl/stritem.hxx>
29 #include <vcl/svapp.hxx>
30 #include <vcl/weld.hxx>
31 #include <globstr.hrc>
32 #include <scresid.hxx>
33 #include <scmod.hxx>
34 #include <appoptio.hxx>
35 #include <tabvwsh.hxx>
36 #include <document.hxx>
37 #include <sc.hrc>
38 #include <reffact.hxx>
39 #include <uiitems.hxx>
40 #include <autoform.hxx>
41 #include <cellsh.hxx>
42 #include <inputhdl.hxx>
43 #include <editable.hxx>
44 #include <funcdesc.hxx>
45 #include <markdata.hxx>
46 #include <scabstdlg.hxx>
47 #include <columnspanset.hxx>
48 #include <comphelper/lok.hxx>
49 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
50 #include <sfx2/lokhelper.hxx>
51 
52 #include <memory>
53 
54 #define IS_EDITMODE() GetViewData()->HasEditView( GetViewData()->GetActivePart() )
55 
56 using sc::HMMToTwips;
57 using sc::TwipsToEvenHMM;
58 
59 namespace
60 {
62 OString escapeJSON(const OUString &aStr)
63 {
64  OUString aEscaped = aStr;
65  aEscaped = aEscaped.replaceAll("\n", " ");
66  aEscaped = aEscaped.replaceAll("\"", "'");
67  return OUStringToOString(aEscaped, RTL_TEXTENCODING_UTF8);
68 }
69 
70 void lcl_lokGetWholeFunctionList()
71 {
72  const SfxViewShell* pViewShell = SfxViewShell::Current();
74  && pViewShell && pViewShell->isLOKMobilePhone()))
75  return;
76 
78  sal_uInt32 nListCount = pFuncList->GetCount();
79  std::set<OUString> aFuncNameOrderedSet;
80  for(sal_uInt32 i = 0; i < nListCount; ++i)
81  {
82  const ScFuncDesc* pDesc = pFuncList->GetFunction( i );
83  if ( pDesc->mxFuncName )
84  {
85  aFuncNameOrderedSet.insert(*pDesc->mxFuncName);
86  }
87  }
89  if (!(pFuncManager && aFuncNameOrderedSet.size()))
90  return;
91 
92  OStringBuffer aPayload;
93  aPayload.append("{ \"wholeList\": true, ");
94  aPayload.append("\"categories\": [ ");
95 
96  formula::FormulaHelper aHelper(pFuncManager);
97  sal_uInt32 nCategoryCount = pFuncManager->getCount();
98  for (sal_uInt32 i = 0; i < nCategoryCount; ++i)
99  {
100  OUString sCategoryName = ScFunctionMgr::GetCategoryName(i);
101  aPayload.append("{");
102  aPayload.append("\"name\": \"");
103  aPayload.append(escapeJSON(sCategoryName));
104  aPayload.append("\"}, ");
105  }
106  sal_Int32 nLen = aPayload.getLength();
107  aPayload[nLen - 2] = ' ';
108  aPayload[nLen - 1] = ']';
109  aPayload.append(", ");
110 
111  OUString aDescFuncNameStr;
112  aPayload.append("\"functions\": [ ");
113  sal_uInt32 nCurIndex = 0;
114  for (const OUString& aFuncNameStr : aFuncNameOrderedSet)
115  {
116  aDescFuncNameStr = aFuncNameStr + "()";
117  sal_Int32 nNextFStart = 0;
118  const formula::IFunctionDescription* ppFDesc;
119  ::std::vector< OUString > aArgs;
120  OUString eqPlusFuncName = "=" + aDescFuncNameStr;
121  if ( aHelper.GetNextFunc( eqPlusFuncName, false, nNextFStart, nullptr, &ppFDesc, &aArgs ) )
122  {
123  if ( ppFDesc && !ppFDesc->getFunctionName().isEmpty() )
124  {
125  if (ppFDesc->getCategory())
126  {
127  aPayload.append("{");
128  aPayload.append("\"index\": ");
129  aPayload.append(OString::number(nCurIndex));
130  aPayload.append(", ");
131  aPayload.append("\"category\": ");
132  aPayload.append(OString::number(ppFDesc->getCategory()->getNumber()));
133  aPayload.append(", ");
134  aPayload.append("\"signature\": \"");
135  aPayload.append(escapeJSON(ppFDesc->getSignature()));
136  aPayload.append("\", ");
137  aPayload.append("\"description\": \"");
138  aPayload.append(escapeJSON(ppFDesc->getDescription()));
139  aPayload.append("\"}, ");
140  }
141  }
142  }
143  ++nCurIndex;
144  }
145  nLen = aPayload.getLength();
146  aPayload[nLen - 2] = ' ';
147  aPayload[nLen - 1] = ']';
148  aPayload.append(" }");
149 
150  OString s = aPayload.makeStringAndClear();
151  pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CALC_FUNCTION_LIST, s.getStr());
152 }
153 
154 } // end namespace
155 
157 {
158  ScTabViewShell* pTabViewShell = GetViewData()->GetViewShell();
159  SfxBindings& rBindings = pTabViewShell->GetViewFrame()->GetBindings();
160  ScModule* pScMod = SC_MOD();
161  const SfxItemSet* pReqArgs = rReq.GetArgs();
162  sal_uInt16 nSlot = rReq.GetSlot();
163 
164  if (nSlot != SID_CURRENTCELL) // this comes with MouseButtonUp
165  pTabViewShell->HideListBox(); // Autofilter-DropDown-Listbox
166 
167  if ( IS_EDITMODE() )
168  {
169  switch ( nSlot )
170  {
171  // when opening a reference-dialog the subshell may not be switched
172  // (on closing the dialog StopEditShell is called)
173  case SID_OPENDLG_FUNCTION:
174  // inplace leads to trouble with EditShell ...
176  if (!pTabViewShell->GetViewFrame()->GetFrame().IsInPlace())
177  pTabViewShell->SetDontSwitch(true); // do not switch off EditShell
178  [[fallthrough]];
179 
180  case FID_CELL_FORMAT:
181  case SID_ENABLE_HYPHENATION:
182  case SID_DATA_SELECT:
183  case SID_OPENDLG_CONSOLIDATE:
184  case SID_OPENDLG_SOLVE:
185  case SID_OPENDLG_OPTSOLVER:
186 
187  pScMod->InputEnterHandler();
188  pTabViewShell->UpdateInputHandler();
189 
190  pTabViewShell->SetDontSwitch(false);
191 
192  break;
193 
194  default:
195  break;
196  }
197  }
198 
199  switch ( nSlot )
200  {
201  case SID_STATUS_SELMODE:
202  if ( pReqArgs )
203  {
204  /* 0: STD Click cancels selection
205  * 1: ER Click extends selection
206  * 2: ERG Click defines further selection
207  */
208  sal_uInt16 nMode = static_cast<const SfxUInt16Item&>(pReqArgs->Get( nSlot )).GetValue();
209 
210  switch ( nMode )
211  {
212  case 1: nMode = KEY_SHIFT; break;
213  case 2: nMode = KEY_MOD1; break; // control-key
214  case 0:
215  default:
216  nMode = 0;
217  }
218 
219  pTabViewShell->LockModifiers( nMode );
220  }
221  else
222  {
223  // no arguments (also executed by double click on the status bar controller):
224  // advance to next selection mode
225 
226  sal_uInt16 nModifiers = pTabViewShell->GetLockedModifiers();
227  switch ( nModifiers )
228  {
229  case KEY_SHIFT: nModifiers = KEY_MOD1; break; // EXT -> ADD
230  case KEY_MOD1: nModifiers = 0; break; // ADD -> STD
231  default: nModifiers = KEY_SHIFT; break; // STD -> EXT
232  }
233  pTabViewShell->LockModifiers( nModifiers );
234  }
235 
236  rBindings.Invalidate( SID_STATUS_SELMODE );
237  rReq.Done();
238  break;
239 
240  // SID_STATUS_SELMODE_NORM is not used ???
241 
242  case SID_STATUS_SELMODE_NORM:
243  pTabViewShell->LockModifiers( 0 );
244  rBindings.Invalidate( SID_STATUS_SELMODE );
245  break;
246 
247  // SID_STATUS_SELMODE_ERG / SID_STATUS_SELMODE_ERW as toggles:
248 
249  case SID_STATUS_SELMODE_ERG:
250  if ( pTabViewShell->GetLockedModifiers() & KEY_MOD1 )
251  pTabViewShell->LockModifiers( 0 );
252  else
253  pTabViewShell->LockModifiers( KEY_MOD1 );
254  rBindings.Invalidate( SID_STATUS_SELMODE );
255  break;
256 
257  case SID_STATUS_SELMODE_ERW:
258  if ( pTabViewShell->GetLockedModifiers() & KEY_SHIFT )
259  pTabViewShell->LockModifiers( 0 );
260  else
261  pTabViewShell->LockModifiers( KEY_SHIFT );
262  rBindings.Invalidate( SID_STATUS_SELMODE );
263  break;
264 
265  case SID_ENTER_STRING:
266  {
267  if ( pReqArgs )
268  {
269  // In the LOK case, we want to set the document modified state
270  // right away at the start of the edit, so that the content is
271  // saved even when the user leaves the document before hitting
272  // Enter
273  // NOTE: This also means we want to set the modified state
274  // regardless of the DontCommit parameter's value.
275  if (comphelper::LibreOfficeKit::isActive() && !GetViewData()->GetDocShell()->IsModified())
276  {
278  rBindings.Invalidate(SID_SAVEDOC);
279  rBindings.Invalidate(SID_DOC_MODIFIED);
280  }
281 
282  OUString aStr( static_cast<const SfxStringItem&>(pReqArgs->
283  Get( SID_ENTER_STRING )).GetValue() );
284  const SfxPoolItem* pDontCommitItem;
285  bool bCommit = true;
286  if (pReqArgs->HasItem(FN_PARAM_1, &pDontCommitItem))
287  bCommit = !(static_cast<const SfxBoolItem*>(pDontCommitItem)->GetValue());
288 
289  ScInputHandler* pHdl = SC_MOD()->GetInputHdl( pTabViewShell );
290  if (bCommit)
291  {
292  pTabViewShell->EnterData( GetViewData()->GetCurX(),
293  GetViewData()->GetCurY(),
294  GetViewData()->GetTabNo(),
295  aStr );
296  }
297  else if (pHdl)
298  {
299  SC_MOD()->SetInputMode(SC_INPUT_TABLE);
300 
301  EditView* pTableView = pHdl->GetActiveView();
302  pHdl->DataChanging();
303  if (pTableView)
304  pTableView->GetEditEngine()->SetText(aStr);
305  pHdl->DataChanged();
306 
307  SC_MOD()->SetInputMode(SC_INPUT_NONE);
308  }
309 
310  if ( !pHdl || !pHdl->IsInEnterHandler() )
311  {
312  // UpdateInputHandler is needed after the cell content
313  // has changed, but if called from EnterHandler, UpdateInputHandler
314  // will be called later when moving the cursor.
315  pTabViewShell->UpdateInputHandler();
316  }
317 
318  rReq.Done();
319 
320  // no GrabFocus here, as otherwise on a Mac the tab jumps before the
321  // sideview, when the input was not finished
322  // (GrabFocus is called in KillEditView)
323  }
324  }
325  break;
326 
327  case SID_INSERT_MATRIX:
328  {
329  if ( pReqArgs )
330  {
331  OUString aStr = static_cast<const SfxStringItem&>(pReqArgs->
332  Get( SID_INSERT_MATRIX )).GetValue();
333  ScDocument* pDoc = GetViewData()->GetDocument();
334  pTabViewShell->EnterMatrix( aStr, pDoc->GetGrammar() );
335  rReq.Done();
336  }
337  }
338  break;
339 
340  case FID_INPUTLINE_ENTER:
341  case FID_INPUTLINE_BLOCK:
342  case FID_INPUTLINE_MATRIX:
343  {
344  if( pReqArgs == nullptr ) //XXX temporary HACK to avoid GPF
345  break;
346 
347  const ScInputStatusItem* pStatusItem
348  = static_cast<const ScInputStatusItem*>(&pReqArgs->
349  Get( FID_INPUTLINE_STATUS ));
350 
351  const ScAddress& aCursorPos = pStatusItem->GetPos();
352  const OUString& aString = pStatusItem->GetString();
353  const EditTextObject* pData = pStatusItem->GetEditData();
354 
355  if (pData)
356  {
357  if (nSlot == FID_INPUTLINE_BLOCK)
358  {
359  pTabViewShell->EnterBlock( aString, pData );
360  }
361  else if ( !aString.isEmpty() && ( aString[0] == '=' || aString[0] == '+' || aString[0] == '-' ) )
362  {
363  pTabViewShell->EnterData( aCursorPos.Col(), aCursorPos.Row(), aCursorPos.Tab(), aString, pData );
364  }
365  else
366  {
367  pTabViewShell->EnterData(aCursorPos.Col(), aCursorPos.Row(), aCursorPos.Tab(), *pData);
368  }
369  }
370  else
371  {
372  if (nSlot == FID_INPUTLINE_ENTER)
373  {
374  if (
375  aCursorPos.Col() == GetViewData()->GetCurX() &&
376  aCursorPos.Row() == GetViewData()->GetCurY() &&
377  aCursorPos.Tab() == GetViewData()->GetTabNo()
378  )
379  {
380  SfxStringItem aItem( SID_ENTER_STRING, aString );
381 
382  const SfxPoolItem* aArgs[2];
383  aArgs[0] = &aItem;
384  aArgs[1] = nullptr;
385  rBindings.Execute( SID_ENTER_STRING, aArgs );
386  }
387  else
388  {
389  pTabViewShell->EnterData( aCursorPos.Col(),
390  aCursorPos.Row(),
391  aCursorPos.Tab(),
392  aString );
393  rReq.Done();
394  }
395  }
396  else if (nSlot == FID_INPUTLINE_BLOCK)
397  {
398  pTabViewShell->EnterBlock( aString, nullptr );
399  rReq.Done();
400  }
401  else
402  {
403  ScDocument* pDoc = GetViewData()->GetDocument();
404  pTabViewShell->EnterMatrix( aString, pDoc->GetGrammar() );
405  rReq.Done();
406  }
407  }
408 
409  pTabViewShell->SetAutoSpellData(
410  aCursorPos.Col(), aCursorPos.Row(), pStatusItem->GetMisspellRanges());
411 
412  // no GrabFocus here, as otherwise on a Mac the tab jumps before the
413  // sideview, when the input was not finished
414  // (GrabFocus is called in KillEditView)
415  }
416  break;
417 
418  case SID_OPENDLG_FUNCTION:
419  {
420  const SfxViewShell* pViewShell = SfxViewShell::Current();
422  && pViewShell && pViewShell->isLOKMobilePhone())
423  {
424  // not set the dialog id in the mobile case or we would
425  // not be able to get cell address pasted in the edit view
426  // by just tapping on them
427  lcl_lokGetWholeFunctionList();
428  }
429  else
430  {
431  sal_uInt16 nId = SID_OPENDLG_FUNCTION;
432  SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame();
433  SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId );
434  bool bVis = comphelper::LibreOfficeKit::isActive() || pWnd == nullptr;
435  pScMod->SetRefDialog( nId, bVis );
436  }
437  rReq.Ignore();
438  }
439  break;
440 
441  case SID_OPENDLG_CONSOLIDATE:
442  {
443  sal_uInt16 nId = ScConsolidateDlgWrapper::GetChildWindowId();
444  SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame();
445  SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId );
446 
447  pScMod->SetRefDialog( nId, pWnd == nullptr );
448  }
449  break;
450 
451  case FID_CELL_FORMAT:
452  {
453  if ( pReqArgs != nullptr )
454  {
455 
456  // set cell attribute without dialog:
457 
458  std::unique_ptr<SfxItemSet> pEmptySet(
459  new SfxItemSet( *pReqArgs->GetPool(),
461  ATTR_PATTERN_END>{} ));
462 
463  std::unique_ptr<SfxItemSet> pNewSet(
464  new SfxItemSet( *pReqArgs->GetPool(),
466  ATTR_PATTERN_END>{} ));
467 
468  const SfxPoolItem* pAttr = nullptr;
469  sal_uInt16 nWhich = 0;
470 
471  for ( nWhich=ATTR_PATTERN_START; nWhich<=ATTR_PATTERN_END; nWhich++ )
472  if ( pReqArgs->GetItemState( nWhich, true, &pAttr ) == SfxItemState::SET )
473  pNewSet->Put( *pAttr );
474 
475  pTabViewShell->ApplyAttributes( pNewSet.get(), pEmptySet.get() );
476 
477  pNewSet.reset();
478  pEmptySet.reset();
479 
480  rReq.Done();
481  }
482  else
483  {
484  pTabViewShell->ExecuteCellFormatDlg( rReq, "" );
485  }
486  }
487  break;
488 
489  case SID_ENABLE_HYPHENATION:
490  pTabViewShell->ExecuteCellFormatDlg(rReq, "alignment");
491  break;
492 
493  case SID_PROPERTY_PANEL_CELLTEXT_DLG:
494  pTabViewShell->ExecuteCellFormatDlg( rReq, "font" );
495  break;
496 
497  case SID_CELL_FORMAT_BORDER:
498  pTabViewShell->ExecuteCellFormatDlg( rReq, "borders" );
499  break;
500 
501  case SID_CHAR_DLG_EFFECT:
502  pTabViewShell->ExecuteCellFormatDlg( rReq, "fonteffects" );
503  break;
504 
505  case SID_OPENDLG_SOLVE:
506  {
507  sal_uInt16 nId = ScSolverDlgWrapper::GetChildWindowId();
508  SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame();
509  SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId );
510 
511  pScMod->SetRefDialog( nId, pWnd == nullptr );
512  }
513  break;
514 
515  case SID_OPENDLG_OPTSOLVER:
516  {
517  sal_uInt16 nId = ScOptSolverDlgWrapper::GetChildWindowId();
518  SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame();
519  SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId );
520 
521  pScMod->SetRefDialog( nId, pWnd == nullptr );
522  }
523  break;
524 
525  case SID_OPENDLG_TABOP:
526  {
527  sal_uInt16 nId = ScTabOpDlgWrapper::GetChildWindowId();
528  SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame();
529  SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId );
530 
531  pScMod->SetRefDialog( nId, pWnd == nullptr );
532  }
533  break;
534 
535  case SID_SCENARIOS:
536  {
537  ScDocument* pDoc = GetViewData()->GetDocument();
538  ScMarkData& rMark = GetViewData()->GetMarkData();
539  SCTAB nTab = GetViewData()->GetTabNo();
540 
541  if ( pDoc->IsScenario(nTab) )
542  {
543  rMark.MarkToMulti();
544  if ( rMark.IsMultiMarked() )
545  {
546 
547  bool bExtend = rReq.IsAPI();
548  if (!bExtend)
549  {
550  std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pTabViewShell->GetFrameWeld(),
551  VclMessageType::Question, VclButtonsType::YesNo,
552  ScResId(STR_UPDATE_SCENARIO)));
553  xQueryBox->set_default_response(RET_YES);
554  bExtend = xQueryBox->run() == RET_YES;
555  }
556 
557  if (bExtend)
558  {
559  pTabViewShell->ExtendScenario();
560  rReq.Done();
561  }
562  }
563  else if( ! rReq.IsAPI() )
564  {
565  std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(pTabViewShell->GetFrameWeld(),
566  VclMessageType::Warning, VclButtonsType::Ok,
567  ScResId(STR_NOAREASELECTED)));
568  xErrorBox->run();
569  }
570  }
571  else
572  {
573  rMark.MarkToMulti();
574  if ( rMark.IsMultiMarked() )
575  {
576  SCTAB i=1;
577  OUString aBaseName;
578  OUString aName;
579  OUString aComment;
580  Color aColor;
581  ScScenarioFlags nFlags;
582 
583  OUString aTmp;
584  pDoc->GetName(nTab, aTmp);
585  aBaseName = aTmp + "_" + ScResId(STR_SCENARIO) + "_";
586 
587  // first test, if the prefix is recognised as valid,
588  // else avoid only doubles
589  bool bPrefix = ScDocument::ValidTabName( aBaseName );
590  OSL_ENSURE(bPrefix, "invalid sheet name");
591 
592  while ( pDoc->IsScenario(nTab+i) )
593  i++;
594 
595  bool bValid;
596  SCTAB nDummy;
597  do
598  {
599  aName = aBaseName + OUString::number( i );
600  if (bPrefix)
601  bValid = pDoc->ValidNewTabName( aName );
602  else
603  bValid = !pDoc->GetTable( aName, nDummy );
604  ++i;
605  }
606  while ( !bValid && i <= MAXTAB + 2 );
607 
608  if ( pReqArgs != nullptr )
609  {
610  OUString aArgName;
611  OUString aArgComment;
612  const SfxPoolItem* pItem;
613  if ( pReqArgs->GetItemState( SID_SCENARIOS, true, &pItem ) == SfxItemState::SET )
614  aArgName = static_cast<const SfxStringItem*>(pItem)->GetValue();
615  if ( pReqArgs->GetItemState( SID_NEW_TABLENAME, true, &pItem ) == SfxItemState::SET )
616  aArgComment = static_cast<const SfxStringItem*>(pItem)->GetValue();
617 
618  aColor = COL_LIGHTGRAY; // Default
619  nFlags = ScScenarioFlags::NONE; // not TwoWay
620 
621  pTabViewShell->MakeScenario( aArgName, aArgComment, aColor, nFlags );
622  if( ! rReq.IsAPI() )
623  rReq.Done();
624  }
625  else
626  {
627  bool bSheetProtected = pDoc->IsTabProtected(nTab);
629 
630  ScopedVclPtr<AbstractScNewScenarioDlg> pNewDlg(pFact->CreateScNewScenarioDlg(pTabViewShell->GetFrameWeld(), aName, false, bSheetProtected));
631  if ( pNewDlg->Execute() == RET_OK )
632  {
633  pNewDlg->GetScenarioData( aName, aComment, aColor, nFlags );
634  pTabViewShell->MakeScenario( aName, aComment, aColor, nFlags );
635 
636  rReq.AppendItem( SfxStringItem( SID_SCENARIOS, aName ) );
637  rReq.AppendItem( SfxStringItem( SID_NEW_TABLENAME, aComment ) );
638  rReq.Done();
639  }
640  }
641  }
642  else if( ! rReq.IsAPI() )
643  {
644  pTabViewShell->ErrorMessage(STR_ERR_NEWSCENARIO);
645  }
646  }
647  }
648  break;
649 
650  case SID_SELECTALL:
651  {
652  pTabViewShell->SelectAll();
653  rReq.Done();
654  }
655  break;
656 
657  case FID_ROW_HEIGHT:
658  {
659  const SfxPoolItem* pRow;
660  const SfxPoolItem* pHeight;
661  sal_uInt16 nHeight;
662 
663  if ( pReqArgs && pReqArgs->HasItem( FID_ROW_HEIGHT, &pHeight ) &&
664  pReqArgs->HasItem( FN_PARAM_1, &pRow ) )
665  {
666  std::vector<sc::ColRowSpan> aRanges;
667  SCCOLROW nRow = static_cast<const SfxInt32Item*>(pRow)->GetValue() - 1;
668  nHeight = static_cast<const SfxUInt16Item*>(pHeight)->GetValue();
669  ScMarkData& rMark = GetViewData()->GetMarkData();
670 
671  if ( rMark.IsRowMarked( static_cast<SCROW>(nRow) ) )
672  {
673  aRanges = rMark.GetMarkedRowSpans();
674  }
675  else
676  {
677  aRanges.emplace_back(nRow, nRow);
678  }
679 
680  pTabViewShell->SetWidthOrHeight(false, aRanges, SC_SIZE_DIRECT, HMMToTwips(nHeight));
681  }
682  else if ( pReqArgs && pReqArgs->HasItem( FID_ROW_HEIGHT, &pHeight ) )
683  {
684  nHeight = static_cast<const SfxUInt16Item*>(pHeight)->GetValue();
685 
686  // #101390#; the value of the macro is in HMM so use HMMToTwips to convert
687  pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_DIRECT,
688  sal::static_int_cast<sal_uInt16>( HMMToTwips(nHeight) ) );
689  if( ! rReq.IsAPI() )
690  rReq.Done();
691  }
692  else
693  {
695  FieldUnit eMetric = SC_MOD()->GetAppOptions().GetAppMetric();
696  sal_uInt16 nCurHeight = pData->GetDocument()->
697  GetRowHeight( pData->GetCurY(),
698  pData->GetTabNo() );
700  ScopedVclPtr<AbstractScMetricInputDlg> pDlg(pFact->CreateScMetricInputDlg(
701  pTabViewShell->GetFrameWeld(), "RowHeightDialog",
702  nCurHeight, ScGlobal::nStdRowHeight,
703  eMetric, 2, MAX_ROW_HEIGHT));
704 
705  if ( pDlg->Execute() == RET_OK )
706  {
707  long nVal = pDlg->GetInputValue();
708  pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_DIRECT, static_cast<sal_uInt16>(nVal) );
709 
710  // #101390#; the value of the macro should be in HMM so use TwipsToEvenHMM to convert
711  rReq.AppendItem( SfxUInt16Item( FID_ROW_HEIGHT, static_cast<sal_uInt16>(TwipsToEvenHMM(nVal)) ) );
712  rReq.Done();
713 
714  }
715  }
716  }
717  break;
718 
719  case FID_ROW_OPT_HEIGHT:
720  {
721  if ( pReqArgs )
722  {
723  const SfxUInt16Item& rUInt16Item = static_cast<const SfxUInt16Item&>(pReqArgs->Get( FID_ROW_OPT_HEIGHT ));
724 
725  // #101390#; the value of the macro is in HMM so use HMMToTwips to convert
726  pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_OPTIMAL,
727  sal::static_int_cast<sal_uInt16>( HMMToTwips(rUInt16Item.GetValue()) ) );
728  ScGlobal::nLastRowHeightExtra = rUInt16Item.GetValue();
729 
730  if( ! rReq.IsAPI() )
731  rReq.Done();
732  }
733  else
734  {
735  FieldUnit eMetric = SC_MOD()->GetAppOptions().GetAppMetric();
736 
739  pTabViewShell->GetFrameWeld(), "OptimalRowHeightDialog",
741  if ( pDlg->Execute() == RET_OK )
742  {
743  long nVal = pDlg->GetInputValue();
744  pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_OPTIMAL, static_cast<sal_uInt16>(nVal) );
746 
747  // #101390#; the value of the macro should be in HMM so use TwipsToEvenHMM to convert
748  rReq.AppendItem( SfxUInt16Item( FID_ROW_OPT_HEIGHT, static_cast<sal_uInt16>(TwipsToEvenHMM(nVal)) ) );
749  rReq.Done();
750 
751  }
752  }
753  }
754  break;
755 
756  case FID_COL_WIDTH:
757  {
758  const SfxPoolItem* pColumn;
759  const SfxPoolItem* pWidth;
760  sal_uInt16 nWidth;
761 
762  if ( pReqArgs && pReqArgs->HasItem( FID_COL_WIDTH, &pWidth ) &&
763  pReqArgs->HasItem( FN_PARAM_1, &pColumn ) )
764  {
765  std::vector<sc::ColRowSpan> aRanges;
766  SCCOLROW nColumn = static_cast<const SfxUInt16Item*>(pColumn)->GetValue() - 1;
767  nWidth = static_cast<const SfxUInt16Item*>(pWidth)->GetValue();
768  ScMarkData& rMark = GetViewData()->GetMarkData();
769 
770  if ( rMark.IsColumnMarked( static_cast<SCCOL>(nColumn) ) )
771  {
772  aRanges = rMark.GetMarkedColSpans();
773  }
774  else
775  {
776  aRanges.emplace_back(nColumn, nColumn);
777  }
778 
779  pTabViewShell->SetWidthOrHeight(true, aRanges, SC_SIZE_DIRECT, HMMToTwips(nWidth));
780  }
781  else if ( pReqArgs && pReqArgs->HasItem( FID_COL_WIDTH, &pWidth ) )
782  {
783  nWidth = static_cast<const SfxUInt16Item*>(pWidth)->GetValue();
784 
785  // #101390#; the value of the macro is in HMM so use HMMToTwips to convert
786  pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_DIRECT,
787  sal::static_int_cast<sal_uInt16>( HMMToTwips(nWidth) ) );
788  if( ! rReq.IsAPI() )
789  rReq.Done();
790  }
791  else
792  {
793  FieldUnit eMetric = SC_MOD()->GetAppOptions().GetAppMetric();
795  sal_uInt16 nCurHeight = pData->GetDocument()->
796  GetColWidth( pData->GetCurX(),
797  pData->GetTabNo() );
799  ScopedVclPtr<AbstractScMetricInputDlg> pDlg(pFact->CreateScMetricInputDlg(
800  pTabViewShell->GetFrameWeld(), "ColWidthDialog", nCurHeight,
801  STD_COL_WIDTH, eMetric, 2, MAX_COL_WIDTH));
802  if ( pDlg->Execute() == RET_OK )
803  {
804  long nVal = pDlg->GetInputValue();
805  pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_DIRECT, static_cast<sal_uInt16>(nVal) );
806 
807  // #101390#; the value of the macro should be in HMM so use TwipsToEvenHMM to convert
808  rReq.AppendItem( SfxUInt16Item( FID_COL_WIDTH, static_cast<sal_uInt16>(TwipsToEvenHMM(nVal))) );
809  rReq.Done();
810 
811  }
812  }
813  }
814  break;
815 
816  case FID_COL_OPT_WIDTH:
817  {
818  if ( pReqArgs )
819  {
820  const SfxUInt16Item& rUInt16Item = static_cast<const SfxUInt16Item&>(pReqArgs->Get( FID_COL_OPT_WIDTH ));
821 
822  // #101390#; the value of the macro is in HMM so use HMMToTwips to convert
823  pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_OPTIMAL,
824  sal::static_int_cast<sal_uInt16>( HMMToTwips(rUInt16Item.GetValue()) ) );
825  ScGlobal::nLastColWidthExtra = rUInt16Item.GetValue();
826 
827  if( ! rReq.IsAPI() )
828  rReq.Done();
829  }
830  else
831  {
832  FieldUnit eMetric = SC_MOD()->GetAppOptions().GetAppMetric();
833 
836  pTabViewShell->GetFrameWeld(), "OptimalColWidthDialog",
838  if ( pDlg->Execute() == RET_OK )
839  {
840  long nVal = pDlg->GetInputValue();
841  pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_OPTIMAL, static_cast<sal_uInt16>(nVal) );
843 
844  // #101390#; the value of the macro should be in HMM so use TwipsToEvenHMM to convert
845  rReq.AppendItem( SfxUInt16Item( FID_COL_OPT_WIDTH, static_cast<sal_uInt16>(TwipsToEvenHMM(nVal)) ) );
846  rReq.Done();
847  }
848  }
849  }
850  break;
851 
852  case FID_COL_OPT_DIRECT:
853  pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_OPTIMAL, STD_EXTRA_WIDTH );
854  rReq.Done();
855  break;
856 
857  case FID_ROW_HIDE:
858  pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_DIRECT, 0 );
859  rReq.Done();
860  break;
861  case FID_ROW_SHOW:
862  pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_SHOW, 0 );
863  rReq.Done();
864  break;
865  case FID_COL_HIDE:
866  pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_DIRECT, 0 );
867  rReq.Done();
868  break;
869  case FID_COL_SHOW:
870  pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_SHOW, 0 );
871  rReq.Done();
872  break;
873 
874  case SID_CELL_FORMAT_RESET:
875  {
877  rReq.Done();
878  }
879  break;
880 
881  case FID_MERGE_ON:
882  case FID_MERGE_OFF:
883  case FID_MERGE_TOGGLE:
884  {
885  if ( !GetViewData()->GetDocument()->GetChangeTrack() )
886  {
887  // test whether to merge or to split
888  bool bMerge = false;
889  bool bCenter = false;
890  switch( nSlot )
891  {
892  case FID_MERGE_ON:
893  bMerge = true;
894  break;
895  case FID_MERGE_OFF:
896  bMerge = false;
897  break;
898  case FID_MERGE_TOGGLE:
899  {
900  bCenter = true;
901  std::unique_ptr<SfxPoolItem> pItem;
902  if( rBindings.QueryState( nSlot, pItem ) >= SfxItemState::DEFAULT )
903  bMerge = !static_cast< SfxBoolItem* >( pItem.get() )->GetValue();
904  }
905  break;
906  }
907 
908  if( bMerge )
909  {
910  // merge - check if to move contents of covered cells
911  bool bMoveContents = false;
912  bool bApi = rReq.IsAPI();
913  const SfxPoolItem* pItem;
914  if ( pReqArgs &&
915  pReqArgs->GetItemState(nSlot, true, &pItem) == SfxItemState::SET )
916  {
917  OSL_ENSURE(dynamic_cast<const SfxBoolItem*>( pItem), "wrong item");
918  bMoveContents = static_cast<const SfxBoolItem*>(pItem)->GetValue();
919  }
920 
921  if (pTabViewShell->MergeCells( bApi, bMoveContents, bCenter ))
922  {
923  if (!bApi && bMoveContents) // "yes" clicked in dialog
924  rReq.AppendItem( SfxBoolItem( nSlot, bMoveContents ) );
925  rBindings.Invalidate( nSlot );
926  rReq.Done();
927  }
928  }
929  else
930  {
931  // split cells
932  if (pTabViewShell->RemoveMerge())
933  {
934  rBindings.Invalidate( nSlot );
935  rReq.Done();
936  }
937  }
938  break;
939  }
940  }
941  break;
942 
943  case SID_AUTOFORMAT:
944  {
945  weld::Window* pDlgParent = pTabViewShell->GetFrameWeld();
946  SCCOL nStartCol;
947  SCROW nStartRow;
948  SCTAB nStartTab;
949  SCCOL nEndCol;
950  SCROW nEndRow;
951  SCTAB nEndTab;
952 
953  const ScMarkData& rMark = GetViewData()->GetMarkData();
954  if ( !rMark.IsMarked() && !rMark.IsMultiMarked() )
955  pTabViewShell->MarkDataArea();
956 
957  GetViewData()->GetSimpleArea( nStartCol,nStartRow,nStartTab,
958  nEndCol,nEndRow,nEndTab );
959 
960  if ( ( std::abs(nEndCol-nStartCol) > 1 )
961  && ( std::abs(nEndRow-nStartRow) > 1 ) )
962  {
963  if ( pReqArgs )
964  {
965  const SfxStringItem& rNameItem = pReqArgs->Get( SID_AUTOFORMAT );
967  ScAutoFormat::const_iterator it = pFormat->find(rNameItem.GetValue());
968  ScAutoFormat::const_iterator itBeg = pFormat->begin();
969  size_t nIndex = std::distance(itBeg, it);
970 
971  pTabViewShell->AutoFormat( nIndex );
972 
973  if( ! rReq.IsAPI() )
974  rReq.Done();
975  }
976  else
977  {
979  std::unique_ptr<ScAutoFormatData> pNewEntry(pTabViewShell->CreateAutoFormatData());
981 
982  ScopedVclPtr<AbstractScAutoFormatDlg> pDlg(pFact->CreateScAutoFormatDlg(pDlgParent, ScGlobal::GetOrCreateAutoFormat(), pNewEntry.get(), GetViewData()));
983 
984  if ( pDlg->Execute() == RET_OK )
985  {
986  ScEditableTester aTester( pTabViewShell );
987  if ( !aTester.IsEditable() )
988  {
989  pTabViewShell->ErrorMessage(aTester.GetMessageId());
990  }
991  else
992  {
993  pTabViewShell->AutoFormat( pDlg->GetIndex() );
994 
995  rReq.AppendItem( SfxStringItem( SID_AUTOFORMAT, pDlg->GetCurrFormatName() ) );
996  rReq.Done();
997  }
998  }
999  }
1000  }
1001  else
1002  {
1003  std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(pDlgParent,
1004  VclMessageType::Warning, VclButtonsType::Ok,
1005  ScResId(STR_INVALID_AFAREA)));
1006  xErrorBox->run();
1007  }
1008  }
1009  break;
1010 
1011  case SID_CANCEL:
1012  {
1013  if (GetViewData()->HasEditView(GetViewData()->GetActivePart()))
1014  pScMod->InputCancelHandler();
1015  else if (pTabViewShell->HasPaintBrush())
1016  pTabViewShell->ResetBrushDocument(); // abort format paint brush
1017  else if (pTabViewShell->HasHintWindow())
1018  pTabViewShell->RemoveHintWindow();
1019  else if( ScViewUtil::IsFullScreen( *pTabViewShell ) )
1020  ScViewUtil::SetFullScreen( *pTabViewShell, false );
1021  else
1022  {
1023  // TODO/LATER: when is this code executed?
1024  pTabViewShell->Escape();
1025  }
1026  }
1027  break;
1028 
1029  case SID_DATA_SELECT:
1030  pTabViewShell->StartDataSelect();
1031  break;
1032 
1033  case SID_DETECTIVE_FILLMODE:
1034  {
1035  bool bOldMode = pTabViewShell->IsAuditShell();
1036  pTabViewShell->SetAuditShell( !bOldMode );
1037  pTabViewShell->Invalidate( nSlot );
1038  }
1039  break;
1040 
1041  case FID_INPUTLINE_STATUS:
1042  OSL_FAIL("Execute from InputLine status");
1043  break;
1044 
1045  case SID_STATUS_DOCPOS:
1046  // Launch navigator.
1048  SID_NAVIGATOR, SfxCallMode::SYNCHRON|SfxCallMode::RECORD );
1049  break;
1050 
1051  case SID_MARKAREA:
1052  // called from Basic at the hidden view to select a range in the visible view
1053  OSL_FAIL("old slot SID_MARKAREA");
1054  break;
1055 
1056  default:
1057  OSL_FAIL("ScCellShell::Execute: unknown slot");
1058  break;
1059  }
1060 }
1061 
1062 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScMarkData & GetMarkData()
Definition: viewdata.cxx:3053
virtual sal_uInt32 getCount() const override
Definition: funcdesc.cxx:1139
SfxViewFrame * GetViewFrame() const
List of spreadsheet functions.
Definition: funcdesc.hxx:242
void DeleteContents(InsertDeleteFlags nFlags)
Definition: viewfunc.cxx:1937
void SelectAll(bool bContinue=false)
Definition: tabview2.cxx:1063
void MarkDataArea(bool bIncludeCursor=true)
Definition: tabview3.cxx:1644
FieldUnit
void ResetBrushDocument()
Definition: tabview5.cxx:640
const EditTextObject * GetEditData() const
Definition: uiitems.hxx:70
sal_Int32 nIndex
ScDocShell * GetDocShell() const
Definition: viewdata.hxx:354
virtual OUString getFunctionName() const =0
#define IS_EDITMODE()
Definition: cellsh3.cxx:54
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
virtual int GetInputValue() const =0
SfxChildWindow * GetChildWindow(sal_uInt16)
constexpr sal_uInt16 KEY_MOD1
bool isLOKMobilePhone() const
SCROW Row() const
Definition: address.hxx:262
void MarkToMulti()
Definition: markdata.cxx:224
constexpr sal_uInt16 ATTR_PATTERN_START(100)
std::unique_ptr< ContentProperties > pData
std::string GetValue
ScViewData * GetViewData()
Definition: formatsh.hxx:35
virtual OUString getSignature() const =0
sal_uInt16 char char * pDesc
Definition: callform.cxx:58
ScScenarioFlags
Definition: global.hxx:236
bool DataChanging(sal_Unicode cTyped=0, bool bFromCommand=false)
Definition: inputhdl.cxx:2566
SCROW GetCurY() const
Definition: viewdata.hxx:402
SC_DLLPUBLIC bool ValidNewTabName(const OUString &rName) const
Definition: document.cxx:374
std::vector< sc::ColRowSpan > GetMarkedRowSpans() const
Definition: markdata.cxx:479
sal_uInt16 GetValue() const
sal_Int16 nId
void EnterBlock(const OUString &rString, const EditTextObject *pData)
Definition: viewfun2.cxx:850
sal_uInt16 GetLockedModifiers() const
Definition: tabview.cxx:1894
void SetAuditShell(bool bActive)
Definition: tabvwsh4.cxx:678
SCTAB GetTabNo() const
Definition: viewdata.hxx:395
virtual sal_uInt16 GetIndex() const =0
void Done(bool bRemove=false)
void RemoveHintWindow()
Definition: tabview3.cxx:865
void SetAutoSpellData(SCCOL nPosX, SCROW nPosY, const std::vector< editeng::MisspellRanges > *pRanges)
Definition: tabview.cxx:2276
static bool IsFullScreen(const SfxViewShell &rViewShell)
Returns true, if the passed view shell is in full screen mode.
Definition: viewutil.cxx:332
constexpr::Color COL_LIGHTGRAY(0xC0, 0xC0, 0xC0)
SC_DLLPUBLIC formula::FormulaGrammar::Grammar GetGrammar() const
Definition: document.hxx:985
const SfxItemSet * GetArgs() const
void Invalidate(sal_uInt16 nId)
virtual short Execute()=0
void LockModifiers(sal_uInt16 nModifiers)
Definition: tabview.cxx:1888
void SetDontSwitch(bool bFlag)
Definition: tabvwsh.hxx:284
Stores spreadsheet functions in categories, including a cumulative ('All') category and makes them ac...
Definition: funcdesc.hxx:306
virtual OUString getDescription() const =0
SC_DLLPUBLIC void InputEnterHandler(ScEnterMode nBlockMode=ScEnterMode::NORMAL)
Definition: scmod.cxx:1359
EditView * GetActiveView()
Definition: inputhdl.cxx:2212
bool GetNextFunc(const OUString &rFormula, bool bBack, sal_Int32 &rFStart, sal_Int32 *pFEnd=nullptr, const IFunctionDescription **ppFDesc=nullptr,::std::vector< OUString > *pArgs=nullptr) const
static void SetFullScreen(const SfxViewShell &rViewShell, bool bSet)
Enters or leaves full screen mode at the passed view shell.
Definition: viewutil.cxx:344
void StartDataSelect()
Definition: tabview.cxx:2179
bool IsInEnterHandler() const
Definition: inputhdl.hxx:264
RET_YES
#define STD_COL_WIDTH
Definition: global.hxx:93
void SetText(const OUString &rStr)
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
Definition: types.hxx:24
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
static SfxViewShell * Current()
void libreOfficeKitViewCallback(int nType, const char *pPayload) const override
#define STD_EXTRA_WIDTH
Definition: global.hxx:94
SC_DLLPUBLIC bool GetTable(const OUString &rName, SCTAB &rTab) const
Definition: document.cxx:260
void AutoFormat(sal_uInt16 nFormatNo)
Definition: viewfun2.cxx:1854
bool RemoveMerge()
Definition: viewfun2.cxx:1307
void UpdateInputHandler(bool bForce=false, bool bStopEditing=true)
Definition: tabvwsha.cxx:632
SCTAB Tab() const
Definition: address.hxx:271
ScDocument * GetDocument() const
Definition: viewdata.cxx:859
const_iterator begin() const
Definition: autoform.cxx:814
bool Execute(sal_uInt16 nSlot, const SfxPoolItem **pArgs=nullptr, SfxCallMode nCall=SfxCallMode::SLOT)
virtual OUString GetCurrFormatName()=0
bool HasHintWindow() const
Definition: tabview3.cxx:863
bool IsRowMarked(SCROW nRow) const
Definition: markdata.cxx:318
ScTabViewShell * GetViewShell() const
Definition: viewdata.hxx:357
static SC_DLLPUBLIC sal_uInt16 nStdRowHeight
Definition: global.hxx:584
const char * GetMessageId() const
Definition: editable.cxx:152
static void ClearAutoFormat()
Definition: global.cxx:235
bool IsMarked() const
Definition: markdata.hxx:82
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
int i
bool IsColumnMarked(SCCOL nCol) const
Definition: markdata.cxx:302
sal_Int16 SCCOL
Definition: types.hxx:22
long TwipsToEvenHMM(long nTwips)
Definition: global.hxx:110
EditEngine * GetEditEngine() const
#define SC_MOD()
Definition: scmod.hxx:253
SfxBindings & GetBindings()
Any aHelper
void ExecuteCellFormatDlg(SfxRequest &rReq, const OString &rTabPage)
Definition: tabvwsha.cxx:478
const OUString & GetValue() const
long HMMToTwips(long nHMM)
Definition: global.hxx:109
static long nLastColWidthExtra
Definition: global.hxx:587
static ScFunctionMgr * GetStarCalcFunctionMgr()
Definition: global.cxx:623
OUString ScResId(const char *pId)
Definition: scdll.cxx:95
ScMarkType GetSimpleArea(SCCOL &rStartCol, SCROW &rStartRow, SCTAB &rStartTab, SCCOL &rEndCol, SCROW &rEndRow, SCTAB &rEndTab) const
Definition: viewdata.cxx:1173
SfxItemState QueryState(sal_uInt16 nSID, std::unique_ptr< SfxPoolItem > &rpState)
const std::vector< editeng::MisspellRanges > * GetMisspellRanges() const
Definition: uiitems.hxx:73
static SC_DLLPUBLIC long nLastRowHeightExtra
Definition: global.hxx:586
static OUString GetCategoryName(sal_uInt32 _nCategoryNumber)
Returns name of category.
Definition: funcdesc.cxx:1171
bool IsEditable() const
Definition: editable.hxx:84
#define MAX_EXTRA_WIDTH
Definition: global.hxx:98
const SCTAB MAXTAB
Definition: address.hxx:71
#define MAX_EXTRA_HEIGHT
Definition: global.hxx:99
SfxItemPool * GetPool() const
const ScFuncDesc * GetFunction(sal_uInt32 nIndex) const
Definition: funcdesc.cxx:1015
virtual VclPtr< AbstractScNewScenarioDlg > CreateScNewScenarioDlg(weld::Window *pParent, const OUString &rName, bool bEdit, bool bSheetProtected)=0
SCCOL Col() const
Definition: address.hxx:267
static ScFunctionList * GetStarCalcFunctionList()
Definition: global.cxx:614
#define MAX_COL_WIDTH
Definition: global.hxx:100
bool IsAuditShell() const
Definition: tabvwsh4.cxx:996
virtual const IFunctionCategory * getCategory() const =0
OString OUStringToOString(const OUString &str, ConnectionSettings const *settings)
iterator find(const OUString &rName)
Definition: autoform.cxx:793
bool HasPaintBrush() const
Definition: tabview.hxx:584
void EnterMatrix(const OUString &rString,::formula::FormulaGrammar::Grammar eGram)
Definition: viewfunc.cxx:759
sal_Int32 SCROW
Definition: types.hxx:18
sal_uInt16 GetSlot() const
std::optional< OUString > mxFuncName
Function name.
Definition: funcdesc.hxx:217
bool MergeCells(bool bApi, bool &rDoContents, bool bCenter)
Definition: viewfun2.cxx:1140
weld::Window * GetFrameWeld() const
SC_DLLPUBLIC bool IsScenario(SCTAB nTab) const
Definition: documen3.cxx:413
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
bool IsInPlace() const
#define MAX_ROW_HEIGHT
Definition: global.hxx:101
void ErrorMessage(const char *pGlobStrId)
Definition: tabview2.cxx:1412
static SC_DLLPUBLIC bool ValidTabName(const OUString &rName)
Definition: document.cxx:335
virtual void Invalidate(sal_uInt16 nId=0)
virtual sal_uInt32 getNumber() const =0
OUString aName
static SC_DLLPUBLIC ScAbstractDialogFactory * Create()
Definition: scabstdlg.cxx:38
SfxDispatcher & GetDispatcher()
Definition: viewdata.cxx:3047
MapType::const_iterator const_iterator
Definition: autoform.hxx:191
RET_OK
bool HasItem(sal_uInt16 nWhich, const SfxPoolItem **ppItem=nullptr) const
constexpr sal_uInt16 ATTR_PATTERN_END(155)
void DataChanged(bool bFromTopNotify=false, bool bSetModified=true)
Definition: inputhdl.cxx:2578
void SetWidthOrHeight(bool bWidth, const std::vector< sc::ColRowSpan > &rRanges, ScSizeMode eMode, sal_uInt16 nSizeTwips, bool bRecord=true, const ScMarkData *pMarkData=nullptr)
Definition: viewfunc.cxx:2023
sal_uInt32 GetCount() const
Definition: funcdesc.hxx:248
virtual void GetScenarioData(OUString &rName, OUString &rComment, Color &rColor, ScScenarioFlags &rFlags) const =0
const ScAddress & GetPos() const
Definition: uiitems.hxx:67
void InputCancelHandler()
Definition: scmod.cxx:1369
void HideListBox()
Definition: tabview3.cxx:2950
const OUString & GetString() const
Definition: uiitems.hxx:69
virtual void SetModified(bool=true) override
Definition: docsh.cxx:2811
void AppendItem(const SfxPoolItem &)
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
void SetMarkedWidthOrHeight(bool bWidth, ScSizeMode eMode, sal_uInt16 nSizeTwips)
Definition: viewfunc.cxx:2329
void ApplyAttributes(const SfxItemSet *pDialogSet, const SfxItemSet *pOldSet, bool bAdjustBlockHeight=true)
Definition: viewfunc.cxx:886
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)
constexpr sal_uInt16 KEY_SHIFT
static SC_DLLPUBLIC ScAutoFormat * GetOrCreateAutoFormat()
Definition: global.cxx:253
ScAutoFormatData * CreateAutoFormatData()
Definition: viewfun2.cxx:1833
void ExtendScenario()
Definition: viewfun2.cxx:2273
std::vector< sc::ColRowSpan > GetMarkedColSpans() const
Definition: markdata.cxx:496
void Ignore()
Stores and generates human readable descriptions for spreadsheet-functions, e.g. functions used in fo...
Definition: funcdesc.hxx:41
aStr
SC_DLLPUBLIC bool GetName(SCTAB nTab, OUString &rName) const
Definition: document.cxx:213
void Execute(SfxRequest &)
Definition: cellsh3.cxx:156
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, bool bMobile=false)
sal_Int16 SCTAB
Definition: types.hxx:23
void EnterData(SCCOL nCol, SCROW nRow, SCTAB nTab, const OUString &rString, const EditTextObject *pData=nullptr)
Definition: viewfunc.cxx:342
SCCOL GetCurX() const
Definition: viewdata.hxx:401
void MakeScenario(const OUString &rName, const OUString &rComment, const Color &rColor, ScScenarioFlags nFlags)
Definition: viewfun2.cxx:2252
virtual VclPtr< AbstractScMetricInputDlg > CreateScMetricInputDlg(weld::Window *pParent, const OString &sDialogName, long nCurrent, long nDefault, FieldUnit eFUnit, sal_uInt16 nDecimals, long nMaximum, long nMinimum=0)=0