20#undef SC_DLLIMPLEMENTATION
23#include <document.hxx>
34 : GenericDialogController(pParent,
"modules/scalc/ui/movecopysheet.ui",
"MoveCopySheetDialog")
35 , maDefaultName(
std::move(aDefault))
42 , m_xBtnMove(m_xBuilder->weld_radio_button(
"move"))
43 , m_xBtnCopy(m_xBuilder->weld_radio_button(
"copy"))
44 , m_xFtDoc(m_xBuilder->weld_label(
"toDocumentLabel"))
45 , m_xLbDoc(m_xBuilder->weld_combo_box(
"toDocument"))
46 , m_xLbTable(m_xBuilder->weld_tree_view(
"insertBefore"))
47 , m_xEdTabName(m_xBuilder->weld_entry(
"newName"))
48 , m_xFtWarn(m_xBuilder->weld_label(
"newNameWarn"))
49 , m_xBtnOk(m_xBuilder->weld_button(
"ok"))
50 , m_xUnusedLabel(m_xBuilder->weld_label(
"warnunused"))
51 , m_xEmptyLabel(m_xBuilder->weld_label(
"warnempty"))
52 , m_xInvalidLabel(m_xBuilder->weld_label(
"warninvalid"))
133 if (aNewName.isEmpty())
156 for (
int i = 0;
i < nLast && !bFound; ++
i)
184 return weld::fromId<ScDocument*>(
m_xLbDoc->get_active_id());
214 sal_uInt16 nSelPos = 0;
249 const bool bIsCopyActive =
m_xBtnCopy->get_active();
260 if (&rBtn == m_xBtnCopy.get())
267 const sal_Int32 nDocSel = m_xLbDoc->get_active();
268 const sal_Int32 nDocLast = m_xLbDoc->get_count() - 1;
269 const sal_Int32 nTabSel = m_xLbTable->get_selected_index();
270 const sal_Int32 nTabLast = m_xLbTable->n_children() - 1;
272 nDocument = (nDocSel != nDocLast) ? nDocSel :
SC_DOC_NEW;
274 bCopyTable = m_xBtnCopy->get_active();
280 OUString aCopyName = maDefaultName;
284 if (aCopyName == m_xEdTabName->get_text())
285 m_xEdTabName->set_text(OUString());
291 if (maDefaultName == m_xEdTabName->get_text())
292 m_xEdTabName->set_text(OUString());
304 m_xLbTable->freeze();
311 m_xLbTable->append_text(
aName);
314 m_xLbTable->append_text(
ScResId(STR_MOVE_TO_END));
316 m_xLbTable->select(0);
const SCTAB SC_TAB_APPEND
Reference< XExecutableDialog > m_xDialog
const ScDocument & GetDocument() const
static SC_DLLPUBLIC bool ValidTabName(const OUString &rName)
SC_DLLPUBLIC void CreateValidTabName(OUString &rName) const
SC_DLLPUBLIC bool GetName(SCTAB nTab, OUString &rName) const
SC_DLLPUBLIC SCTAB GetTableCount() const
OUString msStrTabNameInvalid
void EnableRenameTable(bool bFlag)
std::unique_ptr< weld::ComboBox > m_xLbDoc
void GetTabNameString(OUString &rString) const
std::unique_ptr< weld::Label > m_xFtWarn
std::unique_ptr< weld::RadioButton > m_xBtnCopy
OUString msStrTabNameEmpty
sal_uInt16 mnCurrentDocPos
ScMoveTableDlg(weld::Window *pParent, OUString aDefault)
static bool mbRememeberedCopy
std::unique_ptr< weld::TreeView > m_xLbTable
std::unique_ptr< weld::Label > m_xUnusedLabel
ScDocument * GetSelectedDoc()
std::unique_ptr< weld::Button > m_xBtnOk
OUString msStrTabNameUsed
const OUString maDefaultName
std::unique_ptr< weld::Entry > m_xEdTabName
std::unique_ptr< weld::Label > m_xEmptyLabel
std::unique_ptr< weld::Label > m_xFtDoc
std::unique_ptr< weld::RadioButton > m_xBtnMove
std::unique_ptr< weld::Label > m_xInvalidLabel
virtual ~ScMoveTableDlg() override
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)
static SAL_WARN_UNUSED_RESULT SfxObjectShell * Current()
#define LINK(Instance, Class, Member)
IMPL_LINK_NOARG(ScMoveTableDlg, OkHdl, weld::Button &, void)
IMPL_LINK(ScMoveTableDlg, CheckBtnHdl, weld::Toggleable &, rBtn, void)
OUString toId(const void *pValue)
OUString ScResId(TranslateId aId)