10#undef SC_DLLIMPLEMENTATION
18#include <osl/diagnose.h>
21 : GenericDialogController(pParent,
"modules/scalc/ui/dataform.ui",
"DataFormDialog")
22 , pTabViewShell(pTabViewShellOri)
30 , m_xBtnNew(m_xBuilder->weld_button(
"new"))
31 , m_xBtnDelete(m_xBuilder->weld_button(
"delete"))
32 , m_xBtnRestore(m_xBuilder->weld_button(
"restore"))
33 , m_xBtnPrev(m_xBuilder->weld_button(
"prev"))
34 , m_xBtnNext(m_xBuilder->weld_button(
"next"))
35 , m_xBtnClose(m_xBuilder->weld_button(
"close"))
36 , m_xSlider(m_xBuilder->weld_scrolled_window(
"scrollbar", true))
37 , m_xGrid(m_xBuilder->weld_container(
"grid"))
38 , m_xFixedText(m_xBuilder->weld_label(
"label"))
60 bool bNoSelection(
false);
73 if (aColName.isEmpty() && nColWidth)
89 if (aColName.isEmpty() && nColWidth)
113 if (aColName.isEmpty())
128 if (aColName.isEmpty())
146 sal_Int32 nGridRow = 0;
226 if (rEdit.get_value_changed_from_saved())
227 m_xBtnRestore->set_sensitive(
true);
232 ScViewData& rViewData = pTabViewShell->GetViewData();
237 bool bHasData = std::any_of(m_aEntries.begin(), m_aEntries.end(),
238 [](
const std::unique_ptr<ScDataFormFragment>& rElem) { return (rElem != nullptr) && (!rElem->m_xEdit->get_text().isEmpty()); });
243 pTabViewShell->DataFormPutData(nCurrentRow, nStartRow, nStartCol, nEndRow, nEndCol, m_aEntries, aColLength);
245 if (nCurrentRow >= nEndRow + 2)
248 m_xSlider->vadjustment_set_upper(nEndRow - nStartRow + 1);
260 if ( nCurrentRow > nStartRow +1 )
272 if ( nCurrentRow <= nEndRow)
290 ScViewData& rViewData = pTabViewShell->GetViewData();
295 ScRange aRange(nStartCol, nCurrentRow, nTab, nEndCol, nCurrentRow, nTab);
296 pDoc->DeleteRow(aRange);
314 auto nOffset = m_xSlider->vadjustment_get_value();
315 nCurrentRow = nStartRow + nOffset + 1;
344 : m_xBuilder(
Application::CreateBuilder(pGrid,
"modules/scalc/ui/dataformfragment.ui"))
345 ,
m_xLabel(m_xBuilder->weld_label(
"label"))
346 , m_xEdit(m_xBuilder->weld_entry(
"entry"))
349 m_xLabel->set_grid_top_attach(nLine);
351 m_xEdit->set_grid_left_attach(1);
352 m_xEdit->set_grid_top_attach(nLine);
Reference< XExecutableDialog > m_xDialog
void SetDocumentModified()
virtual SfxUndoManager * GetUndoManager() override
SC_DLLPUBLIC sal_uInt16 GetColWidth(SCCOL nCol, SCTAB nTab, bool bHiddenAsZero=true) const
SC_DLLPUBLIC OUString GetString(SCCOL nCol, SCROW nRow, SCTAB nTab, const ScInterpreterContext *pContext=nullptr) const
ScViewData & GetViewData()
ScDocument & GetDocument() const
ScDocShell * GetDocShell() const
ScMarkType GetSimpleArea(SCCOL &rStartCol, SCROW &rStartRow, SCTAB &rStartTab, SCCOL &rEndCol, SCROW &rEndRow, SCTAB &rEndTab) const
std::unique_ptr< weld::Label > m_xLabel
IMPL_LINK_NOARG(ScDataFormDlg, Impl_NewHdl, weld::Button &, void)
IMPL_LINK(ScDataFormDlg, Impl_DataModifyHdl, weld::Entry &, rEdit, void)
#define MAX_DATAFORM_COLS
#define MAX_DATAFORM_ROWS
#define LINK(Instance, Class, Member)