20#undef SC_DLLIMPLEMENTATION
23#include <document.hxx>
31 : GenericDialogController(pParent,
"modules/scalc/ui/movecopysheet.ui",
"MoveCopySheetDialog")
32 , maDefaultName(
std::move(aDefault))
39 , m_xBtnMove(m_xBuilder->weld_radio_button(
"move"))
40 , m_xBtnCopy(m_xBuilder->weld_radio_button(
"copy"))
41 , m_xFtDoc(m_xBuilder->weld_label(
"toDocumentLabel"))
42 , m_xLbDoc(m_xBuilder->weld_combo_box(
"toDocument"))
43 , m_xLbTable(m_xBuilder->weld_tree_view(
"insertBefore"))
44 , m_xEdTabName(m_xBuilder->weld_entry(
"newName"))
45 , m_xFtWarn(m_xBuilder->weld_label(
"newNameWarn"))
46 , m_xBtnOk(m_xBuilder->weld_button(
"ok"))
47 , m_xUnusedLabel(m_xBuilder->weld_label(
"warnunused"))
48 , m_xEmptyLabel(m_xBuilder->weld_label(
"warnempty"))
49 , m_xInvalidLabel(m_xBuilder->weld_label(
"warninvalid"))
130 if (aNewName.isEmpty())
153 for (
int i = 0;
i < nLast && !bFound; ++
i)
181 return weld::fromId<ScDocument*>(
m_xLbDoc->get_active_id());
209 sal_uInt16 nSelPos = 0;
253 if (&rBtn == m_xBtnCopy.get())
260 const sal_Int32 nDocSel = m_xLbDoc->get_active();
261 const sal_Int32 nDocLast = m_xLbDoc->get_count() - 1;
262 const sal_Int32 nTabSel = m_xLbTable->get_selected_index();
263 const sal_Int32 nTabLast = m_xLbTable->n_children() - 1;
265 nDocument = (nDocSel != nDocLast) ? nDocSel :
SC_DOC_NEW;
267 bCopyTable = m_xBtnCopy->get_active();
273 OUString aCopyName = maDefaultName;
277 if (aCopyName == m_xEdTabName->get_text())
278 m_xEdTabName->set_text(OUString());
284 if (maDefaultName == m_xEdTabName->get_text())
285 m_xEdTabName->set_text(OUString());
297 m_xLbTable->freeze();
304 m_xLbTable->append_text(
aName);
307 m_xLbTable->append_text(
ScResId(STR_MOVE_TO_END));
309 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)
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)