27#include <osl/diagnose.h>
34#include <inputwin.hxx>
38#include <compiler.hxx>
41#include <tokenarray.hxx>
49 , m_pRefEdit (nullptr)
52 , m_pBindings(_pBindings)
54 , m_bHighlightRef(false)
132 for (
size_t i = 0, nRanges = aRangeList.
size();
i < nRanges; ++
i )
134 ScRange const & rRangeEntry = aRangeList[
i ];
192 std::unique_ptr<ScTokenArray> pScTokA(
m_pRefComp->CompileString(rStr));
194 if (!(pTabViewShell && pScTokA))
207 while(pToken!=
nullptr)
217 aRange = aRef.
toAbs(rDoc, aPos);
242 if(pTabViewShell!=
nullptr)
254 std::vector<ReferenceMark> aReferenceMarks;
285 m_pDlg->RefInputStart( pEdit );
302 if ( !aRangeList.
empty() )
310 m_pDlg->SetReference( rRange, rDoc );
324 ScAddress aCursorPos( nCol, nRow, nTab );
336 m_pRefEdit->GrabFocus();
337 m_pDlg->RefInputDone(
true);
380 const OUString sLabel = pLabel->get_label();
381 if (!sLabel.isEmpty())
407 m_pDlg->RefInputDone(
true );
411 m_pDlg->RefInputDone(
true );
412 m_pDlg->RefInputStart( pEdit, pButton );
447 SC_MOD()->SetRefDialog(
nId,
false, pMyViewFrm );
449 pSfxApp->Broadcast(
SfxHint( SfxHintId::ScKillEditView ) );
489 pDisp = pViewFrame->GetDispatcher();
578 : m_pController(&rController)
579 , m_bInRefMode(false)
580 , m_aHelper(this, pB)
592 SC_MOD()->InputEnterHandler();
615 if ( !pParentDoc && pScViewShell )
622 OSL_ENSURE( pInputHdl,
"Missing input handler :-/" );
699 if ( m_aDocName.isEmpty() )
706 return m_aDocName==pDocSh->GetTitle();
IMPL_LINK_NOARG(ScFormulaReferenceHelper, ActivateHdl, weld::Widget &, bool)
static void lcl_InvalidateWindows()
static void lcl_HideAllReferences()
SfxApplication * SfxGetpApp()
static ScViewData * GetViewData()
SC_DLLPUBLIC formula::FormulaGrammar::AddressConvention GetAddressConvention() const
SC_DLLPUBLIC formula::FormulaGrammar::Grammar GetGrammar() const
static Color GetColorName(const size_t nIndex)
void push_back(const ScRange &rRange)
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)
ScRefFlags ParseAny(const OUString &, const ScDocument &, const ScAddress::Details &rDetails=ScAddress::detailsOOOa1)
virtual void RefInputStart(formula::RefEdit *pEdit, formula::RefButton *pButton=nullptr) override
weld::DialogController * m_pController
bool ParseWithNames(ScRangeList &rRanges, std::u16string_view rStr, const ScDocument &pDoc)
virtual bool IsRefInputMode() const override
virtual void RefInputDone(bool bForced=false) override
virtual void ToggleCollapsed(formula::RefEdit *pEdit, formula::RefButton *pButton) override
ScRefHandler(SfxDialogController &rController, SfxBindings *pB, bool bBindRef)
virtual void AddRefEntry() override
ScFormulaReferenceHelper m_aHelper
virtual void SetActive() override=0
virtual bool IsTableLocked() const override
bool DoClose(sal_uInt16 nId)
virtual void ShowReference(const OUString &rStr) override
virtual ~ScRefHandler() COVERITY_NOEXCEPT_FALSE override
virtual bool IsDocAllowed(SfxObjectShell *pDocSh) const override
virtual void ViewShellChanged() override
SfxBindings * m_pMyBindings
virtual void ReleaseFocus(formula::RefEdit *pEdit) override
virtual void HideReference(bool bDoneRefMode=true) override
void SetDispatcherLock(bool bLock)
void UpdateInputHandler(bool bForce=false, bool bStopEditing=true)
static ScTabViewShell * GetActiveViewShell()
void AddHighlightRange(const ScRange &rRange, const Color &rColor)
void DoneRefMode(bool bContinue=false)
void ClearHighlightRanges()
SC_DLLPUBLIC void MoveCursorAbs(SCCOL nCurX, SCROW nCurY, ScFollowMode eMode, bool bShift, bool bControl, bool bKeepOld=false, bool bKeepSel=false)
ScViewData & GetViewData()
SC_DLLPUBLIC void SetTabNo(SCTAB nTab, bool bNew=false, bool bExtendSelection=false, bool bSameTabButMoved=false)
void EnableRefInput(bool bFlag)
ScDocument & GetDocument() const
ScTabViewShell * GetViewShell() const
SfxDispatcher * GetDispatcher() const
vcl::Window * GetWindow() const
SfxViewFrame * GetFrame() 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
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 void set_title(const OUString &rTitle)=0
virtual OUString get_title() const=0
#define LINK(Instance, Class, Member)
OString stripEnd(const OString &rIn, char c)
sal_Int32 indexOfAny(std::u16string_view rIn, sal_Unicode const *const pChars, sal_Int32 const nPos)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
Complex reference (a range) into the sheet.
SC_DLLPUBLIC ScRange toAbs(const ScSheetLimits &rLimits, const ScAddress &rPos) const
Single reference (one address) into the sheet.
ScAddress toAbs(const ScSheetLimits &rLimits, const ScAddress &rPos) const