summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-04-18 16:28:22 +0200
committerMichael Stahl <mstahl@redhat.com>2012-04-18 16:28:51 +0200
commit5b339c5537bb2a882621ca31e2fada391b16d217 (patch)
tree37758b9ef98a90ffb7dedc4ea96aceec827ed85c
parentcallcatcher: remove newly unused code (diff)
downloadbinfilter-5b339c5537bb2a882621ca31e2fada391b16d217.tar.gz
binfilter-5b339c5537bb2a882621ca31e2fada391b16d217.zip
partially revert 271e19336e594195ac6e40dd01ba62d2592f24e8
Turns out this stuff is used by Table
-rw-r--r--binfilter/bf_svtools/source/memtools/tl_contnr.cxx81
-rw-r--r--binfilter/inc/bf_tools/contnr.hxx9
2 files changed, 90 insertions, 0 deletions
diff --git a/binfilter/bf_svtools/source/memtools/tl_contnr.cxx b/binfilter/bf_svtools/source/memtools/tl_contnr.cxx
index f0b48a9d9..e548d00e2 100644
--- a/binfilter/bf_svtools/source/memtools/tl_contnr.cxx
+++ b/binfilter/bf_svtools/source/memtools/tl_contnr.cxx
@@ -788,6 +788,17 @@ void Container::ImpInsert( void* p, CBlock* pBlock, sal_uInt16 nIndex )
|*
*************************************************************************/
+void Container::Insert( void* p )
+{
+ ImpInsert( p, pCurBlock, nCurIndex );
+}
+
+/*************************************************************************
+|*
+|* Container::Insert()
+|*
+*************************************************************************/
+
void Container::Insert( void* p, sal_uIntPtr nIndex )
{
if ( nCount <= nIndex )
@@ -892,6 +903,21 @@ void* Container::ImpRemove( CBlock* pBlock, sal_uInt16 nIndex )
|*
*************************************************************************/
+void* Container::Remove()
+{
+ // Wenn kein Item vorhanden ist, NULL zurueckgeben
+ if ( !nCount )
+ return NULL;
+ else
+ return ImpRemove( pCurBlock, nCurIndex );
+}
+
+/*************************************************************************
+|*
+|* Container::Remove()
+|*
+*************************************************************************/
+
void* Container::Remove( sal_uIntPtr nIndex )
{
// Ist Index nicht innerhalb des Containers, dann NULL zurueckgeben
@@ -1107,6 +1133,23 @@ void Container::Clear()
/*************************************************************************
|*
+|* Container::GetCurObject()
+|*
+*************************************************************************/
+
+void* Container::GetCurObject() const
+{
+ DBG_CHKTHIS( Container, DbgCheckContainer );
+
+ // NULL, wenn Container leer
+ if ( !nCount )
+ return NULL;
+ else
+ return pCurBlock->GetObject( nCurIndex );
+}
+
+/*************************************************************************
+|*
|* Container::GetCurPos()
|*
*************************************************************************/
@@ -1163,6 +1206,44 @@ void* Container::GetObject( sal_uIntPtr nIndex ) const
/*************************************************************************
|*
+|* Container::GetPos()
+|*
+*************************************************************************/
+
+sal_uIntPtr Container::GetPos( const void* p ) const
+{
+ DBG_CHKTHIS( Container, DbgCheckContainer );
+
+ void** pNodes;
+ CBlock* pTemp;
+ sal_uIntPtr nTemp;
+ sal_uInt16 nBlockCount;
+ sal_uInt16 i;
+
+ // Block suchen
+ pTemp = pFirstBlock;
+ nTemp = 0;
+ while ( pTemp )
+ {
+ pNodes = pTemp->GetNodes();
+ i = 0;
+ nBlockCount = pTemp->Count();
+ while ( i < nBlockCount )
+ {
+ if ( p == *pNodes )
+ return nTemp+i;
+ pNodes++;
+ i++;
+ }
+ nTemp += nBlockCount;
+ pTemp = pTemp->GetNextBlock();
+ }
+
+ return CONTAINER_ENTRY_NOTFOUND;
+}
+
+/*************************************************************************
+|*
|* Container::Seek()
|*
*************************************************************************/
diff --git a/binfilter/inc/bf_tools/contnr.hxx b/binfilter/inc/bf_tools/contnr.hxx
index 99b9bc6cf..6d7e70fc5 100644
--- a/binfilter/inc/bf_tools/contnr.hxx
+++ b/binfilter/inc/bf_tools/contnr.hxx
@@ -79,11 +79,17 @@ public:
Container( const Container& rContainer );
~Container();
+ void Insert( void* p );
void Insert( void* p, sal_uIntPtr nIndex );
+ void* Remove();
void* Remove( sal_uIntPtr nIndex );
+ void* Remove( void* p )
+ { return Remove( GetPos( p ) ); }
void* Replace( void* p, sal_uIntPtr nIndex );
+ void* Replace( void* pNew, void* pOld )
+ { return Replace( pNew, GetPos( pOld ) ); }
void SetSize( sal_uIntPtr nNewSize );
sal_uIntPtr GetSize() const { return nCount; }
@@ -91,10 +97,13 @@ public:
sal_uIntPtr Count() const { return nCount; }
void Clear();
+ void* GetCurObject() const;
sal_uIntPtr GetCurPos() const;
void* GetObject( sal_uIntPtr nIndex ) const;
+ sal_uIntPtr GetPos( const void* p ) const;
void* Seek( sal_uIntPtr nIndex );
+ void* Seek( void* p ) { return Seek( GetPos( p ) ); }
void* First();
void* Last();