Kaydet (Commit) 4a624e6e authored tarafından Luke Symes's avatar Luke Symes Kaydeden (comit) David Tardon

remove dead code from dbase driver

üst 5639017c
......@@ -49,7 +49,6 @@ sdbcx::ObjectType ODbaseColumns::createObject(const ::rtl::OUString& _rName)
ODbaseTable* pTable = (ODbaseTable*)m_pTable;
// Reference< XFastPropertySet> xCol(pTable->getColumns()[_rName],UNO_QUERY);
::vos::ORef<OSQLColumns> aCols = pTable->getTableColumns();
OSQLColumns::Vector::const_iterator aIter = find(aCols->get().begin(),aCols->get().end(),_rName,::comphelper::UStringMixEqual(isCaseSensitive()));
......
......@@ -324,7 +324,6 @@ Reference< XResultSet > SAL_CALL ODbaseDatabaseMetaData::getIndexInfo(
Reference< XPropertySet> xColumn;
for(sal_Int32 j=1;pColBegin != pColEnd;++pColBegin,++j)
{
// xColumns->getByName(*pColBegin) >>= xColumn;
aRow[8] = new ORowSetValueDecorator(j);
aRow[9] = new ORowSetValueDecorator(*pColBegin);
aRows.push_back(aRow);
......
......@@ -81,7 +81,7 @@ ODbaseIndex::ODbaseIndex(ODbaseTable* _pTable) : OIndex(sal_True/*_pTable->getCo
ODbaseIndex::ODbaseIndex( ODbaseTable* _pTable,
const NDXHeader& _rHeader,
const ::rtl::OUString& _rName)
:OIndex(_rName,::rtl::OUString(),_rHeader.db_unique,sal_False,sal_False,sal_True) // _pTable->getConnection()->getMetaData()->storesMixedCaseQuotedIdentifiers()
:OIndex(_rName,::rtl::OUString(),_rHeader.db_unique,sal_False,sal_False,sal_True)
,m_pFileStream(NULL)
,m_aHeader(_rHeader)
,m_nCurNode(NODE_NOTFOUND)
......@@ -363,13 +363,6 @@ SvStream& connectivity::dbase::operator >> (SvStream &rStream, ODbaseIndex& rInd
rStream.Seek(0);
rStream.Read(&rIndex.m_aHeader,PAGE_SIZE);
/* OJ: no longer needed
// Text convertierung
ByteString aText(rIndex.m_aHeader.db_name);
// aText.Convert(rIndex.m_pTable->getConnection()->GetCharacterSet(), m_pTable->getConnection()->getTextEncoding());
// aText.Convert(rIndex.m_pTable->getConnection()->GetCharacterSet(), m_pTable->getConnection()->getTextEncoding());
strcpy(rIndex.m_aHeader.db_name,aText.GetBuffer());
*/
rIndex.m_nRootPage = rIndex.m_aHeader.db_rootpage;
rIndex.m_nPageCount = rIndex.m_aHeader.db_pagecount;
return rStream;
......@@ -378,11 +371,6 @@ SvStream& connectivity::dbase::operator >> (SvStream &rStream, ODbaseIndex& rInd
SvStream& connectivity::dbase::operator << (SvStream &rStream, ODbaseIndex& rIndex)
{
rStream.Seek(0);
/* OJ: no longer needed
ByteString aText(rIndex.m_aHeader.db_name);
// aText.Convert(m_pTable->getConnection()->getTextEncoding(), rIndex.m_pTable->getConnection()->GetCharacterSet());
strcpy(rIndex.m_aHeader.db_name,aText.GetBuffer());
*/
OSL_VERIFY_EQUALS( rStream.Write(&rIndex.m_aHeader,PAGE_SIZE), PAGE_SIZE, "Write not successful: Wrong header size for dbase index!");
return rStream;
}
......@@ -508,16 +496,6 @@ BOOL ODbaseIndex::CreateImpl()
// ist die Spalte schon indiziert ?
if ( !xCol.is() )
::dbtools::throwFunctionSequenceException(*this);
// else if (pColumn && pColumn->IsIndexed())
// {
// String aText = String(OResId(STR_STAT_INDEX_COLUMN_ALREADY_INDEXED));
// aText.SearchAndReplace(String::CreateFromAscii("#"),pColumn->GetName());
// aStatus.Set(SDB_STAT_ERROR,
// String::CreateFromAscii("01000"),
// aStatus.CreateErrorMessage(aText),
// 0, String() );
// return FALSE;
// }
// create the index file
m_pFileStream = OFileTable::createStream_simpleError(sFile,STREAM_READWRITE | STREAM_SHARE_DENYWRITE | STREAM_TRUNC);
......@@ -559,14 +537,6 @@ BOOL ODbaseIndex::CreateImpl()
aStatement += aName;
aStatement += aQuote;
// if (!m_IsUnique) // zusaetzlich sortierung mit der bookmarkspalte
// {
// aStatement.AppendAscii(" ,");
// aStatement += aQuote;
// aStatement.AppendAscii("[BOOKMARK]"); // this is a special column
// aStatement += aQuote;
// }
xSet.set( xStmt->executeQuery(aStatement),UNO_SET_THROW );
}
catch(const Exception& )
......@@ -608,13 +578,11 @@ BOOL ODbaseIndex::CreateImpl()
m_nRootPage = 1;
m_nPageCount = 2;
// ODatabaseType eType = m_aHeader.db_keytype == 0 ? DataType::VARCHAR : DataType::DOUBLE;
m_aCurLeaf = m_aRoot = CreatePage(m_nRootPage);
m_aRoot->SetModified(TRUE);
m_bUseCollector = TRUE;
// ULONG nRowsLeft = pCursor->RowCount();
sal_Int32 nRowsLeft = 0;
Reference<XRow> xRow(xSet,UNO_QUERY);
......@@ -635,7 +603,6 @@ BOOL ODbaseIndex::CreateImpl()
// Erzeugen der Indexstruktur
while (xSet->next())
{
// ODbRow& rRow = *pCursor->GetRow();
ORowSetValue aValue(m_aHeader.db_keytype ? ORowSetValue(xRow->getDouble(1)) : ORowSetValue(xRow->getString(1)));
// ueberpruefen auf doppelten eintrag
if (m_IsUnique && m_nCurNode != NODE_NOTFOUND)
......
......@@ -42,7 +42,6 @@ using namespace ::com::sun::star::sdb;
//------------------------------------------------------------------
OIndexIterator::~OIndexIterator()
{
// m_pIndex->UnLock();
m_pIndex->release();
}
......@@ -60,11 +59,7 @@ ULONG OIndexIterator::Next()
//------------------------------------------------------------------
ULONG OIndexIterator::Find(BOOL bFirst)
{
// ONDXIndex* m_pIndex = GetNDXIndex();
ULONG nRes = STRING_NOTFOUND;
// if (!m_pIndex->IsOpen())
// return nRes;
if (bFirst)
{
......@@ -150,7 +145,6 @@ ONDXKey* OIndexIterator::GetFirstKey(ONDXPage* pPage, const OOperand& rKey)
ULONG OIndexIterator::GetCompare(BOOL bFirst)
{
ONDXKey* pKey = NULL;
// ONDXIndex* m_pIndex = GetNDXIndex();
sal_Int32 ePredicateType = PTR_CAST(file::OOp_COMPARE,m_pOperator)->getPredicateType();
if (bFirst)
......@@ -220,7 +214,6 @@ ULONG OIndexIterator::GetCompare(BOOL bFirst)
//------------------------------------------------------------------
ULONG OIndexIterator::GetLike(BOOL bFirst)
{
// ONDXIndex* m_pIndex = GetNDXIndex();
if (bFirst)
{
ONDXPage* pPage = m_aRoot;
......@@ -241,7 +234,6 @@ ULONG OIndexIterator::GetLike(BOOL bFirst)
//------------------------------------------------------------------
ULONG OIndexIterator::GetNull(BOOL bFirst)
{
// ONDXIndex* m_pIndex = GetNDXIndex();
if (bFirst)
{
ONDXPage* pPage = m_aRoot;
......@@ -265,7 +257,6 @@ ULONG OIndexIterator::GetNull(BOOL bFirst)
ULONG OIndexIterator::GetNotNull(BOOL bFirst)
{
ONDXKey* pKey;
// ONDXIndex* m_pIndex = GetNDXIndex();
if (bFirst)
{
// erst alle NULL werte abklappern
......@@ -284,7 +275,6 @@ ULONG OIndexIterator::GetNotNull(BOOL bFirst)
//------------------------------------------------------------------
ONDXKey* OIndexIterator::GetNextKey()
{
// ONDXIndex* m_pIndex = GetNDXIndex();
if (m_aCurLeaf.Is() && ((++m_nCurNode) >= m_aCurLeaf->Count()))
{
ONDXPage* pPage = m_aCurLeaf;
......
......@@ -52,9 +52,6 @@ namespace starutil = ::com::sun::star::util;
sdbcx::ObjectType ODbaseIndexes::createObject(const ::rtl::OUString& _rName)
{
// Dir* pDir = m_pTable->getConnection()->getDir();
// String aPath = pDir->GetName();
// aPath += _rName.getStr();
::rtl::OUString sFile = m_pTable->getConnection()->getURL();
sFile += OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DELIMITER);
sFile += _rName;
......
......@@ -120,7 +120,6 @@ Error:
case IResultSetHelper::BOOKMARK:
m_nFilePos = nTempPos; // vorherige Position
}
// aStatus.Set(SDB_STAT_NO_DATA_FOUND);
return sal_False;
End:
......@@ -132,7 +131,6 @@ BOOL ODbaseTable::ReadMemo(ULONG nBlockNo, ORowSetValue& aVariable)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::ReadMemo" );
BOOL bIsText = TRUE;
// SdbConnection* pConnection = GetConnection();
m_pMemoStream->Seek(nBlockNo * m_aMemoHeader.db_size);
switch (m_aMemoHeader.db_typ)
......@@ -173,13 +171,6 @@ BOOL ODbaseTable::ReadMemo(ULONG nBlockNo, ORowSetValue& aVariable)
{
if (((BYTE)sHeader[0]) != 0 || ((BYTE)sHeader[1]) != 0 || ((BYTE)sHeader[2]) != 0)
{
// String aText = String(SdbResId(STR_STAT_IResultSetHelper::INVALID));
// aText.SearchAndReplace(String::CreateFromAscii("%%d"),m_pMemoStream->GetFileName());
// aText.SearchAndReplace(String::CreateFromAscii("%%t"),aStatus.TypeToString(MEMO));
// aStatus.Set(SDB_STAT_ERROR,
// String::CreateFromAscii("01000"),
// aStatus.CreateErrorMessage(aText),
// 0, String() );
return sal_False;
}
......@@ -187,13 +178,6 @@ BOOL ODbaseTable::ReadMemo(ULONG nBlockNo, ORowSetValue& aVariable)
}
else if (((BYTE)sHeader[0]) != 0xFF || ((BYTE)sHeader[1]) != 0xFF || ((BYTE)sHeader[2]) != 0x08)
{
// String aText = String(SdbResId(STR_STAT_IResultSetHelper::INVALID));
// aText.SearchAndReplace(String::CreateFromAscii("%%d"),m_pMemoStream->GetFileName());
// aText.SearchAndReplace(String::CreateFromAscii("%%t"),aStatus.TypeToString(MEMO));
// aStatus.Set(SDB_STAT_ERROR,
// String::CreateFromAscii("01000"),
// aStatus.CreateErrorMessage(aText),
// 0, String() );
return sal_False;
}
......@@ -203,7 +187,6 @@ BOOL ODbaseTable::ReadMemo(ULONG nBlockNo, ORowSetValue& aVariable)
if (m_aMemoHeader.db_typ == MemodBaseIV)
nLength -= 8;
// char cChar;
::rtl::OUString aStr;
while ( nLength > STRING_MAXLEN )
{
......@@ -218,7 +201,6 @@ BOOL ODbaseTable::ReadMemo(ULONG nBlockNo, ORowSetValue& aVariable)
ByteString aBStr;
aBStr.Expand(static_cast<xub_StrLen>(nLength));
m_pMemoStream->Read(aBStr.AllocBuffer(static_cast<xub_StrLen>(nLength)),nLength);
// aBStr.ReleaseBufferAccess();
aStr += ::rtl::OUString(aBStr.GetBuffer(),aBStr.Len(), getConnection()->getTextEncoding());
......@@ -294,7 +276,6 @@ void ONDXNode::Read(SvStream &rStream, ODbaseIndex& rIndex)
aBuf.ReleaseBufferAccess();
aBuf.EraseTrailingChars();
// aKey = ONDXKey((aBuf,rIndex.GetDBFConnection()->GetCharacterSet()) ,aKey.nRecord);
aKey = ONDXKey(::rtl::OUString(aBuf.GetBuffer(),aBuf.Len(),rIndex.m_pTable->getConnection()->getTextEncoding()) ,aKey.nRecord);
}
rStream >> aChild;
......@@ -365,7 +346,6 @@ BOOL ONDXKey::IsText(sal_Int32 eType)
StringCompare ONDXKey::Compare(const ONDXKey& rKey) const
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ONDXKey::Compare" );
// DBG_ASSERT(is(), "Falscher Indexzugriff");
StringCompare eResult;
if (getValue().isNull())
......@@ -469,7 +449,6 @@ SvStream& connectivity::dbase::operator >> (SvStream &rStream, ONDXPage& rPage)
rStream >> nValue >> rPage.aChild;
rPage.nCount = USHORT(nValue);
// DBG_ASSERT(rPage.nCount && rPage.nCount < rPage.GetIndex().GetMaxNodes(), "Falscher Count");
for (USHORT i = 0; i < rPage.nCount; i++)
rPage[i].Read(rStream, rPage.GetIndex());
return rStream;
......@@ -639,14 +618,4 @@ void ONDXPage::Remove(USHORT nPos)
}
// -----------------------------------------------------------------------------
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -49,8 +49,6 @@ using namespace com::sun::star::lang;
using namespace com::sun::star::beans;
using namespace com::sun::star::sdbc;
using namespace com::sun::star::sdbcx;
// using namespace com::sun::star::container;
// using namespace com::sun::star::util;
//------------------------------------------------------------------------------
ODbaseResultSet::ODbaseResultSet( OStatement_Base* pStmt,connectivity::OSQLParseTreeIterator& _aSQLIterator)
: file::OResultSet(pStmt,_aSQLIterator)
......@@ -198,8 +196,6 @@ sal_Bool ODbaseResultSet::fillIndexValues(const Reference< XColumnsSupplier> &_x
nRec = pIter->Next();
}
m_pFileSet->setFrozen();
// if(!bDistinct)
// SetRowCount(pFileSet->count());
delete pIter;
return sal_True;
}
......
......@@ -191,7 +191,7 @@ void lcl_CalDate(sal_Int32 _nJulianDate,sal_Int32 _nJulianTime,com::sun::star::u
double d_m = d_s / 60;
double d_h = d_m / 60;
_rDateTime.Hours = (sal_uInt16) (d_h);
_rDateTime.Minutes = (sal_uInt16) d_m; // integer _aDateTime.Minutes
_rDateTime.Minutes = (sal_uInt16) d_m;
_rDateTime.Seconds = static_cast<sal_uInt16>(( d_m - (double) _rDateTime.Minutes ) * 60.0);
}
}
......@@ -331,8 +331,6 @@ void ODbaseTable::fillColumns()
break;
sal_Bool bIsRowVersion = bFoxPro && ( aDBFColumn.db_frei2[0] & 0x01 ) == 0x01;
//if ( bFoxPro && ( aDBFColumn.db_frei2[0] & 0x01 ) == 0x01 ) // system column not visible to user
// continue;
const String aColumnName((const char *)aDBFColumn.db_fnm,m_eEncoding);
m_aRealFieldLengths.push_back(aDBFColumn.db_flng);
......@@ -528,7 +526,6 @@ void ODbaseTable::construct()
if (m_pMemoStream)
ReadMemoHeader();
}
// if(!m_pColumns && (!m_aColumns.isValid() || !m_aColumns->size()))
fillColumns();
UINT32 nFileSize = lcl_getFileSize(*m_pFileStream);
......@@ -704,7 +701,7 @@ void ODbaseTable::refreshIndexes()
aVector.push_back(aURL.getBase());
}
}
catch(Exception&) // a execption is thrown when no file exists
catch(Exception&) // an exception is thrown when no file exists
{
}
}
......@@ -737,7 +734,6 @@ Sequence< Type > SAL_CALL ODbaseTable::getTypes( ) throw(RuntimeException)
for(;pBegin != pEnd;++pBegin)
{
if(!(*pBegin == ::getCppuType((const Reference<XKeysSupplier>*)0) ||
// *pBegin == ::getCppuType((const Reference<XAlterTable>*)0) ||
*pBegin == ::getCppuType((const Reference<XDataDescriptorFactory>*)0)))
{
aOwnTypes.push_back(*pBegin);
......@@ -796,7 +792,6 @@ sal_Bool ODbaseTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols, s
// only read the bookmark
// Satz als geloescht markieren
// rRow.setState(bIsCurRecordDeleted ? ROW_DELETED : ROW_CLEAN );
_rRow->setDeleted(bIsCurRecordDeleted);
*(_rRow->get())[0] = m_nFilePos;
......@@ -860,8 +855,6 @@ sal_Bool ODbaseTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols, s
char *pData = (char *) (m_pBuffer + nByteOffset);
// (*_rRow)[i].setType(nType);
if (nType == DataType::CHAR || nType == DataType::VARCHAR)
{
sal_Int32 nLastPos = -1;
......@@ -973,7 +966,6 @@ sal_Bool ODbaseTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols, s
break;
case DataType::DECIMAL:
*(_rRow->get())[i] = ORowSetValue(aStr);
// pVal->setDouble(SdbTools::ToDouble(aStr));
break;
case DataType::BIT:
{
......@@ -986,7 +978,6 @@ sal_Bool ODbaseTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols, s
default: b = FALSE; break;
}
*(_rRow->get())[i] = b;
// pVal->setDouble(b);
}
break;
case DataType::LONGVARBINARY:
......@@ -1069,13 +1060,12 @@ BOOL ODbaseTable::CreateImpl()
if (pFileStream && pFileStream->Seek(STREAM_SEEK_TO_END))
{
// aStatus.SetError(ERRCODE_IO_ALREADYEXISTS,TABLE,aFile.GetFull());
return sal_False;
}
delete pFileStream;
}
}
catch(Exception&) // a execption is thrown when no file exists
catch(Exception&) // an exception is thrown when no file exists
{
}
......@@ -1092,7 +1082,7 @@ BOOL ODbaseTable::CreateImpl()
Content aContent(aURL.GetMainURL(INetURLObject::NO_DECODE),Reference<XCommandEnvironment>());
aContent.executeCommand( rtl::OUString::createFromAscii( "delete" ),bool2any( sal_True ) );
}
catch(Exception&) // a execption is thrown when no file exists
catch(Exception&) // an exception is thrown when no file exists
{
}
return sal_False;
......@@ -1109,12 +1099,11 @@ BOOL ODbaseTable::CreateImpl()
{
bMemoAlreadyExists = aMemo1Content.isDocument();
}
catch(Exception&) // a execption is thrown when no file exists
catch(Exception&) // an exception is thrown when no file exists
{
}
if (bMemoAlreadyExists)
{
// aStatus.SetError(ERRCODE_IO_ALREADYEXISTS,MEMO,aFile.GetFull());
aURL.setExtension(aExt); // kill dbf file
try
{
......@@ -1479,7 +1468,6 @@ BOOL ODbaseTable::Drop_Static(const ::rtl::OUString& _sUrl,sal_Bool _bHasMemoFie
{
}
}
// aFile.SetBase(m_Name);
aURL.setExtension(String::CreateFromAscii("inf"));
// as the inf file does not necessarily exist, we aren't allowed to use UCBContentHelper::Kill
......@@ -1745,7 +1733,6 @@ BOOL ODbaseTable::UpdateBuffer(OValueRefVector& rRow, OValueRefRow pOrgRow,const
continue;
else
{
// ODbVariantRef xVar = (pVal == NULL) ? new ODbVariant() : pVal;
Reference<XUnoTunnel> xTunnel(xIndex,UNO_QUERY);
OSL_ENSURE(xTunnel.is(),"No TunnelImplementation!");
ODbaseIndex* pIndex = reinterpret_cast< ODbaseIndex* >( xTunnel->getSomething(ODbaseIndex::getUnoTunnelImplementationId()) );
......@@ -1855,7 +1842,7 @@ BOOL ODbaseTable::UpdateBuffer(OValueRefVector& rRow, OValueRefRow pOrgRow,const
ODbaseIndex* pIndex = reinterpret_cast< ODbaseIndex* >( xTunnel->getSomething(ODbaseIndex::getUnoTunnelImplementationId()) );
OSL_ENSURE(pIndex,"ODbaseTable::UpdateBuffer: No Index returned!");
// Update !!
if (pOrgRow.isValid() && !rRow.get()[nPos]->getValue().isNull() )//&& pVal->isModified())
if (pOrgRow.isValid() && !rRow.get()[nPos]->getValue().isNull() )
pIndex->Update(m_nFilePos,*(pOrgRow->get())[nPos],*rRow.get()[nPos]);
else
pIndex->Insert(m_nFilePos,*rRow.get()[nPos]);
......@@ -2689,7 +2676,6 @@ Error:
case IResultSetHelper::BOOKMARK:
m_nFilePos = nTempPos; // vorherige Position
}
// aStatus.Set(SDB_STAT_NO_DATA_FOUND);
return sal_False;
End:
......@@ -2701,7 +2687,6 @@ BOOL ODbaseTable::ReadMemo(ULONG nBlockNo, ORowSetValue& aVariable)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::ReadMemo" );
BOOL bIsText = TRUE;
// SdbConnection* pConnection = GetConnection();
m_pMemoStream->Seek(nBlockNo * m_aMemoHeader.db_size);
switch (m_aMemoHeader.db_typ)
......@@ -2740,29 +2725,10 @@ BOOL ODbaseTable::ReadMemo(ULONG nBlockNo, ORowSetValue& aVariable)
// Foxpro stores text and binary data
if (m_aMemoHeader.db_typ == MemoFoxPro)
{
// if (((BYTE)sHeader[0]) != 0 || ((BYTE)sHeader[1]) != 0 || ((BYTE)sHeader[2]) != 0)
// {
//// String aText = String(SdbResId(STR_STAT_IResultSetHelper::INVALID));
//// aText.SearchAndReplace(String::CreateFromAscii("%%d"),m_pMemoStream->GetFileName());
//// aText.SearchAndReplace(String::CreateFromAscii("%%t"),aStatus.TypeToString(MEMO));
//// aStatus.Set(SDB_STAT_ERROR,
//// String::CreateFromAscii("01000"),
//// aStatus.CreateErrorMessage(aText),
//// 0, String() );
// return sal_False;
// }
//
bIsText = sHeader[3] != 0;
}
else if (((BYTE)sHeader[0]) != 0xFF || ((BYTE)sHeader[1]) != 0xFF || ((BYTE)sHeader[2]) != 0x08)
{
// String aText = String(SdbResId(STR_STAT_IResultSetHelper::INVALID));
// aText.SearchAndReplace(String::CreateFromAscii("%%d"),m_pMemoStream->GetFileName());
// aText.SearchAndReplace(String::CreateFromAscii("%%t"),aStatus.TypeToString(MEMO));
// aStatus.Set(SDB_STAT_ERROR,
// String::CreateFromAscii("01000"),
// aStatus.CreateErrorMessage(aText),
// 0, String() );
return sal_False;
}
......@@ -2776,7 +2742,6 @@ BOOL ODbaseTable::ReadMemo(ULONG nBlockNo, ORowSetValue& aVariable)
{
if ( bIsText )
{
// char cChar;
::rtl::OUStringBuffer aStr;
while ( nLength > STRING_MAXLEN )
{
......@@ -2791,7 +2756,6 @@ BOOL ODbaseTable::ReadMemo(ULONG nBlockNo, ORowSetValue& aVariable)
ByteString aBStr;
aBStr.Expand(static_cast<xub_StrLen>(nLength));
m_pMemoStream->Read(aBStr.AllocBuffer(static_cast<xub_StrLen>(nLength)),nLength);
// aBStr.ReleaseBufferAccess();
aStr.append(::rtl::OUString(aBStr.GetBuffer(),aBStr.Len(), m_eEncoding));
}
if ( aStr.getLength() )
......
......@@ -94,8 +94,6 @@ ONDXPage::ONDXPage(ODbaseIndex& rInd, sal_uInt32 nPos, ONDXPage* pParent)
ONDXPage::~ONDXPage()
{
delete[] ppNodes;
// delete aParent;
// delete aChild;
}
//------------------------------------------------------------------
void ONDXPage::QueryDelete()
......@@ -257,7 +255,6 @@ BOOL ONDXPage::Insert(ONDXNode& rNode, sal_uInt32 nRowsLeft)
else
{
aInnerNode = (*this)[nCount - 1];
//aInnerNode = aSplitNode;
// Knoten zeigt auf neue Seite
aInnerNode.SetChild(aNewPage);
......@@ -423,35 +420,6 @@ BOOL ONDXPage::Delete(USHORT nNodePos)
}
if (HasParent() && !(*aParent)[nParentNodePos].HasChild())
aParent->Delete(nParentNodePos);
/*
// letzte Element auf Vaterseite
// -> zusammenlegen mit vorletzter Seite
if (nParentNodePos == (aParent->Count() - 1))
{
if (!nParentNodePos)
// zusammenlegen mit linken nachbarn
Merge(nParentNodePos,aParent->GetChild(&rIndex));
else
Merge(nParentNodePos,(*aParent)[nParentNodePos-1].GetChild(&rIndex,aParent));
}
// sonst Seite mit naechster Seite zusammenlegen
else if(nParentNodePos != NODE_NOTFOUND)
{
// zusammenlegen mit rechten nachbarn
Merge(nParentNodePos + 1,((*aParent)[nParentNodePos + 1].GetChild(&rIndex,aParent)));
nParentNodePos++;
}
else // Sonderbehandlung
{
// Page ist aChild Page vom Parent => erste Page aus ppNodes an aChild anhaengen
Merge(0,(*aParent)[0].GetChild(&rIndex,aParent));
nParentNodePos = 0;
}
if (HasParent() && !(*aParent)[nParentNodePos].HasChild())
aParent->Delete(nParentNodePos);
*/
}
else if (IsRoot())
// Sicherstellen das die Position der Wurzel festgehalten wird
......@@ -724,7 +692,6 @@ void ONDXNode::Read(SvStream &rStream, ODbaseIndex& rIndex)
aBuf.ReleaseBufferAccess();
aBuf.EraseTrailingChars();
// aKey = ONDXKey((aBuf,rIndex.GetDBFConnection()->GetCharacterSet()) ,aKey.nRecord);
aKey = ONDXKey(::rtl::OUString(aBuf.GetBuffer(),aBuf.Len(),rIndex.m_pTable->getConnection()->getTextEncoding()) ,aKey.nRecord);
}
rStream >> aChild;
......@@ -791,7 +758,6 @@ BOOL ONDXKey::IsText(sal_Int32 eType)
//------------------------------------------------------------------
StringCompare ONDXKey::Compare(const ONDXKey& rKey) const
{
// DBG_ASSERT(is(), "Falscher Indexzugriff");
StringCompare eResult;
if (getValue().isNull())
......@@ -891,7 +857,6 @@ SvStream& connectivity::dbase::operator >> (SvStream &rStream, ONDXPage& rPage)
rStream >> nValue >> rPage.aChild;
rPage.nCount = USHORT(nValue);
// DBG_ASSERT(rPage.nCount && rPage.nCount < rPage.GetIndex().GetMaxNodes(), "Falscher Count");
for (USHORT i = 0; i < rPage.nCount; i++)
rPage[i].Read(rStream, rPage.GetIndex());
return rStream;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment