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 // Exclude ';' semicolon as it is the separator for ParseWithNames() used
267 // in ShowSimpleReference(). Also sheet separator '.' dot is part of simple
268 // reference (could be array col/row separator as well but then in '{' '}'
269 // braces). Prefer '!' exclamation mark to be intersection operator rather
270 // than Excel sheet separator.
271 if (comphelper::string::indexOfAny( rStr, u"()+-*/^%&=<>~! #[]{},|\\@", 0) != -1)
272 {
274 }
275 else
276 {
278 }
279}
280
282{
283 if( !m_pRefEdit && pEdit )
284 {
285 m_pDlg->RefInputStart( pEdit );
286 }
287
289 if( !pViewShell )
290 return;
291
292 pViewShell->ActiveGrabFocus();
293 if( !m_pRefEdit )
294 return;
295
296 const ScViewData& rViewData = pViewShell->GetViewData();
297 ScDocument& rDoc = rViewData.GetDocument();
298 ScRangeList aRangeList;
299 if( !ParseWithNames( aRangeList, m_pRefEdit->GetText(), rDoc ) )
300 return;
301
302 if ( !aRangeList.empty() )
303 {
304 const ScRange & rRange = aRangeList.front();
305 pViewShell->SetTabNo( rRange.aStart.Tab() );
306 pViewShell->MoveCursorAbs( rRange.aStart.Col(),
307 rRange.aStart.Row(), SC_FOLLOW_JUMP, false, false );
308 pViewShell->MoveCursorAbs( rRange.aEnd.Col(),
309 rRange.aEnd.Row(), SC_FOLLOW_JUMP, true, false );
310 m_pDlg->SetReference( rRange, rDoc );
311 }
312}
313
315{
317 if ( !pViewData )
318 return;
319
320 ScDocument& rDoc = pViewData->GetDocument();
321 SCCOL nCol = pViewData->GetCurX();
322 SCROW nRow = pViewData->GetCurY();
323 SCTAB nTab = pViewData->GetTabNo();
324 ScAddress aCursorPos( nCol, nRow, nTab );
325
326 m_pRefComp.reset( new ScCompiler( rDoc, aCursorPos, rDoc.GetGrammar()) );
327 m_pRefComp->EnableJumpCommandReorder(false);
328 m_pRefComp->EnableStopOnError(false);
329
330 m_nRefTab = nTab;
331}
332
334{
335 if (m_pRefEdit)
336 m_pRefEdit->GrabFocus();
337 m_pDlg->RefInputDone(true);
338 return true;
339}
340
342{
343 if ( !CanInputDone( bForced ) )
344 return;
345
346 if (!m_pDialog)
347 return;
348
349 // Adjust window title
351
352 if (m_pRefEdit)
354
355 // set button image
356 if (m_pRefBtn)
357 {
360 }
361
363
364 m_pRefEdit = nullptr;
365 m_pRefBtn = nullptr;
366}
367
369{
370 if (m_pRefEdit)
371 return;
372
373 m_pRefEdit = pEdit;
374 m_pRefBtn = pButton;
375
376 // Save and adjust window title
379 {
380 const OUString sLabel = pLabel->get_label();
381 if (!sLabel.isEmpty())
382 {
383 const OUString sNewDialogText = m_sOldDialogText + ": " + comphelper::string::stripEnd(sLabel, ':');
384 m_pDialog->set_title(pLabel->strip_mnemonic(sNewDialogText));
385 }
386 }
387
388 m_pDialog->collapse(pEdit->GetWidget(), pButton ? pButton->GetWidget() : nullptr);
389
390 // set button image
391 if (pButton)
392 pButton->SetEndImage();
393
395 if (m_pRefBtn)
397}
398
400{
401 if( !pEdit )
402 return;
403
404 if( m_pRefEdit == pEdit ) // is this the active ref edit field?
405 {
406 m_pRefEdit->GrabFocus(); // before RefInputDone()
407 m_pDlg->RefInputDone( true ); // finish ref input
408 }
409 else
410 {
411 m_pDlg->RefInputDone( true ); // another active ref edit?
412 m_pDlg->RefInputStart( pEdit, pButton ); // start ref input
413 // pRefEdit might differ from pEdit after RefInputStart() (i.e. ScFormulaDlg)
414 if( m_pRefEdit )
416 }
417}
418
420{
421 SfxApplication* pSfxApp = SfxGetpApp();
422
423 SetDispatcherLock( false );
424
426 if ( pViewFrm && pViewFrm->HasChildWindow(FID_INPUTLINE_STATUS) )
427 {
428 // The input row is disabled with ToolBox::Disable disabled, thus it must be
429 // reenabled with ToolBox::Enable (before the AppWindow is enabled)
430 // for the buttons to be drawn as enabled.
431 SfxChildWindow* pChild = pViewFrm->GetChildWindow(FID_INPUTLINE_STATUS);
432 if (pChild)
433 {
434 ScInputWindow* pWin = static_cast<ScInputWindow*>(pChild->GetWindow());
435 pWin->Enable();
436 }
437 }
438
439 // find parent view frame to close dialog
440 SfxViewFrame* pMyViewFrm = nullptr;
441 if ( m_pBindings )
442 {
444 if (pMyDisp)
445 pMyViewFrm = pMyDisp->GetFrame();
446 }
447 SC_MOD()->SetRefDialog( nId, false, pMyViewFrm );
448
449 pSfxApp->Broadcast( SfxHint( SfxHintId::ScKillEditView ) );
450
452 if ( pScViewShell )
453 pScViewShell->UpdateInputHandler(true);
454}
455
457{
459 {
460 // lock / unlock only the dispatchers of Calc documents
461 ScDocShell* pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(checkSfxObjectShell<ScDocShell>));
462 while (pDocShell)
463 {
464 SfxViewFrame* pFrame = SfxViewFrame::GetFirst(pDocShell);
465 while (pFrame)
466 {
467 SfxDispatcher* pDisp = pFrame->GetDispatcher();
468 if (pDisp)
469 pDisp->Lock(bLock);
470 pFrame = SfxViewFrame::GetNext(*pFrame, pDocShell);
471 }
472 pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pDocShell, checkSfxObjectShell<ScDocShell>));
473 }
474 return;
475 // if a new view is created while the dialog is open,
476 // that view's dispatcher is locked when trying to create the dialog
477 // for that view (ScTabViewShell::CreateRefDialog)
478 }
479
480 // lock / unlock only the dispatcher of Calc document
481 SfxDispatcher* pDisp = nullptr;
482 if ( m_pBindings )
483 {
484 pDisp = m_pBindings->GetDispatcher();
485 }
486 else if(SfxViewFrame* pViewFrame = SfxViewFrame::Current())
487 {
488 if (dynamic_cast< ScTabViewShell* >(pViewFrame->GetViewShell()))
489 pDisp = pViewFrame->GetDispatcher();
490 }
491
492 if (pDisp)
493 pDisp->Lock(bLock);
494}
495
497{
498 enableInput( false );
499
501}
503{
504 ScDocShell* pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(checkSfxObjectShell<ScDocShell>));
505 while( pDocShell )
506 {
507 SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocShell );
508 while( pFrame )
509 {
510 // enable everything except InPlace, including bean frames
511 if ( !pFrame->GetFrame().IsInPlace() )
512 {
513 SfxViewShell* p = pFrame->GetViewShell();
514 ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell *>( p );
515 if(pViewSh!=nullptr)
516 {
517 vcl::Window *pWin=pViewSh->GetWindow();
518 if(pWin)
519 {
520 vcl::Window *pParent=pWin->GetParent();
521 if(pParent)
522 {
523 pParent->EnableInput(bFlag,false);
524 pViewSh->EnableRefInput(bFlag);
525 }
526 }
527 }
528 }
529 pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell );
530 }
531
532 pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pDocShell, checkSfxObjectShell<ScDocShell>));
533 }
534}
535
537{
538 ScDocShell* pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(checkSfxObjectShell<ScDocShell>));
539 while( pDocShell )
540 {
541 SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocShell );
542 while( pFrame )
543 {
544 // enable everything except InPlace, including bean frames
545 if ( !pFrame->GetFrame().IsInPlace() )
546 {
547 SfxViewShell* p = pFrame->GetViewShell();
548 ScTabViewShell* pViewSh = dynamic_cast< ScTabViewShell *>( p );
549 if(pViewSh!=nullptr)
550 {
551 vcl::Window *pWin=pViewSh->GetWindow();
552 if(pWin)
553 {
554 vcl::Window *pParent=pWin->GetParent();
555 if(pParent)
556 pParent->Invalidate();
557 }
558 }
559 }
560 pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell );
561 }
562
563 pDocShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pDocShell, checkSfxObjectShell<ScDocShell>));
564 }
565}
566
568{
569 SfxViewShell* pSh = SfxViewShell::GetFirst( true, checkSfxViewShell<ScTabViewShell> );
570 while ( pSh )
571 {
572 static_cast<ScTabViewShell*>(pSh)->ClearHighlightRanges();
573 pSh = SfxViewShell::GetNext( *pSh, true, checkSfxViewShell<ScTabViewShell> );
574 }
575}
576
578 : m_pController(&rController)
579 , m_bInRefMode(false)
580 , m_aHelper(this, pB)
581 , m_pMyBindings(pB)
582{
583 m_aHelper.SetDialog(rController.getDialog());
584
585 if( bBindRef ) EnterRefMode();
586}
587
589{
590 if( m_bInRefMode ) return false;
591
592 SC_MOD()->InputEnterHandler();
593
594 ScTabViewShell* pScViewShell = nullptr;
595
596 // title has to be from the view that opened the dialog,
597 // even if it's not the current view
598
599 SfxObjectShell* pParentDoc = nullptr;
600 if ( m_pMyBindings )
601 {
603 if (pMyDisp)
604 {
605 SfxViewFrame* pMyViewFrm = pMyDisp->GetFrame();
606 if (pMyViewFrm)
607 {
608 pScViewShell = dynamic_cast<ScTabViewShell*>( pMyViewFrm->GetViewShell() );
609 if( pScViewShell )
610 pScViewShell->UpdateInputHandler(true);
611 pParentDoc = pMyViewFrm->GetObjectShell();
612 }
613 }
614 }
615 if ( !pParentDoc && pScViewShell ) // use current only if above fails
616 pParentDoc = pScViewShell->GetObjectShell();
617 if ( pParentDoc )
618 m_aDocName = pParentDoc->GetTitle();
619
620 ScInputHandler* pInputHdl = SC_MOD()->GetInputHdl(pScViewShell);
621
622 OSL_ENSURE( pInputHdl, "Missing input handler :-/" );
623
624 if ( pInputHdl )
625 pInputHdl->NotifyChange( nullptr );
626
628
630
631 m_aHelper.Init();
632
634
635 m_bInRefMode = true;
636 return m_bInRefMode;
637}
638
639ScRefHandler::~ScRefHandler() COVERITY_NOEXCEPT_FALSE
640{
642}
643
645{
646 m_pController = nullptr;
647 LeaveRefMode();
649}
650
652{
653 if( !m_bInRefMode ) return false;
654
656
657 SetDispatcherLock( false );
658
660 if( pScViewShell )
661 pScViewShell->UpdateInputHandler(true);
662
664
665 m_bInRefMode = false;
666 return true;
667}
668
670{
672 if (pCurrent)
673 {
674 SfxObjectShell* pObjSh = pCurrent->GetObjectShell();
675 if ( pObjSh && pObjSh->GetTitle() == m_aDocName )
676 {
677 // right document already visible -> nothing to do
678 return;
679 }
680 }
681
682 SfxViewShell* pSh = SfxViewShell::GetFirst( true, checkSfxViewShell<ScTabViewShell> );
683 while ( pSh )
684 {
685 SfxObjectShell* pObjSh = pSh->GetObjectShell();
686 if ( pObjSh && pObjSh->GetTitle() == m_aDocName )
687 {
688 // switch to first TabViewShell for document
689 static_cast<ScTabViewShell*>(pSh)->SetActive();
690 return;
691 }
692 pSh = SfxViewShell::GetNext( *pSh, true, checkSfxViewShell<ScTabViewShell> );
693 }
694}
695
696bool ScRefHandler::IsDocAllowed(SfxObjectShell* pDocSh) const // pDocSh may be 0
697{
698 // if aDocName isn't initialized, allow
699 if ( m_aDocName.isEmpty() )
700 return true;
701
702 if ( !pDocSh )
703 return false;
704
705 // default: allow only same document (overridden in function dialog)
706 return m_aDocName==pDocSh->GetTitle();
707}
708
710{
712}
713
714bool ScRefHandler::DoClose( sal_uInt16 nId )
715{
717 return true;
718}
719
721{
723}
724
726{
728}
729
731{
732 // override this for multi-references
733}
734
736{
737 // the default is that the sheet can be switched during while the reference is edited
738
739 return false;
740}
741
742// RefInputStart/Done: Zoom-In (AutoHide) on single field
743// (using button or movement)
744
746{
747 m_aHelper.RefInputStart( pEdit, pButton );
748}
749
751{
752 m_aHelper.ToggleCollapsed( pEdit, pButton );
753}
754
755bool ScRefHandler::ParseWithNames( ScRangeList& rRanges, std::u16string_view rStr, const ScDocument& rDoc )
756{
757 return m_aHelper.ParseWithNames( rRanges, rStr, rDoc );
758}
759
760void ScRefHandler::HideReference( bool bDoneRefMode )
761{
762 m_aHelper.HideReference( bDoneRefMode );
763}
764
765void ScRefHandler::ShowReference(const OUString& rStr)
766{
768}
769
771{
772 m_aHelper.ReleaseFocus( pEdit );
773}
774
775void ScRefHandler::RefInputDone( bool bForced )
776{
777 m_aHelper.RefInputDone( bForced );
778}
779
780/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScRefFlags
Definition: address.hxx:158
IMPL_LINK_NOARG(ScFormulaReferenceHelper, ActivateHdl, weld::Widget &, bool)
Definition: anyrefdg.cxx:333
static void lcl_InvalidateWindows()
Definition: anyrefdg.cxx:536
static void lcl_HideAllReferences()
Definition: anyrefdg.cxx:567
SfxApplication * SfxGetpApp()
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:2607
SC_DLLPUBLIC formula::FormulaGrammar::AddressConvention GetAddressConvention() const
Definition: documen3.cxx:492
SC_DLLPUBLIC formula::FormulaGrammar::Grammar GetGrammar() const
Definition: document.hxx:1010
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:496
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:399
static void EnableSpreadsheets(bool bFlag=true)
Definition: anyrefdg.cxx:502
void SetDispatcherLock(bool bLock)
Definition: anyrefdg.cxx:456
formula::RefButton * m_pRefBtn
Definition: anyrefdg.hxx:39
void DoClose(sal_uInt16 nId)
Definition: anyrefdg.cxx:419
void SetDialog(weld::Dialog *pDialog)
Definition: anyrefdg.hxx:68
void RefInputStart(formula::RefEdit *pEdit, formula::RefButton *pButton)
Definition: anyrefdg.cxx:368
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:281
~ScFormulaReferenceHelper() COVERITY_NOEXCEPT_FALSE
Definition: anyrefdg.cxx:60
void ShowReference(const OUString &rStr)
Definition: anyrefdg.cxx:261
void RefInputDone(bool bForced)
Definition: anyrefdg.cxx:341
void ResetDelayTimer()
Definition: inputhdl.cxx:4395
static void SendReferenceMarks(const SfxViewShell *pViewShell, const std::vector< ReferenceMark > &rReferenceMarks)
Definition: inputhdl.cxx:306
void NotifyChange(const ScInputHdlState *pState, bool bForce=false, ScTabViewShell *pSourceSh=nullptr, bool bStopEditing=true)
Definition: inputhdl.cxx:4172
bool GetRangeFinder() const
Definition: inputopt.hxx:53
static Color GetColorName(const size_t nIndex)
Definition: rfindlst.cxx:49
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:745
weld::DialogController * m_pController
Definition: anyrefdg.hxx:83
bool ParseWithNames(ScRangeList &rRanges, std::u16string_view rStr, const ScDocument &pDoc)
Definition: anyrefdg.cxx:755
virtual bool IsRefInputMode() const override
Definition: anyrefdg.cxx:709
virtual void RefInputDone(bool bForced=false) override
Definition: anyrefdg.cxx:775
virtual void ToggleCollapsed(formula::RefEdit *pEdit, formula::RefButton *pButton) override
Definition: anyrefdg.cxx:750
OUString m_aDocName
Definition: anyrefdg.hxx:91
ScRefHandler(SfxDialogController &rController, SfxBindings *pB, bool bBindRef)
Definition: anyrefdg.cxx:577
virtual void AddRefEntry() override
Definition: anyrefdg.cxx:730
bool EnterRefMode()
Definition: anyrefdg.cxx:588
ScFormulaReferenceHelper m_aHelper
Definition: anyrefdg.hxx:88
void disposeRefHandler()
Definition: anyrefdg.cxx:644
virtual void SetActive() override=0
void SwitchToDocument()
Definition: anyrefdg.cxx:669
virtual bool IsTableLocked() const override
Definition: anyrefdg.cxx:735
bool DoClose(sal_uInt16 nId)
Definition: anyrefdg.cxx:714
bool m_bInRefMode
Definition: anyrefdg.hxx:84
bool LeaveRefMode()
Definition: anyrefdg.cxx:651
virtual void ShowReference(const OUString &rStr) override
Definition: anyrefdg.cxx:765
virtual ~ScRefHandler() COVERITY_NOEXCEPT_FALSE override
Definition: anyrefdg.cxx:639
virtual bool IsDocAllowed(SfxObjectShell *pDocSh) const override
Definition: anyrefdg.cxx:696
virtual void ViewShellChanged() override
Definition: anyrefdg.cxx:725
SfxBindings * m_pMyBindings
Definition: anyrefdg.hxx:89
virtual void ReleaseFocus(formula::RefEdit *pEdit) override
Definition: anyrefdg.cxx:770
virtual void HideReference(bool bDoneRefMode=true) override
Definition: anyrefdg.cxx:760
void SetDispatcherLock(bool bLock)
Definition: anyrefdg.cxx:720
void UpdateInputHandler(bool bForce=false, bool bStopEditing=true)
Definition: tabvwsha.cxx:690
static ScTabViewShell * GetActiveViewShell()
Definition: tabvwsh4.cxx:1076
void AddHighlightRange(const ScRange &rRange, const Color &rColor)
Definition: tabview3.cxx:2549
void DoneRefMode(bool bContinue=false)
Definition: tabview4.cxx:159
void ClearHighlightRanges()
Definition: tabview3.cxx:2559
SC_DLLPUBLIC void MoveCursorAbs(SCCOL nCurX, SCROW nCurY, ScFollowMode eMode, bool bShift, bool bControl, bool bKeepOld=false, bool bKeepSel=false)
Definition: tabview3.cxx:1191
ScViewData & GetViewData()
Definition: tabview.hxx:344
void ActiveGrabFocus()
Definition: tabview.cxx:892
SC_DLLPUBLIC void SetTabNo(SCTAB nTab, bool bNew=false, bool bExtendSelection=false, bool bSameTabButMoved=false)
Definition: tabview3.cxx:1819
void EnableRefInput(bool bFlag)
Definition: tabview.cxx:2315
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 SAL_WARN_UNUSED_RESULT SfxObjectShell * GetNext(const SfxObjectShell &rPrev, const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
OUString GetTitle(sal_uInt16 nMaxLen=0) const
static SAL_WARN_UNUSED_RESULT SfxObjectShell * GetFirst(const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
SfxViewShell * GetViewShell() const
static SAL_WARN_UNUSED_RESULT SfxViewFrame * Current()
bool HasChildWindow(sal_uInt16)
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetNext(const SfxViewFrame &rPrev, const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
SfxDispatcher * GetDispatcher()
SfxChildWindow * GetChildWindow(sal_uInt16)
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
SfxFrame & GetFrame() const
virtual SfxObjectShell * GetObjectShell() override
static SAL_WARN_UNUSED_RESULT SfxViewShell * GetNext(const SfxViewShell &rPrev, bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
static SAL_WARN_UNUSED_RESULT 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)
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
float u
sal_Int32 nIndex
void * p
OString stripEnd(const OString &rIn, char c)
sal_Int32 indexOfAny(std::u16string_view rIn, sal_Unicode const *const pChars, sal_Int32 const nPos)
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:247
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