LibreOffice Module sc (master)  1
tpsubt.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #undef SC_DLLIMPLEMENTATION
21 
22 #include <scitems.hxx>
23 #include <uiitems.hxx>
24 #include <global.hxx>
25 #include <userlist.hxx>
26 #include <viewdata.hxx>
27 #include <document.hxx>
28 #include <scresid.hxx>
29 #include <sc.hrc>
30 #include <strings.hrc>
31 #include <subtotals.hrc>
32 
33 #include <tpsubt.hxx>
34 #include <memory>
35 
36 #include <osl/diagnose.h>
37 
38 // Subtotals group tabpage:
39 
41  : SfxTabPage(pPage, pController, "modules/scalc/ui/subtotalgrppage.ui", "SubTotalGrpPage", &rArgSet)
42  , aStrNone(ScResId(SCSTR_NONE))
43  , aStrColumn(ScResId(SCSTR_COLUMN))
44  , pViewData(nullptr)
45  , pDoc(nullptr)
46  , nWhichSubTotals(rArgSet.GetPool()->GetWhich(SID_SUBTOTALS))
47  , rSubTotalData(static_cast<const ScSubTotalItem&>(rArgSet.Get(nWhichSubTotals)).GetSubTotalData())
48  , nFieldCount(0)
49  , mxLbGroup(m_xBuilder->weld_combo_box("group_by"))
50  , mxLbColumns(m_xBuilder->weld_tree_view("columns"))
51  , mxLbFunctions(m_xBuilder->weld_tree_view("functions"))
52 {
53  for (size_t i = 0; i < SAL_N_ELEMENTS(SCSTR_SUBTOTALS); ++i)
54  mxLbFunctions->append_text(ScResId(SCSTR_SUBTOTALS[i]));
55 
56  auto nHeight = mxLbColumns->get_height_rows(14);
57  mxLbColumns->set_size_request(-1, nHeight);
58  mxLbFunctions->set_size_request(-1, nHeight);
59 
60  mxLbColumns->enable_toggle_buttons(weld::ColumnToggleType::Check);
61 
62  Init();
63 }
64 
66 {
67 }
68 
70 {
71  const ScSubTotalItem& rSubTotalItem = static_cast<const ScSubTotalItem&>(
73 
74  pViewData = rSubTotalItem.GetViewData();
75  pDoc = pViewData ? pViewData->GetDocument() : nullptr;
76 
77  OSL_ENSURE( pViewData && pDoc, "ViewData or Document not found :-(" );
78 
79  mxLbGroup->connect_changed( LINK( this, ScTpSubTotalGroup, SelectListBoxHdl ) );
80  mxLbColumns->connect_changed( LINK( this, ScTpSubTotalGroup, SelectTreeListBoxHdl ) );
81  mxLbColumns->connect_toggled( LINK( this, ScTpSubTotalGroup, CheckHdl ) );
82  mxLbFunctions->connect_changed( LINK( this, ScTpSubTotalGroup, SelectTreeListBoxHdl) );
83 
84  nFieldArr[0] = 0;
85  FillListBoxes();
86 }
87 
88 bool ScTpSubTotalGroup::DoReset( sal_uInt16 nGroupNo,
89  const SfxItemSet& rArgSet )
90 {
91  sal_uInt16 nGroupIdx = 0;
92 
93  OSL_ENSURE( (nGroupNo<=3) && (nGroupNo>0), "Invalid group" );
94 
95  if ( (nGroupNo > 3) || (nGroupNo == 0) )
96  return false;
97  else
98  nGroupIdx = nGroupNo-1;
99 
100  // first we have to clear the listboxes...
101  for (int nLbEntry = 0, nCount = mxLbColumns->n_children(); nLbEntry < nCount; ++nLbEntry)
102  {
103  mxLbColumns->set_toggle(nLbEntry, TRISTATE_FALSE);
104  mxLbColumns->set_id(nLbEntry, "0");
105  }
106  mxLbFunctions->select(0);
107 
108  ScSubTotalParam theSubTotalData( static_cast<const ScSubTotalItem&>(
109  rArgSet.Get( nWhichSubTotals )).
110  GetSubTotalData() );
111 
112  if ( theSubTotalData.bGroupActive[nGroupIdx] )
113  {
114  SCCOL nField = theSubTotalData.nField[nGroupIdx];
115  SCCOL nSubTotals = theSubTotalData.nSubTotals[nGroupIdx];
116  SCCOL* pSubTotals = theSubTotalData.pSubTotals[nGroupIdx];
117  ScSubTotalFunc* pFunctions = theSubTotalData.pFunctions[nGroupIdx];
118 
119  mxLbGroup->set_active( GetFieldSelPos( nField )+1 );
120 
121  sal_uInt16 nFirstChecked = 0;
122  for ( sal_uInt16 i=0; i<nSubTotals; i++ )
123  {
124  sal_uInt16 nCheckPos = GetFieldSelPos( pSubTotals[i] );
125 
126  mxLbColumns->set_toggle(nCheckPos, TRISTATE_TRUE);
127  mxLbColumns->set_id(nCheckPos, OUString::number(FuncToLbPos(pFunctions[i])));
128 
129  if (i == 0 || nCheckPos < nFirstChecked)
130  nFirstChecked = nCheckPos;
131  }
132  // Select the first checked field from the top.
133  mxLbColumns->select(nFirstChecked);
134  }
135  else
136  {
137  mxLbGroup->set_active( (nGroupNo == 1) ? 1 : 0 );
138  mxLbColumns->select( 0 );
139  mxLbFunctions->select( 0 );
140  }
141 
142  return true;
143 }
144 
145 namespace
146 {
147  int GetCheckedEntryCount(const weld::TreeView& rTreeView)
148  {
149  int nRet = 0;
150  for (sal_Int32 i=0, nEntryCount = rTreeView.n_children(); i < nEntryCount; ++i)
151  {
152  if (rTreeView.get_toggle(i) == TRISTATE_TRUE)
153  ++nRet;
154  }
155  return nRet;
156  }
157 }
158 
159 bool ScTpSubTotalGroup::DoFillItemSet( sal_uInt16 nGroupNo,
160  SfxItemSet& rArgSet )
161 {
162  sal_uInt16 nGroupIdx = 0;
163 
164  OSL_ENSURE( (nGroupNo<=3) && (nGroupNo>0), "Invalid group" );
165  OSL_ENSURE( (mxLbGroup->get_count() > 0)
166  && (mxLbColumns->n_children() > 0)
167  && (mxLbFunctions->n_children() > 0),
168  "Non-initialized Lists" );
169 
170  if ( (nGroupNo > 3) || (nGroupNo == 0)
171  || (mxLbGroup->get_count() == 0)
172  || (mxLbColumns->n_children() == 0)
173  || (mxLbFunctions->n_children() == 0)
174  )
175  return false;
176  else
177  nGroupIdx = nGroupNo-1;
178 
179  ScSubTotalParam theSubTotalData; // read out, if already partly filled
180  const SfxItemSet* pExample = GetDialogExampleSet();
181  if (pExample)
182  {
183  const SfxPoolItem* pItem;
184  if (pExample->GetItemState(nWhichSubTotals, true, &pItem) == SfxItemState::SET)
185  theSubTotalData = static_cast<const ScSubTotalItem*>(pItem)->GetSubTotalData();
186  }
187 
188  std::unique_ptr<ScSubTotalFunc[]> pFunctions;
189  std::unique_ptr<SCCOL[]> pSubTotals;
190  const sal_Int32 nGroup = mxLbGroup->get_active();
191  const sal_Int32 nEntryCount = mxLbColumns->n_children();
192  const sal_Int32 nCheckCount = GetCheckedEntryCount(*mxLbColumns);
193 
194  theSubTotalData.nCol1 = rSubTotalData.nCol1;
195  theSubTotalData.nRow1 = rSubTotalData.nRow1;
196  theSubTotalData.nCol2 = rSubTotalData.nCol2;
197  theSubTotalData.nRow2 = rSubTotalData.nRow2;
198  theSubTotalData.bGroupActive[nGroupIdx] = (nGroup != 0);
199  theSubTotalData.nField[nGroupIdx] = (nGroup != 0)
200  ? nFieldArr[nGroup-1]
201  : static_cast<SCCOL>(0);
202 
203  if ( nEntryCount>0 && nCheckCount>0 && nGroup!=0 )
204  {
205  sal_uInt16 nFunction = 0;
206 
207  pSubTotals.reset(new SCCOL [nCheckCount]);
208  pFunctions.reset(new ScSubTotalFunc [nCheckCount]);
209 
210  for ( sal_Int32 i=0, nCheck=0; i<nEntryCount; i++ )
211  {
212  if (mxLbColumns->get_toggle(i) == TRISTATE_TRUE)
213  {
214  OSL_ENSURE( nCheck <= nCheckCount,
215  "Range error :-(" );
216  nFunction = mxLbColumns->get_id(i).toUInt32();
217  pSubTotals[nCheck] = nFieldArr[i];
218  pFunctions[nCheck] = LbPosToFunc( nFunction );
219  nCheck++;
220  }
221  }
222  theSubTotalData.SetSubTotals( nGroupNo, // group number
223  pSubTotals.get(),
224  pFunctions.get(),
225  nCheckCount ); // number of array elements
226 
227  }
228 
229  rArgSet.Put( ScSubTotalItem( SCITEM_SUBTDATA, &theSubTotalData ) );
230 
231  return true;
232 }
233 
235 {
236  OSL_ENSURE( pViewData && pDoc, "ViewData or Document not found :-/" );
237 
238  if ( !(pViewData && pDoc) )
239  return;
240 
241  SCCOL nFirstCol = rSubTotalData.nCol1;
242  SCROW nFirstRow = rSubTotalData.nRow1;
243  SCTAB nTab = pViewData->GetTabNo();
244  SCCOL nMaxCol = rSubTotalData.nCol2;
245  SCCOL col;
246  OUString aFieldName;
247 
248  mxLbGroup->clear();
249  mxLbColumns->clear();
250  mxLbGroup->insert_text(0, aStrNone );
251 
252  sal_uInt16 i=0;
253  for ( col=nFirstCol; col<=nMaxCol && i<SC_MAXFIELDS; col++ )
254  {
255  aFieldName = pDoc->GetString(col, nFirstRow, nTab);
256  if ( aFieldName.isEmpty() )
257  {
258  aFieldName = ScGlobal::ReplaceOrAppend( aStrColumn, "%1", ScColToAlpha( col ));
259  }
260  nFieldArr[i] = col;
261  mxLbGroup->insert_text(i+1, aFieldName);
262  mxLbColumns->insert(i);
263  mxLbColumns->set_toggle(i, TRISTATE_FALSE);
264  mxLbColumns->set_text(i, aFieldName, 0);
265  mxLbColumns->set_id(i, "0");
266  i++;
267  }
268  // subsequent initialization of the constant:
269  nFieldCount = i;
270 }
271 
273 {
274  sal_uInt16 nFieldPos = 0;
275  bool bFound = false;
276 
277  for ( sal_uInt16 n=0; n<nFieldCount && !bFound; n++ )
278  {
279  if ( nFieldArr[n] == nField )
280  {
281  nFieldPos = n;
282  bFound = true;
283  }
284  }
285 
286  return nFieldPos;
287 }
288 
290 {
291  switch ( nPos )
292  {
293 // case 0: return SUBTOTAL_FUNC_NONE;
294  case 2: return SUBTOTAL_FUNC_AVE;
295  case 6: return SUBTOTAL_FUNC_CNT;
296  case 1: return SUBTOTAL_FUNC_CNT2;
297  case 3: return SUBTOTAL_FUNC_MAX;
298  case 4: return SUBTOTAL_FUNC_MIN;
299  case 5: return SUBTOTAL_FUNC_PROD;
300  case 7: return SUBTOTAL_FUNC_STD;
301  case 8: return SUBTOTAL_FUNC_STDP;
302  case 0: return SUBTOTAL_FUNC_SUM;
303  case 9: return SUBTOTAL_FUNC_VAR;
304  case 10: return SUBTOTAL_FUNC_VARP;
305  default:
306  OSL_FAIL( "ScTpSubTotalGroup::LbPosToFunc" );
307  return SUBTOTAL_FUNC_NONE;
308  }
309 }
310 
312 {
313  switch ( eFunc )
314  {
315 // case SUBTOTAL_FUNC_NONE: return 0;
316  case SUBTOTAL_FUNC_AVE: return 2;
317  case SUBTOTAL_FUNC_CNT: return 6;
318  case SUBTOTAL_FUNC_CNT2: return 1;
319  case SUBTOTAL_FUNC_MAX: return 3;
320  case SUBTOTAL_FUNC_MIN: return 4;
321  case SUBTOTAL_FUNC_PROD: return 5;
322  case SUBTOTAL_FUNC_STD: return 7;
323  case SUBTOTAL_FUNC_STDP: return 8;
324  case SUBTOTAL_FUNC_SUM: return 0;
325  case SUBTOTAL_FUNC_VAR: return 9;
326  case SUBTOTAL_FUNC_VARP: return 10;
327  default:
328  OSL_FAIL( "ScTpSubTotalGroup::FuncToLbPos" );
329  return 0;
330  }
331 }
332 
333 // Handler:
334 
335 IMPL_LINK(ScTpSubTotalGroup, SelectTreeListBoxHdl, weld::TreeView&, rLb, void)
336 {
337  SelectHdl(&rLb);
338 }
339 
340 IMPL_LINK(ScTpSubTotalGroup, SelectListBoxHdl, weld::ComboBox&, rLb, void)
341 {
342  SelectHdl(&rLb);
343 }
344 
346 {
347  const sal_Int32 nColumn = mxLbColumns->get_selected_index();
348  if (nColumn == -1)
349  return;
350 
351  const sal_Int32 nFunction = mxLbFunctions->get_selected_index();
352  sal_uInt16 nOldFunction = mxLbColumns->get_id(nColumn).toUInt32();
353 
354  if ( pLb == mxLbColumns.get() )
355  {
356  mxLbFunctions->select(nOldFunction);
357  }
358  else if ( pLb == mxLbFunctions.get() )
359  {
360  mxLbColumns->set_id(nColumn, OUString::number(nFunction));
361  mxLbColumns->set_toggle(nColumn, TRISTATE_TRUE);
362  }
363 }
364 
365 IMPL_LINK( ScTpSubTotalGroup, CheckHdl, const weld::TreeView::iter_col&, rRowCol, void )
366 {
367  mxLbColumns->select(rRowCol.first);
368  SelectHdl(mxLbColumns.get());
369 }
370 
371 // Derived Group TabPages:
372 
373 std::unique_ptr<SfxTabPage> ScTpSubTotalGroup1::Create( weld::Container* pPage, weld::DialogController* pController,
374  const SfxItemSet* rArgSet )
375 {
376  return std::make_unique<ScTpSubTotalGroup1>( pPage, pController, *rArgSet );
377 }
378 
379 std::unique_ptr<SfxTabPage> ScTpSubTotalGroup2::Create( weld::Container* pPage, weld::DialogController* pController,
380  const SfxItemSet* rArgSet )
381 {
382  return std::make_unique<ScTpSubTotalGroup2>( pPage, pController, *rArgSet );
383 }
384 
385 std::unique_ptr<SfxTabPage> ScTpSubTotalGroup3::Create( weld::Container* pPage, weld::DialogController* pController,
386  const SfxItemSet* rArgSet )
387 {
388  return std::make_unique<ScTpSubTotalGroup3>( pPage, pController, *rArgSet );
389 }
390 
392  ScTpSubTotalGroup( pPage, pController, rArgSet )
393 {}
394 
396  ScTpSubTotalGroup( pPage, pController, rArgSet )
397 {}
398 
400  ScTpSubTotalGroup( pPage, pController, rArgSet )
401 {}
402 
403 #define RESET(i) (ScTpSubTotalGroup::DoReset( (i), *rArgSet ))
404 void ScTpSubTotalGroup1::Reset( const SfxItemSet* rArgSet ) { RESET(1); }
405 void ScTpSubTotalGroup2::Reset( const SfxItemSet* rArgSet ) { RESET(2); }
406 void ScTpSubTotalGroup3::Reset( const SfxItemSet* rArgSet ) { RESET(3); }
407 #undef RESET
408 
409 #define FILLSET(i) (ScTpSubTotalGroup::DoFillItemSet( (i), *rArgSet ))
410 bool ScTpSubTotalGroup1::FillItemSet( SfxItemSet* rArgSet ) { return FILLSET(1); }
411 bool ScTpSubTotalGroup2::FillItemSet( SfxItemSet* rArgSet ) { return FILLSET(2); }
412 bool ScTpSubTotalGroup3::FillItemSet( SfxItemSet* rArgSet ) { return FILLSET(3); }
413 #undef FILL
414 
415 // options tab page:
416 
418 
419  : SfxTabPage ( pPage, pController,
420  "modules/scalc/ui/subtotaloptionspage.ui", "SubTotalOptionsPage",
421  &rArgSet ),
422  pViewData ( nullptr ),
423  pDoc ( nullptr ),
424  nWhichSubTotals ( rArgSet.GetPool()->GetWhich( SID_SUBTOTALS ) ),
425  rSubTotalData ( static_cast<const ScSubTotalItem&>(
426  rArgSet.Get( nWhichSubTotals )).
427  GetSubTotalData() )
428  , m_xBtnPagebreak(m_xBuilder->weld_check_button("pagebreak"))
429  , m_xBtnCase(m_xBuilder->weld_check_button("case"))
430  , m_xBtnSort(m_xBuilder->weld_check_button("sort"))
431  , m_xFlSort(m_xBuilder->weld_label("label2"))
432  , m_xBtnAscending(m_xBuilder->weld_radio_button("ascending"))
433  , m_xBtnDescending(m_xBuilder->weld_radio_button("descending"))
434  , m_xBtnFormats(m_xBuilder->weld_check_button("formats"))
435  , m_xBtnUserDef(m_xBuilder->weld_check_button("btnuserdef"))
436  , m_xLbUserDef(m_xBuilder->weld_combo_box("lbuserdef"))
437 {
438  Init();
439 }
440 
442 {
443 }
444 
446 {
447  const ScSubTotalItem& rSubTotalItem = static_cast<const ScSubTotalItem&>(
449 
450  pViewData = rSubTotalItem.GetViewData();
451  pDoc = pViewData ? pViewData->GetDocument() : nullptr;
452 
453  OSL_ENSURE( pViewData && pDoc, "ViewData or Document not found!" );
454 
455  m_xBtnSort->connect_clicked( LINK( this, ScTpSubTotalOptions, CheckHdl ) );
456  m_xBtnUserDef->connect_clicked( LINK( this, ScTpSubTotalOptions, CheckHdl ) );
457 
459 }
460 
461 std::unique_ptr<SfxTabPage> ScTpSubTotalOptions::Create(weld::Container* pPage, weld::DialogController* pController,
462  const SfxItemSet* rArgSet)
463 {
464  return std::make_unique<ScTpSubTotalOptions>(pPage, pController, *rArgSet);
465 }
466 
467 void ScTpSubTotalOptions::Reset( const SfxItemSet* /* rArgSet */ )
468 {
470  m_xBtnCase->set_active( rSubTotalData.bCaseSens );
472  m_xBtnSort->set_active( rSubTotalData.bDoSort );
474  m_xBtnDescending->set_active( !rSubTotalData.bAscending );
475 
476  if ( rSubTotalData.bUserDef )
477  {
478  m_xBtnUserDef->set_active(true);
479  m_xLbUserDef->set_sensitive(true);
481  }
482  else
483  {
484  m_xBtnUserDef->set_active( false );
485  m_xLbUserDef->set_sensitive(false);
486  m_xLbUserDef->set_active(0);
487  }
488 
489  CheckHdl(*m_xBtnSort);
490 }
491 
493 {
494  ScSubTotalParam theSubTotalData; // read out, if already partly filled
495  const SfxItemSet* pExample = GetDialogExampleSet();
496  if (pExample)
497  {
498  const SfxPoolItem* pItem;
499  if (pExample->GetItemState(nWhichSubTotals, true, &pItem) == SfxItemState::SET)
500  theSubTotalData = static_cast<const ScSubTotalItem*>(pItem)->GetSubTotalData();
501  }
502 
503  theSubTotalData.bPagebreak = m_xBtnPagebreak->get_active();
504  theSubTotalData.bReplace = true;
505  theSubTotalData.bCaseSens = m_xBtnCase->get_active();
506  theSubTotalData.bIncludePattern = m_xBtnFormats->get_active();
507  theSubTotalData.bDoSort = m_xBtnSort->get_active();
508  theSubTotalData.bAscending = m_xBtnAscending->get_active();
509  theSubTotalData.bUserDef = m_xBtnUserDef->get_active();
510  theSubTotalData.nUserIndex = (m_xBtnUserDef->get_active())
511  ? m_xLbUserDef->get_active()
512  : 0;
513 
514  rArgSet->Put( ScSubTotalItem( nWhichSubTotals, &theSubTotalData ) );
515 
516  return true;
517 }
518 
520 {
521  ScUserList* pUserLists = ScGlobal::GetUserList();
522 
523  m_xLbUserDef->freeze();
524  m_xLbUserDef->clear();
525  if ( pUserLists )
526  {
527  size_t nCount = pUserLists->size();
528  for ( size_t i=0; i<nCount; ++i )
529  m_xLbUserDef->append_text((*pUserLists)[i].GetString() );
530  }
531  m_xLbUserDef->thaw();
532 }
533 
534 // Handler:
535 
537 {
538  if (&rBox == m_xBtnSort.get())
539  {
540  if ( m_xBtnSort->get_active() )
541  {
542  m_xFlSort->set_sensitive(true);
543  m_xBtnFormats->set_sensitive(true);
544  m_xBtnUserDef->set_sensitive(true);
545  m_xBtnAscending->set_sensitive(true);
546  m_xBtnDescending->set_sensitive(true);
547 
548  if ( m_xBtnUserDef->get_active() )
549  m_xLbUserDef->set_sensitive(true);
550  }
551  else
552  {
553  m_xFlSort->set_sensitive(false);
554  m_xBtnFormats->set_sensitive(false);
555  m_xBtnUserDef->set_sensitive(false);
556  m_xBtnAscending->set_sensitive(false);
557  m_xBtnDescending->set_sensitive(false);
558  m_xLbUserDef->set_sensitive(false);
559  }
560  }
561  else if (&rBox == m_xBtnUserDef.get())
562  {
563  if ( m_xBtnUserDef->get_active() )
564  {
565  m_xLbUserDef->set_sensitive(true);
566  m_xLbUserDef->grab_focus();
567  }
568  else
569  m_xLbUserDef->set_sensitive(false);
570  }
571 }
572 
574 {
575 }
576 
578 {
579 }
580 
582 {
583 }
584 
585 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool bGroupActive[MAXSUBTOTAL]
active groups
static sal_uInt16 FuncToLbPos(ScSubTotalFunc eFunc)
Definition: tpsubt.cxx:311
Collection of user-defined sort lists.
Definition: userlist.hxx:66
ScDocument * pDoc
Definition: tpsubt.hxx:133
SCCOL nField[MAXSUBTOTAL]
associated field
bool bUserDef
sort user defined
SCCOL nCol1
selected area
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rArgSet)
Definition: tpsubt.cxx:379
virtual ~ScTpSubTotalGroup() override
Definition: tpsubt.cxx:65
std::unique_ptr< weld::CheckButton > m_xBtnPagebreak
Definition: tpsubt.hxx:137
sal_Int64 n
ScTpSubTotalGroup2(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rArgSet)
Definition: tpsubt.cxx:395
void ScColToAlpha(OUStringBuffer &rBuf, SCCOL nCol)
append alpha representation of column to buffer
Definition: address.cxx:1921
virtual ~ScTpSubTotalGroup1() override
Definition: tpsubt.cxx:573
virtual void Reset(const SfxItemSet *rArgSet) override
Definition: tpsubt.cxx:467
SCTAB GetTabNo() const
Definition: viewdata.hxx:395
size_t size() const
Definition: userlist.cxx:345
bool bDoSort
presort
virtual void Reset(const SfxItemSet *rArgSet) override
Definition: tpsubt.cxx:404
virtual bool FillItemSet(SfxItemSet *rArgSet) override
Definition: tpsubt.cxx:411
bool bPagebreak
page break at change of group
#define SCITEM_SUBTDATA
Definition: scitems.hxx:92
ScViewData * GetViewData() const
Definition: uiitems.hxx:189
static SC_DLLPUBLIC OUString ReplaceOrAppend(const OUString &rString, const OUString &rPlaceholder, const OUString &rReplacement)
Replaces the first occurrence of rPlaceholder in rString with rReplacement, or if rPlaceholder is not...
Definition: global.cxx:1072
TRISTATE_TRUE
virtual TriState get_toggle(int row, int col=-1) const =0
ScTpSubTotalGroup(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rArgSet)
Definition: tpsubt.cxx:40
std::unique_ptr< weld::CheckButton > m_xBtnCase
Definition: tpsubt.hxx:138
sal_uInt16 nUserIndex
index into list
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rArgSet)
Definition: tpsubt.cxx:385
std::pair< const TreeIter &, int > iter_col
int nCount
virtual int n_children() const =0
SC_DLLPUBLIC OUString GetString(SCCOL nCol, SCROW nRow, SCTAB nTab, const ScInterpreterContext *pContext=nullptr) const
Definition: document.cxx:3489
void SetSubTotals(sal_uInt16 nGroup, const SCCOL *ptrSubTotals, const ScSubTotalFunc *ptrFuncions, sal_uInt16 nCount)
void SelectHdl(const weld::Widget *)
Definition: tpsubt.cxx:345
ScDocument * GetDocument() const
Definition: viewdata.cxx:859
virtual ~ScTpSubTotalGroup3() override
Definition: tpsubt.cxx:581
std::unique_ptr< weld::RadioButton > m_xBtnAscending
Definition: tpsubt.hxx:141
ScDocument * pDoc
Definition: tpsubt.hxx:50
const SfxItemSet & GetItemSet() const
#define SAL_N_ELEMENTS(arr)
SCCOL nFieldArr[SC_MAXFIELDS]
Definition: tpsubt.hxx:54
bool DoFillItemSet(sal_uInt16 nGroupNo, SfxItemSet &rArgSet)
Definition: tpsubt.cxx:159
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rArgSet)
Definition: tpsubt.cxx:373
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
int i
void FillUserSortListBox()
Definition: tpsubt.cxx:519
const OUString aStrColumn
Definition: tpsubt.hxx:47
std::unique_ptr< weld::CheckButton > m_xBtnFormats
Definition: tpsubt.hxx:143
sal_Int16 SCCOL
Definition: types.hxx:22
ScTpSubTotalGroup3(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rArgSet)
Definition: tpsubt.cxx:399
sal_uInt16 GetFieldSelPos(SCCOL nField)
Definition: tpsubt.cxx:272
TRISTATE_FALSE
OUString ScResId(const char *pId)
Definition: scdll.cxx:95
static SC_DLLPUBLIC ScUserList * GetUserList()
Definition: global.cxx:275
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rArgSet)
Definition: tpsubt.cxx:461
std::unique_ptr< weld::CheckButton > m_xBtnUserDef
Definition: tpsubt.hxx:144
bool DoReset(sal_uInt16 nGroupNo, const SfxItemSet &rArgSet)
Definition: tpsubt.cxx:88
std::unique_ptr< weld::TreeView > mxLbColumns
Definition: tpsubt.hxx:58
sal_uInt16 nFieldCount
Definition: tpsubt.hxx:55
std::unique_ptr< weld::CheckButton > m_xBtnSort
Definition: tpsubt.hxx:139
#define SC_MAXFIELDS
Definition: tpsort.hxx:37
ScViewData * pViewData
Definition: tpsubt.hxx:49
const SfxItemSet * GetDialogExampleSet() const
IMPL_LINK(ScTpSubTotalGroup, SelectTreeListBoxHdl, weld::TreeView &, rLb, void)
Definition: tpsubt.cxx:335
virtual bool FillItemSet(SfxItemSet *rArgSet) override
Definition: tpsubt.cxx:410
bool bReplace
replace existing results
virtual ~ScTpSubTotalGroup2() override
Definition: tpsubt.cxx:577
static ScSubTotalFunc LbPosToFunc(sal_uInt16 nPos)
Definition: tpsubt.cxx:289
#define RESET(i)
Definition: tpsubt.cxx:403
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
sal_Int32 SCROW
Definition: types.hxx:18
ScViewData * pViewData
Definition: tpsubt.hxx:132
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
#define GetWhich(nSlot)
#define FILLSET(i)
Definition: tpsubt.cxx:409
std::unique_ptr< weld::RadioButton > m_xBtnDescending
Definition: tpsubt.hxx:142
std::unique_ptr< weld::ComboBox > m_xLbUserDef
Definition: tpsubt.hxx:145
bool bIncludePattern
sort formats
virtual bool FillItemSet(SfxItemSet *rArgSet) override
Definition: tpsubt.cxx:412
std::unique_ptr< weld::TreeView > mxLbFunctions
Definition: tpsubt.hxx:59
virtual void Reset(const SfxItemSet *rArgSet) override
Definition: tpsubt.cxx:406
ScTpSubTotalGroup1(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rArgSet)
Definition: tpsubt.cxx:391
virtual bool FillItemSet(SfxItemSet *rArgSet) override
Definition: tpsubt.cxx:492
const sal_uInt16 nWhichSubTotals
Definition: tpsubt.hxx:134
const ScSubTotalParam & rSubTotalData
Definition: tpsubt.hxx:53
const sal_uInt16 nWhichSubTotals
Definition: tpsubt.hxx:52
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
ScTpSubTotalOptions(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rArgSet)
Definition: tpsubt.cxx:417
ScSubTotalFunc
Definition: global.hxx:845
virtual ~ScTpSubTotalOptions() override
Definition: tpsubt.cxx:441
const OUString aStrNone
Definition: tpsubt.hxx:46
const ScSubTotalParam & rSubTotalData
Definition: tpsubt.hxx:135
virtual void Reset(const SfxItemSet *rArgSet) override
Definition: tpsubt.cxx:405
void FillListBoxes()
Definition: tpsubt.cxx:234
bool bAscending
sort ascending
std::unique_ptr< weld::ComboBox > mxLbGroup
Definition: tpsubt.hxx:57
sal_Int16 SCTAB
Definition: types.hxx:23