Date: prev next · Thread: first prev next last
2010 Archives by date, by thread · List index


This patch removes dead code and fixes a few comments in the code for the
dbase driver in the libs-core repository.
From 8aac153aff470310b23abb63fcb78847fb9d8aad Mon Sep 17 00:00:00 2001
From: Luke Symes <allsymes@gmail.com>
Date: Sun, 17 Oct 2010 18:44:04 +1300
Subject: [PATCH] Remove dead code from dbase driver.

---
 connectivity/source/drivers/dbase/DColumns.cxx     |    1 -
 .../source/drivers/dbase/DDatabaseMetaData.cxx     |    1 -
 connectivity/source/drivers/dbase/DIndex.cxx       |   35 +----------
 connectivity/source/drivers/dbase/DIndexIter.cxx   |   10 ---
 connectivity/source/drivers/dbase/DIndexes.cxx     |    3 -
 connectivity/source/drivers/dbase/DNoException.cxx |   31 ---------
 connectivity/source/drivers/dbase/DResultSet.cxx   |    4 -
 connectivity/source/drivers/dbase/DTable.cxx       |   68 ++------------------
 connectivity/source/drivers/dbase/dindexnode.cxx   |   35 ----------
 9 files changed, 7 insertions(+), 181 deletions(-)

diff --git a/connectivity/source/drivers/dbase/DColumns.cxx 
b/connectivity/source/drivers/dbase/DColumns.cxx
index cbbc020..eef1788 100644
--- a/connectivity/source/drivers/dbase/DColumns.cxx
+++ b/connectivity/source/drivers/dbase/DColumns.cxx
@@ -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()));
 
diff --git a/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx 
b/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
index 5f52a31..85288e8 100644
--- a/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
@@ -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);
diff --git a/connectivity/source/drivers/dbase/DIndex.cxx 
b/connectivity/source/drivers/dbase/DIndex.cxx
index 735a489..f45244d 100644
--- a/connectivity/source/drivers/dbase/DIndex.cxx
+++ b/connectivity/source/drivers/dbase/DIndex.cxx
@@ -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)
diff --git a/connectivity/source/drivers/dbase/DIndexIter.cxx 
b/connectivity/source/drivers/dbase/DIndexIter.cxx
index 570bc87..965196f 100644
--- a/connectivity/source/drivers/dbase/DIndexIter.cxx
+++ b/connectivity/source/drivers/dbase/DIndexIter.cxx
@@ -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;
diff --git a/connectivity/source/drivers/dbase/DIndexes.cxx 
b/connectivity/source/drivers/dbase/DIndexes.cxx
index 0a60cdb..cd2090d 100644
--- a/connectivity/source/drivers/dbase/DIndexes.cxx
+++ b/connectivity/source/drivers/dbase/DIndexes.cxx
@@ -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;
diff --git a/connectivity/source/drivers/dbase/DNoException.cxx 
b/connectivity/source/drivers/dbase/DNoException.cxx
index d9c1124..55c06f2 100644
--- a/connectivity/source/drivers/dbase/DNoException.cxx
+++ b/connectivity/source/drivers/dbase/DNoException.cxx
@@ -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: */
diff --git a/connectivity/source/drivers/dbase/DResultSet.cxx 
b/connectivity/source/drivers/dbase/DResultSet.cxx
index 186c6ef..6b93961 100644
--- a/connectivity/source/drivers/dbase/DResultSet.cxx
+++ b/connectivity/source/drivers/dbase/DResultSet.cxx
@@ -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;
             }
diff --git a/connectivity/source/drivers/dbase/DTable.cxx 
b/connectivity/source/drivers/dbase/DTable.cxx
index 75c9922..ef18b55 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -191,27 +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
-        //// weird: time fix
-     //   int test = (_rDateTime.Hours % 3) * 100 + _rDateTime.Minutes;
-        //int test_tbl[] = {0, 1, 2, 11, 12, 13, 22, 23, 24, 25, 34, 35, 36,
-        //     45, 46, 47, 56, 57, 58, 107, 108, 109, 110, 119, 120, 121,
-        //     130, 131, 132, 141, 142, 143, 152, 153, 154, 155, 204, 205,
-        //     206, 215, 216, 217, 226, 227, 228, 237, 238, 239, 240, 249,
-        //     250, 251};
-     //   for (int i = 0; i < sizeof(test_tbl)/sizeof(test_tbl[0]); i++)
-        //{
-        //    if (test == test_tbl[i])
-        //    {
-        //     // frac += 0.000012;
-        //         //d_hour = frac * 24.0;
-        //         _rDateTime.Hours = (sal_uInt16)d_hour;
-        //         d_minute = (d_hour - (double)_rDateTime.Hours) * 60.0;
-        //         _rDateTime.Minutes = (sal_uInt16)d_minute;
-        //         break;
-        //    }
-     //   }
-
+        _rDateTime.Minutes = (sal_uInt16) d_m;
         _rDateTime.Seconds = static_cast<sal_uInt16>(( d_m - (double) _rDateTime.Minutes ) * 60.0);
     }
 }
@@ -351,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);
@@ -548,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);
@@ -724,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
                 {
                 }
             }
@@ -757,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);
@@ -816,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;
 
@@ -880,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;
@@ -993,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:
                 {
@@ -1006,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:
@@ -1089,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
     {
     }
 
@@ -1112,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;
@@ -1129,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
             {
@@ -1499,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
@@ -1765,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()) );
@@ -1875,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]);
@@ -2709,7 +2676,6 @@ Error:
         case IResultSetHelper::BOOKMARK:
             m_nFilePos = nTempPos;      // vorherige Position
     }
-    // aStatus.Set(SDB_STAT_NO_DATA_FOUND);
     return sal_False;
 
 End:
@@ -2721,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)
@@ -2760,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;
             }
 
@@ -2796,7 +2742,6 @@ BOOL ODbaseTable::ReadMemo(ULONG nBlockNo, ORowSetValue& aVariable)
             {
                 if ( bIsText )
                 {
-                    // char cChar;
                     ::rtl::OUStringBuffer aStr;
                     while ( nLength > STRING_MAXLEN )
                     {
@@ -2811,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() )
diff --git a/connectivity/source/drivers/dbase/dindexnode.cxx 
b/connectivity/source/drivers/dbase/dindexnode.cxx
index 271db31..f769980 100644
--- a/connectivity/source/drivers/dbase/dindexnode.cxx
+++ b/connectivity/source/drivers/dbase/dindexnode.cxx
@@ -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;
-- 
1.7.0.4


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.