xref: /aoo41x/main/sc/source/ui/miscdlgs/filldlg.cxx (revision cdf0e10c)
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_sc.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #undef SC_DLLIMPLEMENTATION
32*cdf0e10cSrcweir 
33*cdf0e10cSrcweir 
34*cdf0e10cSrcweir 
35*cdf0e10cSrcweir //----------------------------------------------------------------------------
36*cdf0e10cSrcweir 
37*cdf0e10cSrcweir #include <svl/zforlist.hxx>
38*cdf0e10cSrcweir #include <vcl/msgbox.hxx>
39*cdf0e10cSrcweir #include <limits.h>
40*cdf0e10cSrcweir 
41*cdf0e10cSrcweir #include "scresid.hxx"
42*cdf0e10cSrcweir #include "document.hxx"
43*cdf0e10cSrcweir #include "miscdlgs.hrc"
44*cdf0e10cSrcweir 
45*cdf0e10cSrcweir #define _FILLDLG_CXX
46*cdf0e10cSrcweir #include "filldlg.hxx"
47*cdf0e10cSrcweir #undef _FILLDLG_CXX
48*cdf0e10cSrcweir 
49*cdf0e10cSrcweir 
50*cdf0e10cSrcweir 
51*cdf0e10cSrcweir //============================================================================
52*cdf0e10cSrcweir // class ScFillSeriesDlg
53*cdf0e10cSrcweir 
54*cdf0e10cSrcweir //----------------------------------------------------------------------------
55*cdf0e10cSrcweir 
56*cdf0e10cSrcweir ScFillSeriesDlg::ScFillSeriesDlg( Window*       pParent,
57*cdf0e10cSrcweir 								  ScDocument&	rDocument,
58*cdf0e10cSrcweir 								  FillDir       eFillDir,
59*cdf0e10cSrcweir 								  FillCmd       eFillCmd,
60*cdf0e10cSrcweir 								  FillDateCmd   eFillDateCmd,
61*cdf0e10cSrcweir 								  String		aStartStr,
62*cdf0e10cSrcweir 								  double		fStep,
63*cdf0e10cSrcweir 								  double		fMax,
64*cdf0e10cSrcweir 								  sal_uInt16		nPossDir )
65*cdf0e10cSrcweir 
66*cdf0e10cSrcweir 	:	ModalDialog     ( pParent, ScResId( RID_SCDLG_FILLSERIES ) ),
67*cdf0e10cSrcweir 
68*cdf0e10cSrcweir 		aFtStartVal     ( this, ScResId( FT_START_VALUE ) ),
69*cdf0e10cSrcweir 		aEdStartVal     ( this, ScResId( ED_START_VALUES ) ),
70*cdf0e10cSrcweir 		aStartStrVal	( aStartStr),
71*cdf0e10cSrcweir 
72*cdf0e10cSrcweir 		aFtEndVal       ( this, ScResId( FT_END_VALUE ) ),
73*cdf0e10cSrcweir 		aEdEndVal       ( this, ScResId( ED_END_VALUES ) ),
74*cdf0e10cSrcweir 
75*cdf0e10cSrcweir 		aFtIncrement    ( this, ScResId( FT_INCREMENT ) ),
76*cdf0e10cSrcweir 		aEdIncrement    ( this, ScResId( ED_INCREMENT ) ),
77*cdf0e10cSrcweir 
78*cdf0e10cSrcweir         aFlDirection    ( this, ScResId( FL_DIRECTION ) ),
79*cdf0e10cSrcweir 		aBtnDown        ( this, ScResId( BTN_BOTTOM ) ),
80*cdf0e10cSrcweir 		aBtnRight       ( this, ScResId( BTN_RIGHT ) ),
81*cdf0e10cSrcweir 		aBtnUp          ( this, ScResId( BTN_TOP ) ),
82*cdf0e10cSrcweir 		aBtnLeft        ( this, ScResId( BTN_LEFT ) ),
83*cdf0e10cSrcweir         aFlSep1         ( this, ScResId( FL_SEP1 ) ),
84*cdf0e10cSrcweir         aFlType         ( this, ScResId( FL_TYPE ) ),
85*cdf0e10cSrcweir 		aBtnArithmetic  ( this, ScResId( BTN_ARITHMETIC ) ),
86*cdf0e10cSrcweir 		aBtnGeometric   ( this, ScResId( BTN_GEOMETRIC ) ),
87*cdf0e10cSrcweir 		aBtnDate        ( this, ScResId( BTN_DATE ) ),
88*cdf0e10cSrcweir 		aBtnAutoFill    ( this, ScResId( BTN_AUTOFILL ) ),
89*cdf0e10cSrcweir         aFlSep2         ( this, ScResId( FL_SEP2 ) ),
90*cdf0e10cSrcweir         aFlTimeUnit     ( this, ScResId( FL_TIME_UNIT ) ),
91*cdf0e10cSrcweir 		aBtnDay         ( this, ScResId( BTN_DAY ) ),
92*cdf0e10cSrcweir 		aBtnDayOfWeek   ( this, ScResId( BTN_DAY_OF_WEEK ) ),
93*cdf0e10cSrcweir 		aBtnMonth       ( this, ScResId( BTN_MONTH ) ),
94*cdf0e10cSrcweir 		aBtnYear        ( this, ScResId( BTN_YEAR ) ),
95*cdf0e10cSrcweir 
96*cdf0e10cSrcweir 		aBtnOk          ( this, ScResId( BTN_OK ) ),
97*cdf0e10cSrcweir 		aBtnCancel      ( this, ScResId( BTN_CANCEL ) ),
98*cdf0e10cSrcweir 		aBtnHelp        ( this, ScResId( BTN_HELP ) ),
99*cdf0e10cSrcweir 		errMsgInvalidVal( ScResId( STR_VALERR ) ),
100*cdf0e10cSrcweir 		rDoc			( rDocument ),
101*cdf0e10cSrcweir 		theFillDir      ( eFillDir ),
102*cdf0e10cSrcweir 		theFillCmd      ( eFillCmd ),
103*cdf0e10cSrcweir 		theFillDateCmd  ( eFillDateCmd ),
104*cdf0e10cSrcweir 		fIncrement      ( fStep ),
105*cdf0e10cSrcweir 		fEndVal         ( fMax )
106*cdf0e10cSrcweir {
107*cdf0e10cSrcweir 	Init( nPossDir );
108*cdf0e10cSrcweir 	FreeResource();
109*cdf0e10cSrcweir }
110*cdf0e10cSrcweir 
111*cdf0e10cSrcweir 
112*cdf0e10cSrcweir //----------------------------------------------------------------------------
113*cdf0e10cSrcweir 
114*cdf0e10cSrcweir __EXPORT ScFillSeriesDlg::~ScFillSeriesDlg()
115*cdf0e10cSrcweir {
116*cdf0e10cSrcweir }
117*cdf0e10cSrcweir 
118*cdf0e10cSrcweir //----------------------------------------------------------------------------
119*cdf0e10cSrcweir 
120*cdf0e10cSrcweir void ScFillSeriesDlg::SetEdStartValEnabled(sal_Bool bFlag)
121*cdf0e10cSrcweir {
122*cdf0e10cSrcweir 	bStartValFlag=bFlag;
123*cdf0e10cSrcweir 	if(bFlag)
124*cdf0e10cSrcweir 	{
125*cdf0e10cSrcweir 	   aFtStartVal.Enable();
126*cdf0e10cSrcweir 	   aEdStartVal.Enable();
127*cdf0e10cSrcweir 	}
128*cdf0e10cSrcweir 	else
129*cdf0e10cSrcweir 	{
130*cdf0e10cSrcweir 	   aFtStartVal.Disable();
131*cdf0e10cSrcweir 	   aEdStartVal.Disable();
132*cdf0e10cSrcweir 	}
133*cdf0e10cSrcweir }
134*cdf0e10cSrcweir 
135*cdf0e10cSrcweir //----------------------------------------------------------------------------
136*cdf0e10cSrcweir 
137*cdf0e10cSrcweir void ScFillSeriesDlg::Init( sal_uInt16 nPossDir )
138*cdf0e10cSrcweir {
139*cdf0e10cSrcweir 	aBtnOk.SetClickHdl         ( LINK( this, ScFillSeriesDlg, OKHdl ) );
140*cdf0e10cSrcweir 	aBtnArithmetic.SetClickHdl ( LINK( this, ScFillSeriesDlg, DisableHdl ) );
141*cdf0e10cSrcweir 	aBtnGeometric.SetClickHdl  ( LINK( this, ScFillSeriesDlg, DisableHdl ) );
142*cdf0e10cSrcweir 	aBtnDate.SetClickHdl       ( LINK( this, ScFillSeriesDlg, DisableHdl ) );
143*cdf0e10cSrcweir 	aBtnAutoFill.SetClickHdl   ( LINK( this, ScFillSeriesDlg, DisableHdl ) );
144*cdf0e10cSrcweir 
145*cdf0e10cSrcweir 	if( nPossDir == FDS_OPT_NONE )
146*cdf0e10cSrcweir 	{
147*cdf0e10cSrcweir 		aBtnLeft.Disable();
148*cdf0e10cSrcweir 		aBtnRight.Disable();
149*cdf0e10cSrcweir 		aBtnDown.Disable();
150*cdf0e10cSrcweir 		aBtnUp.Disable();
151*cdf0e10cSrcweir 	}
152*cdf0e10cSrcweir 
153*cdf0e10cSrcweir 	if( nPossDir == FDS_OPT_HORZ )
154*cdf0e10cSrcweir 	{
155*cdf0e10cSrcweir 		aBtnDown.Disable();
156*cdf0e10cSrcweir 		aBtnUp.Disable();
157*cdf0e10cSrcweir 	}
158*cdf0e10cSrcweir 
159*cdf0e10cSrcweir 	if( nPossDir == FDS_OPT_VERT )
160*cdf0e10cSrcweir 	{
161*cdf0e10cSrcweir 		aBtnLeft.Disable();
162*cdf0e10cSrcweir 		aBtnRight.Disable();
163*cdf0e10cSrcweir 	}
164*cdf0e10cSrcweir 
165*cdf0e10cSrcweir 	switch ( theFillDir )
166*cdf0e10cSrcweir 	{
167*cdf0e10cSrcweir 		case FILL_TO_LEFT:      aBtnLeft.Check();   break;
168*cdf0e10cSrcweir 		case FILL_TO_RIGHT:     aBtnRight.Check();  break;
169*cdf0e10cSrcweir 		case FILL_TO_BOTTOM:    aBtnDown.Check();   break;
170*cdf0e10cSrcweir 		case FILL_TO_TOP:       aBtnUp.Check();     break;
171*cdf0e10cSrcweir 		default:
172*cdf0e10cSrcweir 		break;
173*cdf0e10cSrcweir 	}
174*cdf0e10cSrcweir 
175*cdf0e10cSrcweir 	switch ( theFillCmd )
176*cdf0e10cSrcweir 	{
177*cdf0e10cSrcweir 		case FILL_LINEAR:
178*cdf0e10cSrcweir 			aBtnArithmetic.Check();
179*cdf0e10cSrcweir 			DisableHdl( &aBtnArithmetic );
180*cdf0e10cSrcweir 			break;
181*cdf0e10cSrcweir 		case FILL_GROWTH:
182*cdf0e10cSrcweir 			aBtnGeometric.Check();
183*cdf0e10cSrcweir 			DisableHdl( &aBtnGeometric );
184*cdf0e10cSrcweir 			break;
185*cdf0e10cSrcweir 		case FILL_DATE:
186*cdf0e10cSrcweir 			aBtnDate.Check();
187*cdf0e10cSrcweir 			DisableHdl( &aBtnDate );
188*cdf0e10cSrcweir 			break;
189*cdf0e10cSrcweir 		case FILL_AUTO:
190*cdf0e10cSrcweir 			aBtnAutoFill.Check();
191*cdf0e10cSrcweir 			DisableHdl( &aBtnAutoFill );
192*cdf0e10cSrcweir 			break;
193*cdf0e10cSrcweir 		default:
194*cdf0e10cSrcweir 		break;
195*cdf0e10cSrcweir 	}
196*cdf0e10cSrcweir 
197*cdf0e10cSrcweir 	switch ( theFillDateCmd )
198*cdf0e10cSrcweir 	{
199*cdf0e10cSrcweir 		case FILL_DAY:          aBtnDay.Check();        break;
200*cdf0e10cSrcweir 		case FILL_WEEKDAY:      aBtnDayOfWeek.Check();  break;
201*cdf0e10cSrcweir 		case FILL_MONTH:        aBtnMonth.Check();      break;
202*cdf0e10cSrcweir 		case FILL_YEAR:         aBtnYear.Check();       break;
203*cdf0e10cSrcweir 		default:
204*cdf0e10cSrcweir 		break;
205*cdf0e10cSrcweir 	}
206*cdf0e10cSrcweir 
207*cdf0e10cSrcweir 	fStartVal = MAXDOUBLE;
208*cdf0e10cSrcweir 	/*
209*cdf0e10cSrcweir 	String aStartTxt;
210*cdf0e10cSrcweir 	if ( fStartVal != MAXDOUBLE )
211*cdf0e10cSrcweir 		rDoc.GetFormatTable()->GetInputLineString( fStartVal, 0, aStartTxt );
212*cdf0e10cSrcweir 	aEdStartVal.SetText( aStartTxt );
213*cdf0e10cSrcweir 	*/
214*cdf0e10cSrcweir 
215*cdf0e10cSrcweir 	aEdStartVal.SetText( aStartStrVal);
216*cdf0e10cSrcweir 
217*cdf0e10cSrcweir 	String aIncrTxt;
218*cdf0e10cSrcweir 	rDoc.GetFormatTable()->GetInputLineString( fIncrement, 0, aIncrTxt );
219*cdf0e10cSrcweir 	aEdIncrement.SetText( aIncrTxt );
220*cdf0e10cSrcweir 
221*cdf0e10cSrcweir 	String aEndTxt;
222*cdf0e10cSrcweir 	if ( fEndVal != MAXDOUBLE )
223*cdf0e10cSrcweir 		rDoc.GetFormatTable()->GetInputLineString( fEndVal, 0, aEndTxt );
224*cdf0e10cSrcweir 	aEdEndVal.SetText( aEndTxt );
225*cdf0e10cSrcweir 
226*cdf0e10cSrcweir 	bStartValFlag=sal_False;
227*cdf0e10cSrcweir 
228*cdf0e10cSrcweir     aFlSep1.SetStyle( aFlSep1.GetStyle() | WB_VERT );
229*cdf0e10cSrcweir     aFlSep2.SetStyle( aFlSep2.GetStyle() | WB_VERT );
230*cdf0e10cSrcweir }
231*cdf0e10cSrcweir 
232*cdf0e10cSrcweir 
233*cdf0e10cSrcweir //----------------------------------------------------------------------------
234*cdf0e10cSrcweir 
235*cdf0e10cSrcweir sal_Bool __EXPORT ScFillSeriesDlg::CheckStartVal()
236*cdf0e10cSrcweir {
237*cdf0e10cSrcweir 	sal_Bool bValOk = sal_False;
238*cdf0e10cSrcweir 	sal_uInt32 nKey = 0;
239*cdf0e10cSrcweir 	String aStr( aEdStartVal.GetText() );
240*cdf0e10cSrcweir 
241*cdf0e10cSrcweir 	if ( aStr.Len() == 0 || aBtnAutoFill.IsChecked())
242*cdf0e10cSrcweir 	{
243*cdf0e10cSrcweir 		fStartVal = MAXDOUBLE;
244*cdf0e10cSrcweir 		bValOk = sal_True;
245*cdf0e10cSrcweir 	}
246*cdf0e10cSrcweir 	else
247*cdf0e10cSrcweir 		bValOk = rDoc.GetFormatTable()->IsNumberFormat( aStr, nKey, fStartVal );
248*cdf0e10cSrcweir 
249*cdf0e10cSrcweir 	return bValOk;
250*cdf0e10cSrcweir }
251*cdf0e10cSrcweir 
252*cdf0e10cSrcweir 
253*cdf0e10cSrcweir //----------------------------------------------------------------------------
254*cdf0e10cSrcweir 
255*cdf0e10cSrcweir sal_Bool __EXPORT ScFillSeriesDlg::CheckIncrementVal()
256*cdf0e10cSrcweir {
257*cdf0e10cSrcweir 	sal_uInt32 nKey = 0;
258*cdf0e10cSrcweir 	String aStr( aEdIncrement.GetText() );
259*cdf0e10cSrcweir 
260*cdf0e10cSrcweir 	return rDoc.GetFormatTable()->IsNumberFormat( aStr, nKey, fIncrement );
261*cdf0e10cSrcweir }
262*cdf0e10cSrcweir 
263*cdf0e10cSrcweir 
264*cdf0e10cSrcweir //----------------------------------------------------------------------------
265*cdf0e10cSrcweir 
266*cdf0e10cSrcweir sal_Bool __EXPORT ScFillSeriesDlg::CheckEndVal()
267*cdf0e10cSrcweir {
268*cdf0e10cSrcweir 	sal_Bool	bValOk = sal_False;
269*cdf0e10cSrcweir 	sal_uInt32 nKey = 0;
270*cdf0e10cSrcweir 	String	aStr( aEdEndVal.GetText() );
271*cdf0e10cSrcweir 
272*cdf0e10cSrcweir 	if ( aStr.Len() == 0 )
273*cdf0e10cSrcweir 	{
274*cdf0e10cSrcweir 		fEndVal = (fIncrement < 0) ? -MAXDOUBLE : MAXDOUBLE;
275*cdf0e10cSrcweir 		bValOk  = sal_True;
276*cdf0e10cSrcweir 	}
277*cdf0e10cSrcweir 	else
278*cdf0e10cSrcweir 		bValOk = rDoc.GetFormatTable()->IsNumberFormat( aStr, nKey, fEndVal );
279*cdf0e10cSrcweir 
280*cdf0e10cSrcweir 	return bValOk;
281*cdf0e10cSrcweir }
282*cdf0e10cSrcweir 
283*cdf0e10cSrcweir 
284*cdf0e10cSrcweir //----------------------------------------------------------------------------
285*cdf0e10cSrcweir // Handler:
286*cdf0e10cSrcweir //----------------------------------------------------------------------------
287*cdf0e10cSrcweir 
288*cdf0e10cSrcweir IMPL_LINK( ScFillSeriesDlg, DisableHdl, Button *, pBtn )
289*cdf0e10cSrcweir {
290*cdf0e10cSrcweir 	if ( pBtn == &aBtnDate )
291*cdf0e10cSrcweir 	{
292*cdf0e10cSrcweir 		aBtnDay.Enable();
293*cdf0e10cSrcweir 		aBtnDayOfWeek.Enable();
294*cdf0e10cSrcweir 		aBtnMonth.Enable();
295*cdf0e10cSrcweir 		aBtnYear.Enable();
296*cdf0e10cSrcweir         aFlTimeUnit.Enable();
297*cdf0e10cSrcweir 	}
298*cdf0e10cSrcweir 	else
299*cdf0e10cSrcweir 	{
300*cdf0e10cSrcweir 		aBtnDay.Disable();
301*cdf0e10cSrcweir 		aBtnDayOfWeek.Disable();
302*cdf0e10cSrcweir 		aBtnMonth.Disable();
303*cdf0e10cSrcweir 		aBtnYear.Disable();
304*cdf0e10cSrcweir         aFlTimeUnit.Disable();
305*cdf0e10cSrcweir 	}
306*cdf0e10cSrcweir 
307*cdf0e10cSrcweir 	if ( pBtn != &aBtnAutoFill )
308*cdf0e10cSrcweir 	{
309*cdf0e10cSrcweir 		aFtIncrement.Enable();
310*cdf0e10cSrcweir 		aEdIncrement.Enable();
311*cdf0e10cSrcweir 		aFtEndVal.Enable();
312*cdf0e10cSrcweir 		aEdEndVal.Enable();
313*cdf0e10cSrcweir 	}
314*cdf0e10cSrcweir 	else
315*cdf0e10cSrcweir 	{
316*cdf0e10cSrcweir 		aFtIncrement.Disable();
317*cdf0e10cSrcweir 		aEdIncrement.Disable();
318*cdf0e10cSrcweir 		aFtEndVal.Disable();
319*cdf0e10cSrcweir 		aEdEndVal.Disable();
320*cdf0e10cSrcweir 	}
321*cdf0e10cSrcweir 	return 0;
322*cdf0e10cSrcweir }
323*cdf0e10cSrcweir 
324*cdf0e10cSrcweir 
325*cdf0e10cSrcweir //----------------------------------------------------------------------------
326*cdf0e10cSrcweir 
327*cdf0e10cSrcweir IMPL_LINK( ScFillSeriesDlg, OKHdl, void *, EMPTYARG )
328*cdf0e10cSrcweir {
329*cdf0e10cSrcweir 	if ( aBtnLeft.IsChecked() )             theFillDir = FILL_TO_LEFT;
330*cdf0e10cSrcweir 	else if ( aBtnRight.IsChecked() )       theFillDir = FILL_TO_RIGHT;
331*cdf0e10cSrcweir 	else if ( aBtnDown.IsChecked() )        theFillDir = FILL_TO_BOTTOM;
332*cdf0e10cSrcweir 	else if ( aBtnUp.IsChecked() )          theFillDir = FILL_TO_TOP;
333*cdf0e10cSrcweir 
334*cdf0e10cSrcweir 	if ( aBtnArithmetic.IsChecked() )       theFillCmd = FILL_LINEAR;
335*cdf0e10cSrcweir 	else if ( aBtnGeometric.IsChecked() )   theFillCmd = FILL_GROWTH;
336*cdf0e10cSrcweir 	else if ( aBtnDate.IsChecked() )        theFillCmd = FILL_DATE;
337*cdf0e10cSrcweir 	else if ( aBtnAutoFill.IsChecked() )    theFillCmd = FILL_AUTO;
338*cdf0e10cSrcweir 
339*cdf0e10cSrcweir 	if ( aBtnDay.IsChecked() )              theFillDateCmd = FILL_DAY;
340*cdf0e10cSrcweir 	else if ( aBtnDayOfWeek.IsChecked() )   theFillDateCmd = FILL_WEEKDAY;
341*cdf0e10cSrcweir 	else if ( aBtnMonth.IsChecked() )       theFillDateCmd = FILL_MONTH;
342*cdf0e10cSrcweir 	else if ( aBtnYear.IsChecked() )        theFillDateCmd = FILL_YEAR;
343*cdf0e10cSrcweir 
344*cdf0e10cSrcweir 	sal_Bool  bAllOk = sal_True;
345*cdf0e10cSrcweir     Edit* pEdWrong = NULL;
346*cdf0e10cSrcweir 	if ( !CheckStartVal() )
347*cdf0e10cSrcweir 	{
348*cdf0e10cSrcweir 		bAllOk = sal_False;
349*cdf0e10cSrcweir 		pEdWrong = &aEdStartVal;
350*cdf0e10cSrcweir 	}
351*cdf0e10cSrcweir 	else if ( !CheckIncrementVal() )
352*cdf0e10cSrcweir 	{
353*cdf0e10cSrcweir 		bAllOk = sal_False;
354*cdf0e10cSrcweir 		pEdWrong = &aEdIncrement;
355*cdf0e10cSrcweir 	}
356*cdf0e10cSrcweir 	else if ( !CheckEndVal() )
357*cdf0e10cSrcweir 	{
358*cdf0e10cSrcweir 		bAllOk = sal_False;
359*cdf0e10cSrcweir 		pEdWrong = &aEdEndVal;
360*cdf0e10cSrcweir 	}
361*cdf0e10cSrcweir 	if ( bAllOk )
362*cdf0e10cSrcweir 		EndDialog( RET_OK );
363*cdf0e10cSrcweir 	else
364*cdf0e10cSrcweir 	{
365*cdf0e10cSrcweir 		ErrorBox( this,
366*cdf0e10cSrcweir 				  WinBits( WB_OK | WB_DEF_OK ),
367*cdf0e10cSrcweir 				  errMsgInvalidVal
368*cdf0e10cSrcweir 				).Execute();
369*cdf0e10cSrcweir 		pEdWrong->GrabFocus();
370*cdf0e10cSrcweir 	}
371*cdf0e10cSrcweir 
372*cdf0e10cSrcweir 	return 0;
373*cdf0e10cSrcweir }
374*cdf0e10cSrcweir 
375*cdf0e10cSrcweir 
376*cdf0e10cSrcweir 
377*cdf0e10cSrcweir 
378