xref: /aoo42x/main/sw/source/ui/index/multmrk.cxx (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 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_sw.hxx"
30 
31 #ifdef SW_DLLIMPLEMENTATION
32 #undef SW_DLLIMPLEMENTATION
33 #endif
34 
35 
36 
37 #include "swtypes.hxx"
38 
39 #include "multmrk.hxx"
40 #include "toxmgr.hxx"
41 
42 #include "index.hrc"
43 #include "multmrk.hrc"
44 
45 
46 SwMultiTOXMarkDlg::SwMultiTOXMarkDlg( Window* pParent, SwTOXMgr& rTOXMgr ) :
47 
48 	SvxStandardDialog(pParent, SW_RES(DLG_MULTMRK)),
49 
50     aTOXFL(this,    SW_RES(FL_TOX)),
51 	aEntryFT(this, 	SW_RES(FT_ENTRY)),
52 	aTextFT(this, 	SW_RES(FT_TEXT)),
53 	aTOXFT(this, 	SW_RES(FT_TOX)),
54     aTOXLB(this,    SW_RES(LB_TOX)),
55     aOkBT(this,     SW_RES(OK_BT)),
56 	aCancelBT(this, SW_RES(CANCEL_BT)),
57 	rMgr( rTOXMgr ),
58 	nPos(0)
59 {
60 	aTOXLB.SetSelectHdl(LINK(this, SwMultiTOXMarkDlg, SelectHdl));
61 
62 	sal_uInt16 nSize = rMgr.GetTOXMarkCount();
63 	for(sal_uInt16 i=0; i < nSize; ++i)
64 		aTOXLB.InsertEntry(rMgr.GetTOXMark(i)->GetText());
65 
66 	aTOXLB.SelectEntryPos(0);
67 	aTextFT.SetText(rMgr.GetTOXMark(0)->GetTOXType()->GetTypeName());
68 
69 	FreeResource();
70 }
71 
72 
73 IMPL_LINK_INLINE_START( SwMultiTOXMarkDlg, SelectHdl, ListBox *, pBox )
74 {
75 	if(pBox->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND)
76 	{	SwTOXMark* pMark = rMgr.GetTOXMark(pBox->GetSelectEntryPos());
77 		aTextFT.SetText(pMark->GetTOXType()->GetTypeName());
78 		nPos = pBox->GetSelectEntryPos();
79 	}
80 	return 0;
81 }
82 IMPL_LINK_INLINE_END( SwMultiTOXMarkDlg, SelectHdl, ListBox *, pBox )
83 
84 
85 void SwMultiTOXMarkDlg::Apply()
86 {
87 	rMgr.SetCurTOXMark(nPos);
88 }
89 
90 /*-----------------25.02.94 22:06-------------------
91  dtor ueberladen
92 --------------------------------------------------*/
93 
94 
95 SwMultiTOXMarkDlg::~SwMultiTOXMarkDlg() {}
96 
97 
98 
99