LibreOffice Module sc (master) 1
anyrefdg.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 <rangelst.hxx>
21#include <comphelper/string.hxx>
22#include <sfx2/app.hxx>
23#include <sfx2/viewsh.hxx>
24#include <sfx2/bindings.hxx>
25#include <sfx2/dispatch.hxx>
26#include <sfx2/viewfrm.hxx>
27#include <osl/diagnose.h>
28#include <o3tl/string_view.hxx>
29
30#include <anyrefdg.hxx>
31#include <sc.hrc>
32#include <inputhdl.hxx>
33#include <scmod.hxx>
34#include <inputwin.hxx>
35#include <tabvwsh.hxx>
36#include <docsh.hxx>
37#include <rfindlst.hxx>
38#include <compiler.hxx>
39#include <inputopt.hxx>
40#include <rangeutl.hxx>
41#include <tokenarray.hxx>
42#include <comphelper/lok.hxx>
43#include <output.hxx>
44
45#include <memory>
46
48 : m_pDlg(_pDlg)
49 , m_pRefEdit (nullptr)
50 , m_pRefBtn (nullptr)
51 , m_pDialog(nullptr)
52 , m_pBindings(_pBindings)
53 , m_nRefTab(0)
54 , m_bHighlightRef(false)
55{
56 ScInputOptions aInputOption=SC_MOD()->GetInputOptions();
57 m_bEnableColorRef=aInputOption.GetRangeFinder();
58}
59
61{
62 dispose();
63}
64
66{
67 // common cleanup for ScAnyRefDlg and ScFormulaDlg is done here
69 enableInput( true );
70
71 ScInputHandler* pInputHdl = SC_MOD()->GetInputHdl();
72 if ( pInputHdl )
73 pInputHdl->ResetDelayTimer(); // stop the timer for disabling the input line
74
75 m_pDialog = nullptr;
76}
77
79{
80 ScDocShell* pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(checkSfxObjectShell<ScDocShell>));
81 while( pDocShell )
82 {
83 SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocShell );
84 while( pFrame )
85 {
86 // enable everything except InPlace, including bean frames
87 if ( !pFrame->GetFrame().IsInPlace() )
88 {
89 SfxViewShell* p = pFrame->GetViewShell();
90 ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell *>( p );
91 if(pViewSh!=nullptr)
92 {
93 vcl::Window *pWin=pViewSh->GetWindow();
94 if(pWin)
95 {
96 vcl::Window *pParent=pWin->GetParent();
97 if(pParent)
98 {
99 pParent->EnableInput(bEnable);
100 pViewSh->EnableRefInput(bEnable);
101 }
102 }
103 }
104 }
105 pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell );
106 }
107
108 pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pDocShell, checkSfxObjectShell<ScDocShell>));
109 }
110}
111
113{
115 return;
116
117 m_bHighlightRef = true;
119 if ( !pViewData )
120 return;
121
122 ScDocument& rDoc = pViewData->GetDocument();
123 ScTabViewShell* pTabViewShell=pViewData->GetViewShell();
124
125 ScRangeList aRangeList;
126
127 pTabViewShell->DoneRefMode();
128 pTabViewShell->ClearHighlightRanges();
129
130 if( ParseWithNames( aRangeList, rStr, rDoc ) )
131 {
132 for ( size_t i = 0, nRanges = aRangeList.size(); i < nRanges; ++i )
133 {
134 ScRange const & rRangeEntry = aRangeList[ i ];
136 pTabViewShell->AddHighlightRange( rRangeEntry, aColName );
137 }
138 }
139}
140
141bool ScFormulaReferenceHelper::ParseWithNames( ScRangeList& rRanges, std::u16string_view rStr, const ScDocument& rDoc )
142{
143 rRanges.RemoveAll();
144
145 if (rStr.empty())
146 return true;
147
148 ScAddress::Details aDetails(rDoc.GetAddressConvention(), 0, 0);
149
150 bool bError = false;
151 sal_Int32 nIdx {0};
152 do
153 {
154 ScRange aRange;
155 OUString aRangeStr( o3tl::getToken(rStr, 0, ';', nIdx ) );
156
157 ScRefFlags nFlags = aRange.ParseAny( aRangeStr, rDoc, aDetails );
158 if ( nFlags & ScRefFlags::VALID )
159 {
160 if ( (nFlags & ScRefFlags::TAB_3D) == ScRefFlags::ZERO )
161 aRange.aStart.SetTab( m_nRefTab );
162 if ( (nFlags & ScRefFlags::TAB2_3D) == ScRefFlags::ZERO )
163 aRange.aEnd.SetTab( aRange.aStart.Tab() );
164 rRanges.push_back( aRange );
165 }
166 else if ( ScRangeUtil::MakeRangeFromName( aRangeStr, rDoc, m_nRefTab, aRange, RUTL_NAMES, aDetails ) )
167 rRanges.push_back( aRange );
168 else
169 bError = true;
170 }
171 while (nIdx>0);
172
173 return !bError;
174}
175
177{
179 return;
180
181 m_bHighlightRef=true;
183 if ( !(pViewData && m_pRefComp) )
184 return;
185
186 ScTabViewShell* pTabViewShell=pViewData->GetViewShell();
187 SCCOL nCol = pViewData->GetCurX();
188 SCROW nRow = pViewData->GetCurY();
189 SCTAB nTab = pViewData->GetTabNo();
190 ScAddress aPos( nCol, nRow, nTab );
191
192 std::unique_ptr<ScTokenArray> pScTokA(m_pRefComp->CompileString(rStr));
193
194 if (!(pTabViewShell && pScTokA))
195 return;
196
197 const ScViewData& rViewData = pTabViewShell->GetViewData();
198 ScDocument& rDoc = rViewData.GetDocument();
199 pTabViewShell->DoneRefMode();
200 pTabViewShell->ClearHighlightRanges();
201
203 const formula::FormulaToken* pToken = aIter.GetNextReference();
204
205 sal_uInt16 nIndex=0;
206
207 while(pToken!=nullptr)
208 {
209 bool bDoubleRef=(pToken->GetType()==formula::svDoubleRef);
210
211 if(pToken->GetType()==formula::svSingleRef || bDoubleRef)
212 {
213 ScRange aRange;
214 if(bDoubleRef)
215 {
216 ScComplexRefData aRef( *pToken->GetDoubleRef() );
217 aRange = aRef.toAbs(rDoc, aPos);
218 }
219 else
220 {
221 ScSingleRefData aRef( *pToken->GetSingleRef() );
222 aRange.aStart = aRef.toAbs(rDoc, aPos);
223 aRange.aEnd = aRange.aStart;
224 }
226 pTabViewShell->AddHighlightRange(aRange, aColName);
227 }
228
229 pToken = aIter.GetNextReference();
230 }
231}
232
234{
236
237 if( !(pViewData && m_bHighlightRef && m_bEnableColorRef))
238 return;
239
240 ScTabViewShell* pTabViewShell=pViewData->GetViewShell();
241
242 if(pTabViewShell!=nullptr)
243 {
244 // bDoneRefMode is sal_False when called from before SetReference.
245 // In that case, RefMode was just started and must not be ended now.
246
247 if ( bDoneRefMode )
248 pTabViewShell->DoneRefMode();
249 pTabViewShell->ClearHighlightRanges();
250
252 {
253 // Clear
254 std::vector<ReferenceMark> aReferenceMarks;
255 ScInputHandler::SendReferenceMarks( pTabViewShell, aReferenceMarks );
256 }
257 }
258 m_bHighlightRef=false;
259}
260
262{
263 if( !m_bEnableColorRef )
264 return;
265
266 if( rStr.indexOf('(') != -1 ||
267 rStr.indexOf('+') != -1 ||
268 rStr.indexOf('*') != -1 ||
269 rStr.indexOf('-') != -1 ||
270 rStr.indexOf('/') != -1 ||
271 rStr.indexOf('&') != -1 ||
272 rStr.indexOf('<') != -1 ||
273 rStr.indexOf('>') != -1 ||
274 rStr.indexOf('=') != -1 ||
275 rStr.indexOf('^') != -1 )
276 {
278 }
279 else
280 {
282 }
283}
284
286{
287 if( !m_pRefEdit && pEdit )
288 {
289 m_pDlg->RefInputStart( pEdit );
290 }
291
293 if( !pViewShell )
294 return;
295
296 pViewShell->ActiveGrabFocus();
297 if( !m_pRefEdit )
298 return;
299
300 const ScViewData& rViewData = pViewShell->GetViewData();
301 ScDocument& rDoc = rViewData.GetDocument();
302 ScRangeList aRangeList;
303 if( !ParseWithNames( aRangeList, m_pRefEdit->GetText(), rDoc ) )
304 return;
305
306 if ( !aRangeList.empty() )
307 {
308 const ScRange & rRange = aRangeList.front();
309 pViewShell->SetTabNo( rRange.aStart.Tab() );
310 pViewShell->MoveCursorAbs( rRange.aStart.Col(),
311 rRange.aStart.Row(), SC_FOLLOW_JUMP, false, false );
312 pViewShell->MoveCursorAbs( rRange.aEnd.Col(),
313 rRange.aEnd.Row(), SC_FOLLOW_JUMP, true, false );
314 m_pDlg->SetReference( rRange, rDoc );
315 }
316}
317
319{
321 if ( !pViewData )
322 return;
323
324 ScDocument& rDoc = pViewData->GetDocument();
325 SCCOL nCol = pViewData->GetCurX();
326 SCROW nRow = pViewData->GetCurY();
327 SCTAB nTab = pViewData->GetTabNo();
328 ScAddress aCursorPos( nCol, nRow, nTab );
329
330 m_pRefComp.reset( new ScCompiler( rDoc, aCursorPos, rDoc.GetGrammar()) );
331 m_pRefComp->EnableJumpCommandReorder(false);
332 m_pRefComp->EnableStopOnError(false);
333
334 m_nRefTab = nTab;
335}
336
338{
339 if (m_pRefEdit)
340 m_pRefEdit->GrabFocus();
341 m_pDlg->RefInputDone(true);
342 return true;
343}
344
346{
347 if ( !CanInputDone( bForced ) )
348 return;
349
350 if (!m_pDialog)
351 return;
352
353 // Adjust window title
355
356 if (m_pRefEdit)
358
359 // set button image
360 if (m_pRefBtn)
361 {
364 }
365
367
368 m_pRefEdit = nullptr;
369 m_pRefBtn = nullptr;
370}
371
373{
374 if (m_pRefEdit)
375 return;
376
377 m_pRefEdit = pEdit;
378 m_pRefBtn = pButton;
379
380 // Save and adjust window title
383 {
384 const OUString sLabel = pLabel->get_label();
385 if (!sLabel.isEmpty())
386 {
387 const OUString sNewDialogText = m_sOldDialogText + ": " + comphelper::string::stripEnd(sLabel, ':');
388 m_pDialog->set_title(pLabel->strip_mnemonic(sNewDialogText));
389 }
390 }
391
392 m_pDialog->collapse(pEdit->GetWidget(), pButton ? pButton->GetWidget() : nullptr);
393
394 // set button image
395 if (pButton)
396 pButton->SetEndImage();
397
399 if (m_pRefBtn)
401}
402
404{
405 if( !pEdit )
406 return;
407
408 if( m_pRefEdit == pEdit ) // is this the active ref edit field?
409 {
410 m_pRefEdit->GrabFocus(); // before RefInputDone()
411 m_pDlg->RefInputDone( true ); // finish ref input
412 }
413 else
414 {
415 m_pDlg->RefInputDone( true ); // another active ref edit?
416 m_pDlg->RefInputStart( pEdit, pButton ); // start ref input
417 // pRefEdit might differ from pEdit after RefInputStart() (i.e. ScFormulaDlg)
418 if( m_pRefEdit )
420 }
421}
422
424{
425 SfxApplication* pSfxApp = SfxGetpApp();
426
427 SetDispatcherLock( false );
428
430 if ( pViewFrm && pViewFrm->HasChildWindow(FID_INPUTLINE_STATUS) )
431 {
432 // The input row is disabled with ToolBox::Disable disabled, thus it must be
433 // reenabled with ToolBox::Enable (before the AppWindow is enabled)
434 // for the buttons to be drawn as enabled.
435 SfxChildWindow* pChild = pViewFrm->GetChildWindow(FID_INPUTLINE_STATUS);
436 if (pChild)
437 {
438 ScInputWindow* pWin = static_cast<ScInputWindow*>(pChild->GetWindow());
439 pWin->Enable();
440 }
441 }
442
443 // find parent view frame to close dialog
444 SfxViewFrame* pMyViewFrm = nullptr;
445 if ( m_pBindings )
446 {
448 if (pMyDisp)
449 pMyViewFrm = pMyDisp->GetFrame();
450 }
451 SC_MOD()->SetRefDialog( nId, false, pMyViewFrm );
452
453 pSfxApp->Broadcast( SfxHint( SfxHintId::ScKillEditView ) );
454
456 if ( pScViewShell )
457 pScViewShell->UpdateInputHandler(true);
458}
459
461{
463 {
464 // lock / unlock only the dispatchers of Calc documents
465 ScDocShell* pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(checkSfxObjectShell<ScDocShell>));
466 while (pDocShell)
467 {
468 SfxViewFrame* pFrame = SfxViewFrame::GetFirst(pDocShell);
469 while (pFrame)
470 {
471 SfxDispatcher* pDisp = pFrame->GetDispatcher();
472 if (pDisp)
473 pDisp->Lock(bLock);
474 pFrame = SfxViewFrame::GetNext(*pFrame, pDocShell);
475 }
476 pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pDocShell, checkSfxObjectShell<ScDocShell>));
477 }
478 return;
479 // if a new view is created while the dialog is open,
480 // that view's dispatcher is locked when trying to create the dialog
481 // for that view (ScTabViewShell::CreateRefDialog)
482 }
483
484 // lock / unlock only the dispatcher of Calc document
485 SfxDispatcher* pDisp = nullptr;
486 if ( m_pBindings )
487 {
488 pDisp = m_pBindings->GetDispatcher();
489 }
490 else if(SfxViewFrame* pViewFrame = SfxViewFrame::Current())
491 {
492 if (dynamic_cast< ScTabViewShell* >(pViewFrame->GetViewShell()))
493 pDisp = pViewFrame->GetDispatcher();
494 }
495
496 if (pDisp)
497 pDisp->Lock(bLock);
498}
499
501{
502 enableInput( false );
503
505}
507{
508 ScDocShell* pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(checkSfxObjectShell<ScDocShell>));
509 while( pDocShell )
510 {
511 SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocShell );
512 while( pFrame )
513 {
514 // enable everything except InPlace, including bean frames
515 if ( !pFrame->GetFrame().IsInPlace() )
516 {
517 SfxViewShell* p = pFrame->GetViewShell();
518 ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell *>( p );
519 if(pViewSh!=nullptr)
520 {
521 vcl::Window *pWin=pViewSh->GetWindow();
522 if(pWin)
523 {
524 vcl::Window *pParent=pWin->GetParent();
525 if(pParent)
526 {
527 pParent->EnableInput(bFlag,false);
528 pViewSh->EnableRefInput(bFlag);
529 }
530 }
531 }
532 }
533 pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell );
534 }
535
536 pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pDocShell, checkSfxObjectShell<ScDocShell>));
537 }
538}
539
541{
542 ScDocShell* pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(checkSfxObjectShell<ScDocShell>));
543 while( pDocShell )
544 {
545 SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocShell );
546 while( pFrame )
547 {
548 // enable everything except InPlace, including bean frames
549 if ( !pFrame->GetFrame().IsInPlace() )
550 {
551 SfxViewShell* p = pFrame->GetViewShell();
552 ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell *>( p );
553 if(pViewSh!=nullptr)
554 {
555 vcl::Window *pWin=pViewSh->GetWindow();
556 if(pWin)
557 {
558 vcl::Window *pParent=pWin->GetParent();
559 if(pParent)
560 pParent->Invalidate();
561 }
562 }
563 }
564 pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell );
565 }
566
567 pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pDocShell, checkSfxObjectShell<ScDocShell>));
568 }
569}
570
572{
573 SfxViewShell* pSh = SfxViewShell::GetFirst( true, checkSfxViewShell<ScTabViewShell> );
574 while ( pSh )
575 {
576 static_cast<ScTabViewShell*>(pSh)->ClearHighlightRanges();
577 pSh = SfxViewShell::GetNext( *pSh, true, checkSfxViewShell<ScTabViewShell> );
578 }
579}
580
582 : m_pController(&rController)
583 , m_bInRefMode(false)
584 , m_aHelper(this, pB)
585 , m_pMyBindings(pB)
586{
587 m_aHelper.SetDialog(rController.getDialog());
588
589 if( bBindRef ) EnterRefMode();
590}
591
593{
594 if( m_bInRefMode ) return false;
595
596 SC_MOD()->InputEnterHandler();
597
598 ScTabViewShell* pScViewShell = nullptr;
599
600 // title has to be from the view that opened the dialog,
601 // even if it's not the current view
602
603 SfxObjectShell* pParentDoc = nullptr;
604 if ( m_pMyBindings )
605 {
607 if (pMyDisp)
608 {
609 SfxViewFrame* pMyViewFrm = pMyDisp->GetFrame();
610 if (pMyViewFrm)
611 {
612 pScViewShell = dynamic_cast<ScTabViewShell*>( pMyViewFrm->GetViewShell() );
613 if( pScViewShell )
614 pScViewShell->UpdateInputHandler(true);
615 pParentDoc = pMyViewFrm->GetObjectShell();
616 }
617 }
618 }
619 if ( !pParentDoc && pScViewShell ) // use current only if above fails
620 pParentDoc = pScViewShell->GetObjectShell();
621 if ( pParentDoc )
622 m_aDocName = pParentDoc->GetTitle();
623
624 ScInputHandler* pInputHdl = SC_MOD()->GetInputHdl(pScViewShell);
625
626 OSL_ENSURE( pInputHdl, "Missing input handler :-/" );
627
628 if ( pInputHdl )
629 pInputHdl->NotifyChange( nullptr );
630
632
634
635 m_aHelper.Init();
636
638
639 m_bInRefMode = true;
640 return m_bInRefMode;
641}
642
643ScRefHandler::~ScRefHandler() COVERITY_NOEXCEPT_FALSE
644{
646}
647
649{
650 m_pController = nullptr;
651 LeaveRefMode();
653}
654
656{
657 if( !m_bInRefMode ) return false;
658
660
661 SetDispatcherLock( false );
662
664 if( pScViewShell )
665 pScViewShell->UpdateInputHandler(true);
666
668
669 m_bInRefMode = false;
670 return true;
671}
672
674{
676 if (pCurrent)
677 {
678 SfxObjectShell* pObjSh = pCurrent->GetObjectShell();
679 if ( pObjSh && pObjSh->GetTitle() == m_aDocName )
680 {
681 // right document already visible -> nothing to do
682 return;
683 }
684 }
685
686 SfxViewShell* pSh = SfxViewShell::GetFirst( true, checkSfxViewShell<ScTabViewShell> );
687 while ( pSh )
688 {
689 SfxObjectShell* pObjSh = pSh->GetObjectShell();
690 if ( pObjSh && pObjSh->GetTitle() == m_aDocName )
691 {
692 // switch to first TabViewShell for document
693 static_cast<ScTabViewShell*>(pSh)->SetActive();
694 return;
695 }
696 pSh = SfxViewShell::GetNext( *pSh, true, checkSfxViewShell<ScTabViewShell> );
697 }
698}
699
700bool ScRefHandler::IsDocAllowed(SfxObjectShell* pDocSh) const // pDocSh may be 0
701{
702 // if aDocName isn't initialized, allow
703 if ( m_aDocName.isEmpty() )
704 return true;
705
706 if ( !pDocSh )
707 return false;
708
709 // default: allow only same document (overridden in function dialog)
710 return m_aDocName==pDocSh->GetTitle();
711}
712
714{
716}
717
718bool ScRefHandler::DoClose( sal_uInt16 nId )
719{
721 return true;
722}
723
725{
727}
728
730{
732}
733
735{
736 // override this for multi-references
737}
738
740{
741 // the default is that the sheet can be switched during while the reference is edited
742
743 return false;
744}
745
746// RefInputStart/Done: Zoom-In (AutoHide) on single field
747// (using button or movement)
748
750{
751 m_aHelper.RefInputStart( pEdit, pButton );
752}
753
755{
756 m_aHelper.ToggleCollapsed( pEdit, pButton );
757}
758
759bool ScRefHandler::ParseWithNames( ScRangeList& rRanges, std::u16string_view rStr, const ScDocument& rDoc )
760{
761 return m_aHelper.ParseWithNames( rRanges, rStr, rDoc );
762}
763
764void ScRefHandler::HideReference( bool bDoneRefMode )
765{
766 m_aHelper.HideReference( bDoneRefMode );
767}
768
769void ScRefHandler::ShowReference(const OUString& rStr)
770{
772}
773
775{
776 m_aHelper.ReleaseFocus( pEdit );
777}
778
779void ScRefHandler::RefInputDone( bool bForced )
780{
781 m_aHelper.RefInputDone( bForced );
782}
783
784/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScRefFlags
Definition: address.hxx:158
IMPL_LINK_NOARG(ScFormulaReferenceHelper, ActivateHdl, weld::Widget &, bool)
Definition: anyrefdg.cxx:337
static void lcl_InvalidateWindows()
Definition: anyrefdg.cxx:540
static void lcl_HideAllReferences()
Definition: anyrefdg.cxx:571
SfxApplication * SfxGetpApp()
virtual void SetReference(const ScRange &rRef, ScDocument &rDoc)=0
virtual void RefInputStart(formula::RefEdit *pEdit, formula::RefButton *pButton=nullptr)=0
virtual void RefInputDone(bool bForced=false)=0
SCTAB Tab() const
Definition: address.hxx:283
SCROW Row() const
Definition: address.hxx:274
void SetTab(SCTAB nTabP)
Definition: address.hxx:295
SCCOL Col() const
Definition: address.hxx:279
static ScViewData * GetViewData()
Definition: docsh4.cxx:2592
SC_DLLPUBLIC formula::FormulaGrammar::AddressConvention GetAddressConvention() const
Definition: documen3.cxx:494
SC_DLLPUBLIC formula::FormulaGrammar::Grammar GetGrammar() const
Definition: document.hxx:1008
weld::Dialog * m_pDialog
Definition: anyrefdg.hxx:40
void HideReference(bool bDoneRefMode=true)
Definition: anyrefdg.cxx:233
::std::unique_ptr< ScCompiler > m_pRefComp
Definition: anyrefdg.hxx:37
void ShowFormulaReference(const OUString &rStr)
Definition: anyrefdg.cxx:176
static void ViewShellChanged()
Definition: anyrefdg.cxx:500
static void enableInput(bool _bInput)
Definition: anyrefdg.cxx:78
bool ParseWithNames(ScRangeList &rRanges, std::u16string_view rStr, const ScDocument &rDoc)
Definition: anyrefdg.cxx:141
SfxBindings * m_pBindings
Definition: anyrefdg.hxx:41
void ToggleCollapsed(formula::RefEdit *pEdit, formula::RefButton *pButton)
Definition: anyrefdg.cxx:403
static void EnableSpreadsheets(bool bFlag=true)
Definition: anyrefdg.cxx:506
void SetDispatcherLock(bool bLock)
Definition: anyrefdg.cxx:460
formula::RefButton * m_pRefBtn
Definition: anyrefdg.hxx:39
void DoClose(sal_uInt16 nId)
Definition: anyrefdg.cxx:423
void SetDialog(weld::Dialog *pDialog)
Definition: anyrefdg.hxx:68
void RefInputStart(formula::RefEdit *pEdit, formula::RefButton *pButton)
Definition: anyrefdg.cxx:372
IAnyRefDialog * m_pDlg
Definition: anyrefdg.hxx:36
formula::RefEdit * m_pRefEdit
Definition: anyrefdg.hxx:38
void ShowSimpleReference(std::u16string_view rStr)
Definition: anyrefdg.cxx:112
bool CanInputDone(bool bForced) const
Definition: anyrefdg.hxx:78
ScFormulaReferenceHelper(IAnyRefDialog *_pDlg, SfxBindings *_pBindings)
Definition: anyrefdg.cxx:47
void ReleaseFocus(formula::RefEdit *pEdit)
Definition: anyrefdg.cxx:285
~ScFormulaReferenceHelper() COVERITY_NOEXCEPT_FALSE
Definition: anyrefdg.cxx:60
void ShowReference(const OUString &rStr)
Definition: anyrefdg.cxx:261
void RefInputDone(bool bForced)
Definition: anyrefdg.cxx:345
void ResetDelayTimer()
Definition: inputhdl.cxx:4348
static void SendReferenceMarks(const SfxViewShell *pViewShell, const std::vector< ReferenceMark > &rReferenceMarks)
Definition: inputhdl.cxx:309
void NotifyChange(const ScInputHdlState *pState, bool bForce=false, ScTabViewShell *pSourceSh=nullptr, bool bStopEditing=true)
Definition: inputhdl.cxx:4134
bool GetRangeFinder() const
Definition: inputopt.hxx:53
static Color GetColorName(const size_t nIndex)
Definition: rfindlst.cxx:48
ScRange & front()
Definition: rangelst.hxx:92
void RemoveAll()
Definition: rangelst.cxx:1101
bool empty() const
Definition: rangelst.hxx:88
void push_back(const ScRange &rRange)
Definition: rangelst.cxx:1137
size_t size() const
Definition: rangelst.hxx:89
static bool MakeRangeFromName(const OUString &rName, const ScDocument &rDoc, SCTAB nCurTab, ScRange &rRange, RutlNameScope eScope=RUTL_NAMES, ScAddress::Details const &rDetails=ScAddress::detailsOOOa1, bool bUseDetailsPos=false)
Definition: rangeutl.cxx:233
ScAddress aEnd
Definition: address.hxx:498
ScRefFlags ParseAny(const OUString &, const ScDocument &, const ScAddress::Details &rDetails=ScAddress::detailsOOOa1)
Definition: address.cxx:1733
ScAddress aStart
Definition: address.hxx:497
virtual void RefInputStart(formula::RefEdit *pEdit, formula::RefButton *pButton=nullptr) override
Definition: anyrefdg.cxx:749
weld::DialogController * m_pController
Definition: anyrefdg.hxx:83
bool ParseWithNames(ScRangeList &rRanges, std::u16string_view rStr, const ScDocument &pDoc)
Definition: anyrefdg.cxx:759
virtual bool IsRefInputMode() const override
Definition: anyrefdg.cxx:713
virtual void RefInputDone(bool bForced=false) override
Definition: anyrefdg.cxx:779
virtual void ToggleCollapsed(formula::RefEdit *pEdit, formula::RefButton *pButton) override
Definition: anyrefdg.cxx:754
OUString m_aDocName
Definition: anyrefdg.hxx:91
ScRefHandler(SfxDialogController &rController, SfxBindings *pB, bool bBindRef)
Definition: anyrefdg.cxx:581
virtual void AddRefEntry() override
Definition: anyrefdg.cxx:734
bool EnterRefMode()
Definition: anyrefdg.cxx:592
ScFormulaReferenceHelper m_aHelper
Definition: anyrefdg.hxx:88
void disposeRefHandler()
Definition: anyrefdg.cxx:648
virtual void SetActive() override=0
void SwitchToDocument()
Definition: anyrefdg.cxx:673
virtual bool IsTableLocked() const override
Definition: anyrefdg.cxx:739
bool DoClose(sal_uInt16 nId)
Definition: anyrefdg.cxx:718
bool m_bInRefMode
Definition: anyrefdg.hxx:84
bool LeaveRefMode()
Definition: anyrefdg.cxx:655
virtual void ShowReference(const OUString &rStr) override
Definition: anyrefdg.cxx:769
virtual ~ScRefHandler() COVERITY_NOEXCEPT_FALSE override
Definition: anyrefdg.cxx:643
virtual bool IsDocAllowed(SfxObjectShell *pDocSh) const override
Definition: anyrefdg.cxx:700
virtual void ViewShellChanged() override
Definition: anyrefdg.cxx:729
SfxBindings * m_pMyBindings
Definition: anyrefdg.hxx:89
virtual void ReleaseFocus(formula::RefEdit *pEdit) override
Definition: anyrefdg.cxx:774
virtual void HideReference(bool bDoneRefMode=true) override
Definition: anyrefdg.cxx:764
void SetDispatcherLock(bool bLock)
Definition: anyrefdg.cxx:724
void UpdateInputHandler(bool bForce=false, bool bStopEditing=true)
Definition: tabvwsha.cxx:666
static ScTabViewShell * GetActiveViewShell()
Definition: tabvwsh4.cxx:1075
void AddHighlightRange(const ScRange &rRange, const Color &rColor)
Definition: tabview3.cxx:2528
void DoneRefMode(bool bContinue=false)
Definition: tabview4.cxx:159
void ClearHighlightRanges()
Definition: tabview3.cxx:2538
SC_DLLPUBLIC void MoveCursorAbs(SCCOL nCurX, SCROW nCurY, ScFollowMode eMode, bool bShift, bool bControl, bool bKeepOld=false, bool bKeepSel=false)
Definition: tabview3.cxx:1194
ScViewData & GetViewData()
Definition: tabview.hxx:333
void ActiveGrabFocus()
Definition: tabview.cxx:901
SC_DLLPUBLIC void SetTabNo(SCTAB nTab, bool bNew=false, bool bExtendSelection=false, bool bSameTabButMoved=false)
Definition: tabview3.cxx:1802
void EnableRefInput(bool bFlag)
Definition: tabview.cxx:2228
SCTAB GetTabNo() const
Definition: viewdata.hxx:395
ScDocument & GetDocument() const
Definition: viewdata.hxx:380
ScTabViewShell * GetViewShell() const
Definition: viewdata.hxx:357
SCROW GetCurY() const
Definition: viewdata.hxx:402
SCCOL GetCurX() const
Definition: viewdata.hxx:401
SfxDispatcher * GetDispatcher() const
vcl::Window * GetWindow() const
SfxViewFrame * GetFrame() const
void Lock(bool bLock)
bool IsInPlace() const
static SfxObjectShell * GetNext(const SfxObjectShell &rPrev, const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
OUString GetTitle(sal_uInt16 nMaxLen=0) const
static SfxObjectShell * GetFirst(const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
SfxViewShell * GetViewShell() const
static SfxViewFrame * Current()
bool HasChildWindow(sal_uInt16)
static SfxViewFrame * GetNext(const SfxViewFrame &rPrev, const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
SfxDispatcher * GetDispatcher()
SfxChildWindow * GetChildWindow(sal_uInt16)
static SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
SfxFrame & GetFrame() const
virtual SfxObjectShell * GetObjectShell() override
static SfxViewShell * GetNext(const SfxViewShell &rPrev, bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
static SfxViewShell * GetFirst(bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
virtual SfxObjectShell * GetObjectShell() override
vcl::Window * GetWindow() const
virtual const ScSingleRefData * GetSingleRef() const
StackVar GetType() const
virtual const ScComplexRefData * GetDoubleRef() const
void SetActivateHdl(const Link< weld::Widget &, bool > &rLink)
weld::Button * GetWidget() const
weld::Label * GetLabelWidgetForShrinkMode()
weld::Entry * GetWidget() const
void SetActivateHdl(const Link< weld::Widget &, bool > &rLink)
OUString GetText() const
vcl::Window * GetParent() const
void Enable(bool bEnable=true, bool bChild=true)
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
void EnableInput(bool bEnable=true, bool bChild=true)
virtual Dialog * getDialog()=0
virtual void collapse(weld::Widget *pEdit, weld::Widget *pButton)=0
virtual void undo_collapse()=0
virtual bool get_visible() const=0
virtual void set_title(const OUString &rTitle)=0
virtual OUString get_title() const=0
sal_Int32 nIndex
void * p
OString stripEnd(const OString &rIn, char c)
int i
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
sal_Int16 nId
@ RUTL_NAMES
Definition: rangeutl.hxx:38
#define SC_MOD()
Definition: scmod.hxx:249
Complex reference (a range) into the sheet.
Definition: refdata.hxx:123
SC_DLLPUBLIC ScRange toAbs(const ScSheetLimits &rLimits, const ScAddress &rPos) const
Definition: refdata.cxx:493
Single reference (one address) into the sheet.
Definition: refdata.hxx:30
ScAddress toAbs(const ScSheetLimits &rLimits, const ScAddress &rPos) const
Definition: refdata.cxx:193
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17
@ SC_FOLLOW_JUMP
Definition: viewdata.hxx:52