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

SfxStyleDialog is now unused

Change-Id: I2aa33c6bb53577b84373f7f920f7c6db22cd7cca
Reviewed-on: https://gerrit.libreoffice.org/63975
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 18547e80
......@@ -62,7 +62,6 @@ class SfxManageStyleSheetPage final : public SfxTabPage
std::unique_ptr<weld::Label> m_xDescFt;
std::unique_ptr<weld::Label> m_xNameFt;
friend class SfxStyleDialog;
friend class SfxStyleDialogController;
DECL_LINK(GetFocusHdl, weld::Widget&, void);
......
......@@ -26,26 +26,6 @@
class SfxStyleSheetBase;
class SfxStyleSheetBasePool;
class SFX2_DLLPUBLIC SfxStyleDialog: public SfxTabDialog
{
private:
SfxStyleSheetBase* pStyle;
DECL_DLLPRIVATE_LINK( CancelHdl, Button *, void );
sal_uInt16 m_nOrganizerId;
public:
SfxStyleDialog(vcl::Window* pParent, const OUString& rID,
const OUString& rUIXMLDescription, SfxStyleSheetBase&);
virtual ~SfxStyleDialog() override;
virtual void dispose() override;
SfxStyleSheetBase& GetStyleSheet() { return *pStyle; }
const SfxStyleSheetBase& GetStyleSheet() const { return *pStyle; }
virtual short Ok() override;
};
class SFX2_DLLPUBLIC SfxStyleDialogController : public SfxTabDialogController
{
private:
......
......@@ -48,7 +48,7 @@
*/
SfxManageStyleSheetPage::SfxManageStyleSheetPage(TabPageParent pParent, const SfxItemSet& rAttrSet)
: SfxTabPage(pParent, "sfx/ui/managestylepage.ui", "ManageStylePage", &rAttrSet)
, pStyle(pParent.pPage ? &static_cast<SfxStyleDialogController*>(pParent.pController)->GetStyleSheet() : &static_cast<SfxStyleDialog*>(GetParentDialog())->GetStyleSheet())
, pStyle(&static_cast<SfxStyleDialogController*>(pParent.pController)->GetStyleSheet())
, pItem(nullptr)
, bModified(false)
, aName(pStyle->GetName())
......
......@@ -27,110 +27,6 @@
#include <sfx2/strings.hrc>
// class SfxStyleDialog --------------------------------------------------
SfxStyleDialog::SfxStyleDialog
(
vcl::Window* pParent, // Parent
const OUString& rID, const OUString& rUIXMLDescription,
SfxStyleSheetBase& rStyle // stylesheet to be processed
)
/* [Description]
Constructor: Add Manage TabPage, set ExampleSet from style.
*/
: SfxTabDialog(pParent, rID, rUIXMLDescription,
&rStyle.GetItemSet(), true)
, pStyle( &rStyle )
{
// without ParentSupport suppress the standardButton
if (!rStyle.HasParentSupport())
RemoveStandardButton();
m_nOrganizerId = AddTabPage("organizer", SfxManageStyleSheetPage::Create, nullptr);
// With new template always set the management page as the current page
if( rStyle.GetName().isEmpty() )
SetCurPageId(m_nOrganizerId);
else
{
OUString sTxt = GetText() + ": " + rStyle.GetName();
SetText( sTxt );
}
delete m_pExampleSet; // in SfxTabDialog::Ctor() already created
m_pExampleSet = &pStyle->GetItemSet();
GetCancelButton().SetClickHdl( LINK(this, SfxStyleDialog, CancelHdl) );
}
SfxStyleDialog::~SfxStyleDialog()
{
disposeOnce();
}
/* [Description]
Destructor: set ExampleSet to NULL, so that SfxTabDialog does not delete
the Set from Style.
*/
void SfxStyleDialog::dispose()
{
m_pExampleSet = nullptr;
pStyle = nullptr;
SfxTabDialog::dispose();
}
short SfxStyleDialog::Ok()
/* [Description]
Override so that always RET_OK is returned.
*/
{
SfxTabDialog::Ok();
return RET_OK;
}
IMPL_LINK_NOARG( SfxStyleDialog, CancelHdl, Button *, void )
/* [Description]
If the dialogue was canceled, then all selected attributes must be reset
again.
*/
{
SfxTabPage* pPage = GetTabPage(m_nOrganizerId);
const SfxItemSet* pInSet = GetInputSetImpl();
SfxWhichIter aIter( *pInSet );
sal_uInt16 nWhich = aIter.FirstWhich();
while ( nWhich )
{
SfxItemState eState = pInSet->GetItemState( nWhich, false );
if ( SfxItemState::DEFAULT == eState )
m_pExampleSet->ClearItem( nWhich );
else
m_pExampleSet->Put( pInSet->Get( nWhich ) );
nWhich = aIter.NextWhich();
}
if ( pPage )
pPage->Reset( GetInputSetImpl() );
EndDialog();
}
/* [Description]
Constructor: Add Manage TabPage, set ExampleSet from style.
......
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