15#include <document.hxx>
24 for (
SCCOL inCol = aStart.
Col(); inCol <= aEnd.
Col(); inCol++)
38 for (
SCROW inRow = aStart.
Row(); inRow <= aEnd.
Row(); inRow++)
53 , mxInputRangeLabel(m_xBuilder->weld_label(
"input-range-label"))
54 , mxInputRangeEdit(new
formula::RefEdit(m_xBuilder->weld_entry(
"input-range-edit")))
55 , mxInputRangeButton(new
formula::RefButton(m_xBuilder->weld_button(
"input-range-button")))
56 , mxOutputRangeLabel(m_xBuilder->weld_label(
"output-range-label"))
57 , mxOutputRangeEdit(new
formula::RefEdit(m_xBuilder->weld_entry(
"output-range-edit")))
58 , mxOutputRangeButton(new
formula::RefButton(m_xBuilder->weld_button(
"output-range-button")))
59 , mxGroupByColumnsRadio(m_xBuilder->weld_radio_button(
"groupedby-columns-radio"))
60 , mxGroupByRowsRadio(m_xBuilder->weld_radio_button(
"groupedby-rows-radio"))
61 , mViewData(rViewData)
62 , mDocument(rViewData.GetDocument())
63 , mInputRange(
ScAddress::INITIALIZE_INVALID)
64 , mAddressDetails(mDocument.GetAddressConvention(), 0, 0)
65 , mOutputAddress(
ScAddress::INITIALIZE_INVALID)
66 , mGroupedBy(BY_COLUMN)
67 , mxButtonOk(m_xBuilder->weld_button(
"ok"))
68 , mxButtonCancel(m_xBuilder->weld_button(
"cancel"))
69 , mpActiveEdit(nullptr)
70 , mCurrentAddress(rViewData.GetCurX(), rViewData.GetCurY(), rViewData.GetTabNo())
71 , mDialogLostFocus(false)
146 if ( rReferenceRange.
aStart != rReferenceRange.
aEnd )
149 OUString aReferenceString;
174 if (&rButton == mxButtonOk.get())
176 CalculateInputAndWriteToOutput();
185 mpActiveEdit =
nullptr;
187 if (&rCtrl == mxInputRangeEdit.get())
188 mpActiveEdit = mxInputRangeEdit.get();
189 if (&rCtrl == mxOutputRangeEdit.get())
190 mpActiveEdit = mxOutputRangeEdit.get();
193 mpActiveEdit->SelectAll();
198 mpActiveEdit =
nullptr;
200 if (&rCtrl == mxInputRangeButton.get())
201 mpActiveEdit = mxInputRangeEdit.get();
202 else if (&rCtrl == mxOutputRangeButton.get())
203 mpActiveEdit = mxOutputRangeEdit.get();
206 mpActiveEdit->SelectAll();
211 mDialogLostFocus = !
m_xDialog->has_toplevel_focus();
216 mDialogLostFocus = !
m_xDialog->has_toplevel_focus();
221 if (mxGroupByColumnsRadio->get_active())
222 mGroupedBy = BY_COLUMN;
223 else if (mxGroupByRowsRadio->get_active())
226 ValidateDialogInput();
233 if (mpActiveEdit == mxInputRangeEdit.get())
236 bool bValid = ParseWithNames( aRangeList, mxInputRangeEdit->GetText(), mDocument);
237 const ScRange* pRange = (bValid && aRangeList.
size() == 1) ? &aRangeList[0] :
nullptr;
240 mInputRange = *pRange;
242 mxInputRangeEdit->StartUpdateData();
249 else if (mpActiveEdit == mxOutputRangeEdit.get())
252 bool bValid = ParseWithNames( aRangeList, mxOutputRangeEdit->GetText(), mDocument);
253 const ScRange* pRange = (bValid && aRangeList.
size() == 1) ? &aRangeList[0] :
nullptr;
256 mOutputAddress = pRange->
aStart;
261 ScRefFlags nFormat = ( mOutputAddress.Tab() == mCurrentAddress.Tab() ) ?
264 OUString aReferenceString = mOutputAddress.Format(nFormat, &mDocument, mDocument.GetAddressConvention());
265 mxOutputRangeEdit->SetRefString( aReferenceString );
269 mxOutputRangeEdit->StartUpdateData();
278 ValidateDialogInput();
Reference< XExecutableDialog > m_xDialog
SC_DLLPUBLIC void Format(OStringBuffer &r, ScRefFlags nFlags, const ScDocument *pDocument=nullptr, const Details &rDetails=detailsOOOa1) const
void PostPaint(SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, PaintPartFlags nPart, sal_uInt16 nExtFlags=0)
virtual SfxUndoManager * GetUndoManager() override
SC_DLLPUBLIC formula::FormulaGrammar::AddressConvention GetAddressConvention() const
void push_back(const ScRange &rRange)
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...
virtual void RefInputStart(formula::RefEdit *pEdit, formula::RefButton *pButton=nullptr) override
virtual void RefInputDone(bool bForced=false) override
ScDocShell * GetDocShell() const
ScTabViewShell * GetViewShell() const
ScMarkType GetSimpleArea(SCCOL &rStartCol, SCROW &rStartRow, SCTAB &rStartTab, SCCOL &rEndCol, SCROW &rEndRow, SCTAB &rEndTab) const
virtual void EnterListAction(const OUString &rComment, const OUString &rRepeatComment, sal_uInt16 nId, ViewShellId nViewShellId)
ViewShellId GetViewShellId() const override
#define LINK(Instance, Class, Member)
OUString ScResId(TranslateId aId)