diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-07-14 14:18:13 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-07-14 15:25:28 +0100 |
commit | 3ec9d2724ab48a027385bdda443ab06af2626b2b (patch) | |
tree | 7b442f7d16b596eb71c4c67923454afac7660db1 /svx/inc | |
parent | eb5137543012b05dba2df9b92688e01ddee28922 (diff) |
Resolves: fdo#36534 rework SvxSimpleTable to not manage its own parent
SvxSimpleTable was a little confused in that it wanted to both
inherit from SvHeaderTabListBox to get list semantics, and to
wrap a SvHeaderTabListBox and HeaderBar inside a single Control
Leading to a chain of events that in some contexts the "Size"
refers to the complete collection of controls, and in some
contexts the "Size" refers to the SvHeaderTabListBox alone.
Split it up, force it to be only a child of SvxSimpleTableContainer and leave
the work of containment to SvxSimpleTableContainer, and leave SvxSimpleTable as
"is a SvHeaderTabListBox" not "is a or maybe has a SvHeaderTabListBox"
Diffstat (limited to 'svx/inc')
-rw-r--r-- | svx/inc/svx/ctredlin.hxx | 7 | ||||
-rw-r--r-- | svx/inc/svx/simptabl.hxx | 33 |
2 files changed, 17 insertions, 23 deletions
diff --git a/svx/inc/svx/ctredlin.hxx b/svx/inc/svx/ctredlin.hxx index e7d5d46ed83d..3b7ed86b4b68 100644 --- a/svx/inc/svx/ctredlin.hxx +++ b/svx/inc/svx/ctredlin.hxx @@ -121,9 +121,9 @@ protected: public: - SvxRedlinTable( Window* pParent,WinBits nBits ); - SvxRedlinTable( Window* pParent,const ResId& rResId); - ~SvxRedlinTable(); + SvxRedlinTable(SvxSimpleTableContainer& rParent, WinBits nBits = WB_BORDER); + SvxRedlinTable(SvxSimpleTableContainer& rParent, const ResId& rResId); + ~SvxRedlinTable(); // For FilterPage only { void SetFilterDate(sal_Bool bFlag=sal_True); @@ -318,6 +318,7 @@ private: Link RejectAllClickLk; Link UndoClickLk; + SvxSimpleTableContainer m_aViewDataContainer; SvxRedlinTable aViewData; PushButton PbAccept; PushButton PbReject; diff --git a/svx/inc/svx/simptabl.hxx b/svx/inc/svx/simptabl.hxx index 98020a97fcc4..3cca7b1a18df 100644 --- a/svx/inc/svx/simptabl.hxx +++ b/svx/inc/svx/simptabl.hxx @@ -40,31 +40,32 @@ #include "svx/svxdllapi.h" class SvxSimpleTable; -class SvxSimpTblContainer : public Control +class SVX_DLLPUBLIC SvxSimpleTableContainer : public Control { private: SvxSimpleTable* m_pTable; protected: - virtual long PreNotify( NotifyEvent& rNEvt ); + virtual long PreNotify( NotifyEvent& rNEvt ); public: - SvxSimpTblContainer( Window* pParent, WinBits nWinStyle = 0 ); - SvxSimpTblContainer( Window* pParent, const ResId& rResId ); + SvxSimpleTableContainer( Window* pParent, WinBits nWinStyle = WB_BORDER ); + SvxSimpleTableContainer( Window* pParent, const ResId& rResId ); - inline void SetTable( SvxSimpleTable* _pTable ) { m_pTable = _pTable; } + void SetTable(SvxSimpleTable* pTable); + + virtual void SetSizePixel(const Size& rNewSize); }; class SVX_DLLPUBLIC SvxSimpleTable : public SvHeaderTabListBox { - using Window::SetPosSizePixel; private: + SvxSimpleTableContainer& m_rParentTableContainer; Link aHeaderBarClickLink; Link aHeaderBarDblClickLink; Link aCommandLink; CommandEvent aCEvt; - SvxSimpTblContainer aPrivContainer; HeaderBar aHeaderBar; long nOldPos; sal_uInt16 nHeaderItemId; @@ -72,7 +73,6 @@ private: sal_Bool bPaintFlag; sal_Bool bSortDirection; sal_uInt16 nSortCol; - Window* pMyParentWin; DECL_LINK( StartDragHdl, HeaderBar* ); DECL_LINK( DragHdl, HeaderBar* ); @@ -87,7 +87,6 @@ protected: virtual void SetTabs(); virtual void Paint( const Rectangle& rRect ); - virtual void UpdateViewSize(); virtual void HBarClick(); virtual void HBarDblClick(); @@ -102,10 +101,13 @@ protected: public: - SvxSimpleTable( Window* pParent,WinBits nBits =WB_BORDER ); - SvxSimpleTable( Window* pParent,const ResId& ); + SvxSimpleTable(SvxSimpleTableContainer& rParent, WinBits nBits = WB_BORDER); + SvxSimpleTable(SvxSimpleTableContainer& rParent, const ResId&); ~SvxSimpleTable(); + void UpdateViewSize(); + Size getPreferredContainerSize() const; + void InsertHeaderEntry(const XubString& rText, sal_uInt16 nCol=HEADERBAR_APPEND, HeaderBarItemBits nBits = HIB_STDSTYLE); @@ -139,15 +141,6 @@ public: sal_Bool IsEnabled() const; void TableToTop(); - void SetPosPixel( const Point& rNewPos ); - Point GetPosPixel() const ; - virtual void SetPosSizePixel( const Point& rNewPos, Size& rNewSize ); - void SetPosSize( const Point& rNewPos, const Size& rNewSize ); - void SetSizePixel(const Size& rNewSize ); - void SetOutputSizePixel(const Size& rNewSize ); - - Size GetSizePixel() const; - Size GetOutputSizePixel() const; sal_uInt16 GetSelectedCol(); void SortByCol(sal_uInt16,sal_Bool bDir=sal_True); |