include/sfx2/basedlgs.hxx | 27 -------- sfx2/source/dialog/basedlgs.cxx | 127 ---------------------------------------- 2 files changed, 154 deletions(-)
New commits: commit 623d7a94a57860b0b227e6ebad6d0d3fcaf11333 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Mon Apr 8 12:32:19 2019 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Mon Apr 8 22:24:04 2019 +0200 drop newly unused SfxSingleTabDialog Change-Id: I3b445aba89ce62d7890d387a962f12a7055dc7b4 Reviewed-on: https://gerrit.libreoffice.org/70416 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx index ed7df91b3883..7a29b9f1bd02 100644 --- a/include/sfx2/basedlgs.hxx +++ b/include/sfx2/basedlgs.hxx @@ -203,33 +203,6 @@ struct SingleTabDlgImpl typedef const sal_uInt16* (*GetTabPageRanges)(); // provides international Which values -class SFX2_DLLPUBLIC SfxSingleTabDialog : public SfxModalDialog -{ -public: - SfxSingleTabDialog(vcl::Window *pParent, const SfxItemSet& rOptionsSet, - const OUString& rID = OUString("SingleTabDialog"), - const OUString& rUIXMLDescription = OUString("sfx/ui/singletabdialog.ui")); - - SfxSingleTabDialog(vcl::Window *pParent, const SfxItemSet* pInSet, - const OUString& rID = OUString("SingleTabDialog"), - const OUString& rUIXMLDescription = OUString("sfx/ui/singletabdialog.ui")); - - virtual ~SfxSingleTabDialog() override; - virtual void dispose() override; - - void SetTabPage(SfxTabPage* pTabPage); - SfxTabPage* GetTabPage() const { return pImpl->m_pSfxPage; } - -private: - VclPtr<OKButton> pOKBtn; - VclPtr<CancelButton> pCancelBtn; - VclPtr<HelpButton> pHelpBtn; - - DECL_DLLPRIVATE_LINK(OKHdl_Impl, Button*, void); - - std::unique_ptr<SingleTabDlgImpl> pImpl; -}; - class SFX2_DLLPUBLIC SfxOkDialogController : public SfxDialogController { public: diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx index aed00aa2042a..f6f3e1b5a46a 100644 --- a/sfx2/source/dialog/basedlgs.cxx +++ b/sfx2/source/dialog/basedlgs.cxx @@ -709,133 +709,6 @@ void SfxFloatingWindow::FillInfo(SfxChildWinInfo& rInfo) const rInfo.nFlags |= SfxChildWindowFlags::ZOOMIN; } -// SfxSingleTabDialog ---------------------------------------------------- - -IMPL_LINK_NOARG(SfxSingleTabDialog, OKHdl_Impl, Button*, void) - -/* [Description] - - Ok_Handler; FillItemSet() is called for setting of Page. -*/ - -{ - if ( !GetInputItemSet() ) - { - // TabPage without ItemSet - EndDialog( RET_OK ); - return; - } - - if ( !GetOutputItemSet() ) - { - CreateOutputItemSet( *GetInputItemSet() ); - } - bool bModified = false; - - if ( pImpl->m_pSfxPage->HasExchangeSupport() ) - { - DeactivateRC nRet = pImpl->m_pSfxPage->DeactivatePage( GetOutputSetImpl() ); - if ( nRet != DeactivateRC::LeavePage ) - return; - else - bModified = ( GetOutputItemSet()->Count() > 0 ); - } - else - bModified = pImpl->m_pSfxPage->FillItemSet( GetOutputSetImpl() ); - - if ( bModified ) - { - // Save user data in IniManager. - pImpl->m_pSfxPage->FillUserData(); - OUString sData( pImpl->m_pSfxPage->GetUserData() ); - - OUString sConfigId = OStringToOUString(pImpl->m_pSfxPage->GetConfigId(), - RTL_TEXTENCODING_UTF8); - SvtViewOptions aPageOpt(EViewType::TabPage, sConfigId); - aPageOpt.SetUserItem( USERITEM_NAME, makeAny( sData ) ); - EndDialog( RET_OK ); - } - else - EndDialog(); -} - - -SfxSingleTabDialog::SfxSingleTabDialog(vcl::Window *pParent, const SfxItemSet& rSet, - const OUString& rID, const OUString& rUIXMLDescription) - : SfxModalDialog(pParent, rID, rUIXMLDescription) - , pImpl(new SingleTabDlgImpl) -{ - get(pOKBtn, "ok"); - pOKBtn->SetClickHdl( LINK( this, SfxSingleTabDialog, OKHdl_Impl ) ); - get(pCancelBtn, "cancel"); - get(pHelpBtn, "help"); - SetInputSet( &rSet ); -} - -SfxSingleTabDialog::SfxSingleTabDialog(vcl::Window* pParent, const SfxItemSet* pInSet, - const OUString& rID, const OUString& rUIXMLDescription) - : SfxModalDialog(pParent, rID, rUIXMLDescription) - , pImpl(new SingleTabDlgImpl) -{ - get(pOKBtn, "ok"); - pOKBtn->SetClickHdl( LINK( this, SfxSingleTabDialog, OKHdl_Impl ) ); - get(pCancelBtn, "cancel"); - get(pHelpBtn, "help"); - SetInputSet( pInSet ); -} - -SfxSingleTabDialog::~SfxSingleTabDialog() -{ - disposeOnce(); -} - -void SfxSingleTabDialog::dispose() -{ - pImpl->m_pSfxPage.disposeAndClear(); - pImpl.reset(); - pOKBtn.clear(); - pCancelBtn.clear(); - pHelpBtn.clear(); - SfxModalDialog::dispose(); -} - -/* [Description] - - Insert a (new) TabPage; an existing page is deleted. - The passed on page is initialized with the initially given Itemset - through calling Reset(). -*/ -void SfxSingleTabDialog::SetTabPage(SfxTabPage* pTabPage) -{ - pImpl->m_pSfxPage.disposeAndClear(); - pImpl->m_pSfxPage = pTabPage; - - if ( !pImpl->m_pSfxPage ) - return; - - // First obtain the user data, only then Reset() - OUString sConfigId = OStringToOUString(pImpl->m_pSfxPage->GetConfigId(), RTL_TEXTENCODING_UTF8); - SvtViewOptions aPageOpt(EViewType::TabPage, sConfigId); - Any aUserItem = aPageOpt.GetUserItem( USERITEM_NAME ); - OUString sUserData; - aUserItem >>= sUserData; - pImpl->m_pSfxPage->SetUserData(sUserData); - pImpl->m_pSfxPage->Reset( GetInputItemSet() ); - pImpl->m_pSfxPage->Show(); - - pHelpBtn->Show(Help::IsContextHelpEnabled()); - - // Set TabPage text in the Dialog if there is any - OUString sTitle(pImpl->m_pSfxPage->GetText()); - if (!sTitle.isEmpty()) - SetText(sTitle); - - // Dialog receives the HelpId of TabPage if there is any - OString sHelpId(pImpl->m_pSfxPage->GetHelpId()); - if (!sHelpId.isEmpty()) - SetHelpId(sHelpId); -} - SfxDialogController::SfxDialogController(weld::Widget* pParent, const OUString& rUIFile, const OString& rDialogId) : GenericDialogController(pParent, rUIFile, rDialogId) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits