1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ring.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sw.hxx"
39 /*************************************************************************
43 |* Ersterstellung VB 02.07.91
44 |* Letzte Aenderung JP 10.10.97
46 *************************************************************************/
48 Ring::Ring( Ring
*pObj
)
51 pNext
= this, pPrev
= this;
61 /*************************************************************************
65 |* Ersterstellung VB 02.07.91
66 |* Letzte Aenderung JP 10.10.97
68 *************************************************************************/
76 /*************************************************************************
80 |* Ersterstellung VB 4.3.91
81 |* Letzte Aenderung JP 10.10.97
83 *************************************************************************/
85 void Ring::MoveTo(Ring
*pDestRing
)
87 // loeschen aus dem alten
95 pPrev
= pDestRing
->pPrev
;
96 pDestRing
->pPrev
= this;
100 pNext
= pPrev
= this;
104 void Ring::MoveRingTo(Ring
*pDestRing
)
106 // den gesamten Ring in den DestRing einfuegen
107 Ring
* pMyPrev
= pPrev
;
108 Ring
* pDestPrev
= pDestRing
->pPrev
;
110 pMyPrev
->pNext
= pDestRing
;
111 pDestPrev
->pNext
= this;
112 pDestRing
->pPrev
= pMyPrev
;
116 sal_uInt32
Ring::numberOf() const
119 const Ring
* pNxt
= pNext
;
120 while( pNxt
!= this )
123 pNxt
= pNxt
->GetNext();