36 : GenericDialogController(pWindow,
"modules/simpress/ui/customslideshows.ui",
"CustomSlideShows")
38 , pCustomShowList(nullptr)
39 , m_xLbCustomShows(m_xBuilder->weld_tree_view(
"customshowlist"))
40 , m_xBtnNew(m_xBuilder->weld_button(
"new"))
41 , m_xBtnEdit(m_xBuilder->weld_button(
"edit"))
42 , m_xBtnRemove(m_xBuilder->weld_button(
"delete"))
43 , m_xBtnCopy(m_xBuilder->weld_button(
"copy"))
44 , m_xBtnStartShow(m_xBuilder->weld_button(
"startshow"))
65 pCustomShow !=
nullptr;
85 bool bEnable =
nPos != -1;
102 SelectHdl(&rListBox);
110 std::unique_ptr<SdCustomShow> pCustomShow;
134 std::unique_ptr<SdCustomShow>& pCustomShow = (*pCustomShowList)[
nPos ];
164 OUString
aStr( pShow->GetName() );
165 OUString aStrCopy(
SdResId( STR_COPY_CUSTOMSHOW ) );
167 sal_Int32 nStrPos =
aStr.indexOf( aStrCopy );
171 aStr +=
" (" + aStrCopy + OUString::number( nNum ) +
")";
172 nStrPos =
aStr.indexOf( aStrCopy );
174 nStrPos = nStrPos + aStrCopy.getLength();
176 if( nStrPos >=
aStr.getLength() )
178 aStr +=
" " + OUString::number( nNum );
182 bool bDifferent =
false;
188 pCustomShow !=
nullptr && bDifferent;
191 if(
aStr == pCustomShow->GetName() )
199 while( pCharClass->isDigit(
aStr, nStrPos ) )
200 aStr =
aStr.replaceAt( nStrPos, 1,
u"" );
201 aStr =
aStr.subView( 0, nStrPos) + OUString::number( ++nNum ) +
aStr.subView( nStrPos);
206 pShow->SetName(
aStr );
208 auto pShowTmp = pShow.get();
242 : GenericDialogController(pWindow,
"modules/simpress/ui/definecustomslideshow.ui",
"DefineCustomSlideShow")
246 , m_xEdtName(m_xBuilder->weld_entry(
"customname"))
247 , m_xLbPages(m_xBuilder->weld_tree_view(
"pages"))
248 , m_xBtnAdd(m_xBuilder->weld_button(
"add"))
249 , m_xBtnRemove(m_xBuilder->weld_button(
"remove"))
250 , m_xLbCustomPages(m_xBuilder->weld_tree_view(
"custompages"))
251 , m_xDropTargetHelper(new
weld::ReorderingDropTarget(*m_xLbCustomPages))
252 , m_xBtnOK(m_xBuilder->weld_button(
"ok"))
263 m_xLbPages->set_selection_mode(SelectionMode::Multiple);
309 bool bPages =
m_xLbPages->count_selected_rows() > 0;
320 ClickButtonHdl2(&rWidget);
325 ClickButtonHdl2(&rWidget);
330 ClickButtonHdl2(&rListBox);
335 ClickButtonHdl2(&rEdit);
388 bool bDifferent =
false;
440 bool bDifferent =
true;
442 if( pCustomShowList )
444 OUString
aName( m_xEdtName->get_text() );
448 for( pCustomShow = pCustomShowList->
First();
449 pCustomShow !=
nullptr;
450 pCustomShow = pCustomShowList->
Next() )
455 pCustomShowList->
Seek( nPosToSelect );
467 VclMessageType::Warning, VclButtonsType::Ok,
468 SdResId(STR_WARN_NAME_DUPLICATE)));
470 m_xEdtName->grab_focus();
Reference< XExecutableDialog > m_xDialog
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
std::unique_ptr< weld::Button > m_xBtnEdit
bool IsCustomShow() const
std::unique_ptr< weld::Button > m_xBtnRemove
SdCustomShowDlg(weld::Window *pWindow, SdDrawDocument &rDrawDoc)
std::unique_ptr< weld::Button > m_xBtnCopy
std::unique_ptr< weld::TreeView > m_xLbCustomShows
std::unique_ptr< weld::Button > m_xBtnStartShow
void SelectHdl(void const *)
SdCustomShowList * pCustomShowList
virtual ~SdCustomShowDlg() override
std::unique_ptr< weld::Button > m_xBtnNew
void push_back(std::unique_ptr< SdCustomShow > p)
sal_uInt16 GetCurPos() const
void erase(std::vector< std::unique_ptr< SdCustomShow > >::iterator it)
void Seek(sal_uInt16 nNewPos)
std::vector< std::unique_ptr< SdCustomShow > >::iterator begin()
const OUString & GetName() const
SdDefineCustomShowDlg(weld::Window *pWindow, SdDrawDocument &rDrawDoc, std::unique_ptr< SdCustomShow > &rpCS)
std::unique_ptr< weld::TreeView > m_xLbPages
std::unique_ptr< weld::Button > m_xBtnOK
std::unique_ptr< SdCustomShow > & rpCustomShow
std::unique_ptr< weld::Entry > m_xEdtName
std::unique_ptr< weld::Button > m_xBtnAdd
void ClickButtonHdl2(void const *)
std::unique_ptr< weld::Button > m_xBtnRemove
void CheckCustomShow()
Checks the page pointer of the Show since entries can be moved and copied by TreeLB.
std::unique_ptr< weld::TreeView > m_xLbCustomPages
virtual ~SdDefineCustomShowDlg() override
SdPage * GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const
SdCustomShowList * GetCustomShowList(bool bCreate=false)
SAL_DLLPRIVATE const std::optional< CharClass > & GetCharClass() const
sal_uInt16 GetSdPageCount(PageKind ePgKind) const
const OUString & GetName() const
std::shared_ptr< weld::Dialog > m_xDialog
IMPL_LINK_NOARG(SdCustomShowDlg, StartShowHdl, weld::Button &, void)
IMPL_LINK(SdCustomShowDlg, ClickButtonHdl, weld::Button &, r, void)
#define DBG_ASSERT(sCon, aError)
#define LINK(Instance, Class, Member)
OUString toId(const void *pValue)
OUString SdResId(TranslateId aId)