xref: /aoo41x/main/sc/source/ui/miscdlgs/tabopdlg.cxx (revision b3f79822)
1*b3f79822SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*b3f79822SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*b3f79822SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*b3f79822SAndrew Rist  * distributed with this work for additional information
6*b3f79822SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*b3f79822SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*b3f79822SAndrew Rist  * "License"); you may not use this file except in compliance
9*b3f79822SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*b3f79822SAndrew Rist  *
11*b3f79822SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*b3f79822SAndrew Rist  *
13*b3f79822SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*b3f79822SAndrew Rist  * software distributed under the License is distributed on an
15*b3f79822SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*b3f79822SAndrew Rist  * KIND, either express or implied.  See the License for the
17*b3f79822SAndrew Rist  * specific language governing permissions and limitations
18*b3f79822SAndrew Rist  * under the License.
19*b3f79822SAndrew Rist  *
20*b3f79822SAndrew Rist  *************************************************************/
21*b3f79822SAndrew Rist 
22*b3f79822SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_sc.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir 
28cdf0e10cSrcweir 
29cdf0e10cSrcweir //----------------------------------------------------------------------------
30cdf0e10cSrcweir 
31cdf0e10cSrcweir #include "scitems.hxx"
32cdf0e10cSrcweir #include <sfx2/dispatch.hxx>
33cdf0e10cSrcweir #include <vcl/msgbox.hxx>
34cdf0e10cSrcweir 
35cdf0e10cSrcweir #include "uiitems.hxx"
36cdf0e10cSrcweir #include "global.hxx"
37cdf0e10cSrcweir #include "document.hxx"
38cdf0e10cSrcweir #include "scresid.hxx"
39cdf0e10cSrcweir #include "sc.hrc"
40cdf0e10cSrcweir #include "reffact.hxx"
41cdf0e10cSrcweir #include "tabopdlg.hrc"
42cdf0e10cSrcweir 
43cdf0e10cSrcweir #define _TABOPDLG_CXX
44cdf0e10cSrcweir #include "tabopdlg.hxx"
45cdf0e10cSrcweir 
46cdf0e10cSrcweir 
47cdf0e10cSrcweir //============================================================================
48cdf0e10cSrcweir //	class ScTabOpDlg
49cdf0e10cSrcweir //----------------------------------------------------------------------------
50cdf0e10cSrcweir 
ScTabOpDlg(SfxBindings * pB,SfxChildWindow * pCW,Window * pParent,ScDocument * pDocument,const ScRefAddress & rCursorPos)51cdf0e10cSrcweir ScTabOpDlg::ScTabOpDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
52cdf0e10cSrcweir 						ScDocument*         pDocument,
53cdf0e10cSrcweir 						const ScRefAddress&	rCursorPos )
54cdf0e10cSrcweir 
55cdf0e10cSrcweir 	:	ScAnyRefDlg			( pB, pCW, pParent, RID_SCDLG_TABOP ),
56cdf0e10cSrcweir 		//
57cdf0e10cSrcweir         aFlVariables        ( this, ScResId( FL_VARIABLES ) ),
58cdf0e10cSrcweir 		aFtFormulaRange     ( this, ScResId( FT_FORMULARANGE ) ),
59cdf0e10cSrcweir         aEdFormulaRange     ( this, this, ScResId( ED_FORMULARANGE ) ),
60cdf0e10cSrcweir 		aRBFormulaRange		( this, ScResId( RB_FORMULARANGE ), &aEdFormulaRange, this ),
61cdf0e10cSrcweir 		aFtRowCell       	( this, ScResId( FT_ROWCELL ) ),
62cdf0e10cSrcweir         aEdRowCell          ( this, this, ScResId( ED_ROWCELL ) ),
63cdf0e10cSrcweir 		aRBRowCell			( this, ScResId( RB_ROWCELL ), &aEdRowCell, this ),
64cdf0e10cSrcweir 		aFtColCell       	( this, ScResId( FT_COLCELL ) ),
65cdf0e10cSrcweir         aEdColCell          ( this, this, ScResId( ED_COLCELL ) ),
66cdf0e10cSrcweir 		aRBColCell			( this, ScResId( RB_COLCELL ), &aEdColCell, this ),
67cdf0e10cSrcweir 		aBtnOk              ( this, ScResId( BTN_OK ) ),
68cdf0e10cSrcweir 		aBtnCancel          ( this, ScResId( BTN_CANCEL ) ),
69cdf0e10cSrcweir 		aBtnHelp            ( this, ScResId( BTN_HELP ) ),
70cdf0e10cSrcweir 		//
71cdf0e10cSrcweir 		theFormulaCell      ( rCursorPos ),
72cdf0e10cSrcweir 		pDoc                ( pDocument ),
73cdf0e10cSrcweir 		nCurTab             ( theFormulaCell.Tab() ),
74cdf0e10cSrcweir 		pEdActive           ( NULL ),
75cdf0e10cSrcweir 		bDlgLostFocus       ( sal_False ),
76cdf0e10cSrcweir 		errMsgNoFormula		( ScResId( STR_NOFORMULA ) ),
77cdf0e10cSrcweir 		errMsgNoColRow		( ScResId( STR_NOCOLROW ) ),
78cdf0e10cSrcweir 		errMsgWrongFormula	( ScResId( STR_WRONGFORMULA ) ),
79cdf0e10cSrcweir 		errMsgWrongRowCol	( ScResId( STR_WRONGROWCOL ) ),
80cdf0e10cSrcweir 		errMsgNoColFormula	( ScResId( STR_NOCOLFORMULA ) ),
81cdf0e10cSrcweir 		errMsgNoRowFormula	( ScResId( STR_NOROWFORMULA ) )
82cdf0e10cSrcweir {
83cdf0e10cSrcweir 	Init();
84cdf0e10cSrcweir 	FreeResource();
85cdf0e10cSrcweir }
86cdf0e10cSrcweir 
87cdf0e10cSrcweir //----------------------------------------------------------------------------
88cdf0e10cSrcweir 
~ScTabOpDlg()89cdf0e10cSrcweir __EXPORT ScTabOpDlg::~ScTabOpDlg()
90cdf0e10cSrcweir {
91cdf0e10cSrcweir 	Hide();
92cdf0e10cSrcweir }
93cdf0e10cSrcweir 
94cdf0e10cSrcweir //----------------------------------------------------------------------------
95cdf0e10cSrcweir 
Init()96cdf0e10cSrcweir void __EXPORT ScTabOpDlg::Init()
97cdf0e10cSrcweir {
98cdf0e10cSrcweir 	aBtnOk.			SetClickHdl		( LINK( this, ScTabOpDlg, BtnHdl ) );
99cdf0e10cSrcweir 	aBtnCancel.		SetClickHdl		( LINK( this, ScTabOpDlg, BtnHdl ) );
100cdf0e10cSrcweir 
101cdf0e10cSrcweir     Link aLink = LINK( this, ScTabOpDlg, GetFocusHdl );
102cdf0e10cSrcweir     aEdFormulaRange.SetGetFocusHdl( aLink );
103cdf0e10cSrcweir     aRBFormulaRange.SetGetFocusHdl( aLink );
104cdf0e10cSrcweir     aEdRowCell.     SetGetFocusHdl( aLink );
105cdf0e10cSrcweir     aRBRowCell.     SetGetFocusHdl( aLink );
106cdf0e10cSrcweir     aEdColCell.     SetGetFocusHdl( aLink );
107cdf0e10cSrcweir     aRBColCell.     SetGetFocusHdl( aLink );
108cdf0e10cSrcweir 
109cdf0e10cSrcweir     aLink = LINK( this, ScTabOpDlg, LoseFocusHdl );
110cdf0e10cSrcweir     aEdFormulaRange.SetLoseFocusHdl( aLink );
111cdf0e10cSrcweir     aRBFormulaRange.SetLoseFocusHdl( aLink );
112cdf0e10cSrcweir     aEdRowCell.     SetLoseFocusHdl( aLink );
113cdf0e10cSrcweir     aRBRowCell.     SetLoseFocusHdl( aLink );
114cdf0e10cSrcweir     aEdColCell.     SetLoseFocusHdl( aLink );
115cdf0e10cSrcweir     aRBColCell.     SetLoseFocusHdl( aLink );
116cdf0e10cSrcweir 
117cdf0e10cSrcweir 	aEdFormulaRange.GrabFocus();
118cdf0e10cSrcweir 	pEdActive = &aEdFormulaRange;
119cdf0e10cSrcweir 
120cdf0e10cSrcweir 	//@BugID 54702 Enablen/Disablen nur noch in Basisklasse
121cdf0e10cSrcweir 	//SFX_APPWINDOW->Enable();
122cdf0e10cSrcweir }
123cdf0e10cSrcweir 
124cdf0e10cSrcweir //----------------------------------------------------------------------------
125cdf0e10cSrcweir 
Close()126cdf0e10cSrcweir sal_Bool __EXPORT ScTabOpDlg::Close()
127cdf0e10cSrcweir {
128cdf0e10cSrcweir 	return DoClose( ScTabOpDlgWrapper::GetChildWindowId() );
129cdf0e10cSrcweir }
130cdf0e10cSrcweir 
131cdf0e10cSrcweir //----------------------------------------------------------------------------
132cdf0e10cSrcweir 
SetActive()133cdf0e10cSrcweir void ScTabOpDlg::SetActive()
134cdf0e10cSrcweir {
135cdf0e10cSrcweir 	if ( bDlgLostFocus )
136cdf0e10cSrcweir 	{
137cdf0e10cSrcweir 		bDlgLostFocus = sal_False;
138cdf0e10cSrcweir         if( pEdActive )
139cdf0e10cSrcweir             pEdActive->GrabFocus();
140cdf0e10cSrcweir 	}
141cdf0e10cSrcweir 	else
142cdf0e10cSrcweir 		GrabFocus();
143cdf0e10cSrcweir 
144cdf0e10cSrcweir 	RefInputDone();
145cdf0e10cSrcweir }
146cdf0e10cSrcweir 
147cdf0e10cSrcweir //----------------------------------------------------------------------------
148cdf0e10cSrcweir 
SetReference(const ScRange & rRef,ScDocument * pDocP)149cdf0e10cSrcweir void ScTabOpDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
150cdf0e10cSrcweir {
151cdf0e10cSrcweir 	if ( pEdActive )
152cdf0e10cSrcweir 	{
153cdf0e10cSrcweir         ScAddress::Details aDetails(pDocP->GetAddressConvention(), 0, 0);
154cdf0e10cSrcweir 
155cdf0e10cSrcweir 		if ( rRef.aStart != rRef.aEnd )
156cdf0e10cSrcweir 			RefInputStart(pEdActive);
157cdf0e10cSrcweir 
158cdf0e10cSrcweir 		String		aStr;
159cdf0e10cSrcweir 		sal_uInt16	 	nFmt = ( rRef.aStart.Tab() == nCurTab )
160cdf0e10cSrcweir 								? SCR_ABS
161cdf0e10cSrcweir 								: SCR_ABS_3D;
162cdf0e10cSrcweir 
163cdf0e10cSrcweir 		if ( pEdActive == &aEdFormulaRange )
164cdf0e10cSrcweir 		{
165cdf0e10cSrcweir 			theFormulaCell.Set( rRef.aStart, false, false, false);
166cdf0e10cSrcweir 			theFormulaEnd.Set( rRef.aEnd, false, false, false);
167cdf0e10cSrcweir             rRef.Format( aStr, nFmt, pDocP, aDetails );
168cdf0e10cSrcweir 		}
169cdf0e10cSrcweir 		else if ( pEdActive == &aEdRowCell )
170cdf0e10cSrcweir 		{
171cdf0e10cSrcweir 			theRowCell.Set( rRef.aStart, false, false, false);
172cdf0e10cSrcweir             rRef.aStart.Format( aStr, nFmt, pDocP, aDetails );
173cdf0e10cSrcweir 		}
174cdf0e10cSrcweir 		else if ( pEdActive == &aEdColCell )
175cdf0e10cSrcweir 		{
176cdf0e10cSrcweir 			theColCell.Set( rRef.aStart, false, false, false);
177cdf0e10cSrcweir             rRef.aStart.Format( aStr, nFmt, pDocP, aDetails );
178cdf0e10cSrcweir 		}
179cdf0e10cSrcweir 
180cdf0e10cSrcweir 		pEdActive->SetRefString( aStr );
181cdf0e10cSrcweir 	}
182cdf0e10cSrcweir }
183cdf0e10cSrcweir 
184cdf0e10cSrcweir //----------------------------------------------------------------------------
185cdf0e10cSrcweir 
RaiseError(ScTabOpErr eError)186cdf0e10cSrcweir void ScTabOpDlg::RaiseError( ScTabOpErr eError )
187cdf0e10cSrcweir {
188cdf0e10cSrcweir 	const String* pMsg = &errMsgNoFormula;
189cdf0e10cSrcweir 	Edit*		  pEd  = &aEdFormulaRange;
190cdf0e10cSrcweir 
191cdf0e10cSrcweir 	switch ( eError )
192cdf0e10cSrcweir 	{
193cdf0e10cSrcweir 		case TABOPERR_NOFORMULA:
194cdf0e10cSrcweir 			pMsg = &errMsgNoFormula;
195cdf0e10cSrcweir 			pEd  = &aEdFormulaRange;
196cdf0e10cSrcweir 			break;
197cdf0e10cSrcweir 
198cdf0e10cSrcweir 		case TABOPERR_NOCOLROW:
199cdf0e10cSrcweir 			pMsg = &errMsgNoColRow;
200cdf0e10cSrcweir 			pEd  = &aEdRowCell;
201cdf0e10cSrcweir 			break;
202cdf0e10cSrcweir 
203cdf0e10cSrcweir 		case TABOPERR_WRONGFORMULA:
204cdf0e10cSrcweir 			pMsg = &errMsgWrongFormula;
205cdf0e10cSrcweir 			pEd  = &aEdFormulaRange;
206cdf0e10cSrcweir 			break;
207cdf0e10cSrcweir 
208cdf0e10cSrcweir 		case TABOPERR_WRONGROW:
209cdf0e10cSrcweir 			pMsg = &errMsgWrongRowCol;
210cdf0e10cSrcweir 			pEd  = &aEdRowCell;
211cdf0e10cSrcweir 			break;
212cdf0e10cSrcweir 
213cdf0e10cSrcweir 		case TABOPERR_NOCOLFORMULA:
214cdf0e10cSrcweir 			pMsg = &errMsgNoColFormula;
215cdf0e10cSrcweir 			pEd  = &aEdFormulaRange;
216cdf0e10cSrcweir 			break;
217cdf0e10cSrcweir 
218cdf0e10cSrcweir 		case TABOPERR_WRONGCOL:
219cdf0e10cSrcweir 			pMsg = &errMsgWrongRowCol;
220cdf0e10cSrcweir 			pEd  = &aEdColCell;
221cdf0e10cSrcweir 			break;
222cdf0e10cSrcweir 
223cdf0e10cSrcweir 		case TABOPERR_NOROWFORMULA:
224cdf0e10cSrcweir 			pMsg = &errMsgNoRowFormula;
225cdf0e10cSrcweir 			pEd  = &aEdFormulaRange;
226cdf0e10cSrcweir 			break;
227cdf0e10cSrcweir 	}
228cdf0e10cSrcweir 
229cdf0e10cSrcweir 	ErrorBox( this, WinBits( WB_OK_CANCEL | WB_DEF_OK), *pMsg ).Execute();
230cdf0e10cSrcweir 	pEd->GrabFocus();
231cdf0e10cSrcweir }
232cdf0e10cSrcweir 
233cdf0e10cSrcweir //----------------------------------------------------------------------------
234cdf0e10cSrcweir 
lcl_Parse(const String & rString,ScDocument * pDoc,SCTAB nCurTab,ScRefAddress & rStart,ScRefAddress & rEnd)235cdf0e10cSrcweir sal_Bool lcl_Parse( const String& rString, ScDocument* pDoc, SCTAB nCurTab,
236cdf0e10cSrcweir 				ScRefAddress& rStart, ScRefAddress& rEnd )
237cdf0e10cSrcweir {
238cdf0e10cSrcweir 	sal_Bool bRet = sal_False;
239cdf0e10cSrcweir     const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
240cdf0e10cSrcweir 	if ( rString.Search(':') != STRING_NOTFOUND )
241cdf0e10cSrcweir 		bRet = ConvertDoubleRef( pDoc, rString, nCurTab, rStart, rEnd, eConv );
242cdf0e10cSrcweir 	else
243cdf0e10cSrcweir 	{
244cdf0e10cSrcweir 		bRet = ConvertSingleRef( pDoc, rString, nCurTab, rStart, eConv );
245cdf0e10cSrcweir 		rEnd = rStart;
246cdf0e10cSrcweir 	}
247cdf0e10cSrcweir 	return bRet;
248cdf0e10cSrcweir }
249cdf0e10cSrcweir 
250cdf0e10cSrcweir //----------------------------------------------------------------------------
251cdf0e10cSrcweir // Handler:
252cdf0e10cSrcweir 
IMPL_LINK(ScTabOpDlg,BtnHdl,PushButton *,pBtn)253cdf0e10cSrcweir IMPL_LINK( ScTabOpDlg, BtnHdl, PushButton*, pBtn )
254cdf0e10cSrcweir {
255cdf0e10cSrcweir 	if ( pBtn == &aBtnOk )
256cdf0e10cSrcweir 	{
257cdf0e10cSrcweir 		sal_uInt8 nMode = 3;
258cdf0e10cSrcweir 		sal_uInt16 nError = 0;
259cdf0e10cSrcweir 
260cdf0e10cSrcweir 		// Zu ueberpruefen:
261cdf0e10cSrcweir 		// 1. enthalten die Strings korrekte Tabellenkoordinaten/def.Namen?
262cdf0e10cSrcweir 		// 2. IstFormelRang Zeile bei leerer Zeile bzw. Spalte bei leerer Spalte
263cdf0e10cSrcweir 		//    bzw. Einfachreferenz bei beidem?
264cdf0e10cSrcweir 		// 3. Ist mindestens Zeile oder Spalte und Formel voll?
265cdf0e10cSrcweir 
266cdf0e10cSrcweir 		if (aEdFormulaRange.GetText().Len() == 0)
267cdf0e10cSrcweir 			nError = TABOPERR_NOFORMULA;
268cdf0e10cSrcweir 		else if (aEdRowCell.GetText().Len() == 0 &&
269cdf0e10cSrcweir 				 aEdColCell.GetText().Len() == 0)
270cdf0e10cSrcweir 			nError = TABOPERR_NOCOLROW;
271cdf0e10cSrcweir 		else if ( !lcl_Parse( aEdFormulaRange.GetText(), pDoc, nCurTab,
272cdf0e10cSrcweir 								theFormulaCell, theFormulaEnd ) )
273cdf0e10cSrcweir 			nError = TABOPERR_WRONGFORMULA;
274cdf0e10cSrcweir 		else
275cdf0e10cSrcweir 		{
276cdf0e10cSrcweir             const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
277cdf0e10cSrcweir 			if (aEdRowCell.GetText().Len() > 0)
278cdf0e10cSrcweir 			{
279cdf0e10cSrcweir 				if (!ConvertSingleRef( pDoc, aEdRowCell.GetText(), nCurTab,
280cdf0e10cSrcweir                                        theRowCell, eConv ))
281cdf0e10cSrcweir 					nError = TABOPERR_WRONGROW;
282cdf0e10cSrcweir 				else
283cdf0e10cSrcweir 				{
284cdf0e10cSrcweir 					if (aEdColCell.GetText().Len() == 0 &&
285cdf0e10cSrcweir 						theFormulaCell.Col() != theFormulaEnd.Col())
286cdf0e10cSrcweir 						nError = TABOPERR_NOCOLFORMULA;
287cdf0e10cSrcweir 					else
288cdf0e10cSrcweir 						nMode = 1;
289cdf0e10cSrcweir 				}
290cdf0e10cSrcweir 			}
291cdf0e10cSrcweir 			if (aEdColCell.GetText().Len() > 0)
292cdf0e10cSrcweir 			{
293cdf0e10cSrcweir 				if (!ConvertSingleRef( pDoc, aEdColCell.GetText(), nCurTab,
294cdf0e10cSrcweir 									   theColCell, eConv ))
295cdf0e10cSrcweir 					nError = TABOPERR_WRONGCOL;
296cdf0e10cSrcweir 				else
297cdf0e10cSrcweir 				{
298cdf0e10cSrcweir 					if (nMode == 1)							// beides
299cdf0e10cSrcweir 					{
300cdf0e10cSrcweir 						nMode = 2;
301cdf0e10cSrcweir 						ConvertSingleRef( pDoc, aEdFormulaRange.GetText(), nCurTab,
302cdf0e10cSrcweir 										  theFormulaCell, eConv );
303cdf0e10cSrcweir 					}
304cdf0e10cSrcweir 					else if (theFormulaCell.Row() != theFormulaEnd.Row())
305cdf0e10cSrcweir 						nError = TABOPERR_NOROWFORMULA;
306cdf0e10cSrcweir 					else
307cdf0e10cSrcweir 						nMode = 0;
308cdf0e10cSrcweir 				}
309cdf0e10cSrcweir 			}
310cdf0e10cSrcweir 		}
311cdf0e10cSrcweir 
312cdf0e10cSrcweir 		if (nError)
313cdf0e10cSrcweir 			RaiseError( (ScTabOpErr) nError );
314cdf0e10cSrcweir 		else
315cdf0e10cSrcweir 		{
316cdf0e10cSrcweir 			ScTabOpParam aOutParam( theFormulaCell,
317cdf0e10cSrcweir 									theFormulaEnd,
318cdf0e10cSrcweir 									theRowCell,
319cdf0e10cSrcweir 									theColCell,
320cdf0e10cSrcweir 									nMode );
321cdf0e10cSrcweir 			ScTabOpItem	 aOutItem( SID_TABOP, &aOutParam );
322cdf0e10cSrcweir 
323cdf0e10cSrcweir 			SetDispatcherLock( sal_False );
324cdf0e10cSrcweir 			SwitchToDocument();
325cdf0e10cSrcweir 			GetBindings().GetDispatcher()->Execute( SID_TABOP,
326cdf0e10cSrcweir 									  SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD,
327cdf0e10cSrcweir 									  &aOutItem, 0L, 0L );
328cdf0e10cSrcweir 			Close();
329cdf0e10cSrcweir 		}
330cdf0e10cSrcweir 	}
331cdf0e10cSrcweir 	else if ( pBtn == &aBtnCancel )
332cdf0e10cSrcweir 		Close();
333cdf0e10cSrcweir 
334cdf0e10cSrcweir 	return 0;
335cdf0e10cSrcweir }
336cdf0e10cSrcweir 
337cdf0e10cSrcweir //----------------------------------------------------------------------------
338cdf0e10cSrcweir 
IMPL_LINK(ScTabOpDlg,GetFocusHdl,Control *,pCtrl)339cdf0e10cSrcweir IMPL_LINK( ScTabOpDlg, GetFocusHdl, Control*, pCtrl )
340cdf0e10cSrcweir {
341cdf0e10cSrcweir     if( (pCtrl == (Control*)&aEdFormulaRange) || (pCtrl == (Control*)&aRBFormulaRange) )
342cdf0e10cSrcweir         pEdActive = &aEdFormulaRange;
343cdf0e10cSrcweir     else if( (pCtrl == (Control*)&aEdRowCell) || (pCtrl == (Control*)&aRBRowCell) )
344cdf0e10cSrcweir         pEdActive = &aEdRowCell;
345cdf0e10cSrcweir     else if( (pCtrl == (Control*)&aEdColCell) || (pCtrl == (Control*)&aRBColCell) )
346cdf0e10cSrcweir         pEdActive = &aEdColCell;
347cdf0e10cSrcweir     else
348cdf0e10cSrcweir         pEdActive = NULL;
349cdf0e10cSrcweir 
350cdf0e10cSrcweir     if( pEdActive )
351cdf0e10cSrcweir         pEdActive->SetSelection( Selection( 0, SELECTION_MAX ) );
352cdf0e10cSrcweir 
353cdf0e10cSrcweir 	return 0;
354cdf0e10cSrcweir }
355cdf0e10cSrcweir 
356cdf0e10cSrcweir //----------------------------------------------------------------------------
357cdf0e10cSrcweir 
IMPL_LINK(ScTabOpDlg,LoseFocusHdl,Control *,EMPTYARG)358cdf0e10cSrcweir IMPL_LINK( ScTabOpDlg, LoseFocusHdl, Control*, EMPTYARG )
359cdf0e10cSrcweir {
360cdf0e10cSrcweir 	bDlgLostFocus = !IsActive();
361cdf0e10cSrcweir 	return 0;
362cdf0e10cSrcweir }
363cdf0e10cSrcweir 
364cdf0e10cSrcweir 
365cdf0e10cSrcweir 
366cdf0e10cSrcweir 
367cdf0e10cSrcweir 
368