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