28#include <document.hxx>
39 , theFormulaCell(aCursorPos)
40 , theVariableCell(aCursorPos)
42 , nCurTab(aCursorPos.
Tab())
43 , bDlgLostFocus(false)
44 , errMsgInvalidVar(
ScResId(STR_INVALIDVAR))
45 , errMsgInvalidForm(
ScResId(STR_INVALIDFORM))
46 , errMsgNoFormula(
ScResId(STR_NOFORMULA))
47 , errMsgInvalidVal(
ScResId(STR_INVALIDVAL))
48 , m_pEdActive(nullptr)
49 , m_xFtFormulaCell(m_xBuilder->weld_label(
"formulatext"))
50 , m_xEdFormulaCell(new
formula::RefEdit(m_xBuilder->weld_entry(
"formulaedit")))
51 , m_xRBFormulaCell(new
formula::RefButton(m_xBuilder->weld_button(
"formulabutton")))
52 , m_xEdTargetVal(m_xBuilder->weld_entry(
"target"))
53 , m_xFtVariableCell(m_xBuilder->weld_label(
"vartext"))
54 , m_xEdVariableCell(new
formula::RefEdit(m_xBuilder->weld_entry(
"varedit")))
55 , m_xRBVariableCell(new
formula::RefButton(m_xBuilder->weld_button(
"varbutton")))
56 , m_xBtnOk(m_xBuilder->weld_button(
"ok"))
57 , m_xBtnCancel(m_xBuilder->weld_button(
"cancel"))
105 DoClose( ScSolverDlgWrapper::GetChildWindowId() );
166 VclMessageType::Warning, VclButtonsType::Ok,
191 if (&rBtn == m_xBtnOk.get())
193 theTargetValStr = m_xEdTargetVal->get_text();
201 ScRefFlags nRes1 = theFormulaCell .Parse( m_xEdFormulaCell->GetText(), *pDoc, eConv );
202 ScRefFlags nRes2 = theVariableCell.Parse( m_xEdVariableCell->GetText(), *pDoc, eConv );
208 if ( CheckTargetValue( theTargetValStr ) )
211 theFormulaCell.Row(),
212 theFormulaCell.Tab());
221 SetDispatcherLock(
false );
225 SfxCallMode::SLOT | SfxCallMode::RECORD,
237 else if (&rBtn == m_xBtnCancel.get())
245 if (&rCtrl == m_xEdFormulaCell.get())
246 m_pEdActive = m_xEdFormulaCell.get();
247 else if (&rCtrl == m_xEdVariableCell.get())
248 m_pEdActive = m_xEdVariableCell.get();
251 m_pEdActive->SelectAll();
256 m_pEdActive =
nullptr;
257 m_xEdTargetVal->select_region(0, -1);
262 if (&rCtrl == m_xRBFormulaCell.get())
263 m_pEdActive = m_xEdFormulaCell.get();
264 else if (&rCtrl == m_xRBVariableCell.get())
265 m_pEdActive = m_xEdVariableCell.get();
268 m_pEdActive->SelectAll();
273 bDlgLostFocus = !
m_xDialog->has_toplevel_focus();
278 bDlgLostFocus = !
m_xDialog->has_toplevel_focus();
Reference< XExecutableDialog > m_xDialog
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
SC_DLLPUBLIC void Format(OStringBuffer &r, ScRefFlags nFlags, const ScDocument *pDocument=nullptr, const Details &rDetails=detailsOOOa1) const
SC_DLLPUBLIC formula::FormulaGrammar::AddressConvention GetAddressConvention() const
SC_DLLPUBLIC SvNumberFormatter * GetFormatTable() const
virtual void RefInputStart(formula::RefEdit *pEdit, formula::RefButton *pButton=nullptr) override
virtual void RefInputDone(bool bForced=false) override
bool DoClose(sal_uInt16 nId)
formula::RefEdit * m_pEdActive
const OUString errMsgInvalidVar
std::unique_ptr< formula::RefEdit > m_xEdFormulaCell
std::unique_ptr< weld::Button > m_xBtnCancel
virtual ~ScSolverDlg() override
std::shared_ptr< weld::MessageDialog > m_xMessageBox
virtual bool IsRefInputMode() const override
std::unique_ptr< weld::Button > m_xBtnOk
std::unique_ptr< formula::RefEdit > m_xEdVariableCell
std::unique_ptr< formula::RefButton > m_xRBVariableCell
const OUString errMsgInvalidVal
const OUString errMsgNoFormula
std::unique_ptr< weld::Label > m_xFtFormulaCell
virtual void SetReference(const ScRange &rRef, ScDocument &rDoc) override
virtual void Close() override
std::unique_ptr< weld::Entry > m_xEdTargetVal
virtual void SetActive() override
ScAddress theVariableCell
bool CheckTargetValue(const OUString &rStrVal)
std::unique_ptr< formula::RefButton > m_xRBFormulaCell
ScSolverDlg(SfxBindings *pB, SfxChildWindow *pCW, weld::Window *pParent, ScDocument *pDocument, const ScAddress &aCursorPos)
const OUString errMsgInvalidForm
std::unique_ptr< weld::Label > m_xFtVariableCell
void RaiseError(ScSolverErr eError)
SfxDispatcher * GetDispatcher() const
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
virtual SfxBindings & GetBindings() override
#define LINK(Instance, Class, Member)
OUString ScResId(TranslateId aId)
IMPL_LINK(ScSolverDlg, BtnHdl, weld::Button &, rBtn, void)
IMPL_LINK_NOARG(ScSolverDlg, GetFocusHdl, weld::Widget &, void)
@ SOLVERR_INVALID_VARIABLE
@ SOLVERR_INVALID_FORMULA
@ SOLVERR_INVALID_TARGETVALUE