diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-12-08 14:59:51 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-12-09 07:18:17 +0100 |
commit | 0d43b791e60aa75eb7f769d0f9b3177f93e1591c (patch) | |
tree | 0f22f0ab1972013ff6c7cce91895d1b69c236dfb /cui | |
parent | 145280ffd1dabdc629c14c8162beef668741bcef (diff) |
loplugin:unusedmethods
Change-Id: I4f2635d468c9ad83b3ac93733529e01a4d03f38e
Reviewed-on: https://gerrit.libreoffice.org/64805
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/inc/autocdlg.hxx | 27 | ||||
-rw-r--r-- | cui/source/tabpages/autocdlg.cxx | 102 |
2 files changed, 0 insertions, 129 deletions
diff --git a/cui/source/inc/autocdlg.hxx b/cui/source/inc/autocdlg.hxx index 465ee0a34498..029cfd744b64 100644 --- a/cui/source/inc/autocdlg.hxx +++ b/cui/source/inc/autocdlg.hxx @@ -56,33 +56,6 @@ public: // class OfaACorrCheckListBox ------------------------------------------ -class OfaACorrCheckListBox : public SvSimpleTable -{ - using SvSimpleTable::SetTabs; - using SvTreeListBox::GetCheckButtonState; - using SvTreeListBox::SetCheckButtonState; - - protected: - virtual void SetTabs() override; - virtual void HBarClick() override; - virtual void KeyInput( const KeyEvent& rKEvt ) override; - - public: - OfaACorrCheckListBox(SvSimpleTableContainer& rParent) - : SvSimpleTable(rParent, WB_BORDER) - { - } - - void *GetUserData(sal_uLong nPos) { return GetEntry(nPos)->GetUserData(); } - void SetUserData(sal_uLong nPos, void *pData ) { GetEntry(nPos)->SetUserData(pData); } - sal_uLong GetSelectedEntryPos() { return GetModel()->GetAbsPos(FirstSelected()); } - - bool IsChecked(sal_uLong nPos, sal_uInt16 nCol = 0); - void CheckEntryPos(sal_uLong nPos, sal_uInt16 nCol, bool bChecked); - static SvButtonState GetCheckButtonState( SvTreeListEntry*, sal_uInt16 nCol ); - void SetCheckButtonState( SvTreeListEntry*, sal_uInt16 nCol, SvButtonState ); -}; - // class OfaAutocorrOptionsPage ------------------------------------------ diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index 153d9af05823..add6fb72f3cf 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -654,108 +654,6 @@ IMPL_LINK_NOARG(OfaSwAutoFmtOptionsPage, EditHdl, weld::Button&, void) } } -void OfaACorrCheckListBox::SetTabs() -{ - SvSimpleTable::SetTabs(); - SvLBoxTabFlags nAdjust = SvLBoxTabFlags::ADJUST_RIGHT|SvLBoxTabFlags::ADJUST_LEFT|SvLBoxTabFlags::ADJUST_CENTER|SvLBoxTabFlags::FORCE; - - if( aTabs.size() > 1 ) - { - SvLBoxTab* pTab = aTabs[1].get(); - pTab->nFlags &= ~nAdjust; - pTab->nFlags |= SvLBoxTabFlags::ADJUST_CENTER|SvLBoxTabFlags::FORCE; - } - if( aTabs.size() > 2 ) - { - SvLBoxTab* pTab = aTabs[2].get(); - pTab->nFlags &= ~nAdjust; - pTab->nFlags |= SvLBoxTabFlags::ADJUST_CENTER|SvLBoxTabFlags::FORCE; - } -} - -void OfaACorrCheckListBox::CheckEntryPos(sal_uLong nPos, sal_uInt16 nCol, bool bChecked) -{ - if ( nPos < GetEntryCount() ) - SetCheckButtonState( - GetEntry(nPos), - nCol, - bChecked ? SvButtonState::Checked : SvButtonState::Unchecked ); -} - -bool OfaACorrCheckListBox::IsChecked(sal_uLong nPos, sal_uInt16 nCol) -{ - return GetCheckButtonState( GetEntry(nPos), nCol ) == SvButtonState::Checked; -} - -void OfaACorrCheckListBox::SetCheckButtonState( SvTreeListEntry* pEntry, sal_uInt16 nCol, SvButtonState eState) -{ - SvLBoxButton& rItem = static_cast<SvLBoxButton&>(pEntry->GetItem(nCol + 1)); - - if (rItem.GetType() == SvLBoxItemType::Button) - { - switch( eState ) - { - case SvButtonState::Checked: - rItem.SetStateChecked(); - break; - - case SvButtonState::Unchecked: - rItem.SetStateUnchecked(); - break; - - case SvButtonState::Tristate: - rItem.SetStateTristate(); - break; - } - InvalidateEntry( pEntry ); - } -} - -SvButtonState OfaACorrCheckListBox::GetCheckButtonState( SvTreeListEntry* pEntry, sal_uInt16 nCol ) -{ - SvButtonState eState = SvButtonState::Unchecked; - SvLBoxButton& rItem = static_cast<SvLBoxButton&>(pEntry->GetItem(nCol + 1)); - - if (rItem.GetType() == SvLBoxItemType::Button) - { - SvItemStateFlags nButtonFlags = rItem.GetButtonFlags(); - eState = SvLBoxButtonData::ConvertToButtonState( nButtonFlags ); - } - - return eState; -} - -void OfaACorrCheckListBox::HBarClick() -{ - // sorting is stopped by this override -} - -void OfaACorrCheckListBox::KeyInput( const KeyEvent& rKEvt ) -{ - if(!rKEvt.GetKeyCode().GetModifier() && - KEY_SPACE == rKEvt.GetKeyCode().GetCode()) - { - sal_uLong nSelPos = GetSelectedEntryPos(); - sal_uInt16 nCol = GetCurrentTabPos() - 1; - if ( nCol < 2 ) - { - CheckEntryPos( nSelPos, nCol, !IsChecked( nSelPos, nCol ) ); - CallImplEventListeners( VclEventId::CheckboxToggle, static_cast<void*>(GetEntry( nSelPos )) ); - } - else - { - sal_uInt16 nCheck = IsChecked(nSelPos, 1) ? 1 : 0; - if(IsChecked(nSelPos)) - nCheck += 2; - nCheck--; - nCheck &= 3; - CheckEntryPos(nSelPos, 1, 0 != (nCheck & 1)); - CheckEntryPos(nSelPos, 0, 0 != (nCheck & 2)); - } - } - else - SvSimpleTable::KeyInput(rKEvt); -} OfaAutocorrReplacePage::OfaAutocorrReplacePage(TabPageParent pParent, const SfxItemSet& rSet) |