summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-12-20 14:33:02 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-12-21 07:26:51 +0100
commit526387b96e9bc2c04b0dc26744bf6b88ea7c0521 (patch)
tree3c80e92df338107d0b0e7ce3e889723a91d798e4
parentd9d8ec2521cd59940792902d4757f33c327130a3 (diff)
loplugin:unnecessaryvirtual
Change-Id: I4ca101ba838afecbbc8e841a6a9fa6c9c0460f14 Reviewed-on: https://gerrit.libreoffice.org/65497 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--compilerplugins/clang/unnecessaryvirtual.results8
-rw-r--r--include/vcl/combobox.hxx4
-rw-r--r--vcl/source/control/combobox.cxx4
3 files changed, 9 insertions, 7 deletions
diff --git a/compilerplugins/clang/unnecessaryvirtual.results b/compilerplugins/clang/unnecessaryvirtual.results
index 107bd14a2105..6851f491c4bb 100644
--- a/compilerplugins/clang/unnecessaryvirtual.results
+++ b/compilerplugins/clang/unnecessaryvirtual.results
@@ -20,8 +20,6 @@ basic/source/comp/codegen.cxx:524
_Bool BufferTransformer::processParams()
chart2/source/inc/WeakListenerAdapter.hxx:57
void chart::WeakListenerAdapter::disposing(const struct com::sun::star::lang::EventObject &,)
-cppcanvas/source/inc/implrenderer.hxx:69
- void cppcanvas::internal::EMFPObject::~EMFPObject()
extensions/source/dbpilots/unoautopilot.hxx:99
class cppu::IPropertyArrayHelper * dbp::OUnoAutoPilot::createArrayHelper()const
extensions/source/propctrlr/commoncontrol.hxx:127
@@ -112,8 +110,10 @@ include/vbahelper/vbareturntypes.hxx:40
void ooo::vba::DefaultReturnHelper::setValue(type-parameter-0-0,)
include/vbahelper/vbareturntypes.hxx:41
type-parameter-0-0 ooo::vba::DefaultReturnHelper::getValue()
-include/vcl/tabctrl.hxx:113
- _Bool TabControl::DeactivatePage()
+include/vcl/combobox.hxx:86
+ int ComboBox::InsertEntry(const class rtl::OUString &,int,)
+include/vcl/combobox.hxx:90
+ void ComboBox::RemoveEntryAt(int,)
sc/source/core/opencl/formulagroupcl.cxx:1051
_Bool sc::opencl::DynamicKernelSlidingArgument::NeedParallelReduction()const
sc/source/core/opencl/formulagroupcl.cxx:1059
diff --git a/include/vcl/combobox.hxx b/include/vcl/combobox.hxx
index 9dc14739f4e1..1571cca6961e 100644
--- a/include/vcl/combobox.hxx
+++ b/include/vcl/combobox.hxx
@@ -83,11 +83,11 @@ public:
virtual void SetText( const OUString& rStr ) override;
virtual void SetText( const OUString& rStr, const Selection& rNewSelection ) override;
- virtual sal_Int32 InsertEntry(const OUString& rStr, sal_Int32 nPos = COMBOBOX_APPEND);
+ sal_Int32 InsertEntry(const OUString& rStr, sal_Int32 nPos = COMBOBOX_APPEND);
sal_Int32 InsertEntryWithImage( const OUString& rStr, const Image& rImage, sal_Int32 nPos = COMBOBOX_APPEND );
void RemoveEntry( const OUString& rStr );
- virtual void RemoveEntryAt(sal_Int32 nPos);
+ void RemoveEntryAt(sal_Int32 nPos);
void Clear();
void EnableSelectAll();
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 3eca5c6f0598..a13ee2e4b2b7 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -921,8 +921,10 @@ void ComboBox::RemoveEntryAt(sal_Int32 const nPos)
{
const sal_Int32 nMRUCount = m_pImpl->m_pImplLB->GetEntryList()->GetMRUCount();
if (nPos < 0 || nPos > COMBOBOX_MAX_ENTRIES - nMRUCount)
+ {
+ assert("bad position");
return;
-
+ }
m_pImpl->m_pImplLB->RemoveEntry( nPos + nMRUCount );
CallEventListeners( VclEventId::ComboboxItemRemoved, reinterpret_cast<void*>(nPos) );
}