summaryrefslogtreecommitdiff
path: root/scripting/source/stringresource/stringresource.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2024-09-30 19:16:38 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-10-01 11:15:37 +0200
commit21e2158fa11757e43ccd904bba48553b8caba2ca (patch)
tree669142deae2940232b900f47ecf37f41c0309010 /scripting/source/stringresource/stringresource.cxx
parent5c7b565fa842b1d48e5b7f102e9594985fd17df5 (diff)
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>
Diffstat (limited to 'scripting/source/stringresource/stringresource.cxx')
-rw-r--r--scripting/source/stringresource/stringresource.cxx35
1 files changed, 16 insertions, 19 deletions
diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx
index a081601b42b2..f144fd3bcb32 100644
--- a/scripting/source/stringresource/stringresource.cxx
+++ b/scripting/source/stringresource/stringresource.cxx
@@ -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;