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 "{ \"wholeList\": true, "
91 "\"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 "\"name\": \""
100 + escapeJSON(sCategoryName)
101 + "\"}, ");
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 "\"index\": "
126 + OString::number(static_cast<sal_Int64>(nCurIndex))
127 + ", "
128 "\"category\": "
129 + OString::number(static_cast<sal_Int64>(ppFDesc->getCategory()->getNumber()))
130 + ", "
131 "\"signature\": \""
132 + escapeJSON(ppFDesc->getSignature())
133 + "\", "
134 "\"description\": \""
135 + escapeJSON(ppFDesc->getDescription())
136 + "\"}, ");
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);
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( pReqArgs->Get( SID_ENTER_STRING ).GetValue() );
280 const SfxPoolItem* pDontCommitItem;
281 bool bCommit = true;
282 if (pReqArgs->HasItem(FN_PARAM_1, &pDontCommitItem))
283 bCommit = !(static_cast<const SfxBoolItem*>(pDontCommitItem)->GetValue());
284
285 ScInputHandler* pHdl = SC_MOD()->GetInputHdl( pTabViewShell );
286 if (bCommit)
287 {
288 pTabViewShell->EnterData( GetViewData().GetCurX(),
289 GetViewData().GetCurY(),
290 GetViewData().GetTabNo(),
291 aStr, nullptr,
292 true /*bMatrixExpand*/);
293 }
294 else if (pHdl)
295 {
296 SC_MOD()->SetInputMode(SC_INPUT_TABLE);
297
298 EditView* pTableView = pHdl->GetActiveView();
299 pHdl->DataChanging();
300 if (pTableView)
301 pTableView->GetEditEngine()->SetText(aStr);
302 pHdl->DataChanged();
303
304 SC_MOD()->SetInputMode(SC_INPUT_NONE);
305 }
306
307 if ( !pHdl || !pHdl->IsInEnterHandler() )
308 {
309 // UpdateInputHandler is needed after the cell content
310 // has changed, but if called from EnterHandler, UpdateInputHandler
311 // will be called later when moving the cursor.
312 pTabViewShell->UpdateInputHandler();
313 }
314
315 rReq.Done();
316
317 // no GrabFocus here, as otherwise on a Mac the tab jumps before the
318 // sideview, when the input was not finished
319 // (GrabFocus is called in KillEditView)
320 }
321 }
322 break;
323
324 case SID_INSERT_MATRIX:
325 {
326 if ( pReqArgs )
327 {
328 OUString aStr = static_cast<const SfxStringItem&>(pReqArgs->
329 Get( SID_INSERT_MATRIX )).GetValue();
331 pTabViewShell->EnterMatrix( aStr, rDoc.GetGrammar() );
332 rReq.Done();
333 }
334 }
335 break;
336
337 case FID_INPUTLINE_ENTER:
338 case FID_INPUTLINE_BLOCK:
339 case FID_INPUTLINE_MATRIX:
340 {
341 if( pReqArgs == nullptr ) //XXX temporary HACK to avoid GPF
342 break;
343
344 const ScInputStatusItem* pStatusItem
345 = static_cast<const ScInputStatusItem*>(&pReqArgs->
346 Get( FID_INPUTLINE_STATUS ));
347
348 const ScAddress& aCursorPos = pStatusItem->GetPos();
349 const OUString& aString = pStatusItem->GetString();
350 const EditTextObject* pData = pStatusItem->GetEditData();
351
352 if (pData)
353 {
354 if (nSlot == FID_INPUTLINE_BLOCK)
355 {
356 pTabViewShell->EnterBlock( aString, pData );
357 }
358 else if ( !aString.isEmpty() && ( aString[0] == '=' || aString[0] == '+' || aString[0] == '-' ) )
359 {
360 pTabViewShell->EnterData( aCursorPos.Col(), aCursorPos.Row(), aCursorPos.Tab(),
361 aString, pData, true /*bMatrixExpand*/);
362 }
363 else
364 {
365 pTabViewShell->EnterData(aCursorPos.Col(), aCursorPos.Row(), aCursorPos.Tab(), *pData);
366 }
367 }
368 else
369 {
370 if (nSlot == FID_INPUTLINE_ENTER)
371 {
372 if (
373 aCursorPos.Col() == GetViewData().GetCurX() &&
374 aCursorPos.Row() == GetViewData().GetCurY() &&
375 aCursorPos.Tab() == GetViewData().GetTabNo()
376 )
377 {
378 SfxStringItem aItem( SID_ENTER_STRING, aString );
379
380 const SfxPoolItem* aArgs[2];
381 aArgs[0] = &aItem;
382 aArgs[1] = nullptr;
383 rBindings.Execute( SID_ENTER_STRING, aArgs );
384 }
385 else
386 {
387 pTabViewShell->EnterData( aCursorPos.Col(),
388 aCursorPos.Row(),
389 aCursorPos.Tab(),
390 aString, nullptr,
391 true /*bMatrixExpand*/);
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 {
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& rViewFrm = pTabViewShell->GetViewFrame();
432 SfxChildWindow* pWnd = rViewFrm.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& rViewFrm = pTabViewShell->GetViewFrame();
444 SfxChildWindow* pWnd = rViewFrm.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
458
460
461 const SfxPoolItem* pAttr = nullptr;
462 sal_uInt16 nWhich = 0;
463
464 for ( nWhich=ATTR_PATTERN_START; nWhich<=ATTR_PATTERN_END; nWhich++ )
465 if ( pReqArgs->GetItemState( nWhich, true, &pAttr ) == SfxItemState::SET )
466 aNewSet.Put( *pAttr );
467
468 pTabViewShell->ApplyAttributes( &aNewSet, &aEmptySet );
469
470 rReq.Done();
471 }
472 else
473 {
474 pTabViewShell->ExecuteCellFormatDlg( rReq, "" );
475 }
476 }
477 break;
478
479 case SID_ENABLE_HYPHENATION:
480 pTabViewShell->ExecuteCellFormatDlg(rReq, "alignment");
481 break;
482
483 case SID_PROPERTY_PANEL_CELLTEXT_DLG:
484 pTabViewShell->ExecuteCellFormatDlg( rReq, "font" );
485 break;
486
487 case SID_CELL_FORMAT_BORDER:
488 pTabViewShell->ExecuteCellFormatDlg( rReq, "borders" );
489 break;
490
491 case SID_CHAR_DLG_EFFECT:
492 pTabViewShell->ExecuteCellFormatDlg( rReq, "fonteffects" );
493 break;
494
495 case SID_OPENDLG_SOLVE:
496 {
497 sal_uInt16 nId = ScSolverDlgWrapper::GetChildWindowId();
498 SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame();
499 SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId );
500
501 pScMod->SetRefDialog( nId, pWnd == nullptr );
502 }
503 break;
504
505 case SID_OPENDLG_OPTSOLVER:
506 {
507 sal_uInt16 nId = ScOptSolverDlgWrapper::GetChildWindowId();
508 SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame();
509 SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId );
510
511 pScMod->SetRefDialog( nId, pWnd == nullptr );
512 }
513 break;
514
515 case SID_OPENDLG_TABOP:
516 {
517 sal_uInt16 nId = ScTabOpDlgWrapper::GetChildWindowId();
518 SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame();
519 SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId );
520
521 pScMod->SetRefDialog( nId, pWnd == nullptr );
522 }
523 break;
524
525 case SID_SCENARIOS:
526 {
529 SCTAB nTab = GetViewData().GetTabNo();
530
531 if ( rDoc.IsScenario(nTab) )
532 {
533 rMark.MarkToMulti();
534 if ( rMark.IsMultiMarked() )
535 {
536
537 bool bExtend = rReq.IsAPI();
538 if (!bExtend)
539 {
540 std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pTabViewShell->GetFrameWeld(),
541 VclMessageType::Question, VclButtonsType::YesNo,
542 ScResId(STR_UPDATE_SCENARIO)));
543 xQueryBox->set_default_response(RET_YES);
544 bExtend = xQueryBox->run() == RET_YES;
545 }
546
547 if (bExtend)
548 {
549 pTabViewShell->ExtendScenario();
550 rReq.Done();
551 }
552 }
553 else if( ! rReq.IsAPI() )
554 {
555 std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(pTabViewShell->GetFrameWeld(),
556 VclMessageType::Warning, VclButtonsType::Ok,
557 ScResId(STR_NOAREASELECTED)));
558 xErrorBox->run();
559 }
560 }
561 else
562 {
563 rMark.MarkToMulti();
564 if ( rMark.IsMultiMarked() )
565 {
566 SCTAB i=1;
567 OUString aBaseName;
568 OUString aName;
569 Color aColor;
570 ScScenarioFlags nFlags;
571
572 OUString aTmp;
573 rDoc.GetName(nTab, aTmp);
574 aBaseName = aTmp + "_" + ScResId(STR_SCENARIO) + "_";
575
576 // first test, if the prefix is recognised as valid,
577 // else avoid only doubles
578 bool bPrefix = ScDocument::ValidTabName( aBaseName );
579 OSL_ENSURE(bPrefix, "invalid sheet name");
580
581 while ( rDoc.IsScenario(nTab+i) )
582 i++;
583
584 bool bValid;
585 SCTAB nDummy;
586 do
587 {
588 aName = aBaseName + OUString::number( i );
589 if (bPrefix)
590 bValid = rDoc.ValidNewTabName( aName );
591 else
592 bValid = !rDoc.GetTable( aName, nDummy );
593 ++i;
594 }
595 while ( !bValid && i <= MAXTAB + 2 );
596
597 if ( pReqArgs != nullptr )
598 {
599 OUString aArgName;
600 OUString aArgComment;
601 if ( const SfxStringItem* pItem = pReqArgs->GetItemIfSet( SID_SCENARIOS ) )
602 aArgName = pItem->GetValue();
603 if ( const SfxStringItem* pItem = pReqArgs->GetItemIfSet( SID_NEW_TABLENAME ) )
604 aArgComment = pItem->GetValue();
605
606 aColor = COL_LIGHTGRAY; // Default
607 nFlags = ScScenarioFlags::NONE; // not TwoWay
608
609 pTabViewShell->MakeScenario( aArgName, aArgComment, aColor, nFlags );
610 if( ! rReq.IsAPI() )
611 rReq.Done();
612 }
613 else
614 {
615 bool bSheetProtected = rDoc.IsTabProtected(nTab);
617
618 ScopedVclPtr<AbstractScNewScenarioDlg> pNewDlg(pFact->CreateScNewScenarioDlg(pTabViewShell->GetFrameWeld(), aName, false, bSheetProtected));
619 if ( pNewDlg->Execute() == RET_OK )
620 {
621 OUString aComment;
622 pNewDlg->GetScenarioData( aName, aComment, aColor, nFlags );
623 pTabViewShell->MakeScenario( aName, aComment, aColor, nFlags );
624
625 rReq.AppendItem( SfxStringItem( SID_SCENARIOS, aName ) );
626 rReq.AppendItem( SfxStringItem( SID_NEW_TABLENAME, aComment ) );
627 rReq.Done();
628 }
629 }
630 }
631 else if( ! rReq.IsAPI() )
632 {
633 pTabViewShell->ErrorMessage(STR_ERR_NEWSCENARIO);
634 }
635 }
636 }
637 break;
638
639 case SID_SELECTALL:
640 {
641 pTabViewShell->SelectAll();
642 rReq.Done();
643 }
644 break;
645
646 case FID_ROW_HEIGHT:
647 {
648 const SfxPoolItem* pRow;
649 const SfxUInt16Item* pHeight;
650 sal_uInt16 nHeight;
651
652 if ( pReqArgs && (pHeight = pReqArgs->GetItemIfSet( FID_ROW_HEIGHT )) &&
653 pReqArgs->HasItem( FN_PARAM_1, &pRow ) )
654 {
655 std::vector<sc::ColRowSpan> aRanges;
656 SCCOLROW nRow = static_cast<const SfxInt32Item*>(pRow)->GetValue() - 1;
657 nHeight = pHeight->GetValue();
659
660 if ( rMark.IsRowMarked( static_cast<SCROW>(nRow) ) )
661 {
662 aRanges = rMark.GetMarkedRowSpans();
663 }
664 else
665 {
666 aRanges.emplace_back(nRow, nRow);
667 }
668
669 pTabViewShell->SetWidthOrHeight(false, aRanges, SC_SIZE_DIRECT, o3tl::toTwips(nHeight, o3tl::Length::mm100));
670 }
671 else if ( pReqArgs && (pHeight = pReqArgs->GetItemIfSet( FID_ROW_HEIGHT )) )
672 {
673 nHeight = pHeight->GetValue();
674
675 // #101390#; the value of the macro is in HMM so use convertMm100ToTwip to convert
676 pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_DIRECT,
678 if( ! rReq.IsAPI() )
679 rReq.Done();
680 }
681 else
682 {
683 ScViewData& rData = GetViewData();
684 FieldUnit eMetric = SC_MOD()->GetAppOptions().GetAppMetric();
685 sal_uInt16 nCurHeight = rData.GetDocument().
686 GetRowHeight( rData.GetCurY(),
687 rData.GetTabNo() );
690 pTabViewShell->GetFrameWeld(), "RowHeightDialog", nCurHeight,
692 eMetric, 2, MAX_ROW_HEIGHT));
693
694 pDlg->StartExecuteAsync([pDlg, pTabViewShell](sal_Int32 nResult){
695 if (nResult == RET_OK)
696 {
697 SfxRequest pRequest(pTabViewShell->GetViewFrame(), FID_ROW_HEIGHT);
698 tools::Long nVal = pDlg->GetInputValue();
699 pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_DIRECT, static_cast<sal_uInt16>(nVal) );
700
701 // #101390#; the value of the macro should be in HMM so use TwipsToEvenHMM to convert
702 pRequest.AppendItem( SfxUInt16Item( FID_ROW_HEIGHT, static_cast<sal_uInt16>(TwipsToEvenHMM(nVal)) ) );
703 pRequest.Done();
704 }
705 pDlg->disposeOnce();
706 });
707 }
708 }
709 break;
710
711 case FID_ROW_OPT_HEIGHT:
712 {
713 if ( pReqArgs )
714 {
715 const SfxUInt16Item& rUInt16Item = pReqArgs->Get( FID_ROW_OPT_HEIGHT );
716
717 // #101390#; the value of the macro is in HMM so use convertMm100ToTwip to convert
718 pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_OPTIMAL,
721
722 if( ! rReq.IsAPI() )
723 rReq.Done();
724 }
725 else
726 {
727 FieldUnit eMetric = SC_MOD()->GetAppOptions().GetAppMetric();
728
731 pTabViewShell->GetFrameWeld(), "OptimalRowHeightDialog",
733
734 pDlg->StartExecuteAsync([pDlg, pTabViewShell](sal_Int32 nResult){
735 if ( nResult == RET_OK )
736 {
737 SfxRequest pRequest(pTabViewShell->GetViewFrame(), FID_ROW_OPT_HEIGHT);
738 tools::Long nVal = pDlg->GetInputValue();
739 pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_OPTIMAL, static_cast<sal_uInt16>(nVal) );
741
742 // #101390#; the value of the macro should be in HMM so use TwipsToEvenHMM to convert
743 pRequest.AppendItem( SfxUInt16Item( FID_ROW_OPT_HEIGHT, static_cast<sal_uInt16>(TwipsToEvenHMM(nVal)) ) );
744 pRequest.Done();
745 }
746 pDlg->disposeOnce();
747 });
748 }
749 }
750 break;
751
752 case FID_COL_WIDTH:
753 {
754 const SfxPoolItem* pColumn;
755 const SfxUInt16Item* pWidth;
756 sal_uInt16 nWidth;
757
758 if ( pReqArgs && (pWidth = pReqArgs->GetItemIfSet( FID_COL_WIDTH )) &&
759 pReqArgs->HasItem( FN_PARAM_1, &pColumn ) )
760 {
761 std::vector<sc::ColRowSpan> aRanges;
762 SCCOLROW nColumn = static_cast<const SfxUInt16Item*>(pColumn)->GetValue() - 1;
763 nWidth = pWidth->GetValue();
765
766 if ( rMark.IsColumnMarked( static_cast<SCCOL>(nColumn) ) )
767 {
768 aRanges = rMark.GetMarkedColSpans();
769 }
770 else
771 {
772 aRanges.emplace_back(nColumn, nColumn);
773 }
774
775 pTabViewShell->SetWidthOrHeight(true, aRanges, SC_SIZE_DIRECT, o3tl::toTwips(nWidth, o3tl::Length::mm100));
776 }
777 else if ( pReqArgs && (pWidth = pReqArgs->GetItemIfSet( FID_COL_WIDTH )) )
778 {
779 nWidth = pWidth->GetValue();
780
781 // #101390#; the value of the macro is in HMM so use convertMm100ToTwip to convert
782 pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_DIRECT,
784 if( ! rReq.IsAPI() )
785 rReq.Done();
786 }
787 else
788 {
789 FieldUnit eMetric = SC_MOD()->GetAppOptions().GetAppMetric();
790 ScViewData& rData = GetViewData();
791 sal_uInt16 nCurHeight = rData.GetDocument().
792 GetColWidth( rData.GetCurX(),
793 rData.GetTabNo() );
796 pTabViewShell->GetFrameWeld(), "ColWidthDialog", nCurHeight,
797 STD_COL_WIDTH, eMetric, 2, MAX_COL_WIDTH));
798
799 pDlg->StartExecuteAsync([pDlg, pTabViewShell](sal_Int32 nResult){
800 if ( nResult == RET_OK )
801 {
802 SfxRequest pRequest(pTabViewShell->GetViewFrame(), FID_COL_WIDTH);
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 pRequest.AppendItem( SfxUInt16Item( FID_COL_WIDTH, static_cast<sal_uInt16>(TwipsToEvenHMM(nVal))) );
808 pRequest.Done();
809 }
810 pDlg->disposeOnce();
811 });
812 }
813 }
814 break;
815
816 case FID_COL_OPT_WIDTH:
817 {
818 if ( pReqArgs )
819 {
820 const SfxUInt16Item& rUInt16Item = pReqArgs->Get( FID_COL_OPT_WIDTH );
821
822 // #101390#; the value of the macro is in HMM so use convertMm100ToTwip to convert
823 pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_OPTIMAL,
826
827 if( ! rReq.IsAPI() )
828 rReq.Done();
829 }
830 else
831 {
832 FieldUnit eMetric = SC_MOD()->GetAppOptions().GetAppMetric();
833
836 pTabViewShell->GetFrameWeld(), "OptimalColWidthDialog",
838
839 pDlg->StartExecuteAsync([pDlg, pTabViewShell](sal_Int32 nResult){
840 SfxRequest pRequest(pTabViewShell->GetViewFrame(), FID_COL_OPT_WIDTH);
841 if ( nResult == RET_OK )
842 {
843 tools::Long nVal = pDlg->GetInputValue();
844 pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_OPTIMAL, static_cast<sal_uInt16>(nVal) );
846
847 // #101390#; the value of the macro should be in HMM so use TwipsToEvenHMM to convert
848 pRequest.AppendItem( SfxUInt16Item( FID_COL_OPT_WIDTH, static_cast<sal_uInt16>(TwipsToEvenHMM(nVal)) ) );
849 pRequest.Done();
850 }
851 pDlg->disposeOnce();
852 });
853 }
854 }
855 break;
856
857 case FID_COL_OPT_DIRECT:
859 rReq.Done();
860 break;
861
862 case FID_ROW_HIDE:
863 pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_DIRECT, 0 );
864 rReq.Done();
865 break;
866 case FID_ROW_SHOW:
867 pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_SHOW, 0 );
868 rReq.Done();
869 break;
870 case FID_COL_HIDE:
871 pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_DIRECT, 0 );
872 rReq.Done();
873 break;
874 case FID_COL_SHOW:
875 pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_SHOW, 0 );
876 rReq.Done();
877 break;
878
879 case SID_CELL_FORMAT_RESET:
880 {
882 rReq.Done();
883 }
884 break;
885
886 case FID_MERGE_ON:
887 case FID_MERGE_OFF:
888 case FID_MERGE_TOGGLE:
889 {
891 {
892 // test whether to merge or to split
893 bool bMerge = false;
894 bool bCenter = false;
895 switch( nSlot )
896 {
897 case FID_MERGE_ON:
898 bMerge = true;
899 break;
900 case FID_MERGE_OFF:
901 bMerge = false;
902 break;
903 case FID_MERGE_TOGGLE:
904 {
905 bCenter = true;
906 std::unique_ptr<SfxPoolItem> pItem;
907 if( rBindings.QueryState( nSlot, pItem ) >= SfxItemState::DEFAULT )
908 bMerge = !static_cast< SfxBoolItem* >( pItem.get() )->GetValue();
909 }
910 break;
911 }
912
913 if( bMerge )
914 {
915 // merge - check if to move contents of covered cells
916 bool bMoveContents = false;
917 bool bApi = rReq.IsAPI();
918 const SfxPoolItem* pItem;
919 if ( pReqArgs &&
920 pReqArgs->GetItemState(nSlot, true, &pItem) == SfxItemState::SET )
921 {
922 assert(dynamic_cast<const SfxBoolItem*>( pItem) && "wrong item");
923 bMoveContents = static_cast<const SfxBoolItem*>(pItem)->GetValue();
924 }
925
926 if (pTabViewShell->MergeCells( bApi, bMoveContents, bCenter ))
927 {
928 if (!bApi && bMoveContents) // "yes" clicked in dialog
929 rReq.AppendItem( SfxBoolItem( nSlot, bMoveContents ) );
930 rBindings.Invalidate( nSlot );
931 rReq.Done();
932 }
933 }
934 else
935 {
936 // split cells
937 if (pTabViewShell->RemoveMerge())
938 {
939 rBindings.Invalidate( nSlot );
940 rReq.Done();
941 }
942 }
943 break;
944 }
945 }
946 break;
947
948 case SID_AUTOFORMAT:
949 {
950 weld::Window* pDlgParent = pTabViewShell->GetFrameWeld();
951 SCCOL nStartCol;
952 SCROW nStartRow;
953 SCTAB nStartTab;
954 SCCOL nEndCol;
955 SCROW nEndRow;
956 SCTAB nEndTab;
957
958 const ScMarkData& rMark = GetViewData().GetMarkData();
959 if ( !rMark.IsMarked() && !rMark.IsMultiMarked() )
960 pTabViewShell->MarkDataArea();
961
962 GetViewData().GetSimpleArea( nStartCol,nStartRow,nStartTab,
963 nEndCol,nEndRow,nEndTab );
964
965 if ( ( std::abs(nEndCol-nStartCol) > 1 )
966 && ( std::abs(nEndRow-nStartRow) > 1 ) )
967 {
968 if ( pReqArgs )
969 {
970 const SfxStringItem& rNameItem = pReqArgs->Get( SID_AUTOFORMAT );
972 ScAutoFormat::const_iterator it = pFormat->find(rNameItem.GetValue());
973 ScAutoFormat::const_iterator itBeg = pFormat->begin();
974 size_t nIndex = std::distance(itBeg, it);
975
976 pTabViewShell->AutoFormat( nIndex );
977
978 if( ! rReq.IsAPI() )
979 rReq.Done();
980 }
981 else
982 {
984 std::unique_ptr<ScAutoFormatData> pNewEntry(pTabViewShell->CreateAutoFormatData());
986
988
989 if ( pDlg->Execute() == RET_OK )
990 {
991 ScEditableTester aTester( pTabViewShell );
992 if ( !aTester.IsEditable() )
993 {
994 pTabViewShell->ErrorMessage(aTester.GetMessageId());
995 }
996 else
997 {
998 pTabViewShell->AutoFormat( pDlg->GetIndex() );
999
1000 rReq.AppendItem( SfxStringItem( SID_AUTOFORMAT, pDlg->GetCurrFormatName() ) );
1001 rReq.Done();
1002 }
1003 }
1004 }
1005 }
1006 else
1007 {
1008 std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(pDlgParent,
1009 VclMessageType::Warning, VclButtonsType::Ok,
1010 ScResId(STR_INVALID_AFAREA)));
1011 xErrorBox->run();
1012 }
1013 }
1014 break;
1015
1016 case SID_CANCEL:
1017 {
1018 if (GetViewData().HasEditView(GetViewData().GetActivePart()))
1019 pScMod->InputCancelHandler();
1020 else if (pTabViewShell->HasPaintBrush())
1021 pTabViewShell->ResetBrushDocument(); // abort format paint brush
1022 else if (pTabViewShell->HasHintWindow())
1023 pTabViewShell->RemoveHintWindow();
1024 else if( ScViewUtil::IsFullScreen( *pTabViewShell ) )
1025 ScViewUtil::SetFullScreen( *pTabViewShell, false );
1026 else
1027 {
1028 // TODO/LATER: when is this code executed?
1029 pTabViewShell->Escape();
1030 }
1031 }
1032 break;
1033
1034 case SID_ACCEPT_FORMULA:
1035 {
1036 if (GetViewData().HasEditView(GetViewData().GetActivePart()))
1037 pScMod->InputEnterHandler();
1038 }
1039 break;
1040
1041 case SID_START_FORMULA:
1042 {
1043 ScInputHandler* pInputHandler = pScMod->GetInputHdl();
1044 if (pInputHandler && pInputHandler->GetInputWindow())
1045 pInputHandler->GetInputWindow()->StartFormula();
1046 }
1047 break;
1048
1049 case SID_DATA_SELECT:
1050 pTabViewShell->StartDataSelect();
1051 break;
1052
1053 case SID_DETECTIVE_FILLMODE:
1054 {
1055 bool bOldMode = pTabViewShell->IsAuditShell();
1056 pTabViewShell->SetAuditShell( !bOldMode );
1057 pTabViewShell->Invalidate( nSlot );
1058 }
1059 break;
1060
1061 case FID_INPUTLINE_STATUS:
1062 OSL_FAIL("Execute from InputLine status");
1063 break;
1064
1065 case SID_STATUS_DOCPOS:
1066 // Launch navigator.
1068 SID_NAVIGATOR, SfxCallMode::SYNCHRON|SfxCallMode::RECORD );
1069 break;
1070
1071 case SID_MARKAREA:
1072 // called from Basic at the hidden view to select a range in the visible view
1073 OSL_FAIL("old slot SID_MARKAREA");
1074 break;
1075
1076 default:
1077 OSL_FAIL("ScCellShell::Execute: unknown slot");
1078 break;
1079 }
1080}
1081
1082/* 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, const ILibreOfficeKitNotifier *pNotifier=nullptr)
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< AbstractScMetricInputDlg > CreateScMetricInputDlg(weld::Window *pParent, const OUString &sDialogName, tools::Long nCurrent, tools::Long nDefault, FieldUnit eFUnit, sal_uInt16 nDecimals, tools::Long nMaximum, tools::Long nMinimum=0)=0
virtual VclPtr< AbstractScNewScenarioDlg > CreateScNewScenarioDlg(weld::Window *pParent, const OUString &rName, bool bEdit, bool bSheetProtected)=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:191
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:2973
SC_DLLPUBLIC bool IsScenario(SCTAB nTab) const
Definition: documen3.cxx:432
SC_DLLPUBLIC bool GetTable(const OUString &rName, SCTAB &rTab) const
Definition: document.cxx:244
SC_DLLPUBLIC bool IsTabProtected(SCTAB nTab) const
Definition: documen3.cxx:1905
SC_DLLPUBLIC bool ValidNewTabName(const OUString &rName) const
Definition: document.cxx:357
static SC_DLLPUBLIC bool ValidTabName(const OUString &rName)
Definition: document.cxx:318
sal_uInt16 GetSheetOptimalMinRowHeight(SCTAB nTab) const
Definition: document.cxx:928
SC_DLLPUBLIC formula::FormulaGrammar::Grammar GetGrammar() const
Definition: document.hxx:1010
ScChangeTrack * GetChangeTrack() const
Definition: document.hxx:2494
SC_DLLPUBLIC bool GetName(SCTAB nTab, OUString &rName) const
Definition: document.cxx:204
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:993
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:1115
static OUString GetCategoryName(sal_uInt32 _nCategoryNumber)
Returns name of category.
Definition: funcdesc.cxx:1147
::tools::Long nLastColWidthExtra
Definition: global.hxx:599
static SC_DLLPUBLIC ScAutoFormat * GetOrCreateAutoFormat()
Definition: global.cxx:266
static ScFunctionList * GetStarCalcFunctionList()
Definition: global.cxx:626
static ScFunctionMgr * GetStarCalcFunctionMgr()
Definition: global.cxx:635
static SC_DLLPUBLIC ::tools::Long nLastRowHeightExtra
Definition: global.hxx:598
static void ClearAutoFormat()
Definition: global.cxx:248
ScInputWindow * GetInputWindow()
Definition: inputhdl.hxx:264
void DataChanged(bool bFromTopNotify=false, bool bSetModified=true)
Definition: inputhdl.cxx:2722
EditView * GetActiveView()
Definition: inputhdl.cxx:2355
bool IsInEnterHandler() const
Definition: inputhdl.hxx:268
bool DataChanging(sal_Unicode cTyped=0, bool bFromCommand=false)
Definition: inputhdl.cxx:2710
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:412
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:1355
SC_DLLPUBLIC void SetRefDialog(sal_uInt16 nId, bool bVis, SfxViewFrame *pViewFrm=nullptr)
Reference dialogs.
Definition: scmod.cxx:1519
SC_DLLPUBLIC void InputEnterHandler(ScEnterMode nBlockMode=ScEnterMode::NORMAL, bool bBeforeSavingInLOK=false)
Definition: scmod.cxx:1411
void InputCancelHandler()
Definition: scmod.cxx:1421
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:690
void ExecuteCellFormatDlg(SfxRequest &rReq, const OUString &rTabPage)
Definition: tabvwsha.cxx:538
void SetDontSwitch(bool bFlag)
Definition: tabvwsh.hxx:292
void LockModifiers(sal_uInt16 nModifiers)
Definition: tabview.cxx:1968
sal_uInt16 GetLockedModifiers() const
Definition: tabview.cxx:1974
void ResetBrushDocument()
Definition: tabview5.cxx:651
void MarkDataArea(bool bIncludeCursor=true)
Definition: tabview3.cxx:1677
void ErrorMessage(TranslateId pGlobStrId)
Definition: tabview2.cxx:1553
void RemoveHintWindow()
Definition: tabview3.cxx:878
void StartDataSelect()
Definition: tabview.cxx:2278
void SetAutoSpellData(SCCOL nPosX, SCROW nPosY, const std::vector< editeng::MisspellRanges > *pRanges)
Definition: tabview.cxx:2377
void SelectAll(bool bContinue=false)
Definition: tabview2.cxx:1201
void HideListBox()
Definition: tabview3.cxx:2996
bool HasHintWindow() const
Definition: tabview3.cxx:876
bool HasPaintBrush() const
Definition: tabview.hxx:598
SfxDispatcher & GetDispatcher()
Definition: viewdata.cxx:3140
ScMarkData & GetMarkData()
Definition: viewdata.cxx:3146
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:1182
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:2482
bool RemoveMerge()
Definition: viewfun2.cxx:1345
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:2159
void DeleteContents(InsertDeleteFlags nFlags)
Definition: viewfunc.cxx:2065
void MakeScenario(const OUString &rName, const OUString &rComment, const Color &rColor, ScScenarioFlags nFlags)
Definition: viewfun2.cxx:2330
ScAutoFormatData * CreateAutoFormatData()
Definition: viewfun2.cxx:1903
bool MergeCells(bool bApi, bool &rDoContents, bool bCenter)
Definition: viewfun2.cxx:1179
void AutoFormat(sal_uInt16 nFormatNo)
Definition: viewfun2.cxx:1924
void EnterMatrix(const OUString &rString, ::formula::FormulaGrammar::Grammar eGram)
Definition: viewfunc.cxx:839
void EnterBlock(const OUString &rString, const EditTextObject *pData)
Definition: viewfun2.cxx:881
void ApplyAttributes(const SfxItemSet *pDialogSet, const SfxItemSet *pOldSet, bool bAdjustBlockHeight=true)
Definition: viewfunc.cxx:974
void ExtendScenario()
Definition: viewfun2.cxx:2351
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
virtual void libreOfficeKitViewCallback(int nType, const OString &pPayload) const override
SfxViewFrame & GetViewFrame() const
static SAL_WARN_UNUSED_RESULT SfxViewShell * Current()
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:352
@ SC_SIZE_OPTIMAL
Definition: global.hxx:353
@ SC_SIZE_SHOW
Definition: global.hxx:354
@ SC_INPUT_NONE
Definition: global.hxx:361
@ SC_INPUT_TABLE
Definition: global.hxx:363
ScScenarioFlags
Definition: global.hxx:226
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:247
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