summaryrefslogtreecommitdiff
path: root/sot
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-07-25 13:56:57 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-26 08:31:55 +0200
commitba42d00ed5a04850f88abdf184a4855db7cf2700 (patch)
treeaf8ec0b48accf0abb7dce9f0fb0194cd60440e14 /sot
parentee025b744ac9efafe7c083ed80f8e2cc7cb3e2c1 (diff)
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@collabora.co.uk>
Diffstat (limited to 'sot')
-rw-r--r--sot/source/sdstor/stgdir.cxx12
-rw-r--r--sot/source/sdstor/stgelem.cxx3
-rw-r--r--sot/source/sdstor/stgelem.hxx2
-rw-r--r--sot/source/sdstor/ucbstorage.cxx8
4 files changed, 8 insertions, 17 deletions
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 )