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

Noel Grandin noel at peralex.com
Thu May 19 06:40:48 UTC 2016


 include/tools/errinf.hxx       |   15 -----------
 include/tools/multisel.hxx     |    1 
 include/tools/stream.hxx       |   24 ------------------
 include/tools/svborder.hxx     |    5 ---
 include/tools/vcompat.hxx      |    4 ---
 svtools/source/misc/ehdl.cxx   |   11 --------
 tools/source/stream/stream.cxx |   54 -----------------------------------------
 7 files changed, 2 insertions(+), 112 deletions(-)

New commits:
commit 581e4da5847733a0e87d5ff9cd1c9f2b9fa471fe
Author: Noel Grandin <noel at peralex.com>
Date:   Wed May 18 13:18:56 2016 +0200

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

diff --git a/include/tools/errinf.hxx b/include/tools/errinf.hxx
index 571561e..18822c9 100644
--- a/include/tools/errinf.hxx
+++ b/include/tools/errinf.hxx
@@ -97,21 +97,6 @@ public:
     const OUString& GetArg2() const { return aArg2; }
 };
 
-class TOOLS_DLLPUBLIC MessageInfo : public DynamicErrorInfo
-{
-public:
-
-    MessageInfo(sal_uIntPtr UserId, sal_uInt16 nMask = 0) :
-        DynamicErrorInfo(UserId, nMask) {}
-    MessageInfo(sal_uIntPtr UserId, const OUString &rArg, sal_uInt16 nMask = 0 ) :
-        DynamicErrorInfo(UserId, nMask), aArg(rArg) {}
-
-    const OUString&         GetMessageArg() const { return aArg; }
-
-private:
-    OUString           aArg;
-};
-
 struct ErrorContextImpl;
 class TOOLS_DLLPUBLIC ErrorContext
 {
diff --git a/include/tools/multisel.hxx b/include/tools/multisel.hxx
index 103d7fa..5e5767a 100644
--- a/include/tools/multisel.hxx
+++ b/include/tools/multisel.hxx
@@ -114,7 +114,6 @@ public:
         , nRangeIndex( i_nRange ), nCurrent( i_nCurrent ) {}
 
     public:
-        Iterator() : pEnumerator( nullptr ), pPossibleValues( nullptr ), nRangeIndex( -1 ), nCurrent( -1 ) {}
         Iterator& operator++();
         sal_Int32 operator*() const { return nCurrent;}
         bool operator==(const Iterator&) const;
diff --git a/include/tools/stream.hxx b/include/tools/stream.hxx
index a77f095..a75341e 100644
--- a/include/tools/stream.hxx
+++ b/include/tools/stream.hxx
@@ -153,28 +153,6 @@ public:
 };
 
 
-// SvAsyncLockBytes
-
-class SvAsyncLockBytes: public SvOpenLockBytes
-{
-    sal_uInt64 m_nSize;
-    bool m_bTerminated;
-
-public:
-
-    SvAsyncLockBytes(SvStream * pStream, bool bOwner):
-        SvOpenLockBytes(pStream, bOwner), m_nSize(0), m_bTerminated(false) {}
-
-    virtual ErrCode ReadAt(sal_uInt64 nPos, void * pBuffer, sal_Size nCount,
-                           sal_Size * pRead) const override;
-    virtual ErrCode WriteAt(sal_uInt64 nPos, const void * pBuffer, sal_Size nCount,
-                            sal_Size * pWritten) override;
-
-    virtual ErrCode FillAppend(const void * pBuffer, sal_Size nCount,
-                               sal_Size * pWritten) override;
-};
-
-
 // SvStream
 
 class TOOLS_DLLPUBLIC SvStream
@@ -675,8 +653,6 @@ protected:
     /// resized. FreeMemory may need to NULLify handles in derived classes.
     void    FreeMemory();
 
-                    SvMemoryStream(void*) { } // for sub-classes
-
 public:
                     SvMemoryStream( void* pBuf, sal_Size nSize, StreamMode eMode);
                     SvMemoryStream( sal_Size nInitSize=512, sal_Size nResize=64 );
diff --git a/include/tools/svborder.hxx b/include/tools/svborder.hxx
index c919d8c..50ee581 100644
--- a/include/tools/svborder.hxx
+++ b/include/tools/svborder.hxx
@@ -32,11 +32,6 @@ public:
     {
         nTop = nRight = nBottom = nLeft = 0;
     }
-    SvBorder( const Size & rSz )
-    {
-        nTop = nBottom = rSz.Height();
-        nRight = nLeft = rSz.Width();
-    }
     SvBorder( long nLeftP, long nTopP, long nRightP, long nBottomP )
     {
         nLeft = nLeftP;
diff --git a/include/tools/vcompat.hxx b/include/tools/vcompat.hxx
index 149bebd..71b64be 100644
--- a/include/tools/vcompat.hxx
+++ b/include/tools/vcompat.hxx
@@ -38,12 +38,10 @@ class TOOLS_DLLPUBLIC VersionCompat
     StreamMode   mnStmMode;
     sal_uInt16      mnVersion;
 
-                    VersionCompat() {}
-                    VersionCompat( const VersionCompat& ) {}
+                    VersionCompat( const VersionCompat& ) = delete;
     VersionCompat&  operator=( const VersionCompat& ) { return *this; }
 
 public:
-
                     VersionCompat( SvStream& rStm, StreamMode nStreamMode, sal_uInt16 nVersion = 1 );
                     ~VersionCompat();
 
diff --git a/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx
index 6f805ec..4579966 100644
--- a/svtools/source/misc/ehdl.cxx
+++ b/svtools/source/misc/ehdl.cxx
@@ -173,16 +173,7 @@ bool SfxErrorHandler::CreateString(
     sal_uLong nErrCode = pErr->GetErrorCode() & ERRCODE_ERROR_MASK;
     if( nErrCode>=lEnd || nErrCode<=lStart )
         return false;
-    const MessageInfo *pMsgInfo = dynamic_cast<const MessageInfo*>( pErr );
-    if(pMsgInfo)
-    {
-        if(GetMessageString(nErrCode, rStr, nFlags))
-        {
-            rStr = rStr.replaceAll("$(ARG1)", pMsgInfo->GetMessageArg());
-            return true;
-        }
-    }
-    else if(GetErrorString(nErrCode, rStr, nFlags))
+    if(GetErrorString(nErrCode, rStr, nFlags))
     {
         const StringErrorInfo *pStringInfo = dynamic_cast<const StringErrorInfo *>(pErr);
         if(pStringInfo)
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index 0074ed6..b57cda2 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -250,60 +250,6 @@ ErrCode SvLockBytes::Stat(SvLockBytesStat * pStat, SvLockBytesStatFlag) const
     return ERRCODE_NONE;
 }
 
-//  class SvOpenLockBytes
-
-
-//  class SvAsyncLockBytes
-
-
-// virtual
-ErrCode SvAsyncLockBytes::ReadAt(sal_uInt64 const nPos, void * pBuffer, sal_Size nCount,
-                                 sal_Size * pRead) const
-{
-    if (m_bTerminated)
-        return SvOpenLockBytes::ReadAt(nPos, pBuffer, nCount, pRead);
-    else
-    {
-        sal_Size nTheCount =
-            std::min<sal_Size>(nPos < m_nSize ? m_nSize - nPos : 0, nCount);
-        ErrCode nError = SvOpenLockBytes::ReadAt(nPos, pBuffer, nTheCount,
-                                                 pRead);
-        return !nCount || nTheCount == nCount || nError ? nError :
-                                                          ERRCODE_IO_PENDING;
-    }
-}
-
-// virtual
-ErrCode SvAsyncLockBytes::WriteAt(sal_uInt64 const nPos, const void * pBuffer,
-                                  sal_Size nCount, sal_Size * pWritten)
-{
-    if (m_bTerminated)
-        return SvOpenLockBytes::WriteAt(nPos, pBuffer, nCount, pWritten);
-    else
-    {
-        sal_Size nTheCount =
-            std::min<sal_Size>(nPos < m_nSize ? m_nSize - nPos : 0, nCount);
-        ErrCode nError = SvOpenLockBytes::WriteAt(nPos, pBuffer, nTheCount,
-                                                  pWritten);
-        return !nCount || nTheCount == nCount || nError ? nError :
-                                                          ERRCODE_IO_PENDING;
-    }
-}
-
-// virtual
-ErrCode SvAsyncLockBytes::FillAppend(const void * pBuffer, sal_Size nCount,
-                                     sal_Size * pWritten)
-{
-    sal_Size nTheWritten(0);
-    ErrCode nError = SvOpenLockBytes::WriteAt(m_nSize, pBuffer, nCount,
-                                              &nTheWritten);
-    if (!nError)
-        m_nSize += nTheWritten;
-    if (pWritten)
-        *pWritten = nTheWritten;
-    return nError;
-}
-
 //  class SvStream
 
 sal_Size SvStream::GetData( void* pData, sal_Size nSize )


More information about the Libreoffice-commits mailing list