diff options
Diffstat (limited to 'package/source/zipapi/ZipFile.cxx')
-rw-r--r-- | package/source/zipapi/ZipFile.cxx | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx index af90d6b1ef1a..7de1da7f2963 100644 --- a/package/source/zipapi/ZipFile.cxx +++ b/package/source/zipapi/ZipFile.cxx @@ -524,7 +524,7 @@ bool ZipFile::hasValidPassword ( ZipEntry const & rEntry, const ::rtl::Reference namespace { -class XBufferedStream : public cppu::WeakImplHelper<css::io::XInputStream> +class XBufferedStream : public cppu::WeakImplHelper<css::io::XInputStream, css::io::XSeekable> { std::vector<sal_Int8> maBytes; size_t mnPos; @@ -613,6 +613,21 @@ public: virtual void SAL_CALL closeInput() override { } + // XSeekable + virtual void SAL_CALL seek( sal_Int64 location ) override + { + if ( location > sal_Int64(maBytes.size()) || location < 0 ) + throw IllegalArgumentException(THROW_WHERE, uno::Reference< uno::XInterface >(), 1 ); + mnPos = location; + } + virtual sal_Int64 SAL_CALL getPosition() override + { + return mnPos; + } + virtual sal_Int64 SAL_CALL getLength() override + { + return maBytes.size(); + } }; } |