summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-06-06 16:50:30 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-06-07 17:32:41 +0200
commita3bf3c0a5e33bd5769c545bdf1e81d52ae3dcb86 (patch)
treece3be8b1f61fc3831f209fad182dbd62e690dd71 /vcl
parent09b70f8d846d718b73eaaf80c368a8a5cc9f9596 (diff)
focus rect in treeview doesn't match the selected area
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 <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/svimpbox.hxx2
-rw-r--r--vcl/source/treelist/svimpbox.cxx13
2 files changed, 0 insertions, 15 deletions
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 );