summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/dbase/DIndex.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'connectivity/source/drivers/dbase/DIndex.cxx')
-rw-r--r--connectivity/source/drivers/dbase/DIndex.cxx64
1 files changed, 32 insertions, 32 deletions
diff --git a/connectivity/source/drivers/dbase/DIndex.cxx b/connectivity/source/drivers/dbase/DIndex.cxx
index e4d3eafc9071..cd11204b3570 100644
--- a/connectivity/source/drivers/dbase/DIndex.cxx
+++ b/connectivity/source/drivers/dbase/DIndex.cxx
@@ -143,7 +143,7 @@ ONDXPagePtr ODbaseIndex::getRoot()
{
m_nRootPage = m_aHeader.db_rootpage;
m_nPageCount = m_aHeader.db_pagecount;
- m_aRoot = CreatePage(m_nRootPage,NULL,TRUE);
+ m_aRoot = CreatePage(m_nRootPage,NULL,sal_True);
}
return m_aRoot;
}
@@ -185,7 +185,7 @@ OIndexIterator* ODbaseIndex::createIterator(OBoolOperator* pOp,
return new OIndexIterator(this, pOp, pOperand);
}
//------------------------------------------------------------------
-BOOL ODbaseIndex::ConvertToKey(ONDXKey* rKey, sal_uInt32 nRec, const ORowSetValue& rValue)
+sal_Bool ODbaseIndex::ConvertToKey(ONDXKey* rKey, sal_uInt32 nRec, const ORowSetValue& rValue)
{
OSL_ENSURE(m_pFileStream,"FileStream is not opened!");
// Sucht ein bestimmten Wert im Index
@@ -207,13 +207,13 @@ BOOL ODbaseIndex::ConvertToKey(ONDXKey* rKey, sal_uInt32 nRec, const ORowSetValu
catch (Exception&)
{
OSL_ASSERT(0);
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
//------------------------------------------------------------------
-BOOL ODbaseIndex::Find(sal_uInt32 nRec, const ORowSetValue& rValue)
+sal_Bool ODbaseIndex::Find(sal_uInt32 nRec, const ORowSetValue& rValue)
{
openIndexFile();
OSL_ENSURE(m_pFileStream,"FileStream is not opened!");
@@ -224,7 +224,7 @@ BOOL ODbaseIndex::Find(sal_uInt32 nRec, const ORowSetValue& rValue)
}
//------------------------------------------------------------------
-BOOL ODbaseIndex::Insert(sal_uInt32 nRec, const ORowSetValue& rValue)
+sal_Bool ODbaseIndex::Insert(sal_uInt32 nRec, const ORowSetValue& rValue)
{
openIndexFile();
OSL_ENSURE(m_pFileStream,"FileStream is not opened!");
@@ -233,35 +233,35 @@ BOOL ODbaseIndex::Insert(sal_uInt32 nRec, const ORowSetValue& rValue)
// Existiert der Wert bereits
// Find immer verwenden um das aktuelle Blatt zu bestimmen
if (!ConvertToKey(&aKey, nRec, rValue) || (getRoot()->Find(aKey) && isUnique()))
- return FALSE;
+ return sal_False;
ONDXNode aNewNode(aKey);
// einfuegen in das aktuelle Blatt
if (!m_aCurLeaf.Is())
- return FALSE;
+ return sal_False;
- BOOL bResult = m_aCurLeaf->Insert(aNewNode);
+ sal_Bool bResult = m_aCurLeaf->Insert(aNewNode);
Release(bResult);
return bResult;
}
//------------------------------------------------------------------
-BOOL ODbaseIndex::Update(sal_uInt32 nRec, const ORowSetValue& rOldValue,
+sal_Bool ODbaseIndex::Update(sal_uInt32 nRec, const ORowSetValue& rOldValue,
const ORowSetValue& rNewValue)
{
openIndexFile();
OSL_ENSURE(m_pFileStream,"FileStream is not opened!");
ONDXKey aKey;
if (!ConvertToKey(&aKey, nRec, rNewValue) || (isUnique() && getRoot()->Find(aKey)))
- return FALSE;
+ return sal_False;
else
return Delete(nRec, rOldValue) && Insert(nRec,rNewValue);
}
//------------------------------------------------------------------
-BOOL ODbaseIndex::Delete(sal_uInt32 nRec, const ORowSetValue& rValue)
+sal_Bool ODbaseIndex::Delete(sal_uInt32 nRec, const ORowSetValue& rValue)
{
openIndexFile();
OSL_ENSURE(m_pFileStream,"FileStream is not opened!");
@@ -269,13 +269,13 @@ BOOL ODbaseIndex::Delete(sal_uInt32 nRec, const ORowSetValue& rValue)
// Find immer verwenden um das aktuelle Blatt zu bestimmen
ONDXKey aKey;
if (!ConvertToKey(&aKey, nRec, rValue) || !getRoot()->Find(aKey))
- return FALSE;
+ return sal_False;
ONDXNode aNewNode(aKey);
// einfuegen in das aktuelle Blatt
if (!m_aCurLeaf.Is())
- return FALSE;
+ return sal_False;
#if OSL_DEBUG_LEVEL > 1
m_aRoot->PrintPage();
#endif
@@ -289,10 +289,10 @@ void ODbaseIndex::Collect(ONDXPage* pPage)
m_aCollector.push_back(pPage);
}
//------------------------------------------------------------------
-void ODbaseIndex::Release(BOOL bSave)
+void ODbaseIndex::Release(sal_Bool bSave)
{
// Freigeben der Indexressourcen
- m_bUseCollector = FALSE;
+ m_bUseCollector = sal_False;
if (m_aCurLeaf.Is())
{
@@ -307,7 +307,7 @@ void ODbaseIndex::Release(BOOL bSave)
m_aRoot.Clear();
}
// alle Referenzen freigeben, bevor der FileStream geschlossen wird
- for (ULONG i = 0; i < m_aCollector.size(); i++)
+ for (sal_uIntPtr i = 0; i < m_aCollector.size(); i++)
m_aCollector[i]->QueryDelete();
m_aCollector.clear();
@@ -335,7 +335,7 @@ void ODbaseIndex::closeImpl()
}
}
//------------------------------------------------------------------
-ONDXPage* ODbaseIndex::CreatePage(sal_uInt32 nPagePos, ONDXPage* pParent, BOOL bLoad)
+ONDXPage* ODbaseIndex::CreatePage(sal_uInt32 nPagePos, ONDXPage* pParent, sal_Bool bLoad)
{
OSL_ENSURE(m_pFileStream,"FileStream is not opened!");
@@ -412,14 +412,14 @@ void ODbaseIndex::createINFEntry()
Config aInfFile(sPhysicalPath);
aInfFile.SetGroup(dBASE_III_GROUP);
- USHORT nSuffix = aInfFile.GetKeyCount();
+ sal_uInt16 nSuffix = aInfFile.GetKeyCount();
ByteString aNewEntry,aKeyName;
- BOOL bCase = isCaseSensitive();
+ sal_Bool bCase = isCaseSensitive();
while (!aNewEntry.Len())
{
aNewEntry = "NDX";
aNewEntry += ByteString::CreateFromInt32(++nSuffix);
- for (USHORT i = 0; i < aInfFile.GetKeyCount(); i++)
+ for (sal_uInt16 i = 0; i < aInfFile.GetKeyCount(); i++)
{
aKeyName = aInfFile.GetKeyName(i);
if (bCase ? aKeyName == aNewEntry : aKeyName.EqualsIgnoreCaseAscii(aNewEntry))
@@ -432,7 +432,7 @@ void ODbaseIndex::createINFEntry()
aInfFile.WriteKey(aNewEntry,ByteString(sEntry,m_pTable->getConnection()->getTextEncoding()));
}
// -------------------------------------------------------------------------
-BOOL ODbaseIndex::DropImpl()
+sal_Bool ODbaseIndex::DropImpl()
{
closeImpl();
@@ -456,13 +456,13 @@ BOOL ODbaseIndex::DropImpl()
Config aInfFile(sPhysicalPath);
aInfFile.SetGroup(dBASE_III_GROUP);
- USHORT nKeyCnt = aInfFile.GetKeyCount();
+ sal_uInt16 nKeyCnt = aInfFile.GetKeyCount();
ByteString aKeyName;
String sEntry = m_Name;
sEntry += String::CreateFromAscii(".ndx");
// delete entries from the inf file
- for (USHORT nKey = 0; nKey < nKeyCnt; nKey++)
+ for (sal_uInt16 nKey = 0; nKey < nKeyCnt; nKey++)
{
// Verweist der Key auf ein Indexfile?...
aKeyName = aInfFile.GetKeyName( nKey );
@@ -475,7 +475,7 @@ BOOL ODbaseIndex::DropImpl()
}
}
}
- return TRUE;
+ return sal_True;
}
// -------------------------------------------------------------------------
void ODbaseIndex::impl_killFileAndthrowError_throw(sal_uInt16 _nErrorId,const ::rtl::OUString& _sFile)
@@ -486,7 +486,7 @@ void ODbaseIndex::impl_killFileAndthrowError_throw(sal_uInt16 _nErrorId,const ::
m_pTable->getConnection()->throwGenericSQLException(_nErrorId,*this);
}
//------------------------------------------------------------------
-BOOL ODbaseIndex::CreateImpl()
+sal_Bool ODbaseIndex::CreateImpl()
{
// Anlegen des Index
const ::rtl::OUString sFile = getCompletePath();
@@ -515,7 +515,7 @@ BOOL ODbaseIndex::CreateImpl()
// String::CreateFromAscii("01000"),
// aStatus.CreateErrorMessage(aText),
// 0, String() );
-// return FALSE;
+// return sal_False;
// }
// create the index file
@@ -586,7 +586,7 @@ BOOL ODbaseIndex::CreateImpl()
xTableCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE)) >>= nType;
m_aHeader.db_keytype = (nType == DataType::VARCHAR || nType == DataType::CHAR) ? 0 : 1;
- m_aHeader.db_keylen = (m_aHeader.db_keytype) ? 8 : (USHORT)getINT32(xTableCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION)));
+ m_aHeader.db_keylen = (m_aHeader.db_keytype) ? 8 : (sal_uInt16)getINT32(xTableCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION)));
m_aHeader.db_keylen = (( m_aHeader.db_keylen - 1) / 4 + 1) * 4;
m_aHeader.db_maxkeys = (PAGE_SIZE - 4) / (8 + m_aHeader.db_keylen);
if ( m_aHeader.db_maxkeys < 3 )
@@ -597,7 +597,7 @@ BOOL ODbaseIndex::CreateImpl()
m_pFileStream->SetStreamSize(PAGE_SIZE);
ByteString aCol(aName,m_pTable->getConnection()->getTextEncoding());
- strncpy(m_aHeader.db_name,aCol.GetBuffer(),std::min((USHORT)sizeof(m_aHeader.db_name), aCol.Len()));
+ strncpy(m_aHeader.db_name,aCol.GetBuffer(),std::min((sal_uInt16)sizeof(m_aHeader.db_name), aCol.Len()));
m_aHeader.db_unique = m_IsUnique ? 1: 0;
m_aHeader.db_keyrec = m_aHeader.db_keylen + 8;
@@ -609,11 +609,11 @@ BOOL ODbaseIndex::CreateImpl()
// ODatabaseType eType = m_aHeader.db_keytype == 0 ? DataType::VARCHAR : DataType::DOUBLE;
m_aCurLeaf = m_aRoot = CreatePage(m_nRootPage);
- m_aRoot->SetModified(TRUE);
+ m_aRoot->SetModified(sal_True);
- m_bUseCollector = TRUE;
+ m_bUseCollector = sal_True;
- // ULONG nRowsLeft = pCursor->RowCount();
+ // sal_uIntPtr nRowsLeft = pCursor->RowCount();
sal_Int32 nRowsLeft = 0;
Reference<XRow> xRow(xSet,UNO_QUERY);