Kaydet (Commit) d6e4c97c authored tarafından Caolán McNamara's avatar Caolán McNamara

remove newly unused SfxTabDialog

Change-Id: Iebbfe2ab66ff6e058c90c85de747f549cbc36aa5
Reviewed-on: https://gerrit.libreoffice.org/73156
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 389491ae
......@@ -362,7 +362,6 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, StartFolderPickerHdl, void*, void)
}
}
IMPL_LINK( SvxJavaOptionsPage, DialogClosedHdl, DialogClosedEvent*, pEvt, void )
{
if ( RET_OK == pEvt->DialogResult )
......@@ -373,10 +372,9 @@ IMPL_LINK( SvxJavaOptionsPage, DialogClosedHdl, DialogClosedEvent*, pEvt, void )
}
}
IMPL_LINK_NOARG( SvxJavaOptionsPage, ExpertConfigHdl_Impl, Button*, void )
IMPL_STATIC_LINK( SvxJavaOptionsPage, ExpertConfigHdl_Impl, Button*, pButton, void )
{
ScopedVclPtrInstance< CuiAboutConfigTabPage > pExpertConfigDlg(GetTabDialog());
ScopedVclPtrInstance< CuiAboutConfigTabPage > pExpertConfigDlg(pButton->GetParentDialog());
pExpertConfigDlg->Reset();//initialize and reset function
if( RET_OK == pExpertConfigDlg->Execute() )
......@@ -387,7 +385,6 @@ IMPL_LINK_NOARG( SvxJavaOptionsPage, ExpertConfigHdl_Impl, Button*, void )
pExpertConfigDlg.disposeAndClear();
}
void SvxJavaOptionsPage::ClearJavaInfo()
{
#if HAVE_FEATURE_JAVA
......
......@@ -98,7 +98,7 @@ private:
DECL_LINK( StartFolderPickerHdl, void *, void );
DECL_LINK( DialogClosedHdl, css::ui::dialogs::DialogClosedEvent*, void );
DECL_LINK( ExpertConfigHdl_Impl, Button*, void);
DECL_STATIC_LINK(SvxJavaOptionsPage, ExpertConfigHdl_Impl, Button*, void);
void ClearJavaInfo();
void ClearJavaList();
......
......@@ -393,15 +393,9 @@ void SvxAreaTabPage::SelectFillType(weld::ToggleButton& rButton, const SfxItemSe
maBox.SelectButton(&rButton);
FillType eFillType = static_cast<FillType>(maBox.GetCurrentButtonPos());
TabPageParent aFillTab(m_xFillTab.get(), GetDialogController());
// TEMP
if (!aFillTab.pController)
aFillTab.pParent = GetParentDialog();
m_pFillTabPage.disposeAndReset(lcl_CreateFillStyleTabPage(eFillType, aFillTab, m_rXFSet));
if (m_pFillTabPage)
{
m_pFillTabPage->SetTabDialog(GetTabDialog());
m_pFillTabPage->SetDialogController(GetDialogController());
}
CreatePage( eFillType , m_pFillTabPage);
}
}
......
......@@ -51,121 +51,6 @@ public:
virtual SfxPoolItem* Clone(SfxItemPool* pToPool = nullptr) const override;
};
class SFX2_DLLPUBLIC SfxTabDialog : public TabDialog
{
private:
friend class SfxTabPage;
friend class SfxTabDialogUIObject;
VclPtr<VclBox> m_pBox;
VclPtr<TabControl> m_pTabCtrl;
VclPtr<PushButton> m_pOKBtn;
VclPtr<PushButton> m_pUserBtn;
VclPtr<CancelButton> m_pCancelBtn;
VclPtr<HelpButton> m_pHelpBtn;
VclPtr<PushButton> m_pResetBtn;
VclPtr<PushButton> m_pBaseFmtBtn;
bool m_bOwnsOKBtn;
bool m_bOwnsCancelBtn;
bool m_bOwnsHelpBtn;
bool m_bOwnsResetBtn;
bool m_bOwnsBaseFmtBtn;
std::unique_ptr<SfxItemSet> m_pSet;
std::unique_ptr<SfxItemSet> m_pOutSet;
std::unique_ptr< TabDlg_Impl > m_pImpl;
std::unique_ptr<sal_uInt16[]> m_pRanges;
sal_uInt16 m_nAppPageId;
bool m_bStandardPushed;
DECL_DLLPRIVATE_LINK(ActivatePageHdl, TabControl*, void );
DECL_DLLPRIVATE_LINK(DeactivatePageHdl, TabControl*, bool );
DECL_DLLPRIVATE_LINK(OkHdl, Button*, void);
DECL_DLLPRIVATE_LINK(ResetHdl, Button*, void);
DECL_DLLPRIVATE_LINK(BaseFmtHdl, Button*, void);
DECL_DLLPRIVATE_LINK(UserHdl, Button*, void);
DECL_DLLPRIVATE_LINK(CancelHdl, Button*, void);
SAL_DLLPRIVATE void Init_Impl();
protected:
virtual short Ok();
// Is deleted in Sfx!
static SfxItemSet* CreateInputItemSet( sal_uInt16 nId );
virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
VclPtr<VclButtonBox> m_pActionArea;
SfxItemSet* m_pExampleSet;
SfxItemSet* GetInputSetImpl();
SfxTabPage* GetTabPage( sal_uInt16 nPageId ) const;
/** prepare to leave the current page. Calls the DeactivatePage method of the current page, (if necessary),
handles the item sets to copy.
@return sal_True if it is allowed to leave the current page, sal_False otherwise
*/
bool PrepareLeaveCurrentPage();
/** save the position of the TabDialog and which tab page is the currently active one
*/
void SavePosAndId();
void SetPageName(sal_uInt16 nPageId, const OString& rName) const;
public:
SfxTabDialog(vcl::Window* pParent,
const OUString& rID, const OUString& rUIXMLDescription,
const SfxItemSet * = nullptr);
virtual ~SfxTabDialog() override;
virtual void dispose() override;
sal_uInt16 AddTabPage( const OString& rName, // Name of the label for the page in the notebook .ui
CreateTabPage pCreateFunc); // != 0
void AddTabPage( sal_uInt16 nId,
const OUString &rRiderText,
CreateTabPage pCreateFunc, // != 0
sal_uInt16 nPos = TAB_APPEND);
void SetCurPageId(sal_uInt16 nId)
{
m_nAppPageId = nId;
}
sal_uInt16 GetCurPageId() const
{
return m_pTabCtrl->GetCurPageId();
}
SfxTabPage* GetCurTabPage() const
{
return GetTabPage(m_pTabCtrl->GetCurPageId());
}
virtual OString GetScreenshotId() const override;
OUString const & GetPageText( sal_uInt16 nPageId ) const
{
return m_pTabCtrl->GetPageText(nPageId);
}
void ShowPage( sal_uInt16 nId );
// may provide local slots converted by Map
const sal_uInt16* GetInputRanges( const SfxItemPool& );
const SfxItemSet* GetOutputItemSet() const { return m_pOutSet.get(); }
short Execute() override;
bool StartExecuteAsync( VclAbstractDialog::AsyncContext &rCtx ) override;
const SfxItemSet* GetExampleSet() const { return m_pExampleSet; }
SAL_DLLPRIVATE void Start_Impl();
virtual FactoryFunction GetUITestFactory() const override;
// Screenshot interface
virtual std::vector<OString> getAllPageUIXMLDescriptions() const override;
virtual bool selectPageByUIXMLDescription(const OString& rUIXMLDescription) override;
};
class SFX2_DLLPUBLIC SfxTabDialogController : public SfxOkDialogController
{
protected:
......@@ -306,10 +191,8 @@ protected:
return static_cast<const T*>(GetOldItem(rSet, sal_uInt16(nSlot), bDeep));
}
SfxTabDialog* GetTabDialog() const;
SfxOkDialogController* GetDialogController() const;
public:
void SetTabDialog(SfxTabDialog* pDialog);
void SetDialogController(SfxOkDialogController* pDialog);
public:
virtual ~SfxTabPage() override;
......
......@@ -291,7 +291,6 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\
sfx2/source/statbar/stbitem \
sfx2/source/styles/StyleManager \
sfx2/source/toolbox/tbxitem \
sfx2/source/uitest/sfx_uiobject \
sfx2/source/view/classificationcontroller \
sfx2/source/view/classificationhelper \
sfx2/source/view/frame \
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <vcl/uitest/uiobject.hxx>
#include <memory>
class SfxTabDialog;
class SfxTabDialogUIObject : public WindowUIObject
{
private:
VclPtr<SfxTabDialog> mxTabDialog;
public:
SfxTabDialogUIObject(const VclPtr<SfxTabDialog>& xTabDialog);
virtual ~SfxTabDialogUIObject() override;
virtual StringMap get_state() override;
virtual void execute(const OUString& rAction,
const StringMap& rParameters) override;
static std::unique_ptr<UIObject> create(vcl::Window* pWindow);
protected:
virtual OUString get_name() const override;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -814,7 +814,7 @@ void SfxDocumentPage::ImplUpdateSignatures()
try
{
xD = security::DocumentDigitalSignatures::createDefault(comphelper::getProcessComponentContext());
xD->setParentWindow(VCLUnoHelper::GetInterface(GetTabDialog()));
xD->setParentWindow(GetDialogController()->getDialog()->GetXWindow());
}
catch ( const css::uno::DeploymentException& )
{
......
This diff is collapsed.
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <memory>
#include <uitest/sfx_uiobject.hxx>
#include <sfx2/tabdlg.hxx>
SfxTabDialogUIObject::SfxTabDialogUIObject(const VclPtr<SfxTabDialog>& xTabDialog):
WindowUIObject(xTabDialog),
mxTabDialog(xTabDialog)
{
}
SfxTabDialogUIObject::~SfxTabDialogUIObject()
{
}
StringMap SfxTabDialogUIObject::get_state()
{
StringMap aMap = WindowUIObject::get_state();
sal_uInt16 nPageId = mxTabDialog->GetCurPageId();
std::vector<sal_uInt16> aPageIds = mxTabDialog->m_pTabCtrl->GetPageIDs();
OUString aStrIds;
OUString aStrNames;
for (auto const& pageId : aPageIds)
{
aStrIds = aStrIds + OUString::number(pageId) + ";";
aStrNames = aStrNames + mxTabDialog->GetPageText(pageId) + ";";
}
aMap["PageIds"] = aStrIds;
aMap["PageNames"] = aStrNames;
aMap["CurrentPageID"] = OUString::number(nPageId);
aMap["CurrentPageText"] = mxTabDialog->GetPageText(nPageId);
return aMap;
}
void SfxTabDialogUIObject::execute(const OUString& rAction,
const StringMap& rParameters)
{
if (rAction != "SELECT")
return;
if (rParameters.find("POS") != rParameters.end())
{
auto itr = rParameters.find("POS");
sal_uInt32 nPos = itr->second.toUInt32();
std::vector<sal_uInt16> aIds = mxTabDialog->m_pTabCtrl->GetPageIDs();
sal_uInt16 nPageId = aIds[nPos];
mxTabDialog->ShowPage(nPageId);
}
else if (rParameters.find("NAME") != rParameters.end())
{
auto itr = rParameters.find("NAME");
OUString aName = itr->second;
std::vector<sal_uInt16> aIds = mxTabDialog->m_pTabCtrl->GetPageIDs();
for (auto const& elem : aIds)
{
if (mxTabDialog->GetPageText(elem) == aName)
{
mxTabDialog->ShowPage(elem);
break;
}
}
}
}
std::unique_ptr<UIObject> SfxTabDialogUIObject::create(vcl::Window* pWindow)
{
SfxTabDialog* pDialog = dynamic_cast<SfxTabDialog*>(pWindow);
assert(pDialog);
return std::unique_ptr<UIObject>(new SfxTabDialogUIObject(pDialog));
}
OUString SfxTabDialogUIObject::get_name() const
{
return OUString("SfxTabDialogUIObject");
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment