[Libreoffice-commits] core.git: l10ntools/inc l10ntools/source sal/osl sot/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Jul 26 06:32:24 UTC 2018


 l10ntools/inc/helpmerge.hxx      |    2 +-
 l10ntools/inc/lngmerge.hxx       |    4 ++--
 l10ntools/inc/xmlparse.hxx       |    2 +-
 l10ntools/source/helpmerge.cxx   |    7 +++----
 l10ntools/source/lngmerge.cxx    |    6 ++----
 l10ntools/source/xmlparse.cxx    |    3 +--
 sal/osl/unx/file.cxx             |    8 ++++----
 sot/source/sdstor/stgdir.cxx     |   12 ++----------
 sot/source/sdstor/stgelem.cxx    |    3 +--
 sot/source/sdstor/stgelem.hxx    |    2 +-
 sot/source/sdstor/ucbstorage.cxx |    8 ++++----
 11 files changed, 22 insertions(+), 35 deletions(-)

New commits:
commit ba42d00ed5a04850f88abdf184a4855db7cf2700
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Jul 25 13:56:57 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Jul 26 08:31:55 2018 +0200

    loplugin:returnconstant in sal,l10ntools,sot
    
    Change-Id: I3f4e4efa8ea839f48b9700ebc26c7e5ab279ce49
    Reviewed-on: https://gerrit.libreoffice.org/57975
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/l10ntools/inc/helpmerge.hxx b/l10ntools/inc/helpmerge.hxx
index 5837cc2f7765..99c9270df9fe 100644
--- a/l10ntools/inc/helpmerge.hxx
+++ b/l10ntools/inc/helpmerge.hxx
@@ -52,7 +52,7 @@ public:
         const OString& sLanguage , MergeDataFile* pMergeDataFile );
 
 private:
-    bool MergeSingleFile( XMLFile* file , MergeDataFile* pMergeDataFile , const OString& sLanguage , OString const & sPath );
+    void MergeSingleFile( XMLFile* file , MergeDataFile* pMergeDataFile , const OString& sLanguage , OString const & sPath );
 
     static void ProcessHelp( LangHashMap* aLangHM , const OString& sCur , ResData *pResData , MergeDataFile* pMergeDataFile );
 };
diff --git a/l10ntools/inc/lngmerge.hxx b/l10ntools/inc/lngmerge.hxx
index 35c7868b01a3..56eaec71b11d 100644
--- a/l10ntools/inc/lngmerge.hxx
+++ b/l10ntools/inc/lngmerge.hxx
@@ -54,8 +54,8 @@ public:
     LngParser(const OString &rLngFile);
     ~LngParser();
 
-    bool CreatePO( const OString &rPOFile );
-    bool Merge(const OString &rPOFile, const OString &rDestinationFile,
+    void CreatePO( const OString &rPOFile );
+    void Merge(const OString &rPOFile, const OString &rDestinationFile,
          const OString &rLanguage );
 };
 
diff --git a/l10ntools/inc/xmlparse.hxx b/l10ntools/inc/xmlparse.hxx
index 04f150d5d674..027076f39725 100644
--- a/l10ntools/inc/xmlparse.hxx
+++ b/l10ntools/inc/xmlparse.hxx
@@ -157,7 +157,7 @@ public:
 
     XMLHashMap* GetStrings(){ return m_pXMLStrings.get(); }
     void Write( OString const &rFilename );
-    bool Write( std::ofstream &rStream, XMLNode *pCur = nullptr );
+    void Write( std::ofstream &rStream, XMLNode *pCur = nullptr );
 
     bool CheckExportStatus( XMLParentNode *pCur = nullptr );
 
diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx
index 92f5171e5e67..0a2e3c3dfd52 100644
--- a/l10ntools/source/helpmerge.cxx
+++ b/l10ntools/source/helpmerge.cxx
@@ -156,12 +156,12 @@ bool HelpParser::Merge( const OString &rDestinationFile,
         SAL_WARN("l10ntools", "could not parse " << sHelpFile);
         return false;
     }
-    bool hasNoError = MergeSingleFile( xmlfile , pMergeDataFile , rLanguage , rDestinationFile );
+    MergeSingleFile( xmlfile , pMergeDataFile , rLanguage , rDestinationFile );
     delete xmlfile;
-    return hasNoError;
+    return true;
 }
 
-bool HelpParser::MergeSingleFile( XMLFile* file , MergeDataFile* pMergeDataFile , const OString& sLanguage ,
+void HelpParser::MergeSingleFile( XMLFile* file , MergeDataFile* pMergeDataFile , const OString& sLanguage ,
                                   OString const & sPath )
 {
     file->Extract();
@@ -189,7 +189,6 @@ bool HelpParser::MergeSingleFile( XMLFile* file , MergeDataFile* pMergeDataFile
      }
 
     file->Write(sPath);
-    return true;
 }
 
 /* ProcessHelp method: search for en-US entry and replace it with the current language*/
diff --git a/l10ntools/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx
index f5215e4d14b2..39f98747e99c 100644
--- a/l10ntools/source/lngmerge.cxx
+++ b/l10ntools/source/lngmerge.cxx
@@ -79,7 +79,7 @@ LngParser::~LngParser()
 {
 }
 
-bool LngParser::CreatePO( const OString &rPOFile )
+void LngParser::CreatePO( const OString &rPOFile )
 {
     PoOfstream aPOStream( rPOFile, PoOfstream::APP );
     if (!aPOStream.isOpen()) {
@@ -109,7 +109,6 @@ bool LngParser::CreatePO( const OString &rPOFile )
         Text.erase("x-comment");
     }
     aPOStream.close();
-    return true;
 }
 
 void LngParser::WritePO(PoOfstream &aPOStream,
@@ -145,7 +144,7 @@ void LngParser::ReadLine(const OString &rLine_in,
     }
 }
 
-bool LngParser::Merge(
+void LngParser::Merge(
     const OString &rPOFile,
     const OString &rDestinationFile,
     const OString &rLanguage )
@@ -290,7 +289,6 @@ bool LngParser::Merge(
         aDestination << mvLines[i] << '\n';
 
     aDestination.close();
-    return true;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/l10ntools/source/xmlparse.cxx b/l10ntools/source/xmlparse.cxx
index f8faf8538089..462c4d2e1ce9 100644
--- a/l10ntools/source/xmlparse.cxx
+++ b/l10ntools/source/xmlparse.cxx
@@ -164,7 +164,7 @@ void XMLFile::Write( OString const &aFilename )
     s.close();
 }
 
-bool XMLFile::Write( ofstream &rStream , XMLNode *pCur )
+void XMLFile::Write( ofstream &rStream , XMLNode *pCur )
 {
     if ( !pCur )
         Write( rStream, this );
@@ -229,7 +229,6 @@ bool XMLFile::Write( ofstream &rStream , XMLNode *pCur )
             break;
         }
     }
-    return true;
 }
 
 void XMLFile::Print( XMLNode *pCur, sal_uInt16 nLevel )
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index 40aadc940e88..0101bf6f8e36 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -100,7 +100,7 @@ struct FileHandle_Impl
     static size_t getpagesize();
 
     sal_uInt64   getPos() const;
-    oslFileError setPos(sal_uInt64 uPos);
+    void setPos(sal_uInt64 uPos);
 
     sal_uInt64   getSize() const;
     oslFileError setSize(sal_uInt64 uSize);
@@ -282,10 +282,9 @@ sal_uInt64 FileHandle_Impl::getPos() const
     return sal::static_int_cast< sal_uInt64 >(m_fileptr);
 }
 
-oslFileError FileHandle_Impl::setPos(sal_uInt64 uPos)
+void FileHandle_Impl::setPos(sal_uInt64 uPos)
 {
     m_fileptr = sal::static_int_cast< off_t >(uPos);
-    return osl_File_E_None;
 }
 
 sal_uInt64 FileHandle_Impl::getSize() const
@@ -1490,7 +1489,8 @@ oslFileError SAL_CALL osl_setFilePos(oslFileHandle Handle, sal_uInt32 uHow, sal_
             return osl_File_E_INVAL;
     }
 
-    return pImpl->setPos(nPos + nOffset);
+    pImpl->setPos(nPos + nOffset);
+    return osl_File_E_None;
 }
 
 oslFileError SAL_CALL osl_getFileSize(oslFileHandle Handle, sal_uInt64* pSize)
diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx
index b2e64967c436..f400d79cbd20 100644
--- a/sot/source/sdstor/stgdir.cxx
+++ b/sot/source/sdstor/stgdir.cxx
@@ -901,11 +901,7 @@ StgDirEntry* StgDirStrm::Find( StgDirEntry& rStg, const OUString& rName )
     {
         StgEntry aEntry;
         aEntry.Init();
-        if( !aEntry.SetName( rName ) )
-        {
-            m_rIo.SetError( SVSTREAM_GENERALERROR );
-            return nullptr;
-        }
+        aEntry.SetName( rName );
         // Look in the directory attached to the entry
         StgDirEntry aTest( aEntry );
         return static_cast<StgDirEntry*>( rStg.m_pDown->Find( &aTest ) );
@@ -921,11 +917,7 @@ StgDirEntry* StgDirStrm::Create( StgDirEntry& rStg, const OUString& rName, StgEn
     StgEntry aEntry;
     aEntry.Init();
     aEntry.SetType( eType );
-    if( !aEntry.SetName( rName ) )
-    {
-        m_rIo.SetError( SVSTREAM_GENERALERROR );
-        return nullptr;
-    }
+    aEntry.SetName( rName );
     StgDirEntry* pRes = Find( rStg, rName );
     if( pRes )
     {
diff --git a/sot/source/sdstor/stgelem.cxx b/sot/source/sdstor/stgelem.cxx
index 88f7bcb7c876..be22b5e44b6e 100644
--- a/sot/source/sdstor/stgelem.cxx
+++ b/sot/source/sdstor/stgelem.cxx
@@ -317,7 +317,7 @@ static OUString ToUpperUnicode( const OUString & rStr )
     return aCC.uppercase( rStr );
 }
 
-bool StgEntry::SetName( const OUString& rName )
+void StgEntry::SetName( const OUString& rName )
 {
     // I don't know the locale, so en_US is hopefully fine
     m_aName = ToUpperUnicode( rName );
@@ -336,7 +336,6 @@ bool StgEntry::SetName( const OUString& rName )
         m_nName[ i++ ] = 0;
     }
     m_nNameLen = ( rName.getLength() + 1 ) << 1;
-    return true;
 }
 
 sal_Int32 StgEntry::GetLeaf( StgEntryRef eRef ) const
diff --git a/sot/source/sdstor/stgelem.hxx b/sot/source/sdstor/stgelem.hxx
index 5fa3170280b9..7dce8863a824 100644
--- a/sot/source/sdstor/stgelem.hxx
+++ b/sot/source/sdstor/stgelem.hxx
@@ -118,7 +118,7 @@ class StgEntry
     OUString    m_aName;                      // Name as Compare String (ascii, upper)
 public:
     void        Init();                     // initialize the data
-    bool        SetName( const OUString& );   // store a name (ASCII, up to 32 chars)
+    void        SetName( const OUString& );   // store a name (ASCII, up to 32 chars)
     void        GetName( OUString& rName ) const;
                                         // fill in the name
     sal_Int32   Compare( const StgEntry& ) const;   // compare two entries
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index a9780879e907..77b88df16693 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -487,7 +487,7 @@ public:
                                 UCBStorage_Impl( SvStream&, UCBStorage*, bool );
     void                        Init();
     sal_Int16                   Commit();
-    bool                        Revert();
+    void                        Revert();
     bool                        Insert( ::ucbhelper::Content *pContent );
     UCBStorage_Impl*            OpenStorage( UCBStorageElement_Impl* pElement, StreamMode nMode, bool bDirect );
     void                        OpenStream( UCBStorageElement_Impl*, StreamMode, bool );
@@ -2269,7 +2269,7 @@ sal_Int16 UCBStorage_Impl::Commit()
     return nRet;
 }
 
-bool UCBStorage_Impl::Revert()
+void UCBStorage_Impl::Revert()
 {
     for ( size_t i = 0; i < m_aChildrenList.size(); )
     {
@@ -2295,7 +2295,6 @@ bool UCBStorage_Impl::Revert()
             ++i;
         }
     }
-    return true;
 }
 
 const OUString& UCBStorage::GetName() const
@@ -2541,7 +2540,8 @@ bool UCBStorage::Commit()
 
 bool UCBStorage::Revert()
 {
-    return pImp->Revert();
+    pImp->Revert();
+    return true;
 }
 
 BaseStorageStream* UCBStorage::OpenStream( const OUString& rEleName, StreamMode nMode, bool bDirect )


More information about the Libreoffice-commits mailing list