Resolves: fdo#36534 rework SvxSimpleTable to not manage its own parent

This commit is contained in:
Caolán McNamara 2011-07-14 14:23:22 +01:00
parent 9ae7372923
commit 024c78c94f
22 changed files with 58 additions and 43 deletions

View File

@ -192,7 +192,8 @@ SvxMultiPathDialog::SvxMultiPathDialog( Window* pParent, sal_Bool bEmptyAllowed
aPathFL ( this, CUI_RES( FL_MULTIPATH) ),
aPathLB ( this, CUI_RES( LB_MULTIPATH ) ),
aRadioLB ( this, CUI_RES( LB_RADIOBUTTON ) ),
m_aRadioLBContainer(this, CUI_RES(LB_RADIOBUTTON)),
aRadioLB(m_aRadioLBContainer),
aRadioFT ( this, CUI_RES( FT_RADIOBUTTON ) ),
aAddBtn ( this, CUI_RES( BTN_ADD_MULTIPATH ) ),
aDelBtn ( this, CUI_RES( BTN_DEL_MULTIPATH ) ),

View File

@ -83,8 +83,10 @@ class OfaACorrCheckListBox : public SvxSimpleTable
virtual void KeyInput( const KeyEvent& rKEvt );
public:
OfaACorrCheckListBox(Window* pParent, const ResId& rResId ) :
SvxSimpleTable( pParent, rResId ){}
OfaACorrCheckListBox(SvxSimpleTableContainer& rParent, WinBits nBits = WB_BORDER)
: SvxSimpleTable(rParent, nBits)
{
}
inline void *GetUserData(sal_uLong nPos) { return GetEntry(nPos)->GetUserData(); }
inline void SetUserData(sal_uLong nPos, void *pData ) { GetEntry(nPos)->SetUserData(pData); }
@ -136,6 +138,7 @@ class OfaSwAutoFmtOptionsPage : public SfxTabPage
{
using TabPage::ActivatePage;
SvxSimpleTableContainer m_aCheckLBContainer;
OfaACorrCheckListBox aCheckLB;
PushButton aEditPB;
FixedText aHeader1Expl;
@ -334,6 +337,7 @@ private:
SvxCheckListBox aCheckLB;
// Just for writer
SvxSimpleTableContainer m_aSwCheckLBContainer;
OfaACorrCheckListBox aSwCheckLB;
String sHeader1;
String sHeader2;

View File

@ -58,6 +58,7 @@ class SvxMultiPathDialog : public ModalDialog
protected:
FixedLine aPathFL;
ListBox aPathLB;
SvxSimpleTableContainer m_aRadioLBContainer;
svx::SvxRadioButtonListBox aRadioLB;
FixedText aRadioFT;
PushButton aAddBtn;

View File

@ -49,7 +49,7 @@ protected:
virtual void KeyInput( const KeyEvent& rKEvt );
public:
SvxRadioButtonListBox( Window* _pParent, const ResId& _rId );
SvxRadioButtonListBox(SvxSimpleTableContainer& rParent, WinBits nBits = WB_BORDER);
~SvxRadioButtonListBox();
void HandleEntryChecked( SvLBoxEntry* _pEntry );

View File

@ -57,7 +57,8 @@ SvxFontSubstTabPage::SvxFontSubstTabPage( Window* pParent,
aFont2FT (this, CUI_RES(FT_FONT2)),
aFont2CB (this, CUI_RES(CB_FONT2)),
aNewDelTBX (this, CUI_RES(TBX_SUBSTNEWDEL)),
aCheckLB (this, CUI_RES(CLB_SUBSTITUTES)),
m_aCheckLBContainer(this, CUI_RES(CLB_SUBSTITUTES)),
aCheckLB(m_aCheckLBContainer),
aSourceViewFontsFL (this, CUI_RES(FL_SOURCEVIEW )),
aFontNameFT (this, CUI_RES(FT_FONTNAME )),

View File

@ -53,8 +53,10 @@ class SvxFontSubstCheckListBox : public SvxSimpleTable
virtual void KeyInput( const KeyEvent& rKEvt );
public:
SvxFontSubstCheckListBox(Window* pParent, const ResId& rResId ) :
SvxSimpleTable( pParent, rResId ){}
SvxFontSubstCheckListBox(SvxSimpleTableContainer& rParent, WinBits nBits = WB_BORDER)
: SvxSimpleTable(rParent, nBits)
{
}
inline void *GetUserData(sal_uLong nPos) { return GetEntry(nPos)->GetUserData(); }
inline void SetUserData(sal_uLong nPos, void *pData ) { GetEntry(nPos)->SetUserData(pData); }
@ -78,6 +80,7 @@ class SvxFontSubstTabPage : public SfxTabPage
FixedText aFont2FT;
FontNameBox aFont2CB;
ToolBox aNewDelTBX;
SvxSimpleTableContainer m_aCheckLBContainer;
SvxFontSubstCheckListBox aCheckLB;
FixedLine aSourceViewFontsFL;

View File

@ -147,7 +147,8 @@ void OfaMSFilterTabPage::Reset( const SfxItemSet& )
OfaMSFilterTabPage2::OfaMSFilterTabPage2( Window* pParent,
const SfxItemSet& rSet )
: SfxTabPage( pParent, CUI_RES( RID_OFAPAGE_MSFILTEROPT2 ), rSet ),
aCheckLB ( this, CUI_RES( CLB_SETTINGS )),
m_aCheckLBContainer(this, CUI_RES( CLB_SETTINGS)),
aCheckLB(m_aCheckLBContainer),
aHeader1FT ( this, CUI_RES( FT_HEADER1_EXPLANATION )),
aHeader2FT ( this, CUI_RES( FT_HEADER2_EXPLANATION )),
sHeader1 ( CUI_RES( ST_HEADER1 )),

View File

@ -81,10 +81,13 @@ class OfaMSFilterTabPage2 : public SfxTabPage
virtual void KeyInput( const KeyEvent& rKEvt );
public:
MSFltrSimpleTable(Window* pParent, const ResId& rResId ) :
SvxSimpleTable( pParent, rResId ){}
MSFltrSimpleTable(SvxSimpleTableContainer& rParent, WinBits nBits = WB_BORDER)
: SvxSimpleTable(rParent, nBits)
{
}
};
SvxSimpleTableContainer m_aCheckLBContainer;
MSFltrSimpleTable aCheckLB;
FixedText aHeader1FT, aHeader2FT;
String sHeader1, sHeader2;

View File

@ -99,7 +99,8 @@ SvxJavaOptionsPage::SvxJavaOptionsPage( Window* pParent, const SfxItemSet& rSet
m_aJavaLine ( this, CUI_RES( FL_JAVA ) ),
m_aJavaEnableCB ( this, CUI_RES( CB_JAVA_ENABLE ) ),
m_aJavaFoundLabel ( this, CUI_RES( FT_JAVA_FOUND ) ),
m_aJavaList ( this, CUI_RES( LB_JAVA ) ),
m_aJavaListContainer(this, CUI_RES(LB_JAVA)),
m_aJavaList(m_aJavaListContainer),
m_aJavaPathText ( this, CUI_RES( FT_JAVA_PATH ) ),
m_aAddBtn ( this, CUI_RES( PB_ADD ) ),
m_aParameterBtn ( this, CUI_RES( PB_PARAMETER ) ),
@ -169,9 +170,9 @@ SvxJavaOptionsPage::SvxJavaOptionsPage( Window* pParent, const SfxItemSet& rSet
aPos = m_aParameterBtn.GetPosPixel();
aPos.X() -= nDiff;
m_aParameterBtn.SetPosSizePixel(aPos, aButtonSize);
Size aSize = m_aJavaList.GetSizePixel();
Size aSize = m_aJavaListContainer.GetSizePixel();
aSize.Width() -= nDiff;
m_aJavaList.SetSizePixel(aSize);
m_aJavaListContainer.SetSizePixel(aSize);
}
}

View File

@ -56,6 +56,7 @@ private:
FixedLine m_aJavaLine;
CheckBox m_aJavaEnableCB;
FixedText m_aJavaFoundLabel;
SvxSimpleTableContainer m_aJavaListContainer;
svx::SvxRadioButtonListBox m_aJavaList;
FixedText m_aJavaPathText;
PushButton m_aAddBtn;

View File

@ -35,9 +35,8 @@ namespace svx {
// class SvxRadioButtonListBox ----------------------------------------------------
SvxRadioButtonListBox::SvxRadioButtonListBox( Window* _pParent, const ResId& _rId ) :
SvxSimpleTable( _pParent, _rId )
SvxRadioButtonListBox::SvxRadioButtonListBox(SvxSimpleTableContainer& rParent, WinBits nBits)
: SvxSimpleTable(rParent, nBits)
{
EnableCheckButton( new SvLBoxButtonData( this, true ) );
@ -50,16 +49,6 @@ SvxRadioButtonListBox::~SvxRadioButtonListBox()
void SvxRadioButtonListBox::SetTabs()
{
SvxSimpleTable::SetTabs();
/*
sal_uInt16 nAdjust = SV_LBOXTAB_ADJUST_RIGHT | SV_LBOXTAB_ADJUST_LEFT |
SV_LBOXTAB_ADJUST_CENTER | SV_LBOXTAB_ADJUST_NUMERIC | SV_LBOXTAB_FORCE;
if ( aTabs.Count() > 0 )
{
SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject(0);
pTab->nFlags &= ~nAdjust;
pTab->nFlags |= SV_LBOXTAB_PUSHABLE | SV_LBOXTAB_ADJUST_CENTER | SV_LBOXTAB_FORCE;
}
*/
}
void SvxRadioButtonListBox::MouseButtonUp( const MouseEvent& _rMEvt )

View File

@ -48,10 +48,9 @@ namespace svx
// class PasswordTable ---------------------------------------------------
PasswordTable::PasswordTable( Window* pParent, const ResId& rResId ) :
SvxSimpleTable( pParent, rResId )
PasswordTable::PasswordTable(SvxSimpleTableContainer& rParent, WinBits nBits)
: SvxSimpleTable(rParent, nBits | WB_NOINITIALSELECTION)
{
SetStyle( GetStyle() | WB_NOINITIALSELECTION );
}
void PasswordTable::InsertHeaderItem( sal_uInt16 nColumn, const String& rText, HeaderBarItemBits nBits )
@ -97,7 +96,8 @@ void PasswordTable::Resort( bool bForced )
WebConnectionInfoDialog::WebConnectionInfoDialog( Window* pParent ) :
ModalDialog( pParent, CUI_RES( RID_SVXDLG_WEBCONNECTION_INFO ) )
,m_aNeverShownFI ( this, CUI_RES( FI_NEVERSHOWN ) )
,m_aPasswordsLB ( this, CUI_RES( LB_PASSWORDS ) )
,m_aPasswordsLBContainer(this, CUI_RES( LB_PASSWORDS))
,m_aPasswordsLB(m_aPasswordsLBContainer)
,m_aRemoveBtn ( this, CUI_RES( PB_REMOVE ) )
,m_aRemoveAllBtn ( this, CUI_RES( PB_REMOVEALL ) )
,m_aChangeBtn ( this, CUI_RES( PB_CHANGE ) )

View File

@ -42,7 +42,7 @@ namespace svx
class PasswordTable : public SvxSimpleTable
{
public:
PasswordTable( Window* pParent, const ResId& rResId );
PasswordTable(SvxSimpleTableContainer& rParent, WinBits nBits = WB_BORDER);
void InsertHeaderItem( sal_uInt16 nColumn, const String& rText, HeaderBarItemBits nBits );
void ResetTabs();
@ -56,6 +56,7 @@ namespace svx
{
private:
FixedInfo m_aNeverShownFI;
SvxSimpleTableContainer m_aPasswordsLBContainer;
PasswordTable m_aPasswordsLB;
PushButton m_aRemoveBtn;
PushButton m_aRemoveAllBtn;

View File

@ -428,7 +428,8 @@ enum OfaAutoFmtOptions
OfaSwAutoFmtOptionsPage::OfaSwAutoFmtOptionsPage( Window* pParent,
const SfxItemSet& rSet ) :
SfxTabPage(pParent, CUI_RES(RID_OFAPAGE_AUTOFMT_APPLY), rSet),
aCheckLB (this, CUI_RES(CLB_SETTINGS)),
m_aCheckLBContainer(this, CUI_RES(CLB_SETTINGS)),
aCheckLB(m_aCheckLBContainer),
aEditPB (this, CUI_RES(PB_EDIT)),
aHeader1Expl (this, CUI_RES(FT_HEADER1_EXPLANATION)),
aHeader2Expl (this, CUI_RES(FT_HEADER2_EXPLANATION)),
@ -1897,7 +1898,8 @@ SvLBoxEntry* OfaQuoteTabPage::CreateEntry(String& rTxt, sal_uInt16 nCol)
OfaQuoteTabPage::OfaQuoteTabPage( Window* pParent, const SfxItemSet& rSet ) :
SfxTabPage(pParent, CUI_RES( RID_OFAPAGE_AUTOCORR_QUOTE ), rSet),
aCheckLB (this, CUI_RES(CLB_SETTINGS )),
aSwCheckLB (this, CUI_RES(CLB_SETTINGS )),
m_aSwCheckLBContainer(this, CUI_RES(CLB_SETTINGS)),
aSwCheckLB(m_aSwCheckLBContainer),
sHeader1 (CUI_RES( STR_HEADER1 )),
sHeader2 (CUI_RES( STR_HEADER2 )),
sNonBrkSpace (CUI_RES( ST_NON_BREAK_SPACE )),

View File

@ -61,7 +61,8 @@ private:
SignatureInformations maCertsToIgnore;
FixedText maHintFT;
SvxSimpleTable maCertLB; // #i48648 now SvHeaderTabListBox
SvxSimpleTableContainer m_aCertLBContainer;
SvxSimpleTable maCertLB;
PushButton maViewBtn;
@ -73,7 +74,6 @@ private:
sal_Bool mbInitialized;
sal_uInt16 GetSelectedEntryPos( void ) const;
// DECL_LINK( Initialize, void* );
DECL_LINK( ViewButtonHdl, Button* );
DECL_LINK( CertificateHighlightHdl, void* );
DECL_LINK( CertificateSelectHdl, void* );

View File

@ -114,7 +114,8 @@ public:
class CertificateViewerDetailsTP : public CertificateViewerTP
{
private:
SvxSimpleTable maElementsLB; // #i48648 now SvHeaderTabListBox
SvxSimpleTableContainer m_aElementsLBContainer;
SvxSimpleTable maElementsLB;
MultiLineEdit maElementML;
Font maStdFont;
Font maFixedWidthFont;

View File

@ -80,7 +80,8 @@ private:
FixedText maHintDocFT;
FixedText maHintBasicFT;
FixedText maHintPackageFT;
SvxSimpleTable maSignaturesLB; // #i48648 now SvHeaderTabListBox
SvxSimpleTableContainer maSignaturesLBContainer;
SvxSimpleTable maSignaturesLB;
FixedImage maSigsValidImg;
FixedInfo maSigsValidFI;
FixedImage maSigsInvalidImg;

View File

@ -138,7 +138,8 @@ class MacroSecurityTrustedSourcesTP : public MacroSecurityTP
private:
FixedLine maTrustCertFL;
ReadOnlyImage maTrustCertROFI;
SvxSimpleTable maTrustCertLB; // #i48648 now SvHeaderTabListBox
SvxSimpleTableContainer m_aTrustCertLBContainer;
SvxSimpleTable maTrustCertLB;
PushButton maAddCertPB;
PushButton maViewCertPB;
PushButton maRemoveCertPB;

View File

@ -68,7 +68,8 @@ CertificateChooser::CertificateChooser( Window* _pParent, uno::Reference< uno::X
:ModalDialog ( _pParent, XMLSEC_RES( RID_XMLSECDLG_CERTCHOOSER ) )
,maCertsToIgnore( _rCertsToIgnore )
,maHintFT ( this, XMLSEC_RES( FT_HINT_SELECT ) )
,maCertLB ( this, XMLSEC_RES( LB_SIGNATURES ) )
,m_aCertLBContainer(this, XMLSEC_RES(LB_SIGNATURES))
,maCertLB(m_aCertLBContainer)
,maViewBtn ( this, XMLSEC_RES( BTN_VIEWCERT ) )
,maBottomSepFL ( this, XMLSEC_RES( FL_BOTTOM_SEP ) )
,maOKBtn ( this, XMLSEC_RES( BTN_OK ) )

View File

@ -255,7 +255,8 @@ void CertificateViewerDetailsTP::InsertElement( const String& _rField, const Str
CertificateViewerDetailsTP::CertificateViewerDetailsTP( Window* _pParent, CertificateViewer* _pDlg )
:CertificateViewerTP ( _pParent, XMLSEC_RES( RID_XMLSECTP_DETAILS ), _pDlg )
,maElementsLB ( this, XMLSEC_RES( LB_ELEMENTS ) )
,m_aElementsLBContainer(this, XMLSEC_RES(LB_ELEMENTS))
,maElementsLB(m_aElementsLBContainer)
,maElementML ( this, XMLSEC_RES( ML_ELEMENT ) )
,maStdFont ( maElementML.GetControlFont() )
,maFixedWidthFont ( OutputDevice::GetDefaultFont( DEFAULTFONT_UI_FIXED, LANGUAGE_DONTKNOW, DEFAULTFONT_FLAGS_ONLYONE, this ) )

View File

@ -191,7 +191,8 @@ DigitalSignaturesDialog::DigitalSignaturesDialog(
,maHintDocFT ( this, XMLSEC_RES( FT_HINT_DOC ) )
,maHintBasicFT ( this, XMLSEC_RES( FT_HINT_BASIC ) )
,maHintPackageFT ( this, XMLSEC_RES( FT_HINT_PACK ) )
,maSignaturesLB ( this, XMLSEC_RES( LB_SIGNATURES ) )
,maSignaturesLBContainer(this, XMLSEC_RES(LB_SIGNATURES))
,maSignaturesLB(maSignaturesLBContainer)
,maSigsValidImg ( this, XMLSEC_RES( IMG_STATE_VALID ) )
,maSigsValidFI ( this, XMLSEC_RES( FI_STATE_VALID ) )
,maSigsInvalidImg ( this, XMLSEC_RES( IMG_STATE_BROKEN ) )
@ -209,7 +210,7 @@ DigitalSignaturesDialog::DigitalSignaturesDialog(
,m_bHasDocumentSignature(bHasDocumentSignature)
,m_bWarningShowSignMacro(false)
{
// --> PB #i48253 the tablistbox needs its own unique id
// #i48253# the tablistbox needs its own unique id
maSignaturesLB.Window::SetUniqueId( HID_XMLSEC_TREE_SIGNATURESDLG );
Size aControlSize( maSignaturesLB.GetSizePixel() );
aControlSize = maSignaturesLB.PixelToLogic( aControlSize, MapMode( MAP_APPFONT ) );

View File

@ -337,7 +337,8 @@ MacroSecurityTrustedSourcesTP::MacroSecurityTrustedSourcesTP( Window* _pParent,
:MacroSecurityTP ( _pParent, XMLSEC_RES( RID_XMLSECTP_TRUSTSOURCES ), _pDlg )
,maTrustCertFL ( this, XMLSEC_RES( FL_TRUSTCERT ) )
,maTrustCertROFI ( this, XMLSEC_RES( FI_TRUSTCERT_RO ) )
,maTrustCertLB ( this, XMLSEC_RES( LB_TRUSTCERT ) )
,m_aTrustCertLBContainer(this, XMLSEC_RES(LB_TRUSTCERT))
,maTrustCertLB(m_aTrustCertLBContainer)
,maAddCertPB ( this, XMLSEC_RES( PB_ADD_TRUSTCERT ) )
,maViewCertPB ( this, XMLSEC_RES( PB_VIEW_TRUSTCERT ) )
,maRemoveCertPB ( this, XMLSEC_RES( PB_REMOVE_TRUSTCERT ) )