xref: /trunk/main/tools/source/memtools/table.cxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_tools.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #define _TOOLS_TABLE_CXX
32*cdf0e10cSrcweir 
33*cdf0e10cSrcweir // -----------------------------------------------------------------------
34*cdf0e10cSrcweir #include <tools/debug.hxx>
35*cdf0e10cSrcweir #include <impcont.hxx>
36*cdf0e10cSrcweir #include <tools/table.hxx>
37*cdf0e10cSrcweir 
38*cdf0e10cSrcweir // =======================================================================
39*cdf0e10cSrcweir 
40*cdf0e10cSrcweir sal_uIntPtr Table::ImplGetIndex( sal_uIntPtr nKey, sal_uIntPtr* pIndex ) const
41*cdf0e10cSrcweir {
42*cdf0e10cSrcweir     // Abpruefen, ob der erste Key groesser als der Vergleichskey ist
43*cdf0e10cSrcweir     if ( !nCount || (nKey < (sal_uIntPtr)Container::ImpGetObject(0)) )
44*cdf0e10cSrcweir         return TABLE_ENTRY_NOTFOUND;
45*cdf0e10cSrcweir 
46*cdf0e10cSrcweir     sal_uIntPtr nLow;
47*cdf0e10cSrcweir     sal_uIntPtr nHigh;
48*cdf0e10cSrcweir     sal_uIntPtr nMid;
49*cdf0e10cSrcweir     sal_uIntPtr nCompareKey;
50*cdf0e10cSrcweir     void**  pNodes = Container::ImpGetOnlyNodes();
51*cdf0e10cSrcweir 
52*cdf0e10cSrcweir     // Binaeres Suchen
53*cdf0e10cSrcweir     nLow  = 0;
54*cdf0e10cSrcweir     nHigh = nCount-1;
55*cdf0e10cSrcweir     if ( pNodes )
56*cdf0e10cSrcweir     {
57*cdf0e10cSrcweir         do
58*cdf0e10cSrcweir         {
59*cdf0e10cSrcweir             nMid = (nLow + nHigh) / 2;
60*cdf0e10cSrcweir             nCompareKey = (sal_uIntPtr)pNodes[nMid*2];
61*cdf0e10cSrcweir             if ( nKey < nCompareKey )
62*cdf0e10cSrcweir                 nHigh = nMid-1;
63*cdf0e10cSrcweir             else
64*cdf0e10cSrcweir             {
65*cdf0e10cSrcweir                 if ( nKey > nCompareKey )
66*cdf0e10cSrcweir                     nLow = nMid + 1;
67*cdf0e10cSrcweir                 else
68*cdf0e10cSrcweir                     return nMid*2;
69*cdf0e10cSrcweir             }
70*cdf0e10cSrcweir         }
71*cdf0e10cSrcweir         while ( nLow <= nHigh );
72*cdf0e10cSrcweir     }
73*cdf0e10cSrcweir     else
74*cdf0e10cSrcweir     {
75*cdf0e10cSrcweir         do
76*cdf0e10cSrcweir         {
77*cdf0e10cSrcweir             nMid = (nLow + nHigh) / 2;
78*cdf0e10cSrcweir             nCompareKey = (sal_uIntPtr)Container::ImpGetObject( nMid*2 );
79*cdf0e10cSrcweir             if ( nKey < nCompareKey )
80*cdf0e10cSrcweir                 nHigh = nMid-1;
81*cdf0e10cSrcweir             else
82*cdf0e10cSrcweir             {
83*cdf0e10cSrcweir                 if ( nKey > nCompareKey )
84*cdf0e10cSrcweir                     nLow = nMid + 1;
85*cdf0e10cSrcweir                 else
86*cdf0e10cSrcweir                     return nMid*2;
87*cdf0e10cSrcweir             }
88*cdf0e10cSrcweir         }
89*cdf0e10cSrcweir         while ( nLow <= nHigh );
90*cdf0e10cSrcweir     }
91*cdf0e10cSrcweir 
92*cdf0e10cSrcweir     if ( pIndex )
93*cdf0e10cSrcweir     {
94*cdf0e10cSrcweir         if ( nKey > nCompareKey )
95*cdf0e10cSrcweir             *pIndex = (nMid+1)*2;
96*cdf0e10cSrcweir         else
97*cdf0e10cSrcweir             *pIndex = nMid*2;
98*cdf0e10cSrcweir     }
99*cdf0e10cSrcweir 
100*cdf0e10cSrcweir     return TABLE_ENTRY_NOTFOUND;
101*cdf0e10cSrcweir }
102*cdf0e10cSrcweir 
103*cdf0e10cSrcweir // =======================================================================
104*cdf0e10cSrcweir 
105*cdf0e10cSrcweir Table::Table( sal_uInt16 _nInitSize, sal_uInt16 _nReSize ) :
106*cdf0e10cSrcweir            Container( CONTAINER_MAXBLOCKSIZE, _nInitSize*2, _nReSize*2 )
107*cdf0e10cSrcweir {
108*cdf0e10cSrcweir     DBG_ASSERT( _nInitSize <= 32767, "Table::Table(): InitSize > 32767" );
109*cdf0e10cSrcweir     DBG_ASSERT( _nReSize <= 32767, "Table::Table(): ReSize > 32767" );
110*cdf0e10cSrcweir     nCount = 0;
111*cdf0e10cSrcweir }
112*cdf0e10cSrcweir 
113*cdf0e10cSrcweir // -----------------------------------------------------------------------
114*cdf0e10cSrcweir 
115*cdf0e10cSrcweir sal_Bool Table::Insert( sal_uIntPtr nKey, void* p )
116*cdf0e10cSrcweir {
117*cdf0e10cSrcweir     // Tabellenelement einsortieren
118*cdf0e10cSrcweir     sal_uIntPtr i;
119*cdf0e10cSrcweir     if ( nCount )
120*cdf0e10cSrcweir     {
121*cdf0e10cSrcweir         if ( nCount <= 24 )
122*cdf0e10cSrcweir         {
123*cdf0e10cSrcweir             sal_uInt16 n = 0;
124*cdf0e10cSrcweir             sal_uInt16 nTempCount = (sal_uInt16)nCount * 2;
125*cdf0e10cSrcweir             //<!--Modified by PengYunQuan for resolving a NULL pointer access
126*cdf0e10cSrcweir 
127*cdf0e10cSrcweir             if( void** pNodes = Container::ImpGetOnlyNodes() )
128*cdf0e10cSrcweir             {
129*cdf0e10cSrcweir                 sal_uIntPtr  nCompareKey = (sal_uIntPtr)(*pNodes);
130*cdf0e10cSrcweir                 while ( nKey > nCompareKey )
131*cdf0e10cSrcweir                 {
132*cdf0e10cSrcweir                     n += 2;
133*cdf0e10cSrcweir                     pNodes += 2;
134*cdf0e10cSrcweir                     if ( n < nTempCount )
135*cdf0e10cSrcweir                         nCompareKey = (sal_uIntPtr)(*pNodes);
136*cdf0e10cSrcweir                     else
137*cdf0e10cSrcweir                     {
138*cdf0e10cSrcweir                         nCompareKey = 0;
139*cdf0e10cSrcweir                         break;
140*cdf0e10cSrcweir                     }
141*cdf0e10cSrcweir                 }
142*cdf0e10cSrcweir 
143*cdf0e10cSrcweir                 // Testen, ob sich der Key schon in der Tabelle befindet
144*cdf0e10cSrcweir                 if ( nKey == nCompareKey )
145*cdf0e10cSrcweir                     return sal_False;
146*cdf0e10cSrcweir 
147*cdf0e10cSrcweir                 i = n;
148*cdf0e10cSrcweir             }
149*cdf0e10cSrcweir             else
150*cdf0e10cSrcweir             {
151*cdf0e10cSrcweir                 i = 0;
152*cdf0e10cSrcweir                 if ( ImplGetIndex( nKey, &i ) != TABLE_ENTRY_NOTFOUND )
153*cdf0e10cSrcweir                     return sal_False;
154*cdf0e10cSrcweir             }
155*cdf0e10cSrcweir             //-->Modified by PengYunQuan for resolving a NULL pointer access
156*cdf0e10cSrcweir         }
157*cdf0e10cSrcweir         else
158*cdf0e10cSrcweir         {
159*cdf0e10cSrcweir             i = 0;
160*cdf0e10cSrcweir             if ( ImplGetIndex( nKey, &i ) != TABLE_ENTRY_NOTFOUND )
161*cdf0e10cSrcweir                 return sal_False;
162*cdf0e10cSrcweir         }
163*cdf0e10cSrcweir     }
164*cdf0e10cSrcweir     else
165*cdf0e10cSrcweir         i = 0;
166*cdf0e10cSrcweir 
167*cdf0e10cSrcweir     // Eintrag einfuegen (Key vor Pointer)
168*cdf0e10cSrcweir     Container::Insert( (void*)nKey, i );
169*cdf0e10cSrcweir     Container::Insert( p, i+1 );
170*cdf0e10cSrcweir 
171*cdf0e10cSrcweir     // Ein neuer Eintrag
172*cdf0e10cSrcweir     nCount++;
173*cdf0e10cSrcweir 
174*cdf0e10cSrcweir     return sal_True;
175*cdf0e10cSrcweir }
176*cdf0e10cSrcweir 
177*cdf0e10cSrcweir // -----------------------------------------------------------------------
178*cdf0e10cSrcweir 
179*cdf0e10cSrcweir void* Table::Remove( sal_uIntPtr nKey )
180*cdf0e10cSrcweir {
181*cdf0e10cSrcweir     // Index besorgen
182*cdf0e10cSrcweir     sal_uIntPtr nIndex = ImplGetIndex( nKey );
183*cdf0e10cSrcweir 
184*cdf0e10cSrcweir     // Testen, ob sich der Key in der Tabelle befindet
185*cdf0e10cSrcweir     if ( nIndex == TABLE_ENTRY_NOTFOUND )
186*cdf0e10cSrcweir         return NULL;
187*cdf0e10cSrcweir 
188*cdf0e10cSrcweir     // Itemanzahl erniedrigen
189*cdf0e10cSrcweir     nCount--;
190*cdf0e10cSrcweir 
191*cdf0e10cSrcweir     // Key entfernen
192*cdf0e10cSrcweir     Container::Remove( nIndex );
193*cdf0e10cSrcweir 
194*cdf0e10cSrcweir     // Pointer entfernen und zurueckgeben
195*cdf0e10cSrcweir     return Container::Remove( nIndex );
196*cdf0e10cSrcweir }
197*cdf0e10cSrcweir 
198*cdf0e10cSrcweir // -----------------------------------------------------------------------
199*cdf0e10cSrcweir 
200*cdf0e10cSrcweir void* Table::Replace( sal_uIntPtr nKey, void* p )
201*cdf0e10cSrcweir {
202*cdf0e10cSrcweir     // Index abfragen
203*cdf0e10cSrcweir     sal_uIntPtr nIndex = ImplGetIndex( nKey );
204*cdf0e10cSrcweir 
205*cdf0e10cSrcweir     // Existiert kein Eintrag mit dem Schluessel
206*cdf0e10cSrcweir     if ( nIndex == TABLE_ENTRY_NOTFOUND )
207*cdf0e10cSrcweir         return NULL;
208*cdf0e10cSrcweir     else
209*cdf0e10cSrcweir         return Container::Replace( p, nIndex+1 );
210*cdf0e10cSrcweir }
211*cdf0e10cSrcweir 
212*cdf0e10cSrcweir // -----------------------------------------------------------------------
213*cdf0e10cSrcweir 
214*cdf0e10cSrcweir void* Table::Get( sal_uIntPtr nKey ) const
215*cdf0e10cSrcweir {
216*cdf0e10cSrcweir     // Index besorgen
217*cdf0e10cSrcweir     sal_uIntPtr nIndex = ImplGetIndex( nKey );
218*cdf0e10cSrcweir 
219*cdf0e10cSrcweir     // Testen, ob sich der Key in der Tabelle befindet
220*cdf0e10cSrcweir     if ( nIndex == TABLE_ENTRY_NOTFOUND )
221*cdf0e10cSrcweir         return NULL;
222*cdf0e10cSrcweir     else
223*cdf0e10cSrcweir         return Container::ImpGetObject( nIndex+1 );
224*cdf0e10cSrcweir }
225*cdf0e10cSrcweir 
226*cdf0e10cSrcweir // -----------------------------------------------------------------------
227*cdf0e10cSrcweir 
228*cdf0e10cSrcweir void* Table::GetCurObject() const
229*cdf0e10cSrcweir {
230*cdf0e10cSrcweir     return Container::ImpGetObject( Container::GetCurPos()+1 );
231*cdf0e10cSrcweir }
232*cdf0e10cSrcweir 
233*cdf0e10cSrcweir // -----------------------------------------------------------------------
234*cdf0e10cSrcweir 
235*cdf0e10cSrcweir sal_uIntPtr Table::GetKey( const void* p ) const
236*cdf0e10cSrcweir {
237*cdf0e10cSrcweir     sal_uIntPtr nIndex = 0;
238*cdf0e10cSrcweir 
239*cdf0e10cSrcweir     // Solange noch Eintraege Vorhanden sind
240*cdf0e10cSrcweir     while ( nIndex < nCount )
241*cdf0e10cSrcweir     {
242*cdf0e10cSrcweir         // Stimmt der Pointer ueberein, wird der Key zurueckgegeben
243*cdf0e10cSrcweir         if ( p == Container::ImpGetObject( (nIndex*2)+1 ) )
244*cdf0e10cSrcweir             return (sal_uIntPtr)Container::ImpGetObject( nIndex*2 );
245*cdf0e10cSrcweir 
246*cdf0e10cSrcweir         nIndex++;
247*cdf0e10cSrcweir     }
248*cdf0e10cSrcweir 
249*cdf0e10cSrcweir     return TABLE_ENTRY_NOTFOUND;
250*cdf0e10cSrcweir }
251*cdf0e10cSrcweir 
252*cdf0e10cSrcweir // -----------------------------------------------------------------------
253*cdf0e10cSrcweir 
254*cdf0e10cSrcweir sal_Bool Table::IsKeyValid( sal_uIntPtr nKey ) const
255*cdf0e10cSrcweir {
256*cdf0e10cSrcweir     return (ImplGetIndex( nKey ) != TABLE_ENTRY_NOTFOUND) ? sal_True : sal_False;
257*cdf0e10cSrcweir }
258*cdf0e10cSrcweir 
259*cdf0e10cSrcweir // -----------------------------------------------------------------------
260*cdf0e10cSrcweir 
261*cdf0e10cSrcweir sal_uIntPtr Table::GetUniqueKey( sal_uIntPtr nStartKey ) const
262*cdf0e10cSrcweir {
263*cdf0e10cSrcweir     DBG_ASSERT( (nStartKey > 1) && (nStartKey < 0xFFFFFFFF),
264*cdf0e10cSrcweir                 "Table::GetUniqueKey() - nStartKey == 0 or nStartKey >= 0xFFFFFFFF" );
265*cdf0e10cSrcweir 
266*cdf0e10cSrcweir     if ( !nCount )
267*cdf0e10cSrcweir         return nStartKey;
268*cdf0e10cSrcweir 
269*cdf0e10cSrcweir     sal_uIntPtr nLastKey = (sal_uIntPtr)Container::GetObject( (nCount*2)-2 );
270*cdf0e10cSrcweir     if ( nLastKey < nStartKey )
271*cdf0e10cSrcweir         return nStartKey;
272*cdf0e10cSrcweir     else
273*cdf0e10cSrcweir     {
274*cdf0e10cSrcweir         if ( nLastKey < 0xFFFFFFFE )
275*cdf0e10cSrcweir             return nLastKey+1;
276*cdf0e10cSrcweir         else
277*cdf0e10cSrcweir         {
278*cdf0e10cSrcweir             sal_uIntPtr nPos;
279*cdf0e10cSrcweir             sal_uIntPtr nTempPos = ImplGetIndex( nStartKey, &nPos );
280*cdf0e10cSrcweir             if ( nTempPos != TABLE_ENTRY_NOTFOUND )
281*cdf0e10cSrcweir                 nPos = nTempPos;
282*cdf0e10cSrcweir             nLastKey = (sal_uIntPtr)Container::GetObject( nPos );
283*cdf0e10cSrcweir             if ( nStartKey < nLastKey )
284*cdf0e10cSrcweir                 return nStartKey;
285*cdf0e10cSrcweir             while ( nLastKey < 0xFFFFFFFE )
286*cdf0e10cSrcweir             {
287*cdf0e10cSrcweir                 nPos += 2;
288*cdf0e10cSrcweir                 nLastKey++;
289*cdf0e10cSrcweir                 if ( nLastKey != (sal_uIntPtr)Container::GetObject( nPos ) )
290*cdf0e10cSrcweir                     return nLastKey;
291*cdf0e10cSrcweir             }
292*cdf0e10cSrcweir         }
293*cdf0e10cSrcweir     }
294*cdf0e10cSrcweir 
295*cdf0e10cSrcweir     return 0;
296*cdf0e10cSrcweir }
297*cdf0e10cSrcweir 
298*cdf0e10cSrcweir // -----------------------------------------------------------------------
299*cdf0e10cSrcweir 
300*cdf0e10cSrcweir sal_uIntPtr Table::SearchKey( sal_uIntPtr nKey, sal_uIntPtr* pPos ) const
301*cdf0e10cSrcweir {
302*cdf0e10cSrcweir     *pPos = 0;
303*cdf0e10cSrcweir     sal_uIntPtr nPos = ImplGetIndex( nKey, pPos );
304*cdf0e10cSrcweir     if ( nPos != TABLE_ENTRY_NOTFOUND )
305*cdf0e10cSrcweir     {
306*cdf0e10cSrcweir         nPos /= 2;
307*cdf0e10cSrcweir         *pPos = nPos;
308*cdf0e10cSrcweir     }
309*cdf0e10cSrcweir     else
310*cdf0e10cSrcweir         *pPos /= 2;
311*cdf0e10cSrcweir     return nPos;
312*cdf0e10cSrcweir }
313*cdf0e10cSrcweir 
314*cdf0e10cSrcweir // -----------------------------------------------------------------------
315*cdf0e10cSrcweir 
316*cdf0e10cSrcweir void* Table::Seek( sal_uIntPtr nKey )
317*cdf0e10cSrcweir {
318*cdf0e10cSrcweir     // Testen, ob ein Eintrag vorhanden ist
319*cdf0e10cSrcweir     if ( nCount )
320*cdf0e10cSrcweir     {
321*cdf0e10cSrcweir         sal_uIntPtr nIndex = ImplGetIndex( nKey );
322*cdf0e10cSrcweir 
323*cdf0e10cSrcweir         // Ist Key nicht enthalten
324*cdf0e10cSrcweir         if ( nIndex == TABLE_ENTRY_NOTFOUND )
325*cdf0e10cSrcweir             return NULL;
326*cdf0e10cSrcweir         else
327*cdf0e10cSrcweir         {
328*cdf0e10cSrcweir             // Index setzen
329*cdf0e10cSrcweir             Container::Seek( nIndex );
330*cdf0e10cSrcweir 
331*cdf0e10cSrcweir             // Pointer zurueckgeben
332*cdf0e10cSrcweir             return Container::ImpGetObject( Container::GetCurPos() + 1 );
333*cdf0e10cSrcweir         }
334*cdf0e10cSrcweir     }
335*cdf0e10cSrcweir     else
336*cdf0e10cSrcweir         return NULL;
337*cdf0e10cSrcweir }
338*cdf0e10cSrcweir 
339*cdf0e10cSrcweir // -----------------------------------------------------------------------
340*cdf0e10cSrcweir 
341*cdf0e10cSrcweir void* Table::Seek( void* p )
342*cdf0e10cSrcweir {
343*cdf0e10cSrcweir     sal_uIntPtr nKey = GetKey( p );
344*cdf0e10cSrcweir 
345*cdf0e10cSrcweir     // Ist Key vorhanden, dann als aktuellen Eintrag setzen
346*cdf0e10cSrcweir     if ( nKey != TABLE_ENTRY_NOTFOUND )
347*cdf0e10cSrcweir         return Seek( nKey );
348*cdf0e10cSrcweir     else
349*cdf0e10cSrcweir         return NULL;
350*cdf0e10cSrcweir }
351*cdf0e10cSrcweir 
352*cdf0e10cSrcweir // -----------------------------------------------------------------------
353*cdf0e10cSrcweir 
354*cdf0e10cSrcweir void* Table::First()
355*cdf0e10cSrcweir {
356*cdf0e10cSrcweir     // Testen, ob ein Eintrag vorhanden ist
357*cdf0e10cSrcweir     if ( nCount )
358*cdf0e10cSrcweir     {
359*cdf0e10cSrcweir         // Auf ersten Eintag setzen
360*cdf0e10cSrcweir         Container::First();
361*cdf0e10cSrcweir 
362*cdf0e10cSrcweir         // Pointer zurueckgeben
363*cdf0e10cSrcweir         return Container::ImpGetObject( 1 );
364*cdf0e10cSrcweir     }
365*cdf0e10cSrcweir     else
366*cdf0e10cSrcweir         return NULL;
367*cdf0e10cSrcweir }
368*cdf0e10cSrcweir 
369*cdf0e10cSrcweir // -----------------------------------------------------------------------
370*cdf0e10cSrcweir 
371*cdf0e10cSrcweir void* Table::Last()
372*cdf0e10cSrcweir {
373*cdf0e10cSrcweir     // Testen, ob ein Eintrag vorhanden ist
374*cdf0e10cSrcweir     if ( nCount )
375*cdf0e10cSrcweir     {
376*cdf0e10cSrcweir         // Last auf letzten Eintrag setzen
377*cdf0e10cSrcweir         void* p = Container::Last();
378*cdf0e10cSrcweir         Container::Prev();
379*cdf0e10cSrcweir 
380*cdf0e10cSrcweir         // Pointer zurueckgeben
381*cdf0e10cSrcweir         return p;
382*cdf0e10cSrcweir     }
383*cdf0e10cSrcweir     else
384*cdf0e10cSrcweir         return NULL;
385*cdf0e10cSrcweir }
386*cdf0e10cSrcweir 
387*cdf0e10cSrcweir // -----------------------------------------------------------------------
388*cdf0e10cSrcweir 
389*cdf0e10cSrcweir void* Table::Next()
390*cdf0e10cSrcweir {
391*cdf0e10cSrcweir     // Ueber den Pointer weiterschalten
392*cdf0e10cSrcweir     Container::Next();
393*cdf0e10cSrcweir 
394*cdf0e10cSrcweir     // Nachsten Eintag
395*cdf0e10cSrcweir     Container::Next();
396*cdf0e10cSrcweir 
397*cdf0e10cSrcweir     // Pointer vom naechsten Key zurueckgeben
398*cdf0e10cSrcweir     return Container::ImpGetObject( Container::GetCurPos() + 1 );
399*cdf0e10cSrcweir }
400*cdf0e10cSrcweir 
401*cdf0e10cSrcweir // -----------------------------------------------------------------------
402*cdf0e10cSrcweir 
403*cdf0e10cSrcweir void* Table::Prev()
404*cdf0e10cSrcweir {
405*cdf0e10cSrcweir     // Ueber den Pointer weiterschalten
406*cdf0e10cSrcweir     void* p = Container::Prev();
407*cdf0e10cSrcweir 
408*cdf0e10cSrcweir     // Nachsten Eintag
409*cdf0e10cSrcweir     Container::Prev();
410*cdf0e10cSrcweir 
411*cdf0e10cSrcweir     // Pointer vom vorherigen Key zurueckgeben
412*cdf0e10cSrcweir     return p;
413*cdf0e10cSrcweir }
414