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
55
56namespace
57{
59OString 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
67void 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.
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, nullptr,
293 true /*bMatrixExpand*/);
294 }
295 else if (pHdl)
296 {
297 SC_MOD()->SetInputMode(SC_INPUT_TABLE);
298
299 EditView* pTableView = pHdl->GetActiveView();
300 pHdl->DataChanging();
301 if (pTableView)
302 pTableView->GetEditEngine()->SetText(aStr);
303 pHdl->DataChanged();
304
305 SC_MOD()->SetInputMode(SC_INPUT_NONE);
306 }
307
308 if ( !pHdl || !pHdl->IsInEnterHandler() )
309 {
310 // UpdateInputHandler is needed after the cell content
311 // has changed, but if called from EnterHandler, UpdateInputHandler
312 // will be called later when moving the cursor.
313 pTabViewShell->UpdateInputHandler();
314 }
315
316 rReq.Done();
317
318 // no GrabFocus here, as otherwise on a Mac the tab jumps before the
319 // sideview, when the input was not finished
320 // (GrabFocus is called in KillEditView)
321 }
322 }
323 break;
324
325 case SID_INSERT_MATRIX:
326 {
327 if ( pReqArgs )
328 {
329 OUString aStr = static_cast<const SfxStringItem&>(pReqArgs->
330 Get( SID_INSERT_MATRIX )).GetValue();
332 pTabViewShell->EnterMatrix( aStr, rDoc.GetGrammar() );
333 rReq.Done();
334 }
335 }
336 break;
337
338 case FID_INPUTLINE_ENTER:
339 case FID_INPUTLINE_BLOCK:
340 case FID_INPUTLINE_MATRIX:
341 {
342 if( pReqArgs == nullptr ) //XXX temporary HACK to avoid GPF
343 break;
344
345 const ScInputStatusItem* pStatusItem
346 = static_cast<const ScInputStatusItem*>(&pReqArgs->
347 Get( FID_INPUTLINE_STATUS ));
348
349 const ScAddress& aCursorPos = pStatusItem->GetPos();
350 const OUString& aString = pStatusItem->GetString();
351 const EditTextObject* pData = pStatusItem->GetEditData();
352
353 if (pData)
354 {
355 if (nSlot == FID_INPUTLINE_BLOCK)
356 {
357 pTabViewShell->EnterBlock( aString, pData );
358 }
359 else if ( !aString.isEmpty() && ( aString[0] == '=' || aString[0] == '+' || aString[0] == '-' ) )
360 {
361 pTabViewShell->EnterData( aCursorPos.Col(), aCursorPos.Row(), aCursorPos.Tab(),
362 aString, pData, true /*bMatrixExpand*/);
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, nullptr,
392 true /*bMatrixExpand*/);
393 rReq.Done();
394 }
395 }
396 else if (nSlot == FID_INPUTLINE_BLOCK)
397 {
398 pTabViewShell->EnterBlock( aString, nullptr );
399 rReq.Done();
400 }
401 else
402 {
404 pTabViewShell->EnterMatrix( aString, rDoc.GetGrammar() );
405 rReq.Done();
406 }
407 }
408
409 pTabViewShell->SetAutoSpellData(
410 aCursorPos.Col(), aCursorPos.Row(), pStatusItem->GetMisspellRanges());
411
412 // no GrabFocus here, as otherwise on a Mac the tab jumps before the
413 // sideview, when the input was not finished
414 // (GrabFocus is called in KillEditView)
415 }
416 break;
417
418 case SID_OPENDLG_FUNCTION:
419 {
420 const SfxViewShell* pViewShell = SfxViewShell::Current();
422 && pViewShell && pViewShell->isLOKMobilePhone())
423 {
424 // not set the dialog id in the mobile case or we would
425 // not be able to get cell address pasted in the edit view
426 // by just tapping on them
427 lcl_lokGetWholeFunctionList();
428 }
429 else
430 {
431 sal_uInt16 nId = SID_OPENDLG_FUNCTION;
432 SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame();
433 SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId );
434 bool bVis = comphelper::LibreOfficeKit::isActive() || pWnd == nullptr;
435 pScMod->SetRefDialog( nId, bVis );
436 }
437 rReq.Ignore();
438 }
439 break;
440
441 case SID_OPENDLG_CONSOLIDATE:
442 {
443 sal_uInt16 nId = ScConsolidateDlgWrapper::GetChildWindowId();
444 SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame();
445 SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId );
446
447 pScMod->SetRefDialog( nId, pWnd == nullptr );
448 }
449 break;
450
451 case FID_CELL_FORMAT:
452 {
453 if ( pReqArgs != nullptr )
454 {
455
456 // set cell attribute without dialog:
457
459
461
462 const SfxPoolItem* pAttr = nullptr;
463 sal_uInt16 nWhich = 0;
464
465 for ( nWhich=ATTR_PATTERN_START; nWhich<=ATTR_PATTERN_END; nWhich++ )
466 if ( pReqArgs->GetItemState( nWhich, true, &pAttr ) == SfxItemState::SET )
467 aNewSet.Put( *pAttr );
468
469 pTabViewShell->ApplyAttributes( &aNewSet, &aEmptySet );
470
471 rReq.Done();
472 }
473 else
474 {
475 pTabViewShell->ExecuteCellFormatDlg( rReq, "" );
476 }
477 }
478 break;
479
480 case SID_ENABLE_HYPHENATION:
481 pTabViewShell->ExecuteCellFormatDlg(rReq, "alignment");
482 break;
483
484 case SID_PROPERTY_PANEL_CELLTEXT_DLG:
485 pTabViewShell->ExecuteCellFormatDlg( rReq, "font" );
486 break;
487
488 case SID_CELL_FORMAT_BORDER:
489 pTabViewShell->ExecuteCellFormatDlg( rReq, "borders" );
490 break;
491
492 case SID_CHAR_DLG_EFFECT:
493 pTabViewShell->ExecuteCellFormatDlg( rReq, "fonteffects" );
494 break;
495
496 case SID_OPENDLG_SOLVE:
497 {
498 sal_uInt16 nId = ScSolverDlgWrapper::GetChildWindowId();
499 SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame();
500 SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId );
501
502 pScMod->SetRefDialog( nId, pWnd == nullptr );
503 }
504 break;
505
506 case SID_OPENDLG_OPTSOLVER:
507 {
508 sal_uInt16 nId = ScOptSolverDlgWrapper::GetChildWindowId();
509 SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame();
510 SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId );
511
512 pScMod->SetRefDialog( nId, pWnd == nullptr );
513 }
514 break;
515
516 case SID_OPENDLG_TABOP:
517 {
518 sal_uInt16 nId = ScTabOpDlgWrapper::GetChildWindowId();
519 SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame();
520 SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId );
521
522 pScMod->SetRefDialog( nId, pWnd == nullptr );
523 }
524 break;
525
526 case SID_SCENARIOS:
527 {
530 SCTAB nTab = GetViewData().GetTabNo();
531
532 if ( rDoc.IsScenario(nTab) )
533 {
534 rMark.MarkToMulti();
535 if ( rMark.IsMultiMarked() )
536 {
537
538 bool bExtend = rReq.IsAPI();
539 if (!bExtend)
540 {
541 std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pTabViewShell->GetFrameWeld(),
542 VclMessageType::Question, VclButtonsType::YesNo,
543 ScResId(STR_UPDATE_SCENARIO)));
544 xQueryBox->set_default_response(RET_YES);
545 bExtend = xQueryBox->run() == RET_YES;
546 }
547
548 if (bExtend)
549 {
550 pTabViewShell->ExtendScenario();
551 rReq.Done();
552 }
553 }
554 else if( ! rReq.IsAPI() )
555 {
556 std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(pTabViewShell->GetFrameWeld(),
557 VclMessageType::Warning, VclButtonsType::Ok,
558 ScResId(STR_NOAREASELECTED)));
559 xErrorBox->run();
560 }
561 }
562 else
563 {
564 rMark.MarkToMulti();
565 if ( rMark.IsMultiMarked() )
566 {
567 SCTAB i=1;
568 OUString aBaseName;
569 OUString aName;
570 Color aColor;
571 ScScenarioFlags nFlags;
572
573 OUString aTmp;
574 rDoc.GetName(nTab, aTmp);
575 aBaseName = aTmp + "_" + ScResId(STR_SCENARIO) + "_";
576
577 // first test, if the prefix is recognised as valid,
578 // else avoid only doubles
579 bool bPrefix = ScDocument::ValidTabName( aBaseName );
580 OSL_ENSURE(bPrefix, "invalid sheet name");
581
582 while ( rDoc.IsScenario(nTab+i) )
583 i++;
584
585 bool bValid;
586 SCTAB nDummy;
587 do
588 {
589 aName = aBaseName + OUString::number( i );
590 if (bPrefix)
591 bValid = rDoc.ValidNewTabName( aName );
592 else
593 bValid = !rDoc.GetTable( aName, nDummy );
594 ++i;
595 }
596 while ( !bValid && i <= MAXTAB + 2 );
597
598 if ( pReqArgs != nullptr )
599 {
600 OUString aArgName;
601 OUString aArgComment;
602 if ( const SfxStringItem* pItem = pReqArgs->GetItemIfSet( SID_SCENARIOS ) )
603 aArgName = pItem->GetValue();
604 if ( const SfxStringItem* pItem = pReqArgs->GetItemIfSet( SID_NEW_TABLENAME ) )
605 aArgComment = pItem->GetValue();
606
607 aColor = COL_LIGHTGRAY; // Default
608 nFlags = ScScenarioFlags::NONE; // not TwoWay
609
610 pTabViewShell->MakeScenario( aArgName, aArgComment, aColor, nFlags );
611 if( ! rReq.IsAPI() )
612 rReq.Done();
613 }
614 else
615 {
616 bool bSheetProtected = rDoc.IsTabProtected(nTab);
618
619 ScopedVclPtr<AbstractScNewScenarioDlg> pNewDlg(pFact->CreateScNewScenarioDlg(pTabViewShell->GetFrameWeld(), aName, false, bSheetProtected));
620 if ( pNewDlg->Execute() == RET_OK )
621 {
622 OUString aComment;
623 pNewDlg->GetScenarioData( aName, aComment, aColor, nFlags );
624 pTabViewShell->MakeScenario( aName, aComment, aColor, nFlags );
625
626 rReq.AppendItem( SfxStringItem( SID_SCENARIOS, aName ) );
627 rReq.AppendItem( SfxStringItem( SID_NEW_TABLENAME, aComment ) );
628 rReq.Done();
629 }
630 }
631 }
632 else if( ! rReq.IsAPI() )
633 {
634 pTabViewShell->ErrorMessage(STR_ERR_NEWSCENARIO);
635 }
636 }
637 }
638 break;
639
640 case SID_SELECTALL:
641 {
642 pTabViewShell->SelectAll();
643 rReq.Done();
644 }
645 break;
646
647 case FID_ROW_HEIGHT:
648 {
649 const SfxPoolItem* pRow;
650 const SfxUInt16Item* pHeight;
651 sal_uInt16 nHeight;
652
653 if ( pReqArgs && (pHeight = pReqArgs->GetItemIfSet( FID_ROW_HEIGHT )) &&
654 pReqArgs->HasItem( FN_PARAM_1, &pRow ) )
655 {
656 std::vector<sc::ColRowSpan> aRanges;
657 SCCOLROW nRow = static_cast<const SfxInt32Item*>(pRow)->GetValue() - 1;
658 nHeight = pHeight->GetValue();
660
661 if ( rMark.IsRowMarked( static_cast<SCROW>(nRow) ) )
662 {
663 aRanges = rMark.GetMarkedRowSpans();
664 }
665 else
666 {
667 aRanges.emplace_back(nRow, nRow);
668 }
669
670 pTabViewShell->SetWidthOrHeight(false, aRanges, SC_SIZE_DIRECT, o3tl::toTwips(nHeight, o3tl::Length::mm100));
671 }
672 else if ( pReqArgs && (pHeight = pReqArgs->GetItemIfSet( FID_ROW_HEIGHT )) )
673 {
674 nHeight = pHeight->GetValue();
675
676 // #101390#; the value of the macro is in HMM so use convertMm100ToTwip to convert
677 pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_DIRECT,
679 if( ! rReq.IsAPI() )
680 rReq.Done();
681 }
682 else
683 {
684 ScViewData& rData = GetViewData();
685 FieldUnit eMetric = SC_MOD()->GetAppOptions().GetAppMetric();
686 sal_uInt16 nCurHeight = rData.GetDocument().
687 GetRowHeight( rData.GetCurY(),
688 rData.GetTabNo() );
691 pTabViewShell->GetFrameWeld(), "RowHeightDialog",
692 nCurHeight, ScGlobal::nStdRowHeight,
693 eMetric, 2, MAX_ROW_HEIGHT));
694
695 pDlg->StartExecuteAsync([pDlg, pTabViewShell](sal_Int32 nResult){
696 if (nResult == RET_OK)
697 {
698 SfxRequest pRequest(pTabViewShell->GetViewFrame(), FID_ROW_HEIGHT);
699 tools::Long nVal = pDlg->GetInputValue();
700 pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_DIRECT, static_cast<sal_uInt16>(nVal) );
701
702 // #101390#; the value of the macro should be in HMM so use TwipsToEvenHMM to convert
703 pRequest.AppendItem( SfxUInt16Item( FID_ROW_HEIGHT, static_cast<sal_uInt16>(TwipsToEvenHMM(nVal)) ) );
704 pRequest.Done();
705 }
706 pDlg->disposeOnce();
707 });
708 }
709 }
710 break;
711
712 case FID_ROW_OPT_HEIGHT:
713 {
714 if ( pReqArgs )
715 {
716 const SfxUInt16Item& rUInt16Item = static_cast<const SfxUInt16Item&>(pReqArgs->Get( FID_ROW_OPT_HEIGHT ));
717
718 // #101390#; the value of the macro is in HMM so use convertMm100ToTwip to convert
719 pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_OPTIMAL,
722
723 if( ! rReq.IsAPI() )
724 rReq.Done();
725 }
726 else
727 {
728 FieldUnit eMetric = SC_MOD()->GetAppOptions().GetAppMetric();
729
732 pTabViewShell->GetFrameWeld(), "OptimalRowHeightDialog",
734
735 pDlg->StartExecuteAsync([pDlg, pTabViewShell](sal_Int32 nResult){
736 if ( nResult == RET_OK )
737 {
738 SfxRequest pRequest(pTabViewShell->GetViewFrame(), FID_ROW_OPT_HEIGHT);
739 tools::Long nVal = pDlg->GetInputValue();
740 pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_OPTIMAL, static_cast<sal_uInt16>(nVal) );
742
743 // #101390#; the value of the macro should be in HMM so use TwipsToEvenHMM to convert
744 pRequest.AppendItem( SfxUInt16Item( FID_ROW_OPT_HEIGHT, static_cast<sal_uInt16>(TwipsToEvenHMM(nVal)) ) );
745 pRequest.Done();
746 }
747 pDlg->disposeOnce();
748 });
749 }
750 }
751 break;
752
753 case FID_COL_WIDTH:
754 {
755 const SfxPoolItem* pColumn;
756 const SfxUInt16Item* pWidth;
757 sal_uInt16 nWidth;
758
759 if ( pReqArgs && (pWidth = pReqArgs->GetItemIfSet( FID_COL_WIDTH )) &&
760 pReqArgs->HasItem( FN_PARAM_1, &pColumn ) )
761 {
762 std::vector<sc::ColRowSpan> aRanges;
763 SCCOLROW nColumn = static_cast<const SfxUInt16Item*>(pColumn)->GetValue() - 1;
764 nWidth = pWidth->GetValue();
766
767 if ( rMark.IsColumnMarked( static_cast<SCCOL>(nColumn) ) )
768 {
769 aRanges = rMark.GetMarkedColSpans();
770 }
771 else
772 {
773 aRanges.emplace_back(nColumn, nColumn);
774 }
775
776 pTabViewShell->SetWidthOrHeight(true, aRanges, SC_SIZE_DIRECT, o3tl::toTwips(nWidth, o3tl::Length::mm100));
777 }
778 else if ( pReqArgs && (pWidth = pReqArgs->GetItemIfSet( FID_COL_WIDTH )) )
779 {
780 nWidth = pWidth->GetValue();
781
782 // #101390#; the value of the macro is in HMM so use convertMm100ToTwip to convert
783 pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_DIRECT,
785 if( ! rReq.IsAPI() )
786 rReq.Done();
787 }
788 else
789 {
790 FieldUnit eMetric = SC_MOD()->GetAppOptions().GetAppMetric();
791 ScViewData& rData = GetViewData();
792 sal_uInt16 nCurHeight = rData.GetDocument().
793 GetColWidth( rData.GetCurX(),
794 rData.GetTabNo() );
797 pTabViewShell->GetFrameWeld(), "ColWidthDialog", nCurHeight,
798 STD_COL_WIDTH, eMetric, 2, MAX_COL_WIDTH));
799
800 pDlg->StartExecuteAsync([pDlg, pTabViewShell](sal_Int32 nResult){
801 if ( nResult == RET_OK )
802 {
803 SfxRequest pRequest(pTabViewShell->GetViewFrame(), FID_COL_WIDTH);
804 tools::Long nVal = pDlg->GetInputValue();
805 pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_DIRECT, static_cast<sal_uInt16>(nVal) );
806
807 // #101390#; the value of the macro should be in HMM so use TwipsToEvenHMM to convert
808 pRequest.AppendItem( SfxUInt16Item( FID_COL_WIDTH, static_cast<sal_uInt16>(TwipsToEvenHMM(nVal))) );
809 pRequest.Done();
810 }
811 pDlg->disposeOnce();
812 });
813 }
814 }
815 break;
816
817 case FID_COL_OPT_WIDTH:
818 {
819 if ( pReqArgs )
820 {
821 const SfxUInt16Item& rUInt16Item = static_cast<const SfxUInt16Item&>(pReqArgs->Get( FID_COL_OPT_WIDTH ));
822
823 // #101390#; the value of the macro is in HMM so use convertMm100ToTwip to convert
824 pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_OPTIMAL,
827
828 if( ! rReq.IsAPI() )
829 rReq.Done();
830 }
831 else
832 {
833 FieldUnit eMetric = SC_MOD()->GetAppOptions().GetAppMetric();
834
837 pTabViewShell->GetFrameWeld(), "OptimalColWidthDialog",
839
840 pDlg->StartExecuteAsync([pDlg, pTabViewShell](sal_Int32 nResult){
841 SfxRequest pRequest(pTabViewShell->GetViewFrame(), FID_COL_OPT_WIDTH);
842 if ( nResult == RET_OK )
843 {
844 tools::Long nVal = pDlg->GetInputValue();
845 pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_OPTIMAL, static_cast<sal_uInt16>(nVal) );
847
848 // #101390#; the value of the macro should be in HMM so use TwipsToEvenHMM to convert
849 pRequest.AppendItem( SfxUInt16Item( FID_COL_OPT_WIDTH, static_cast<sal_uInt16>(TwipsToEvenHMM(nVal)) ) );
850 pRequest.Done();
851 }
852 pDlg->disposeOnce();
853 });
854 }
855 }
856 break;
857
858 case FID_COL_OPT_DIRECT:
860 rReq.Done();
861 break;
862
863 case FID_ROW_HIDE:
864 pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_DIRECT, 0 );
865 rReq.Done();
866 break;
867 case FID_ROW_SHOW:
868 pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_SHOW, 0 );
869 rReq.Done();
870 break;
871 case FID_COL_HIDE:
872 pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_DIRECT, 0 );
873 rReq.Done();
874 break;
875 case FID_COL_SHOW:
876 pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_SHOW, 0 );
877 rReq.Done();
878 break;
879
880 case SID_CELL_FORMAT_RESET:
881 {
883 rReq.Done();
884 }
885 break;
886
887 case FID_MERGE_ON:
888 case FID_MERGE_OFF:
889 case FID_MERGE_TOGGLE:
890 {
892 {
893 // test whether to merge or to split
894 bool bMerge = false;
895 bool bCenter = false;
896 switch( nSlot )
897 {
898 case FID_MERGE_ON:
899 bMerge = true;
900 break;
901 case FID_MERGE_OFF:
902 bMerge = false;
903 break;
904 case FID_MERGE_TOGGLE:
905 {
906 bCenter = true;
907 std::unique_ptr<SfxPoolItem> pItem;
908 if( rBindings.QueryState( nSlot, pItem ) >= SfxItemState::DEFAULT )
909 bMerge = !static_cast< SfxBoolItem* >( pItem.get() )->GetValue();
910 }
911 break;
912 }
913
914 if( bMerge )
915 {
916 // merge - check if to move contents of covered cells
917 bool bMoveContents = false;
918 bool bApi = rReq.IsAPI();
919 const SfxPoolItem* pItem;
920 if ( pReqArgs &&
921 pReqArgs->GetItemState(nSlot, true, &pItem) == SfxItemState::SET )
922 {
923 assert(dynamic_cast<const SfxBoolItem*>( pItem) && "wrong item");
924 bMoveContents = static_cast<const SfxBoolItem*>(pItem)->GetValue();
925 }
926
927 if (pTabViewShell->MergeCells( bApi, bMoveContents, bCenter ))
928 {
929 if (!bApi && bMoveContents) // "yes" clicked in dialog
930 rReq.AppendItem( SfxBoolItem( nSlot, bMoveContents ) );
931 rBindings.Invalidate( nSlot );
932 rReq.Done();
933 }
934 }
935 else
936 {
937 // split cells
938 if (pTabViewShell->RemoveMerge())
939 {
940 rBindings.Invalidate( nSlot );
941 rReq.Done();
942 }
943 }
944 break;
945 }
946 }
947 break;
948
949 case SID_AUTOFORMAT:
950 {
951 weld::Window* pDlgParent = pTabViewShell->GetFrameWeld();
952 SCCOL nStartCol;
953 SCROW nStartRow;
954 SCTAB nStartTab;
955 SCCOL nEndCol;
956 SCROW nEndRow;
957 SCTAB nEndTab;
958
959 const ScMarkData& rMark = GetViewData().GetMarkData();
960 if ( !rMark.IsMarked() && !rMark.IsMultiMarked() )
961 pTabViewShell->MarkDataArea();
962
963 GetViewData().GetSimpleArea( nStartCol,nStartRow,nStartTab,
964 nEndCol,nEndRow,nEndTab );
965
966 if ( ( std::abs(nEndCol-nStartCol) > 1 )
967 && ( std::abs(nEndRow-nStartRow) > 1 ) )
968 {
969 if ( pReqArgs )
970 {
971 const SfxStringItem& rNameItem = pReqArgs->Get( SID_AUTOFORMAT );
973 ScAutoFormat::const_iterator it = pFormat->find(rNameItem.GetValue());
974 ScAutoFormat::const_iterator itBeg = pFormat->begin();
975 size_t nIndex = std::distance(itBeg, it);
976
977 pTabViewShell->AutoFormat( nIndex );
978
979 if( ! rReq.IsAPI() )
980 rReq.Done();
981 }
982 else
983 {
985 std::unique_ptr<ScAutoFormatData> pNewEntry(pTabViewShell->CreateAutoFormatData());
987
989
990 if ( pDlg->Execute() == RET_OK )
991 {
992 ScEditableTester aTester( pTabViewShell );
993 if ( !aTester.IsEditable() )
994 {
995 pTabViewShell->ErrorMessage(aTester.GetMessageId());
996 }
997 else
998 {
999 pTabViewShell->AutoFormat( pDlg->GetIndex() );
1000
1001 rReq.AppendItem( SfxStringItem( SID_AUTOFORMAT, pDlg->GetCurrFormatName() ) );
1002 rReq.Done();
1003 }
1004 }
1005 }
1006 }
1007 else
1008 {
1009 std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(pDlgParent,
1010 VclMessageType::Warning, VclButtonsType::Ok,
1011 ScResId(STR_INVALID_AFAREA)));
1012 xErrorBox->run();
1013 }
1014 }
1015 break;
1016
1017 case SID_CANCEL:
1018 {
1019 if (GetViewData().HasEditView(GetViewData().GetActivePart()))
1020 pScMod->InputCancelHandler();
1021 else if (pTabViewShell->HasPaintBrush())
1022 pTabViewShell->ResetBrushDocument(); // abort format paint brush
1023 else if (pTabViewShell->HasHintWindow())
1024 pTabViewShell->RemoveHintWindow();
1025 else if( ScViewUtil::IsFullScreen( *pTabViewShell ) )
1026 ScViewUtil::SetFullScreen( *pTabViewShell, false );
1027 else
1028 {
1029 // TODO/LATER: when is this code executed?
1030 pTabViewShell->Escape();
1031 }
1032 }
1033 break;
1034
1035 case SID_ACCEPT_FORMULA:
1036 {
1037 if (GetViewData().HasEditView(GetViewData().GetActivePart()))
1038 pScMod->InputEnterHandler();
1039 }
1040 break;
1041
1042 case SID_START_FORMULA:
1043 {
1044 ScInputHandler* pInputHandler = pScMod->GetInputHdl();
1045 if (pInputHandler && pInputHandler->GetInputWindow())
1046 pInputHandler->GetInputWindow()->StartFormula();
1047 }
1048 break;
1049
1050 case SID_DATA_SELECT:
1051 pTabViewShell->StartDataSelect();
1052 break;
1053
1054 case SID_DETECTIVE_FILLMODE:
1055 {
1056 bool bOldMode = pTabViewShell->IsAuditShell();
1057 pTabViewShell->SetAuditShell( !bOldMode );
1058 pTabViewShell->Invalidate( nSlot );
1059 }
1060 break;
1061
1062 case FID_INPUTLINE_STATUS:
1063 OSL_FAIL("Execute from InputLine status");
1064 break;
1065
1066 case SID_STATUS_DOCPOS:
1067 // Launch navigator.
1069 SID_NAVIGATOR, SfxCallMode::SYNCHRON|SfxCallMode::RECORD );
1070 break;
1071
1072 case SID_MARKAREA:
1073 // called from Basic at the hidden view to select a range in the visible view
1074 OSL_FAIL("old slot SID_MARKAREA");
1075 break;
1076
1077 default:
1078 OSL_FAIL("ScCellShell::Execute: unknown slot");
1079 break;
1080 }
1081}
1082
1083/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const SCTAB MAXTAB
Definition: address.hxx:70
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, bool bMobile=false)
sal_uInt16 GetValue() const
const OUString & GetValue() const
void SetText(const OUString &rStr)
EditEngine * GetEditEngine() const
virtual VclPtr< AbstractScAutoFormatDlg > CreateScAutoFormatDlg(weld::Window *pParent, ScAutoFormat *pAutoFormat, const ScAutoFormatData *pSelFormatData, ScViewData &rViewData)=0
virtual VclPtr< AbstractScNewScenarioDlg > CreateScNewScenarioDlg(weld::Window *pParent, const OUString &rName, bool bEdit, bool bSheetProtected)=0
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
static SC_DLLPUBLIC ScAbstractDialogFactory * Create()
Definition: scabstdlg.cxx:37
SCTAB Tab() const
Definition: address.hxx:283
SCROW Row() const
Definition: address.hxx:274
SCCOL Col() const
Definition: address.hxx:279
MapType::const_iterator const_iterator
Definition: autoform.hxx:190
const_iterator begin() const
Definition: autoform.cxx:803
iterator find(const OUString &rName)
Definition: autoform.cxx:782
void Execute(SfxRequest &)
Definition: cellsh3.cxx:153
virtual void SetModified(bool=true) override
Definition: docsh.cxx:2950
SC_DLLPUBLIC bool IsScenario(SCTAB nTab) const
Definition: documen3.cxx:438
SC_DLLPUBLIC bool GetTable(const OUString &rName, SCTAB &rTab) const
Definition: document.cxx:264
SC_DLLPUBLIC bool IsTabProtected(SCTAB nTab) const
Definition: documen3.cxx:1919
SC_DLLPUBLIC bool ValidNewTabName(const OUString &rName) const
Definition: document.cxx:377
static SC_DLLPUBLIC bool ValidTabName(const OUString &rName)
Definition: document.cxx:338
SC_DLLPUBLIC formula::FormulaGrammar::Grammar GetGrammar() const
Definition: document.hxx:1008
ScChangeTrack * GetChangeTrack() const
Definition: document.hxx:2487
SC_DLLPUBLIC bool GetName(SCTAB nTab, OUString &rName) const
Definition: document.cxx:217
bool IsEditable() const
Definition: editable.hxx:84
TranslateId GetMessageId() const
Definition: editable.cxx:152
ScViewData & GetViewData()
Definition: formatsh.hxx:34
Stores and generates human readable descriptions for spreadsheet-functions, e.g. functions used in fo...
Definition: funcdesc.hxx:41
std::optional< OUString > mxFuncName
Function name.
Definition: funcdesc.hxx:216
List of spreadsheet functions.
Definition: funcdesc.hxx:242
const ScFuncDesc * GetFunction(sal_uInt32 nIndex) const
Definition: funcdesc.cxx:1010
sal_uInt32 GetCount() const
Definition: funcdesc.hxx:247
Stores spreadsheet functions in categories, including a cumulative ('All') category and makes them ac...
Definition: funcdesc.hxx:309
virtual sal_uInt32 getCount() const override
Definition: funcdesc.cxx:1132
static OUString GetCategoryName(sal_uInt32 _nCategoryNumber)
Returns name of category.
Definition: funcdesc.cxx:1164
static SC_DLLPUBLIC sal_uInt16 nStdRowHeight
Definition: global.hxx:595
::tools::Long nLastColWidthExtra
Definition: global.hxx:598
static SC_DLLPUBLIC ScAutoFormat * GetOrCreateAutoFormat()
Definition: global.cxx:266
static ScFunctionList * GetStarCalcFunctionList()
Definition: global.cxx:624
static ScFunctionMgr * GetStarCalcFunctionMgr()
Definition: global.cxx:633
static SC_DLLPUBLIC ::tools::Long nLastRowHeightExtra
Definition: global.hxx:597
static void ClearAutoFormat()
Definition: global.cxx:248
ScInputWindow * GetInputWindow()
Definition: inputhdl.hxx:264
void DataChanged(bool bFromTopNotify=false, bool bSetModified=true)
Definition: inputhdl.cxx:2688
EditView * GetActiveView()
Definition: inputhdl.cxx:2321
bool IsInEnterHandler() const
Definition: inputhdl.hxx:268
bool DataChanging(sal_Unicode cTyped=0, bool bFromCommand=false)
Definition: inputhdl.cxx:2676
const EditTextObject * GetEditData() const
Definition: uiitems.hxx:69
const ScAddress & GetPos() const
Definition: uiitems.hxx:66
const std::vector< editeng::MisspellRanges > * GetMisspellRanges() const
Definition: uiitems.hxx:72
const OUString & GetString() const
Definition: uiitems.hxx:68
void StartFormula()
Definition: inputwin.cxx:371
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
Definition: markdata.hxx:43
bool IsMultiMarked() const
Definition: markdata.hxx:81
bool IsColumnMarked(SCCOL nCol) const
Definition: markdata.cxx:287
bool IsRowMarked(SCROW nRow) const
Definition: markdata.cxx:303
std::vector< sc::ColRowSpan > GetMarkedColSpans() const
Definition: markdata.cxx:481
void MarkToMulti()
Definition: markdata.cxx:209
bool IsMarked() const
Definition: markdata.hxx:80
std::vector< sc::ColRowSpan > GetMarkedRowSpans() const
Definition: markdata.cxx:464
ScInputHandler * GetInputHdl(ScTabViewShell *pViewSh=nullptr, bool bUseRef=true)
Input-Handler.
Definition: scmod.cxx:1352
SC_DLLPUBLIC void SetRefDialog(sal_uInt16 nId, bool bVis, SfxViewFrame *pViewFrm=nullptr)
Reference dialogs.
Definition: scmod.cxx:1516
SC_DLLPUBLIC void InputEnterHandler(ScEnterMode nBlockMode=ScEnterMode::NORMAL, bool bBeforeSavingInLOK=false)
Definition: scmod.cxx:1408
void InputCancelHandler()
Definition: scmod.cxx:1418
void SetAuditShell(bool bActive)
Definition: tabvwsh4.cxx:714
bool IsAuditShell() const
Definition: tabvwsh4.cxx:1049
void UpdateInputHandler(bool bForce=false, bool bStopEditing=true)
Definition: tabvwsha.cxx:666
void ExecuteCellFormatDlg(SfxRequest &rReq, const OString &rTabPage)
Definition: tabvwsha.cxx:520
void SetDontSwitch(bool bFlag)
Definition: tabvwsh.hxx:290
void LockModifiers(sal_uInt16 nModifiers)
Definition: tabview.cxx:1899
sal_uInt16 GetLockedModifiers() const
Definition: tabview.cxx:1905
void ResetBrushDocument()
Definition: tabview5.cxx:654
void MarkDataArea(bool bIncludeCursor=true)
Definition: tabview3.cxx:1680
void ErrorMessage(TranslateId pGlobStrId)
Definition: tabview2.cxx:1446
void RemoveHintWindow()
Definition: tabview3.cxx:881
void StartDataSelect()
Definition: tabview.cxx:2212
void SetAutoSpellData(SCCOL nPosX, SCROW nPosY, const std::vector< editeng::MisspellRanges > *pRanges)
Definition: tabview.cxx:2311
void SelectAll(bool bContinue=false)
Definition: tabview2.cxx:1099
void HideListBox()
Definition: tabview3.cxx:2996
bool HasHintWindow() const
Definition: tabview3.cxx:879
bool HasPaintBrush() const
Definition: tabview.hxx:587
SfxDispatcher & GetDispatcher()
Definition: viewdata.cxx:3135
ScMarkData & GetMarkData()
Definition: viewdata.cxx:3141
SCTAB GetTabNo() const
Definition: viewdata.hxx:395
ScDocument & GetDocument() const
Definition: viewdata.hxx:380
ScDocShell * GetDocShell() const
Definition: viewdata.hxx:354
ScTabViewShell * GetViewShell() const
Definition: viewdata.hxx:357
ScMarkType GetSimpleArea(SCCOL &rStartCol, SCROW &rStartRow, SCTAB &rStartTab, SCCOL &rEndCol, SCROW &rEndRow, SCTAB &rEndTab) const
Definition: viewdata.cxx:1181
SCROW GetCurY() const
Definition: viewdata.hxx:402
SCCOL GetCurX() const
Definition: viewdata.hxx:401
void SetMarkedWidthOrHeight(bool bWidth, ScSizeMode eMode, sal_uInt16 nSizeTwips)
Definition: viewfunc.cxx:2469
bool RemoveMerge()
Definition: viewfun2.cxx:1347
void EnterData(SCCOL nCol, SCROW nRow, SCTAB nTab, const OUString &rString, const EditTextObject *pData=nullptr, bool bMatrixExpand=false)
Definition: viewfunc.cxx:384
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:2146
void DeleteContents(InsertDeleteFlags nFlags)
Definition: viewfunc.cxx:2052
void MakeScenario(const OUString &rName, const OUString &rComment, const Color &rColor, ScScenarioFlags nFlags)
Definition: viewfun2.cxx:2332
ScAutoFormatData * CreateAutoFormatData()
Definition: viewfun2.cxx:1905
bool MergeCells(bool bApi, bool &rDoContents, bool bCenter)
Definition: viewfun2.cxx:1181
void AutoFormat(sal_uInt16 nFormatNo)
Definition: viewfun2.cxx:1926
void EnterMatrix(const OUString &rString, ::formula::FormulaGrammar::Grammar eGram)
Definition: viewfunc.cxx:837
void EnterBlock(const OUString &rString, const EditTextObject *pData)
Definition: viewfun2.cxx:883
void ApplyAttributes(const SfxItemSet *pDialogSet, const SfxItemSet *pOldSet, bool bAdjustBlockHeight=true)
Definition: viewfunc.cxx:964
void ExtendScenario()
Definition: viewfun2.cxx:2353
static void SetFullScreen(const SfxViewShell &rViewShell, bool bSet)
Enters or leaves full screen mode at the passed view shell.
Definition: viewutil.cxx:343
static bool IsFullScreen(const SfxViewShell &rViewShell)
Returns true, if the passed view shell is in full screen mode.
Definition: viewutil.cxx:331
SfxItemState QueryState(sal_uInt16 nSID, std::unique_ptr< SfxPoolItem > &rpState)
bool Execute(sal_uInt16 nSlot, const SfxPoolItem **pArgs=nullptr, SfxCallMode nCall=SfxCallMode::SLOT)
void Invalidate(sal_uInt16 nId)
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
bool IsInPlace() const
SfxItemPool * GetPool() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
bool HasItem(sal_uInt16 nWhich, const SfxPoolItem **ppItem=nullptr) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
bool IsModified() const
sal_uInt16 GetSlot() const
void Ignore()
const SfxItemSet * GetArgs() const
void AppendItem(const SfxPoolItem &)
bool IsAPI() const
void Done(bool bRemove=false)
virtual void Invalidate(sal_uInt16 nId=0)
SfxBindings & GetBindings()
SfxChildWindow * GetChildWindow(sal_uInt16)
SfxFrame & GetFrame() const
bool isLOKMobilePhone() const
weld::Window * GetFrameWeld() const
SfxViewFrame * GetViewFrame() const
static SfxViewShell * Current()
virtual void libreOfficeKitViewCallback(int nType, const char *pPayload) const override
virtual sal_uInt32 getNumber() const=0
virtual const IFunctionCategory * getCategory() const=0
virtual OUString getFunctionName() const=0
virtual OUString getSignature() const=0
virtual OUString getDescription() const=0
constexpr ::Color COL_LIGHTGRAY(0xC0, 0xC0, 0xC0)
Any aHelper
FieldUnit
constexpr sal_Int32 MAX_COL_WIDTH
Definition: global.hxx:92
@ EDITATTR
Drawing objects.
@ HARDATTR
Formula cells.
constexpr sal_Int32 MAX_EXTRA_WIDTH
Definition: global.hxx:90
@ SC_SIZE_DIRECT
Definition: global.hxx:351
@ SC_SIZE_OPTIMAL
Definition: global.hxx:352
@ SC_SIZE_SHOW
Definition: global.hxx:353
@ SC_INPUT_NONE
Definition: global.hxx:360
@ SC_INPUT_TABLE
Definition: global.hxx:362
ScScenarioFlags
Definition: global.hxx:225
constexpr sal_Int32 STD_EXTRA_WIDTH
Definition: global.hxx:88
constexpr sal_Int32 MAX_ROW_HEIGHT
Definition: global.hxx:93
constexpr sal_Int32 STD_COL_WIDTH
Definition: global.hxx:87
constexpr sal_Int32 MAX_EXTRA_HEIGHT
Definition: global.hxx:91
sal_Int32 nIndex
OUString aName
constexpr sal_uInt16 KEY_MOD1
constexpr sal_uInt16 KEY_SHIFT
aStr
std::unique_ptr< sal_Int32[]> pData
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
int i
constexpr auto toTwips(N number, Length from)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
constexpr ::tools::Long TwipsToEvenHMM(::tools::Long nTwips)
Definition: global.hxx:100
long Long
sal_Int16 nId
const char GetValue[]
OUString ScResId(TranslateId aId)
Definition: scdll.cxx:90
constexpr sal_uInt16 ATTR_PATTERN_START(100)
constexpr sal_uInt16 ATTR_PATTERN_END(155)
#define SC_MOD()
Definition: scmod.hxx:249
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
Definition: types.hxx:23
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17
RET_OK
RET_YES