loplugin:singlevalfields

Change-Id: I0bb32ad7351f0e4cfbdc872ed0e81b8157ecc4cb
Reviewed-on: https://gerrit.libreoffice.org/83056
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2019-11-16 13:49:37 +02:00
parent 227100ff4e
commit 0fc7daed22
7 changed files with 9 additions and 32 deletions

View File

@@ -110,7 +110,7 @@ namespace
return pFilter->GetType(); 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->GetCurFilter(), "fpicker.office", "restoreCurrentFilter: no current filter!" );
SAL_WARN_IF( pImpl->GetCurFilterDisplayName().isEmpty(), "fpicker.office", "restoreCurrentFilter: no current filter (no display name)!" ); SAL_WARN_IF( pImpl->GetCurFilterDisplayName().isEmpty(), "fpicker.office", "restoreCurrentFilter: no current filter (no display name)!" );
@@ -123,7 +123,6 @@ namespace
&& ( sSelectedDisplayName == pImpl->GetCurFilterDisplayName() ), && ( sSelectedDisplayName == pImpl->GetCurFilterDisplayName() ),
"restoreCurrentFilter: inconsistence!" ); "restoreCurrentFilter: inconsistence!" );
#endif #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 { // 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, // the keyboard, and then presses enter: When the selection happens, we immediately deselect the entry,
// so in this situation there is no current selection. // so in this situation there is no current selection.
if ( restoreCurrentFilter( m_xImpl ) ) restoreCurrentFilter( m_xImpl );
ExecuteFilter();
} }
else else
{ {
@@ -1072,7 +1070,6 @@ SvtFileDialogFilter_Impl* SvtFileDialog::FindFilter_Impl
void SvtFileDialog::ExecuteFilter() void SvtFileDialog::ExecuteFilter()
{ {
m_xImpl->m_bNeedDelayedFilterExecute = false;
executeAsync( AsyncPickerAction::eExecuteFilter, OUString(), getMostCurrentFilter(m_xImpl) ); executeAsync( AsyncPickerAction::eExecuteFilter, OUString(), getMostCurrentFilter(m_xImpl) );
} }

View File

@@ -121,7 +121,6 @@ SvtExpFileDlg_Impl::SvtExpFileDlg_Impl()
, m_eDlgType( FILEDLG_TYPE_FILEDLG ) , m_eDlgType( FILEDLG_TYPE_FILEDLG )
, m_nStyle( PickerFlags::NONE ) , m_nStyle( PickerFlags::NONE )
, m_bDoubleClick( false ) , m_bDoubleClick( false )
, m_bNeedDelayedFilterExecute ( false )
, m_bMultiSelection( false ) , m_bMultiSelection( false )
{ {
} }

View File

@@ -155,7 +155,6 @@ public:
// shows OpenHdl_Imp() if the open was triggered by a double click // shows OpenHdl_Imp() if the open was triggered by a double click
bool m_bDoubleClick; bool m_bDoubleClick;
bool m_bNeedDelayedFilterExecute;
// MultiSelection? // MultiSelection?
bool m_bMultiSelection; bool m_bMultiSelection;

View File

@@ -43,7 +43,6 @@ friend class SvtURLBox_Impl;
INetProtocol eSmartProtocol; INetProtocol eSmartProtocol;
bool bAutoCompleteMode : 1; bool bAutoCompleteMode : 1;
bool bHistoryDisabled : 1; bool bHistoryDisabled : 1;
bool bIsAutoCompleteEnabled : 1;
SVT_DLLPRIVATE bool ProcessKey( const vcl::KeyCode& rCode ); SVT_DLLPRIVATE bool ProcessKey( const vcl::KeyCode& rCode );
SVT_DLLPRIVATE void TryAutoComplete(); SVT_DLLPRIVATE void TryAutoComplete();

View File

@@ -38,7 +38,6 @@ private:
Color m_aAutoDisplayColor; Color m_aAutoDisplayColor;
NamedColor m_aSelectedColor; NamedColor m_aSelectedColor;
sal_uInt16 m_nSlotId; sal_uInt16 m_nSlotId;
bool m_bShowNoneButton;
std::shared_ptr<PaletteManager> m_xPaletteManager; std::shared_ptr<PaletteManager> m_xPaletteManager;
ColorStatus m_aColorStatus; ColorStatus m_aColorStatus;

View File

@@ -1356,7 +1356,7 @@ void SvtURLBox::TryAutoComplete()
return; return;
sal_uInt16 nLen = static_cast<sal_uInt16>(aSelection.Min()); sal_uInt16 nLen = static_cast<sal_uInt16>(aSelection.Min());
aCurText = aCurText.copy( 0, nLen ); aCurText = aCurText.copy( 0, nLen );
if( !aCurText.isEmpty() && bIsAutoCompleteEnabled ) if( !aCurText.isEmpty() )
{ {
if ( pCtx.is() ) if ( pCtx.is() )
{ {
@@ -1374,8 +1374,7 @@ SvtURLBox::SvtURLBox( vcl::Window* pParent, INetProtocol eSmart, bool bSetDefaul
: ComboBox( pParent , WB_DROPDOWN | WB_AUTOHSCROLL ), : ComboBox( pParent , WB_DROPDOWN | WB_AUTOHSCROLL ),
eSmartProtocol( eSmart ), eSmartProtocol( eSmart ),
bAutoCompleteMode( false ), bAutoCompleteMode( false ),
bHistoryDisabled( false ), bHistoryDisabled( false )
bIsAutoCompleteEnabled( true )
{ {
Init(bSetDefaultHelpID); Init(bSetDefaultHelpID);
@@ -1391,8 +1390,7 @@ SvtURLBox::SvtURLBox( vcl::Window* pParent, WinBits _nStyle, INetProtocol eSmart
: ComboBox( pParent, _nStyle ), : ComboBox( pParent, _nStyle ),
eSmartProtocol( eSmart ), eSmartProtocol( eSmart ),
bAutoCompleteMode( false ), bAutoCompleteMode( false ),
bHistoryDisabled( false ), bHistoryDisabled( false )
bIsAutoCompleteEnabled( true )
{ {
Init(bSetDefaultHelpID); Init(bSetDefaultHelpID);
} }
@@ -1440,7 +1438,7 @@ void SvtURLBox::UpdatePickList( )
} }
OUString sText = GetText(); OUString sText = GetText();
if ( !sText.isEmpty() && bIsAutoCompleteEnabled ) if ( !sText.isEmpty() )
{ {
pCtx = new SvtMatchContext_Impl( this, sText ); pCtx = new SvtMatchContext_Impl( this, sText );
pCtx->launch(); pCtx->launch();

View File

@@ -3914,7 +3914,6 @@ SvxColorListBox::SvxColorListBox(vcl::Window* pParent, WinBits nStyle)
, m_aColorWrapper(this) , m_aColorWrapper(this)
, m_aAutoDisplayColor(Application::GetSettings().GetStyleSettings().GetDialogColor()) , m_aAutoDisplayColor(Application::GetSettings().GetStyleSettings().GetDialogColor())
, m_nSlotId(0) , m_nSlotId(0)
, m_bShowNoneButton(false)
{ {
m_aSelectedColor = GetAutoColor(m_nSlotId); m_aSelectedColor = GetAutoColor(m_nSlotId);
LockWidthRequest(); LockWidthRequest();
@@ -3943,7 +3942,6 @@ void ColorListBox::EnsurePaletteManager()
void SvxColorListBox::SetSlotId(sal_uInt16 nSlotId) void SvxColorListBox::SetSlotId(sal_uInt16 nSlotId)
{ {
m_nSlotId = nSlotId; m_nSlotId = nSlotId;
m_bShowNoneButton = false;
m_xColorWindow.disposeAndClear(); m_xColorWindow.disposeAndClear();
m_aSelectedColor = GetAutoColor(m_nSlotId); m_aSelectedColor = GetAutoColor(m_nSlotId);
ShowPreview(m_aSelectedColor); ShowPreview(m_aSelectedColor);
@@ -3993,20 +3991,10 @@ void SvxColorListBox::ShowPreview(const NamedColor &rColor)
ScopedVclPtrInstance<VirtualDevice> xDevice; ScopedVclPtrInstance<VirtualDevice> xDevice;
xDevice->SetOutputSize(aImageSize); xDevice->SetOutputSize(aImageSize);
const tools::Rectangle aRect(Point(0, 0), aImageSize); const tools::Rectangle aRect(Point(0, 0), aImageSize);
if (m_bShowNoneButton && rColor.first == COL_NONE_COLOR) if (rColor.first == COL_AUTO)
{ xDevice->SetFillColor(m_aAutoDisplayColor);
const Color aW(COL_WHITE);
const Color aG(0xef, 0xef, 0xef);
xDevice->DrawCheckered(aRect.TopLeft(), aRect.GetSize(), 8, aW, aG);
xDevice->SetFillColor();
}
else else
{ xDevice->SetFillColor(rColor.first);
if (rColor.first == COL_AUTO)
xDevice->SetFillColor(m_aAutoDisplayColor);
else
xDevice->SetFillColor(rColor.first);
}
xDevice->SetLineColor(rStyleSettings.GetDisableColor()); xDevice->SetLineColor(rStyleSettings.GetDisableColor());
xDevice->DrawRect(aRect); xDevice->DrawRect(aRect);
@@ -4053,8 +4041,6 @@ void SvxColorListBox::createColorWindow()
m_xColorWindow->AddEventListener(LINK(this, SvxColorListBox, WindowEventListener)); m_xColorWindow->AddEventListener(LINK(this, SvxColorListBox, WindowEventListener));
SetNoSelection(); SetNoSelection();
if (m_bShowNoneButton)
m_xColorWindow->ShowNoneButton();
m_xColorWindow->SelectEntry(m_aSelectedColor); m_xColorWindow->SelectEntry(m_aSelectedColor);
SetPopover(m_xColorWindow); SetPopover(m_xColorWindow);
} }