diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-12-11 12:56:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-12-13 07:05:24 +0100 |
commit | 753084a3f73bb8a88412feac7aa40a2750e6e9f3 (patch) | |
tree | 0b9001326c2f4ecf64547da4490849bc0f22118e /vcl | |
parent | 3eb694a2ba080095bc1ac2e3bcea61aa6881bee7 (diff) |
loplugin:singlevalfields
Change-Id: Idec5a7a732d5dc868ad3f9a147e18ee9685645e2
Reviewed-on: https://gerrit.libreoffice.org/85076
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/svimpbox.hxx | 5 | ||||
-rw-r--r-- | vcl/source/control/imivctl.hxx | 3 | ||||
-rw-r--r-- | vcl/source/control/imivctl1.cxx | 17 | ||||
-rw-r--r-- | vcl/source/treelist/svimpbox.cxx | 31 | ||||
-rw-r--r-- | vcl/source/treelist/svtabbx.cxx | 14 | ||||
-rw-r--r-- | vcl/source/treelist/treelistbox.cxx | 5 |
6 files changed, 11 insertions, 64 deletions
diff --git a/vcl/inc/svimpbox.hxx b/vcl/inc/svimpbox.hxx index 5a3ddf140b9e..5206ded364fc 100644 --- a/vcl/inc/svimpbox.hxx +++ b/vcl/inc/svimpbox.hxx @@ -139,7 +139,6 @@ private: bool m_bSubLstOpLR : 1; // open/close sublist with cursor left/right, defaulted with false bool m_bSubLstOpDblClick : 1; // open/close sublist with mouse double click, defaulted with true bool m_bContextMenuHandling : 1; - bool m_bIsCellFocusEnabled : 1; bool mbForceMakeVisible; Point m_aEditClickPos; @@ -198,7 +197,7 @@ private: void UpdateContextBmpWidthMax( SvTreeListEntry const * pEntry ); void UpdateContextBmpWidthVectorFromMovedEntry( SvTreeListEntry* pEntry ); - void CalcCellFocusRect( SvTreeListEntry const * pEntry, tools::Rectangle& rRect ); + void CalcCellFocusRect( tools::Rectangle& rRect ); void ExpandAll(); void CollapseTo(SvTreeListEntry* pParentToCollapse); @@ -332,8 +331,6 @@ public: void ShowFocusRect( const SvTreeListEntry* pEntry ); void CallEventListeners( VclEventId nEvent, void* pData = nullptr ); - /** Enables, that one cell of a tablistbox entry can be focused */ - bool IsCellFocusEnabled() const { return m_bIsCellFocusEnabled; } bool SetCurrentTabPos( sal_uInt16 _nNewPos ); sal_uInt16 GetCurrentTabPos() const { return m_nCurTabPos; } diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index 1421c14cd452..ce53dcc6a2f1 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -139,10 +139,7 @@ class SvxIconChoiceCtrl_Impl SvxIconChoiceCtrlEntry* pHead = nullptr; // top left entry SvxIconChoiceCtrlEntry* pCursor; SvxIconChoiceCtrlEntry* pHdlEntry; - VclPtr<VirtualDevice> pDDDev; VclPtr<VirtualDevice> pDDBufDev; - VclPtr<VirtualDevice> pDDTempDev; - VclPtr<VirtualDevice> pEntryPaintDev; SvxIconChoiceCtrlEntry* pAnchor; // for selection LocalFocus aFocus; // Data for focusrect ::vcl::AccessibleFactoryAccess aAccFactory; diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index 7e2767452ff1..353a92902aba 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -64,7 +64,7 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( pView(pCurView), nMaxVirtWidth(DEFAULT_MAX_VIRT_WIDTH), nMaxVirtHeight(DEFAULT_MAX_VIRT_HEIGHT), nFlags(IconChoiceFlags::NONE), nUserEventAdjustScrBars(nullptr), pCurHighlightFrame(nullptr), bHighlightFramePressed(false), pHead(nullptr), pCursor(nullptr), - pHdlEntry(nullptr), pDDDev(nullptr), pDDBufDev(nullptr), pDDTempDev(nullptr), pEntryPaintDev(nullptr), + pHdlEntry(nullptr), pDDBufDev(nullptr), pAnchor(nullptr), eTextMode(SvxIconChoiceCtrlTextMode::Short), eSelectionMode(SelectionMode::Multiple), ePositionMode(SvxIconChoiceCtrlPositionMode::Free), bUpdateMode(true) @@ -110,10 +110,7 @@ SvxIconChoiceCtrl_Impl::~SvxIconChoiceCtrl_Impl() CancelUserEvents(); pImpCursor.reset(); pGridMap.reset(); - pDDDev.disposeAndClear(); pDDBufDev.disposeAndClear(); - pDDTempDev.disposeAndClear(); - pEntryPaintDev.disposeAndClear(); ClearSelectedRectList(); ClearColumnList(); aVerSBar.disposeAndClear(); @@ -186,10 +183,7 @@ IMPL_LINK( SvxIconChoiceCtrl_Impl, ScrollLeftRightHdl, ScrollBar*, pScrollBar, v void SvxIconChoiceCtrl_Impl::FontModified() { - pDDDev.disposeAndClear(); pDDBufDev.disposeAndClear(); - pDDTempDev.disposeAndClear(); - pEntryPaintDev.disposeAndClear(); SetDefaultTextSize(); ShowCursor( false ); ShowCursor( true ); @@ -1866,14 +1860,7 @@ void SvxIconChoiceCtrl_Impl::ShowCursor( bool bShow ) void SvxIconChoiceCtrl_Impl::HideDDIcon() { pView->Update(); - if( pDDDev ) - { - Size aSize( pDDDev->GetOutputSizePixel() ); - // restore pView - pView->DrawOutDev( Point(), aSize, Point(), aSize, *pDDDev ); - } - pDDBufDev = pDDDev; - pDDDev = nullptr; + pDDBufDev = nullptr; } bool SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd ) diff --git a/vcl/source/treelist/svimpbox.cxx b/vcl/source/treelist/svimpbox.cxx index b09cb6bc9d1a..baa2852c8170 100644 --- a/vcl/source/treelist/svimpbox.cxx +++ b/vcl/source/treelist/svimpbox.cxx @@ -107,7 +107,7 @@ SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvTreeList* pLBTree, WinBits nWinS m_bInVScrollHdl = false; m_nFlags |= LBoxFlags::Filling; - m_bSubLstOpRet = m_bSubLstOpLR = m_bContextMenuHandling = m_bIsCellFocusEnabled = false; + m_bSubLstOpRet = m_bSubLstOpLR = m_bContextMenuHandling = false; m_bSubLstOpDblClick = true; } @@ -212,11 +212,8 @@ void SvImpLBox::UpdateContextBmpWidthMax( SvTreeListEntry const * pEntry ) } } -void SvImpLBox::CalcCellFocusRect( SvTreeListEntry const * pEntry, tools::Rectangle& rRect ) +void SvImpLBox::CalcCellFocusRect( tools::Rectangle& rRect ) { - if ( !(pEntry && m_bIsCellFocusEnabled) ) - return; - if ( m_nCurTabPos > FIRST_ENTRY_TAB ) { SvLBoxItem& rItem = m_pCursor->GetItem( m_nCurTabPos ); @@ -586,7 +583,7 @@ void SvImpLBox::RecalcFocusRect() m_pView->HideFocus(); long nY = GetEntryLine( m_pCursor ); tools::Rectangle aRect = m_pView->GetFocusRect( m_pCursor, nY ); - CalcCellFocusRect( m_pCursor, aRect ); + CalcCellFocusRect( aRect ); vcl::Region aOldClip( m_pView->GetClipRegion()); vcl::Region aClipRegion( GetClipRegionRect() ); m_pView->SetClipRegion( aClipRegion ); @@ -682,7 +679,7 @@ void SvImpLBox::ShowCursor( bool bShow ) { long nY = GetEntryLine( m_pCursor ); tools::Rectangle aRect = m_pView->GetFocusRect( m_pCursor, nY ); - CalcCellFocusRect( m_pCursor, aRect ); + CalcCellFocusRect( aRect ); vcl::Region aOldClip( m_pView->GetClipRegion()); vcl::Region aClipRegion( GetClipRegionRect() ); m_pView->SetClipRegion( aClipRegion ); @@ -2240,15 +2237,6 @@ bool SvImpLBox::KeyInput( const KeyEvent& rKEvt) if( IsExpandable() && !m_pView->IsExpanded( m_pCursor ) ) m_pView->Expand( m_pCursor ); } - else if (m_bIsCellFocusEnabled) - { - if ( m_nCurTabPos < ( m_pView->TabCount() - 1 /*!2*/ ) ) - { - ++m_nCurTabPos; - ShowCursor( true ); - CallEventListeners( VclEventId::ListboxSelect, m_pCursor ); - } - } else if (m_aHorSBar->IsVisible()) { long nThumb = m_aHorSBar->GetThumbPos(); @@ -2271,16 +2259,7 @@ bool SvImpLBox::KeyInput( const KeyEvent& rKEvt) case KEY_LEFT: { - if (m_bIsCellFocusEnabled) - { - if ( m_nCurTabPos > FIRST_ENTRY_TAB ) - { - --m_nCurTabPos; - ShowCursor( true ); - CallEventListeners( VclEventId::ListboxSelect, m_pCursor ); - } - } - else if (m_aHorSBar->IsVisible()) + if (m_aHorSBar->IsVisible()) { long nThumb = m_aHorSBar->GetThumbPos(); nThumb -= m_aHorSBar->GetLineSize(); diff --git a/vcl/source/treelist/svtabbx.cxx b/vcl/source/treelist/svtabbx.cxx index ffea99cfca75..809f0885be4d 100644 --- a/vcl/source/treelist/svtabbx.cxx +++ b/vcl/source/treelist/svtabbx.cxx @@ -335,7 +335,7 @@ OUString SvTabListBox::GetTabEntryText( sal_uLong nPos, sal_uInt16 nCol ) const if ( pEntry ) { sal_uInt16 nCount = pEntry->ItemCount(); - sal_uInt16 nCur = ( 0 == nCol && IsCellFocusEnabled() ) ? GetCurrentTabPos() : 0; + sal_uInt16 nCur = 0; while( nCur < nCount ) { const SvLBoxItem& rBoxItem = pEntry->GetItem( nCur ); @@ -644,17 +644,9 @@ bool SvHeaderTabListBox::HasRowHeader() const return false; } -bool SvHeaderTabListBox::GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn ) +bool SvHeaderTabListBox::GoToCell( sal_Int32 /*_nRow*/, sal_uInt16 /*_nColumn*/ ) { - bool bRet = IsCellFocusEnabled(); - if ( bRet ) - { - // first set cursor to _nRow - SetCursor( GetEntry( _nRow ), true ); - // then set the focus into _nColumn - bRet = SetCurrentTabPos( _nColumn ); - } - return bRet; + return false; } void SvHeaderTabListBox::SetNoSelection() diff --git a/vcl/source/treelist/treelistbox.cxx b/vcl/source/treelist/treelistbox.cxx index 5e9629d266b4..9b30cd8ef976 100644 --- a/vcl/source/treelist/treelistbox.cxx +++ b/vcl/source/treelist/treelistbox.cxx @@ -3529,11 +3529,6 @@ void SvTreeListBox::InitSettings() pCheckButtonData->SetDefaultImages(this); } -bool SvTreeListBox::IsCellFocusEnabled() const -{ - return pImpl->IsCellFocusEnabled(); -} - bool SvTreeListBox::SetCurrentTabPos( sal_uInt16 _nNewPos ) { return pImpl->SetCurrentTabPos( _nNewPos ); |