[Libreoffice-commits] core.git: 2 commits - compilerplugins/clang sc/inc sc/source sw/inc

Noel Grandin noel.grandin at collabora.co.uk
Thu Mar 15 06:30:53 UTC 2018


 compilerplugins/clang/unusedmethods.results                |  188 +++++++------
 compilerplugins/clang/unusedmethods.unused-returns.results |   50 ---
 sc/inc/address.hxx                                         |    5 
 sc/inc/rangelst.hxx                                        |   17 -
 sc/source/core/data/documen3.cxx                           |    6 
 sc/source/core/tool/compiler.cxx                           |   18 -
 sc/source/core/tool/rangelst.cxx                           |   93 +++---
 sc/source/filter/excel/xecontent.cxx                       |    4 
 sc/source/ui/miscdlgs/crnrdlg.cxx                          |   12 
 sc/source/ui/unoobj/nameuno.cxx                            |   29 --
 sw/inc/calbck.hxx                                          |    2 
 11 files changed, 199 insertions(+), 225 deletions(-)

New commits:
commit c1ee9b9f746296b916569a1357aa8f1216d40535
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Mar 14 16:59:30 2018 +0200

    loplugin:unusedmethods
    
    Change-Id: Ice171112d3e737cf0e0edabbc59a1307a4a4f5ad
    Reviewed-on: https://gerrit.libreoffice.org/51282
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/compilerplugins/clang/unusedmethods.results b/compilerplugins/clang/unusedmethods.results
index 3c535defd69c..351e78273543 100644
--- a/compilerplugins/clang/unusedmethods.results
+++ b/compilerplugins/clang/unusedmethods.results
@@ -6,6 +6,8 @@ basic/source/inc/buffer.hxx:42
     void SbiBuffer::operator+=(short)
 basic/source/inc/buffer.hxx:46
     void SbiBuffer::operator+=(int)
+canvas/source/vcl/impltools.hxx:105
+     vclcanvas::tools::LocalGuard::LocalGuard()
 connectivity/source/drivers/evoab2/NResultSetMetaData.hxx:51
     class com::sun::star::uno::Reference<class com::sun::star::sdbc::XResultSetMetaData> connectivity::evoab::OEvoabResultSetMetaData::operator Reference()
 connectivity/source/drivers/firebird/Driver.hxx:65
@@ -44,7 +46,7 @@ connectivity/source/inc/OTypeInfo.hxx:55
     _Bool connectivity::OTypeInfo::operator==(const struct connectivity::OTypeInfo &) const
 connectivity/source/inc/OTypeInfo.hxx:56
     _Bool connectivity::OTypeInfo::operator!=(const struct connectivity::OTypeInfo &) const
-dbaccess/source/ui/browser/genericcontroller.cxx:1230
+dbaccess/source/ui/browser/genericcontroller.cxx:1215
     const type-parameter-?-? & dbaui::(anonymous namespace)::SGI_identity::operator()(const type-parameter-?-? &) const
 dbaccess/source/ui/inc/indexcollection.hxx:54
     class __gnu_debug::_Safe_iterator<class __gnu_cxx::__normal_iterator<const struct dbaui::OIndex *, class std::__cxx1998::vector<struct dbaui::OIndex, class std::allocator<struct dbaui::OIndex> > >, class std::__debug::vector<struct dbaui::OIndex, class std::allocator<struct dbaui::OIndex> > > dbaui::OIndexCollection::begin() const
@@ -86,6 +88,10 @@ drawinglayer/source/tools/emfpstringformat.hxx:57
     _Bool emfplushelper::EMFPStringFormat::NoClip() const
 drawinglayer/source/tools/emfpstringformat.hxx:58
     _Bool emfplushelper::EMFPStringFormat::BypassGDI() const
+editeng/inc/edtspell.hxx:112
+    class __gnu_debug::_Safe_iterator<class __gnu_cxx::__normal_iterator<const struct editeng::MisspellRange *, class std::__cxx1998::vector<struct editeng::MisspellRange, class std::allocator<struct editeng::MisspellRange> > >, class std::__debug::vector<struct editeng::MisspellRange, class std::allocator<struct editeng::MisspellRange> > > WrongList::begin() const
+editeng/inc/edtspell.hxx:113
+    class __gnu_debug::_Safe_iterator<class __gnu_cxx::__normal_iterator<const struct editeng::MisspellRange *, class std::__cxx1998::vector<struct editeng::MisspellRange, class std::allocator<struct editeng::MisspellRange> > >, class std::__debug::vector<struct editeng::MisspellRange, class std::allocator<struct editeng::MisspellRange> > > WrongList::end() const
 extensions/source/scanner/scanner.hxx:81
     void ScannerManager::SetData(void *)
 framework/source/uiconfiguration/ImageList.hxx:51
@@ -240,6 +246,34 @@ include/basegfx/vector/b3dvector.hxx:85
     class basegfx::B3DVector & basegfx::B3DVector::operator*=(const class basegfx::B3DVector &)
 include/basic/sbxvar.hxx:133
     struct SbxValues * SbxValue::data()
+include/canvas/rendering/icolorbuffer.hxx:49
+    unsigned char * canvas::IColorBuffer::lock() const
+include/canvas/rendering/icolorbuffer.hxx:53
+    void canvas::IColorBuffer::unlock() const
+include/canvas/rendering/icolorbuffer.hxx:68
+    unsigned int canvas::IColorBuffer::getStride() const
+include/canvas/rendering/icolorbuffer.hxx:72
+    enum canvas::IColorBuffer::Format canvas::IColorBuffer::getFormat() const
+include/canvas/rendering/isurfaceproxy.hxx:42
+    void canvas::ISurfaceProxy::setColorBufferDirty()
+include/canvas/rendering/isurfaceproxy.hxx:55
+    _Bool canvas::ISurfaceProxy::draw(double,const class basegfx::B2DPoint &,const class basegfx::B2DHomMatrix &)
+include/canvas/rendering/isurfaceproxy.hxx:75
+    _Bool canvas::ISurfaceProxy::draw(double,const class basegfx::B2DPoint &,const class basegfx::B2DRange &,const class basegfx::B2DHomMatrix &)
+include/canvas/rendering/isurfaceproxy.hxx:95
+    _Bool canvas::ISurfaceProxy::draw(double,const class basegfx::B2DPoint &,const class basegfx::B2DPolyPolygon &,const class basegfx::B2DHomMatrix &)
+include/canvas/rendering/isurfaceproxymanager.hxx:58
+    class std::shared_ptr<struct canvas::ISurfaceProxy> canvas::ISurfaceProxyManager::createSurfaceProxy(const class std::shared_ptr<struct canvas::IColorBuffer> &) const
+include/canvas/rendering/isurfaceproxymanager.hxx:64
+    class std::shared_ptr<struct canvas::ISurfaceProxyManager> createSurfaceProxyManager(const class std::shared_ptr<struct canvas::IRenderModule> &)
+include/canvas/vclwrapper.hxx:66
+     canvas::vcltools::VCLObject::VCLObject<Wrappee_>(type-parameter-?-? *)
+include/canvas/vclwrapper.hxx:134
+    type-parameter-?-? & canvas::vcltools::VCLObject::get()
+include/canvas/vclwrapper.hxx:135
+    const type-parameter-?-? & canvas::vcltools::VCLObject::get() const
+include/canvas/vclwrapper.hxx:137
+    void canvas::vcltools::VCLObject::swap(VCLObject<Wrappee_> &)
 include/codemaker/global.hxx:58
     class FileStream & operator<<(class FileStream &,const class rtl::OString *)
 include/codemaker/global.hxx:60
@@ -330,8 +364,6 @@ include/drawinglayer/primitive3d/baseprimitive3d.hxx:113
     _Bool drawinglayer::primitive3d::BasePrimitive3D::operator!=(const class drawinglayer::primitive3d::BasePrimitive3D &) const
 include/drawinglayer/texture/texture.hxx:44
     _Bool drawinglayer::texture::GeoTexSvx::operator!=(const class drawinglayer::texture::GeoTexSvx &) const
-include/editeng/editeng.hxx:626
-    _Bool EditEngine::IsHoriAlignIgnoreTrailingWhitespace() const
 include/filter/msfilter/mstoolbar.hxx:98
      Indent::Indent(_Bool)
 include/formula/opcode.hxx:520
@@ -436,8 +468,6 @@ include/oox/helper/containerhelper.hxx:123
     typename vector<type-parameter-?-?, allocator<type-parameter-?-?> >::iterator oox::Matrix::row_end(typename vector<type-parameter-?-?, allocator<type-parameter-?-?> >::size_type)
 include/oox/helper/containerhelper.hxx:126
     typename vector<type-parameter-?-?, allocator<type-parameter-?-?> >::reference oox::Matrix::row_front(typename vector<type-parameter-?-?, allocator<type-parameter-?-?> >::size_type)
-include/oox/helper/graphichelper.hxx:142
-    class rtl::OUString oox::GraphicHelper::importGraphicObject(const class com::sun::star::uno::Reference<class com::sun::star::io::XInputStream> &,const struct WmfExternal *) const
 include/oox/helper/propertymap.hxx:114
     void oox::PropertyMap::dumpCode(const class com::sun::star::uno::Reference<class com::sun::star::beans::XPropertySet> &)
 include/oox/helper/propertymap.hxx:115
@@ -448,7 +478,7 @@ include/opencl/OpenCLZone.hxx:42
     _Bool OpenCLZone::isInInitialTest()
 include/sfx2/docfile.hxx:209
     class rtl::OUString SfxMedium::GetConvertImagesFilter()
-include/sfx2/docfilt.hxx:81
+include/sfx2/docfilt.hxx:83
     _Bool SfxFilter::GetGpgEncryption() const
 include/sfx2/lokcharthelper.hxx:41
     void LokChartHelper::Invalidate()
@@ -572,6 +602,8 @@ include/vcl/gdimtf.hxx:108
     _Bool GDIMetaFile::operator!=(const class GDIMetaFile &) const
 include/vcl/gradient.hxx:104
     _Bool Gradient::operator!=(const class Gradient &) const
+include/vcl/GraphicObject.hxx:467
+    _Bool GraphicObject::isGraphicObjectUniqueIdURL(const class rtl::OUString &)
 include/vcl/hatch.hxx:56
     _Bool Hatch::operator!=(const class Hatch &) const
 include/vcl/inputctx.hxx:63
@@ -632,138 +664,126 @@ include/vcl/wall.hxx:98
     _Bool Wallpaper::operator!=(const class Wallpaper &) const
 include/vcl/weld.hxx:30
     void weld::Widget::set_visible(_Bool)
-include/vcl/weld.hxx:46
-    int weld::Widget::get_text_height() const
 include/vcl/weld.hxx:48
     class rtl::OString weld::Widget::get_buildable_name() const
 include/vcl/weld.hxx:52
     void weld::Widget::set_grid_left_attach(int)
 include/vcl/weld.hxx:53
     int weld::Widget::get_grid_left_attach() const
-include/vcl/weld.hxx:73
+include/vcl/weld.hxx:76
     class rtl::OUString weld::Frame::get_label() const
-include/vcl/weld.hxx:86
+include/vcl/weld.hxx:89
     void weld::Notebook::set_current_page(const class rtl::OString &)
-include/vcl/weld.hxx:87
+include/vcl/weld.hxx:90
     int weld::Notebook::get_n_pages() const
-include/vcl/weld.hxx:88
+include/vcl/weld.hxx:91
     class weld::Container * weld::Notebook::get_page(const class rtl::OString &) const
-include/vcl/weld.hxx:90
+include/vcl/weld.hxx:93
     void weld::Notebook::connect_leave_page(const class Link<const class rtl::OString &, _Bool> &)
-include/vcl/weld.hxx:92
+include/vcl/weld.hxx:95
     void weld::Notebook::connect_enter_page(const class Link<const class rtl::OString &, void> &)
-include/vcl/weld.hxx:161
+include/vcl/weld.hxx:164
     class rtl::OUString weld::ComboBoxText::get_active_id() const
-include/vcl/weld.hxx:162
+include/vcl/weld.hxx:165
     void weld::ComboBoxText::set_active_id(const class rtl::OUString &)
-include/vcl/weld.hxx:164
+include/vcl/weld.hxx:167
     class rtl::OUString weld::ComboBoxText::get_id(int) const
-include/vcl/weld.hxx:165
+include/vcl/weld.hxx:168
     void weld::ComboBoxText::append_text(const class rtl::OUString &)
-include/vcl/weld.hxx:167
+include/vcl/weld.hxx:170
     void weld::ComboBoxText::append(const class rtl::OUString &,const class rtl::OUString &)
-include/vcl/weld.hxx:168
-    void weld::ComboBoxText::insert(int,const class rtl::OUString &,const class rtl::OUString &)
 include/vcl/weld.hxx:171
+    void weld::ComboBoxText::insert(int,const class rtl::OUString &,const class rtl::OUString &)
+include/vcl/weld.hxx:174
     void weld::ComboBoxText::make_sorted()
-include/vcl/weld.hxx:176
+include/vcl/weld.hxx:179
     void weld::ComboBoxText::set_active(const class rtl::OUString &)
-include/vcl/weld.hxx:178
+include/vcl/weld.hxx:181
     void weld::ComboBoxText::save_value()
-include/vcl/weld.hxx:180
+include/vcl/weld.hxx:183
     _Bool weld::ComboBoxText::get_value_changed_from_saved() const
-include/vcl/weld.hxx:196
+include/vcl/weld.hxx:199
     int weld::TreeView::n_children() const
-include/vcl/weld.hxx:201
+include/vcl/weld.hxx:204
     void weld::TreeView::set_top_entry(int)
-include/vcl/weld.hxx:205
+include/vcl/weld.hxx:208
     class rtl::OUString weld::TreeView::get(int)
-include/vcl/weld.hxx:215
+include/vcl/weld.hxx:218
     void weld::TreeView::select(const class rtl::OUString &)
-include/vcl/weld.hxx:217
+include/vcl/weld.hxx:220
     void weld::TreeView::remove(const class rtl::OUString &)
-include/vcl/weld.hxx:280
+include/vcl/weld.hxx:283
     _Bool weld::ToggleButton::get_state_changed_from_saved() const
-include/vcl/weld.hxx:304
+include/vcl/weld.hxx:307
     void weld::Entry::signal_insert_text(class rtl::OUString &)
-include/vcl/weld.hxx:386
+include/vcl/weld.hxx:347
+    void weld::SpinButton::set_min(int)
+include/vcl/weld.hxx:402
     enum FieldUnit weld::MetricSpinButton::get_unit() const
-include/vcl/weld.hxx:388
-    void weld::MetricSpinButton::set_unit(enum FieldUnit)
-include/vcl/weld.hxx:394
-    void weld::MetricSpinButton::set_value(int,enum FieldUnit)
-include/vcl/weld.hxx:399
-    int weld::MetricSpinButton::get_value(enum FieldUnit) const
-include/vcl/weld.hxx:405
+include/vcl/weld.hxx:421
     void weld::MetricSpinButton::set_range(int,int,enum FieldUnit)
-include/vcl/weld.hxx:413
+include/vcl/weld.hxx:429
     void weld::MetricSpinButton::get_range(int &,int &,enum FieldUnit) const
-include/vcl/weld.hxx:420
+include/vcl/weld.hxx:436
     void weld::MetricSpinButton::set_increments(int,int,enum FieldUnit)
-include/vcl/weld.hxx:427
+include/vcl/weld.hxx:443
     void weld::MetricSpinButton::get_increments(int &,int &,enum FieldUnit) const
-include/vcl/weld.hxx:434
-    void weld::MetricSpinButton::connect_value_changed(const class Link<class weld::MetricSpinButton &, void> &)
-include/vcl/weld.hxx:439
+include/vcl/weld.hxx:455
     int weld::MetricSpinButton::normalize(int) const
-include/vcl/weld.hxx:440
+include/vcl/weld.hxx:456
     int weld::MetricSpinButton::denormalize(int) const
-include/vcl/weld.hxx:441
+include/vcl/weld.hxx:457
     void weld::MetricSpinButton::set_sensitive(_Bool)
-include/vcl/weld.hxx:442
+include/vcl/weld.hxx:458
     _Bool weld::MetricSpinButton::get_sensitive() const
-include/vcl/weld.hxx:443
+include/vcl/weld.hxx:459
     _Bool weld::MetricSpinButton::get_visible() const
-include/vcl/weld.hxx:444
+include/vcl/weld.hxx:460
     void weld::MetricSpinButton::grab_focus()
-include/vcl/weld.hxx:445
+include/vcl/weld.hxx:461
     _Bool weld::MetricSpinButton::has_focus() const
-include/vcl/weld.hxx:446
+include/vcl/weld.hxx:462
     void weld::MetricSpinButton::show()
-include/vcl/weld.hxx:447
+include/vcl/weld.hxx:463
     void weld::MetricSpinButton::hide()
-include/vcl/weld.hxx:448
+include/vcl/weld.hxx:464
     void weld::MetricSpinButton::set_digits(unsigned int)
-include/vcl/weld.hxx:449
+include/vcl/weld.hxx:465
     unsigned int weld::MetricSpinButton::get_digits() const
-include/vcl/weld.hxx:450
+include/vcl/weld.hxx:466
     void weld::MetricSpinButton::save_value()
-include/vcl/weld.hxx:451
+include/vcl/weld.hxx:467
     _Bool weld::MetricSpinButton::get_value_changed_from_saved() const
-include/vcl/weld.hxx:455
+include/vcl/weld.hxx:471
     void weld::MetricSpinButton::set_text(const class rtl::OUString &)
-include/vcl/weld.hxx:456
+include/vcl/weld.hxx:472
     class rtl::OUString weld::MetricSpinButton::get_text() const
-include/vcl/weld.hxx:457
+include/vcl/weld.hxx:473
     void weld::MetricSpinButton::set_size_request(int,int)
-include/vcl/weld.hxx:461
+include/vcl/weld.hxx:477
     class Size weld::MetricSpinButton::get_preferred_size() const
-include/vcl/weld.hxx:474
+include/vcl/weld.hxx:490
     void weld::TextView::set_text(const class rtl::OUString &)
-include/vcl/weld.hxx:475
+include/vcl/weld.hxx:491
     class rtl::OUString weld::TextView::get_text() const
-include/vcl/weld.hxx:476
+include/vcl/weld.hxx:492
     class Selection weld::TextView::get_selection() const
-include/vcl/weld.hxx:477
+include/vcl/weld.hxx:493
     void weld::TextView::set_selection(const class Selection &)
-include/vcl/weld.hxx:522
+include/vcl/weld.hxx:551
     class weld::Window * weld::Builder::weld_window(const class rtl::OString &,_Bool)
-include/vcl/weld.hxx:527
+include/vcl/weld.hxx:556
     class weld::Notebook * weld::Builder::weld_notebook(const class rtl::OString &,_Bool)
-include/vcl/weld.hxx:531
-    class weld::MetricSpinButton * weld::Builder::weld_metric_spin_button(const class rtl::OString &,_Bool)
-include/vcl/weld.hxx:538
+include/vcl/weld.hxx:567
     class weld::TextView * weld::Builder::weld_text_view(const class rtl::OString &,_Bool)
-include/vcl/weld.hxx:551
-    short weld::DialogController::run()
+include/vcl/weld.hxx:617
+    void weld::MessageDialogController::set_help_id(const class rtl::OString &)
 include/vcl/window.hxx:431
     const char * ImplDbgCheckWindow(const void *)
 include/vcl/window.hxx:1230
     class Size vcl::Window::PaintActiveFloatingWindow(class VirtualDevice &) const
 libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.hxx:35
     void openLokDialog(struct _GtkWidget *,void *)
-mysqlc/source/mysqlc_subcomponent.hxx:53
-    void release(int &,struct cppu::OBroadcastHelperVar<class cppu::OMultiTypeInterfaceContainerHelper, class com::sun::star::uno::Type> &,class com::sun::star::uno::Reference<class com::sun::star::uno::XInterface> &,class com::sun::star::lang::XComponent *)
 o3tl/qa/cow_wrapper_clients.hxx:140
     _Bool o3tltests::cow_wrapper_client4::operator==(const class o3tltests::cow_wrapper_client4 &) const
 o3tl/qa/cow_wrapper_clients.hxx:141
@@ -776,8 +796,6 @@ oox/inc/drawingml/textliststyle.hxx:49
     void oox::drawingml::TextListStyle::dump() const
 oox/inc/drawingml/textparagraphproperties.hxx:101
     void oox::drawingml::TextParagraphProperties::setLineSpacing(const class oox::drawingml::TextSpacing &)
-postprocess/qa/services.cxx:409
-    int main()
 sc/inc/address.hxx:650
     _Bool ScRange::operator<=(const class ScRange &) const
 sc/inc/bigrange.hxx:71
@@ -806,9 +824,9 @@ sc/inc/postit.hxx:47
      ScCaptionPtr::ScCaptionPtr(class SdrCaptionObj *)
 sc/inc/scdll.hxx:42
      ScDLL::ScDLL()
-sc/inc/scmatrix.hxx:621
+sc/inc/scmatrix.hxx:625
     class ScFullMatrix & ScFullMatrix::operator+=(const class ScFullMatrix &)
-sc/inc/scmatrix.hxx:840
+sc/inc/scmatrix.hxx:846
     class ScVectorRefMatrix & ScVectorRefMatrix::operator+=(const class ScVectorRefMatrix &)
 sc/inc/stlalgorithm.hxx:62
     _Bool sc::AlignedAllocator::operator==(const AlignedAllocator<T, Alignment> &) const
@@ -948,6 +966,8 @@ svgio/inc/svgstyleattributes.hxx:345
     class svgio::svgreader::SvgNumber svgio::svgreader::SvgStyleAttributes::getStrokeDashOffset() const
 svgio/inc/svgstyleattributes.hxx:369
     enum svgio::svgreader::FontStretch svgio::svgreader::SvgStyleAttributes::getFontStretch() const
+sw/inc/calbck.hxx:231
+    class SwClient * SwDepend::GetToTell()
 sw/inc/dbgoutsw.hxx:53
     const char * dbg_out(const void *)
 sw/inc/dbgoutsw.hxx:55
@@ -1018,11 +1038,11 @@ sw/inc/IDocumentLinksAdministration.hxx:55
     _Bool IDocumentLinksAdministration::SetData(const class rtl::OUString &,const class rtl::OUString &,const class com::sun::star::uno::Any &)
 sw/inc/IMark.hxx:65
     _Bool sw::mark::IMark::operator<(const class sw::mark::IMark &) const
-sw/inc/pagedesc.hxx:416
+sw/inc/pagedesc.hxx:417
     void SwPageDescs::erase(class SwPageDesc *const &)
-sw/inc/pagedesc.hxx:424
-    class SwPageDesc *const & SwPageDescs::front() const
 sw/inc/pagedesc.hxx:425
+    class SwPageDesc *const & SwPageDescs::front() const
+sw/inc/pagedesc.hxx:426
     class SwPageDesc *const & SwPageDescs::back() const
 sw/inc/rdfhelper.hxx:59
     void SwRDFHelper::cloneStatements(const class com::sun::star::uno::Reference<class com::sun::star::frame::XModel> &,const class com::sun::star::uno::Reference<class com::sun::star::frame::XModel> &,const class rtl::OUString &,const class com::sun::star::uno::Reference<class com::sun::star::rdf::XResource> &,const class com::sun::star::uno::Reference<class com::sun::star::rdf::XResource> &)
@@ -1034,6 +1054,8 @@ sw/inc/ring.hxx:203
      sw::RingIterator::RingIterator<value_type>()
 sw/inc/swatrset.hxx:227
     const class SvxNoHyphenItem & SwAttrSet::GetNoHyphenHere(_Bool) const
+sw/inc/swrect.hxx:99
+    class SwRect & SwRect::operator-=(const class Point &)
 sw/inc/swrect.hxx:105
     class SvStream & WriteSwRect(class SvStream &,const class SwRect &)
 sw/inc/swrect.hxx:131
@@ -1044,6 +1066,8 @@ sw/inc/swrect.hxx:147
     _Bool SwRect::OverStepTop(long) const
 sw/qa/extras/inc/swmodeltestbase.hxx:556
     class com::sun::star::uno::Reference<class com::sun::star::beans::XPropertySet> SwModelTestBase::getParagraphAnchoredObject(const int,const class com::sun::star::uno::Reference<class com::sun::star::text::XTextRange> &) const
+sw/qa/extras/uiwriter/uiwriter.cxx:6009
+    int main()
 sw/source/core/inc/frame.hxx:1325
     class Size SwRectFnSet::GetSize(const class SwRect &) const
 sw/source/core/inc/frame.hxx:1356
@@ -1054,8 +1078,6 @@ sw/source/core/inc/frame.hxx:1365
     long SwRectFnSet::XInc(long,long) const
 sw/source/core/inc/mvsave.hxx:162
     _Bool ZSortFly::operator==(const class ZSortFly &) const
-sw/source/core/inc/noteurl.hxx:38
-     SwURLNote::SwURLNote(const class rtl::OUString &,const class rtl::OUString &,const class SwRect &)
 sw/source/core/text/porlin.hxx:119
     _Bool SwLinePortion::IsTabRightPortion() const
 sw/source/core/text/txtpaint.hxx:73
diff --git a/compilerplugins/clang/unusedmethods.unused-returns.results b/compilerplugins/clang/unusedmethods.unused-returns.results
index 039481f1741a..ff792fe435f4 100644
--- a/compilerplugins/clang/unusedmethods.unused-returns.results
+++ b/compilerplugins/clang/unusedmethods.unused-returns.results
@@ -1,5 +1,3 @@
-canvas/source/cairo/cairo_canvashelper.hxx:214
-    _Bool cairocanvas::CanvasHelper::hasAlpha() const
 chart2/source/view/main/OpenGLRender.hxx:69
     int OpenGLRender::InitOpenGL()
 chart2/source/view/main/OpenGLRender.hxx:70
@@ -36,10 +34,6 @@ connectivity/source/inc/odbc/OConnection.hxx:78
     short connectivity::odbc::OConnection::Construct(const class rtl::OUString &,const class com::sun::star::uno::Sequence<struct com::sun::star::beans::PropertyValue> &)
 connectivity/source/inc/odbc/OStatement.hxx:116
     _Bool connectivity::odbc::OStatement_Base::lockIfNecessary(const class rtl::OUString &)
-cppcanvas/source/inc/canvasgraphichelper.hxx:59
-    const class com::sun::star::uno::Reference<class com::sun::star::rendering::XGraphicDevice> & cppcanvas::internal::CanvasGraphicHelper::getGraphicDevice() const
-cui/source/options/securityoptions.hxx:56
-    short svx::SecurityOptionsDialog::run()
 extensions/source/scanner/sane.hxx:97
     _Bool Sane::CheckConsistency(const char *,_Bool)
 extensions/source/scanner/sane.hxx:140
@@ -64,38 +58,6 @@ include/basegfx/vector/b3dvector.hxx:155
     class basegfx::B3DVector & basegfx::B3DVector::setLength(double)
 include/basegfx/vector/b3dvector.hxx:180
     class basegfx::B3DVector & basegfx::B3DVector::normalize()
-include/canvas/base/bufferedgraphicdevicebase.hxx:158
-    const class com::sun::star::uno::Reference<class com::sun::star::awt::XWindow2> & canvas::BufferedGraphicDeviceBase::getWindow() const
-include/canvas/base/canvascustomspritehelper.hxx:118
-    _Bool canvas::CanvasCustomSpriteHelper::hasAlphaChanged() const
-include/canvas/base/canvascustomspritehelper.hxx:121
-    _Bool canvas::CanvasCustomSpriteHelper::hasPositionChanged() const
-include/canvas/base/canvascustomspritehelper.hxx:127
-    _Bool canvas::CanvasCustomSpriteHelper::hasClipChanged() const
-include/canvas/base/canvascustomspritehelper.hxx:130
-    _Bool canvas::CanvasCustomSpriteHelper::hasPrioChanged() const
-include/canvas/base/canvascustomspritehelper.hxx:133
-    _Bool canvas::CanvasCustomSpriteHelper::hasVisibilityChanged() const
-include/canvas/rendering/icolorbuffer.hxx:49
-    unsigned char * canvas::IColorBuffer::lock() const
-include/canvas/rendering/icolorbuffer.hxx:68
-    unsigned int canvas::IColorBuffer::getStride() const
-include/canvas/rendering/icolorbuffer.hxx:72
-    enum canvas::IColorBuffer::Format canvas::IColorBuffer::getFormat() const
-include/canvas/rendering/isurfaceproxy.hxx:55
-    _Bool canvas::ISurfaceProxy::draw(double,const class basegfx::B2DPoint &,const class basegfx::B2DHomMatrix &)
-include/canvas/rendering/isurfaceproxy.hxx:75
-    _Bool canvas::ISurfaceProxy::draw(double,const class basegfx::B2DPoint &,const class basegfx::B2DRange &,const class basegfx::B2DHomMatrix &)
-include/canvas/rendering/isurfaceproxy.hxx:95
-    _Bool canvas::ISurfaceProxy::draw(double,const class basegfx::B2DPoint &,const class basegfx::B2DPolyPolygon &,const class basegfx::B2DHomMatrix &)
-include/canvas/rendering/isurfaceproxymanager.hxx:58
-    class std::shared_ptr<struct canvas::ISurfaceProxy> canvas::ISurfaceProxyManager::createSurfaceProxy(const class std::shared_ptr<struct canvas::IColorBuffer> &) const
-include/canvas/rendering/isurfaceproxymanager.hxx:64
-    class std::shared_ptr<struct canvas::ISurfaceProxyManager> createSurfaceProxyManager(const class std::shared_ptr<struct canvas::IRenderModule> &)
-include/canvas/vclwrapper.hxx:134
-    type-parameter-?-? & canvas::vcltools::VCLObject::get()
-include/canvas/vclwrapper.hxx:135
-    const type-parameter-?-? & canvas::vcltools::VCLObject::get() const
 include/comphelper/backupfilehelper.hxx:206
     _Bool comphelper::BackupFileHelper::tryPush_extensionInfo(const class rtl::OUString &)
 include/editeng/editview.hxx:220
@@ -238,6 +200,8 @@ include/vcl/texteng.hxx:285
     _Bool TextEngine::Read(class SvStream &,const class TextSelection *)
 include/vcl/textview.hxx:192
     _Bool TextView::SetCursorAtPoint(const class Point &)
+include/vcl/toolbox.hxx:513
+    _Bool ToolBox::ChangeHighlightUpDn(_Bool,_Bool)
 lotuswordpro/inc/lwpsvstream.hxx:76
     class LwpSvStream & LwpSvStream::ReadUInt8(unsigned char &)
 lotuswordpro/inc/lwpsvstream.hxx:77
@@ -306,12 +270,10 @@ sd/source/ui/inc/OutlineViewShell.hxx:114
     class ErrCode sd::OutlineViewShell::ReadRtf(class SvStream &)
 sd/source/ui/remotecontrol/IBluetoothSocket.hxx:37
     int sd::IBluetoothSocket::write(const void *,unsigned int)
-sfx2/inc/saveastemplatedlg.hxx:54
-    short SfxSaveAsTemplateDialog::run()
-sfx2/source/appl/appserv.cxx:322
-    short (anonymous namespace)::LicenseDialog::run()
-sfx2/source/appl/appserv.cxx:344
-    short (anonymous namespace)::SafeModeQueryDialog::run()
+sfx2/source/appl/appserv.cxx:318
+    short (anonymous namespace)::LicenseDialog::execute()
+sfx2/source/appl/appserv.cxx:336
+    short (anonymous namespace)::SafeModeQueryDialog::execute()
 sw/inc/calc.hxx:112
     class SwSbxValue & SwSbxValue::MakeDouble()
 sw/inc/doc.hxx:1102
diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx
index 7b903c2c9638..cdf1e9b612dc 100644
--- a/sw/inc/calbck.hxx
+++ b/sw/inc/calbck.hxx
@@ -228,8 +228,6 @@ public:
         o.m_pToTell = nullptr;
     }
 
-    SwClient* GetToTell() { return m_pToTell; }
-
     /** get Client information */
     virtual bool GetInfo( SfxPoolItem& rInfo) const override
         { return m_pToTell == nullptr || m_pToTell->GetInfo( rInfo ); }
commit a3aceef8200e48173df4b5e67b5d6fb393a23ad9
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Mar 13 17:02:09 2018 +0200

    don't use heap for elements in ScRangePairList
    
    no need to store small objects like this out of line.
    
    And use std::array for ScRangePair, so we get range checking in debug
    mode.
    
    Change-Id: Ie4690edbb4c3fdc4e08206cb016b8167a399d95a
    Reviewed-on: https://gerrit.libreoffice.org/51268
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx
index ddc85469d349..37a401ef0194 100644
--- a/sc/inc/address.hxx
+++ b/sc/inc/address.hxx
@@ -23,6 +23,7 @@
 #include <rtl/ustrbuf.hxx>
 #include <rtl/strbuf.hxx>
 
+#include <array>
 #include <limits>
 #include <ostream>
 
@@ -763,10 +764,10 @@ inline bool ValidRange( const ScRange& rRange )
 }
 
 //  ScRangePair
-class SAL_WARN_UNUSED ScRangePair
+class SAL_WARN_UNUSED ScRangePair final
 {
 private:
-    ScRange aRange[2];
+    std::array<ScRange,2> aRange;
 
 public:
     ScRangePair( const ScRangePair& r )
diff --git a/sc/inc/rangelst.hxx b/sc/inc/rangelst.hxx
index e137613df857..6a1afadad037 100644
--- a/sc/inc/rangelst.hxx
+++ b/sc/inc/rangelst.hxx
@@ -129,28 +129,27 @@ public:
     ScRangePairList*    Clone() const;
     void                Append( const ScRangePair& rRangePair )
                         {
-                            ScRangePair* pR = new ScRangePair( rRangePair );
-                            maPairs.push_back( pR );
+                            maPairs.push_back( rRangePair );
                         }
     void                Join( const ScRangePair&, bool bIsInList = false );
     void                UpdateReference( UpdateRefMode, const ScDocument*,
                                     const ScRange& rWhere,
                                     SCCOL nDx, SCROW nDy, SCTAB nDz );
     void                DeleteOnTab( SCTAB nTab );
-    ScRangePair*        Find( const ScAddress& ) const;
-    ScRangePair*        Find( const ScRange& ) const;
-    std::vector<ScRangePair*>
+    ScRangePair*        Find( const ScAddress& );
+    ScRangePair*        Find( const ScRange& );
+    std::vector<const ScRangePair*>
                         CreateNameSortedArray( ScDocument* ) const;
 
     void                Remove(size_t nPos);
-    void                Remove(const ScRangePair* pAdr);
+    void                Remove(const ScRangePair & rAdr);
 
     size_t              size() const;
-    ScRangePair*        operator[](size_t idx);
-    const ScRangePair*  operator[](size_t idx) const;
+    ScRangePair&        operator[](size_t idx);
+    const ScRangePair&  operator[](size_t idx) const;
 
 private:
-    ::std::vector< ScRangePair* > maPairs;
+    ::std::vector< ScRangePair > maPairs;
 };
 typedef tools::SvRef<ScRangePairList> ScRangePairListRef;
 
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index ff79d99e347e..98a3f403bc30 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -1661,9 +1661,9 @@ void ScDocument::GetFormulaEntries( ScTypedCaseStrSet& rStrings )
 
         for ( size_t i = 0, nPairs = pList->size(); i < nPairs; ++i )
         {
-            ScRangePair* pPair = (*pList)[i];
-            ScRange aRange = pPair->GetRange(0);
-            ScCellIterator aIter( this, aRange );
+            const ScRangePair & rPair = (*pList)[i];
+            const ScRange & rRange = rPair.GetRange(0);
+            ScCellIterator aIter( this, rRange );
             for (bool bHas = aIter.first(); bHas; bHas = aIter.next())
             {
                 if (!aIter.hasString())
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 4b574a3a2bca..2b22c08171a8 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -3482,8 +3482,8 @@ bool ScCompiler::IsColRowName( const OUString& rName )
                 pRL = pDoc->GetRowNameRanges();
             for ( size_t iPair = 0, nPairs = pRL->size(); iPair < nPairs && !bInList; ++iPair )
             {
-                ScRangePair* pR = (*pRL)[iPair];
-                const ScRange& rNameRange = pR->GetRange(0);
+                const ScRangePair & rR = (*pRL)[iPair];
+                const ScRange& rNameRange = rR.GetRange(0);
                 if ( jThisTab && !(rNameRange.aStart.Tab() <= nThisTab &&
                         nThisTab <= rNameRange.aEnd.Tab()) )
                     continue;   // for
@@ -5252,11 +5252,11 @@ bool ScCompiler::HandleColRowName()
     ScRange aRange;
     for ( size_t i = 0, nPairs = pRL->size(); i < nPairs; ++i )
     {
-        ScRangePair* pR = (*pRL)[i];
-        if ( pR->GetRange(0).In( aAbs ) )
+        const ScRangePair & rR = (*pRL)[i];
+        if ( rR.GetRange(0).In( aAbs ) )
         {
             bInList = bValidName = true;
-            aRange = pR->GetRange(1);
+            aRange = rR.GetRange(1);
             if ( bColName )
             {
                 aRange.aStart.SetCol( nCol );
@@ -5300,8 +5300,8 @@ bool ScCompiler::HandleColRowName()
                 }
                 for ( size_t i = 0, nPairs = pRL->size(); i < nPairs; ++i )
                 {   // next defined ColNameRange below limits row
-                    ScRangePair* pR = (*pRL)[i];
-                    const ScRange& rRange = pR->GetRange(1);
+                    const ScRangePair & rR = (*pRL)[i];
+                    const ScRange& rRange = rR.GetRange(1);
                     if ( rRange.aStart.Col() <= nCol && nCol <= rRange.aEnd.Col() )
                     {   // identical column range
                         SCROW nTmp = rRange.aStart.Row();
@@ -5333,8 +5333,8 @@ bool ScCompiler::HandleColRowName()
                 }
                 for ( size_t i = 0, nPairs = pRL->size(); i < nPairs; ++i )
                 {   // next defined RowNameRange to the right limits column
-                    ScRangePair* pR = (*pRL)[i];
-                    const ScRange& rRange = pR->GetRange(1);
+                    const ScRangePair & rR = (*pRL)[i];
+                    const ScRange& rRange = rR.GetRange(1);
                     if ( rRange.aStart.Row() <= nRow && nRow <= rRange.aEnd.Row() )
                     {   // identical row range
                         SCCOL nTmp = rRange.aStart.Col();
diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx
index 62a083bcab96..5380a7aa321d 100644
--- a/sc/source/core/tool/rangelst.cxx
+++ b/sc/source/core/tool/rangelst.cxx
@@ -1187,8 +1187,6 @@ ScRangeList ScRangeList::GetIntersectedRange(const ScRange& rRange) const
 //  ScRangePairList
 ScRangePairList::~ScRangePairList()
 {
-    for_each( maPairs.begin(), maPairs.end(), std::default_delete<ScRangePair>() );
-    maPairs.clear();
 }
 
 void ScRangePairList::Remove(size_t nPos)
@@ -1196,23 +1194,15 @@ void ScRangePairList::Remove(size_t nPos)
     if (maPairs.size() <= nPos)
         // Out-of-bound condition.  Bail out.
         return;
-
-    vector<ScRangePair*>::iterator itr = maPairs.begin();
-    advance(itr, nPos);
-    delete *itr;
-    maPairs.erase(itr);
+    maPairs.erase(maPairs.begin() + nPos);
 }
 
-void ScRangePairList::Remove( const ScRangePair* Adr)
+void ScRangePairList::Remove( const ScRangePair & rAdr)
 {
-    if (Adr == nullptr)
-        return;
-
-    for ( vector<ScRangePair*>::iterator itr = maPairs.begin(); itr != maPairs.end(); ++itr )
+    for ( auto itr = maPairs.begin(); itr != maPairs.end(); ++itr )
     {
-        if (Adr == *itr)
+        if (&rAdr == &*itr)
         {
-            delete *itr;
             maPairs.erase( itr );
             return;
         }
@@ -1220,12 +1210,12 @@ void ScRangePairList::Remove( const ScRangePair* Adr)
     assert(false);
 }
 
-ScRangePair* ScRangePairList::operator [](size_t idx)
+ScRangePair & ScRangePairList::operator [](size_t idx)
 {
     return maPairs[idx];
 }
 
-const ScRangePair* ScRangePairList::operator [](size_t idx) const
+const ScRangePair & ScRangePairList::operator [](size_t idx) const
 {
     return maPairs[idx];
 }
@@ -1248,11 +1238,11 @@ void ScRangePairList::UpdateReference( UpdateRefMode eUpdateRefMode,
         SCROW nRow2;
         SCTAB nTab2;
         rWhere.GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
-        for (ScRangePair* pR : maPairs)
+        for (ScRangePair & rR : maPairs)
         {
             for ( sal_uInt16 j=0; j<2; j++ )
             {
-                ScRange& rRange = pR->GetRange(j);
+                ScRange& rRange = rR.GetRange(j);
                 SCCOL theCol1;
                 SCROW theRow1;
                 SCTAB theTab1;
@@ -1277,38 +1267,35 @@ void ScRangePairList::UpdateReference( UpdateRefMode eUpdateRefMode,
 // Delete entries that have the labels (first range) on nTab
 void ScRangePairList::DeleteOnTab( SCTAB nTab )
 {
-    size_t nListCount = maPairs.size();
-    size_t nPos = 0;
-    while ( nPos < nListCount )
+    for (auto it = maPairs.begin(); it != maPairs.end(); )
     {
-        ScRangePair* pR = maPairs[  nPos ];
-        ScRange aRange = pR->GetRange(0);
-        if ( aRange.aStart.Tab() == nTab && aRange.aEnd.Tab() == nTab )
+        const ScRangePair & rR = *it;
+        const ScRange & rRange = rR.GetRange(0);
+        if ( rRange.aStart.Tab() == nTab && rRange.aEnd.Tab() == nTab )
         {
-            Remove( nPos );
-            nListCount = maPairs.size();
+            it = maPairs.erase(it);
         }
         else
-            ++nPos;
+            ++it;
     }
 }
 
-ScRangePair* ScRangePairList::Find( const ScAddress& rAdr ) const
+ScRangePair* ScRangePairList::Find( const ScAddress& rAdr )
 {
-    for (ScRangePair* pR : maPairs)
+    for (ScRangePair & rR : maPairs)
     {
-        if ( pR->GetRange(0).In( rAdr ) )
-            return pR;
+        if ( rR.GetRange(0).In( rAdr ) )
+            return &rR;
     }
     return nullptr;
 }
 
-ScRangePair* ScRangePairList::Find( const ScRange& rRange ) const
+ScRangePair* ScRangePairList::Find( const ScRange& rRange )
 {
-    for (ScRangePair* pR : maPairs)
+    for (ScRangePair & rR : maPairs)
     {
-        if ( pR->GetRange(0) == rRange )
-            return pR;
+        if ( rR.GetRange(0) == rRange )
+            return &rR;
     }
     return nullptr;
 }
@@ -1316,9 +1303,9 @@ ScRangePair* ScRangePairList::Find( const ScRange& rRange ) const
 ScRangePairList* ScRangePairList::Clone() const
 {
     ScRangePairList* pNew = new ScRangePairList;
-    for (const ScRangePair* pR : maPairs)
+    for (const ScRangePair & rR : maPairs)
     {
-        pNew->Append( *pR );
+        pNew->Append( rR );
     }
     return pNew;
 }
@@ -1425,15 +1412,15 @@ Label_RangePair_Join:
     size_t nOverPos = std::numeric_limits<size_t>::max();
     for (size_t i = 0; i < maPairs.size(); ++i)
     {
-        ScRangePair* p = maPairs[ i ];
-        if ( p == pOver )
+        ScRangePair & rPair = maPairs[ i ];
+        if ( &rPair == pOver )
         {
             nOverPos = i;
             continue;           // the same one, continue with the next
         }
         bool bJoined = false;
-        ScRange& rp1 = p->GetRange(0);
-        ScRange& rp2 = p->GetRange(1);
+        ScRange& rp1 = rPair.GetRange(0);
+        ScRange& rp2 = rPair.GetRange(1);
         if ( rp2 == r2 )
         {   // only if Range2 is equal
             if ( rp1.In( r1 ) )
@@ -1448,7 +1435,7 @@ Label_RangePair_Join:
             }
             else if ( r1.In( rp1 ) )
             {   // RangePair p included in RangePair pOver, make pOver the new RangePair
-                *p = *pOver;
+                rPair = *pOver;
                 bJoined = true;
             }
         }
@@ -1500,21 +1487,26 @@ Label_RangePair_Join:
             if ( bIsInList )
             {   // delete RangePair pOver within the list
                 if (nOverPos != std::numeric_limits<size_t>::max())
+                {
                     Remove(nOverPos);
+                    if (nOverPos < i)
+                        --i;
+                }
                 else
                 {
-                    for (size_t nOver = 0, nPairs = maPairs.size(); nOver < nPairs; ++nOver)
+                    for (size_t nOver = 0, nRangePairs = maPairs.size(); nOver < nRangePairs; ++nOver)
                     {
-                        if (maPairs[nOver] == pOver)
+                        if (&maPairs[nOver] == pOver)
                         {
-                            Remove(nOver);
+                            maPairs.erase(maPairs.begin() + nOver);
                             break;
                         }
                     }
+                    assert(false);
                 }
             }
             bJoinedInput = true;
-            pOver = p;
+            pOver = &maPairs[i];
             bIsInList = true;
             goto Label_RangePair_Join;
         }
@@ -1523,9 +1515,14 @@ Label_RangePair_Join:
         Append( r );
 }
 
-std::vector<ScRangePair*> ScRangePairList::CreateNameSortedArray( ScDocument* pDoc ) const
+std::vector<const ScRangePair*> ScRangePairList::CreateNameSortedArray( ScDocument* pDoc ) const
 {
-    std::vector<ScRangePair*> aSortedVec(maPairs);
+    std::vector<const ScRangePair*> aSortedVec(maPairs.size());
+    size_t i = 0;
+    for ( auto const & rPair : maPairs)
+    {
+        aSortedVec[i++] = &rPair;
+    }
 
     std::sort( aSortedVec.begin(), aSortedVec.end(), ScRangePairList_sortNameCompare(pDoc) );
 
diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx
index 473200a13c5a..8cd7de4b5066 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -551,8 +551,8 @@ void XclExpLabelranges::FillRangeList( ScRangeList& rScRanges,
 {
     for ( size_t i = 0, nPairs = xLabelRangesRef->size(); i < nPairs; ++i )
     {
-        ScRangePair* pRangePair = (*xLabelRangesRef)[i];
-        const ScRange& rScRange = pRangePair->GetRange( 0 );
+        const ScRangePair & rRangePair = (*xLabelRangesRef)[i];
+        const ScRange& rScRange = rRangePair.GetRange( 0 );
         if( rScRange.aStart.Tab() == nScTab )
             rScRanges.push_back( rScRange );
     }
diff --git a/sc/source/ui/miscdlgs/crnrdlg.cxx b/sc/source/ui/miscdlgs/crnrdlg.cxx
index 31df267e218f..8cbdf77a2b1c 100644
--- a/sc/source/ui/miscdlgs/crnrdlg.cxx
+++ b/sc/source/ui/miscdlgs/crnrdlg.cxx
@@ -391,7 +391,7 @@ void ScColRowNameRangesDlg::UpdateNames()
     pLbRange->SetEntryData( nPos, reinterpret_cast<void*>(nEntryDataDelim) );
     if ( (nCount = xColNameRanges->size()) > 0 )
     {
-        std::vector<ScRangePair*> aSortArray(xColNameRanges->CreateNameSortedArray(
+        std::vector<const ScRangePair*> aSortArray(xColNameRanges->CreateNameSortedArray(
                pDoc ));
         nCount = aSortArray.size();
         for ( j=0; j < nCount; j++ )
@@ -435,7 +435,7 @@ void ScColRowNameRangesDlg::UpdateNames()
     pLbRange->SetEntryData( nPos, reinterpret_cast<void*>(nEntryDataDelim) );
     if ( (nCount = xRowNameRanges->size()) > 0 )
     {
-        std::vector<ScRangePair*> aSortArray(xRowNameRanges->CreateNameSortedArray(
+        std::vector<const ScRangePair*> aSortArray(xRowNameRanges->CreateNameSortedArray(
                pDoc ));
         nCount = aSortArray.size();
         for ( j=0; j < nCount; j++ )
@@ -557,11 +557,11 @@ IMPL_LINK_NOARG(ScColRowNameRangesDlg, AddBtnHdl, Button*, void)
             ScRangePair* pPair;
             if ( ( pPair = xColNameRanges->Find( theCurArea ) ) != nullptr )
             {
-                xColNameRanges->Remove( pPair );
+                xColNameRanges->Remove( *pPair );
             }
             if ( ( pPair = xRowNameRanges->Find( theCurArea ) ) != nullptr )
             {
-                xRowNameRanges->Remove( pPair );
+                xRowNameRanges->Remove( *pPair );
             }
             if ( pBtnColHead->IsChecked() )
                 xColNameRanges->Join( ScRangePair( theCurArea, theCurData ) );
@@ -619,9 +619,9 @@ IMPL_LINK_NOARG(ScColRowNameRangesDlg, RemoveBtnHdl, Button*, void)
         if (RET_YES == QUERYBOX(GetFrameWeld(), aMsg))
         {
             if ( bColName )
-                xColNameRanges->Remove( pPair );
+                xColNameRanges->Remove( *pPair );
             else
-                xRowNameRanges->Remove( pPair );
+                xRowNameRanges->Remove( *pPair );
 
             UpdateNames();
             const sal_Int32 nCnt = pLbRange->GetEntryCount();
diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx
index 1caa62e9920c..e1e7d1478c28 100644
--- a/sc/source/ui/unoobj/nameuno.cxx
+++ b/sc/source/ui/unoobj/nameuno.cxx
@@ -1041,9 +1041,8 @@ ScLabelRangeObj* ScLabelRangesObj::GetObjectByIndex_Impl(size_t nIndex)
         ScRangePairList* pList = bColumn ? rDoc.GetColNameRanges() : rDoc.GetRowNameRanges();
         if ( pList && nIndex < pList->size() )
         {
-            ScRangePair* pData = (*pList)[nIndex];
-            if (pData)
-                return new ScLabelRangeObj( pDocShell, bColumn, pData->GetRange(0) );
+            ScRangePair & rData = (*pList)[nIndex];
+            return new ScLabelRangeObj( pDocShell, bColumn, rData.GetRange(0) );
         }
     }
     return nullptr;
@@ -1094,23 +1093,19 @@ void SAL_CALL ScLabelRangesObj::removeByIndex( sal_Int32 nIndex )
         {
             ScRangePairListRef xNewList(pOldList->Clone());
 
-            ScRangePair* pEntry = (*xNewList)[nIndex];
-            if (pEntry)
-            {
-                xNewList->Remove( pEntry );
+            xNewList->Remove( nIndex );
 
-                if (bColumn)
-                    rDoc.GetColNameRangesRef() = xNewList;
-                else
-                    rDoc.GetRowNameRangesRef() = xNewList;
+            if (bColumn)
+                rDoc.GetColNameRangesRef() = xNewList;
+            else
+                rDoc.GetRowNameRangesRef() = xNewList;
 
-                rDoc.CompileColRowNameFormula();
-                pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PaintPartFlags::Grid );
-                pDocShell->SetDocumentModified();
-                bDone = true;
+            rDoc.CompileColRowNameFormula();
+            pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PaintPartFlags::Grid );
+            pDocShell->SetDocumentModified();
+            bDone = true;
 
-                //! Undo ?!?! (here and from dialog)
-            }
+            //! Undo ?!?! (here and from dialog)
         }
     }
     if (!bDone)


More information about the Libreoffice-commits mailing list