25#include <document.hxx>
38 "MultipleOperationsDialog")
39 , theFormulaCell(rCursorPos)
41 , nCurTab(theFormulaCell.
Tab())
42 , bDlgLostFocus(false)
43 , errMsgNoFormula(
ScResId(STR_NOFORMULASPECIFIED))
44 , errMsgNoColRow(
ScResId(STR_NOCOLROW))
45 , errMsgWrongFormula(
ScResId(STR_WRONGFORMULA))
46 , errMsgWrongRowCol(
ScResId(STR_WRONGROWCOL))
47 , errMsgNoColFormula(
ScResId(STR_NOCOLFORMULA))
48 , errMsgNoRowFormula(
ScResId(STR_NOROWFORMULA))
49 , m_pEdActive(nullptr)
50 , m_xFtFormulaRange(m_xBuilder->weld_label(
"formulasft"))
51 , m_xEdFormulaRange(new
formula::RefEdit(m_xBuilder->weld_entry(
"formulas")))
52 , m_xRBFormulaRange(new
formula::RefButton(m_xBuilder->weld_button(
"formulasref")))
53 , m_xFtRowCell(m_xBuilder->weld_label(
"rowft"))
54 , m_xEdRowCell(new
formula::RefEdit(m_xBuilder->weld_entry(
"row")))
55 , m_xRBRowCell(new
formula::RefButton(m_xBuilder->weld_button(
"rowref")))
56 , m_xFtColCell(m_xBuilder->weld_label(
"colft"))
57 , m_xEdColCell(new
formula::RefEdit(m_xBuilder->weld_entry(
"col")))
58 , m_xRBColCell(new
formula::RefButton(m_xBuilder->weld_button(
"colref")))
59 , m_xBtnOk(m_xBuilder->weld_button(
"ok"))
60 , m_xBtnCancel(m_xBuilder->weld_button(
"cancel"))
109 DoClose( ScTabOpDlgWrapper::GetChildWindowId() );
205 VclMessageType::Error, VclButtonsType::OkCancel, *pMsg));
215 if ( rString.indexOf(
':') != -1 )
229 if (&rBtn == m_xBtnOk.get())
232 sal_uInt16 nError = 0;
240 if (m_xEdFormulaRange->GetText().isEmpty())
242 else if (m_xEdRowCell->GetText().isEmpty() &&
243 m_xEdColCell->GetText().isEmpty())
245 else if ( !
lcl_Parse( m_xEdFormulaRange->GetText(), *pDoc, nCurTab,
246 theFormulaCell, theFormulaEnd ) )
251 if (!m_xEdRowCell->GetText().isEmpty())
258 if (m_xEdColCell->GetText().isEmpty() &&
259 theFormulaCell.Col() != theFormulaEnd.Col())
265 if (!m_xEdColCell->GetText().isEmpty())
276 theFormulaCell, eConv );
278 else if (theFormulaCell.Row() != theFormulaEnd.Row())
287 RaiseError(
static_cast<ScTabOpErr>(nError) );
290 ScTabOpParam aOutParam(theFormulaCell, theFormulaEnd, theRowCell, theColCell,
eMode);
293 SetDispatcherLock(
false );
296 SfxCallMode::SLOT | SfxCallMode::RECORD,
301 else if (&rBtn == m_xBtnCancel.get())
307 if (&rCtrl == m_xEdFormulaRange.get())
308 m_pEdActive = m_xEdFormulaRange.get();
309 else if (&rCtrl == m_xEdRowCell.get())
310 m_pEdActive = m_xEdRowCell.get();
311 else if (&rCtrl == m_xEdColCell.get())
312 m_pEdActive = m_xEdColCell.get();
314 m_pEdActive =
nullptr;
317 m_pEdActive->SelectAll();
322 if (&rCtrl == m_xRBFormulaRange.get())
323 m_pEdActive = m_xEdFormulaRange.get();
324 else if (&rCtrl == m_xRBRowCell.get())
325 m_pEdActive = m_xEdRowCell.get();
326 else if (&rCtrl == m_xRBColCell.get())
327 m_pEdActive = m_xEdColCell.get();
329 m_pEdActive =
nullptr;
332 m_pEdActive->SelectAll();
337 bDlgLostFocus = !
m_xDialog->has_toplevel_focus();
342 bDlgLostFocus = !
m_xDialog->has_toplevel_focus();
bool ConvertSingleRef(const ScDocument &rDoc, const OUString &rRefString, SCTAB nDefTab, ScRefAddress &rRefAddress, const ScAddress::Details &rDetails, ScAddress::ExternalInfo *pExtInfo)
bool ConvertDoubleRef(const ScDocument &rDoc, const OUString &rRefString, SCTAB nDefTab, ScRefAddress &rStartRefAddress, ScRefAddress &rEndRefAddress, const ScAddress::Details &rDetails, ScAddress::ExternalInfo *pExtInfo)
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
OUString Format(const ScDocument &rDocument, ScRefFlags nFlags=ScRefFlags::ZERO, const ScAddress::Details &rDetails=ScAddress::detailsOOOa1, bool bFullAddressNotation=false) const
Returns string with formatted cell range from aStart to aEnd, according to provided address conventio...
void Set(const ScAddress &rAdr, bool bNewRelCol, bool bNewRelRow, bool bNewRelTab)
virtual void RefInputStart(formula::RefEdit *pEdit, formula::RefButton *pButton=nullptr) override
virtual void RefInputDone(bool bForced=false) override
bool DoClose(sal_uInt16 nId)
std::unique_ptr< formula::RefEdit > m_xEdColCell
const OUString errMsgNoColRow
const OUString errMsgWrongRowCol
const OUString errMsgWrongFormula
std::unique_ptr< weld::Button > m_xBtnCancel
std::unique_ptr< weld::Label > m_xFtRowCell
virtual void Close() override
std::unique_ptr< weld::Label > m_xFtFormulaRange
ScRefAddress theFormulaEnd
std::unique_ptr< formula::RefButton > m_xRBRowCell
formula::RefEdit * m_pEdActive
ScTabOpDlg(SfxBindings *pB, SfxChildWindow *pCW, weld::Window *pParent, ScDocument *pDocument, const ScRefAddress &rCursorPos)
const OUString errMsgNoRowFormula
std::unique_ptr< formula::RefEdit > m_xEdRowCell
virtual void SetReference(const ScRange &rRef, ScDocument &rDoc) override
std::unique_ptr< formula::RefButton > m_xRBFormulaRange
std::unique_ptr< formula::RefButton > m_xRBColCell
const OUString errMsgNoColFormula
std::unique_ptr< weld::Button > m_xBtnOk
virtual ~ScTabOpDlg() override
virtual void SetActive() override
ScRefAddress theFormulaCell
std::unique_ptr< weld::Label > m_xFtColCell
std::unique_ptr< formula::RefEdit > m_xEdFormulaRange
const OUString errMsgNoFormula
void RaiseError(ScTabOpErr 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)
Parameter for data table aka multiple operations.
IMPL_LINK(ScTabOpDlg, BtnHdl, weld::Button &, rBtn, void)
static bool lcl_Parse(const OUString &rString, const ScDocument &rDoc, SCTAB nCurTab, ScRefAddress &rStart, ScRefAddress &rEnd)
IMPL_LINK_NOARG(ScTabOpDlg, LoseEditFocusHdl, formula::RefEdit &, void)