From a3bf3c0a5e33bd5769c545bdf1e81d52ae3dcb86 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 6 Jun 2020 16:50:30 +0100 Subject: focus rect in treeview doesn't match the selected area MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit regression from... commit 753084a3f73bb8a88412feac7aa40a2750e6e9f3 Date: Wed Dec 11 12:56:57 2019 +0200 loplugin:singlevalfields which detected that m_bIsCellFocusEnabled is always false but inadvertently make a change of -void SvImpLBox::CalcCellFocusRect( SvTreeListEntry const * pEntry, tools::Rectangle& rRect ) +void SvImpLBox::CalcCellFocusRect( tools::Rectangle& rRect ) { - if ( !(pEntry && m_bIsCellFocusEnabled) ) - return; which treats m_bIsCellFocusEnabled as always true. Always false would make CalcCellFocusRect a no-op so just remove the method to fix things. Change-Id: I46bfa122058a9e4384d2b1e2dc9e844ada22cc69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95672 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- vcl/inc/svimpbox.hxx | 2 -- vcl/source/treelist/svimpbox.cxx | 13 ------------- 2 files changed, 15 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/svimpbox.hxx b/vcl/inc/svimpbox.hxx index 5d23b3f2c46b..c5a51143f141 100644 --- a/vcl/inc/svimpbox.hxx +++ b/vcl/inc/svimpbox.hxx @@ -189,8 +189,6 @@ private: void UpdateContextBmpWidthMax( SvTreeListEntry const * pEntry ); void UpdateContextBmpWidthVectorFromMovedEntry( SvTreeListEntry* pEntry ); - void CalcCellFocusRect( tools::Rectangle& rRect ); - void ExpandAll(); void CollapseTo(SvTreeListEntry* pParentToCollapse); diff --git a/vcl/source/treelist/svimpbox.cxx b/vcl/source/treelist/svimpbox.cxx index 2fc2d0bf9d3c..d7199eb56f7b 100644 --- a/vcl/source/treelist/svimpbox.cxx +++ b/vcl/source/treelist/svimpbox.cxx @@ -210,17 +210,6 @@ void SvImpLBox::UpdateContextBmpWidthMax( SvTreeListEntry const * pEntry ) } } -void SvImpLBox::CalcCellFocusRect( tools::Rectangle& rRect ) -{ - if (m_pCursor->ItemCount() > o3tl::make_unsigned(FIRST_ENTRY_TAB+1)) - { - SvLBoxItem& rNextItem = m_pCursor->GetItem( FIRST_ENTRY_TAB + 1 ); - long nRight = m_pView->GetTab( m_pCursor, &rNextItem )->GetPos() - 1; - if ( nRight < rRect.Right() ) - rRect.SetRight( nRight ); - } -} - void SvImpLBox::SetStyle( WinBits i_nWinStyle ) { m_nStyle = i_nWinStyle; @@ -574,7 +563,6 @@ void SvImpLBox::RecalcFocusRect() m_pView->HideFocus(); long nY = GetEntryLine( m_pCursor ); tools::Rectangle aRect = m_pView->GetFocusRect( m_pCursor, nY ); - CalcCellFocusRect( aRect ); vcl::Region aOldClip( m_pView->GetClipRegion()); vcl::Region aClipRegion( GetClipRegionRect() ); m_pView->SetClipRegion( aClipRegion ); @@ -668,7 +656,6 @@ void SvImpLBox::ShowCursor( bool bShow ) { long nY = GetEntryLine( m_pCursor ); tools::Rectangle aRect = m_pView->GetFocusRect( m_pCursor, nY ); - CalcCellFocusRect( aRect ); vcl::Region aOldClip( m_pView->GetClipRegion()); vcl::Region aClipRegion( GetClipRegionRect() ); m_pView->SetClipRegion( aClipRegion ); -- cgit