SfxNoLayoutSingleTabDialog not needed anymore

all single tab dialogs are .ui enabled now.

So now we can remove SfxNoLayoutSingleTabDialog and merge SfxSingleTabDialog
and ~SfxNoLayoutSingleTabDialogBase together

Change-Id: If0acc792d85b7d399572257d7e9b0e12993ba3fe
This commit is contained in:
Caolán McNamara 2014-01-23 14:21:11 +00:00
parent 976ccb9374
commit ebf5e613a5
25 changed files with 44 additions and 203 deletions

View File

@ -46,7 +46,7 @@ NumberFormatDialog::NumberFormatDialog(Window* pParent, SfxItemSet& rSet)
{
SfxTabPage* pTabPage = (*fnCreatePage)( get_content_area(), rSet );
pTabPage->PageCreated(rSet);
setTabPage(pTabPage);
SetTabPage(pTabPage);
}
}

View File

@ -873,7 +873,7 @@ SvxMacroAssignDlg::SvxMacroAssignDlg( Window* pParent, const Reference< frame::X
const Reference< container::XNameReplace >& xNameReplace, sal_uInt16 nSelectedIndex )
: SvxMacroAssignSingleTabDialog(pParent, rSet)
{
setTabPage(new SvxMacroTabPage(get_content_area(), _rxDocumentFrame, rSet, xNameReplace, nSelectedIndex));
SetTabPage(new SvxMacroTabPage(get_content_area(), _rxDocumentFrame, rSet, xNameReplace, nSelectedIndex));
}
//===============================================

View File

@ -506,7 +506,7 @@ void SpellDialog::StartSpellOptDlg_Impl()
new SfxSingleTabDialog(this, aSet, "SpellOptionsDialog", "cui/ui/spelloptionsdialog.ui");
SfxTabPage* pPage = SvxLinguTabPage::Create( pDlg->get_content_area(), aSet );
( (SvxLinguTabPage*)pPage )->HideGroups( GROUP_MODULES );
pDlg->setTabPage( pPage );
pDlg->SetTabPage( pPage );
if(RET_OK == pDlg->Execute())
{
InitUserDicts();

View File

@ -56,7 +56,7 @@ SvxJSearchOptionsDialog::SvxJSearchOptionsDialog(Window *pParent,
// SfxSingleTabDialog destructor
pPage = (SvxJSearchOptionsPage *)
SvxJSearchOptionsPage::Create(get_content_area(), rOptionsSet );
setTabPage( pPage ); //! implicitly calls pPage->Reset(...)!
SetTabPage( pPage ); //! implicitly calls pPage->Reset(...)!
pPage->EnableSaveOptions(false);
}

View File

@ -79,7 +79,7 @@ DatabaseRegistrationDialog::DatabaseRegistrationDialog( Window* pParent, const S
, SfxSingleTabDialog(pParent, getRegistrationItems())
{
SfxTabPage* page = DbRegistrationOptionsPage::Create(get_content_area(), getRegistrationItems());
setTabPage(page);
SetTabPage(page);
SetText(page->get<VclFrame>("frame1")->get_label());
}

View File

@ -60,7 +60,7 @@ SvxConnectionDialog::SvxConnectionDialog( Window* pParent, const SfxItemSet& rIn
_pPage->SetView( pSdrView );
_pPage->Construct();
setTabPage( _pPage );
SetTabPage( _pPage );
SetText(CUI_RESSTR( RID_SVXSTR_CONNECTOR ));
}

View File

@ -46,7 +46,7 @@ SvxDistributeDialog::SvxDistributeDialog(Window* pParent,
, mpPage(NULL)
{
mpPage = new SvxDistributePage(get_content_area(), rInAttrs, eHor, eVer);
setTabPage(mpPage);
SetTabPage(mpPage);
}
/*************************************************************************

View File

@ -474,7 +474,7 @@ SfxMacroAssignDlg::SfxMacroAssignDlg(Window* pParent,
{
SfxMacroTabPage* pPage = CreateSfxMacroTabPage(get_content_area(), rSet);
pPage->SetFrame( rxDocumentFrame );
setTabPage( pPage );
SetTabPage( pPage );
pPage->LaunchFillGroup();
}

View File

@ -69,7 +69,7 @@ SvxMeasureDialog::SvxMeasureDialog( Window* pParent, const SfxItemSet& rInAttrs,
_pPage->SetView( pSdrView );
_pPage->Construct();
setTabPage(_pPage );
SetTabPage(_pPage );
SetText(CUI_RESSTR(RID_SVXSTR_DIMENSION_LINE));
}

View File

@ -1108,7 +1108,7 @@ IMPL_LINK( SvxNumberFormatTabPage, DoubleClickHdl_Impl, SvxFontListBox*, pLb )
}
else
{
SfxSingleTabDialogBase* pParent = dynamic_cast< SfxSingleTabDialogBase* >( GetParentDialog() );
SfxSingleTabDialog* pParent = dynamic_cast< SfxSingleTabDialog* >( GetParentDialog() );
OKButton* pOKButton = pParent ? pParent->GetOKButton() : NULL;
if ( pOKButton )
pOKButton->Click();

View File

@ -56,7 +56,7 @@ OTableSubscriptionDialog::OTableSubscriptionDialog(Window* pParent
OTableSubscriptionPage* pTabPage = new OTableSubscriptionPage(get_content_area(), *m_pOutSet, this);
pTabPage->SetServiceFactory(_rxORB);
setTabPage(pTabPage);
SetTabPage(pTabPage);
}
OTableSubscriptionDialog::~OTableSubscriptionDialog()

View File

@ -2730,7 +2730,7 @@ namespace pcr
throw RuntimeException(); // caught below
SfxTabPage* pPage = (*fnCreatePage)( xDialog->get_content_area(), aCoreSet );
xDialog->setTabPage( pPage );
xDialog->SetTabPage( pPage );
_rClearBeforeDialog.clear();
if ( RET_OK == xDialog->Execute() )

View File

@ -178,21 +178,20 @@ struct SingleTabDlgImpl
typedef sal_uInt16* (*GetTabPageRanges)(); // liefert internationale Which-Werte
class SFX2_DLLPUBLIC SfxSingleTabDialogBase : public SfxModalDialog
class SFX2_DLLPUBLIC SfxSingleTabDialog : public SfxModalDialog
{
public:
//layout ctors
SfxSingleTabDialogBase(Window *pParent, const SfxItemSet& rOptionsSet,
const OString& rID, const OUString& rUIXMLDescription);
SfxSingleTabDialogBase(Window *pParent, const SfxItemSet* pInSet,
const OString& rID, const OUString& rUIXMLDescription);
SfxSingleTabDialog(Window *pParent, const SfxItemSet& rOptionsSet,
const OString& rID = OString("SingleTabDialog"),
const OUString& rUIXMLDescription = OUString("sfx/ui/singletabdialog.ui"));
//non-layout ctors
SfxSingleTabDialogBase( Window* pParent, const SfxItemSet& rOptionsSet, sal_uInt16 nUniqueId );
SfxSingleTabDialogBase( Window* pParent, sal_uInt16 nUniqueId, const SfxItemSet* pInSet = 0 );
SfxSingleTabDialog(Window *pParent, const SfxItemSet* pInSet = 0,
const OString& rID = OString("SingleTabDialog"),
const OUString& rUIXMLDescription = OUString("sfx/ui/singletabdialog.ui"));
virtual ~SfxSingleTabDialogBase();
virtual ~SfxSingleTabDialog();
void SetTabPage(SfxTabPage* pTabPage, GetTabPageRanges pRangesFunc = 0, sal_uInt32 nSettingsId = 0);
SfxTabPage* GetTabPage() const { return pImpl->m_pSfxPage; }
OKButton* GetOKButton() const { return pOKBtn; }
@ -210,40 +209,6 @@ protected:
DECL_DLLPRIVATE_LINK(OKHdl_Impl, void *);
};
class SFX2_DLLPUBLIC SfxSingleTabDialog : public SfxSingleTabDialogBase
{
public:
SfxSingleTabDialog(Window *pParent, const SfxItemSet& rOptionsSet,
const OString& rID = OString("SingleTabDialog"),
const OUString& rUIXMLDescription = OUString("sfx/ui/singletabdialog.ui"))
: SfxSingleTabDialogBase(pParent, rOptionsSet, rID, rUIXMLDescription)
{
}
SfxSingleTabDialog(Window *pParent, const SfxItemSet* pInSet = 0,
const OString& rID = OString("SingleTabDialog"),
const OUString& rUIXMLDescription = OUString("sfx/ui/singletabdialog.ui"))
: SfxSingleTabDialogBase(pParent, pInSet, rID, rUIXMLDescription)
{
}
void setTabPage(SfxTabPage* pTabPage, GetTabPageRanges pRangesFunc = 0, sal_uInt32 nSettingsId = 0);
};
//Old school deprecated non-layout aware version
class SFX2_DLLPUBLIC SfxNoLayoutSingleTabDialog : public SfxSingleTabDialogBase
{
public:
SfxNoLayoutSingleTabDialog(Window* pParent, const SfxItemSet& rOptionsSet, sal_uInt16 nUniqueId)
: SfxSingleTabDialogBase(pParent, rOptionsSet, nUniqueId)
{
}
SfxNoLayoutSingleTabDialog(Window* pParent, sal_uInt16 nUniqueId, const SfxItemSet* pInSet = 0)
: SfxSingleTabDialogBase(pParent, nUniqueId, pInSet)
{
}
~SfxNoLayoutSingleTabDialog();
void SetTabPage(SfxTabPage* pTabPage, GetTabPageRanges pRangesFunc = 0);
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -232,17 +232,17 @@ IMPL_LINK_NOARG(ScHFPage, HFEditHdl)
{
aText = ScGlobal::GetRscString( STR_PAGEHEADER );
if ( bRightPage )
pDlg->setTabPage( ScRightHeaderEditPage::Create( pDlg->get_content_area(), aDataSet ), NULL, nSettingsId );
pDlg->SetTabPage( ScRightHeaderEditPage::Create( pDlg->get_content_area(), aDataSet ), NULL, nSettingsId );
else
pDlg->setTabPage( ScLeftHeaderEditPage::Create( pDlg->get_content_area(), aDataSet ), NULL, nSettingsId );
pDlg->SetTabPage( ScLeftHeaderEditPage::Create( pDlg->get_content_area(), aDataSet ), NULL, nSettingsId );
}
else
{
aText = ScGlobal::GetRscString( STR_PAGEFOOTER );
if ( bRightPage )
pDlg->setTabPage( ScRightFooterEditPage::Create( pDlg->get_content_area(), aDataSet ), NULL, nSettingsId );
pDlg->SetTabPage( ScRightFooterEditPage::Create( pDlg->get_content_area(), aDataSet ), NULL, nSettingsId );
else
pDlg->setTabPage( ScLeftFooterEditPage::Create( pDlg->get_content_area(), aDataSet ), NULL, nSettingsId );
pDlg->SetTabPage( ScLeftFooterEditPage::Create( pDlg->get_content_area(), aDataSet ), NULL, nSettingsId );
}
SvxNumType eNumType = ((const SvxPageItem&)aDataSet.Get(ATTR_PAGE)).GetNumType();

View File

@ -89,7 +89,7 @@ SdActionDlg::SdActionDlg (
( (SdTPAction*) pNewPage )->SetView( pView );
( (SdTPAction*) pNewPage )->Construct();
setTabPage( pNewPage );
SetTabPage( pNewPage );
}

View File

@ -648,9 +648,9 @@ void SfxFloatingWindow::FillInfo(SfxChildWinInfo& rInfo) const
rInfo.nFlags |= SFX_CHILDWIN_ZOOMIN;
}
// SfxSingleTabDialogBase ----------------------------------------------------
// SfxSingleTabDialog ----------------------------------------------------
IMPL_LINK_NOARG(SfxSingleTabDialogBase, OKHdl_Impl)
IMPL_LINK_NOARG(SfxSingleTabDialog, OKHdl_Impl)
/* [Description]
@ -698,76 +698,25 @@ IMPL_LINK_NOARG(SfxSingleTabDialogBase, OKHdl_Impl)
// -----------------------------------------------------------------------
SfxSingleTabDialogBase::SfxSingleTabDialogBase
(
Window *pParent,
const SfxItemSet& rSet,
sal_uInt16 nUniqueId
) :
/* [Description]
Constructor of the general base class for SingleTab-Dialoge;
ID for the ini-file is handed over.
*/
SfxModalDialog( pParent, nUniqueId, WinBits( WB_STDMODAL | WB_3DLOOK ) ),
pOKBtn ( 0 ),
pCancelBtn ( 0 ),
pHelpBtn ( 0 ),
pImpl ( new SingleTabDlgImpl )
{
DBG_WARNING( "please use the constructor with ViewFrame" );
SetInputSet( &rSet );
}
// -----------------------------------------------------------------------
SfxSingleTabDialogBase::SfxSingleTabDialogBase
(
Window* pParent,
sal_uInt16 nUniqueId,
const SfxItemSet* pInSet
)
/* [Description]
Constructor of the general base class for SingleTab-Dialoge;
ID for the ini-file is handed over.
Deprecated.
*/
: SfxModalDialog( pParent, nUniqueId, WinBits( WB_STDMODAL | WB_3DLOOK ) ),
pOKBtn ( 0 ),
pCancelBtn ( 0 ),
pHelpBtn ( 0 ),
pImpl ( new SingleTabDlgImpl )
{
DBG_WARNING( "please use the constructor with ViewFrame" );
SetInputSet( pInSet );
}
SfxSingleTabDialogBase::SfxSingleTabDialogBase(Window *pParent, const SfxItemSet& rSet,
SfxSingleTabDialog::SfxSingleTabDialog(Window *pParent, const SfxItemSet& rSet,
const OString& rID, const OUString& rUIXMLDescription)
: SfxModalDialog(pParent, rID, rUIXMLDescription)
, pImpl(new SingleTabDlgImpl)
{
get(pOKBtn, "ok");
pOKBtn->SetClickHdl( LINK( this, SfxSingleTabDialogBase, OKHdl_Impl ) );
pOKBtn->SetClickHdl( LINK( this, SfxSingleTabDialog, OKHdl_Impl ) );
get(pCancelBtn, "cancel");
get(pHelpBtn, "help");
SetInputSet( &rSet );
}
SfxSingleTabDialogBase::SfxSingleTabDialogBase(Window* pParent, const SfxItemSet* pInSet,
SfxSingleTabDialog::SfxSingleTabDialog(Window* pParent, const SfxItemSet* pInSet,
const OString& rID, const OUString& rUIXMLDescription)
: SfxModalDialog(pParent, rID, rUIXMLDescription)
, pImpl(new SingleTabDlgImpl)
{
get(pOKBtn, "ok");
pOKBtn->SetClickHdl( LINK( this, SfxSingleTabDialogBase, OKHdl_Impl ) );
pOKBtn->SetClickHdl( LINK( this, SfxSingleTabDialog, OKHdl_Impl ) );
get(pCancelBtn, "cancel");
get(pHelpBtn, "help");
SetInputSet( pInSet );
@ -775,14 +724,14 @@ SfxSingleTabDialogBase::SfxSingleTabDialogBase(Window* pParent, const SfxItemSet
// -----------------------------------------------------------------------
SfxSingleTabDialogBase::~SfxSingleTabDialogBase()
SfxSingleTabDialog::~SfxSingleTabDialog()
{
delete pImpl->m_pSfxPage;
delete pImpl->m_pLine;
delete pImpl;
}
void SfxSingleTabDialog::setTabPage(SfxTabPage* pTabPage,
void SfxSingleTabDialog::SetTabPage(SfxTabPage* pTabPage,
GetTabPageRanges pRangesFunc, sal_uInt32 nSettingsId)
/* [Description]
@ -825,77 +774,4 @@ void SfxSingleTabDialog::setTabPage(SfxTabPage* pTabPage,
}
}
// -----------------------------------------------------------------------
void SfxNoLayoutSingleTabDialog::SetTabPage( SfxTabPage* pTabPage,
GetTabPageRanges pRangesFunc )
/* [Description]
Insert a (new) TabPage; an existing page is deleted.
The passed on page is initialized with the initially given Itemset
through calling Reset().
*/
{
if ( !pOKBtn )
{
pOKBtn = new OKButton( this, WB_DEFBUTTON );
pOKBtn->SetClickHdl( LINK( this, SfxSingleTabDialogBase, OKHdl_Impl ) );
}
if ( !pCancelBtn )
pCancelBtn = new CancelButton( this );
if ( !pHelpBtn )
pHelpBtn = new HelpButton( this );
delete pImpl->m_pSfxPage;
pImpl->m_pSfxPage = pTabPage;
fnGetRanges = pRangesFunc;
if ( pImpl->m_pSfxPage )
{
// First obtain the user data, only then Reset()
SvtViewOptions aPageOpt( E_TABPAGE, OUString::number( GetUniqId() ) );
OUString sUserData;
Any aUserItem = aPageOpt.GetUserItem( USERITEM_NAME );
OUString aTemp;
if ( aUserItem >>= aTemp )
sUserData = aTemp;
pImpl->m_pSfxPage->SetUserData( sUserData );
pImpl->m_pSfxPage->Reset( *GetInputItemSet() );
pImpl->m_pSfxPage->Show();
// Adjust size and position
pImpl->m_pSfxPage->SetPosPixel( Point() );
Size aOutSz( pImpl->m_pSfxPage->GetSizePixel() );
Size aBtnSiz = LogicToPixel( Size( 50, 14 ), MAP_APPFONT );
Point aPnt( aOutSz.Width(), LogicToPixel( Point( 0, 6 ), MAP_APPFONT ).Y() );
aOutSz.Width() += aBtnSiz.Width() + LogicToPixel( Size( 6, 0 ), MAP_APPFONT ).Width();
SetOutputSizePixel( aOutSz );
pOKBtn->SetPosSizePixel( aPnt, aBtnSiz );
pOKBtn->Show();
aPnt.Y() = LogicToPixel( Point( 0, 23 ), MAP_APPFONT ).Y();
pCancelBtn->SetPosSizePixel( aPnt, aBtnSiz );
pCancelBtn->Show();
aPnt.Y() = LogicToPixel( Point( 0, 43 ), MAP_APPFONT ).Y();
pHelpBtn->SetPosSizePixel( aPnt, aBtnSiz );
if ( Help::IsContextHelpEnabled() )
pHelpBtn->Show();
// Set TabPage text in the Dialog
SetText( pImpl->m_pSfxPage->GetText() );
// Dialog receives the HelpId of TabPage
SetHelpId( pImpl->m_pSfxPage->GetHelpId() );
SetUniqueId( pImpl->m_pSfxPage->GetUniqueId() );
}
}
SfxNoLayoutSingleTabDialog::~SfxNoLayoutSingleTabDialog()
{
delete pOKBtn;
delete pCancelBtn;
delete pHelpBtn;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -748,7 +748,7 @@ void SvxGrafAttrHelper::ExecuteGrafAttr( SfxRequest& rReq, SdrView& rView )
SfxTabPage* pTabPage = (*fnCreatePage)( aCropDialog.get_content_area(), aCropDlgAttr );
pTabPage->SetText( aCropStr );
aCropDialog.setTabPage( pTabPage );
aCropDialog.SetTabPage( pTabPage );
if( aCropDialog.Execute() == RET_OK )
{

View File

@ -526,7 +526,7 @@ SwDropCapsDlg::SwDropCapsDlg(Window *pParent, const SfxItemSet &rSet )
{
SwDropCapsPage* pNewPage = (SwDropCapsPage*) SwDropCapsPage::Create(get_content_area(), rSet);
pNewPage->SetFormat(false);
setTabPage(pNewPage);
SetTabPage(pNewPage);
}
SwDropCapsPage::SwDropCapsPage(Window *pParent, const SfxItemSet &rSet)

View File

@ -44,7 +44,7 @@ SwNumFmtDlg::SwNumFmtDlg(Window* pParent, const SfxItemSet& rSet)
SfxAllItemSet aSet(*(rSet.GetPool()));
aSet.Put ( SvxNumberInfoItem( (const SvxNumberInfoItem&)pNewPage->GetItemSet().Get( SID_ATTR_NUMBERFORMAT_INFO )));
pNewPage->PageCreated(aSet);
setTabPage(pNewPage);
SetTabPage(pNewPage);
}
}

View File

@ -357,7 +357,7 @@ SwMailConfigDlg::SwMailConfigDlg(Window* pParent, SfxItemSet& rSet)
: SfxSingleTabDialog(pParent, rSet)
{
// create TabPage
setTabPage(SwMailConfigPage::Create(get_content_area(), rSet));
SetTabPage(SwMailConfigPage::Create(get_content_area(), rSet));
}
SwAuthenticationSettingsDialog::SwAuthenticationSettingsDialog(

View File

@ -317,7 +317,7 @@ SwCaptionOptDlg::SwCaptionOptDlg(Window* pParent, const SfxItemSet& rSet)
"modules/swriter/ui/captiondialog.ui")
{
// create TabPage
setTabPage(SwCaptionOptPage::Create(get_content_area(), rSet));
SetTabPage(SwCaptionOptPage::Create(get_content_area(), rSet));
}
SwCaptionPreview::SwCaptionPreview( Window* pParent, WinBits nStyle )
@ -746,7 +746,7 @@ IMPL_LINK_NOARG(SwCaptionOptPage, ModifyHdl)
{
OUString sFldTypeName = m_pCategoryBox->GetText();
SfxSingleTabDialogBase *pDlg = dynamic_cast<SfxSingleTabDialogBase*>(GetParentDialog());
SfxSingleTabDialog *pDlg = dynamic_cast<SfxSingleTabDialog*>(GetParentDialog());
PushButton *pBtn = pDlg ? pDlg->GetOKButton() : NULL;
if (pBtn)
pBtn->Enable(!sFldTypeName.isEmpty());

View File

@ -30,7 +30,7 @@ SwAddrDlg::SwAddrDlg(Window* pParent, const SfxItemSet& rSet)
if ( fnCreatePage )
{
SfxTabPage* pPage2 = (*fnCreatePage)(get_content_area(), rSet);
setTabPage(pPage2);
SetTabPage(pPage2);
}
}

View File

@ -186,7 +186,7 @@ SfxTabPage* SwFldEditDlg::CreatePage(sal_uInt16 nGroup)
static_cast<SwFldPage*>(pTabPage)->SetWrtShell(pSh);
setTabPage(pTabPage);
SetTabPage(pTabPage);
return pTabPage;
}

View File

@ -33,7 +33,7 @@ SwBackgroundDlg::SwBackgroundDlg(Window* pParent, const SfxItemSet& rSet)
::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND );
if ( fnCreatePage )
{
setTabPage((*fnCreatePage)(get_content_area(), rSet));
SetTabPage((*fnCreatePage)(get_content_area(), rSet));
}
}

View File

@ -60,7 +60,7 @@ SwWrapDlg::SwWrapDlg(Window* pParent, SfxItemSet& rSet, SwWrtShell* pSh, bool bD
SwWrapTabPage* pNewPage = (SwWrapTabPage*) SwWrapTabPage::Create(get_content_area(), rSet);
pNewPage->SetFormatUsed(sal_False, bDrawMode);
pNewPage->SetShell(pWrtShell);
setTabPage(pNewPage);
SetTabPage(pNewPage);
}
SwWrapTabPage::SwWrapTabPage(Window *pParent, const SfxItemSet &rSet)