xref: /AOO41X/main/svx/source/dialog/ctredlin.cxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_svx.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir // System - Includes ---------------------------------------------------------
32*cdf0e10cSrcweir #include <vcl/svapp.hxx>
33*cdf0e10cSrcweir #include <tools/shl.hxx>
34*cdf0e10cSrcweir #include <sfx2/app.hxx>
35*cdf0e10cSrcweir #include <sfx2/module.hxx>
36*cdf0e10cSrcweir #include <svtools/txtcmp.hxx>
37*cdf0e10cSrcweir #include <unotools/charclass.hxx>
38*cdf0e10cSrcweir // INCLUDE -------------------------------------------------------------------
39*cdf0e10cSrcweir #include <editeng/unolingu.hxx>
40*cdf0e10cSrcweir #include <svx/dialmgr.hxx>
41*cdf0e10cSrcweir #include "ctredlin.hrc"
42*cdf0e10cSrcweir #include <svx/ctredlin.hxx>
43*cdf0e10cSrcweir #include "helpid.hrc"
44*cdf0e10cSrcweir 
45*cdf0e10cSrcweir //============================================================================
46*cdf0e10cSrcweir //	Local Defines and Function
47*cdf0e10cSrcweir //----------------------------------------------------------------------------
48*cdf0e10cSrcweir 
49*cdf0e10cSrcweir inline void EnableDisable( Window& rWin, sal_Bool bEnable )
50*cdf0e10cSrcweir {
51*cdf0e10cSrcweir 	if (bEnable)
52*cdf0e10cSrcweir 		rWin.Enable();
53*cdf0e10cSrcweir 	else
54*cdf0e10cSrcweir 		rWin.Disable();
55*cdf0e10cSrcweir }
56*cdf0e10cSrcweir 
57*cdf0e10cSrcweir static long nStaticTabs[]=
58*cdf0e10cSrcweir {
59*cdf0e10cSrcweir 	5,10,65,120,170,220
60*cdf0e10cSrcweir };
61*cdf0e10cSrcweir 
62*cdf0e10cSrcweir #define	MIN_DISTANCE	6
63*cdf0e10cSrcweir #define WRITER_AUTHOR   1
64*cdf0e10cSrcweir #define WRITER_DATE		2
65*cdf0e10cSrcweir #define CALC_AUTHOR		2
66*cdf0e10cSrcweir #define CALC_DATE		3
67*cdf0e10cSrcweir 
68*cdf0e10cSrcweir RedlinData::RedlinData()
69*cdf0e10cSrcweir {
70*cdf0e10cSrcweir 	bDisabled=sal_False;
71*cdf0e10cSrcweir 	pData=NULL;
72*cdf0e10cSrcweir }
73*cdf0e10cSrcweir RedlinData::~RedlinData()
74*cdf0e10cSrcweir {
75*cdf0e10cSrcweir }
76*cdf0e10cSrcweir 
77*cdf0e10cSrcweir //============================================================================
78*cdf0e10cSrcweir //	class SvxRedlinEntry (Eintraege fuer Liste)
79*cdf0e10cSrcweir //----------------------------------------------------------------------------
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir SvxRedlinEntry::SvxRedlinEntry()
82*cdf0e10cSrcweir 	:SvLBoxEntry()
83*cdf0e10cSrcweir {
84*cdf0e10cSrcweir }
85*cdf0e10cSrcweir 
86*cdf0e10cSrcweir SvxRedlinEntry::~SvxRedlinEntry()
87*cdf0e10cSrcweir {
88*cdf0e10cSrcweir 	RedlinData* pRedDat=(RedlinData*) GetUserData();
89*cdf0e10cSrcweir 	if(pRedDat!=NULL)
90*cdf0e10cSrcweir 	{
91*cdf0e10cSrcweir 		delete pRedDat;
92*cdf0e10cSrcweir 	}
93*cdf0e10cSrcweir }
94*cdf0e10cSrcweir 
95*cdf0e10cSrcweir /*************************************************************************
96*cdf0e10cSrcweir #* Funktionen der in den SvxRedlinTable eingefuegten Items
97*cdf0e10cSrcweir #************************************************************************/
98*cdf0e10cSrcweir 
99*cdf0e10cSrcweir DBG_NAME(SvLBoxColorString);
100*cdf0e10cSrcweir 
101*cdf0e10cSrcweir /*************************************************************************
102*cdf0e10cSrcweir #*	Member:		SvLBoxColorString							Datum:23.10.97
103*cdf0e10cSrcweir #*------------------------------------------------------------------------
104*cdf0e10cSrcweir #*
105*cdf0e10cSrcweir #*  Klasse:		SvLBoxColorString
106*cdf0e10cSrcweir #*
107*cdf0e10cSrcweir #*  Funktion:	Konstruktor der Klasse SvLBoxColorString
108*cdf0e10cSrcweir #*
109*cdf0e10cSrcweir #*  Input:		Box- Entry,Flags, Text fuer Anzeige, Schrift
110*cdf0e10cSrcweir #*
111*cdf0e10cSrcweir #*	Output:		---
112*cdf0e10cSrcweir #*
113*cdf0e10cSrcweir #************************************************************************/
114*cdf0e10cSrcweir 
115*cdf0e10cSrcweir SvLBoxColorString::SvLBoxColorString( SvLBoxEntry*pEntry,sal_uInt16 nFlags,const XubString& rStr,
116*cdf0e10cSrcweir 									const Color& rCol)
117*cdf0e10cSrcweir 
118*cdf0e10cSrcweir : SvLBoxString( pEntry, nFlags, rStr )
119*cdf0e10cSrcweir {
120*cdf0e10cSrcweir 	DBG_CTOR(SvLBoxColorString,0);
121*cdf0e10cSrcweir 	aPrivColor=rCol;
122*cdf0e10cSrcweir 	SetText( pEntry, rStr );
123*cdf0e10cSrcweir }
124*cdf0e10cSrcweir 
125*cdf0e10cSrcweir /*************************************************************************
126*cdf0e10cSrcweir #*	Member:		SvLBoxColorString							Datum:23.10.97
127*cdf0e10cSrcweir #*------------------------------------------------------------------------
128*cdf0e10cSrcweir #*
129*cdf0e10cSrcweir #*  Klasse:		SvLBoxColorString
130*cdf0e10cSrcweir #*
131*cdf0e10cSrcweir #*  Funktion:	Default Konstruktor der Klasse SvLBoxColorString
132*cdf0e10cSrcweir #*
133*cdf0e10cSrcweir #*  Input:		---
134*cdf0e10cSrcweir #*
135*cdf0e10cSrcweir #*	Output:		---
136*cdf0e10cSrcweir #*
137*cdf0e10cSrcweir #************************************************************************/
138*cdf0e10cSrcweir 
139*cdf0e10cSrcweir SvLBoxColorString::SvLBoxColorString()
140*cdf0e10cSrcweir : SvLBoxString()
141*cdf0e10cSrcweir {
142*cdf0e10cSrcweir 	DBG_CTOR(SvLBoxColorString,0);
143*cdf0e10cSrcweir }
144*cdf0e10cSrcweir 
145*cdf0e10cSrcweir /*************************************************************************
146*cdf0e10cSrcweir #*	Member:		~SvLBoxColorString							Datum:23.10.97
147*cdf0e10cSrcweir #*------------------------------------------------------------------------
148*cdf0e10cSrcweir #*
149*cdf0e10cSrcweir #*  Klasse:		SvLBoxColorString
150*cdf0e10cSrcweir #*
151*cdf0e10cSrcweir #*  Funktion:	Destruktor der Klasse SvLBoxColorString
152*cdf0e10cSrcweir #*
153*cdf0e10cSrcweir #*  Input:		---
154*cdf0e10cSrcweir #*
155*cdf0e10cSrcweir #*	Output:		---
156*cdf0e10cSrcweir #*
157*cdf0e10cSrcweir #************************************************************************/
158*cdf0e10cSrcweir 
159*cdf0e10cSrcweir SvLBoxColorString::~SvLBoxColorString()
160*cdf0e10cSrcweir {
161*cdf0e10cSrcweir 	DBG_DTOR(SvLBoxColorString,0);
162*cdf0e10cSrcweir }
163*cdf0e10cSrcweir 
164*cdf0e10cSrcweir 
165*cdf0e10cSrcweir /*************************************************************************
166*cdf0e10cSrcweir #*	Member:		SvLBoxColorString							Datum:23.10.97
167*cdf0e10cSrcweir #*------------------------------------------------------------------------
168*cdf0e10cSrcweir #*
169*cdf0e10cSrcweir #*  Klasse:		SvLBoxColorString
170*cdf0e10cSrcweir #*
171*cdf0e10cSrcweir #*  Funktion:	Erzeugt einen neuen SvLBoxColorString
172*cdf0e10cSrcweir #*
173*cdf0e10cSrcweir #*  Input:		---
174*cdf0e10cSrcweir #*
175*cdf0e10cSrcweir #*	Output:		SvLBoxColorString
176*cdf0e10cSrcweir #*
177*cdf0e10cSrcweir #************************************************************************/
178*cdf0e10cSrcweir 
179*cdf0e10cSrcweir SvLBoxItem* SvLBoxColorString::Create() const
180*cdf0e10cSrcweir {
181*cdf0e10cSrcweir 	DBG_CHKTHIS(SvLBoxColorString,0);
182*cdf0e10cSrcweir 	return new SvLBoxColorString;
183*cdf0e10cSrcweir }
184*cdf0e10cSrcweir 
185*cdf0e10cSrcweir 
186*cdf0e10cSrcweir 
187*cdf0e10cSrcweir /*************************************************************************
188*cdf0e10cSrcweir #*	Member:		SvLBoxColorString							Datum:23.10.97
189*cdf0e10cSrcweir #*------------------------------------------------------------------------
190*cdf0e10cSrcweir #*
191*cdf0e10cSrcweir #*  Klasse:		SvLBoxColorString
192*cdf0e10cSrcweir #*
193*cdf0e10cSrcweir #*  Funktion:	Zeichenroutine des SvLBoxColorString. Gezeichnet wird
194*cdf0e10cSrcweir #*				der entsprechende Text mit der eingestellten Farbe
195*cdf0e10cSrcweir #*				im Ausgabe- Device.
196*cdf0e10cSrcweir #*
197*cdf0e10cSrcweir #*  Input:		Position, Ausgabe- Device, Flag fuer Selection,
198*cdf0e10cSrcweir #*				Zeiger auf den Eintrag
199*cdf0e10cSrcweir #*
200*cdf0e10cSrcweir #*	Output:		---
201*cdf0e10cSrcweir #*
202*cdf0e10cSrcweir #************************************************************************/
203*cdf0e10cSrcweir 
204*cdf0e10cSrcweir void SvLBoxColorString::Paint( const Point& rPos, SvLBox& rDev,
205*cdf0e10cSrcweir 							 sal_uInt16 nFlags,	SvLBoxEntry* pEntry )
206*cdf0e10cSrcweir {
207*cdf0e10cSrcweir 	Color aColor=rDev.GetTextColor();
208*cdf0e10cSrcweir 	Color a2Color=aColor;
209*cdf0e10cSrcweir 	if(!(nFlags & SVLISTENTRYFLAG_SELECTED))
210*cdf0e10cSrcweir 	{
211*cdf0e10cSrcweir 		rDev.SetTextColor(aPrivColor);
212*cdf0e10cSrcweir 	}
213*cdf0e10cSrcweir 	SvLBoxString::Paint(rPos,rDev,nFlags,pEntry );
214*cdf0e10cSrcweir 	rDev.SetTextColor(a2Color);
215*cdf0e10cSrcweir }
216*cdf0e10cSrcweir 
217*cdf0e10cSrcweir //============================================================================
218*cdf0e10cSrcweir //	class SvxRedlinTable
219*cdf0e10cSrcweir //----------------------------------------------------------------------------
220*cdf0e10cSrcweir 
221*cdf0e10cSrcweir SvxRedlinTable::SvxRedlinTable( Window* pParent,WinBits nBits ):
222*cdf0e10cSrcweir 		SvxSimpleTable(pParent,nBits )
223*cdf0e10cSrcweir {
224*cdf0e10cSrcweir 	bAuthor=sal_False;
225*cdf0e10cSrcweir 	bDate=sal_False;
226*cdf0e10cSrcweir 	bIsCalc=sal_False;
227*cdf0e10cSrcweir 	bComment=sal_False;
228*cdf0e10cSrcweir 	nDatePos=WRITER_DATE;
229*cdf0e10cSrcweir 	pCommentSearcher=NULL;
230*cdf0e10cSrcweir     SetNodeDefaultImages();
231*cdf0e10cSrcweir }
232*cdf0e10cSrcweir 
233*cdf0e10cSrcweir SvxRedlinTable::SvxRedlinTable( Window* pParent,const ResId& rResId):
234*cdf0e10cSrcweir 		SvxSimpleTable(pParent,rResId)
235*cdf0e10cSrcweir {
236*cdf0e10cSrcweir 	bAuthor=sal_False;
237*cdf0e10cSrcweir 	bDate=sal_False;
238*cdf0e10cSrcweir 	bIsCalc=sal_False;
239*cdf0e10cSrcweir 	bComment=sal_False;
240*cdf0e10cSrcweir 	nDatePos=WRITER_DATE;
241*cdf0e10cSrcweir 	pCommentSearcher=NULL;
242*cdf0e10cSrcweir     SetNodeDefaultImages();
243*cdf0e10cSrcweir }
244*cdf0e10cSrcweir 
245*cdf0e10cSrcweir SvxRedlinTable::~SvxRedlinTable()
246*cdf0e10cSrcweir {
247*cdf0e10cSrcweir 	if(pCommentSearcher!=NULL)
248*cdf0e10cSrcweir 		delete pCommentSearcher;
249*cdf0e10cSrcweir }
250*cdf0e10cSrcweir 
251*cdf0e10cSrcweir StringCompare SvxRedlinTable::ColCompare(SvLBoxEntry* pLeft,SvLBoxEntry* pRight)
252*cdf0e10cSrcweir {
253*cdf0e10cSrcweir 	StringCompare eCompare=COMPARE_EQUAL;
254*cdf0e10cSrcweir 
255*cdf0e10cSrcweir 	if(aColCompareLink.IsSet())
256*cdf0e10cSrcweir 	{
257*cdf0e10cSrcweir 		SvSortData aRedlinCompare;
258*cdf0e10cSrcweir 		aRedlinCompare.pLeft=pLeft;
259*cdf0e10cSrcweir 		aRedlinCompare.pRight=pRight;
260*cdf0e10cSrcweir 		eCompare=(StringCompare) aColCompareLink.Call(&aRedlinCompare);
261*cdf0e10cSrcweir 	}
262*cdf0e10cSrcweir 	else
263*cdf0e10cSrcweir 	{
264*cdf0e10cSrcweir 		if(nDatePos==GetSortedCol())
265*cdf0e10cSrcweir 		{
266*cdf0e10cSrcweir 			RedlinData *pLeftData=(RedlinData *)(pLeft->GetUserData());
267*cdf0e10cSrcweir 			RedlinData *pRightData=(RedlinData *)(pRight->GetUserData());
268*cdf0e10cSrcweir 
269*cdf0e10cSrcweir 			if(pLeftData!=NULL && pRightData!=NULL)
270*cdf0e10cSrcweir 			{
271*cdf0e10cSrcweir 				if(pLeftData->aDateTime < pRightData->aDateTime)
272*cdf0e10cSrcweir 				{
273*cdf0e10cSrcweir 					eCompare=COMPARE_LESS;
274*cdf0e10cSrcweir 				}
275*cdf0e10cSrcweir 				else if(pLeftData->aDateTime > pRightData->aDateTime)
276*cdf0e10cSrcweir 				{
277*cdf0e10cSrcweir 					eCompare=COMPARE_GREATER;
278*cdf0e10cSrcweir 				}
279*cdf0e10cSrcweir 			}
280*cdf0e10cSrcweir 			else
281*cdf0e10cSrcweir 				eCompare=SvxSimpleTable::ColCompare(pLeft,pRight);
282*cdf0e10cSrcweir 		}
283*cdf0e10cSrcweir 		else
284*cdf0e10cSrcweir 		{
285*cdf0e10cSrcweir 			eCompare=SvxSimpleTable::ColCompare(pLeft,pRight);
286*cdf0e10cSrcweir 		}
287*cdf0e10cSrcweir 
288*cdf0e10cSrcweir 	}
289*cdf0e10cSrcweir 
290*cdf0e10cSrcweir 	return eCompare;
291*cdf0e10cSrcweir }
292*cdf0e10cSrcweir void SvxRedlinTable::SetCalcView(sal_Bool bFlag)
293*cdf0e10cSrcweir {
294*cdf0e10cSrcweir 	bIsCalc=bFlag;
295*cdf0e10cSrcweir 	if(bFlag)
296*cdf0e10cSrcweir 	{
297*cdf0e10cSrcweir 		nDatePos=CALC_DATE;
298*cdf0e10cSrcweir 	}
299*cdf0e10cSrcweir 	else
300*cdf0e10cSrcweir 	{
301*cdf0e10cSrcweir 		nDatePos=WRITER_DATE;
302*cdf0e10cSrcweir 	}
303*cdf0e10cSrcweir }
304*cdf0e10cSrcweir 
305*cdf0e10cSrcweir 
306*cdf0e10cSrcweir void SvxRedlinTable::UpdateFilterTest()
307*cdf0e10cSrcweir {
308*cdf0e10cSrcweir 	Date aDateMax;
309*cdf0e10cSrcweir 	sal_uInt16 nYEAR=aDateMax.GetYear()+100;
310*cdf0e10cSrcweir 	aDateMax.SetYear(nYEAR);
311*cdf0e10cSrcweir 	Date aDateMin(1,1,1989);
312*cdf0e10cSrcweir 	Time aTMin(0);
313*cdf0e10cSrcweir 	Time aTMax(23,59,59);
314*cdf0e10cSrcweir 
315*cdf0e10cSrcweir 
316*cdf0e10cSrcweir 	DateTime aDTMin(aDateMin);
317*cdf0e10cSrcweir 	DateTime aDTMax(aDateMax);
318*cdf0e10cSrcweir 
319*cdf0e10cSrcweir 	switch(nDaTiMode)
320*cdf0e10cSrcweir 	{
321*cdf0e10cSrcweir 		case FLT_DATE_BEFORE:
322*cdf0e10cSrcweir 								aDaTiFilterFirst=aDTMin;
323*cdf0e10cSrcweir 								aDaTiFilterLast=aDaTiFirst;
324*cdf0e10cSrcweir 								break;
325*cdf0e10cSrcweir 		case FLT_DATE_SAVE:
326*cdf0e10cSrcweir 		case FLT_DATE_SINCE:
327*cdf0e10cSrcweir 								aDaTiFilterFirst=aDaTiFirst;
328*cdf0e10cSrcweir 								aDaTiFilterLast=aDTMax;
329*cdf0e10cSrcweir 								break;
330*cdf0e10cSrcweir 		case FLT_DATE_EQUAL:
331*cdf0e10cSrcweir 								aDaTiFilterFirst=aDaTiFirst;
332*cdf0e10cSrcweir 								aDaTiFilterLast=aDaTiFirst;
333*cdf0e10cSrcweir 								aDaTiFilterFirst.SetTime(aTMin.GetTime());
334*cdf0e10cSrcweir 								aDaTiFilterLast.SetTime(aTMax.GetTime());
335*cdf0e10cSrcweir 								break;
336*cdf0e10cSrcweir 		case FLT_DATE_NOTEQUAL:
337*cdf0e10cSrcweir 								aDaTiFilterFirst=aDaTiFirst;
338*cdf0e10cSrcweir 								aDaTiFilterLast=aDaTiFirst;
339*cdf0e10cSrcweir 								aDaTiFilterFirst.SetTime(aTMin.GetTime());
340*cdf0e10cSrcweir 								aDaTiFilterLast.SetTime(aTMax.GetTime());
341*cdf0e10cSrcweir 								break;
342*cdf0e10cSrcweir 		case FLT_DATE_BETWEEN:
343*cdf0e10cSrcweir 								aDaTiFilterFirst=aDaTiFirst;
344*cdf0e10cSrcweir 								aDaTiFilterLast=aDaTiLast;
345*cdf0e10cSrcweir 								break;
346*cdf0e10cSrcweir 	}
347*cdf0e10cSrcweir }
348*cdf0e10cSrcweir 
349*cdf0e10cSrcweir 
350*cdf0e10cSrcweir void SvxRedlinTable::SetFilterDate(sal_Bool bFlag)
351*cdf0e10cSrcweir {
352*cdf0e10cSrcweir 	bDate=bFlag;
353*cdf0e10cSrcweir }
354*cdf0e10cSrcweir 
355*cdf0e10cSrcweir void SvxRedlinTable::SetDateTimeMode(sal_uInt16 nMode)
356*cdf0e10cSrcweir {
357*cdf0e10cSrcweir 	nDaTiMode=nMode;
358*cdf0e10cSrcweir }
359*cdf0e10cSrcweir 
360*cdf0e10cSrcweir void SvxRedlinTable::SetFirstDate(const Date& aDate)
361*cdf0e10cSrcweir {
362*cdf0e10cSrcweir 	aDaTiFirst.SetDate(aDate.GetDate());
363*cdf0e10cSrcweir }
364*cdf0e10cSrcweir 
365*cdf0e10cSrcweir void SvxRedlinTable::SetLastDate(const Date& aDate)
366*cdf0e10cSrcweir {
367*cdf0e10cSrcweir 	aDaTiLast.SetDate(aDate.GetDate());
368*cdf0e10cSrcweir }
369*cdf0e10cSrcweir 
370*cdf0e10cSrcweir void SvxRedlinTable::SetFirstTime(const Time& aTime)
371*cdf0e10cSrcweir {
372*cdf0e10cSrcweir 	aDaTiFirst.SetTime(aTime.GetTime());
373*cdf0e10cSrcweir }
374*cdf0e10cSrcweir 
375*cdf0e10cSrcweir void SvxRedlinTable::SetLastTime(const Time& aTime)
376*cdf0e10cSrcweir {
377*cdf0e10cSrcweir 	aDaTiLast.SetTime(aTime.GetTime());
378*cdf0e10cSrcweir }
379*cdf0e10cSrcweir 
380*cdf0e10cSrcweir void SvxRedlinTable::SetFilterAuthor(sal_Bool bFlag)
381*cdf0e10cSrcweir {
382*cdf0e10cSrcweir 	bAuthor=bFlag;
383*cdf0e10cSrcweir }
384*cdf0e10cSrcweir 
385*cdf0e10cSrcweir void SvxRedlinTable::SetAuthor(const String &aString)
386*cdf0e10cSrcweir {
387*cdf0e10cSrcweir 	aAuthor=aString;
388*cdf0e10cSrcweir }
389*cdf0e10cSrcweir 
390*cdf0e10cSrcweir void SvxRedlinTable::SetFilterComment(sal_Bool bFlag)
391*cdf0e10cSrcweir {
392*cdf0e10cSrcweir 	bComment=bFlag;
393*cdf0e10cSrcweir }
394*cdf0e10cSrcweir 
395*cdf0e10cSrcweir void SvxRedlinTable::SetCommentParams( const utl::SearchParam* pSearchPara )
396*cdf0e10cSrcweir {
397*cdf0e10cSrcweir 	if(pSearchPara!=NULL)
398*cdf0e10cSrcweir 	{
399*cdf0e10cSrcweir 		if(pCommentSearcher!=NULL) delete pCommentSearcher;
400*cdf0e10cSrcweir 
401*cdf0e10cSrcweir 		pCommentSearcher=new utl::TextSearch(*pSearchPara, LANGUAGE_SYSTEM );
402*cdf0e10cSrcweir 	}
403*cdf0e10cSrcweir }
404*cdf0e10cSrcweir 
405*cdf0e10cSrcweir sal_Bool SvxRedlinTable::IsValidWriterEntry(const String& rString,RedlinData *pUserData)
406*cdf0e10cSrcweir {
407*cdf0e10cSrcweir 	sal_Bool nTheFlag=sal_True;
408*cdf0e10cSrcweir 	String aString=rString.GetToken(WRITER_AUTHOR,'\t');
409*cdf0e10cSrcweir 	if(pUserData==NULL)
410*cdf0e10cSrcweir 	{
411*cdf0e10cSrcweir 		if(bAuthor)
412*cdf0e10cSrcweir 		{
413*cdf0e10cSrcweir 			if(aAuthor.CompareTo(aString)==COMPARE_EQUAL)
414*cdf0e10cSrcweir 				nTheFlag=sal_True;
415*cdf0e10cSrcweir 			else
416*cdf0e10cSrcweir 				nTheFlag=sal_False;
417*cdf0e10cSrcweir 		}
418*cdf0e10cSrcweir 	}
419*cdf0e10cSrcweir 	else
420*cdf0e10cSrcweir 	{
421*cdf0e10cSrcweir 		DateTime aDateTime=pUserData->aDateTime;
422*cdf0e10cSrcweir 		nTheFlag=IsValidEntry(&aString,&aDateTime);
423*cdf0e10cSrcweir 	}
424*cdf0e10cSrcweir 	return nTheFlag;
425*cdf0e10cSrcweir }
426*cdf0e10cSrcweir 
427*cdf0e10cSrcweir sal_Bool SvxRedlinTable::IsValidCalcEntry(const String& rString,RedlinData *pUserData)
428*cdf0e10cSrcweir {
429*cdf0e10cSrcweir 	sal_Bool nTheFlag=sal_True;
430*cdf0e10cSrcweir 	String aString=rString.GetToken(CALC_AUTHOR,'\t');
431*cdf0e10cSrcweir 	if(pUserData==NULL)
432*cdf0e10cSrcweir 	{
433*cdf0e10cSrcweir 		if(bAuthor)
434*cdf0e10cSrcweir 		{
435*cdf0e10cSrcweir 			if(aAuthor.CompareTo(aString)==COMPARE_EQUAL)
436*cdf0e10cSrcweir 				nTheFlag=sal_True;
437*cdf0e10cSrcweir 			else
438*cdf0e10cSrcweir 				nTheFlag=sal_False;
439*cdf0e10cSrcweir 		}
440*cdf0e10cSrcweir 	}
441*cdf0e10cSrcweir 	else
442*cdf0e10cSrcweir 	{
443*cdf0e10cSrcweir 		DateTime aDateTime=pUserData->aDateTime;
444*cdf0e10cSrcweir 		nTheFlag=IsValidEntry(&aString,&aDateTime);
445*cdf0e10cSrcweir 	}
446*cdf0e10cSrcweir 	return nTheFlag;
447*cdf0e10cSrcweir }
448*cdf0e10cSrcweir 
449*cdf0e10cSrcweir sal_Bool SvxRedlinTable::IsValidEntry(const String* pAuthorStr,
450*cdf0e10cSrcweir 								  const DateTime *pDateTime,const String* pCommentStr)
451*cdf0e10cSrcweir {
452*cdf0e10cSrcweir 	bool nTheFlag=true;
453*cdf0e10cSrcweir 	if(bAuthor)
454*cdf0e10cSrcweir 	{
455*cdf0e10cSrcweir 		nTheFlag = aAuthor.CompareTo(*pAuthorStr)==COMPARE_EQUAL;
456*cdf0e10cSrcweir 	}
457*cdf0e10cSrcweir 	if(bDate && nTheFlag)
458*cdf0e10cSrcweir 	{
459*cdf0e10cSrcweir 		if(nDaTiMode!=FLT_DATE_NOTEQUAL)
460*cdf0e10cSrcweir 		{
461*cdf0e10cSrcweir 			nTheFlag=pDateTime->IsBetween(aDaTiFilterFirst,aDaTiFilterLast);
462*cdf0e10cSrcweir 		}
463*cdf0e10cSrcweir 		else
464*cdf0e10cSrcweir 		{
465*cdf0e10cSrcweir 			nTheFlag=!(pDateTime->IsBetween(aDaTiFilterFirst,aDaTiFilterLast));
466*cdf0e10cSrcweir 		}
467*cdf0e10cSrcweir 	}
468*cdf0e10cSrcweir 	if(bComment && nTheFlag)
469*cdf0e10cSrcweir 	{
470*cdf0e10cSrcweir 		xub_StrLen nStartPos = 0;
471*cdf0e10cSrcweir 		xub_StrLen nEndPos = pCommentStr->Len();
472*cdf0e10cSrcweir 
473*cdf0e10cSrcweir 		nTheFlag=pCommentSearcher->SearchFrwrd( *pCommentStr, &nStartPos, &nEndPos);
474*cdf0e10cSrcweir 	}
475*cdf0e10cSrcweir 	return nTheFlag;
476*cdf0e10cSrcweir }
477*cdf0e10cSrcweir 
478*cdf0e10cSrcweir sal_Bool SvxRedlinTable::IsValidEntry(const String* pAuthorStr,const DateTime *pDateTime)
479*cdf0e10cSrcweir {
480*cdf0e10cSrcweir 	sal_Bool nTheFlag=sal_True;
481*cdf0e10cSrcweir 	if(bAuthor)
482*cdf0e10cSrcweir 	{
483*cdf0e10cSrcweir 		if(aAuthor.CompareTo(*pAuthorStr)==COMPARE_EQUAL)
484*cdf0e10cSrcweir 			nTheFlag=sal_True;
485*cdf0e10cSrcweir 		else
486*cdf0e10cSrcweir 			nTheFlag=sal_False;
487*cdf0e10cSrcweir 	}
488*cdf0e10cSrcweir 	if(bDate && nTheFlag)
489*cdf0e10cSrcweir 	{
490*cdf0e10cSrcweir 		if(nDaTiMode!=FLT_DATE_NOTEQUAL)
491*cdf0e10cSrcweir 		{
492*cdf0e10cSrcweir 			nTheFlag=pDateTime->IsBetween(aDaTiFilterFirst,aDaTiFilterLast);
493*cdf0e10cSrcweir 		}
494*cdf0e10cSrcweir 		else
495*cdf0e10cSrcweir 		{
496*cdf0e10cSrcweir 			nTheFlag=!(pDateTime->IsBetween(aDaTiFilterFirst,aDaTiFilterLast));
497*cdf0e10cSrcweir 		}
498*cdf0e10cSrcweir 	}
499*cdf0e10cSrcweir 	return nTheFlag;
500*cdf0e10cSrcweir }
501*cdf0e10cSrcweir 
502*cdf0e10cSrcweir sal_Bool SvxRedlinTable::IsValidComment(const String* pCommentStr)
503*cdf0e10cSrcweir {
504*cdf0e10cSrcweir 	bool nTheFlag=true;
505*cdf0e10cSrcweir 
506*cdf0e10cSrcweir 	if(bComment)
507*cdf0e10cSrcweir 	{
508*cdf0e10cSrcweir 		xub_StrLen nStartPos = 0;
509*cdf0e10cSrcweir 		xub_StrLen nEndPos = pCommentStr->Len();
510*cdf0e10cSrcweir 
511*cdf0e10cSrcweir 		nTheFlag=pCommentSearcher->SearchFrwrd( *pCommentStr, &nStartPos, &nEndPos);
512*cdf0e10cSrcweir 	}
513*cdf0e10cSrcweir 	return nTheFlag;
514*cdf0e10cSrcweir }
515*cdf0e10cSrcweir 
516*cdf0e10cSrcweir SvLBoxEntry* SvxRedlinTable::InsertEntry(const String& rStr,RedlinData *pUserData,
517*cdf0e10cSrcweir 								SvLBoxEntry* pParent,sal_uIntPtr nPos)
518*cdf0e10cSrcweir {
519*cdf0e10cSrcweir 	aEntryColor=GetTextColor();
520*cdf0e10cSrcweir 	if(pUserData!=NULL)
521*cdf0e10cSrcweir 	{
522*cdf0e10cSrcweir 		if(pUserData->bDisabled)
523*cdf0e10cSrcweir 			aEntryColor=Color(COL_GRAY);
524*cdf0e10cSrcweir 	}
525*cdf0e10cSrcweir 
526*cdf0e10cSrcweir 	XubString aStr= rStr;
527*cdf0e10cSrcweir 
528*cdf0e10cSrcweir 	XubString aFirstStr( aStr );
529*cdf0e10cSrcweir 	xub_StrLen nEnd = aFirstStr.Search( sal_Unicode( '\t' ) );
530*cdf0e10cSrcweir 	if( nEnd != STRING_NOTFOUND )
531*cdf0e10cSrcweir 	{
532*cdf0e10cSrcweir 		aFirstStr.Erase( nEnd );
533*cdf0e10cSrcweir 		aCurEntry = aStr;
534*cdf0e10cSrcweir 		aCurEntry.Erase( 0, ++nEnd );
535*cdf0e10cSrcweir 	}
536*cdf0e10cSrcweir 	else
537*cdf0e10cSrcweir 		aCurEntry.Erase();
538*cdf0e10cSrcweir 
539*cdf0e10cSrcweir 	return SvTreeListBox::InsertEntry( aFirstStr, pParent, sal_False, nPos, pUserData );
540*cdf0e10cSrcweir 
541*cdf0e10cSrcweir }
542*cdf0e10cSrcweir 
543*cdf0e10cSrcweir SvLBoxEntry* SvxRedlinTable::InsertEntry(const String& rStr,RedlinData *pUserData,const Color& aColor,
544*cdf0e10cSrcweir 								SvLBoxEntry* pParent,sal_uIntPtr nPos)
545*cdf0e10cSrcweir {
546*cdf0e10cSrcweir 	aEntryColor=aColor;
547*cdf0e10cSrcweir 
548*cdf0e10cSrcweir 	XubString aStr= rStr;
549*cdf0e10cSrcweir 
550*cdf0e10cSrcweir 	XubString aFirstStr( aStr );
551*cdf0e10cSrcweir 	xub_StrLen nEnd = aFirstStr.Search( sal_Unicode ( '\t' ) );
552*cdf0e10cSrcweir 	if( nEnd != STRING_NOTFOUND )
553*cdf0e10cSrcweir 	{
554*cdf0e10cSrcweir 		aFirstStr.Erase( nEnd );
555*cdf0e10cSrcweir 		aCurEntry = aStr;
556*cdf0e10cSrcweir 		aCurEntry.Erase( 0, ++nEnd );
557*cdf0e10cSrcweir 	}
558*cdf0e10cSrcweir 	else
559*cdf0e10cSrcweir 		aCurEntry.Erase();
560*cdf0e10cSrcweir 
561*cdf0e10cSrcweir 	return SvTreeListBox::InsertEntry( aFirstStr, pParent, sal_False, nPos, pUserData );
562*cdf0e10cSrcweir }
563*cdf0e10cSrcweir 
564*cdf0e10cSrcweir SvLBoxEntry* SvxRedlinTable::CreateEntry() const
565*cdf0e10cSrcweir {
566*cdf0e10cSrcweir 	return new SvxRedlinEntry;
567*cdf0e10cSrcweir }
568*cdf0e10cSrcweir 
569*cdf0e10cSrcweir void SvxRedlinTable::InitEntry( SvLBoxEntry* pEntry, const XubString& rStr,
570*cdf0e10cSrcweir 	const Image& rColl, const Image& rExp, SvLBoxButtonKind eButtonKind )
571*cdf0e10cSrcweir {
572*cdf0e10cSrcweir 	SvLBoxButton* pButton;
573*cdf0e10cSrcweir 	SvLBoxString* pString;
574*cdf0e10cSrcweir 	SvLBoxContextBmp* pContextBmp;
575*cdf0e10cSrcweir 
576*cdf0e10cSrcweir 	if( nTreeFlags & TREEFLAG_CHKBTN )
577*cdf0e10cSrcweir 	{
578*cdf0e10cSrcweir 		pButton= new SvLBoxButton( pEntry,eButtonKind,0,pCheckButtonData );
579*cdf0e10cSrcweir 		pEntry->AddItem( pButton );
580*cdf0e10cSrcweir 	}
581*cdf0e10cSrcweir 
582*cdf0e10cSrcweir 	pContextBmp= new SvLBoxContextBmp( pEntry,0, rColl,rExp,
583*cdf0e10cSrcweir 									 SVLISTENTRYFLAG_EXPANDED);
584*cdf0e10cSrcweir 	pEntry->AddItem( pContextBmp );
585*cdf0e10cSrcweir 
586*cdf0e10cSrcweir 	pString = new SvLBoxColorString( pEntry, 0, rStr ,aEntryColor);
587*cdf0e10cSrcweir 	pEntry->AddItem( pString );
588*cdf0e10cSrcweir 
589*cdf0e10cSrcweir 	XubString aToken;
590*cdf0e10cSrcweir 
591*cdf0e10cSrcweir 	xub_Unicode* pCurToken = (xub_Unicode*)aCurEntry.GetBuffer();
592*cdf0e10cSrcweir 	sal_uInt16 nCurTokenLen;
593*cdf0e10cSrcweir 	xub_Unicode* pNextToken = (xub_Unicode*)GetToken( pCurToken, nCurTokenLen );
594*cdf0e10cSrcweir 	sal_uInt16 nCount = TabCount(); nCount--;
595*cdf0e10cSrcweir 
596*cdf0e10cSrcweir 	for( sal_uInt16 nToken = 0; nToken < nCount; nToken++ )
597*cdf0e10cSrcweir 	{
598*cdf0e10cSrcweir 		if( pCurToken && nCurTokenLen )
599*cdf0e10cSrcweir 			// aToken.Assign( pCurToken, nCurTokenLen );
600*cdf0e10cSrcweir 			aToken = XubString( pCurToken, nCurTokenLen );
601*cdf0e10cSrcweir 		else
602*cdf0e10cSrcweir 			aToken.Erase();
603*cdf0e10cSrcweir 
604*cdf0e10cSrcweir 		SvLBoxColorString* pStr = new SvLBoxColorString( pEntry, 0, aToken ,aEntryColor);
605*cdf0e10cSrcweir 		pEntry->AddItem( pStr );
606*cdf0e10cSrcweir 
607*cdf0e10cSrcweir 		pCurToken = pNextToken;
608*cdf0e10cSrcweir 		if( pCurToken )
609*cdf0e10cSrcweir 			pNextToken = (xub_Unicode*)GetToken( pCurToken, nCurTokenLen );
610*cdf0e10cSrcweir 		else
611*cdf0e10cSrcweir 			nCurTokenLen = 0;
612*cdf0e10cSrcweir 	}
613*cdf0e10cSrcweir }
614*cdf0e10cSrcweir 
615*cdf0e10cSrcweir 
616*cdf0e10cSrcweir 
617*cdf0e10cSrcweir 
618*cdf0e10cSrcweir //============================================================================
619*cdf0e10cSrcweir //	class SvxTPView
620*cdf0e10cSrcweir //----------------------------------------------------------------------------
621*cdf0e10cSrcweir 
622*cdf0e10cSrcweir SvxTPView::SvxTPView( Window * pParent)
623*cdf0e10cSrcweir 	: TabPage( pParent, SVX_RES(SID_REDLIN_VIEW_PAGE)),
624*cdf0e10cSrcweir 	aViewData	( this, SVX_RES( DG_VIEW) ),
625*cdf0e10cSrcweir 	PbAccept	( this, SVX_RES(PB_ACCEPT	 ) ),
626*cdf0e10cSrcweir     PbReject    ( this, SVX_RES(PB_REJECT  ) ),
627*cdf0e10cSrcweir     PbAcceptAll ( this, SVX_RES(PB_ACCEPTALL  ) ),
628*cdf0e10cSrcweir     PbRejectAll ( this, SVX_RES(PB_REJECTALL  ) ),
629*cdf0e10cSrcweir 	PbUndo		( this, SVX_RES(PB_UNDO  ) ),
630*cdf0e10cSrcweir 	aTitle1		( SVX_RES( STR_TITLE1 ) ),		// lokale Resource
631*cdf0e10cSrcweir 	aTitle2		( SVX_RES( STR_TITLE2 ) ),
632*cdf0e10cSrcweir 	aTitle3		( SVX_RES( STR_TITLE3 ) ),
633*cdf0e10cSrcweir 	aTitle4		( SVX_RES( STR_TITLE4 ) ),
634*cdf0e10cSrcweir 	aTitle5		( SVX_RES( STR_TITLE5 ) ),
635*cdf0e10cSrcweir 	aStrMyName	( SVX_RES( STR_VIEW) )
636*cdf0e10cSrcweir {
637*cdf0e10cSrcweir 	aViewData.SetAccessibleName(String(SVX_RES(STR_TREE)));
638*cdf0e10cSrcweir 	FreeResource();
639*cdf0e10cSrcweir 
640*cdf0e10cSrcweir     aViewData.SetHelpId(HID_REDLINING_VIEW_DG_VIEW_TABLE);
641*cdf0e10cSrcweir     aViewData.SetHeaderBarHelpId(HID_REDLINING_VIEW_DG_VIEW_HEADER);
642*cdf0e10cSrcweir 
643*cdf0e10cSrcweir 	aMinSize=GetSizePixel();
644*cdf0e10cSrcweir 
645*cdf0e10cSrcweir 	Link aLink=LINK( this, SvxTPView, PbClickHdl);
646*cdf0e10cSrcweir 
647*cdf0e10cSrcweir 	PbAccept.SetClickHdl(aLink);
648*cdf0e10cSrcweir 	PbAcceptAll.SetClickHdl(aLink);
649*cdf0e10cSrcweir 	PbReject.SetClickHdl(aLink);
650*cdf0e10cSrcweir 	PbRejectAll.SetClickHdl(aLink);
651*cdf0e10cSrcweir 	PbUndo.SetClickHdl(aLink);
652*cdf0e10cSrcweir 
653*cdf0e10cSrcweir 	nDistance=PbAccept.GetSizePixel().Height()+2*MIN_DISTANCE;
654*cdf0e10cSrcweir 	aViewData.SetTabs(nStaticTabs);
655*cdf0e10cSrcweir }
656*cdf0e10cSrcweir 
657*cdf0e10cSrcweir String SvxTPView::GetMyName() const
658*cdf0e10cSrcweir {
659*cdf0e10cSrcweir 	return aStrMyName;
660*cdf0e10cSrcweir }
661*cdf0e10cSrcweir 
662*cdf0e10cSrcweir void SvxTPView::Resize()
663*cdf0e10cSrcweir {
664*cdf0e10cSrcweir 	Size aSize=GetOutputSizePixel();
665*cdf0e10cSrcweir 	Point aPos=aViewData.GetPosPixel();
666*cdf0e10cSrcweir 	aSize.Height()-=aPos.Y()+nDistance;
667*cdf0e10cSrcweir 	aSize.Width()-=2*aPos.X();
668*cdf0e10cSrcweir 
669*cdf0e10cSrcweir 	long newY=aPos.Y()+aSize.Height()+MIN_DISTANCE;
670*cdf0e10cSrcweir 	aPos=PbAccept.GetPosPixel();
671*cdf0e10cSrcweir 	aPos.Y()=newY;
672*cdf0e10cSrcweir 	PbAccept.SetPosPixel(aPos);
673*cdf0e10cSrcweir 	aPos=PbAcceptAll.GetPosPixel();
674*cdf0e10cSrcweir 	aPos.Y()=newY;
675*cdf0e10cSrcweir 	PbAcceptAll.SetPosPixel(aPos);
676*cdf0e10cSrcweir 	aPos=PbReject.GetPosPixel();
677*cdf0e10cSrcweir 	aPos.Y()=newY;
678*cdf0e10cSrcweir 	PbReject.SetPosPixel(aPos);
679*cdf0e10cSrcweir 	aPos=PbRejectAll.GetPosPixel();
680*cdf0e10cSrcweir 	aPos.Y()=newY;
681*cdf0e10cSrcweir 	PbRejectAll.SetPosPixel(aPos);
682*cdf0e10cSrcweir 
683*cdf0e10cSrcweir 	if(PbUndo.IsVisible())
684*cdf0e10cSrcweir 	{
685*cdf0e10cSrcweir 		aPos=PbUndo.GetPosPixel();
686*cdf0e10cSrcweir 		aPos.Y()=newY;
687*cdf0e10cSrcweir 		PbUndo.SetPosPixel(aPos);
688*cdf0e10cSrcweir 	}
689*cdf0e10cSrcweir 	aViewData.SetSizePixel(aSize);
690*cdf0e10cSrcweir }
691*cdf0e10cSrcweir 
692*cdf0e10cSrcweir void SvxTPView::InsertWriterHeader()
693*cdf0e10cSrcweir {
694*cdf0e10cSrcweir 	String aStrTab(sal_Unicode('\t'));
695*cdf0e10cSrcweir 	String aString(aTitle1);
696*cdf0e10cSrcweir 	aString+=aStrTab;
697*cdf0e10cSrcweir 	aString+=aTitle3;
698*cdf0e10cSrcweir 	aString+=aStrTab;
699*cdf0e10cSrcweir 	aString+=aTitle4;
700*cdf0e10cSrcweir 	aString+=aStrTab;
701*cdf0e10cSrcweir 	aString+=aTitle5;
702*cdf0e10cSrcweir 	aViewData.ClearHeader();
703*cdf0e10cSrcweir 	aViewData.InsertHeaderEntry(aString);
704*cdf0e10cSrcweir }
705*cdf0e10cSrcweir 
706*cdf0e10cSrcweir void SvxTPView::InsertCalcHeader()
707*cdf0e10cSrcweir {
708*cdf0e10cSrcweir 	String aStrTab(sal_Unicode('\t'));
709*cdf0e10cSrcweir 	String aString(aTitle1);
710*cdf0e10cSrcweir 	aString+=aStrTab;
711*cdf0e10cSrcweir 	aString+=aTitle2;
712*cdf0e10cSrcweir 	aString+=aStrTab;
713*cdf0e10cSrcweir 	aString+=aTitle3;
714*cdf0e10cSrcweir 	aString+=aStrTab;
715*cdf0e10cSrcweir 	aString+=aTitle4;
716*cdf0e10cSrcweir 	aString+=aStrTab;
717*cdf0e10cSrcweir 	aString+=aTitle5;
718*cdf0e10cSrcweir 	aViewData.ClearHeader();
719*cdf0e10cSrcweir 	aViewData.InsertHeaderEntry(aString);
720*cdf0e10cSrcweir }
721*cdf0e10cSrcweir 
722*cdf0e10cSrcweir void SvxTPView::EnableAccept(sal_Bool nFlag)
723*cdf0e10cSrcweir {
724*cdf0e10cSrcweir 	PbAccept.Enable(nFlag);
725*cdf0e10cSrcweir }
726*cdf0e10cSrcweir 
727*cdf0e10cSrcweir void SvxTPView::EnableAcceptAll(sal_Bool nFlag)
728*cdf0e10cSrcweir {
729*cdf0e10cSrcweir 	PbAcceptAll.Enable(nFlag);
730*cdf0e10cSrcweir }
731*cdf0e10cSrcweir 
732*cdf0e10cSrcweir void SvxTPView::EnableReject(sal_Bool nFlag)
733*cdf0e10cSrcweir {
734*cdf0e10cSrcweir 	PbReject.Enable(nFlag);
735*cdf0e10cSrcweir }
736*cdf0e10cSrcweir 
737*cdf0e10cSrcweir void SvxTPView::EnableRejectAll(sal_Bool nFlag)
738*cdf0e10cSrcweir {
739*cdf0e10cSrcweir 	PbRejectAll.Enable(nFlag);
740*cdf0e10cSrcweir }
741*cdf0e10cSrcweir 
742*cdf0e10cSrcweir void SvxTPView::ShowUndo(sal_Bool nFlag)
743*cdf0e10cSrcweir {
744*cdf0e10cSrcweir 	PbUndo.Show(nFlag);
745*cdf0e10cSrcweir }
746*cdf0e10cSrcweir 
747*cdf0e10cSrcweir void SvxTPView::EnableUndo(sal_Bool nFlag)
748*cdf0e10cSrcweir {
749*cdf0e10cSrcweir 	PbUndo.Enable(nFlag);
750*cdf0e10cSrcweir }
751*cdf0e10cSrcweir 
752*cdf0e10cSrcweir Size SvxTPView::GetMinSizePixel()
753*cdf0e10cSrcweir {
754*cdf0e10cSrcweir 	Size aSize=aMinSize;
755*cdf0e10cSrcweir 	if(PbUndo.IsVisible())
756*cdf0e10cSrcweir 	{
757*cdf0e10cSrcweir 		sal_uIntPtr nSize=PbUndo.GetSizePixel().Width()
758*cdf0e10cSrcweir 					+PbUndo.GetPosPixel().X()
759*cdf0e10cSrcweir 					+PbAccept.GetPosPixel().X();
760*cdf0e10cSrcweir 
761*cdf0e10cSrcweir 		aSize.Width()=nSize;
762*cdf0e10cSrcweir 	}
763*cdf0e10cSrcweir 
764*cdf0e10cSrcweir 	return aSize;
765*cdf0e10cSrcweir }
766*cdf0e10cSrcweir 
767*cdf0e10cSrcweir 
768*cdf0e10cSrcweir SvxRedlinTable* SvxTPView::GetTableControl()
769*cdf0e10cSrcweir {
770*cdf0e10cSrcweir 	return &aViewData;
771*cdf0e10cSrcweir }
772*cdf0e10cSrcweir 
773*cdf0e10cSrcweir IMPL_LINK( SvxTPView, PbClickHdl, PushButton*, pPushB )
774*cdf0e10cSrcweir {
775*cdf0e10cSrcweir 	if(pPushB==&PbAccept)
776*cdf0e10cSrcweir 	{
777*cdf0e10cSrcweir 		AcceptClickLk.Call(this);
778*cdf0e10cSrcweir 	}
779*cdf0e10cSrcweir 	else if(pPushB==&PbAcceptAll)
780*cdf0e10cSrcweir 	{
781*cdf0e10cSrcweir 		AcceptAllClickLk.Call(this);
782*cdf0e10cSrcweir 	}
783*cdf0e10cSrcweir 	else if(pPushB==&PbReject)
784*cdf0e10cSrcweir 	{
785*cdf0e10cSrcweir 		RejectClickLk.Call(this);
786*cdf0e10cSrcweir 	}
787*cdf0e10cSrcweir 	else if(pPushB==&PbRejectAll)
788*cdf0e10cSrcweir 	{
789*cdf0e10cSrcweir 		RejectAllClickLk.Call(this);
790*cdf0e10cSrcweir 	}
791*cdf0e10cSrcweir 	else if(pPushB==&PbUndo)
792*cdf0e10cSrcweir 	{
793*cdf0e10cSrcweir 		UndoClickLk.Call(this);
794*cdf0e10cSrcweir 	}
795*cdf0e10cSrcweir 
796*cdf0e10cSrcweir 	return 0;
797*cdf0e10cSrcweir }
798*cdf0e10cSrcweir 
799*cdf0e10cSrcweir 
800*cdf0e10cSrcweir 
801*cdf0e10cSrcweir 
802*cdf0e10cSrcweir //============================================================================
803*cdf0e10cSrcweir //	class SvxTPFilter
804*cdf0e10cSrcweir //----------------------------------------------------------------------------
805*cdf0e10cSrcweir 
806*cdf0e10cSrcweir SvxTPFilter::SvxTPFilter( Window * pParent)
807*cdf0e10cSrcweir 	: TabPage( pParent, SVX_RES(SID_REDLIN_FILTER_PAGE)),
808*cdf0e10cSrcweir     pRedlinTable(NULL),
809*cdf0e10cSrcweir     aCbDate     ( this, SVX_RES( CB_DATE ) ),
810*cdf0e10cSrcweir 	aLbDate		( this, SVX_RES( LB_DATE ) ),
811*cdf0e10cSrcweir 	aDfDate		( this, SVX_RES( DF_DATE ) ),
812*cdf0e10cSrcweir 	aTfDate		( this, SVX_RES( TF_DATE ) ),
813*cdf0e10cSrcweir 	aIbClock 	( this, SVX_RES( IB_CLOCK ) ),
814*cdf0e10cSrcweir 	aFtDate2	( this, SVX_RES( FT_DATE2 ) ),
815*cdf0e10cSrcweir 	aDfDate2	( this, SVX_RES( DF_DATE2 ) ),
816*cdf0e10cSrcweir 	aTfDate2	( this, SVX_RES( TF_DATE2 ) ),
817*cdf0e10cSrcweir 	aIbClock2 	( this, SVX_RES( IB_CLOCK2) ),
818*cdf0e10cSrcweir 	aCbAuthor	( this, SVX_RES( CB_AUTOR ) ),
819*cdf0e10cSrcweir 	aLbAuthor	( this, SVX_RES( LB_AUTOR ) ),
820*cdf0e10cSrcweir 	aCbRange 	( this, SVX_RES( CB_RANGE ) ),
821*cdf0e10cSrcweir 	aEdRange 	( this, SVX_RES( ED_RANGE ) ),
822*cdf0e10cSrcweir 	aBtnRange 	( this, SVX_RES( BTN_REF ) ),
823*cdf0e10cSrcweir 	aLbAction	( this, SVX_RES( LB_ACTION ) ),
824*cdf0e10cSrcweir 	aCbComment	( this, SVX_RES( CB_COMMENT) ),
825*cdf0e10cSrcweir 	aEdComment	( this, SVX_RES( ED_COMMENT) ),
826*cdf0e10cSrcweir     aActionStr  (       SVX_RES( STR_ACTION) ),
827*cdf0e10cSrcweir     aStrMyName  (       SVX_RES( STR_FILTER) ),
828*cdf0e10cSrcweir     bModified   (sal_False)
829*cdf0e10cSrcweir {
830*cdf0e10cSrcweir     aLbDate.SetAccessibleName( String( SVX_RES( STR_DATE_COMBOX) ) );
831*cdf0e10cSrcweir     aDfDate.SetAccessibleName( String( SVX_RES( STR_DATE_SPIN) ) );
832*cdf0e10cSrcweir     aTfDate.SetAccessibleName( String( SVX_RES( STR_DATE_TIME_SPIN) ) );
833*cdf0e10cSrcweir     aDfDate2.SetAccessibleName( String( SVX_RES( STR_DATE_SPIN1) ) );
834*cdf0e10cSrcweir     aTfDate2.SetAccessibleName( String( SVX_RES( STR_DATE_TIME_SPIN1) ) );
835*cdf0e10cSrcweir 	aLbAuthor.SetAccessibleName(aCbAuthor.GetText());
836*cdf0e10cSrcweir 	aLbAction.SetAccessibleName( String( SVX_RES( STR_ACTION) ) );
837*cdf0e10cSrcweir 	aEdComment.SetAccessibleName(aCbComment.GetText());
838*cdf0e10cSrcweir     Image aImgTimeHC( SVX_RES( IMG_TIME_H ) );
839*cdf0e10cSrcweir 	FreeResource();
840*cdf0e10cSrcweir 
841*cdf0e10cSrcweir     aIbClock.SetModeImage( aImgTimeHC, BMP_COLOR_HIGHCONTRAST );
842*cdf0e10cSrcweir     aIbClock2.SetModeImage( aImgTimeHC, BMP_COLOR_HIGHCONTRAST );
843*cdf0e10cSrcweir 
844*cdf0e10cSrcweir 	aDfDate.SetShowDateCentury( sal_True );
845*cdf0e10cSrcweir 	aDfDate2.SetShowDateCentury( sal_True );
846*cdf0e10cSrcweir 
847*cdf0e10cSrcweir 	aRangeStr=aCbRange.GetText();
848*cdf0e10cSrcweir 	aLbDate.SelectEntryPos(0);
849*cdf0e10cSrcweir 	aLbDate.SetSelectHdl( LINK( this, SvxTPFilter, SelDateHdl ) );
850*cdf0e10cSrcweir 	aIbClock.SetClickHdl( LINK( this, SvxTPFilter, TimeHdl) );
851*cdf0e10cSrcweir 	aIbClock2.SetClickHdl( LINK( this, SvxTPFilter,TimeHdl) );
852*cdf0e10cSrcweir 	aBtnRange.SetClickHdl( LINK( this, SvxTPFilter, RefHandle));
853*cdf0e10cSrcweir 
854*cdf0e10cSrcweir 	Link aLink=LINK( this, SvxTPFilter, RowEnableHdl) ;
855*cdf0e10cSrcweir 	aCbDate.SetClickHdl(aLink);
856*cdf0e10cSrcweir 	aCbAuthor.SetClickHdl(aLink);
857*cdf0e10cSrcweir 	aCbRange.SetClickHdl(aLink);
858*cdf0e10cSrcweir 	aCbComment.SetClickHdl(aLink);
859*cdf0e10cSrcweir 
860*cdf0e10cSrcweir 	Link a2Link=LINK( this, SvxTPFilter, ModifyDate);
861*cdf0e10cSrcweir 	aDfDate.SetModifyHdl(a2Link);
862*cdf0e10cSrcweir 	aTfDate.SetModifyHdl(a2Link);
863*cdf0e10cSrcweir 	aDfDate2.SetModifyHdl(a2Link);
864*cdf0e10cSrcweir 	aTfDate2.SetModifyHdl(a2Link);
865*cdf0e10cSrcweir 
866*cdf0e10cSrcweir 	Link a3Link=LINK( this, SvxTPFilter, ModifyHdl);
867*cdf0e10cSrcweir 	aEdRange.SetModifyHdl(a3Link);
868*cdf0e10cSrcweir 	aEdComment.SetModifyHdl(a3Link);
869*cdf0e10cSrcweir 	aLbAction.SetSelectHdl(a3Link);
870*cdf0e10cSrcweir 	aLbAuthor.SetSelectHdl(a3Link);
871*cdf0e10cSrcweir 
872*cdf0e10cSrcweir 	RowEnableHdl(&aCbDate);
873*cdf0e10cSrcweir 	RowEnableHdl(&aCbAuthor);
874*cdf0e10cSrcweir 	RowEnableHdl(&aCbRange);
875*cdf0e10cSrcweir 	RowEnableHdl(&aCbComment);
876*cdf0e10cSrcweir 
877*cdf0e10cSrcweir 	Date aDate;
878*cdf0e10cSrcweir 	Time aTime;
879*cdf0e10cSrcweir 	aDfDate.SetDate(aDate);
880*cdf0e10cSrcweir 	aTfDate.SetTime(aTime);
881*cdf0e10cSrcweir 	aDfDate2.SetDate(aDate);
882*cdf0e10cSrcweir 	aTfDate2.SetTime(aTime);
883*cdf0e10cSrcweir 	HideRange();
884*cdf0e10cSrcweir 	ShowAction();
885*cdf0e10cSrcweir 	bModified=sal_False;
886*cdf0e10cSrcweir 
887*cdf0e10cSrcweir 	aLbDate.SetAccessibleRelationLabeledBy(&aCbDate);
888*cdf0e10cSrcweir 	aLbAuthor.SetAccessibleRelationLabeledBy(&aCbAuthor);
889*cdf0e10cSrcweir 	aLbAction.SetAccessibleRelationLabeledBy(&aCbRange);
890*cdf0e10cSrcweir 	aEdRange.SetAccessibleRelationLabeledBy(&aCbRange);
891*cdf0e10cSrcweir 	aBtnRange.SetAccessibleRelationLabeledBy(&aCbRange);
892*cdf0e10cSrcweir 	aEdComment.SetAccessibleRelationLabeledBy(&aCbComment);
893*cdf0e10cSrcweir 	aDfDate2.SetAccessibleRelationLabeledBy(&aDfDate2);
894*cdf0e10cSrcweir 	aTfDate2.SetAccessibleRelationLabeledBy(&aTfDate2);
895*cdf0e10cSrcweir }
896*cdf0e10cSrcweir 
897*cdf0e10cSrcweir void SvxTPFilter::SetRedlinTable(SvxRedlinTable* pTable)
898*cdf0e10cSrcweir {
899*cdf0e10cSrcweir 	pRedlinTable=pTable;
900*cdf0e10cSrcweir }
901*cdf0e10cSrcweir 
902*cdf0e10cSrcweir String SvxTPFilter::GetMyName() const
903*cdf0e10cSrcweir {
904*cdf0e10cSrcweir 	return aStrMyName;
905*cdf0e10cSrcweir }
906*cdf0e10cSrcweir 
907*cdf0e10cSrcweir void SvxTPFilter::DisableRange(sal_Bool bFlag)
908*cdf0e10cSrcweir {
909*cdf0e10cSrcweir 	if(bFlag)
910*cdf0e10cSrcweir 	{
911*cdf0e10cSrcweir 		aCbRange.Disable();
912*cdf0e10cSrcweir 		aEdRange.Disable();
913*cdf0e10cSrcweir 		aBtnRange.Disable();
914*cdf0e10cSrcweir 	}
915*cdf0e10cSrcweir 	else
916*cdf0e10cSrcweir 	{
917*cdf0e10cSrcweir 		aCbRange.Enable();
918*cdf0e10cSrcweir 		aEdRange.Enable();
919*cdf0e10cSrcweir 		aBtnRange.Enable();
920*cdf0e10cSrcweir 	}
921*cdf0e10cSrcweir }
922*cdf0e10cSrcweir 
923*cdf0e10cSrcweir void SvxTPFilter::ShowDateFields(sal_uInt16 nKind)
924*cdf0e10cSrcweir {
925*cdf0e10cSrcweir 	String aEmpty;
926*cdf0e10cSrcweir 	switch(nKind)
927*cdf0e10cSrcweir 	{
928*cdf0e10cSrcweir 		case FLT_DATE_BEFORE:
929*cdf0e10cSrcweir 				EnableDateLine1(sal_True);
930*cdf0e10cSrcweir 				EnableDateLine2(sal_False);
931*cdf0e10cSrcweir 				break;
932*cdf0e10cSrcweir 		case FLT_DATE_SINCE:
933*cdf0e10cSrcweir 				EnableDateLine1(sal_True);
934*cdf0e10cSrcweir 				EnableDateLine2(sal_False);
935*cdf0e10cSrcweir 				break;
936*cdf0e10cSrcweir 		case FLT_DATE_EQUAL:
937*cdf0e10cSrcweir 				EnableDateLine1(sal_True);
938*cdf0e10cSrcweir 				aTfDate.Disable();
939*cdf0e10cSrcweir 				aTfDate.SetText(aEmpty);
940*cdf0e10cSrcweir 				EnableDateLine2(sal_False);
941*cdf0e10cSrcweir 				break;
942*cdf0e10cSrcweir 		case FLT_DATE_NOTEQUAL:
943*cdf0e10cSrcweir 				EnableDateLine1(sal_True);
944*cdf0e10cSrcweir 				aTfDate.Disable();
945*cdf0e10cSrcweir 				aTfDate.SetText(aEmpty);
946*cdf0e10cSrcweir 				EnableDateLine2(sal_False);
947*cdf0e10cSrcweir 				break;
948*cdf0e10cSrcweir 		case FLT_DATE_BETWEEN:
949*cdf0e10cSrcweir 				EnableDateLine1(sal_True);
950*cdf0e10cSrcweir 				EnableDateLine2(sal_True);
951*cdf0e10cSrcweir 				break;
952*cdf0e10cSrcweir 		case FLT_DATE_SAVE:
953*cdf0e10cSrcweir 				EnableDateLine1(sal_False);
954*cdf0e10cSrcweir 				EnableDateLine2(sal_False);
955*cdf0e10cSrcweir 				break;
956*cdf0e10cSrcweir 	}
957*cdf0e10cSrcweir }
958*cdf0e10cSrcweir 
959*cdf0e10cSrcweir void SvxTPFilter::EnableDateLine1(sal_Bool bFlag)
960*cdf0e10cSrcweir {
961*cdf0e10cSrcweir 	if(bFlag && aCbDate.IsChecked())
962*cdf0e10cSrcweir 	{
963*cdf0e10cSrcweir 		aDfDate.Enable();
964*cdf0e10cSrcweir 		aTfDate.Enable();
965*cdf0e10cSrcweir 		aIbClock.Enable();
966*cdf0e10cSrcweir 	}
967*cdf0e10cSrcweir 	else
968*cdf0e10cSrcweir 	{
969*cdf0e10cSrcweir 		aDfDate.Disable();
970*cdf0e10cSrcweir 		aTfDate.Disable();
971*cdf0e10cSrcweir 		aIbClock.Disable();
972*cdf0e10cSrcweir 	}
973*cdf0e10cSrcweir }
974*cdf0e10cSrcweir void SvxTPFilter::EnableDateLine2(sal_Bool bFlag)
975*cdf0e10cSrcweir {
976*cdf0e10cSrcweir 	String aEmpty;
977*cdf0e10cSrcweir 	if(bFlag && aCbDate.IsChecked())
978*cdf0e10cSrcweir 	{
979*cdf0e10cSrcweir 		aFtDate2.Enable();
980*cdf0e10cSrcweir 		aDfDate2.Enable();
981*cdf0e10cSrcweir 		aTfDate2.Enable();
982*cdf0e10cSrcweir 		aIbClock2.Enable();
983*cdf0e10cSrcweir 	}
984*cdf0e10cSrcweir 	else
985*cdf0e10cSrcweir 	{
986*cdf0e10cSrcweir 		aFtDate2.Disable();
987*cdf0e10cSrcweir 		aDfDate2.Disable();
988*cdf0e10cSrcweir 		aDfDate2.SetText(aEmpty);
989*cdf0e10cSrcweir 		aTfDate2.Disable();
990*cdf0e10cSrcweir 		aTfDate2.SetText(aEmpty);
991*cdf0e10cSrcweir 		aIbClock2.Disable();
992*cdf0e10cSrcweir 	}
993*cdf0e10cSrcweir }
994*cdf0e10cSrcweir 
995*cdf0e10cSrcweir Date SvxTPFilter::GetFirstDate() const
996*cdf0e10cSrcweir {
997*cdf0e10cSrcweir 	return aDfDate.GetDate();
998*cdf0e10cSrcweir }
999*cdf0e10cSrcweir 
1000*cdf0e10cSrcweir void SvxTPFilter::SetFirstDate(const Date &aDate)
1001*cdf0e10cSrcweir {
1002*cdf0e10cSrcweir 	aDfDate.SetDate(aDate);
1003*cdf0e10cSrcweir }
1004*cdf0e10cSrcweir 
1005*cdf0e10cSrcweir Time SvxTPFilter::GetFirstTime() const
1006*cdf0e10cSrcweir {
1007*cdf0e10cSrcweir 	return aTfDate.GetTime();
1008*cdf0e10cSrcweir }
1009*cdf0e10cSrcweir 
1010*cdf0e10cSrcweir void SvxTPFilter::SetFirstTime(const Time &aTime)
1011*cdf0e10cSrcweir {
1012*cdf0e10cSrcweir 	aTfDate.SetTime(aTime);
1013*cdf0e10cSrcweir }
1014*cdf0e10cSrcweir 
1015*cdf0e10cSrcweir 
1016*cdf0e10cSrcweir Date SvxTPFilter::GetLastDate() const
1017*cdf0e10cSrcweir {
1018*cdf0e10cSrcweir 	return aDfDate2.GetDate();
1019*cdf0e10cSrcweir }
1020*cdf0e10cSrcweir 
1021*cdf0e10cSrcweir void SvxTPFilter::SetLastDate(const Date &aDate)
1022*cdf0e10cSrcweir {
1023*cdf0e10cSrcweir 	aDfDate2.SetDate(aDate);
1024*cdf0e10cSrcweir }
1025*cdf0e10cSrcweir 
1026*cdf0e10cSrcweir Time SvxTPFilter::GetLastTime() const
1027*cdf0e10cSrcweir {
1028*cdf0e10cSrcweir 	return aTfDate2.GetTime();
1029*cdf0e10cSrcweir }
1030*cdf0e10cSrcweir 
1031*cdf0e10cSrcweir void SvxTPFilter::SetLastTime(const Time &aTime)
1032*cdf0e10cSrcweir {
1033*cdf0e10cSrcweir 	aTfDate2.SetTime(aTime);
1034*cdf0e10cSrcweir }
1035*cdf0e10cSrcweir 
1036*cdf0e10cSrcweir void SvxTPFilter::SetDateMode(sal_uInt16 nMode)
1037*cdf0e10cSrcweir {
1038*cdf0e10cSrcweir 	aLbDate.SelectEntryPos(nMode);
1039*cdf0e10cSrcweir 	SelDateHdl(&aLbDate);
1040*cdf0e10cSrcweir }
1041*cdf0e10cSrcweir 
1042*cdf0e10cSrcweir sal_uInt16 SvxTPFilter::GetDateMode()
1043*cdf0e10cSrcweir {
1044*cdf0e10cSrcweir 	return (sal_uInt16) aLbDate.GetSelectEntryPos();
1045*cdf0e10cSrcweir }
1046*cdf0e10cSrcweir void SvxTPFilter::ClearAuthors()
1047*cdf0e10cSrcweir {
1048*cdf0e10cSrcweir 	aLbAuthor.Clear();
1049*cdf0e10cSrcweir }
1050*cdf0e10cSrcweir 
1051*cdf0e10cSrcweir void SvxTPFilter::InsertAuthor( const String& rString, sal_uInt16 nPos)
1052*cdf0e10cSrcweir {
1053*cdf0e10cSrcweir 	aLbAuthor.InsertEntry(rString,nPos);
1054*cdf0e10cSrcweir }
1055*cdf0e10cSrcweir 
1056*cdf0e10cSrcweir String SvxTPFilter::GetSelectedAuthor()	const
1057*cdf0e10cSrcweir {
1058*cdf0e10cSrcweir 	return aLbAuthor.GetSelectEntry();
1059*cdf0e10cSrcweir }
1060*cdf0e10cSrcweir 
1061*cdf0e10cSrcweir sal_uInt16	SvxTPFilter::GetSelectedAuthorPos()
1062*cdf0e10cSrcweir {
1063*cdf0e10cSrcweir 	return (sal_uInt16) aLbAuthor.GetSelectEntryPos();
1064*cdf0e10cSrcweir }
1065*cdf0e10cSrcweir 
1066*cdf0e10cSrcweir void SvxTPFilter::SelectedAuthorPos(sal_uInt16 nPos)
1067*cdf0e10cSrcweir {
1068*cdf0e10cSrcweir 	aLbAuthor.SelectEntryPos(nPos);
1069*cdf0e10cSrcweir }
1070*cdf0e10cSrcweir 
1071*cdf0e10cSrcweir sal_uInt16 SvxTPFilter::SelectAuthor(const String& aString)
1072*cdf0e10cSrcweir {
1073*cdf0e10cSrcweir 	aLbAuthor.SelectEntry(aString);
1074*cdf0e10cSrcweir 	return aLbAuthor.GetSelectEntryPos();
1075*cdf0e10cSrcweir }
1076*cdf0e10cSrcweir 
1077*cdf0e10cSrcweir void SvxTPFilter::SetRange(const String& rString)
1078*cdf0e10cSrcweir {
1079*cdf0e10cSrcweir 	aEdRange.SetText(rString);
1080*cdf0e10cSrcweir }
1081*cdf0e10cSrcweir 
1082*cdf0e10cSrcweir String SvxTPFilter::GetRange() const
1083*cdf0e10cSrcweir {
1084*cdf0e10cSrcweir 	return aEdRange.GetText();
1085*cdf0e10cSrcweir }
1086*cdf0e10cSrcweir 
1087*cdf0e10cSrcweir void SvxTPFilter::SetFocusToRange()
1088*cdf0e10cSrcweir {
1089*cdf0e10cSrcweir 	aEdRange.GrabFocus();
1090*cdf0e10cSrcweir }
1091*cdf0e10cSrcweir 
1092*cdf0e10cSrcweir void SvxTPFilter::HideRange(sal_Bool bHide)
1093*cdf0e10cSrcweir {
1094*cdf0e10cSrcweir 	if(bHide)
1095*cdf0e10cSrcweir 	{
1096*cdf0e10cSrcweir 		aCbRange.Hide();
1097*cdf0e10cSrcweir 		aEdRange.Hide();
1098*cdf0e10cSrcweir 		aBtnRange.Hide();
1099*cdf0e10cSrcweir 	}
1100*cdf0e10cSrcweir 	else
1101*cdf0e10cSrcweir 	{
1102*cdf0e10cSrcweir 		ShowAction(sal_False);
1103*cdf0e10cSrcweir 		aCbRange.SetText(aRangeStr);
1104*cdf0e10cSrcweir 		aCbRange.Show();
1105*cdf0e10cSrcweir 		aEdRange.Show();
1106*cdf0e10cSrcweir 		aBtnRange.Show();
1107*cdf0e10cSrcweir 	}
1108*cdf0e10cSrcweir }
1109*cdf0e10cSrcweir 
1110*cdf0e10cSrcweir void SvxTPFilter::HideClocks(sal_Bool bHide)
1111*cdf0e10cSrcweir {
1112*cdf0e10cSrcweir 	if(bHide)
1113*cdf0e10cSrcweir 	{
1114*cdf0e10cSrcweir 		aIbClock. Hide();
1115*cdf0e10cSrcweir 		aIbClock2.Hide();
1116*cdf0e10cSrcweir 	}
1117*cdf0e10cSrcweir 	else
1118*cdf0e10cSrcweir 	{
1119*cdf0e10cSrcweir 		aIbClock. Show();
1120*cdf0e10cSrcweir 		aIbClock2.Show();
1121*cdf0e10cSrcweir 	}
1122*cdf0e10cSrcweir }
1123*cdf0e10cSrcweir 
1124*cdf0e10cSrcweir void SvxTPFilter::SetComment(const String &rComment)
1125*cdf0e10cSrcweir {
1126*cdf0e10cSrcweir 	aEdComment.SetText(rComment);
1127*cdf0e10cSrcweir }
1128*cdf0e10cSrcweir String SvxTPFilter::GetComment()const
1129*cdf0e10cSrcweir {
1130*cdf0e10cSrcweir 	return aEdComment.GetText();
1131*cdf0e10cSrcweir }
1132*cdf0e10cSrcweir 
1133*cdf0e10cSrcweir sal_Bool SvxTPFilter::IsDate()
1134*cdf0e10cSrcweir {
1135*cdf0e10cSrcweir 	return aCbDate.IsChecked();
1136*cdf0e10cSrcweir }
1137*cdf0e10cSrcweir 
1138*cdf0e10cSrcweir sal_Bool SvxTPFilter::IsAuthor()
1139*cdf0e10cSrcweir {
1140*cdf0e10cSrcweir 	return aCbAuthor.IsChecked();
1141*cdf0e10cSrcweir }
1142*cdf0e10cSrcweir 
1143*cdf0e10cSrcweir sal_Bool SvxTPFilter::IsRange()
1144*cdf0e10cSrcweir {
1145*cdf0e10cSrcweir 	return aCbRange.IsChecked();
1146*cdf0e10cSrcweir }
1147*cdf0e10cSrcweir sal_Bool SvxTPFilter::IsAction()
1148*cdf0e10cSrcweir {
1149*cdf0e10cSrcweir 	return aCbRange.IsChecked();
1150*cdf0e10cSrcweir }
1151*cdf0e10cSrcweir 
1152*cdf0e10cSrcweir sal_Bool SvxTPFilter::IsComment()
1153*cdf0e10cSrcweir {
1154*cdf0e10cSrcweir 	return aCbComment.IsChecked();
1155*cdf0e10cSrcweir }
1156*cdf0e10cSrcweir 
1157*cdf0e10cSrcweir void SvxTPFilter::CheckDate(sal_Bool bFlag)
1158*cdf0e10cSrcweir {
1159*cdf0e10cSrcweir 	aCbDate.Check(bFlag);
1160*cdf0e10cSrcweir 	RowEnableHdl(&aCbDate);
1161*cdf0e10cSrcweir 	bModified=sal_False;
1162*cdf0e10cSrcweir }
1163*cdf0e10cSrcweir 
1164*cdf0e10cSrcweir void SvxTPFilter::CheckAuthor(sal_Bool bFlag)
1165*cdf0e10cSrcweir {
1166*cdf0e10cSrcweir 	aCbAuthor.Check(bFlag);
1167*cdf0e10cSrcweir 	RowEnableHdl(&aCbAuthor);
1168*cdf0e10cSrcweir 	bModified=sal_False;
1169*cdf0e10cSrcweir }
1170*cdf0e10cSrcweir 
1171*cdf0e10cSrcweir void SvxTPFilter::CheckRange(sal_Bool bFlag)
1172*cdf0e10cSrcweir {
1173*cdf0e10cSrcweir 	aCbRange.Check(bFlag);
1174*cdf0e10cSrcweir 	RowEnableHdl(&aCbRange);
1175*cdf0e10cSrcweir 	bModified=sal_False;
1176*cdf0e10cSrcweir }
1177*cdf0e10cSrcweir 
1178*cdf0e10cSrcweir void SvxTPFilter::CheckAction(sal_Bool bFlag)
1179*cdf0e10cSrcweir {
1180*cdf0e10cSrcweir 	aCbRange.Check(bFlag);
1181*cdf0e10cSrcweir 	RowEnableHdl(&aCbRange);
1182*cdf0e10cSrcweir 	bModified=sal_False;
1183*cdf0e10cSrcweir }
1184*cdf0e10cSrcweir 
1185*cdf0e10cSrcweir void SvxTPFilter::CheckComment(sal_Bool bFlag)
1186*cdf0e10cSrcweir {
1187*cdf0e10cSrcweir 	aCbComment.Check(bFlag);
1188*cdf0e10cSrcweir 	RowEnableHdl(&aCbComment);
1189*cdf0e10cSrcweir 	bModified=sal_False;
1190*cdf0e10cSrcweir }
1191*cdf0e10cSrcweir 
1192*cdf0e10cSrcweir void SvxTPFilter::ShowAction(sal_Bool bShow)
1193*cdf0e10cSrcweir {
1194*cdf0e10cSrcweir 	if(!bShow)
1195*cdf0e10cSrcweir 	{
1196*cdf0e10cSrcweir 		aCbRange.Hide();
1197*cdf0e10cSrcweir 		aLbAction.Hide();
1198*cdf0e10cSrcweir 		aCbRange.SetHelpId(HID_REDLINING_FILTER_CB_RANGE);
1199*cdf0e10cSrcweir 	}
1200*cdf0e10cSrcweir 	else
1201*cdf0e10cSrcweir 	{
1202*cdf0e10cSrcweir 		HideRange();
1203*cdf0e10cSrcweir 		aCbRange.SetText(aActionStr);
1204*cdf0e10cSrcweir 		aCbRange.SetHelpId(HID_REDLINING_FILTER_CB_ACTION);
1205*cdf0e10cSrcweir 		aCbRange.Show();
1206*cdf0e10cSrcweir 		aLbAction.Show();
1207*cdf0e10cSrcweir 
1208*cdf0e10cSrcweir 	}
1209*cdf0e10cSrcweir }
1210*cdf0e10cSrcweir 
1211*cdf0e10cSrcweir ListBox* SvxTPFilter::GetLbAction()
1212*cdf0e10cSrcweir {
1213*cdf0e10cSrcweir 	return &aLbAction;
1214*cdf0e10cSrcweir }
1215*cdf0e10cSrcweir 
1216*cdf0e10cSrcweir IMPL_LINK( SvxTPFilter, SelDateHdl, ListBox*, pLb )
1217*cdf0e10cSrcweir {
1218*cdf0e10cSrcweir 	ShowDateFields((sal_uInt16)aLbDate.GetSelectEntryPos());
1219*cdf0e10cSrcweir 	ModifyHdl(pLb);
1220*cdf0e10cSrcweir 	return 0;
1221*cdf0e10cSrcweir }
1222*cdf0e10cSrcweir 
1223*cdf0e10cSrcweir IMPL_LINK( SvxTPFilter, RowEnableHdl, CheckBox*, pCB )
1224*cdf0e10cSrcweir {
1225*cdf0e10cSrcweir 	if(pCB==&aCbDate)
1226*cdf0e10cSrcweir 	{
1227*cdf0e10cSrcweir 		aLbDate.Enable(aCbDate.IsChecked());
1228*cdf0e10cSrcweir 		aLbDate.Invalidate();
1229*cdf0e10cSrcweir 		EnableDateLine1(sal_False);
1230*cdf0e10cSrcweir 		EnableDateLine2(sal_False);
1231*cdf0e10cSrcweir 		if(aCbDate.IsChecked()) SelDateHdl(&aLbDate);
1232*cdf0e10cSrcweir 	}
1233*cdf0e10cSrcweir 	else if(pCB==&aCbAuthor)
1234*cdf0e10cSrcweir 	{
1235*cdf0e10cSrcweir 		aLbAuthor.Enable(aCbAuthor.IsChecked());
1236*cdf0e10cSrcweir 		aLbAuthor.Invalidate();
1237*cdf0e10cSrcweir 	}
1238*cdf0e10cSrcweir 	else if(pCB==&aCbRange)
1239*cdf0e10cSrcweir 	{
1240*cdf0e10cSrcweir 		aLbAction.Enable(aCbRange.IsChecked());
1241*cdf0e10cSrcweir 		aLbAction.Invalidate();
1242*cdf0e10cSrcweir 		aEdRange.Enable(aCbRange.IsChecked());
1243*cdf0e10cSrcweir 		aBtnRange.Enable(aCbRange.IsChecked());
1244*cdf0e10cSrcweir 	}
1245*cdf0e10cSrcweir 	else if(pCB==&aCbComment)
1246*cdf0e10cSrcweir 	{
1247*cdf0e10cSrcweir 		aEdComment.Enable(aCbComment.IsChecked());
1248*cdf0e10cSrcweir 		aEdComment.Invalidate();
1249*cdf0e10cSrcweir 	}
1250*cdf0e10cSrcweir 
1251*cdf0e10cSrcweir 	ModifyHdl(pCB);
1252*cdf0e10cSrcweir 	return 0;
1253*cdf0e10cSrcweir }
1254*cdf0e10cSrcweir 
1255*cdf0e10cSrcweir IMPL_LINK( SvxTPFilter, TimeHdl, ImageButton*,pIB )
1256*cdf0e10cSrcweir {
1257*cdf0e10cSrcweir 	Date aDate;
1258*cdf0e10cSrcweir 	Time aTime;
1259*cdf0e10cSrcweir 	if(pIB==&aIbClock)
1260*cdf0e10cSrcweir 	{
1261*cdf0e10cSrcweir 		aDfDate.SetDate(aDate);
1262*cdf0e10cSrcweir 		aTfDate.SetTime(aTime);
1263*cdf0e10cSrcweir 	}
1264*cdf0e10cSrcweir 	else if(pIB==&aIbClock2)
1265*cdf0e10cSrcweir 	{
1266*cdf0e10cSrcweir 		aDfDate2.SetDate(aDate);
1267*cdf0e10cSrcweir 		aTfDate2.SetTime(aTime);
1268*cdf0e10cSrcweir 	}
1269*cdf0e10cSrcweir 	ModifyHdl(&aDfDate);
1270*cdf0e10cSrcweir 	return 0;
1271*cdf0e10cSrcweir }
1272*cdf0e10cSrcweir 
1273*cdf0e10cSrcweir IMPL_LINK( SvxTPFilter, ModifyHdl, void*, pCtr)
1274*cdf0e10cSrcweir {
1275*cdf0e10cSrcweir 	if(pCtr!=NULL)
1276*cdf0e10cSrcweir 	{
1277*cdf0e10cSrcweir 		if(pCtr==&aCbDate  || pCtr==&aLbDate ||
1278*cdf0e10cSrcweir 		   pCtr==&aDfDate  || pCtr==&aTfDate ||
1279*cdf0e10cSrcweir 		   pCtr==&aIbClock || pCtr==&aFtDate2||
1280*cdf0e10cSrcweir 		   pCtr==&aDfDate2 || pCtr==&aTfDate2||
1281*cdf0e10cSrcweir 		   pCtr==&aIbClock2)
1282*cdf0e10cSrcweir 		{
1283*cdf0e10cSrcweir 			aModifyDateLink.Call(this);
1284*cdf0e10cSrcweir 		}
1285*cdf0e10cSrcweir 		else if(pCtr==&aCbAuthor || pCtr==&aLbAuthor)
1286*cdf0e10cSrcweir 		{
1287*cdf0e10cSrcweir 			aModifyAuthorLink.Call(this);
1288*cdf0e10cSrcweir 		}
1289*cdf0e10cSrcweir 		else if(pCtr==&aCbRange  || pCtr==&aEdRange ||
1290*cdf0e10cSrcweir 				pCtr==&aBtnRange )
1291*cdf0e10cSrcweir 		{
1292*cdf0e10cSrcweir 			aModifyRefLink.Call(this);
1293*cdf0e10cSrcweir 		}
1294*cdf0e10cSrcweir 		else if(pCtr==&aCbComment || pCtr==&aEdComment)
1295*cdf0e10cSrcweir 		{
1296*cdf0e10cSrcweir 			aModifyComLink.Call(this);
1297*cdf0e10cSrcweir 		}
1298*cdf0e10cSrcweir 
1299*cdf0e10cSrcweir 		bModified=sal_True;
1300*cdf0e10cSrcweir 		aModifyLink.Call(this);
1301*cdf0e10cSrcweir 	}
1302*cdf0e10cSrcweir 	return 0;
1303*cdf0e10cSrcweir }
1304*cdf0e10cSrcweir 
1305*cdf0e10cSrcweir void SvxTPFilter::DeactivatePage()
1306*cdf0e10cSrcweir {
1307*cdf0e10cSrcweir 	if(bModified)
1308*cdf0e10cSrcweir 	{
1309*cdf0e10cSrcweir 		if(pRedlinTable!=NULL)
1310*cdf0e10cSrcweir 		{
1311*cdf0e10cSrcweir 			pRedlinTable->SetFilterDate(IsDate());
1312*cdf0e10cSrcweir 			pRedlinTable->SetDateTimeMode(GetDateMode());
1313*cdf0e10cSrcweir 			pRedlinTable->SetFirstDate(aDfDate.GetDate());
1314*cdf0e10cSrcweir 			pRedlinTable->SetLastDate(aDfDate2.GetDate());
1315*cdf0e10cSrcweir 			pRedlinTable->SetFirstTime(aTfDate.GetTime());
1316*cdf0e10cSrcweir 			pRedlinTable->SetLastTime(aTfDate2.GetTime());
1317*cdf0e10cSrcweir 			pRedlinTable->SetFilterAuthor(IsAuthor());
1318*cdf0e10cSrcweir 			pRedlinTable->SetAuthor(GetSelectedAuthor());
1319*cdf0e10cSrcweir 
1320*cdf0e10cSrcweir 			pRedlinTable->SetFilterComment(IsComment());
1321*cdf0e10cSrcweir 
1322*cdf0e10cSrcweir 			utl::SearchParam aSearchParam( aEdComment.GetText(),
1323*cdf0e10cSrcweir 					utl::SearchParam::SRCH_REGEXP,sal_False,sal_False,sal_False );
1324*cdf0e10cSrcweir 
1325*cdf0e10cSrcweir 			pRedlinTable->SetCommentParams(&aSearchParam);
1326*cdf0e10cSrcweir 
1327*cdf0e10cSrcweir 			pRedlinTable->UpdateFilterTest();
1328*cdf0e10cSrcweir 		}
1329*cdf0e10cSrcweir 
1330*cdf0e10cSrcweir 		aReadyLink.Call(this);
1331*cdf0e10cSrcweir 	}
1332*cdf0e10cSrcweir 	bModified=sal_False;
1333*cdf0e10cSrcweir 	TabPage::DeactivatePage();
1334*cdf0e10cSrcweir }
1335*cdf0e10cSrcweir 
1336*cdf0e10cSrcweir void SvxTPFilter::Enable( bool bEnable, bool bChild)
1337*cdf0e10cSrcweir {
1338*cdf0e10cSrcweir 	TabPage::Enable(bEnable,bChild);
1339*cdf0e10cSrcweir 	if(aCbDate.IsEnabled())
1340*cdf0e10cSrcweir 	{
1341*cdf0e10cSrcweir 		RowEnableHdl(&aCbDate);
1342*cdf0e10cSrcweir 		RowEnableHdl(&aCbAuthor);
1343*cdf0e10cSrcweir 		RowEnableHdl(&aCbRange);
1344*cdf0e10cSrcweir 		RowEnableHdl(&aCbComment);
1345*cdf0e10cSrcweir 	}
1346*cdf0e10cSrcweir }
1347*cdf0e10cSrcweir void SvxTPFilter::Disable( bool bChild)
1348*cdf0e10cSrcweir {
1349*cdf0e10cSrcweir 	Enable( false, bChild );
1350*cdf0e10cSrcweir }
1351*cdf0e10cSrcweir 
1352*cdf0e10cSrcweir IMPL_LINK( SvxTPFilter, ModifyDate, void*,pTF)
1353*cdf0e10cSrcweir {
1354*cdf0e10cSrcweir 
1355*cdf0e10cSrcweir 	Date aDate;
1356*cdf0e10cSrcweir 	Time aTime(0);
1357*cdf0e10cSrcweir 	if(&aDfDate==pTF)
1358*cdf0e10cSrcweir 	{
1359*cdf0e10cSrcweir 		if(aDfDate.GetText().Len()==0)
1360*cdf0e10cSrcweir 		   aDfDate.SetDate(aDate);
1361*cdf0e10cSrcweir 
1362*cdf0e10cSrcweir 		if(pRedlinTable!=NULL)
1363*cdf0e10cSrcweir 			pRedlinTable->SetFirstDate(aDfDate.GetDate());
1364*cdf0e10cSrcweir 	}
1365*cdf0e10cSrcweir 	else if(&aDfDate2==pTF)
1366*cdf0e10cSrcweir 	{
1367*cdf0e10cSrcweir 		if(aDfDate2.GetText().Len()==0)
1368*cdf0e10cSrcweir 		   aDfDate2.SetDate(aDate);
1369*cdf0e10cSrcweir 
1370*cdf0e10cSrcweir 		if(pRedlinTable!=NULL)
1371*cdf0e10cSrcweir 			pRedlinTable->SetLastDate(aDfDate2.GetDate());
1372*cdf0e10cSrcweir 	}
1373*cdf0e10cSrcweir 	else if(&aTfDate==pTF)
1374*cdf0e10cSrcweir 	{
1375*cdf0e10cSrcweir 		if(aTfDate.GetText().Len()==0)
1376*cdf0e10cSrcweir 		   aTfDate.SetTime(aTime);
1377*cdf0e10cSrcweir 
1378*cdf0e10cSrcweir 		if(pRedlinTable!=NULL)
1379*cdf0e10cSrcweir 			pRedlinTable->SetFirstTime(aTfDate.GetTime());
1380*cdf0e10cSrcweir 	}
1381*cdf0e10cSrcweir 	else if(&aTfDate2==pTF)
1382*cdf0e10cSrcweir 	{
1383*cdf0e10cSrcweir 		if(aTfDate2.GetText().Len()==0)
1384*cdf0e10cSrcweir 		   aTfDate2.SetTime(aTime);
1385*cdf0e10cSrcweir 
1386*cdf0e10cSrcweir 		if(pRedlinTable!=NULL)
1387*cdf0e10cSrcweir 			pRedlinTable->SetLastTime(aTfDate2.GetTime());
1388*cdf0e10cSrcweir 
1389*cdf0e10cSrcweir 	}
1390*cdf0e10cSrcweir 	ModifyHdl(&aDfDate);
1391*cdf0e10cSrcweir 	return 0;
1392*cdf0e10cSrcweir }
1393*cdf0e10cSrcweir 
1394*cdf0e10cSrcweir IMPL_LINK( SvxTPFilter, RefHandle, PushButton*, pRef )
1395*cdf0e10cSrcweir {
1396*cdf0e10cSrcweir 	if(pRef!=NULL)
1397*cdf0e10cSrcweir 	{
1398*cdf0e10cSrcweir 		aRefLink.Call(this);
1399*cdf0e10cSrcweir 	}
1400*cdf0e10cSrcweir 	return 0;
1401*cdf0e10cSrcweir }
1402*cdf0e10cSrcweir 
1403*cdf0e10cSrcweir static Size gDiffSize;
1404*cdf0e10cSrcweir //============================================================================
1405*cdf0e10cSrcweir //	class SvxAcceptChgCtr
1406*cdf0e10cSrcweir //----------------------------------------------------------------------------
1407*cdf0e10cSrcweir 
1408*cdf0e10cSrcweir SvxAcceptChgCtr::SvxAcceptChgCtr( Window* pParent, WinBits nWinStyle)
1409*cdf0e10cSrcweir 		:	Control(pParent,nWinStyle |WB_DIALOGCONTROL),
1410*cdf0e10cSrcweir 			aTCAccept(this,WB_TABSTOP |WB_DIALOGCONTROL)
1411*cdf0e10cSrcweir {
1412*cdf0e10cSrcweir 	pTPFilter=new SvxTPFilter(&aTCAccept);
1413*cdf0e10cSrcweir 	pTPView=new SvxTPView(&aTCAccept);
1414*cdf0e10cSrcweir 	aMinSize=pTPView->GetMinSizePixel();
1415*cdf0e10cSrcweir 
1416*cdf0e10cSrcweir 	aTCAccept.InsertPage( TP_VIEW,	 pTPView->GetMyName());
1417*cdf0e10cSrcweir 	aTCAccept.InsertPage( TP_FILTER, pTPFilter->GetMyName());
1418*cdf0e10cSrcweir 	aTCAccept.SetTabPage( TP_VIEW,	 pTPView);
1419*cdf0e10cSrcweir 	aTCAccept.SetTabPage( TP_FILTER, pTPFilter);
1420*cdf0e10cSrcweir 	aTCAccept.SetHelpId(HID_REDLINING_TABCONTROL);
1421*cdf0e10cSrcweir 
1422*cdf0e10cSrcweir 	aTCAccept.SetTabPageSizePixel(aMinSize);
1423*cdf0e10cSrcweir 	Size aSize=aTCAccept.GetSizePixel();
1424*cdf0e10cSrcweir 
1425*cdf0e10cSrcweir 	gDiffSize.Height()=aSize.Height()-aMinSize.Height();
1426*cdf0e10cSrcweir 	gDiffSize.Width()=aSize.Width()-aMinSize.Width();
1427*cdf0e10cSrcweir 
1428*cdf0e10cSrcweir 
1429*cdf0e10cSrcweir 	pTPFilter->SetRedlinTable(GetViewTable());
1430*cdf0e10cSrcweir 
1431*cdf0e10cSrcweir 	aTCAccept.Show();
1432*cdf0e10cSrcweir 	ShowViewPage();
1433*cdf0e10cSrcweir }
1434*cdf0e10cSrcweir 
1435*cdf0e10cSrcweir SvxAcceptChgCtr::SvxAcceptChgCtr( Window* pParent, const ResId& rResId )
1436*cdf0e10cSrcweir 		:	Control(pParent,rResId ),
1437*cdf0e10cSrcweir 			aTCAccept(this,WB_TABSTOP |WB_DIALOGCONTROL)
1438*cdf0e10cSrcweir {
1439*cdf0e10cSrcweir 	pTPFilter=new SvxTPFilter(&aTCAccept);
1440*cdf0e10cSrcweir 	pTPView=new SvxTPView(&aTCAccept);
1441*cdf0e10cSrcweir 	aMinSize=pTPView->GetMinSizePixel();
1442*cdf0e10cSrcweir 
1443*cdf0e10cSrcweir 	aTCAccept.InsertPage( TP_VIEW,	 pTPView->GetMyName());
1444*cdf0e10cSrcweir 	aTCAccept.InsertPage( TP_FILTER, pTPFilter->GetMyName());
1445*cdf0e10cSrcweir 	aTCAccept.SetTabPage( TP_VIEW,	 pTPView);
1446*cdf0e10cSrcweir 	aTCAccept.SetTabPage( TP_FILTER, pTPFilter);
1447*cdf0e10cSrcweir 	aTCAccept.SetHelpId(HID_REDLINING_TABCONTROL);
1448*cdf0e10cSrcweir 
1449*cdf0e10cSrcweir 	aTCAccept.SetTabPageSizePixel(aMinSize);
1450*cdf0e10cSrcweir 	Size aSize=aTCAccept.GetSizePixel();
1451*cdf0e10cSrcweir 
1452*cdf0e10cSrcweir 	gDiffSize.Height()=aSize.Height()-aMinSize.Height();
1453*cdf0e10cSrcweir 	gDiffSize.Width()=aSize.Width()-aMinSize.Width();
1454*cdf0e10cSrcweir 
1455*cdf0e10cSrcweir 
1456*cdf0e10cSrcweir 	pTPFilter->SetRedlinTable(GetViewTable());
1457*cdf0e10cSrcweir 	WinBits nWinStyle=GetStyle()|WB_DIALOGCONTROL;
1458*cdf0e10cSrcweir 	SetStyle(nWinStyle);
1459*cdf0e10cSrcweir 
1460*cdf0e10cSrcweir 	aTCAccept.Show();
1461*cdf0e10cSrcweir 	ShowViewPage();
1462*cdf0e10cSrcweir 	Resize();
1463*cdf0e10cSrcweir }
1464*cdf0e10cSrcweir 
1465*cdf0e10cSrcweir SvxAcceptChgCtr::~SvxAcceptChgCtr()
1466*cdf0e10cSrcweir {
1467*cdf0e10cSrcweir 	delete pTPView;
1468*cdf0e10cSrcweir 	delete pTPFilter;
1469*cdf0e10cSrcweir }
1470*cdf0e10cSrcweir 
1471*cdf0e10cSrcweir void SvxAcceptChgCtr::Resize()
1472*cdf0e10cSrcweir {
1473*cdf0e10cSrcweir 	aMinSize=pTPView->GetMinSizePixel();
1474*cdf0e10cSrcweir 	Size aSize=GetOutputSizePixel();
1475*cdf0e10cSrcweir 	sal_Bool bFlag=sal_False;
1476*cdf0e10cSrcweir 
1477*cdf0e10cSrcweir 	if(aMinSize.Height()>aSize.Height())
1478*cdf0e10cSrcweir 	{
1479*cdf0e10cSrcweir 		aSize.Height()=aMinSize.Height();
1480*cdf0e10cSrcweir 		bFlag=sal_True;
1481*cdf0e10cSrcweir 	}
1482*cdf0e10cSrcweir 	if(aMinSize.Width()>aSize.Width())
1483*cdf0e10cSrcweir 	{
1484*cdf0e10cSrcweir 		aSize.Width()=aMinSize.Width();
1485*cdf0e10cSrcweir 		bFlag=sal_True;
1486*cdf0e10cSrcweir 	}
1487*cdf0e10cSrcweir 
1488*cdf0e10cSrcweir 	if(bFlag)
1489*cdf0e10cSrcweir 	{
1490*cdf0e10cSrcweir 		SetOutputSizePixel(aSize);
1491*cdf0e10cSrcweir 		aMinSizeLink.Call(this);
1492*cdf0e10cSrcweir 	}
1493*cdf0e10cSrcweir 
1494*cdf0e10cSrcweir 	aSize.Height()-=2;
1495*cdf0e10cSrcweir 	aSize.Width()-=2;
1496*cdf0e10cSrcweir 	aTCAccept.SetSizePixel(aSize);
1497*cdf0e10cSrcweir }
1498*cdf0e10cSrcweir 
1499*cdf0e10cSrcweir Size SvxAcceptChgCtr::GetMinSizePixel() const
1500*cdf0e10cSrcweir {
1501*cdf0e10cSrcweir 	Size aSize=pTPView->GetMinSizePixel();
1502*cdf0e10cSrcweir 	aSize.Height()+=gDiffSize.Height();
1503*cdf0e10cSrcweir 	aSize.Width()+=gDiffSize.Width();
1504*cdf0e10cSrcweir 	return aSize;
1505*cdf0e10cSrcweir }
1506*cdf0e10cSrcweir 
1507*cdf0e10cSrcweir void SvxAcceptChgCtr::ShowFilterPage()
1508*cdf0e10cSrcweir {
1509*cdf0e10cSrcweir 	aTCAccept.SetCurPageId(TP_FILTER);
1510*cdf0e10cSrcweir }
1511*cdf0e10cSrcweir 
1512*cdf0e10cSrcweir void SvxAcceptChgCtr::ShowViewPage()
1513*cdf0e10cSrcweir {
1514*cdf0e10cSrcweir 	aTCAccept.SetCurPageId(TP_VIEW);
1515*cdf0e10cSrcweir }
1516*cdf0e10cSrcweir 
1517*cdf0e10cSrcweir sal_Bool SvxAcceptChgCtr::IsFilterPageVisible()
1518*cdf0e10cSrcweir {
1519*cdf0e10cSrcweir 	return (aTCAccept.GetCurPageId()==TP_FILTER);
1520*cdf0e10cSrcweir }
1521*cdf0e10cSrcweir 
1522*cdf0e10cSrcweir sal_Bool SvxAcceptChgCtr::IsViewPageVisible()
1523*cdf0e10cSrcweir {
1524*cdf0e10cSrcweir 	return (aTCAccept.GetCurPageId()==TP_VIEW);
1525*cdf0e10cSrcweir }
1526*cdf0e10cSrcweir 
1527*cdf0e10cSrcweir SvxTPFilter* SvxAcceptChgCtr::GetFilterPage()
1528*cdf0e10cSrcweir {
1529*cdf0e10cSrcweir 	return pTPFilter;
1530*cdf0e10cSrcweir }
1531*cdf0e10cSrcweir 
1532*cdf0e10cSrcweir SvxTPView* SvxAcceptChgCtr::GetViewPage()
1533*cdf0e10cSrcweir {
1534*cdf0e10cSrcweir 	return pTPView;
1535*cdf0e10cSrcweir }
1536*cdf0e10cSrcweir 
1537*cdf0e10cSrcweir SvxRedlinTable* SvxAcceptChgCtr::GetViewTable()
1538*cdf0e10cSrcweir {
1539*cdf0e10cSrcweir 	if(pTPView!=NULL)
1540*cdf0e10cSrcweir 	{
1541*cdf0e10cSrcweir 		return pTPView->GetTableControl();
1542*cdf0e10cSrcweir 	}
1543*cdf0e10cSrcweir 	else
1544*cdf0e10cSrcweir 	{
1545*cdf0e10cSrcweir 		return NULL;
1546*cdf0e10cSrcweir 	}
1547*cdf0e10cSrcweir }
1548*cdf0e10cSrcweir 
1549*cdf0e10cSrcweir 
1550