summaryrefslogtreecommitdiff
path: root/package/source/zipapi/ByteGrabber.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-09-21 15:42:49 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-09-22 08:30:10 +0200
commitb63609ba5478ed9b020c113f5704f7ea8447dec8 (patch)
treee40896646675d8b462cec7a90ca1e94e902b3746 /package/source/zipapi/ByteGrabber.cxx
parent4af6c0948be47d7816eb1b6f2137b70aba639f0d (diff)
loplugin:flatten in framework..package
Change-Id: Ide8a97eae6e2fdc7d2dcccba1480ac55a9b555bc Reviewed-on: https://gerrit.libreoffice.org/42593 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'package/source/zipapi/ByteGrabber.cxx')
-rw-r--r--package/source/zipapi/ByteGrabber.cxx30
1 files changed, 14 insertions, 16 deletions
diff --git a/package/source/zipapi/ByteGrabber.cxx b/package/source/zipapi/ByteGrabber.cxx
index 0818f1ecd09e..89e22c368851 100644
--- a/package/source/zipapi/ByteGrabber.cxx
+++ b/package/source/zipapi/ByteGrabber.cxx
@@ -64,35 +64,33 @@ sal_Int32 SAL_CALL ByteGrabber::readBytes( uno::Sequence< sal_Int8 >& aData,
void SAL_CALL ByteGrabber::seek( sal_Int64 location )
{
::osl::MutexGuard aGuard( m_aMutex );
- if (xSeek.is() )
- {
- sal_Int64 nLen = xSeek->getLength();
- if ( location < 0 || location > nLen )
- throw lang::IllegalArgumentException(THROW_WHERE, uno::Reference< uno::XInterface >(), 1 );
- if (location > nLen )
- location = nLen;
- xSeek->seek( location );
- }
- else
+ if (!xSeek.is() )
throw io::IOException(THROW_WHERE );
+
+ sal_Int64 nLen = xSeek->getLength();
+ if ( location < 0 || location > nLen )
+ throw lang::IllegalArgumentException(THROW_WHERE, uno::Reference< uno::XInterface >(), 1 );
+ if (location > nLen )
+ location = nLen;
+ xSeek->seek( location );
}
sal_Int64 SAL_CALL ByteGrabber::getPosition( )
{
::osl::MutexGuard aGuard( m_aMutex );
- if (xSeek.is() )
- return xSeek->getPosition();
- else
+ if (!xSeek.is() )
throw io::IOException(THROW_WHERE );
+
+ return xSeek->getPosition();
}
sal_Int64 SAL_CALL ByteGrabber::getLength( )
{
::osl::MutexGuard aGuard( m_aMutex );
- if (xSeek.is() )
- return xSeek->getLength();
- else
+ if (!xSeek.is() )
throw io::IOException(THROW_WHERE );
+
+ return xSeek->getLength();
}
sal_uInt16 ByteGrabber::ReadUInt16()