summaryrefslogtreecommitdiff
path: root/svtools/source/contnr/svtreebx.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svtools/source/contnr/svtreebx.cxx')
-rw-r--r--svtools/source/contnr/svtreebx.cxx41
1 files changed, 24 insertions, 17 deletions
diff --git a/svtools/source/contnr/svtreebx.cxx b/svtools/source/contnr/svtreebx.cxx
index ac4ca35a67ac..0e66c425825e 100644
--- a/svtools/source/contnr/svtreebx.cxx
+++ b/svtools/source/contnr/svtreebx.cxx
@@ -65,10 +65,10 @@ DBG_NAME(SvTreeListBox)
#define SV_LBOX_DEFAULT_INDENT_PIXEL 20
SvTreeListBox::SvTreeListBox( Window* pParent, WinBits nWinStyle )
- : SvLBox(pParent,nWinStyle )
+ : SvLBox( pParent, nWinStyle )
{
DBG_CTOR(SvTreeListBox,0);
- InitTreeView( nWinStyle );
+ InitTreeView();
SetSublistOpenWithLeftRight();
}
@@ -78,13 +78,13 @@ SvTreeListBox::SvTreeListBox( Window* pParent , const ResId& rResId )
{
DBG_CTOR(SvTreeListBox,0);
- InitTreeView( 0 );
+ InitTreeView();
Resize();
SetSublistOpenWithLeftRight();
}
-void SvTreeListBox::InitTreeView( WinBits nWinStyle )
+void SvTreeListBox::InitTreeView()
{
DBG_CHKTHIS(SvTreeListBox,0);
pCheckButtonData = NULL;
@@ -102,7 +102,7 @@ void SvTreeListBox::InitTreeView( WinBits nWinStyle )
nTreeFlags = TREEFLAG_RECALCTABS;
nIndent = SV_LBOX_DEFAULT_INDENT_PIXEL;
nEntryHeightOffs = SV_ENTRYHEIGHTOFFS_PIXEL;
- pImp = new SvImpLBox( this, GetModel(), nWinStyle );
+ pImp = new SvImpLBox( this, GetModel(), GetStyle() );
aContextBmpMode = SVLISTENTRYFLAG_EXPANDED;
nContextBmpWidthMax = 0;
@@ -110,7 +110,7 @@ void SvTreeListBox::InitTreeView( WinBits nWinStyle )
SetSpaceBetweenEntries( 0 );
SetLineColor();
InitSettings( sal_True, sal_True, sal_True );
- SetWindowBits( nWinStyle );
+ ImplInitStyle();
SetTabs();
}
@@ -227,8 +227,9 @@ void SvTreeListBox::SetTabs()
EndEditing( sal_True );
nTreeFlags &= (~TREEFLAG_RECALCTABS);
nFocusWidth = -1;
- sal_Bool bHasButtons = (nWindowStyle & WB_HASBUTTONS)!=0;
- sal_Bool bHasButtonsAtRoot = (nWindowStyle & (WB_HASLINESATROOT |
+ const WinBits nStyle( GetStyle() );
+ sal_Bool bHasButtons = (nStyle & WB_HASBUTTONS)!=0;
+ sal_Bool bHasButtonsAtRoot = (nStyle & (WB_HASLINESATROOT |
WB_HASBUTTONSATROOT))!=0;
long nStartPos = TAB_STARTPOS;
long nNodeWidthPixel = GetExpandedNodeBmp().GetSizePixel().Width();
@@ -1492,12 +1493,14 @@ SvLBoxEntry* SvTreeListBox::GetCurEntry() const
return pImp->GetCurEntry();
}
-void SvTreeListBox::SetWindowBits( WinBits nWinStyle )
+void SvTreeListBox::ImplInitStyle()
{
DBG_CHKTHIS(SvTreeListBox,0);
- nWindowStyle = nWinStyle;
+
+ const WinBits nWindowStyle = GetStyle();
+
nTreeFlags |= TREEFLAG_RECALCTABS;
- if( nWinStyle & WB_SORT )
+ if( nWindowStyle & WB_SORT )
{
GetModel()->SetSortMode( SortAscending );
GetModel()->SetCompareHdl( LINK(this,SvTreeListBox,DefaultCompare));
@@ -1508,9 +1511,9 @@ void SvTreeListBox::SetWindowBits( WinBits nWinStyle )
GetModel()->SetCompareHdl( Link() );
}
#ifdef OS2
- nWinStyle |= WB_VSCROLL;
+ nWindowStyle |= WB_VSCROLL;
#endif
- pImp->SetWindowBits( nWinStyle );
+ pImp->SetStyle( nWindowStyle );
pImp->Resize();
Invalidate();
}
@@ -1578,8 +1581,9 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,sal_uInt16 nTabFl
sal_Bool bInUse = pEntry->HasInUseEmphasis();
// wenn eine ClipRegion von aussen gesetzt wird, dann
// diese nicht zuruecksetzen
- sal_Bool bResetClipRegion = !bHasClipRegion;
- sal_Bool bHideSelection = ((nWindowStyle & WB_HIDESELECTION) && !HasFocus())!=0;
+ const WinBits nWindowStyle = GetStyle();
+ const sal_Bool bResetClipRegion = !bHasClipRegion;
+ const sal_Bool bHideSelection = ((nWindowStyle & WB_HIDESELECTION) && !HasFocus())!=0;
const StyleSettings& rSettings = GetSettings().GetStyleSettings();
Font aHighlightFont( GetFont() );
@@ -2229,8 +2233,8 @@ Region SvTreeListBox::GetDragRegion() const
void SvTreeListBox::Command( const CommandEvent& rCEvt )
{
DBG_CHKTHIS(SvTreeListBox,0);
- if ( !pImp->Command( rCEvt ) )
- SvLBox::Command( rCEvt );
+ // FIXME gnumake2 resync to DEV300_m84
+ pImp->Command( rCEvt );
}
@@ -2367,6 +2371,7 @@ void SvTreeListBox::ModelNotification( sal_uInt16 nActionId, SvListEntry* pEntry
long SvTreeListBox::GetTextOffset() const
{
DBG_CHKTHIS(SvTreeListBox,0);
+ const WinBits nWindowStyle = GetStyle();
sal_Bool bHasButtons = (nWindowStyle & WB_HASBUTTONS)!=0;
sal_Bool bHasButtonsAtRoot = (nWindowStyle & (WB_HASLINESATROOT |
WB_HASBUTTONSATROOT))!=0;
@@ -2519,6 +2524,8 @@ void SvTreeListBox::DataChanged( const DataChangedEvent& rDCEvt )
void SvTreeListBox::StateChanged( StateChangedType i_nStateChange )
{
SvLBox::StateChanged( i_nStateChange );
+ if ( i_nStateChange == STATE_CHANGE_STYLE )
+ ImplInitStyle();
}
void SvTreeListBox::InitSettings(sal_Bool bFont,sal_Bool bForeground,sal_Bool bBackground)