[Libreoffice-commits] core.git: include/svx svx/source

Jochen Nitschke j.nitschke+logerrit at ok.de
Thu Oct 5 06:58:30 UTC 2017


 include/svx/algitem.hxx             |    1 
 include/svx/ofaitem.hxx             |    4 --
 include/svx/optgrid.hxx             |    1 
 include/svx/rulritem.hxx            |   10 -----
 include/svx/svxgrahicitem.hxx       |    2 -
 include/svx/zoomslideritem.hxx      |    2 -
 svx/source/dialog/optgrid.cxx       |   17 ---------
 svx/source/dialog/rulritem.cxx      |   65 ------------------------------------
 svx/source/dialog/svxgrahicitem.cxx |    4 --
 svx/source/items/algitem.cxx        |   11 ------
 svx/source/items/clipfmtitem.cxx    |    8 ----
 svx/source/items/numinf.cxx         |    4 --
 svx/source/items/ofaitem.cxx        |    4 --
 svx/source/items/zoomslideritem.cxx |   14 -------
 14 files changed, 1 insertion(+), 146 deletions(-)

New commits:
commit 9051ceb9f2048a85772306573cb662ee14efd718
Author: Jochen Nitschke <j.nitschke+logerrit at ok.de>
Date:   Wed Oct 4 02:17:25 2017 +0200

    clang-tidy modernize-use-equals-default in svx
    
    SfxPoolItem has a copy constructor and its copy assignment
    operator is deleted. Derived classes have a implicit defined
    copy constructor too, if all members are copy constructible.
    
    This patch removes default-able copy constructors and destructors
    on such items.
    
    Also removing copy constructors of pool item members
    SvxClipboardFormatItem_Impl and SvxColumnItem.
    
    Change-Id: Ic0f39c992d1fd7b667cb56134fd7c953681a3131
    Reviewed-on: https://gerrit.libreoffice.org/43143
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/svx/algitem.hxx b/include/svx/algitem.hxx
index 00ab5145fec7..797b3be24c86 100644
--- a/include/svx/algitem.hxx
+++ b/include/svx/algitem.hxx
@@ -79,7 +79,6 @@ public:
     SvxMarginItem( sal_Int16 nLeft, sal_Int16 nTop /*= 0*/,
                    sal_Int16 nRight /*= 0*/, sal_Int16 nBottom /*= 0*/,
                    const sal_uInt16 nId  );
-    SvxMarginItem( const SvxMarginItem& );
 
     virtual bool GetPresentation( SfxItemPresentation ePres,
                                   MapUnit eCoreMetric,
diff --git a/include/svx/ofaitem.hxx b/include/svx/ofaitem.hxx
index 49df180d86a2..956588b6b5f8 100644
--- a/include/svx/ofaitem.hxx
+++ b/include/svx/ofaitem.hxx
@@ -32,7 +32,6 @@ private:
 
 public:
                              OfaPtrItem( sal_uInt16 nWhich, void *pPtr );
-                             OfaPtrItem( const OfaPtrItem& );
 
     virtual bool             operator==( const SfxPoolItem& ) const override;
     virtual SfxPoolItem*     Clone( SfxItemPool *pPool = nullptr ) const override;
@@ -51,9 +50,6 @@ public:
     OfaRefItem( sal_uInt16 _nWhich, const rtl::Reference<reference_type> &xRef )
         : SfxPoolItem( _nWhich ), mxRef( xRef )
     {}
-    OfaRefItem( const OfaRefItem& rItem )
-        : SfxPoolItem( rItem.Which() ), mxRef( rItem.mxRef )
-    {}
     virtual bool operator==( const SfxPoolItem& rItem ) const override
     {
         return mxRef == static_cast<OfaRefItem<reference_type> const &>(rItem).mxRef;
diff --git a/include/svx/optgrid.hxx b/include/svx/optgrid.hxx
index 9ca88ff34a10..bd59955cee05 100644
--- a/include/svx/optgrid.hxx
+++ b/include/svx/optgrid.hxx
@@ -79,7 +79,6 @@ class SVX_DLLPUBLIC SvxGridItem : public SvxOptionsGrid, public SfxPoolItem
 
 public:
     SvxGridItem( sal_uInt16 _nWhich) : SfxPoolItem(_nWhich){};
-    SvxGridItem( const SvxGridItem& pTestItem );
 
     virtual SfxPoolItem*    Clone( SfxItemPool *pPool = nullptr ) const override;
     virtual bool            operator==( const SfxPoolItem& ) const override;
diff --git a/include/svx/rulritem.hxx b/include/svx/rulritem.hxx
index d35e0f23731a..4ce3bedfcebb 100644
--- a/include/svx/rulritem.hxx
+++ b/include/svx/rulritem.hxx
@@ -48,7 +48,6 @@ private:
 public:
     static SfxPoolItem* CreateDefault();
     SvxLongLRSpaceItem(long lLeft, long lRight, sal_uInt16 nId);
-    SvxLongLRSpaceItem(const SvxLongLRSpaceItem &);
     SvxLongLRSpaceItem();
 
     long GetLeft() const { return mlLeft;}
@@ -81,7 +80,6 @@ private:
 public:
     static SfxPoolItem* CreateDefault();
     SvxLongULSpaceItem(long lUpper, long lLower, sal_uInt16 nId);
-    SvxLongULSpaceItem(const SvxLongULSpaceItem &);
     SvxLongULSpaceItem();
 
     long GetUpper() const { return mlLeft;}
@@ -112,7 +110,6 @@ private:
 public:
     static SfxPoolItem* CreateDefault();
     SvxPagePosSizeItem(const Point &rPos, long lWidth, long lHeight);
-    SvxPagePosSizeItem(const SvxPagePosSizeItem &);
     SvxPagePosSizeItem();
 
     const Point &GetPos() const { return aPos; }
@@ -131,8 +128,6 @@ struct SVX_DLLPUBLIC SvxColumnDescription
 
     SvxColumnDescription();
 
-    SvxColumnDescription(const SvxColumnDescription &rCopy);
-
     SvxColumnDescription(long start, long end, bool bVis);
 
     SvxColumnDescription(long start, long end,
@@ -184,10 +179,6 @@ public:
     // nLeft, nRight each the distance to the surrounding frame
     SvxColumnItem(sal_uInt16 nAct = 0);
     SvxColumnItem(sal_uInt16 nActCol, sal_uInt16 nLeft, sal_uInt16 nRight); // Table with borders
-    SvxColumnItem(const SvxColumnItem& aItem);
-    virtual ~SvxColumnItem() override;
-
-    SvxColumnItem &operator=(const SvxColumnItem &);
 
     SvxColumnDescription&       operator[](sal_uInt16 index);
     const SvxColumnDescription& operator[](sal_uInt16 index) const;
@@ -239,7 +230,6 @@ public:
     static SfxPoolItem* CreateDefault();
     SvxObjectItem(long nStartX, long nEndX,
                   long nStartY, long nEndY);
-    SvxObjectItem(const SvxObjectItem& rCopy);
 
     long GetStartX() const { return nStartX;}
     long GetEndX() const { return nEndX;}
diff --git a/include/svx/svxgrahicitem.hxx b/include/svx/svxgrahicitem.hxx
index a5f417feaa66..a4f5bcca2b1c 100644
--- a/include/svx/svxgrahicitem.hxx
+++ b/include/svx/svxgrahicitem.hxx
@@ -31,8 +31,6 @@ class SVX_DLLPUBLIC SvxGraphicItem: public SfxPoolItem
 
 public:
                             SvxGraphicItem( const Graphic& rGraphic);
-                            SvxGraphicItem( const SvxGraphicItem& );
-
 
     virtual bool            operator==( const SfxPoolItem& ) const override;
     virtual SfxPoolItem*    Clone( SfxItemPool *pPool = nullptr ) const override;
diff --git a/include/svx/zoomslideritem.hxx b/include/svx/zoomslideritem.hxx
index 0bff42560dc6..d58f74b93881 100644
--- a/include/svx/zoomslideritem.hxx
+++ b/include/svx/zoomslideritem.hxx
@@ -35,8 +35,6 @@ public:
     static SfxPoolItem* CreateDefault();
 
     SvxZoomSliderItem( sal_uInt16 nCurrentZoom = 100, sal_uInt16 nMinZoom = 20, sal_uInt16 nMaxZoom = 600, sal_uInt16 nWhich = SID_ATTR_ZOOMSLIDER );
-    SvxZoomSliderItem( const SvxZoomSliderItem& );
-    virtual ~SvxZoomSliderItem() override;
 
     void AddSnappingPoint( sal_Int32 nNew );
     const css::uno::Sequence < sal_Int32 >& GetSnappingPoints() const { return maValues;}
diff --git a/svx/source/dialog/optgrid.cxx b/svx/source/dialog/optgrid.cxx
index 248d741e1c27..d517dd7fb6df 100644
--- a/svx/source/dialog/optgrid.cxx
+++ b/svx/source/dialog/optgrid.cxx
@@ -58,23 +58,6 @@ SvxOptionsGrid::SvxOptionsGrid() :
 {
 }
 
-SvxGridItem::SvxGridItem( const SvxGridItem& rItem )
-:   SvxOptionsGrid()
-,   SfxPoolItem(rItem)
-{
-    bUseGridsnap = rItem.bUseGridsnap ;
-    bSynchronize = rItem.bSynchronize ;
-    bGridVisible = rItem.bGridVisible ;
-    bEqualGrid   = rItem.bEqualGrid   ;
-    nFldDrawX    = rItem.nFldDrawX    ;
-    nFldDivisionX= rItem.nFldDivisionX;
-    nFldDrawY    = rItem.nFldDrawY    ;
-    nFldDivisionY= rItem.nFldDivisionY;
-    nFldSnapX    = rItem.nFldSnapX    ;
-    nFldSnapY    = rItem.nFldSnapY    ;
-
-};
-
 SfxPoolItem*  SvxGridItem::Clone( SfxItemPool* ) const
 {
     return new SvxGridItem( *this );
diff --git a/svx/source/dialog/rulritem.cxx b/svx/source/dialog/rulritem.cxx
index a74c55703c8f..145a552f8f87 100644
--- a/svx/source/dialog/rulritem.cxx
+++ b/svx/source/dialog/rulritem.cxx
@@ -143,13 +143,6 @@ SvxLongLRSpaceItem::SvxLongLRSpaceItem() :
     mlRight     (0)
 {}
 
-SvxLongLRSpaceItem::SvxLongLRSpaceItem(const SvxLongLRSpaceItem &rCpy) :
-    SfxPoolItem (rCpy),
-    mlLeft      (rCpy.mlLeft),
-    mlRight     (rCpy.mlRight)
-{}
-
-
 void SvxLongLRSpaceItem::SetLeft(long lArgLeft)
 {
     mlLeft = lArgLeft;
@@ -263,12 +256,6 @@ SvxLongULSpaceItem::SvxLongULSpaceItem(long lLeft, long lRight, sal_uInt16 nId)
     mlRight      (lRight)
 {}
 
-SvxLongULSpaceItem::SvxLongULSpaceItem(const SvxLongULSpaceItem &rCpy) :
-    SfxPoolItem (rCpy),
-    mlLeft      (rCpy.mlLeft),
-    mlRight     (rCpy.mlRight)
-{}
-
 SvxLongULSpaceItem::SvxLongULSpaceItem() :
     SfxPoolItem (0),
     mlLeft      (0),
@@ -385,13 +372,6 @@ SvxPagePosSizeItem::SvxPagePosSizeItem(const Point &rP, long lW, long lH) :
     lHeight     (lH)
 {}
 
-SvxPagePosSizeItem::SvxPagePosSizeItem(const SvxPagePosSizeItem &rCpy) :
-    SfxPoolItem (rCpy),
-    aPos        (rCpy.aPos),
-    lWidth      (rCpy.lWidth),
-    lHeight     (rCpy.lHeight)
-{}
-
 SvxPagePosSizeItem::SvxPagePosSizeItem() :
     SfxPoolItem (0),
     aPos        (0, 0),
@@ -439,21 +419,6 @@ SvxColumnItem::SvxColumnItem( sal_uInt16 nActCol, sal_uInt16 left, sal_uInt16 ri
     bOrtho      (true)
 {}
 
-SvxColumnItem::SvxColumnItem( const SvxColumnItem& rCopy ) :
-    SfxPoolItem (rCopy),
-    nLeft       (rCopy.nLeft),
-    nRight      (rCopy.nRight),
-    nActColumn  (rCopy.nActColumn),
-    bTable      (rCopy.bTable),
-    bOrtho      (rCopy.bOrtho)
-{
-    aColumns.resize(rCopy.aColumns.size());
-    std::copy(rCopy.aColumns.begin(), rCopy.aColumns.end(), aColumns.begin());
-}
-
-SvxColumnItem::~SvxColumnItem()
-{}
-
 bool SvxColumnItem::GetPresentation(
                         SfxItemPresentation /*ePres*/,
                         MapUnit             /*eCoreUnit*/,
@@ -469,19 +434,6 @@ SfxPoolItem* SvxColumnItem::Clone(SfxItemPool* /*pPool*/) const
     return new SvxColumnItem(*this);
 }
 
-SvxColumnItem& SvxColumnItem::operator=(const SvxColumnItem& rCopy)
-{
-    nLeft = rCopy.nLeft;
-    nRight = rCopy.nRight;
-    bTable = rCopy.bTable;
-    nActColumn = rCopy.nActColumn;
-    aColumns.resize(rCopy.aColumns.size());
-
-    std::copy(rCopy.aColumns.begin(), rCopy.aColumns.end(), aColumns.begin());
-
-    return *this;
-}
-
 bool SvxColumnItem::CalcOrtho() const
 {
     const sal_uInt16 nCount = Count();
@@ -624,14 +576,6 @@ SvxColumnDescription::SvxColumnDescription() :
     nEndMax  (0)
 {}
 
-SvxColumnDescription::SvxColumnDescription(const SvxColumnDescription &rCopy) :
-    nStart   (rCopy.nStart),
-    nEnd     (rCopy.nEnd),
-    bVisible (rCopy.bVisible),
-    nEndMin  (rCopy.nEndMin),
-    nEndMax  (rCopy.nEndMax)
-{}
-
 SvxColumnDescription::SvxColumnDescription(long start, long end, bool bVis) :
     nStart   (start),
     nEnd     (end),
@@ -714,15 +658,6 @@ SvxObjectItem::SvxObjectItem( long nSX, long nEX,
     bLimits     (false)
 {}
 
-SvxObjectItem::SvxObjectItem( const SvxObjectItem& rCopy ) :
-    SfxPoolItem (rCopy),
-    nStartX     (rCopy.nStartX),
-    nEndX       (rCopy.nEndX),
-    nStartY     (rCopy.nStartY),
-    nEndY       (rCopy.nEndY),
-    bLimits     (rCopy.bLimits)
-{}
-
 bool SvxObjectItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) const
 {
     nMemberId &= ~CONVERT_TWIPS;
diff --git a/svx/source/dialog/svxgrahicitem.cxx b/svx/source/dialog/svxgrahicitem.cxx
index d7bbd8a328f4..ff6bf9ec8085 100644
--- a/svx/source/dialog/svxgrahicitem.cxx
+++ b/svx/source/dialog/svxgrahicitem.cxx
@@ -25,10 +25,6 @@ SvxGraphicItem::SvxGraphicItem( const Graphic& rGraphic )
 {
 
 }
-SvxGraphicItem::SvxGraphicItem( const SvxGraphicItem& rItem)
-    : SfxPoolItem( rItem.Which() ), aGraphic( rItem.aGraphic )
-{
-}
 
 bool SvxGraphicItem::operator==( const SfxPoolItem& rItem) const
 {
diff --git a/svx/source/items/algitem.cxx b/svx/source/items/algitem.cxx
index 3da88e3625b1..c8c3623dce5d 100644
--- a/svx/source/items/algitem.cxx
+++ b/svx/source/items/algitem.cxx
@@ -187,17 +187,6 @@ SvxMarginItem::SvxMarginItem( sal_Int16 nLeft,
 }
 
 
-SvxMarginItem::SvxMarginItem( const SvxMarginItem& rItem ) :
-
-    SfxPoolItem( rItem.Which() )
-{
-    nLeftMargin = rItem.nLeftMargin;
-    nTopMargin = rItem.nTopMargin;
-    nRightMargin = rItem.nRightMargin;
-    nBottomMargin = rItem.nBottomMargin;
-}
-
-
 bool SvxMarginItem::GetPresentation
 (
     SfxItemPresentation ePres,
diff --git a/svx/source/items/clipfmtitem.cxx b/svx/source/items/clipfmtitem.cxx
index 2cd8929cfb92..08aa4782f376 100644
--- a/svx/source/items/clipfmtitem.cxx
+++ b/svx/source/items/clipfmtitem.cxx
@@ -30,18 +30,10 @@ struct SvxClipboardFormatItem_Impl
     std::vector<SotClipboardFormatId> aFmtIds;
 
     SvxClipboardFormatItem_Impl() {}
-    SvxClipboardFormatItem_Impl( const SvxClipboardFormatItem_Impl& );
 };
 
 SfxPoolItem* SvxClipboardFormatItem::CreateDefault() { return new  SvxClipboardFormatItem(0); };
 
-SvxClipboardFormatItem_Impl::SvxClipboardFormatItem_Impl(
-                            const SvxClipboardFormatItem_Impl& rCpy )
-    : aFmtNms(rCpy.aFmtNms)
-    , aFmtIds(rCpy.aFmtIds)
-{
-}
-
 SvxClipboardFormatItem::SvxClipboardFormatItem( sal_uInt16 nId )
     : SfxPoolItem( nId ), pImpl( new SvxClipboardFormatItem_Impl )
 {
diff --git a/svx/source/items/numinf.cxx b/svx/source/items/numinf.cxx
index 56074beb0511..0dcf67964b1b 100644
--- a/svx/source/items/numinf.cxx
+++ b/svx/source/items/numinf.cxx
@@ -78,9 +78,7 @@ SvxNumberInfoItem::SvxNumberInfoItem( SvNumberFormatter* pNumFormatter,
 
 
 SvxNumberInfoItem::SvxNumberInfoItem( const SvxNumberInfoItem& rItem ) :
-
-    SfxPoolItem( rItem.Which() ),
-
+    SfxPoolItem  ( rItem ),
     pFormatter   ( rItem.pFormatter ),
     eValueType   ( rItem.eValueType ),
     aStringVal   ( rItem.aStringVal ),
diff --git a/svx/source/items/ofaitem.cxx b/svx/source/items/ofaitem.cxx
index 5b911ad8965d..b3b92c233abd 100644
--- a/svx/source/items/ofaitem.cxx
+++ b/svx/source/items/ofaitem.cxx
@@ -25,10 +25,6 @@ OfaPtrItem::OfaPtrItem( sal_uInt16 _nWhich, void *_pPtr )
 {
 
 }
-OfaPtrItem::OfaPtrItem( const OfaPtrItem& rItem)
-    : SfxPoolItem( rItem.Which() ), pPtr( rItem.pPtr )
-{
-}
 
 bool OfaPtrItem::operator==( const SfxPoolItem& rItem) const
 {
diff --git a/svx/source/items/zoomslideritem.cxx b/svx/source/items/zoomslideritem.cxx
index d03674e3316c..ed261b781b91 100644
--- a/svx/source/items/zoomslideritem.cxx
+++ b/svx/source/items/zoomslideritem.cxx
@@ -40,20 +40,6 @@ SvxZoomSliderItem::SvxZoomSliderItem( sal_uInt16 nCurrentZoom, sal_uInt16 nMinZo
 }
 
 
-SvxZoomSliderItem::SvxZoomSliderItem( const SvxZoomSliderItem& rOrig )
-: SfxUInt16Item( rOrig.Which(), rOrig.GetValue() )
-, maValues( rOrig.maValues )
-, mnMinZoom( rOrig.mnMinZoom )
-, mnMaxZoom( rOrig.mnMaxZoom )
-{
-}
-
-
-SvxZoomSliderItem::~SvxZoomSliderItem()
-{
-}
-
-
 SfxPoolItem* SvxZoomSliderItem::Clone( SfxItemPool * /*pPool*/ ) const
 {
     return new SvxZoomSliderItem( *this );


More information about the Libreoffice-commits mailing list