summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2014-11-24 14:36:20 +0100
committerMatúš Kukan <matus.kukan@collabora.com>2014-11-24 23:14:54 +0100
commit79c1b05591a66fb3c7cec60bc3ad91382095a936 (patch)
tree71b68994da5075bef95cc21ce60f03a7f209bfb3
parent09186fceb0ca5ab67cc81ed601fd0e25d49a03ad (diff)
Remove not used SvLockBytesInputStream
Change-Id: Id4e0852f6d204b3a1d2a7f5ce281730f5fcad8fd
-rw-r--r--include/svl/strmadpt.hxx61
-rw-r--r--svl/source/misc/strmadpt.cxx179
2 files changed, 3 insertions, 237 deletions
diff --git a/include/svl/strmadpt.hxx b/include/svl/strmadpt.hxx
index 9d1645bda956..3d9acaf2fbd5 100644
--- a/include/svl/strmadpt.hxx
+++ b/include/svl/strmadpt.hxx
@@ -21,10 +21,7 @@
#define INCLUDED_SVL_STRMADPT_HXX
#include <svl/svldllapi.h>
-#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
-#include <com/sun/star/io/XSeekable.hpp>
-#include <cppuhelper/weak.hxx>
#include <tools/stream.hxx>
@@ -64,64 +61,6 @@ public:
virtual void Terminate() SAL_OVERRIDE;
};
-
-class SVL_DLLPUBLIC SvLockBytesInputStream: public cppu::OWeakObject,
- public com::sun::star::io::XInputStream,
- public com::sun::star::io::XSeekable
-{
- SvLockBytesRef m_xLockBytes;
- sal_Int64 m_nPosition;
-
-public:
- SvLockBytesInputStream(SvLockBytes * pTheLockBytes):
- m_xLockBytes(pTheLockBytes), m_nPosition(0) {}
-
- virtual com::sun::star::uno::Any SAL_CALL
- queryInterface(const com::sun::star::uno::Type & rType)
- throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-
- virtual void SAL_CALL acquire() throw() SAL_OVERRIDE;
-
- virtual void SAL_CALL release() throw() SAL_OVERRIDE;
-
- virtual sal_Int32 SAL_CALL
- readBytes(com::sun::star::uno::Sequence< sal_Int8 > & rData,
- sal_Int32 nBytesToRead)
- throw (com::sun::star::io::IOException,
- com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-
- virtual sal_Int32 SAL_CALL
- readSomeBytes(com::sun::star::uno::Sequence< sal_Int8 > & rData,
- sal_Int32 nMaxBytesToRead)
- throw (com::sun::star::io::IOException,
- com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-
- virtual void SAL_CALL skipBytes(sal_Int32 nBytesToSkip)
- throw (com::sun::star::io::IOException,
- com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-
- virtual sal_Int32 SAL_CALL available()
- throw (com::sun::star::io::IOException,
- com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-
- virtual void SAL_CALL closeInput()
- throw (com::sun::star::io::IOException,
- com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-
- virtual void SAL_CALL seek(sal_Int64 nLocation)
- throw (com::sun::star::lang::IllegalArgumentException,
- com::sun::star::io::IOException,
- com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-
- virtual sal_Int64 SAL_CALL getPosition()
- throw (com::sun::star::io::IOException,
- com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-
- virtual sal_Int64 SAL_CALL getLength()
- throw (com::sun::star::io::IOException,
- com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-};
-
#endif // INCLUDED_SVL_STRMADPT_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/source/misc/strmadpt.cxx b/svl/source/misc/strmadpt.cxx
index 43923f1a2797..a651eaaed8bc 100644
--- a/svl/source/misc/strmadpt.cxx
+++ b/svl/source/misc/strmadpt.cxx
@@ -25,6 +25,9 @@
#include <set>
#include <string.h>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/io/XSeekable.hpp>
+
#include <osl/diagnose.h>
#include <rtl/alloc.h>
#include <cppuhelper/queryinterface.hxx>
@@ -235,182 +238,6 @@ void SvOutputStreamOpenLockBytes::Terminate()
}
-// SvLockBytesInputStream
-
-
-// virtual
-uno::Any SAL_CALL SvLockBytesInputStream::queryInterface(uno::Type const &
- rType)
- throw (uno::RuntimeException, std::exception)
-{
- uno::Any
- aReturn(cppu::queryInterface(rType,
- static_cast< io::XInputStream * >(this),
- static_cast< io::XSeekable * >(this)));
- return aReturn.hasValue() ? aReturn : OWeakObject::queryInterface(rType);
-}
-
-// virtual
-void SAL_CALL SvLockBytesInputStream::acquire() throw ()
-{
- OWeakObject::acquire();
-}
-
-// virtual
-void SAL_CALL SvLockBytesInputStream::release() throw ()
-{
- OWeakObject::release();
-}
-
-// virtual
-sal_Int32 SAL_CALL
-SvLockBytesInputStream::readBytes(uno::Sequence< sal_Int8 > & rData,
- sal_Int32 nBytesToRead)
- throw (io::IOException, uno::RuntimeException, std::exception)
-{
- OSL_ASSERT(m_nPosition >= 0);
- if (!m_xLockBytes.Is())
- throw io::NotConnectedException();
- if (
- nBytesToRead < 0 ||
- (
- static_cast<sal_uInt64>(m_nPosition) > SAL_MAX_SIZE &&
- nBytesToRead > 0
- )
- )
- {
- throw io::IOException();
- }
- rData.realloc(nBytesToRead);
- sal_Int32 nSize = 0;
- while (nSize < nBytesToRead)
- {
- sal_Size nCount;
- ErrCode nError = m_xLockBytes->ReadAt(m_nPosition,
- rData.getArray() + nSize,
- nBytesToRead - nSize, &nCount);
- if (nError != ERRCODE_NONE && nError != ERRCODE_IO_PENDING)
- throw io::IOException();
- m_nPosition += nCount;
- nSize += nCount;
- if (nError == ERRCODE_NONE && nCount == 0)
- break;
- }
- rData.realloc(nSize);
- return nSize;
-}
-
-// virtual
-sal_Int32 SAL_CALL
-SvLockBytesInputStream::readSomeBytes(uno::Sequence< sal_Int8 > & rData,
- sal_Int32 nMaxBytesToRead)
- throw (io::IOException, uno::RuntimeException, std::exception)
-{
- OSL_ASSERT(m_nPosition >= 0);
- if (!m_xLockBytes.Is())
- throw io::NotConnectedException();
- if (static_cast<sal_uInt64>(m_nPosition) > SAL_MAX_SIZE
- && nMaxBytesToRead > 0)
- throw io::IOException();
- rData.realloc(nMaxBytesToRead);
- sal_Size nCount = 0;
- if (nMaxBytesToRead > 0)
- {
- ErrCode nError;
- do
- {
- nError = m_xLockBytes->ReadAt(m_nPosition,
- rData.getArray(),
- nMaxBytesToRead,
- &nCount);
- if (nError != ERRCODE_NONE && nError != ERRCODE_IO_PENDING)
- throw io::IOException();
- m_nPosition += nCount;
- }
- while (nCount == 0 && nError == ERRCODE_IO_PENDING);
- }
- rData.realloc(sal_Int32(nCount));
- return sal_Int32(nCount);
-}
-
-// virtual
-void SAL_CALL SvLockBytesInputStream::skipBytes(sal_Int32 nBytesToSkip)
- throw (io::IOException, uno::RuntimeException, std::exception)
-{
- if (!m_xLockBytes.Is())
- throw io::NotConnectedException();
- if (nBytesToSkip < 0)
- throw io::IOException();
- if (nBytesToSkip > SAL_MAX_INT64 - m_nPosition)
- throw io::BufferSizeExceededException();
- m_nPosition += nBytesToSkip;
-}
-
-// virtual
-sal_Int32 SAL_CALL SvLockBytesInputStream::available()
- throw (io::IOException, uno::RuntimeException, std::exception)
-{
- OSL_ASSERT(m_nPosition >= 0);
- if (!m_xLockBytes.Is())
- throw io::NotConnectedException();
- SvLockBytesStat aStat;
- if (m_xLockBytes->Stat(&aStat, SVSTATFLAG_DEFAULT) != ERRCODE_NONE)
- throw io::IOException();
- return aStat.nSize <= static_cast<sal_uInt64>(m_nPosition) ?
- 0 :
- static_cast<sal_Size>(aStat.nSize - m_nPosition) <=
- static_cast<sal_uInt32>(SAL_MAX_INT32) ?
- static_cast<sal_Int32>(aStat.nSize - m_nPosition) :
- SAL_MAX_INT32;
-}
-
-// virtual
-void SAL_CALL SvLockBytesInputStream::closeInput()
- throw (io::IOException, uno::RuntimeException, std::exception)
-{
- if (!m_xLockBytes.Is())
- throw io::NotConnectedException();
- m_xLockBytes = 0;
-}
-
-// virtual
-void SAL_CALL SvLockBytesInputStream::seek(sal_Int64 nLocation)
- throw (lang::IllegalArgumentException, io::IOException,
- uno::RuntimeException, std::exception)
-{
- if (nLocation < 0)
- throw lang::IllegalArgumentException();
- if (!m_xLockBytes.Is())
- throw io::NotConnectedException();
- m_nPosition = nLocation;
-}
-
-// virtual
-sal_Int64 SAL_CALL SvLockBytesInputStream::getPosition()
- throw (io::IOException, uno::RuntimeException, std::exception)
-{
- if (!m_xLockBytes.Is())
- throw io::NotConnectedException();
- return m_nPosition;
-}
-
-// virtual
-sal_Int64 SAL_CALL SvLockBytesInputStream::getLength()
- throw (io::IOException, uno::RuntimeException, std::exception)
-{
- if (!m_xLockBytes.Is())
- throw io::NotConnectedException();
- SvLockBytesStat aStat;
- if (m_xLockBytes->Stat(&aStat, SVSTATFLAG_DEFAULT) != ERRCODE_NONE)
- throw io::IOException();
-#if SAL_TYPES_SIZEOFPOINTER > 4 // avoid warnings if sal_Size < sal_Int64
- if (aStat.nSize > static_cast<sal_uInt64>(SAL_MAX_INT64))
- throw io::IOException();
-#endif
- return aStat.nSize;
-}
-
-
// SvInputStream