diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-21 13:07:10 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-23 10:41:38 +0100 |
commit | 91b4e4531621b7afb2dbab1a8aa62c92da66951a (patch) | |
tree | f36ee2468313a4000e310b4db4903c96e747a03e /vcl | |
parent | ea20bc176cbf575e39c602a91dd3e6919b3fc31e (diff) |
new loplugin: pointerbool
look for possibly bogus implicit conversions to bool when passing
(normally pointer) args to bool params.
this plugin comes in the wake of a couple of bugs caused by refactoring,
where some of the call sites were not currently updated.
Of the changes, the following are real bugs:
desktop/../dp_persmap.cxx
StartInputFieldDlg
in sw/../fldmgr.cxx
which occurred as a result of
commit 39d719a80d8c87856c84e3ecd569d45fa6f8a30e
Date: Tue May 3 11:39:37 2016 +0200
tdf#99529 sw: don't pop up input field dialog before inserting field
CSerializationURLEncoded::encode_and_append in
forms/../serialization_urlencoded.cxx
XclExpCFImpl::XclExpCFImpl
in sc/../xecontent.cxx
I have no idea how to properly fix this, just made a guess.
SwDocTest::test64kPageDescs
in sw/qa/core/uwriter.cxx
which looks like a simple copy/paste error.
Change-Id: I795ebd5ef485a1d36863dc27fe13832989f5a441
Reviewed-on: https://gerrit.libreoffice.org/48291
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/control/combobox.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/edit.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk/gtksalframe.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkframe.cxx | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index 531284cf86eb..daf90a3333bc 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -853,7 +853,7 @@ void ComboBox::Impl::ImplUpdateFloatSelection() ::std::set< sal_Int32 > aSelInText; lcl_GetSelectedEntries(aSelInText, m_pSubEdit->GetText(), m_cMultiSep, m_pImplLB->GetEntryList()); for (sal_Int32 n = 0; n < m_pImplLB->GetEntryList()->GetEntryCount(); n++) - m_pImplLB->SelectEntry( n, aSelInText.count( n ) ); + m_pImplLB->SelectEntry( n, aSelInText.count( n ) != 0 ); } m_pImplLB->SetCallSelectionChangedHdl( true ); } diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index fc8d7299780c..4dd99139c2f5 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -1978,7 +1978,7 @@ void Edit::Command( const CommandEvent& rCEvt ) pPopup->EnableItem(pPopup->GetItemId("undo"), maUndoText != maText.getStr()); bool bAllSelected = maSelection.Min() == 0 && maSelection.Max() == maText.getLength(); pPopup->EnableItem(pPopup->GetItemId("selectall"), !bAllSelected); - pPopup->ShowItem(pPopup->GetItemId("specialchar"), pImplFncGetSpecialChars); + pPopup->ShowItem(pPopup->GetItemId("specialchar"), pImplFncGetSpecialChars != nullptr); mbActivePopup = true; Selection aSaveSel = GetSelection(); // if someone changes selection in Get/LoseFocus, e.g. URL bar diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx index d297d7ad7cfd..880e1244bd36 100644 --- a/vcl/unx/gtk/gtksalframe.cxx +++ b/vcl/unx/gtk/gtksalframe.cxx @@ -2894,7 +2894,7 @@ gboolean GtkSalFrame::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer f pThis->m_nKeyModifiers = ModKeyFlags::NONE; if( pThis->m_pIMHandler ) - pThis->m_pIMHandler->focusChanged( pEvent->in ); + pThis->m_pIMHandler->focusChanged( pEvent->in != 0 ); // ask for changed printers like generic implementation if( pEvent->in && pSalInstance->isPrinterInit() ) diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx index 485ef9323d0d..e5236108df1c 100644 --- a/vcl/unx/gtk3/gtk3gtkframe.cxx +++ b/vcl/unx/gtk3/gtk3gtkframe.cxx @@ -3005,7 +3005,7 @@ gboolean GtkSalFrame::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer f pThis->m_nKeyModifiers = ModKeyFlags::NONE; if( pThis->m_pIMHandler ) - pThis->m_pIMHandler->focusChanged( pEvent->in ); + pThis->m_pIMHandler->focusChanged( pEvent->in != 0 ); // ask for changed printers like generic implementation if( pEvent->in && pSalInstance->isPrinterInit() ) |