remove unnecessary null checks

Change-Id: I73805881eef49fc6886f7f4fbc212da3aac1fd6f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174290
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2024-09-30 19:16:38 +02:00 committed by Noel Grandin
parent 5c7b565fa8
commit 21e2158fa1

View file

@ -930,7 +930,7 @@ void StringResourcePersistenceImpl::storeToURL( const OUString& URL,
std::unique_lock aGuard( m_aMutex );
Reference< ucb::XSimpleFileAccess3 > xFileAccess = ucb::SimpleFileAccess::create(m_xContext);
if( xFileAccess.is() && Handler.is() )
if( Handler.is() )
xFileAccess->setInteractionHandler( Handler );
implStoreAtLocation( URL, NameBase, Comment, xFileAccess, false/*bUsedForStore*/, true/*bStoreAll*/ );
@ -2531,7 +2531,7 @@ void StringResourceWithLocationImpl::setURL( const OUString& URL )
void StringResourceWithLocationImpl::implScanLocales()
{
const Reference< ucb::XSimpleFileAccess3 > xFileAccess = getFileAccessImpl();
if( xFileAccess.is() && xFileAccess->isFolder( m_aLocation ) )
if( xFileAccess->isFolder( m_aLocation ) )
{
Sequence< OUString > aContentSeq = xFileAccess->getFolderContents( m_aLocation, false );
implScanLocaleNames( aContentSeq );
@ -2544,23 +2544,20 @@ bool StringResourceWithLocationImpl::implLoadLocale( LocaleItem* pLocaleItem )
bool bSuccess = false;
const Reference< ucb::XSimpleFileAccess3 > xFileAccess = getFileAccessImpl();
if( xFileAccess.is() )
{
OUString aCompleteFileName =
implGetPathForLocaleItem( pLocaleItem, m_aNameBase, m_aLocation );
OUString aCompleteFileName =
implGetPathForLocaleItem( pLocaleItem, m_aNameBase, m_aLocation );
Reference< io::XInputStream > xInputStream;
try
{
xInputStream = xFileAccess->openFileRead( aCompleteFileName );
}
catch( Exception& )
{}
if( xInputStream.is() )
{
bSuccess = StringResourcePersistenceImpl::implReadPropertiesFile( pLocaleItem, xInputStream );
xInputStream->closeInput();
}
Reference< io::XInputStream > xInputStream;
try
{
xInputStream = xFileAccess->openFileRead( aCompleteFileName );
}
catch( Exception& )
{}
if( xInputStream.is() )
{
bSuccess = StringResourcePersistenceImpl::implReadPropertiesFile( pLocaleItem, xInputStream );
xInputStream->closeInput();
}
return bSuccess;
@ -2572,7 +2569,7 @@ const Reference< ucb::XSimpleFileAccess3 > & StringResourceWithLocationImpl::get
{
m_xSFI = ucb::SimpleFileAccess::create(m_xContext);
if( m_xSFI.is() && m_xInteractionHandler.is() )
if( m_xInteractionHandler.is() )
m_xSFI->setInteractionHandler( m_xInteractionHandler );
}
return m_xSFI;