xref: /trunk/main/sw/inc/ftnidx.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _FTNIDX_HXX
28 #define _FTNIDX_HXX
29 
30 
31 #define _SVSTDARR_USHORTS
32 #include <svl/svstdarr.hxx>
33 
34 class SwTxtFtn;
35 class SwNodeIndex;
36 class SwSectionNode;
37 
38 // ueberall, wo der NodeIndex gebraucht wird, werden die hier fehlenden
39 // Headerfiles schon includes. Darum hier nur als define und nicht als
40 // inline Methode (spart Compile-Zeit)
41 #define _SwTxtFtn_GetIndex( pFIdx )	(pFIdx->GetTxtNode().GetIndex())
42 
43 
44 typedef SwTxtFtn* SwTxtFtnPtr;
45 SV_DECL_PTRARR_SORT( _SwFtnIdxs, SwTxtFtnPtr, 0, 10 )
46 
47 class SwFtnIdxs : public _SwFtnIdxs
48 {
49 public:
50 	SwFtnIdxs() {}
51 
52 	void UpdateFtn( const SwNodeIndex& rStt );   	// ab Pos. alle Updaten
53 	void UpdateAllFtn();					// alle Fussnoten updaten
54 
55 	SwTxtFtn* SeekEntry( const SwNodeIndex& rIdx, sal_uInt16* pPos = 0 ) const;
56 };
57 
58 
59 class SwUpdFtnEndNtAtEnd
60 {
61 	SvPtrarr aFtnSects, aEndSects;
62 	SvUShorts aFtnNums, aEndNums;
63 
64 public:
65 	SwUpdFtnEndNtAtEnd() : aFtnSects( 0, 4 ), aEndSects( 0, 4 ),
66 						   aFtnNums( 0, 4 ), aEndNums( 0, 4 )
67 		{}
68 
69 	static const SwSectionNode* FindSectNdWithEndAttr(
70 											const SwTxtFtn& rTxtFtn );
71 
72 	sal_uInt16 GetNumber( const SwTxtFtn& rTxtFtn, const SwSectionNode& rNd );
73 	sal_uInt16 ChkNumber( const SwTxtFtn& rTxtFtn );
74 };
75 
76 
77 
78 #endif // _FTNIDX_HXX
79 
80