1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sw.hxx"
26 #ifdef SW_DLLIMPLEMENTATION
27 #undef SW_DLLIMPLEMENTATION
28 #endif
29 
30 
31 
32 #define _SVSTDARR_STRINGSSORTDTOR
33 #define _SVSTDARR_USHORTSSORT
34 #define _SVSTDARR_USHORTS
35 
36 
37 #include <redline.hxx>
38 #include <tools/datetime.hxx>
39 #include <vcl/msgbox.hxx>
40 #ifndef _SVSTDARR_HXX
41 #include <svl/svstdarr.hxx>
42 #endif
43 #include <svl/eitem.hxx>
44 #include <sfx2/viewfrm.hxx>
45 #include <sfx2/dispatch.hxx>
46 #include <svx/ctredlin.hxx>
47 #include <svx/postattr.hxx>
48 #include <swtypes.hxx>
49 #include <wrtsh.hxx>
50 #ifndef _VIEW_HXX
51 #include <view.hxx>
52 #endif
53 #include <swmodule.hxx>
54 #include <swwait.hxx>
55 #include <uitool.hxx>
56 
57 #ifndef _HELPID_H
58 #include <helpid.h>
59 #endif
60 #ifndef _CMDID_H
61 #include <cmdid.h>
62 #endif
63 #ifndef _MISC_HRC
64 #include <misc.hrc>
65 #endif
66 #ifndef _REDLNDLG_HRC
67 #include <redlndlg.hrc>
68 #endif
69 #ifndef _SHELLS_HRC
70 #include <shells.hrc>
71 #endif
72 
73 #include <vector>
74 #ifndef _REDLNDLG_HXX
75 #define _REDLNACCEPTDLG
76 #include <redlndlg.hxx>
77 #endif
78 #include "swmodalredlineacceptdlg.hxx"
79 
80 #include <unomid.h>
81 
82 
SwModalRedlineAcceptDlg(Window * pParent)83 SwModalRedlineAcceptDlg::SwModalRedlineAcceptDlg(Window *pParent) :
84 	SfxModalDialog(pParent, SW_RES(DLG_MOD_REDLINE_ACCEPT))
85 {
86 	pImplDlg = new SwRedlineAcceptDlg(this, sal_True);
87 
88 	pImplDlg->Initialize(GetExtraData());
89 	pImplDlg->Activate();	// Zur Initialisierung der Daten
90 
91 	FreeResource();
92 }
93 
94 /*------------------------------------------------------------------------
95 	Beschreibung:
96 ------------------------------------------------------------------------*/
97 
~SwModalRedlineAcceptDlg()98 SwModalRedlineAcceptDlg::~SwModalRedlineAcceptDlg()
99 {
100 	AcceptAll(sal_False);	// Alles uebriggebliebene ablehnen
101 	pImplDlg->FillInfo(GetExtraData());
102 
103 	delete pImplDlg;
104 }
105 
106 /*--------------------------------------------------------------------
107 	Beschreibung:
108  --------------------------------------------------------------------*/
109 
Activate()110 void SwModalRedlineAcceptDlg::Activate()
111 {
112 }
113 
114 /*------------------------------------------------------------------------
115 	Beschreibung:
116 ------------------------------------------------------------------------*/
117 
Resize()118 void SwModalRedlineAcceptDlg::Resize()
119 {
120 	pImplDlg->Resize();
121 	SfxModalDialog::Resize();
122 }
123 
124 /*------------------------------------------------------------------------
125 	Beschreibung:
126 ------------------------------------------------------------------------*/
127 
AcceptAll(sal_Bool bAccept)128 void SwModalRedlineAcceptDlg::AcceptAll( sal_Bool bAccept )
129 {
130 	SvxTPFilter* pFilterTP = pImplDlg->GetChgCtrl()->GetFilterPage();
131 
132 	if (pFilterTP->IsDate() || pFilterTP->IsAuthor() ||
133 		pFilterTP->IsRange() || pFilterTP->IsAction())
134 	{
135 		pFilterTP->CheckDate(sal_False);	// Alle Filter abschalten
136 		pFilterTP->CheckAuthor(sal_False);
137 		pFilterTP->CheckRange(sal_False);
138 		pFilterTP->CheckAction(sal_False);
139 		pImplDlg->FilterChangedHdl();
140 	}
141 
142 	pImplDlg->CallAcceptReject( sal_False, bAccept );
143 }
144