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();
}
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) );
}

View File

@@ -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 )
{
}

View File

@@ -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;

View File

@@ -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();

View File

@@ -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;

View File

@@ -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();

View File

@@ -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);
}