summaryrefslogtreecommitdiff
path: root/xmlhelp
diff options
context:
space:
mode:
Diffstat (limited to 'xmlhelp')
-rw-r--r--xmlhelp/source/cxxhelp/provider/inputstream.cxx8
-rw-r--r--xmlhelp/source/cxxhelp/provider/urlparameter.cxx2
2 files changed, 8 insertions, 2 deletions
diff --git a/xmlhelp/source/cxxhelp/provider/inputstream.cxx b/xmlhelp/source/cxxhelp/provider/inputstream.cxx
index 19e88810799e..e5f18bb5fcc9 100644
--- a/xmlhelp/source/cxxhelp/provider/inputstream.cxx
+++ b/xmlhelp/source/cxxhelp/provider/inputstream.cxx
@@ -116,7 +116,13 @@ XInputStream_impl::skipBytes(
sal_Int32 SAL_CALL
XInputStream_impl::available()
{
- return 0;
+ sal_uInt64 uPos;
+ if( osl::FileBase::E_None != m_aFile.getPos( uPos ) )
+ throw io::IOException();
+ sal_uInt64 uSize;
+ if( osl::FileBase::E_None != m_aFile.getSize( uSize ) )
+ throw io::IOException();
+ return std::min<sal_uInt64>(SAL_MAX_INT32, uSize - uPos);
}
diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
index fb0aa90cb62b..8ed8f80a1c69 100644
--- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
+++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
@@ -924,7 +924,7 @@ void SAL_CALL InputStreamTransformer::skipBytes( sal_Int32 nBytesToSkip )
sal_Int32 SAL_CALL InputStreamTransformer::available()
{
osl::MutexGuard aGuard( m_aMutex );
- return std::max<sal_Int32>(buffer.getLength() - pos, 0);
+ return std::min<sal_Int64>(SAL_MAX_INT32, buffer.getLength() - pos);
}