INTEGRATION: CWS sb88 (1.9.10); FILE MERGED
2008/06/03 15:29:51 sb 1.9.10.1: #i89553 applied patch by cmc
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
* OpenOffice.org - a multi-platform office productivity suite
|
* OpenOffice.org - a multi-platform office productivity suite
|
||||||
*
|
*
|
||||||
* $RCSfile: oslstream.cxx,v $
|
* $RCSfile: oslstream.cxx,v $
|
||||||
* $Revision: 1.9 $
|
* $Revision: 1.10 $
|
||||||
*
|
*
|
||||||
* This file is part of OpenOffice.org.
|
* This file is part of OpenOffice.org.
|
||||||
*
|
*
|
||||||
@@ -209,102 +209,6 @@ void SAL_CALL OSLOutputStreamWrapper::closeOutput() throw( stario::NotConnectedE
|
|||||||
rFile.close();
|
rFile.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
|
||||||
// -----------------------------------------------------------------------------
|
|
||||||
// ----------------------------- Buffered OSLStream -----------------------------
|
|
||||||
// -----------------------------------------------------------------------------
|
|
||||||
// -----------------------------------------------------------------------------
|
|
||||||
//------------------------------------------------------------------
|
|
||||||
/*
|
|
||||||
BufferedFileInputStream::BufferedFileInputStream( File& _rFile )
|
|
||||||
:m_pFile(&_rFile)
|
|
||||||
,m_bFileOwner(sal_False)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
//------------------------------------------------------------------
|
|
||||||
BufferedFileInputStream::BufferedFileInputStream( rtl::OUString const & aFileURL)
|
|
||||||
: m_aFile( aFileURL )
|
|
||||||
{
|
|
||||||
osl::File::RC rc = m_aFile.open(osl_File_OpenFlag_Read);
|
|
||||||
if (rc != File::E_None)
|
|
||||||
raiseIOException(rc,NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
//------------------------------------------------------------------
|
|
||||||
BufferedFileInputStream::~BufferedFileInputStream()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
sal_Int32 SAL_CALL BufferedFileInputStream::readBytes(staruno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead)
|
|
||||||
throw( stario::NotConnectedException, stario::BufferSizeExceededException,
|
|
||||||
stario::IOException, staruno::RuntimeException )
|
|
||||||
{
|
|
||||||
if (nBytesToRead < 0)
|
|
||||||
raiseIOException(osl::File::E_INVAL, *this);
|
|
||||||
|
|
||||||
aData.realloc(nBytesToRead);
|
|
||||||
|
|
||||||
sal_uInt64 nSize = sal_uInt64(nBytesToRead);
|
|
||||||
sal_uInt64 nRead = 0;
|
|
||||||
|
|
||||||
File::RC rc = m_aFile.read(aData.getArray(), nSize, nRead);
|
|
||||||
if (rc != File::E_None)
|
|
||||||
raiseIOException(rc,*this);
|
|
||||||
|
|
||||||
OSL_ASSERT(nRead <= nSize);
|
|
||||||
return sal_Int32(nRead);
|
|
||||||
}
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
sal_Int32 SAL_CALL BufferedFileInputStream::readSomeBytes(staruno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead)
|
|
||||||
throw( stario::NotConnectedException, stario::BufferSizeExceededException,
|
|
||||||
stario::IOException, staruno::RuntimeException )
|
|
||||||
{
|
|
||||||
return readBytes(aData, nMaxBytesToRead);
|
|
||||||
}
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
void SAL_CALL BufferedFileInputStream::skipBytes(sal_Int32 nBytesToSkip)
|
|
||||||
throw( stario::NotConnectedException, stario::BufferSizeExceededException,
|
|
||||||
stario::IOException, staruno::RuntimeException )
|
|
||||||
{
|
|
||||||
if (nBytesToSkip < 0)
|
|
||||||
raiseIOException(osl::File::E_INVAL, *this);
|
|
||||||
|
|
||||||
sal_uInt64 nOffset = sal_uInt64(nBytesToSkip);
|
|
||||||
|
|
||||||
File::RC rc = m_aFile.setPos(osl_Pos_Current, nOffset);
|
|
||||||
if (rc != File::E_None)
|
|
||||||
raiseIOException(rc,*this);
|
|
||||||
}
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
sal_Int32 SAL_CALL BufferedFileInputStream::available()
|
|
||||||
throw( stario::NotConnectedException, stario::IOException, staruno::RuntimeException )
|
|
||||||
{
|
|
||||||
sal_uInt64 avail = 0;
|
|
||||||
File::RC rc = m_aFile.available(avail);
|
|
||||||
if (rc != File::E_None)
|
|
||||||
raiseIOException(rc,*this);
|
|
||||||
|
|
||||||
sal_Int32 result = sal_Int32(avail);
|
|
||||||
if (result < 0 || sal_uInt64(result) < avail)
|
|
||||||
result = SAL_MAX_INT32;
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
void SAL_CALL BufferedFileInputStream::closeInput()
|
|
||||||
throw( stario::NotConnectedException, stario::IOException, staruno::RuntimeException )
|
|
||||||
{
|
|
||||||
File::RC rc = m_aFile.close();
|
|
||||||
if (rc != File::E_None)
|
|
||||||
raiseIOException(rc,*this);
|
|
||||||
}
|
|
||||||
|
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
BufferedFileOutputStream::BufferedFileOutputStream( rtl::OUString const & aFileURL, bool bCreate, sal_uInt32 nBufferSizeHint)
|
BufferedFileOutputStream::BufferedFileOutputStream( rtl::OUString const & aFileURL, bool bCreate, sal_uInt32 nBufferSizeHint)
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
* OpenOffice.org - a multi-platform office productivity suite
|
* OpenOffice.org - a multi-platform office productivity suite
|
||||||
*
|
*
|
||||||
* $RCSfile: requestoptions.cxx,v $
|
* $RCSfile: requestoptions.cxx,v $
|
||||||
* $Revision: 1.9 $
|
* $Revision: 1.10 $
|
||||||
*
|
*
|
||||||
* This file is part of OpenOffice.org.
|
* This file is part of OpenOffice.org.
|
||||||
*
|
*
|
||||||
@@ -38,33 +38,6 @@
|
|||||||
|
|
||||||
namespace configmgr
|
namespace configmgr
|
||||||
{
|
{
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#if 0 // not used any more
|
|
||||||
static sal_Int32 getNextCacheID()
|
|
||||||
{
|
|
||||||
static oslInterlockedCount nNextID = 0;
|
|
||||||
|
|
||||||
oslInterlockedCount nNewID = osl_incrementInterlockedCount(&nNextID);
|
|
||||||
|
|
||||||
if (nNewID == 0)
|
|
||||||
{
|
|
||||||
CFG_TRACE_WARNING("Cache ID overflow - restarting sequence !");
|
|
||||||
OSL_ENSURE(false, "Cache ID overflow - restarting sequence !");
|
|
||||||
}
|
|
||||||
|
|
||||||
return static_cast<sal_Int32>(nNewID);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
RequestOptions RequestOptions::forAllLocales()
|
|
||||||
{
|
|
||||||
RequestOptions aResult;
|
|
||||||
aResult.setAllLocales();
|
|
||||||
return aResult;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
RequestOptions::LocaleString RequestOptions::getIsoLocale() const
|
RequestOptions::LocaleString RequestOptions::getIsoLocale() const
|
||||||
@@ -105,12 +78,6 @@ namespace configmgr
|
|||||||
}
|
}
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
sal_Int32 RequestOptions::hashCode() const
|
|
||||||
{
|
|
||||||
return hashRequestLocale(m_sLocale) ^ m_sEntity.hashCode();
|
|
||||||
}
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
static inline
|
static inline
|
||||||
sal_Int32 compareRequestLocale(RequestOptions::Locale const& lhs, RequestOptions::Locale const& rhs)
|
sal_Int32 compareRequestLocale(RequestOptions::Locale const& lhs, RequestOptions::Locale const& rhs)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user