update dev300-m58
[ooovba.git] / sc / source / ui / dbgui / tpsubt.cxx
blob676df4424668b45f0c77b31598587949a7fba78e
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: tpsubt.cxx,v $
10 * $Revision: 1.11 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sc.hxx"
34 #undef SC_DLLIMPLEMENTATION
38 #include "scitems.hxx"
39 #include "uiitems.hxx"
40 #include "global.hxx"
41 #include "userlist.hxx"
42 #include "viewdata.hxx"
43 #include "document.hxx"
44 #include "scresid.hxx"
45 #include "sc.hrc" // -> Slot IDs
47 #include "subtdlg.hxx"
48 #include "subtdlg.hrc"
49 #include "tpsubt.hxx"
51 // STATIC DATA -----------------------------------------------------------
53 static USHORT pSubTotalsRanges[] =
55 SID_SUBTOTALS,
56 SID_SUBTOTALS,
60 //========================================================================
61 // Zwischenergebnisgruppen-Tabpage:
63 ScTpSubTotalGroup::ScTpSubTotalGroup( Window* pParent, USHORT nResId,
64 const SfxItemSet& rArgSet )
65 : SfxTabPage ( pParent,
66 ScResId( nResId ),
67 rArgSet ),
69 aFtGroup ( this, ScResId( FT_GROUP ) ),
70 aLbGroup ( this, ScResId( LB_GROUP ) ),
71 aFtColumns ( this, ScResId( FT_COLUMNS ) ),
72 aLbColumns ( this, ScResId( WND_COLUMNS ) ),
73 aFtFunctions ( this, ScResId( FT_FUNCTIONS ) ),
74 aLbFunctions ( this, ScResId( LB_FUNCTIONS ) ),
75 aStrNone ( ScResId( SCSTR_NONE ) ),
76 aStrColumn ( ScResId( SCSTR_COLUMN ) ),
78 pViewData ( NULL ),
79 pDoc ( NULL ),
80 nWhichSubTotals ( rArgSet.GetPool()->GetWhich( SID_SUBTOTALS ) ),
81 rSubTotalData ( ((const ScSubTotalItem&)
82 rArgSet.Get( nWhichSubTotals )).
83 GetSubTotalData() ),
84 nFieldCount ( 0 )
86 // Font is correctly initialized by SvTreeListBox ctor
87 aLbColumns.SetSelectionMode( SINGLE_SELECTION );
88 aLbColumns.SetDragDropMode( SV_DRAGDROP_NONE );
89 aLbColumns.SetSpaceBetweenEntries( 0 );
90 aLbColumns.Show();
92 Init ();
93 FreeResource();
96 // -----------------------------------------------------------------------
98 __EXPORT ScTpSubTotalGroup::~ScTpSubTotalGroup()
100 USHORT nCount = (USHORT)aLbColumns.GetEntryCount();
102 if ( nCount > 0 )
104 USHORT* pData = NULL;
106 for ( USHORT i=0; i<nCount; i++ )
108 pData = (USHORT*)(aLbColumns.GetEntryData( i ));
109 DBG_ASSERT( pData, "EntryData not found" );
111 delete pData;
116 // -----------------------------------------------------------------------
118 void ScTpSubTotalGroup::Init()
120 const ScSubTotalItem& rSubTotalItem = (const ScSubTotalItem&)
121 GetItemSet().Get( nWhichSubTotals );
123 pViewData = rSubTotalItem.GetViewData();
124 pDoc = ( pViewData ) ? pViewData->GetDocument() : NULL;
126 DBG_ASSERT( pViewData && pDoc, "ViewData or Document not found :-(" );
128 aLbGroup.SetSelectHdl ( LINK( this, ScTpSubTotalGroup, SelectHdl ) );
129 aLbColumns.SetSelectHdl ( LINK( this, ScTpSubTotalGroup, SelectHdl ) );
130 aLbColumns.SetCheckButtonHdl ( LINK( this, ScTpSubTotalGroup, CheckHdl ) );
131 aLbFunctions.SetSelectHdl ( LINK( this, ScTpSubTotalGroup, SelectHdl ) );
133 nFieldArr[0] = 0;
134 FillListBoxes();
137 //------------------------------------------------------------------------
139 USHORT* __EXPORT ScTpSubTotalGroup::GetRanges()
141 return pSubTotalsRanges;
144 // -----------------------------------------------------------------------
146 BOOL ScTpSubTotalGroup::DoReset( USHORT nGroupNo,
147 const SfxItemSet& rArgSet )
149 USHORT nGroupIdx = 0;
151 DBG_ASSERT( (nGroupNo<=3) && (nGroupNo>0), "Invalid group" );
153 if ( (nGroupNo > 3) || (nGroupNo == 0) )
154 return FALSE;
155 else
156 nGroupIdx = nGroupNo-1;
158 //----------------------------------------------------------
160 // #79058# first we have to clear the listboxes...
161 for ( USHORT nLbEntry = 0; nLbEntry < aLbColumns.GetEntryCount(); ++nLbEntry )
163 aLbColumns.CheckEntryPos( nLbEntry, FALSE );
164 *((USHORT*)aLbColumns.GetEntryData( nLbEntry )) = 0;
166 aLbFunctions.SelectEntryPos( 0 );
168 ScSubTotalParam theSubTotalData( ((const ScSubTotalItem&)
169 rArgSet.Get( nWhichSubTotals )).
170 GetSubTotalData() );
172 if ( theSubTotalData.bGroupActive[nGroupIdx] )
174 SCCOL nField = theSubTotalData.nField[nGroupIdx];
175 SCCOL nSubTotals = theSubTotalData.nSubTotals[nGroupIdx];
176 SCCOL* pSubTotals = theSubTotalData.pSubTotals[nGroupIdx];
177 ScSubTotalFunc* pFunctions = theSubTotalData.pFunctions[nGroupIdx];
179 aLbGroup.SelectEntryPos( GetFieldSelPos( nField )+1 );
181 for ( USHORT i=0; i<nSubTotals; i++ )
183 USHORT nCheckPos = GetFieldSelPos( pSubTotals[i] );
184 USHORT* pFunction = (USHORT*)aLbColumns.GetEntryData( nCheckPos );
186 aLbColumns.CheckEntryPos( nCheckPos );
187 *pFunction = FuncToLbPos( pFunctions[i] );
189 aLbColumns.SelectEntryPos( 0 );
191 else
193 aLbGroup.SelectEntryPos( (nGroupNo == 1) ? 1 : 0 );
194 aLbColumns.SelectEntryPos( 0 );
195 aLbFunctions.SelectEntryPos( 0 );
198 return TRUE;
201 // -----------------------------------------------------------------------
203 BOOL ScTpSubTotalGroup::DoFillItemSet( USHORT nGroupNo,
204 SfxItemSet& rArgSet )
206 USHORT nGroupIdx = 0;
208 DBG_ASSERT( (nGroupNo<=3) && (nGroupNo>0), "Invalid group" );
209 DBG_ASSERT( (aLbGroup.GetEntryCount() > 0)
210 && (aLbColumns.GetEntryCount() > 0)
211 && (aLbFunctions.GetEntryCount() > 0),
212 "Non-initialized Lists" );
215 if ( (nGroupNo > 3) || (nGroupNo == 0)
216 || (aLbGroup.GetEntryCount() == 0)
217 || (aLbColumns.GetEntryCount() == 0)
218 || (aLbFunctions.GetEntryCount() == 0)
220 return FALSE;
221 else
222 nGroupIdx = nGroupNo-1;
224 //----------------------------------------------------------
226 ScSubTotalParam theSubTotalData; // auslesen, wenn schon teilweise gefuellt
227 SfxTabDialog* pDlg = GetTabDialog();
228 if ( pDlg )
230 const SfxItemSet* pExample = pDlg->GetExampleSet();
231 const SfxPoolItem* pItem;
232 if ( pExample && pExample->GetItemState( nWhichSubTotals, TRUE, &pItem ) == SFX_ITEM_SET )
233 theSubTotalData = ((const ScSubTotalItem*)pItem)->GetSubTotalData();
236 ScSubTotalFunc* pFunctions = NULL;
237 SCCOL* pSubTotals = NULL;
238 USHORT nGroup = aLbGroup.GetSelectEntryPos();
239 USHORT nEntryCount = (USHORT)aLbColumns.GetEntryCount();
240 USHORT nCheckCount = aLbColumns.GetCheckedEntryCount();
242 theSubTotalData.nCol1 = rSubTotalData.nCol1;
243 theSubTotalData.nRow1 = rSubTotalData.nRow1;
244 theSubTotalData.nCol2 = rSubTotalData.nCol2;
245 theSubTotalData.nRow2 = rSubTotalData.nRow2;
246 theSubTotalData.bGroupActive[nGroupIdx] = (nGroup != 0);
247 theSubTotalData.nField[nGroupIdx] = (nGroup != 0)
248 ? nFieldArr[nGroup-1]
249 : static_cast<SCCOL>(0);
251 if ( nEntryCount>0 && nCheckCount>0 && nGroup!=0 )
253 USHORT nFunction = 0;
255 pSubTotals = new SCCOL [nCheckCount];
256 pFunctions = new ScSubTotalFunc [nCheckCount];
258 for ( USHORT i=0, nCheck=0; i<nEntryCount; i++ )
260 if ( aLbColumns.IsChecked( i ) )
262 DBG_ASSERT( nCheck <= nCheckCount,
263 "Range error :-(" );
264 nFunction = *((USHORT*)aLbColumns.GetEntryData( i ));
265 pSubTotals[nCheck] = nFieldArr[i];
266 pFunctions[nCheck] = LbPosToFunc( nFunction );
267 nCheck++;
270 theSubTotalData.SetSubTotals( nGroupNo, // Gruppen-Nr.
271 pSubTotals,
272 pFunctions,
273 nCheckCount ); // Anzahl der Array-Elemente
277 rArgSet.Put( ScSubTotalItem( SCITEM_SUBTDATA, &theSubTotalData ) );
279 if ( pSubTotals ) delete pSubTotals;
280 if ( pFunctions ) delete pFunctions;
282 return TRUE;
285 // -----------------------------------------------------------------------
287 void ScTpSubTotalGroup::FillListBoxes()
289 DBG_ASSERT( pViewData && pDoc, "ViewData or Document not found :-/" );
291 if ( pViewData && pDoc )
293 SCCOL nFirstCol = rSubTotalData.nCol1;
294 SCROW nFirstRow = rSubTotalData.nRow1;
295 SCTAB nTab = pViewData->GetTabNo();
296 SCCOL nMaxCol = rSubTotalData.nCol2;
297 SCCOL col;
298 USHORT i=0;
299 String aFieldName;
301 aLbGroup.Clear();
302 aLbColumns.Clear();
303 aLbGroup.InsertEntry( aStrNone, 0 );
305 i=0;
306 for ( col=nFirstCol; col<=nMaxCol && i<SC_MAXFIELDS; col++ )
308 pDoc->GetString( col, nFirstRow, nTab, aFieldName );
309 if ( aFieldName.Len() == 0 )
311 aFieldName = aStrColumn;
312 aFieldName += ' ';
313 aFieldName += ::ScColToAlpha( col ); // from global.hxx
315 nFieldArr[i] = col;
316 aLbGroup.InsertEntry( aFieldName, i+1 );
317 aLbColumns.InsertEntry( aFieldName, i );
318 aLbColumns.SetEntryData( i, new USHORT(0) );
319 i++;
321 // Nachtraegliche "Konstanteninitialisierung":
322 (USHORT&)nFieldCount = i;
326 // -----------------------------------------------------------------------
328 USHORT ScTpSubTotalGroup::GetFieldSelPos( SCCOL nField )
330 USHORT nFieldPos = 0;
331 BOOL bFound = FALSE;
333 for ( USHORT n=0; n<nFieldCount && !bFound; n++ )
335 if ( nFieldArr[n] == nField )
337 nFieldPos = n;
338 bFound = TRUE;
342 return nFieldPos;
345 // -----------------------------------------------------------------------
347 ScSubTotalFunc ScTpSubTotalGroup::LbPosToFunc( USHORT nPos )
349 switch ( nPos )
351 // case 0: return SUBTOTAL_FUNC_NONE;
352 case 2: return SUBTOTAL_FUNC_AVE;
353 case 6: return SUBTOTAL_FUNC_CNT;
354 case 1: return SUBTOTAL_FUNC_CNT2;
355 case 3: return SUBTOTAL_FUNC_MAX;
356 case 4: return SUBTOTAL_FUNC_MIN;
357 case 5: return SUBTOTAL_FUNC_PROD;
358 case 7: return SUBTOTAL_FUNC_STD;
359 case 8: return SUBTOTAL_FUNC_STDP;
360 case 0: return SUBTOTAL_FUNC_SUM;
361 case 9: return SUBTOTAL_FUNC_VAR;
362 case 10: return SUBTOTAL_FUNC_VARP;
363 default:
364 DBG_ERROR( "ScTpSubTotalGroup::LbPosToFunc" );
365 return SUBTOTAL_FUNC_NONE;
369 // -----------------------------------------------------------------------
371 USHORT ScTpSubTotalGroup::FuncToLbPos( ScSubTotalFunc eFunc )
373 switch ( eFunc )
375 // case SUBTOTAL_FUNC_NONE: return 0;
376 case SUBTOTAL_FUNC_AVE: return 2;
377 case SUBTOTAL_FUNC_CNT: return 6;
378 case SUBTOTAL_FUNC_CNT2: return 1;
379 case SUBTOTAL_FUNC_MAX: return 3;
380 case SUBTOTAL_FUNC_MIN: return 4;
381 case SUBTOTAL_FUNC_PROD: return 5;
382 case SUBTOTAL_FUNC_STD: return 7;
383 case SUBTOTAL_FUNC_STDP: return 8;
384 case SUBTOTAL_FUNC_SUM: return 0;
385 case SUBTOTAL_FUNC_VAR: return 9;
386 case SUBTOTAL_FUNC_VARP: return 10;
387 default:
388 DBG_ERROR( "ScTpSubTotalGroup::FuncToLbPos" );
389 return 0;
393 // -----------------------------------------------------------------------
394 // Handler:
395 //---------
397 IMPL_LINK( ScTpSubTotalGroup, SelectHdl, ListBox *, pLb )
399 if ( (aLbColumns.GetEntryCount() > 0)
400 && (aLbColumns.GetSelectionCount() > 0) )
402 USHORT nFunction = aLbFunctions.GetSelectEntryPos();
403 USHORT nColumn = aLbColumns.GetSelectEntryPos();
404 USHORT* pFunction = (USHORT*)aLbColumns.GetEntryData( nColumn );
406 DBG_ASSERT( pFunction, "EntryData nicht gefunden!" );
407 if ( !pFunction )
408 return 0;
410 if ( ((SvxCheckListBox*)pLb) == &aLbColumns )
412 aLbFunctions.SelectEntryPos( *pFunction );
414 else if ( pLb == &aLbFunctions )
416 *pFunction = nFunction;
417 // aLbColumns.CheckEntryPos( nColumn, (nFunction != 0) );//XXX
418 aLbColumns.CheckEntryPos( nColumn, TRUE );
421 return 0;
424 // -----------------------------------------------------------------------
426 IMPL_LINK( ScTpSubTotalGroup, CheckHdl, ListBox *, pLb )
428 if ( ((SvxCheckListBox*)pLb) == &aLbColumns )
430 SvLBoxEntry* pEntry = aLbColumns.GetHdlEntry();
432 if ( pEntry )
434 aLbColumns.SelectEntryPos( (USHORT)aLbColumns.GetModel()->GetAbsPos( pEntry ) );
435 SelectHdl( pLb );
438 return 0;
441 //========================================================================
442 // Abgeleitete Gruppen-TabPages:
444 SfxTabPage* __EXPORT ScTpSubTotalGroup1::Create( Window* pParent,
445 const SfxItemSet& rArgSet )
446 { return ( new ScTpSubTotalGroup1( pParent, rArgSet ) ); }
448 // -----------------------------------------------------------------------
450 SfxTabPage* __EXPORT ScTpSubTotalGroup2::Create( Window* pParent,
451 const SfxItemSet& rArgSet )
452 { return ( new ScTpSubTotalGroup2( pParent, rArgSet ) ); }
454 // -----------------------------------------------------------------------
456 SfxTabPage* __EXPORT ScTpSubTotalGroup3::Create( Window* pParent,
457 const SfxItemSet& rArgSet )
458 { return ( new ScTpSubTotalGroup3( pParent, rArgSet ) ); }
460 // -----------------------------------------------------------------------
462 ScTpSubTotalGroup1::ScTpSubTotalGroup1( Window* pParent, const SfxItemSet& rArgSet ) :
463 ScTpSubTotalGroup( pParent, RID_SCPAGE_SUBT_GROUP1, rArgSet )
466 ScTpSubTotalGroup2::ScTpSubTotalGroup2( Window* pParent, const SfxItemSet& rArgSet ) :
467 ScTpSubTotalGroup( pParent, RID_SCPAGE_SUBT_GROUP2, rArgSet )
470 ScTpSubTotalGroup3::ScTpSubTotalGroup3( Window* pParent, const SfxItemSet& rArgSet ) :
471 ScTpSubTotalGroup( pParent, RID_SCPAGE_SUBT_GROUP3, rArgSet )
474 // -----------------------------------------------------------------------
477 #define RESET(i) (ScTpSubTotalGroup::DoReset( (i), rArgSet ))
479 void __EXPORT ScTpSubTotalGroup1::Reset( const SfxItemSet& rArgSet ) { RESET(1); }
481 void __EXPORT ScTpSubTotalGroup2::Reset( const SfxItemSet& rArgSet ) { RESET(2); }
483 void __EXPORT ScTpSubTotalGroup3::Reset( const SfxItemSet& rArgSet ) { RESET(3); }
485 #undef RESET
487 // -----------------------------------------------------------------------
489 #define FILLSET(i) (ScTpSubTotalGroup::DoFillItemSet( (i), rArgSet ))
491 BOOL __EXPORT ScTpSubTotalGroup1::FillItemSet( SfxItemSet& rArgSet ) { return FILLSET(1); }
493 BOOL __EXPORT ScTpSubTotalGroup2::FillItemSet( SfxItemSet& rArgSet ) { return FILLSET(2); }
495 BOOL __EXPORT ScTpSubTotalGroup3::FillItemSet( SfxItemSet& rArgSet ) { return FILLSET(3); }
497 #undef FILL
499 //========================================================================
500 // Optionen-Tabpage:
502 ScTpSubTotalOptions::ScTpSubTotalOptions( Window* pParent,
503 const SfxItemSet& rArgSet )
505 : SfxTabPage ( pParent,
506 ScResId( RID_SCPAGE_SUBT_OPTIONS ),
507 rArgSet ),
509 aFlGroup ( this, ScResId( FL_GROUP ) ),
510 aBtnPagebreak ( this, ScResId( BTN_PAGEBREAK ) ),
511 aBtnCase ( this, ScResId( BTN_CASE ) ),
512 aBtnSort ( this, ScResId( BTN_SORT ) ),
513 aFlSort ( this, ScResId( FL_SORT ) ),
514 aBtnAscending ( this, ScResId( BTN_ASCENDING ) ),
515 aBtnDescending ( this, ScResId( BTN_DESCENDING ) ),
516 aBtnFormats ( this, ScResId( BTN_FORMATS ) ),
517 aBtnUserDef ( this, ScResId( BTN_USERDEF ) ),
518 aLbUserDef ( this, ScResId( LB_USERDEF ) ),
520 pViewData ( NULL ),
521 pDoc ( NULL ),
522 nWhichSubTotals ( rArgSet.GetPool()->GetWhich( SID_SUBTOTALS ) ),
523 rSubTotalData ( ((const ScSubTotalItem&)
524 rArgSet.Get( nWhichSubTotals )).
525 GetSubTotalData() )
527 Init();
528 FreeResource();
531 // -----------------------------------------------------------------------
533 __EXPORT ScTpSubTotalOptions::~ScTpSubTotalOptions()
537 // -----------------------------------------------------------------------
539 void ScTpSubTotalOptions::Init()
541 const ScSubTotalItem& rSubTotalItem = (const ScSubTotalItem&)
542 GetItemSet().Get( nWhichSubTotals );
544 pViewData = rSubTotalItem.GetViewData();
545 pDoc = ( pViewData ) ? pViewData->GetDocument() : NULL;
547 DBG_ASSERT( pViewData && pDoc, "ViewData oder Document nicht gefunden!" );
549 aBtnSort.SetClickHdl ( LINK( this, ScTpSubTotalOptions, CheckHdl ) );
550 aBtnUserDef.SetClickHdl ( LINK( this, ScTpSubTotalOptions, CheckHdl ) );
552 FillUserSortListBox();
555 // -----------------------------------------------------------------------
557 SfxTabPage* __EXPORT ScTpSubTotalOptions::Create( Window* pParent,
558 const SfxItemSet& rArgSet )
560 return ( new ScTpSubTotalOptions( pParent, rArgSet ) );
563 // -----------------------------------------------------------------------
565 void __EXPORT ScTpSubTotalOptions::Reset( const SfxItemSet& /* rArgSet */ )
567 aBtnPagebreak.Check ( rSubTotalData.bPagebreak );
568 aBtnCase.Check ( rSubTotalData.bCaseSens );
569 aBtnFormats.Check ( rSubTotalData.bIncludePattern );
570 aBtnSort.Check ( rSubTotalData.bDoSort );
571 aBtnAscending.Check ( rSubTotalData.bAscending );
572 aBtnDescending.Check( !rSubTotalData.bAscending );
574 if ( rSubTotalData.bUserDef )
576 aBtnUserDef.Check( TRUE );
577 aLbUserDef.Enable();
578 aLbUserDef.SelectEntryPos( rSubTotalData.nUserIndex );
580 else
582 aBtnUserDef.Check( FALSE );
583 aLbUserDef.Disable();
584 aLbUserDef.SelectEntryPos( 0 );
587 CheckHdl( &aBtnSort );
590 // -----------------------------------------------------------------------
592 BOOL __EXPORT ScTpSubTotalOptions::FillItemSet( SfxItemSet& rArgSet )
594 ScSubTotalParam theSubTotalData; // auslesen, wenn schon teilweise gefuellt
595 SfxTabDialog* pDlg = GetTabDialog();
596 if ( pDlg )
598 const SfxItemSet* pExample = pDlg->GetExampleSet();
599 const SfxPoolItem* pItem;
600 if ( pExample && pExample->GetItemState( nWhichSubTotals, TRUE, &pItem ) == SFX_ITEM_SET )
601 theSubTotalData = ((const ScSubTotalItem*)pItem)->GetSubTotalData();
604 theSubTotalData.bPagebreak = aBtnPagebreak.IsChecked();
605 theSubTotalData.bReplace = TRUE;
606 theSubTotalData.bCaseSens = aBtnCase.IsChecked();
607 theSubTotalData.bIncludePattern = aBtnFormats.IsChecked();
608 theSubTotalData.bDoSort = aBtnSort.IsChecked();
609 theSubTotalData.bAscending = aBtnAscending.IsChecked();
610 theSubTotalData.bUserDef = aBtnUserDef.IsChecked();
611 theSubTotalData.nUserIndex = (aBtnUserDef.IsChecked())
612 ? aLbUserDef.GetSelectEntryPos()
613 : 0;
615 rArgSet.Put( ScSubTotalItem( nWhichSubTotals, &theSubTotalData ) );
617 return TRUE;
620 // -----------------------------------------------------------------------
622 void ScTpSubTotalOptions::FillUserSortListBox()
624 ScUserList* pUserLists = ScGlobal::GetUserList();
626 aLbUserDef.Clear();
627 if ( pUserLists )
629 USHORT nCount = pUserLists->GetCount();
630 if ( nCount > 0 )
631 for ( USHORT i=0; i<nCount; i++ )
632 aLbUserDef.InsertEntry( (*pUserLists)[i]->GetString() );
636 // -----------------------------------------------------------------------
637 // Handler:
639 IMPL_LINK( ScTpSubTotalOptions, CheckHdl, CheckBox *, pBox )
641 if ( pBox == &aBtnSort )
643 if ( aBtnSort.IsChecked() )
645 aFlSort .Enable();
646 aBtnFormats .Enable();
647 aBtnUserDef .Enable();
648 aBtnAscending .Enable();
649 aBtnDescending .Enable();
651 if ( aBtnUserDef.IsChecked() )
652 aLbUserDef.Enable();
654 else
656 aFlSort .Disable();
657 aBtnFormats .Disable();
658 aBtnUserDef .Disable();
659 aBtnAscending .Disable();
660 aBtnDescending .Disable();
661 aLbUserDef .Disable();
664 else if ( pBox == &aBtnUserDef )
666 if ( aBtnUserDef.IsChecked() )
668 aLbUserDef.Enable();
669 aLbUserDef.GrabFocus();
671 else
672 aLbUserDef.Disable();
675 return 0;
678 __EXPORT ScTpSubTotalGroup1::~ScTpSubTotalGroup1()
682 __EXPORT ScTpSubTotalGroup2::~ScTpSubTotalGroup2()
686 __EXPORT ScTpSubTotalGroup3::~ScTpSubTotalGroup3()