diff options
author | Ocke Janssen <oj@openoffice.org> | 2001-10-23 11:35:12 +0000 |
---|---|---|
committer | Ocke Janssen <oj@openoffice.org> | 2001-10-23 11:35:12 +0000 |
commit | 1175442442d2f4285b36e6d14bf57adfaac3911d (patch) | |
tree | ad58ce62551fd569ecfa22372a3d5fcab0ffde58 /comphelper/source/streaming | |
parent | 0ee4be8ee553242d9e24642f9f22eec74fb16a53 (diff) |
#93566# new method which return the available bytes before end
Diffstat (limited to 'comphelper/source/streaming')
-rw-r--r-- | comphelper/source/streaming/streamsection.cxx | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/comphelper/source/streaming/streamsection.cxx b/comphelper/source/streaming/streamsection.cxx index 5c79762bcddb..46f19f9c7f28 100644 --- a/comphelper/source/streaming/streamsection.cxx +++ b/comphelper/source/streaming/streamsection.cxx @@ -2,9 +2,9 @@ * * $RCSfile: streamsection.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: jl $ $Date: 2001-03-22 13:33:25 $ + * last change: $Author: oj $ $Date: 2001-10-23 12:35:12 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -134,10 +134,25 @@ OStreamSection::~OStreamSection() } } } - catch(...) + catch(const staruno::Exception&) { } } +// ----------------------------------------------------------------------------- +sal_Int32 OStreamSection::available() +{ + sal_Int32 nBytes = 0; + try + { // don't allow any exceptions to leave this block, this may be called during the stack unwinding of an exception + if (m_xInStream.is() && m_xMarkStream.is()) + nBytes = m_xMarkStream->offsetToMark(m_nBlockStart) - sizeof(m_nBlockLen); + } + catch(const staruno::Exception&) + { + } + return nBytes; +} +// ----------------------------------------------------------------------------- } // namespace comphelper |