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