From 6f4ad52d4cad5093e72120decea31066a419665f Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 22 Feb 2019 11:09:53 +0200 Subject: loplugin:unusedfields in sot and simplify, the ErrorLink functionality in StgIo is actually unused Change-Id: I6fb73ebebce2e1b144bd7a75d37323299fd73581 Reviewed-on: https://gerrit.libreoffice.org/68200 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sot/source/sdstor/stg.cxx | 2 -- sot/source/sdstor/stgio.cxx | 15 --------------- sot/source/sdstor/stgio.hxx | 7 ------- sot/source/sdstor/ucbstorage.cxx | 7 +++---- 4 files changed, 3 insertions(+), 28 deletions(-) (limited to 'sot') diff --git a/sot/source/sdstor/stg.cxx b/sot/source/sdstor/stg.cxx index d22bbbe6a465..2bf3ac2d8113 100644 --- a/sot/source/sdstor/stg.cxx +++ b/sot/source/sdstor/stg.cxx @@ -880,9 +880,7 @@ OUString Storage::GetUserName() bool Storage::ValidateFAT() { - Link aLink = StgIo::GetErrorLink(); FatError nErr = pIo->ValidateFATs(); - StgIo::SetErrorLink( aLink ); return nErr == FatError::Ok; } diff --git a/sot/source/sdstor/stgio.cxx b/sot/source/sdstor/stgio.cxx index 2a82c0731b52..8ec356d20699 100644 --- a/sot/source/sdstor/stgio.cxx +++ b/sot/source/sdstor/stgio.cxx @@ -355,18 +355,6 @@ FatError Validator::FindUnrefedChains() const return FatError::Ok; } -namespace { struct ErrorLink : public rtl::Static, ErrorLink > {}; } - -void StgIo::SetErrorLink( const Link& rLink ) -{ - ErrorLink::get() = rLink; -} - -const Link& StgIo::GetErrorLink() -{ - return ErrorLink::get(); -} - FatError StgIo::ValidateFATs() { if( m_bFile ) @@ -395,9 +383,6 @@ FatError StgIo::ValidateFATs() else nErr = bRet1 ? FatError::Ok : FatError::BothError; if( nErr != FatError::Ok && !m_bCopied ) { - StgLinkArg aArg; - aArg.aFile = pFileStrm->GetFileName(); - ErrorLink::get().Call( aArg ); m_bCopied = true; } // DBG_ASSERT( nErr == FatError::Ok ,"Storage broken"); diff --git a/sot/source/sdstor/stgio.hxx b/sot/source/sdstor/stgio.hxx index d73db29cfb01..8e09c6ae1c09 100644 --- a/sot/source/sdstor/stgio.hxx +++ b/sot/source/sdstor/stgio.hxx @@ -41,11 +41,6 @@ enum class FatError BothError }; -struct StgLinkArg -{ - OUString aFile; -}; - class StgIo : public StgCache { void SetupStreams(); // load all internal streams bool m_bCopied; @@ -62,8 +57,6 @@ public: bool Init(); // set up an empty file bool CommitAll(); // commit everything (root commit) - static void SetErrorLink( const Link& ); - static const Link& GetErrorLink(); FatError ValidateFATs( ); }; diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index 0f76afcfafca..59b9f97f1e85 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -450,7 +450,6 @@ class UCBStorage_Impl : public SvRefBase public: UCBStorage* m_pAntiImpl; // only valid if external references exists - OUString m_aOriginalName;// the original name before accessing the storage OUString m_aName; // the actual name ( changed with a Rename command at the parent ) OUString m_aURL; // the full path name to create the content OUString m_aContentType; @@ -1463,7 +1462,7 @@ UCBStorage_Impl::UCBStorage_Impl( const ::ucbhelper::Content& rContent, const OU DBG_ASSERT( m_bIsRoot, "SubStorage must have a name!" ); m_pTempFile.reset(new ::utl::TempFile); m_pTempFile->EnableKillingFile(); - m_aName = m_aOriginalName = aName = m_pTempFile->GetURL(); + m_aName = aName = m_pTempFile->GetURL(); } m_aURL = rName; @@ -1492,7 +1491,7 @@ UCBStorage_Impl::UCBStorage_Impl( const OUString& rName, StreamMode nMode, UCBSt DBG_ASSERT( m_bIsRoot, "SubStorage must have a name!" ); m_pTempFile.reset(new ::utl::TempFile); m_pTempFile->EnableKillingFile(); - m_aName = m_aOriginalName = aName = m_pTempFile->GetURL(); + m_aName = aName = m_pTempFile->GetURL(); } if ( m_bIsRoot ) @@ -1568,7 +1567,7 @@ void UCBStorage_Impl::Init() INetURLObject aObj( m_aURL ); if ( m_aName.isEmpty() ) // if the name was not already set to a temp name - m_aName = m_aOriginalName = aObj.GetLastName(); + m_aName = aObj.GetLastName(); if ( !m_pContent ) CreateContent(); -- cgit