#89786# createStream_simpleError instead of UcbStreamHelper::CreateStream

This commit is contained in:
Frank Schönheit 2001-07-17 11:37:19 +00:00
parent a2a4c0d990
commit d08d21996e
4 changed files with 27 additions and 35 deletions

View file

@ -2,9 +2,9 @@
*
* $RCSfile: DIndex.cxx,v $
*
* $Revision: 1.29 $
* $Revision: 1.30 $
*
* last change: $Author: oj $ $Date: 2001-07-16 09:58:39 $
* last change: $Author: fs $ $Date: 2001-07-17 12:36:18 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -110,9 +110,6 @@
#ifndef _UNOTOOLS_UCBHELPER_HXX
#include <unotools/ucbhelper.hxx>
#endif
#ifndef _UNTOOLS_UCBSTREAMHELPER_HXX
#include <unotools/ucbstreamhelper.hxx>
#endif
#ifndef _COMPHELPER_TYPES_HXX_
#include <comphelper/types.hxx>
#endif
@ -233,9 +230,9 @@ sal_Bool ODbaseIndex::openIndexFile()
::rtl::OUString sFile = getCompletePath();
if(UCBContentHelper::Exists(sFile))
{
m_pFileStream = UcbStreamHelper::CreateStream(sFile,STREAM_READWRITE | STREAM_NOCREATE | STREAM_SHARE_DENYWRITE);
if(!m_pFileStream)
m_pFileStream = UcbStreamHelper::CreateStream(sFile,STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYNONE );
m_pFileStream = OFileTable::createStream_simpleError(sFile, STREAM_READWRITE | STREAM_NOCREATE | STREAM_SHARE_DENYWRITE);
if (!m_pFileStream)
m_pFileStream = OFileTable::createStream_simpleError(sFile,STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYNONE);
if(m_pFileStream)
{
m_pFileStream->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN);
@ -595,7 +592,7 @@ BOOL ODbaseIndex::CreateImpl()
// }
// create the index file
m_pFileStream = UcbStreamHelper::CreateStream(sFile,STREAM_READWRITE | STREAM_SHARE_DENYWRITE | STREAM_TRUNC);
m_pFileStream = OFileTable::createStream_simpleError(sFile,STREAM_READWRITE | STREAM_SHARE_DENYWRITE | STREAM_TRUNC);
if (!m_pFileStream)
throw SQLException(::rtl::OUString::createFromAscii("Could not access index file!"),*this,OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ERRORMSG_SEQUENCE),1000,Any());

View file

@ -2,9 +2,9 @@
*
* $RCSfile: DIndexes.cxx,v $
*
* $Revision: 1.8 $
* $Revision: 1.9 $
*
* last change: $Author: oj $ $Date: 2001-05-18 08:48:08 $
* last change: $Author: fs $ $Date: 2001-07-17 12:36:18 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -64,15 +64,15 @@
#ifndef _CONNECTIVITY_DBASE_INDEX_HXX_
#include "dbase/DIndex.hxx"
#endif
#ifndef _UNTOOLS_UCBSTREAMHELPER_HXX
#include <unotools/ucbstreamhelper.hxx>
#endif
#ifndef _UNOTOOLS_UCBHELPER_HXX
#include <unotools/ucbhelper.hxx>
#endif
#ifndef _COMPHELPER_TYPES_HXX_
#include <comphelper/types.hxx>
#endif
#ifndef _CONNECTIVITY_FILE_TABLE_HXX_
#include "FTable.hxx"
#endif
using namespace ::comphelper;
@ -100,7 +100,7 @@ Reference< XNamed > ODbaseIndexes::createObject(const ::rtl::OUString& _rName)
throw SQLException(::rtl::OUString::createFromAscii("Index file doesn't exists!"),*m_pTable,OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_HY0000),1000,Any());
Reference< XNamed > xRet;
SvStream* pFileStream = UcbStreamHelper::CreateStream(sFile,STREAM_READ | STREAM_NOCREATE| STREAM_SHARE_DENYWRITE);
SvStream* pFileStream = ::connectivity::file::OFileTable::createStream_simpleError(sFile,STREAM_READ | STREAM_NOCREATE| STREAM_SHARE_DENYWRITE);
if(pFileStream)
{
pFileStream->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN);

View file

@ -2,9 +2,9 @@
*
* $RCSfile: DTable.cxx,v $
*
* $Revision: 1.54 $
* $Revision: 1.55 $
*
* last change: $Author: fs $ $Date: 2001-07-16 15:13:25 $
* last change: $Author: fs $ $Date: 2001-07-17 12:36:18 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -114,9 +114,6 @@
#ifndef _COMPHELPER_EXTRACT_HXX_
#include <comphelper/extract.hxx>
#endif
#ifndef _UNTOOLS_UCBSTREAMHELPER_HXX
#include <unotools/ucbstreamhelper.hxx>
#endif
#ifndef _DBHELPER_DBEXCEPTION_HXX_
#include <connectivity/dbexception.hxx>
#endif
@ -332,6 +329,7 @@ ODbaseTable::ODbaseTable(ODbaseConnection* _pConnection,
,m_bWriteableMemo(sal_False)
{
}
// -----------------------------------------------------------------------------
void ODbaseTable::construct()
{
@ -350,10 +348,10 @@ void ODbaseTable::construct()
"ODbaseTable::ODbaseTable: invalid extension!");
// getEntry is expected to ensure the corect file name
m_pFileStream = ::utl::UcbStreamHelper::CreateStream( sFileName,STREAM_READWRITE | STREAM_NOCREATE | STREAM_SHARE_DENYWRITE);
m_pFileStream = createStream_simpleError( sFileName, STREAM_READWRITE | STREAM_NOCREATE | STREAM_SHARE_DENYWRITE);
if (!(m_bWriteable = (NULL != m_pFileStream)))
m_pFileStream = ::utl::UcbStreamHelper::CreateStream( sFileName,STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYNONE );
m_pFileStream = createStream_simpleError( sFileName, STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYNONE);
if(m_pFileStream)
{
@ -371,9 +369,9 @@ void ODbaseTable::construct()
// Wenn die Memodatei nicht gefunden wird, werden die Daten trotzdem angezeigt
// allerdings koennen keine Updates durchgefuehrt werden
// jedoch die Operation wird ausgefuehrt
m_pMemoStream = ::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL(INetURLObject::NO_DECODE), STREAM_READWRITE | STREAM_NOCREATE | STREAM_SHARE_DENYWRITE);
m_pMemoStream = createStream_simpleError( aURL.GetMainURL(INetURLObject::NO_DECODE), STREAM_READWRITE | STREAM_NOCREATE | STREAM_SHARE_DENYWRITE);
if (!(m_bWriteableMemo = (NULL != m_pMemoStream)))
m_pMemoStream = ::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL(INetURLObject::NO_DECODE), STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYNONE );
m_pMemoStream = createStream_simpleError( aURL.GetMainURL(INetURLObject::NO_DECODE), STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYNONE);
if (m_pMemoStream)
ReadMemoHeader();
}
@ -821,7 +819,7 @@ BOOL ODbaseTable::CreateImpl()
if (aContent.isDocument())
{
// Hack fuer Bug #30609 , nur wenn das File existiert und die Laenge > 0 gibt es einen Fehler
SvStream* pFileStream = ::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL(INetURLObject::NO_DECODE),STREAM_READ);
SvStream* pFileStream = createStream_simpleError( aURL.GetMainURL(INetURLObject::NO_DECODE),STREAM_READ);
if (pFileStream && pFileStream->Seek(STREAM_SEEK_TO_END))
{
@ -907,7 +905,7 @@ BOOL ODbaseTable::CreateFile(const INetURLObject& aFile, BOOL& bCreateMemo)
bCreateMemo = sal_False;
Date aDate; // aktuelles Datum
m_pFileStream = ::utl::UcbStreamHelper::CreateStream( aFile.GetMainURL(INetURLObject::NO_DECODE),STREAM_READWRITE | STREAM_SHARE_DENYWRITE | STREAM_TRUNC);
m_pFileStream = createStream_simpleError( aFile.GetMainURL(INetURLObject::NO_DECODE),STREAM_READWRITE | STREAM_SHARE_DENYWRITE | STREAM_TRUNC );
if (!m_pFileStream)
return sal_False;
@ -1084,7 +1082,7 @@ BOOL ODbaseTable::CreateFile(const INetURLObject& aFile, BOOL& bCreateMemo)
BOOL ODbaseTable::CreateMemoFile(const INetURLObject& aFile)
{
// Makro zum Filehandling fürs Erzeugen von Tabellen
m_pMemoStream = ::utl::UcbStreamHelper::CreateStream( aFile.GetMainURL(INetURLObject::NO_DECODE),STREAM_READWRITE | STREAM_SHARE_DENYWRITE);
m_pMemoStream = createStream_simpleError( aFile.GetMainURL(INetURLObject::NO_DECODE),STREAM_READWRITE | STREAM_SHARE_DENYWRITE);
if (!m_pMemoStream)
return sal_False;
@ -1910,7 +1908,7 @@ void ODbaseTable::copyData(ODbaseTable* _pNewTable,sal_Int32 _nPos)
// we only have to bind the values which we need to copy into the new table
for(OValueVector::iterator aIter = aRow->begin(); aIter != aRow->end();++aIter)
aIter->setBound(sal_True);
if(nPos && nPos < aRow->size())
if(nPos && (nPos < (sal_Int32)aRow->size()))
(*aRow)[nPos].setBound(sal_False);

View file

@ -2,9 +2,9 @@
*
* $RCSfile: ETable.cxx,v $
*
* $Revision: 1.31 $
* $Revision: 1.32 $
*
* last change: $Author: oj $ $Date: 2001-07-16 09:58:40 $
* last change: $Author: fs $ $Date: 2001-07-17 12:37:19 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -125,9 +125,6 @@
#ifndef _ISOLANG_HXX
#include <tools/isolang.hxx>
#endif
#ifndef _UNTOOLS_UCBSTREAMHELPER_HXX
#include <unotools/ucbstreamhelper.hxx>
#endif
#ifndef _DBHELPER_DBCONVERSION_HXX_
#include "connectivity/dbconversion.hxx"
#endif
@ -393,10 +390,10 @@ OFlatTable::OFlatTable(OFlatConnection* _pConnection,
String aFileName = aURL.GetMainURL(INetURLObject::NO_DECODE);
m_pFileStream = ::utl::UcbStreamHelper::CreateStream( aFileName,STREAM_READWRITE | STREAM_NOCREATE | STREAM_SHARE_DENYWRITE);
m_pFileStream = createStream_simpleError( aFileName,STREAM_READWRITE | STREAM_NOCREATE | STREAM_SHARE_DENYWRITE);
if(!m_pFileStream)
m_pFileStream = ::utl::UcbStreamHelper::CreateStream( aFileName,STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYNONE );
m_pFileStream = createStream_simpleError( aFileName,STREAM_READ | STREAM_NOCREATE | STREAM_SHARE_DENYNONE);
if(m_pFileStream)
{