Commits

Anonymous committed 33e9fb7

fs33a: revert the original fix for HideInactiveSelection support in the tree list box, causing too much regressions. Fix it by using SetWindowBits instead of SetStyle

Comments (0)

Files changed (2)

svtools/source/contnr/svtreebx.cxx

 	pImp->SetWindowBits( nWinStyle );
 	pImp->Resize();
 	Invalidate();
-
-    if ( nWindowStyle != GetStyle() )
-    {
-        SetStyle( nWindowStyle );
-    }
 }
 
 void SvTreeListBox::PaintEntry( SvLBoxEntry* pEntry )
 void SvTreeListBox::StateChanged( StateChangedType i_nStateChange )
 {
     SvLBox::StateChanged( i_nStateChange );
-    if ( ( i_nStateChange & STATE_CHANGE_STYLE ) != 0 )
-    {
-        if ( GetStyle() != nWindowStyle )
-            // keep in sync with our WindowBits
-            // TODO: SetWindowBits is weird, it should be completely replaced (in all clients) with SetStyle
-            // (or are there WindowBits which have a different meaning when interpreted as style? Wouldn't
-            // be the first time, but all of those should be fixed meanwhile ...)
-            SetWindowBits( GetStyle() );
-    }
 }
 
 void SvTreeListBox::InitSettings(BOOL bFont,BOOL bForeground,BOOL bBackground)

svtools/source/uno/treecontrolpeer.cxx

             sal_Bool bEnabled = sal_False;
             if ( aValue >>= bEnabled )
             {
-                WinBits nStyle = rTree.GetStyle();
+                WinBits nStyle = rTree.GetWindowBits();
                 if ( bEnabled )
                     nStyle |= WB_HIDESELECTION;
                 else
                     nStyle &= ~WB_HIDESELECTION;
-                rTree.SetStyle( nStyle );
+                rTree.SetWindowBits( nStyle );
             }
         }
         break;
 		switch(nPropId)
 		{
         case BASEPROPERTY_HIDEINACTIVESELECTION:
-			return Any( ( rTree.GetStyle() & WB_HIDESELECTION ) != 0 ? sal_True : sal_False );
+			return Any( ( rTree.GetWindowBits() & WB_HIDESELECTION ) != 0 ? sal_True : sal_False );
 
 		case BASEPROPERTY_TREE_SELECTIONTYPE:
 		{