xref: /AOO41X/main/sw/source/ui/misc/swmodalredlineacceptdlg.cxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
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 #ifdef SW_DLLIMPLEMENTATION
31 #undef SW_DLLIMPLEMENTATION
32 #endif
33 
34 
35 
36 #define _SVSTDARR_STRINGSSORTDTOR
37 #define _SVSTDARR_USHORTSSORT
38 #define _SVSTDARR_USHORTS
39 
40 
41 #include <redline.hxx>
42 #include <tools/datetime.hxx>
43 #include <vcl/msgbox.hxx>
44 #ifndef _SVSTDARR_HXX
45 #include <svl/svstdarr.hxx>
46 #endif
47 #include <svl/eitem.hxx>
48 #include <sfx2/viewfrm.hxx>
49 #include <sfx2/dispatch.hxx>
50 #include <svx/ctredlin.hxx>
51 #include <svx/postattr.hxx>
52 #include <swtypes.hxx>
53 #include <wrtsh.hxx>
54 #ifndef _VIEW_HXX
55 #include <view.hxx>
56 #endif
57 #include <swmodule.hxx>
58 #include <swwait.hxx>
59 #include <uitool.hxx>
60 
61 #ifndef _HELPID_H
62 #include <helpid.h>
63 #endif
64 #ifndef _CMDID_H
65 #include <cmdid.h>
66 #endif
67 #ifndef _MISC_HRC
68 #include <misc.hrc>
69 #endif
70 #ifndef _REDLNDLG_HRC
71 #include <redlndlg.hrc>
72 #endif
73 #ifndef _SHELLS_HRC
74 #include <shells.hrc>
75 #endif
76 
77 #include <vector>
78 #ifndef _REDLNDLG_HXX
79 #define _REDLNACCEPTDLG
80 #include <redlndlg.hxx>
81 #endif
82 #include "swmodalredlineacceptdlg.hxx"
83 
84 #include <unomid.h>
85 
86 
87 SwModalRedlineAcceptDlg::SwModalRedlineAcceptDlg(Window *pParent) :
88 	SfxModalDialog(pParent, SW_RES(DLG_MOD_REDLINE_ACCEPT))
89 {
90 	pImplDlg = new SwRedlineAcceptDlg(this, sal_True);
91 
92 	pImplDlg->Initialize(GetExtraData());
93 	pImplDlg->Activate();	// Zur Initialisierung der Daten
94 
95 	FreeResource();
96 }
97 
98 /*------------------------------------------------------------------------
99 	Beschreibung:
100 ------------------------------------------------------------------------*/
101 
102 SwModalRedlineAcceptDlg::~SwModalRedlineAcceptDlg()
103 {
104 	AcceptAll(sal_False);	// Alles uebriggebliebene ablehnen
105 	pImplDlg->FillInfo(GetExtraData());
106 
107 	delete pImplDlg;
108 }
109 
110 /*--------------------------------------------------------------------
111 	Beschreibung:
112  --------------------------------------------------------------------*/
113 
114 void SwModalRedlineAcceptDlg::Activate()
115 {
116 }
117 
118 /*------------------------------------------------------------------------
119 	Beschreibung:
120 ------------------------------------------------------------------------*/
121 
122 void SwModalRedlineAcceptDlg::Resize()
123 {
124 	pImplDlg->Resize();
125 	SfxModalDialog::Resize();
126 }
127 
128 /*------------------------------------------------------------------------
129 	Beschreibung:
130 ------------------------------------------------------------------------*/
131 
132 void SwModalRedlineAcceptDlg::AcceptAll( sal_Bool bAccept )
133 {
134 	SvxTPFilter* pFilterTP = pImplDlg->GetChgCtrl()->GetFilterPage();
135 
136 	if (pFilterTP->IsDate() || pFilterTP->IsAuthor() ||
137 		pFilterTP->IsRange() || pFilterTP->IsAction())
138 	{
139 		pFilterTP->CheckDate(sal_False);	// Alle Filter abschalten
140 		pFilterTP->CheckAuthor(sal_False);
141 		pFilterTP->CheckRange(sal_False);
142 		pFilterTP->CheckAction(sal_False);
143 		pImplDlg->FilterChangedHdl();
144 	}
145 
146 	pImplDlg->CallAcceptReject( sal_False, bAccept );
147 }
148