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(OString::number(nCurIndex));
129  aPayload.append(", ");
130  aPayload.append("\"category\": ");
131  aPayload.append(OString::number(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  std::unique_ptr<SfxItemSet> pEmptySet(
458  new SfxItemSet( *pReqArgs->GetPool(),
460  ATTR_PATTERN_END>{} ));
461 
462  std::unique_ptr<SfxItemSet> pNewSet(
463  new SfxItemSet( *pReqArgs->GetPool(),
465  ATTR_PATTERN_END>{} ));
466 
467  const SfxPoolItem* pAttr = nullptr;
468  sal_uInt16 nWhich = 0;
469 
470  for ( nWhich=ATTR_PATTERN_START; nWhich<=ATTR_PATTERN_END; nWhich++ )
471  if ( pReqArgs->GetItemState( nWhich, true, &pAttr ) == SfxItemState::SET )
472  pNewSet->Put( *pAttr );
473 
474  pTabViewShell->ApplyAttributes( pNewSet.get(), pEmptySet.get() );
475 
476  pNewSet.reset();
477  pEmptySet.reset();
478 
479  rReq.Done();
480  }
481  else
482  {
483  pTabViewShell->ExecuteCellFormatDlg( rReq, "" );
484  }
485  }
486  break;
487 
488  case SID_ENABLE_HYPHENATION:
489  pTabViewShell->ExecuteCellFormatDlg(rReq, "alignment");
490  break;
491 
492  case SID_PROPERTY_PANEL_CELLTEXT_DLG:
493  pTabViewShell->ExecuteCellFormatDlg( rReq, "font" );
494  break;
495 
496  case SID_CELL_FORMAT_BORDER:
497  pTabViewShell->ExecuteCellFormatDlg( rReq, "borders" );
498  break;
499 
500  case SID_CHAR_DLG_EFFECT:
501  pTabViewShell->ExecuteCellFormatDlg( rReq, "fonteffects" );
502  break;
503 
504  case SID_OPENDLG_SOLVE:
505  {
506  sal_uInt16 nId = ScSolverDlgWrapper::GetChildWindowId();
507  SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame();
508  SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId );
509 
510  pScMod->SetRefDialog( nId, pWnd == nullptr );
511  }
512  break;
513 
514  case SID_OPENDLG_OPTSOLVER:
515  {
516  sal_uInt16 nId = ScOptSolverDlgWrapper::GetChildWindowId();
517  SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame();
518  SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId );
519 
520  pScMod->SetRefDialog( nId, pWnd == nullptr );
521  }
522  break;
523 
524  case SID_OPENDLG_TABOP:
525  {
526  sal_uInt16 nId = ScTabOpDlgWrapper::GetChildWindowId();
527  SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame();
528  SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId );
529 
530  pScMod->SetRefDialog( nId, pWnd == nullptr );
531  }
532  break;
533 
534  case SID_SCENARIOS:
535  {
536  ScDocument& rDoc = GetViewData().GetDocument();
537  ScMarkData& rMark = GetViewData().GetMarkData();
538  SCTAB nTab = GetViewData().GetTabNo();
539 
540  if ( rDoc.IsScenario(nTab) )
541  {
542  rMark.MarkToMulti();
543  if ( rMark.IsMultiMarked() )
544  {
545 
546  bool bExtend = rReq.IsAPI();
547  if (!bExtend)
548  {
549  std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pTabViewShell->GetFrameWeld(),
550  VclMessageType::Question, VclButtonsType::YesNo,
551  ScResId(STR_UPDATE_SCENARIO)));
552  xQueryBox->set_default_response(RET_YES);
553  bExtend = xQueryBox->run() == RET_YES;
554  }
555 
556  if (bExtend)
557  {
558  pTabViewShell->ExtendScenario();
559  rReq.Done();
560  }
561  }
562  else if( ! rReq.IsAPI() )
563  {
564  std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(pTabViewShell->GetFrameWeld(),
565  VclMessageType::Warning, VclButtonsType::Ok,
566  ScResId(STR_NOAREASELECTED)));
567  xErrorBox->run();
568  }
569  }
570  else
571  {
572  rMark.MarkToMulti();
573  if ( rMark.IsMultiMarked() )
574  {
575  SCTAB i=1;
576  OUString aBaseName;
577  OUString aName;
578  Color aColor;
579  ScScenarioFlags nFlags;
580 
581  OUString aTmp;
582  rDoc.GetName(nTab, aTmp);
583  aBaseName = aTmp + "_" + ScResId(STR_SCENARIO) + "_";
584 
585  // first test, if the prefix is recognised as valid,
586  // else avoid only doubles
587  bool bPrefix = ScDocument::ValidTabName( aBaseName );
588  OSL_ENSURE(bPrefix, "invalid sheet name");
589 
590  while ( rDoc.IsScenario(nTab+i) )
591  i++;
592 
593  bool bValid;
594  SCTAB nDummy;
595  do
596  {
597  aName = aBaseName + OUString::number( i );
598  if (bPrefix)
599  bValid = rDoc.ValidNewTabName( aName );
600  else
601  bValid = !rDoc.GetTable( aName, nDummy );
602  ++i;
603  }
604  while ( !bValid && i <= MAXTAB + 2 );
605 
606  if ( pReqArgs != nullptr )
607  {
608  OUString aArgName;
609  OUString aArgComment;
610  const SfxPoolItem* pItem;
611  if ( pReqArgs->GetItemState( SID_SCENARIOS, true, &pItem ) == SfxItemState::SET )
612  aArgName = static_cast<const SfxStringItem*>(pItem)->GetValue();
613  if ( pReqArgs->GetItemState( SID_NEW_TABLENAME, true, &pItem ) == SfxItemState::SET )
614  aArgComment = static_cast<const SfxStringItem*>(pItem)->GetValue();
615 
616  aColor = COL_LIGHTGRAY; // Default
617  nFlags = ScScenarioFlags::NONE; // not TwoWay
618 
619  pTabViewShell->MakeScenario( aArgName, aArgComment, aColor, nFlags );
620  if( ! rReq.IsAPI() )
621  rReq.Done();
622  }
623  else
624  {
625  bool bSheetProtected = rDoc.IsTabProtected(nTab);
627 
628  ScopedVclPtr<AbstractScNewScenarioDlg> pNewDlg(pFact->CreateScNewScenarioDlg(pTabViewShell->GetFrameWeld(), aName, false, bSheetProtected));
629  if ( pNewDlg->Execute() == RET_OK )
630  {
631  OUString aComment;
632  pNewDlg->GetScenarioData( aName, aComment, aColor, nFlags );
633  pTabViewShell->MakeScenario( aName, aComment, aColor, nFlags );
634 
635  rReq.AppendItem( SfxStringItem( SID_SCENARIOS, aName ) );
636  rReq.AppendItem( SfxStringItem( SID_NEW_TABLENAME, aComment ) );
637  rReq.Done();
638  }
639  }
640  }
641  else if( ! rReq.IsAPI() )
642  {
643  pTabViewShell->ErrorMessage(STR_ERR_NEWSCENARIO);
644  }
645  }
646  }
647  break;
648 
649  case SID_SELECTALL:
650  {
651  pTabViewShell->SelectAll();
652  rReq.Done();
653  }
654  break;
655 
656  case FID_ROW_HEIGHT:
657  {
658  const SfxPoolItem* pRow;
659  const SfxPoolItem* pHeight;
660  sal_uInt16 nHeight;
661 
662  if ( pReqArgs && pReqArgs->HasItem( FID_ROW_HEIGHT, &pHeight ) &&
663  pReqArgs->HasItem( FN_PARAM_1, &pRow ) )
664  {
665  std::vector<sc::ColRowSpan> aRanges;
666  SCCOLROW nRow = static_cast<const SfxInt32Item*>(pRow)->GetValue() - 1;
667  nHeight = static_cast<const SfxUInt16Item*>(pHeight)->GetValue();
668  ScMarkData& rMark = GetViewData().GetMarkData();
669 
670  if ( rMark.IsRowMarked( static_cast<SCROW>(nRow) ) )
671  {
672  aRanges = rMark.GetMarkedRowSpans();
673  }
674  else
675  {
676  aRanges.emplace_back(nRow, nRow);
677  }
678 
679  pTabViewShell->SetWidthOrHeight(false, aRanges, SC_SIZE_DIRECT, convertMm100ToTwip(nHeight));
680  }
681  else if ( pReqArgs && pReqArgs->HasItem( FID_ROW_HEIGHT, &pHeight ) )
682  {
683  nHeight = static_cast<const SfxUInt16Item*>(pHeight)->GetValue();
684 
685  // #101390#; the value of the macro is in HMM so use convertMm100ToTwip to convert
686  pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_DIRECT,
687  sal::static_int_cast<sal_uInt16>(convertMm100ToTwip(nHeight)));
688  if( ! rReq.IsAPI() )
689  rReq.Done();
690  }
691  else
692  {
694  FieldUnit eMetric = SC_MOD()->GetAppOptions().GetAppMetric();
695  sal_uInt16 nCurHeight = rData.GetDocument().
696  GetRowHeight( rData.GetCurY(),
697  rData.GetTabNo() );
699  ScopedVclPtr<AbstractScMetricInputDlg> pDlg(pFact->CreateScMetricInputDlg(
700  pTabViewShell->GetFrameWeld(), "RowHeightDialog",
701  nCurHeight, ScGlobal::nStdRowHeight,
702  eMetric, 2, MAX_ROW_HEIGHT));
703 
704  if ( pDlg->Execute() == RET_OK )
705  {
706  tools::Long nVal = pDlg->GetInputValue();
707  pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_DIRECT, static_cast<sal_uInt16>(nVal) );
708 
709  // #101390#; the value of the macro should be in HMM so use TwipsToEvenHMM to convert
710  rReq.AppendItem( SfxUInt16Item( FID_ROW_HEIGHT, static_cast<sal_uInt16>(TwipsToEvenHMM(nVal)) ) );
711  rReq.Done();
712 
713  }
714  }
715  }
716  break;
717 
718  case FID_ROW_OPT_HEIGHT:
719  {
720  if ( pReqArgs )
721  {
722  const SfxUInt16Item& rUInt16Item = static_cast<const SfxUInt16Item&>(pReqArgs->Get( FID_ROW_OPT_HEIGHT ));
723 
724  // #101390#; the value of the macro is in HMM so use convertMm100ToTwip to convert
725  pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_OPTIMAL,
726  sal::static_int_cast<sal_uInt16>( convertMm100ToTwip(rUInt16Item.GetValue()) ) );
727  ScGlobal::nLastRowHeightExtra = rUInt16Item.GetValue();
728 
729  if( ! rReq.IsAPI() )
730  rReq.Done();
731  }
732  else
733  {
734  FieldUnit eMetric = SC_MOD()->GetAppOptions().GetAppMetric();
735 
738  pTabViewShell->GetFrameWeld(), "OptimalRowHeightDialog",
740  if ( pDlg->Execute() == RET_OK )
741  {
742  tools::Long nVal = pDlg->GetInputValue();
743  pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_OPTIMAL, static_cast<sal_uInt16>(nVal) );
745 
746  // #101390#; the value of the macro should be in HMM so use TwipsToEvenHMM to convert
747  rReq.AppendItem( SfxUInt16Item( FID_ROW_OPT_HEIGHT, static_cast<sal_uInt16>(TwipsToEvenHMM(nVal)) ) );
748  rReq.Done();
749 
750  }
751  }
752  }
753  break;
754 
755  case FID_COL_WIDTH:
756  {
757  const SfxPoolItem* pColumn;
758  const SfxPoolItem* pWidth;
759  sal_uInt16 nWidth;
760 
761  if ( pReqArgs && pReqArgs->HasItem( FID_COL_WIDTH, &pWidth ) &&
762  pReqArgs->HasItem( FN_PARAM_1, &pColumn ) )
763  {
764  std::vector<sc::ColRowSpan> aRanges;
765  SCCOLROW nColumn = static_cast<const SfxUInt16Item*>(pColumn)->GetValue() - 1;
766  nWidth = static_cast<const SfxUInt16Item*>(pWidth)->GetValue();
767  ScMarkData& rMark = GetViewData().GetMarkData();
768 
769  if ( rMark.IsColumnMarked( static_cast<SCCOL>(nColumn) ) )
770  {
771  aRanges = rMark.GetMarkedColSpans();
772  }
773  else
774  {
775  aRanges.emplace_back(nColumn, nColumn);
776  }
777 
778  pTabViewShell->SetWidthOrHeight(true, aRanges, SC_SIZE_DIRECT, convertMm100ToTwip(nWidth));
779  }
780  else if ( pReqArgs && pReqArgs->HasItem( FID_COL_WIDTH, &pWidth ) )
781  {
782  nWidth = static_cast<const SfxUInt16Item*>(pWidth)->GetValue();
783 
784  // #101390#; the value of the macro is in HMM so use convertMm100ToTwip to convert
785  pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_DIRECT,
786  sal::static_int_cast<sal_uInt16>(convertMm100ToTwip(nWidth)));
787  if( ! rReq.IsAPI() )
788  rReq.Done();
789  }
790  else
791  {
792  FieldUnit eMetric = SC_MOD()->GetAppOptions().GetAppMetric();
794  sal_uInt16 nCurHeight = rData.GetDocument().
795  GetColWidth( rData.GetCurX(),
796  rData.GetTabNo() );
798  ScopedVclPtr<AbstractScMetricInputDlg> pDlg(pFact->CreateScMetricInputDlg(
799  pTabViewShell->GetFrameWeld(), "ColWidthDialog", nCurHeight,
800  STD_COL_WIDTH, eMetric, 2, MAX_COL_WIDTH));
801  if ( pDlg->Execute() == RET_OK )
802  {
803  tools::Long nVal = pDlg->GetInputValue();
804  pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_DIRECT, static_cast<sal_uInt16>(nVal) );
805 
806  // #101390#; the value of the macro should be in HMM so use TwipsToEvenHMM to convert
807  rReq.AppendItem( SfxUInt16Item( FID_COL_WIDTH, static_cast<sal_uInt16>(TwipsToEvenHMM(nVal))) );
808  rReq.Done();
809 
810  }
811  }
812  }
813  break;
814 
815  case FID_COL_OPT_WIDTH:
816  {
817  if ( pReqArgs )
818  {
819  const SfxUInt16Item& rUInt16Item = static_cast<const SfxUInt16Item&>(pReqArgs->Get( FID_COL_OPT_WIDTH ));
820 
821  // #101390#; the value of the macro is in HMM so use convertMm100ToTwip to convert
822  pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_OPTIMAL,
823  sal::static_int_cast<sal_uInt16>( convertMm100ToTwip(rUInt16Item.GetValue()) ) );
824  ScGlobal::nLastColWidthExtra = rUInt16Item.GetValue();
825 
826  if( ! rReq.IsAPI() )
827  rReq.Done();
828  }
829  else
830  {
831  FieldUnit eMetric = SC_MOD()->GetAppOptions().GetAppMetric();
832 
835  pTabViewShell->GetFrameWeld(), "OptimalColWidthDialog",
837  if ( pDlg->Execute() == RET_OK )
838  {
839  tools::Long nVal = pDlg->GetInputValue();
840  pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_OPTIMAL, static_cast<sal_uInt16>(nVal) );
842 
843  // #101390#; the value of the macro should be in HMM so use TwipsToEvenHMM to convert
844  rReq.AppendItem( SfxUInt16Item( FID_COL_OPT_WIDTH, static_cast<sal_uInt16>(TwipsToEvenHMM(nVal)) ) );
845  rReq.Done();
846  }
847  }
848  }
849  break;
850 
851  case FID_COL_OPT_DIRECT:
852  pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_OPTIMAL, STD_EXTRA_WIDTH );
853  rReq.Done();
854  break;
855 
856  case FID_ROW_HIDE:
857  pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_DIRECT, 0 );
858  rReq.Done();
859  break;
860  case FID_ROW_SHOW:
861  pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_SHOW, 0 );
862  rReq.Done();
863  break;
864  case FID_COL_HIDE:
865  pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_DIRECT, 0 );
866  rReq.Done();
867  break;
868  case FID_COL_SHOW:
869  pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_SHOW, 0 );
870  rReq.Done();
871  break;
872 
873  case SID_CELL_FORMAT_RESET:
874  {
876  rReq.Done();
877  }
878  break;
879 
880  case FID_MERGE_ON:
881  case FID_MERGE_OFF:
882  case FID_MERGE_TOGGLE:
883  {
884  if ( !GetViewData().GetDocument().GetChangeTrack() )
885  {
886  // test whether to merge or to split
887  bool bMerge = false;
888  bool bCenter = false;
889  switch( nSlot )
890  {
891  case FID_MERGE_ON:
892  bMerge = true;
893  break;
894  case FID_MERGE_OFF:
895  bMerge = false;
896  break;
897  case FID_MERGE_TOGGLE:
898  {
899  bCenter = true;
900  std::unique_ptr<SfxPoolItem> pItem;
901  if( rBindings.QueryState( nSlot, pItem ) >= SfxItemState::DEFAULT )
902  bMerge = !static_cast< SfxBoolItem* >( pItem.get() )->GetValue();
903  }
904  break;
905  }
906 
907  if( bMerge )
908  {
909  // merge - check if to move contents of covered cells
910  bool bMoveContents = false;
911  bool bApi = rReq.IsAPI();
912  const SfxPoolItem* pItem;
913  if ( pReqArgs &&
914  pReqArgs->GetItemState(nSlot, true, &pItem) == SfxItemState::SET )
915  {
916  OSL_ENSURE(dynamic_cast<const SfxBoolItem*>( pItem), "wrong item");
917  bMoveContents = static_cast<const SfxBoolItem*>(pItem)->GetValue();
918  }
919 
920  if (pTabViewShell->MergeCells( bApi, bMoveContents, bCenter ))
921  {
922  if (!bApi && bMoveContents) // "yes" clicked in dialog
923  rReq.AppendItem( SfxBoolItem( nSlot, bMoveContents ) );
924  rBindings.Invalidate( nSlot );
925  rReq.Done();
926  }
927  }
928  else
929  {
930  // split cells
931  if (pTabViewShell->RemoveMerge())
932  {
933  rBindings.Invalidate( nSlot );
934  rReq.Done();
935  }
936  }
937  break;
938  }
939  }
940  break;
941 
942  case SID_AUTOFORMAT:
943  {
944  weld::Window* pDlgParent = pTabViewShell->GetFrameWeld();
945  SCCOL nStartCol;
946  SCROW nStartRow;
947  SCTAB nStartTab;
948  SCCOL nEndCol;
949  SCROW nEndRow;
950  SCTAB nEndTab;
951 
952  const ScMarkData& rMark = GetViewData().GetMarkData();
953  if ( !rMark.IsMarked() && !rMark.IsMultiMarked() )
954  pTabViewShell->MarkDataArea();
955 
956  GetViewData().GetSimpleArea( nStartCol,nStartRow,nStartTab,
957  nEndCol,nEndRow,nEndTab );
958 
959  if ( ( std::abs(nEndCol-nStartCol) > 1 )
960  && ( std::abs(nEndRow-nStartRow) > 1 ) )
961  {
962  if ( pReqArgs )
963  {
964  const SfxStringItem& rNameItem = pReqArgs->Get( SID_AUTOFORMAT );
966  ScAutoFormat::const_iterator it = pFormat->find(rNameItem.GetValue());
967  ScAutoFormat::const_iterator itBeg = pFormat->begin();
968  size_t nIndex = std::distance(itBeg, it);
969 
970  pTabViewShell->AutoFormat( nIndex );
971 
972  if( ! rReq.IsAPI() )
973  rReq.Done();
974  }
975  else
976  {
978  std::unique_ptr<ScAutoFormatData> pNewEntry(pTabViewShell->CreateAutoFormatData());
980 
981  ScopedVclPtr<AbstractScAutoFormatDlg> pDlg(pFact->CreateScAutoFormatDlg(pDlgParent, ScGlobal::GetOrCreateAutoFormat(), pNewEntry.get(), GetViewData()));
982 
983  if ( pDlg->Execute() == RET_OK )
984  {
985  ScEditableTester aTester( pTabViewShell );
986  if ( !aTester.IsEditable() )
987  {
988  pTabViewShell->ErrorMessage(aTester.GetMessageId());
989  }
990  else
991  {
992  pTabViewShell->AutoFormat( pDlg->GetIndex() );
993 
994  rReq.AppendItem( SfxStringItem( SID_AUTOFORMAT, pDlg->GetCurrFormatName() ) );
995  rReq.Done();
996  }
997  }
998  }
999  }
1000  else
1001  {
1002  std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(pDlgParent,
1003  VclMessageType::Warning, VclButtonsType::Ok,
1004  ScResId(STR_INVALID_AFAREA)));
1005  xErrorBox->run();
1006  }
1007  }
1008  break;
1009 
1010  case SID_CANCEL:
1011  {
1012  if (GetViewData().HasEditView(GetViewData().GetActivePart()))
1013  pScMod->InputCancelHandler();
1014  else if (pTabViewShell->HasPaintBrush())
1015  pTabViewShell->ResetBrushDocument(); // abort format paint brush
1016  else if (pTabViewShell->HasHintWindow())
1017  pTabViewShell->RemoveHintWindow();
1018  else if( ScViewUtil::IsFullScreen( *pTabViewShell ) )
1019  ScViewUtil::SetFullScreen( *pTabViewShell, false );
1020  else
1021  {
1022  // TODO/LATER: when is this code executed?
1023  pTabViewShell->Escape();
1024  }
1025  }
1026  break;
1027 
1028  case SID_DATA_SELECT:
1029  pTabViewShell->StartDataSelect();
1030  break;
1031 
1032  case SID_DETECTIVE_FILLMODE:
1033  {
1034  bool bOldMode = pTabViewShell->IsAuditShell();
1035  pTabViewShell->SetAuditShell( !bOldMode );
1036  pTabViewShell->Invalidate( nSlot );
1037  }
1038  break;
1039 
1040  case FID_INPUTLINE_STATUS:
1041  OSL_FAIL("Execute from InputLine status");
1042  break;
1043 
1044  case SID_STATUS_DOCPOS:
1045  // Launch navigator.
1047  SID_NAVIGATOR, SfxCallMode::SYNCHRON|SfxCallMode::RECORD );
1048  break;
1049 
1050  case SID_MARKAREA:
1051  // called from Basic at the hidden view to select a range in the visible view
1052  OSL_FAIL("old slot SID_MARKAREA");
1053  break;
1054 
1055  default:
1056  OSL_FAIL("ScCellShell::Execute: unknown slot");
1057  break;
1058  }
1059 }
1060 
1061 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScMarkData & GetMarkData()
Definition: viewdata.cxx:3047
virtual sal_uInt32 getCount() const override
Definition: funcdesc.cxx:1139
SfxViewFrame * GetViewFrame() const
List of spreadsheet functions.
Definition: funcdesc.hxx:241
void DeleteContents(InsertDeleteFlags nFlags)
Definition: viewfunc.cxx:1936
void SelectAll(bool bContinue=false)
Definition: tabview2.cxx:1064
void MarkDataArea(bool bIncludeCursor=true)
Definition: tabview3.cxx:1654
FieldUnit
void ResetBrushDocument()
Definition: tabview5.cxx:646
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:1906
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
bool isLOKMobilePhone() const
SCROW Row() const
Definition: address.hxx:261
void MarkToMulti()
Definition: markdata.cxx:224
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:235
bool DataChanging(sal_Unicode cTyped=0, bool bFromCommand=false)
Definition: inputhdl.cxx:2590
long Long
SCROW GetCurY() const
Definition: viewdata.hxx:401
SC_DLLPUBLIC bool ValidNewTabName(const OUString &rName) const
Definition: document.cxx:373
std::vector< sc::ColRowSpan > GetMarkedRowSpans() const
Definition: markdata.cxx:479
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:850
sal_uInt16 GetLockedModifiers() const
Definition: tabview.cxx:1896
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:875
void SetAutoSpellData(SCCOL nPosX, SCROW nPosY, const std::vector< editeng::MisspellRanges > *pRanges)
Definition: tabview.cxx:2281
static bool IsFullScreen(const SfxViewShell &rViewShell)
Returns true, if the passed view shell is in full screen mode.
Definition: viewutil.cxx:333
constexpr::Color COL_LIGHTGRAY(0xC0, 0xC0, 0xC0)
SC_DLLPUBLIC formula::FormulaGrammar::Grammar GetGrammar() const
Definition: document.hxx:983
const SfxItemSet * GetArgs() const
void Invalidate(sal_uInt16 nId)
virtual short Execute()=0
void LockModifiers(sal_uInt16 nModifiers)
Definition: tabview.cxx:1890
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:1360
EditView * GetActiveView()
Definition: inputhdl.cxx:2236
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:345
void StartDataSelect()
Definition: tabview.cxx:2181
bool IsInEnterHandler() const
Definition: inputhdl.hxx:266
RET_YES
#define STD_COL_WIDTH
Definition: global.hxx:94
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:1468
static SfxViewShell * Current()
void libreOfficeKitViewCallback(int nType, const char *pPayload) const override
#define STD_EXTRA_WIDTH
Definition: global.hxx:95
SC_DLLPUBLIC bool GetTable(const OUString &rName, SCTAB &rTab) const
Definition: document.cxx:259
void AutoFormat(sal_uInt16 nFormatNo)
Definition: viewfun2.cxx:1881
bool RemoveMerge()
Definition: viewfun2.cxx:1306
void UpdateInputHandler(bool bForce=false, bool bStopEditing=true)
Definition: tabvwsha.cxx:653
SCTAB Tab() const
Definition: address.hxx:270
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
const_iterator begin() const
Definition: autoform.cxx:807
bool Execute(sal_uInt16 nSlot, const SfxPoolItem **pArgs=nullptr, SfxCallMode nCall=SfxCallMode::SLOT)
virtual OUString GetCurrFormatName()=0
bool HasHintWindow() const
Definition: tabview3.cxx:873
bool IsRowMarked(SCROW nRow) const
Definition: markdata.cxx:318
ScTabViewShell * GetViewShell() const
Definition: viewdata.hxx:356
static SC_DLLPUBLIC sal_uInt16 nStdRowHeight
Definition: global.hxx:583
const char * GetMessageId() const
Definition: editable.cxx:152
static void ClearAutoFormat()
Definition: global.cxx:234
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:302
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:502
const OUString & GetValue() const
::tools::Long nLastColWidthExtra
Definition: global.hxx:586
static ScFunctionMgr * GetStarCalcFunctionMgr()
Definition: global.cxx:618
OUString ScResId(const char *pId)
Definition: scdll.cxx:89
ScMarkType GetSimpleArea(SCCOL &rStartCol, SCROW &rStartRow, SCTAB &rStartTab, SCCOL &rEndCol, SCROW &rEndRow, SCTAB &rEndTab) const
Definition: viewdata.cxx:1171
constexpr auto convertMm100ToTwip(N n)
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:1171
bool IsEditable() const
Definition: editable.hxx:83
#define MAX_EXTRA_WIDTH
Definition: global.hxx:99
const SCTAB MAXTAB
Definition: address.hxx:70
#define MAX_EXTRA_HEIGHT
Definition: global.hxx:100
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:266
static ScFunctionList * GetStarCalcFunctionList()
Definition: global.cxx:609
#define MAX_COL_WIDTH
Definition: global.hxx:101
bool IsAuditShell() const
Definition: tabvwsh4.cxx:1011
virtual const IFunctionCategory * getCategory() const =0
iterator find(const OUString &rName)
Definition: autoform.cxx:786
bool HasPaintBrush() const
Definition: tabview.hxx:585
void EnterMatrix(const OUString &rString,::formula::FormulaGrammar::Grammar eGram)
Definition: viewfunc.cxx:759
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:1139
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:102
void ErrorMessage(const char *pGlobStrId)
Definition: tabview2.cxx:1413
static SC_DLLPUBLIC bool ValidTabName(const OUString &rName)
Definition: document.cxx:334
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:3041
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:2602
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:2026
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:1370
void HideListBox()
Definition: tabview3.cxx:2962
inline::tools::Long TwipsToEvenHMM(::tools::Long nTwips)
Definition: global.hxx:109
const OUString & GetString() const
Definition: uiitems.hxx:68
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:2350
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)
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:252
static SC_DLLPUBLIC::tools::Long nLastRowHeightExtra
Definition: global.hxx:585
ScAutoFormatData * CreateAutoFormatData()
Definition: viewfun2.cxx:1860
void ExtendScenario()
Definition: viewfun2.cxx:2297
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:40
aStr
SC_DLLPUBLIC bool GetName(SCTAB nTab, OUString &rName) const
Definition: document.cxx:212
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:342
SCCOL GetCurX() const
Definition: viewdata.hxx:400
void MakeScenario(const OUString &rName, const OUString &rComment, const Color &rColor, ScScenarioFlags nFlags)
Definition: viewfun2.cxx:2276