[Libreoffice-commits] core.git: include/vcl l10ntools/inc sc/source vcl/inc

Noel Grandin noel at peralex.com
Wed Jun 1 06:49:30 UTC 2016


 include/vcl/bitmapaccess.hxx          |   12 +--------
 include/vcl/threadex.hxx              |   29 -----------------------
 l10ntools/inc/xmlparse.hxx            |    1 
 sc/source/filter/inc/stylesbuffer.hxx |   10 --------
 sc/source/filter/oox/stylesbuffer.cxx |   42 ----------------------------------
 vcl/inc/fontattributes.hxx            |   13 ----------
 vcl/inc/impfont.hxx                   |    1 
 vcl/inc/impfontmetricdata.hxx         |   27 ---------------------
 8 files changed, 2 insertions(+), 133 deletions(-)

New commits:
commit c150ac07873e2861d0b4531fe88648801c9995be
Author: Noel Grandin <noel at peralex.com>
Date:   Tue May 31 11:28:46 2016 +0200

    loplugin:unusedmethods
    
    Change-Id: Ia7981447e96d9ac87526ad1276585ab3077d7f08
    Reviewed-on: https://gerrit.libreoffice.org/25707
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/include/vcl/bitmapaccess.hxx b/include/vcl/bitmapaccess.hxx
index e0d0a5a..f8f1cc8 100644
--- a/include/vcl/bitmapaccess.hxx
+++ b/include/vcl/bitmapaccess.hxx
@@ -61,16 +61,8 @@ public:
     inline ColorMask&           GetColorMask() const;
 
 private:
-    BitmapInfoAccess()
-    {}
-
-    BitmapInfoAccess(const BitmapInfoAccess&)
-    {}
-
-    BitmapInfoAccess& operator=(const BitmapInfoAccess&)
-    {
-        return *this;
-    }
+    BitmapInfoAccess(const BitmapInfoAccess&) = delete;
+    BitmapInfoAccess& operator=(const BitmapInfoAccess&) = delete;
 
 protected:
     Bitmap maBitmap;
diff --git a/include/vcl/threadex.hxx b/include/vcl/threadex.hxx
index 891d022..2f27657 100644
--- a/include/vcl/threadex.hxx
+++ b/include/vcl/threadex.hxx
@@ -120,35 +120,6 @@ private:
     FuncT const m_func;
 };
 
-template <typename T>
-class copy_back_wrapper
-{
-public:
-    operator T *() const { return &m_holder->m_value; }
-    operator T &() const { return m_holder->m_value; }
-
-    explicit copy_back_wrapper( T * p ) : m_holder( new data_holder(p) ) {}
-
-    // no thread-safe counting needed here, because calling thread blocks
-    // until solar thread has executed the functor.
-    copy_back_wrapper( copy_back_wrapper<T> const& r )
-        : m_holder(r.m_holder) { ++m_holder->m_refCount; }
-    ~copy_back_wrapper() {
-        --m_holder->m_refCount;
-        if (m_holder->m_refCount == 0) {
-            delete m_holder;
-        }
-    }
-private:
-    struct data_holder {
-        T m_value;
-        T * const m_ptr;
-        data_holder( T * p ) : m_value(*p), m_ptr(p) {}
-        ~data_holder() { *m_ptr = m_value; }
-    };
-    data_holder * const m_holder;
-};
-
 } // namespace detail
 
 
diff --git a/l10ntools/inc/xmlparse.hxx b/l10ntools/inc/xmlparse.hxx
index ad3bd87..8d8fe9f 100644
--- a/l10ntools/inc/xmlparse.hxx
+++ b/l10ntools/inc/xmlparse.hxx
@@ -93,7 +93,6 @@ private:
 
 protected:
     XMLChildNode( XMLParentNode *pPar );
-    XMLChildNode(): m_pParent( nullptr ){};
     XMLChildNode( const XMLChildNode& rObj);
     XMLChildNode& operator=(const XMLChildNode& rObj);
 public:
diff --git a/sc/source/filter/inc/stylesbuffer.hxx b/sc/source/filter/inc/stylesbuffer.hxx
index 26ff2b1..3f25bca 100644
--- a/sc/source/filter/inc/stylesbuffer.hxx
+++ b/sc/source/filter/inc/stylesbuffer.hxx
@@ -334,8 +334,6 @@ public:
     inline const ApiAlignmentData& getApiData() const { return maApiData; }
 
     void                fillToItemSet( SfxItemSet& rItemSet, bool bSkipPoolDefs = false ) const;
-    /** Writes all alignment attributes to the passed property map. */
-    void                writeToPropertyMap( PropertyMap& rPropMap ) const;
 
 private:
     ::SvxCellHorJustify GetScHorAlign() const;
@@ -383,8 +381,6 @@ public:
     /** Returns the converted API protection data struct. */
     inline const ApiProtectionData& getApiData() const { return maApiData; }
 
-    /** Writes all protection attributes to the passed property map. */
-    void                writeToPropertyMap( PropertyMap& rPropMap ) const;
     void                fillToItemSet( SfxItemSet& rItemSet, bool bSkipPoolDefs = false ) const;
 private:
     ProtectionModel     maModel;            /// Protection model data.
@@ -881,17 +877,11 @@ public:
     OUString     createDxfStyle( sal_Int32 nDxfId ) const;
 
     void                writeFontToItemSet( SfxItemSet& rItemSet, sal_Int32 nFontId, bool bSkipPoolDefs = false ) const;
-    /** Writes the font attributes of the specified font data to the passed property map. */
-    void                writeFontToPropertyMap( PropertyMap& rPropMap, sal_Int32 nFontId ) const;
     sal_uLong           writeNumFmtToItemSet( SfxItemSet& rItemSet, sal_Int32 nNumFmtId, bool bSkipPoolDefs = false ) const;
     /** Writes the specified number format to the passed property map. */
-    void                writeNumFmtToPropertyMap( PropertyMap& rPropMap, sal_Int32 nNumFmtId ) const;
     void                writeBorderToItemSet( SfxItemSet& rItemSet, sal_Int32 nBorderId, bool bSkipPoolDefs = false ) const;
-    /** Writes the border attributes of the specified border data to the passed property map. */
-    void                writeBorderToPropertyMap( PropertyMap& rPropMap, sal_Int32 nBorderId ) const;
     /** Writes the fill attributes of the specified fill data to the passed property map. */
     void                writeFillToItemSet( SfxItemSet& rItemSet, sal_Int32 nFillId, bool bSkipPoolDefs = false ) const;
-    void                writeFillToPropertyMap( PropertyMap& rPropMap, sal_Int32 nFillId ) const;
 
     /** Writes the cell formatting attributes of the specified XF to the passed property set. */
     void                writeCellXfToDoc( ScDocumentImport& rDoc, const css::table::CellRangeAddress& rRange, sal_Int32 nXfId ) const;
diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx
index 5e0e09b..033d5d9 100644
--- a/sc/source/filter/oox/stylesbuffer.cxx
+++ b/sc/source/filter/oox/stylesbuffer.cxx
@@ -1346,20 +1346,6 @@ void Alignment::fillToItemSet( SfxItemSet& rItemSet, bool bSkipPoolDefs ) const
     ScfTools::PutItem( rItemSet, SfxBoolItem( ATTR_SHRINKTOFIT, maApiData.mbShrink ), bSkipPoolDefs );
 }
 
-void Alignment::writeToPropertyMap( PropertyMap& rPropMap ) const
-{
-    rPropMap.setProperty( PROP_HoriJustify, maApiData.meHorJustify);
-    rPropMap.setProperty( PROP_HoriJustifyMethod, maApiData.mnHorJustifyMethod);
-    rPropMap.setProperty( PROP_VertJustify, maApiData.mnVerJustify);
-    rPropMap.setProperty( PROP_VertJustifyMethod, maApiData.mnVerJustifyMethod);
-    rPropMap.setProperty( PROP_WritingMode, maApiData.mnWritingMode);
-    rPropMap.setProperty( PROP_RotateAngle, maApiData.mnRotation);
-    rPropMap.setProperty( PROP_Orientation, maApiData.meOrientation);
-    rPropMap.setProperty( PROP_ParaIndent, maApiData.mnIndent);
-    rPropMap.setProperty( PROP_IsTextWrapped, maApiData.mbWrapText);
-    rPropMap.setProperty( PROP_ShrinkToFit, maApiData.mbShrink);
-}
-
 ProtectionModel::ProtectionModel() :
     mbLocked( true ),   // default in Excel and Calc
     mbHidden( false )
@@ -1403,11 +1389,6 @@ void Protection::finalizeImport()
     maApiData.maCellProt.IsFormulaHidden = maModel.mbHidden;
 }
 
-void Protection::writeToPropertyMap( PropertyMap& rPropMap ) const
-{
-    rPropMap.setProperty( PROP_CellProtection, maApiData.maCellProt);
-}
-
 void Protection::fillToItemSet( SfxItemSet& rItemSet, bool bSkipPoolDefs ) const
 {
     ScfTools::PutItem( rItemSet, ScProtectionAttr( maApiData.maCellProt.IsLocked, maApiData.maCellProt.IsFormulaHidden ), bSkipPoolDefs );
@@ -3058,46 +3039,23 @@ void StylesBuffer::writeFontToItemSet( SfxItemSet& rItemSet, sal_Int32 nFontId,
         pFont->fillToItemSet( rItemSet, false, bSkipPoolDefs );
 }
 
-void StylesBuffer::writeFontToPropertyMap( PropertyMap& rPropMap, sal_Int32 nFontId ) const
-{
-    if( Font* pFont = maFonts.get( nFontId ).get() )
-        pFont->writeToPropertyMap( rPropMap, FONT_PROPTYPE_CELL );
-}
-
 sal_uLong StylesBuffer::writeNumFmtToItemSet( SfxItemSet& rItemSet, sal_Int32 nNumFmtId, bool bSkipPoolDefs ) const
 {
     return maNumFmts.fillToItemSet( rItemSet, nNumFmtId, bSkipPoolDefs );
 }
 
-void StylesBuffer::writeNumFmtToPropertyMap( PropertyMap& rPropMap, sal_Int32 nNumFmtId ) const
-{
-    maNumFmts.writeToPropertyMap( rPropMap, nNumFmtId );
-}
-
 void StylesBuffer::writeBorderToItemSet( SfxItemSet& rItemSet, sal_Int32 nBorderId, bool bSkipPoolDefs ) const
 {
     if( Border* pBorder = maBorders.get( nBorderId ).get() )
         pBorder->fillToItemSet( rItemSet, bSkipPoolDefs );
 }
 
-void StylesBuffer::writeBorderToPropertyMap( PropertyMap& rPropMap, sal_Int32 nBorderId ) const
-{
-    if( Border* pBorder = maBorders.get( nBorderId ).get() )
-        pBorder->writeToPropertyMap( rPropMap );
-}
-
 void StylesBuffer::writeFillToItemSet( SfxItemSet& rItemSet, sal_Int32 nFillId, bool bSkipPoolDefs ) const
 {
     if( Fill* pFill = maFills.get( nFillId ).get() )
         pFill->fillToItemSet( rItemSet, bSkipPoolDefs );
 }
 
-void StylesBuffer::writeFillToPropertyMap( PropertyMap& rPropMap, sal_Int32 nFillId ) const
-{
-    if( Fill* pFill = maFills.get( nFillId ).get() )
-        pFill->writeToPropertyMap( rPropMap );
-}
-
 bool operator==( const XfModel& rXfModel1,  const XfModel& rXfModel2 )
 {
     return ( rXfModel1.mbCellXf == rXfModel2.mbCellXf &&
diff --git a/vcl/inc/fontattributes.hxx b/vcl/inc/fontattributes.hxx
index 6e464b3..faca6a8 100644
--- a/vcl/inc/fontattributes.hxx
+++ b/vcl/inc/fontattributes.hxx
@@ -55,8 +55,6 @@ public:
     void                SetItalic(const FontItalic eItalic )        { meItalic = eItalic; }
     void                SetWeight(const FontWeight eWeight )        { meWeight = eWeight; }
     void                SetWidthType(const FontWidth eWidthType)    { meWidthType = eWidthType; }
-    void                SetAlignment(const TextAlign eAlignment)    { meAlign = eAlignment; }
-    void                SetCharSet( const rtl_TextEncoding );
 
     void                SetSymbolFlag(const bool );
 
@@ -69,13 +67,9 @@ public:
     bool                IsBuiltInFont() const                       { return mbDevice; }
     bool                CanEmbed() const                            { return mbEmbeddable; }
     bool                CanSubset() const                           { return mbSubsettable; }
-    bool                CanRotate() const                           { return mbOrientation; }
-    bool                HasMapNames() const                         { return (maMapNames.getLength() > 0); }
 
     void                SetQuality( int nQuality )                  { mnQuality = nQuality; }
     void                IncreaseQualityBy( int nQualityAmount )     { mnQuality += nQualityAmount; }
-    void                DecreaseQualityBy( int nQualityAmount )     { mnQuality -= nQualityAmount; }
-    void                SetMapNames( OUString const & aMapNames )   { maMapNames = aMapNames; }
     void                AddMapName( OUString const& );
 
     void                SetBuiltInFontFlag( bool bIsBuiltInFont )   { mbDevice = bIsBuiltInFont; }
@@ -125,13 +119,6 @@ inline void FontAttributes::SetSymbolFlag( const bool bSymbolFlag )
     }
 }
 
-inline void FontAttributes::SetCharSet( const rtl_TextEncoding aEncoding )
-{
-    meCharSet = aEncoding;
-    mbSymbolFlag = meCharSet == RTL_TEXTENCODING_SYMBOL;
-}
-
-
 inline void FontAttributes::AddMapName( OUString const & aMapName )
 {
     if( maMapNames.getLength() > 0 )
diff --git a/vcl/inc/impfont.hxx b/vcl/inc/impfont.hxx
index e608471..0f5d3f3 100644
--- a/vcl/inc/impfont.hxx
+++ b/vcl/inc/impfont.hxx
@@ -74,7 +74,6 @@ public:
 
     // device dependent functions
     int                 GetQuality() const                              { return mnQuality; }
-    const OUString&     GetMapNames() const                             { return maMapNames; }
 
     void                SetQuality( int nQuality )                      { mnQuality = nQuality; }
     void                IncreaseQualityBy( int nQualityAmount )         { mnQuality += nQualityAmount; }
diff --git a/vcl/inc/impfontmetricdata.hxx b/vcl/inc/impfontmetricdata.hxx
index c8180fc..7a59fd7 100644
--- a/vcl/inc/impfontmetricdata.hxx
+++ b/vcl/inc/impfontmetricdata.hxx
@@ -70,7 +70,6 @@ public:
     void            SetTrueTypeFlag(bool bTrueTypeFont)                             { mbTrueTypeFont = bTrueTypeFont; }
     void            SetKernableFlag(bool bKernable)                                 { mbKernableFont = bKernable; }
     void            SetFullstopCenteredFlag(bool bFullstopCentered)                 { mbFullstopCentered = bFullstopCentered; }
-    void            SetBulletOffset(long nBulletOffset)                             { mnBulletOffset = nBulletOffset; }
 
     // font metrics that are usually derived from the measurements
     long            GetUnderlineSize()                                              { return mnUnderlineSize; }
@@ -99,32 +98,6 @@ public:
     long            GetDoubleStrikeoutOffset1()                                     { return mnDStrikeoutOffset1; }
     long            GetDoubleStrikeoutOffset2()                                     { return mnDStrikeoutOffset2; }
 
-    void            SetUnderlineSize( long nUnderlineSize )                         { mnUnderlineSize = nUnderlineSize; }
-    void            SetUnderlineOffset( long nUnderlineOffset )                     { mnUnderlineOffset = nUnderlineOffset; }
-    void            SetBoldUnderlineSize( long nBUnderlineSize )                    { mnBUnderlineSize = nBUnderlineSize; }
-    void            SetBoldUnderlineOffset( long nBUnderlineOffset )                { mnBUnderlineOffset = nBUnderlineOffset; }
-    void            SetDoubleUnderlineSize( long nDUnderlineSize )                  { mnDUnderlineSize = nDUnderlineSize; }
-    void            SetDoubleUnderlineOffset1( long nDUnderlineOffset1 )            { mnDUnderlineOffset1 = nDUnderlineOffset1; }
-    void            SetDoubleUnderlineOffset2( long nDUnderlineOffset2 )            { mnDUnderlineOffset2 = nDUnderlineOffset2; }
-    void            SetWavelineUnderlineSize( long nWUnderlineSize )                { mnWUnderlineSize = nWUnderlineSize; }
-    void            SetWavelineUnderlineOffset( long nWUnderlineOffset )            { mnWUnderlineOffset = nWUnderlineOffset; }
-    void            SetAboveUnderlineSize( long nAboveUnderlineSize )               { mnAboveUnderlineSize = nAboveUnderlineSize; }
-    void            SetAboveUnderlineOffset( long nAboveUnderlineOffset )           { mnAboveUnderlineOffset = nAboveUnderlineOffset; }
-    void            SetAboveBoldUnderlineSize( long nAboveBUnderlineSize )          { mnAboveBUnderlineSize = nAboveBUnderlineSize; }
-    void            SetAboveBoldUnderlineOffset( long nAboveBUnderlineOffset )      { mnAboveBUnderlineOffset = nAboveBUnderlineOffset; }
-    void            SetAboveDoubleUnderlineSize( long nAboveDUnderlineSize )        { mnAboveDUnderlineSize = nAboveDUnderlineSize; }
-    void            SetAboveDoubleUnderlineOffset1( long nAboveDUnderlineOffset1 )  { mnAboveDUnderlineOffset1 = nAboveDUnderlineOffset1; }
-    void            SetAboveDoubleUnderlineOffset2( long nAboveDUnderlineOffset2 )  { mnAboveDUnderlineOffset2 = nAboveDUnderlineOffset2; }
-    void            SetAboveWavelineUnderlineSize( long nAboveWUnderlineSize )      { mnAboveWUnderlineSize = nAboveWUnderlineSize; }
-    void            SetAboveWavelineUnderlineOffset( long nAboveWUnderlineOffset )  { mnAboveWUnderlineOffset = nAboveWUnderlineOffset; }
-    void            SetStrikeoutSize( long nStrikeoutSize )                         { mnStrikeoutSize = nStrikeoutSize; }
-    void            SetStrikeoutOffset( long nStrikeoutOffset )                     { mnStrikeoutOffset = nStrikeoutOffset; }
-    void            SetBoldStrikeoutSize( long nBStrikeoutSize )                    { mnBStrikeoutSize = nBStrikeoutSize; }
-    void            SetBoldStrikeoutOffset( long nBStrikeoutOffset )                { mnBStrikeoutOffset = nBStrikeoutOffset; }
-    void            SetDoubleStrikeoutSize( long nDStrikeoutSize )                  { mnDStrikeoutSize = nDStrikeoutSize; }
-    void            SetDoubleStrikeoutOffset1( long nDStrikeoutOffset1 )            { mnDStrikeoutOffset1 = nDStrikeoutOffset1; }
-    void            SetDoubleStrikeoutOffset2( long nDStrikeoutOffset2 )            { mnDStrikeoutOffset2 = nDStrikeoutOffset2; }
-
     void            ImplInitTextLineSize( const OutputDevice* pDev );
     void            ImplInitAboveTextLineSize();
 


More information about the Libreoffice-commits mailing list