diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-11-16 13:49:37 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-11-18 09:49:14 +0100 |
commit | 0fc7daed227ea6fd4fb3de04c92ae6cb765122c3 (patch) | |
tree | 2de30ad2686820ddc336cf5b883720ef58723b83 | |
parent | 227100ff4e5560c09c5a822052fc5ada541b8cc5 (diff) |
loplugin:singlevalfields
Change-Id: I0bb32ad7351f0e4cfbdc872ed0e81b8157ecc4cb
Reviewed-on: https://gerrit.libreoffice.org/83056
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | fpicker/source/office/iodlg.cxx | 7 | ||||
-rw-r--r-- | fpicker/source/office/iodlgimp.cxx | 1 | ||||
-rw-r--r-- | fpicker/source/office/iodlgimp.hxx | 1 | ||||
-rw-r--r-- | include/svtools/inettbc.hxx | 1 | ||||
-rw-r--r-- | include/svx/colorbox.hxx | 1 | ||||
-rw-r--r-- | svtools/source/control/inettbc.cxx | 10 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 20 |
7 files changed, 9 insertions, 32 deletions
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index db90c2f7f0f5..8357cc8f330e 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -110,7 +110,7 @@ namespace return pFilter->GetType(); } - bool restoreCurrentFilter( std::unique_ptr<SvtExpFileDlg_Impl> const & pImpl ) + void restoreCurrentFilter( std::unique_ptr<SvtExpFileDlg_Impl> const & pImpl ) { SAL_WARN_IF( !pImpl->GetCurFilter(), "fpicker.office", "restoreCurrentFilter: no current filter!" ); SAL_WARN_IF( pImpl->GetCurFilterDisplayName().isEmpty(), "fpicker.office", "restoreCurrentFilter: no current filter (no display name)!" ); @@ -123,7 +123,6 @@ namespace && ( sSelectedDisplayName == pImpl->GetCurFilterDisplayName() ), "restoreCurrentFilter: inconsistence!" ); #endif - return pImpl->m_bNeedDelayedFilterExecute; } @@ -916,8 +915,7 @@ IMPL_LINK_NOARG( SvtFileDialog, FilterSelectHdl_Impl, weld::ComboBox&, void ) { // there is no current selection. This happens if for instance the user selects a group separator using // the keyboard, and then presses enter: When the selection happens, we immediately deselect the entry, // so in this situation there is no current selection. - if ( restoreCurrentFilter( m_xImpl ) ) - ExecuteFilter(); + restoreCurrentFilter( m_xImpl ); } else { @@ -1072,7 +1070,6 @@ SvtFileDialogFilter_Impl* SvtFileDialog::FindFilter_Impl void SvtFileDialog::ExecuteFilter() { - m_xImpl->m_bNeedDelayedFilterExecute = false; executeAsync( AsyncPickerAction::eExecuteFilter, OUString(), getMostCurrentFilter(m_xImpl) ); } diff --git a/fpicker/source/office/iodlgimp.cxx b/fpicker/source/office/iodlgimp.cxx index 1ed153a7b248..89716e5c5b5d 100644 --- a/fpicker/source/office/iodlgimp.cxx +++ b/fpicker/source/office/iodlgimp.cxx @@ -121,7 +121,6 @@ SvtExpFileDlg_Impl::SvtExpFileDlg_Impl() , m_eDlgType( FILEDLG_TYPE_FILEDLG ) , m_nStyle( PickerFlags::NONE ) , m_bDoubleClick( false ) - , m_bNeedDelayedFilterExecute ( false ) , m_bMultiSelection( false ) { } diff --git a/fpicker/source/office/iodlgimp.hxx b/fpicker/source/office/iodlgimp.hxx index e816f56ebd6b..27e2731fd29a 100644 --- a/fpicker/source/office/iodlgimp.hxx +++ b/fpicker/source/office/iodlgimp.hxx @@ -155,7 +155,6 @@ public: // shows OpenHdl_Imp() if the open was triggered by a double click bool m_bDoubleClick; - bool m_bNeedDelayedFilterExecute; // MultiSelection? bool m_bMultiSelection; diff --git a/include/svtools/inettbc.hxx b/include/svtools/inettbc.hxx index 3791632555ec..b6851e845f14 100644 --- a/include/svtools/inettbc.hxx +++ b/include/svtools/inettbc.hxx @@ -43,7 +43,6 @@ friend class SvtURLBox_Impl; INetProtocol eSmartProtocol; bool bAutoCompleteMode : 1; bool bHistoryDisabled : 1; - bool bIsAutoCompleteEnabled : 1; SVT_DLLPRIVATE bool ProcessKey( const vcl::KeyCode& rCode ); SVT_DLLPRIVATE void TryAutoComplete(); diff --git a/include/svx/colorbox.hxx b/include/svx/colorbox.hxx index 16d5fa1be3d2..d9bde63bdaa5 100644 --- a/include/svx/colorbox.hxx +++ b/include/svx/colorbox.hxx @@ -38,7 +38,6 @@ private: Color m_aAutoDisplayColor; NamedColor m_aSelectedColor; sal_uInt16 m_nSlotId; - bool m_bShowNoneButton; std::shared_ptr<PaletteManager> m_xPaletteManager; ColorStatus m_aColorStatus; diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx index 1603a0fc824a..5ffd546dad6c 100644 --- a/svtools/source/control/inettbc.cxx +++ b/svtools/source/control/inettbc.cxx @@ -1356,7 +1356,7 @@ void SvtURLBox::TryAutoComplete() return; sal_uInt16 nLen = static_cast<sal_uInt16>(aSelection.Min()); aCurText = aCurText.copy( 0, nLen ); - if( !aCurText.isEmpty() && bIsAutoCompleteEnabled ) + if( !aCurText.isEmpty() ) { if ( pCtx.is() ) { @@ -1374,8 +1374,7 @@ SvtURLBox::SvtURLBox( vcl::Window* pParent, INetProtocol eSmart, bool bSetDefaul : ComboBox( pParent , WB_DROPDOWN | WB_AUTOHSCROLL ), eSmartProtocol( eSmart ), bAutoCompleteMode( false ), - bHistoryDisabled( false ), - bIsAutoCompleteEnabled( true ) + bHistoryDisabled( false ) { Init(bSetDefaultHelpID); @@ -1391,8 +1390,7 @@ SvtURLBox::SvtURLBox( vcl::Window* pParent, WinBits _nStyle, INetProtocol eSmart : ComboBox( pParent, _nStyle ), eSmartProtocol( eSmart ), bAutoCompleteMode( false ), - bHistoryDisabled( false ), - bIsAutoCompleteEnabled( true ) + bHistoryDisabled( false ) { Init(bSetDefaultHelpID); } @@ -1440,7 +1438,7 @@ void SvtURLBox::UpdatePickList( ) } OUString sText = GetText(); - if ( !sText.isEmpty() && bIsAutoCompleteEnabled ) + if ( !sText.isEmpty() ) { pCtx = new SvtMatchContext_Impl( this, sText ); pCtx->launch(); diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 782dd2cc16cb..a8025d6a95dd 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -3914,7 +3914,6 @@ SvxColorListBox::SvxColorListBox(vcl::Window* pParent, WinBits nStyle) , m_aColorWrapper(this) , m_aAutoDisplayColor(Application::GetSettings().GetStyleSettings().GetDialogColor()) , m_nSlotId(0) - , m_bShowNoneButton(false) { m_aSelectedColor = GetAutoColor(m_nSlotId); LockWidthRequest(); @@ -3943,7 +3942,6 @@ void ColorListBox::EnsurePaletteManager() void SvxColorListBox::SetSlotId(sal_uInt16 nSlotId) { m_nSlotId = nSlotId; - m_bShowNoneButton = false; m_xColorWindow.disposeAndClear(); m_aSelectedColor = GetAutoColor(m_nSlotId); ShowPreview(m_aSelectedColor); @@ -3993,20 +3991,10 @@ void SvxColorListBox::ShowPreview(const NamedColor &rColor) ScopedVclPtrInstance<VirtualDevice> xDevice; xDevice->SetOutputSize(aImageSize); const tools::Rectangle aRect(Point(0, 0), aImageSize); - if (m_bShowNoneButton && rColor.first == COL_NONE_COLOR) - { - const Color aW(COL_WHITE); - const Color aG(0xef, 0xef, 0xef); - xDevice->DrawCheckered(aRect.TopLeft(), aRect.GetSize(), 8, aW, aG); - xDevice->SetFillColor(); - } + if (rColor.first == COL_AUTO) + xDevice->SetFillColor(m_aAutoDisplayColor); else - { - if (rColor.first == COL_AUTO) - xDevice->SetFillColor(m_aAutoDisplayColor); - else - xDevice->SetFillColor(rColor.first); - } + xDevice->SetFillColor(rColor.first); xDevice->SetLineColor(rStyleSettings.GetDisableColor()); xDevice->DrawRect(aRect); @@ -4053,8 +4041,6 @@ void SvxColorListBox::createColorWindow() m_xColorWindow->AddEventListener(LINK(this, SvxColorListBox, WindowEventListener)); SetNoSelection(); - if (m_bShowNoneButton) - m_xColorWindow->ShowNoneButton(); m_xColorWindow->SelectEntry(m_aSelectedColor); SetPopover(m_xColorWindow); } |