LibreOffice Module sc (master)  1
pvfundlg.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 <pvfundlg.hxx>
23 
24 #include <com/sun/star/sheet/DataPilotFieldReferenceType.hpp>
25 #include <com/sun/star/sheet/DataPilotFieldReferenceItemType.hpp>
26 #include <com/sun/star/sheet/DataPilotFieldLayoutMode.hpp>
27 #include <com/sun/star/sheet/DataPilotFieldSortMode.hpp>
28 #include <com/sun/star/sheet/DataPilotFieldShowItemsMode.hpp>
29 
30 #include <osl/diagnose.h>
31 
32 #include <scresid.hxx>
33 #include <dpobject.hxx>
34 #include <dpsave.hxx>
35 #include <pvfundlg.hrc>
36 #include <globstr.hrc>
37 #include <dputil.hxx>
38 
39 #include <vector>
40 
41 using namespace ::com::sun::star::sheet;
42 
43 using ::com::sun::star::uno::Sequence;
44 using ::std::vector;
45 
46 namespace {
47 
56 bool lclFillListBox(weld::ComboBox& rLBox, const Sequence< OUString >& rStrings)
57 {
58  bool bEmpty = false;
59  for (const OUString& str : rStrings)
60  {
61  if (!str.isEmpty())
62  rLBox.append_text(str);
63  else
64  {
65  rLBox.append_text(ScResId(STR_EMPTYDATA));
66  bEmpty = true;
67  }
68  }
69  return bEmpty;
70 }
71 
72 bool lclFillListBox(weld::ComboBox& rLBox, const vector<ScDPLabelData::Member>& rMembers, int nEmptyPos)
73 {
74  bool bEmpty = false;
75  vector<ScDPLabelData::Member>::const_iterator itr = rMembers.begin(), itrEnd = rMembers.end();
76  for (; itr != itrEnd; ++itr)
77  {
78  OUString aName = itr->getDisplayName();
79  if (!aName.isEmpty())
80  rLBox.append_text(aName);
81  else
82  {
83  rLBox.insert_text(nEmptyPos, ScResId(STR_EMPTYDATA));
84  bEmpty = true;
85  }
86  }
87  return bEmpty;
88 }
89 
90 bool lclFillListBox(weld::TreeView& rLBox, const vector<ScDPLabelData::Member>& rMembers)
91 {
92  bool bEmpty = false;
93  for (const auto& rMember : rMembers)
94  {
95  rLBox.append();
96  int pos = rLBox.n_children() - 1;
97  rLBox.set_toggle(pos, TRISTATE_FALSE);
98  OUString aName = rMember.getDisplayName();
99  if (!aName.isEmpty())
100  rLBox.set_text(pos, aName, 0);
101  else
102  {
103  rLBox.set_text(pos, ScResId(STR_EMPTYDATA), 0);
104  bEmpty = true;
105  }
106  }
107  return bEmpty;
108 }
109 
111 const PivotFunc spnFunctions[] =
112 {
125 };
126 
127 const sal_uInt16 SC_BASEITEM_PREV_POS = 0;
128 const sal_uInt16 SC_BASEITEM_NEXT_POS = 1;
129 const sal_uInt16 SC_BASEITEM_USER_POS = 2;
130 
131 const sal_uInt16 SC_SORTNAME_POS = 0;
132 const sal_uInt16 SC_SORTDATA_POS = 1;
133 
134 const tools::Long SC_SHOW_DEFAULT = 10;
135 
136 } // namespace
137 
138 ScDPFunctionListBox::ScDPFunctionListBox(std::unique_ptr<weld::TreeView> xControl)
139  : m_xControl(std::move(xControl))
140 {
142 }
143 
145 {
146  if( (nFuncMask == PivotFunc::NONE) || (nFuncMask == PivotFunc::Auto) )
147  m_xControl->unselect_all();
148  else
149  {
150  for( sal_Int32 nEntry = 0, nCount = m_xControl->n_children(); nEntry < nCount; ++nEntry )
151  {
152  if (bool(nFuncMask & spnFunctions[ nEntry ]))
153  m_xControl->select(nEntry);
154  else
155  m_xControl->unselect(nEntry);
156  }
157  }
158 }
159 
161 {
162  PivotFunc nFuncMask = PivotFunc::NONE;
163  std::vector<int> aRows = m_xControl->get_selected_rows();
164  for (int nSel : aRows)
165  nFuncMask |= spnFunctions[nSel];
166  return nFuncMask;
167 }
168 
170 {
171  OSL_ENSURE( !m_xControl->n_children(), "ScDPMultiFuncListBox::FillFunctionNames - do not add texts to resource" );
172  m_xControl->clear();
173  m_xControl->freeze();
174  for (size_t nIndex = 0; nIndex < SAL_N_ELEMENTS(SCSTR_DPFUNCLISTBOX); ++nIndex)
175  m_xControl->append_text(ScResId(SCSTR_DPFUNCLISTBOX[nIndex]));
176  m_xControl->thaw();
177  assert(m_xControl->n_children() == SAL_N_ELEMENTS(spnFunctions));
178 }
179 
180 namespace
181 {
182  int FromDataPilotFieldReferenceType(int eMode)
183  {
184  switch (eMode)
185  {
187  return 0;
188  case DataPilotFieldReferenceType::ITEM_DIFFERENCE:
189  return 1;
190  case DataPilotFieldReferenceType::ITEM_PERCENTAGE:
191  return 2;
192  case DataPilotFieldReferenceType::ITEM_PERCENTAGE_DIFFERENCE:
193  return 3;
194  case DataPilotFieldReferenceType::RUNNING_TOTAL:
195  return 4;
196  case DataPilotFieldReferenceType::ROW_PERCENTAGE:
197  return 5;
198  case DataPilotFieldReferenceType::COLUMN_PERCENTAGE:
199  return 6;
200  case DataPilotFieldReferenceType::TOTAL_PERCENTAGE:
201  return 7;
202  case DataPilotFieldReferenceType::INDEX:
203  return 8;
204  }
205  return -1;
206  }
207 
208  int ToDataPilotFieldReferenceType(int nPos)
209  {
210  switch (nPos)
211  {
212  case 0:
214  case 1:
215  return DataPilotFieldReferenceType::ITEM_DIFFERENCE;
216  case 2:
217  return DataPilotFieldReferenceType::ITEM_PERCENTAGE;
218  case 3:
219  return DataPilotFieldReferenceType::ITEM_PERCENTAGE_DIFFERENCE;
220  case 4:
221  return DataPilotFieldReferenceType::RUNNING_TOTAL;
222  case 5:
223  return DataPilotFieldReferenceType::ROW_PERCENTAGE;
224  case 6:
225  return DataPilotFieldReferenceType::COLUMN_PERCENTAGE;
226  case 7:
227  return DataPilotFieldReferenceType::TOTAL_PERCENTAGE;
228  case 8:
229  return DataPilotFieldReferenceType::INDEX;
230  }
232 
233  }
234 }
235 
237  weld::Widget* pParent, const ScDPLabelDataVector& rLabelVec,
238  const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData)
239  : GenericDialogController(pParent, "modules/scalc/ui/datafielddialog.ui", "DataFieldDialog")
240  , mxLbFunc(new ScDPFunctionListBox(m_xBuilder->weld_tree_view("functions")))
241  , mxFtName(m_xBuilder->weld_label("name"))
242  , mxLbType(m_xBuilder->weld_combo_box("type"))
243  , mxFtBaseField(m_xBuilder->weld_label("basefieldft"))
244  , mxLbBaseField(m_xBuilder->weld_combo_box("basefield"))
245  , mxFtBaseItem(m_xBuilder->weld_label("baseitemft"))
246  , mxLbBaseItem(m_xBuilder->weld_combo_box("baseitem"))
247  , mxBtnOk(m_xBuilder->weld_button("ok"))
248  , mxBtnCancel(m_xBuilder->weld_button("cancel"))
249  , mxExpander(m_xBuilder->weld_expander("expander"))
250  , mrLabelVec(rLabelVec)
251  , mbEmptyItem(false)
252 {
253  mxLbFunc->set_size_request(-1, mxLbFunc->get_height_rows(8));
254 
255  Init(rLabelData, rFuncData);
256 }
257 
259 {
260 }
261 
263 {
264  return mxLbFunc->GetSelection();
265 }
266 
267 DataPilotFieldReference ScDPFunctionDlg::GetFieldRef() const
268 {
269  DataPilotFieldReference aRef;
270 
271  aRef.ReferenceType = ToDataPilotFieldReferenceType(mxLbType->get_active());
272  aRef.ReferenceField = GetBaseFieldName(mxLbBaseField->get_active_text());
273 
274  sal_Int32 nBaseItemPos = mxLbBaseItem->get_active();
275  switch( nBaseItemPos )
276  {
277  case SC_BASEITEM_PREV_POS:
278  aRef.ReferenceItemType = DataPilotFieldReferenceItemType::PREVIOUS;
279  break;
280  case SC_BASEITEM_NEXT_POS:
281  aRef.ReferenceItemType = DataPilotFieldReferenceItemType::NEXT;
282  break;
283  default:
284  {
285  aRef.ReferenceItemType = DataPilotFieldReferenceItemType::NAMED;
286  if( !mbEmptyItem || (nBaseItemPos > SC_BASEITEM_USER_POS) )
287  aRef.ReferenceItemName = GetBaseItemName(mxLbBaseItem->get_active_text());
288  }
289  }
290 
291  return aRef;
292 }
293 
294 void ScDPFunctionDlg::Init( const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData )
295 {
296  mxBtnOk->connect_clicked( LINK( this, ScDPFunctionDlg, ButtonClicked ) );
297  mxBtnCancel->connect_clicked( LINK( this, ScDPFunctionDlg, ButtonClicked ) );
298 
299  // list box
300  PivotFunc nFuncMask = (rFuncData.mnFuncMask == PivotFunc::NONE) ? PivotFunc::Sum : rFuncData.mnFuncMask;
301  mxLbFunc->SetSelection( nFuncMask );
302 
303  // field name
304  mxFtName->set_label(rLabelData.getDisplayName());
305 
306  // handlers
307  mxLbFunc->connect_row_activated( LINK( this, ScDPFunctionDlg, DblClickHdl ) );
308  mxLbType->connect_changed( LINK( this, ScDPFunctionDlg, SelectHdl ) );
309  mxLbBaseField->connect_changed( LINK( this, ScDPFunctionDlg, SelectHdl ) );
310 
311  // base field list box
312  OUString aSelectedEntry;
313  for( const auto& rxLabel : mrLabelVec )
314  {
315  mxLbBaseField->append_text(rxLabel->getDisplayName());
316  maBaseFieldNameMap.emplace(rxLabel->getDisplayName(), rxLabel->maName);
317  if (rxLabel->maName == rFuncData.maFieldRef.ReferenceField)
318  aSelectedEntry = rxLabel->getDisplayName();
319  }
320 
321  // select field reference type
322  mxLbType->set_active(FromDataPilotFieldReferenceType(rFuncData.maFieldRef.ReferenceType));
323  SelectHdl( *mxLbType ); // enables base field/item list boxes
324 
325  // select base field
326  mxLbBaseField->set_active_text(aSelectedEntry);
327  if (mxLbBaseField->get_active() == -1)
328  mxLbBaseField->set_active(0);
329  SelectHdl( *mxLbBaseField ); // fills base item list, selects base item
330 
331  // select base item
332  switch( rFuncData.maFieldRef.ReferenceItemType )
333  {
334  case DataPilotFieldReferenceItemType::PREVIOUS:
335  mxLbBaseItem->set_active( SC_BASEITEM_PREV_POS );
336  break;
337  case DataPilotFieldReferenceItemType::NEXT:
338  mxLbBaseItem->set_active( SC_BASEITEM_NEXT_POS );
339  break;
340  default:
341  {
342  if( mbEmptyItem && rFuncData.maFieldRef.ReferenceItemName.isEmpty() )
343  {
344  // select special "(empty)" entry added before other items
345  mxLbBaseItem->set_active( SC_BASEITEM_USER_POS );
346  }
347  else
348  {
349  sal_Int32 nStartPos = mbEmptyItem ? (SC_BASEITEM_USER_POS + 1) : SC_BASEITEM_USER_POS;
350  sal_Int32 nPos = FindBaseItemPos( rFuncData.maFieldRef.ReferenceItemName, nStartPos );
351  if( nPos == -1)
352  nPos = (mxLbBaseItem->get_count() > SC_BASEITEM_USER_POS) ? SC_BASEITEM_USER_POS : SC_BASEITEM_PREV_POS;
353  mxLbBaseItem->set_active( nPos );
354  }
355  }
356  }
357 }
358 
359 const OUString& ScDPFunctionDlg::GetBaseFieldName(const OUString& rLayoutName) const
360 {
361  NameMapType::const_iterator itr = maBaseFieldNameMap.find(rLayoutName);
362  return itr == maBaseFieldNameMap.end() ? rLayoutName : itr->second;
363 }
364 
365 const OUString& ScDPFunctionDlg::GetBaseItemName(const OUString& rLayoutName) const
366 {
367  NameMapType::const_iterator itr = maBaseItemNameMap.find(rLayoutName);
368  return itr == maBaseItemNameMap.end() ? rLayoutName : itr->second;
369 }
370 
371 sal_Int32 ScDPFunctionDlg::FindBaseItemPos( std::u16string_view rEntry, sal_Int32 nStartPos ) const
372 {
373  sal_Int32 nPos = nStartPos;
374  bool bFound = false;
375  while (nPos < mxLbBaseItem->get_count())
376  {
377  // translate the displayed field name back to its original field name.
378  const OUString& rInName = mxLbBaseItem->get_text(nPos);
379  const OUString& rName = GetBaseItemName(rInName);
380  if (rName == rEntry)
381  {
382  bFound = true;
383  break;
384  }
385  ++nPos;
386  }
387  return bFound ? nPos : -1;
388 }
389 
390 IMPL_LINK( ScDPFunctionDlg, SelectHdl, weld::ComboBox&, rLBox, void )
391 {
392  if (&rLBox == mxLbType.get())
393  {
394  bool bEnableField, bEnableItem;
395  switch (ToDataPilotFieldReferenceType(mxLbType->get_active()))
396  {
397  case DataPilotFieldReferenceType::ITEM_DIFFERENCE:
398  case DataPilotFieldReferenceType::ITEM_PERCENTAGE:
399  case DataPilotFieldReferenceType::ITEM_PERCENTAGE_DIFFERENCE:
400  bEnableField = bEnableItem = true;
401  break;
402 
403  case DataPilotFieldReferenceType::RUNNING_TOTAL:
404  bEnableField = true;
405  bEnableItem = false;
406  break;
407 
408  default:
409  bEnableField = bEnableItem = false;
410  }
411 
412  bEnableField &= (mxLbBaseField->get_count() > 0);
413  mxFtBaseField->set_sensitive( bEnableField );
414  mxLbBaseField->set_sensitive( bEnableField );
415 
416  bEnableItem &= bEnableField;
417  mxFtBaseItem->set_sensitive( bEnableItem );
418  mxLbBaseItem->set_sensitive( bEnableItem );
419  }
420  else if (&rLBox == mxLbBaseField.get())
421  {
422  // keep "previous" and "next" entries
423  while (mxLbBaseItem->get_count() > SC_BASEITEM_USER_POS)
424  mxLbBaseItem->remove(SC_BASEITEM_USER_POS);
425 
426  // update item list for current base field
427  mbEmptyItem = false;
428  size_t nBasePos = mxLbBaseField->get_active();
429  if (nBasePos < mrLabelVec.size())
430  {
431  const vector<ScDPLabelData::Member>& rMembers = mrLabelVec[nBasePos]->maMembers;
432  mbEmptyItem = lclFillListBox(*mxLbBaseItem, rMembers, SC_BASEITEM_USER_POS);
433  // build cache for base names.
434  NameMapType aMap;
435  for (const auto& rMember : rMembers)
436  aMap.emplace(rMember.getDisplayName(), rMember.maName);
437  maBaseItemNameMap.swap(aMap);
438  }
439 
440  // select base item
441  sal_uInt16 nItemPos = (mxLbBaseItem->get_count() > SC_BASEITEM_USER_POS) ? SC_BASEITEM_USER_POS : SC_BASEITEM_PREV_POS;
442  mxLbBaseItem->set_active( nItemPos );
443  }
444 }
445 
446 IMPL_LINK(ScDPFunctionDlg, ButtonClicked, weld::Button&, rButton, void)
447 {
448  if (&rButton == mxBtnOk.get())
449  response(RET_OK);
450  else
451  response(RET_CANCEL);
452 }
453 
455 {
456  m_xDialog->response(RET_OK);
457  return true;
458 }
459 
461  const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData,
462  const ScDPNameVec& rDataFields, bool bEnableLayout)
463  : GenericDialogController(pParent, "modules/scalc/ui/pivotfielddialog.ui", "PivotFieldDialog")
464  , mrDPObj(rDPObj)
465  , mrDataFields(rDataFields)
466  , maLabelData(rLabelData)
467  , mbEnableLayout(bEnableLayout)
468  , mxRbNone(m_xBuilder->weld_radio_button("none"))
469  , mxRbAuto(m_xBuilder->weld_radio_button("auto"))
470  , mxRbUser(m_xBuilder->weld_radio_button("user"))
471  , mxLbFunc(new ScDPFunctionListBox(m_xBuilder->weld_tree_view("functions")))
472  , mxFtName(m_xBuilder->weld_label("name"))
473  , mxCbShowAll(m_xBuilder->weld_check_button("showall"))
474  , mxBtnOk(m_xBuilder->weld_button("ok"))
475  , mxBtnCancel(m_xBuilder->weld_button("cancel"))
476  , mxBtnOptions(m_xBuilder->weld_button("options"))
477 {
478  mxLbFunc->set_selection_mode(SelectionMode::Multiple);
479  mxLbFunc->set_size_request(-1, mxLbFunc->get_height_rows(8));
480  Init(rLabelData, rFuncData);
481 }
482 
484 {
485 }
486 
488 {
489  PivotFunc nFuncMask = PivotFunc::NONE;
490 
491  if (mxRbAuto->get_active())
492  nFuncMask = PivotFunc::Auto;
493  else if (mxRbUser->get_active())
494  nFuncMask = mxLbFunc->GetSelection();
495 
496  return nFuncMask;
497 }
498 
500 {
501  rLabelData.mnFuncMask = GetFuncMask();
502  rLabelData.mnUsedHier = maLabelData.mnUsedHier;
503  rLabelData.mbShowAll = mxCbShowAll->get_active();
504  rLabelData.maMembers = maLabelData.maMembers;
505  rLabelData.maSortInfo = maLabelData.maSortInfo;
507  rLabelData.maShowInfo = maLabelData.maShowInfo;
509 }
510 
511 void ScDPSubtotalDlg::Init( const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData )
512 {
513  mxBtnOk->connect_clicked( LINK( this, ScDPSubtotalDlg, ButtonClicked ) );
514  mxBtnCancel->connect_clicked( LINK( this, ScDPSubtotalDlg, ButtonClicked ) );
515 
516  // field name
517  mxFtName->set_label(rLabelData.getDisplayName());
518 
519  // radio buttons
520  mxRbNone->connect_clicked( LINK( this, ScDPSubtotalDlg, RadioClickHdl ) );
521  mxRbAuto->connect_clicked( LINK( this, ScDPSubtotalDlg, RadioClickHdl ) );
522  mxRbUser->connect_clicked( LINK( this, ScDPSubtotalDlg, RadioClickHdl ) );
523 
524  weld::RadioButton* pRBtn = nullptr;
525  switch( rFuncData.mnFuncMask )
526  {
527  case PivotFunc::NONE: pRBtn = mxRbNone.get(); break;
528  case PivotFunc::Auto: pRBtn = mxRbAuto.get(); break;
529  default: pRBtn = mxRbUser.get();
530  }
531  pRBtn->set_active(true);
532  RadioClickHdl(*pRBtn);
533 
534  // list box
535  mxLbFunc->SetSelection( rFuncData.mnFuncMask );
536  mxLbFunc->connect_row_activated( LINK( this, ScDPSubtotalDlg, DblClickHdl ) );
537 
538  // show all
539  mxCbShowAll->set_active( rLabelData.mbShowAll );
540 
541  // options
542  mxBtnOptions->connect_clicked( LINK( this, ScDPSubtotalDlg, ClickHdl ) );
543 }
544 
545 IMPL_LINK(ScDPSubtotalDlg, ButtonClicked, weld::Button&, rButton, void)
546 {
547  if (&rButton == mxBtnOk.get())
548  response(RET_OK);
549  else
550  response(RET_CANCEL);
551 }
552 
553 IMPL_LINK(ScDPSubtotalDlg, RadioClickHdl, weld::Button&, rBtn, void)
554 {
555  mxLbFunc->set_sensitive(&rBtn == mxRbUser.get());
556 }
557 
559 {
560  m_xDialog->response(RET_OK);
561  return true;
562 }
563 
564 IMPL_LINK(ScDPSubtotalDlg, ClickHdl, weld::Button&, rBtn, void)
565 {
566  if (&rBtn == mxBtnOptions.get())
567  {
568  ScDPSubtotalOptDlg aDlg(m_xDialog.get(), mrDPObj, maLabelData, mrDataFields, mbEnableLayout);
569  if (aDlg.run() == RET_OK)
570  aDlg.FillLabelData(maLabelData);
571  }
572 }
573 
574 namespace
575 {
576  int FromDataPilotFieldLayoutMode(int eMode)
577  {
578  switch (eMode)
579  {
580  case DataPilotFieldLayoutMode::TABULAR_LAYOUT:
581  return 0;
582  case DataPilotFieldLayoutMode::OUTLINE_SUBTOTALS_TOP:
583  return 1;
584  case DataPilotFieldLayoutMode::OUTLINE_SUBTOTALS_BOTTOM:
585  return 2;
586  }
587  return -1;
588  }
589 
590  int ToDataPilotFieldLayoutMode(int nPos)
591  {
592  switch (nPos)
593  {
594  case 0:
595  return DataPilotFieldLayoutMode::TABULAR_LAYOUT;
596  case 1:
597  return DataPilotFieldLayoutMode::OUTLINE_SUBTOTALS_TOP;
598  case 2:
599  return DataPilotFieldLayoutMode::OUTLINE_SUBTOTALS_BOTTOM;
600  }
601  return DataPilotFieldLayoutMode::TABULAR_LAYOUT;
602  }
603 
604  int FromDataPilotFieldShowItemsMode(int eMode)
605  {
606  switch (eMode)
607  {
608  case DataPilotFieldShowItemsMode::FROM_TOP:
609  return 0;
610  case DataPilotFieldShowItemsMode::FROM_BOTTOM:
611  return 1;
612  }
613  return -1;
614  }
615 
616  int ToDataPilotFieldShowItemsMode(int nPos)
617  {
618  switch (nPos)
619  {
620  case 0:
621  return DataPilotFieldShowItemsMode::FROM_TOP;
622  case 1:
623  return DataPilotFieldShowItemsMode::FROM_BOTTOM;
624  }
625  return DataPilotFieldShowItemsMode::FROM_TOP;
626  }
627 }
628 
630  const ScDPLabelData& rLabelData, const ScDPNameVec& rDataFields,
631  bool bEnableLayout )
632  : GenericDialogController(pParent, "modules/scalc/ui/datafieldoptionsdialog.ui",
633  "DataFieldOptionsDialog")
634  , m_xLbSortBy(m_xBuilder->weld_combo_box("sortby"))
635  , m_xRbSortAsc(m_xBuilder->weld_radio_button("ascending"))
636  , m_xRbSortDesc(m_xBuilder->weld_radio_button("descending"))
637  , m_xRbSortMan(m_xBuilder->weld_radio_button("manual"))
638  , m_xLayoutFrame(m_xBuilder->weld_widget("layoutframe"))
639  , m_xLbLayout(m_xBuilder->weld_combo_box("layout"))
640  , m_xCbLayoutEmpty(m_xBuilder->weld_check_button("emptyline"))
641  , m_xCbRepeatItemLabels(m_xBuilder->weld_check_button("repeatitemlabels"))
642  , m_xCbShow(m_xBuilder->weld_check_button("show"))
643  , m_xNfShow(m_xBuilder->weld_spin_button("items"))
644  , m_xFtShow(m_xBuilder->weld_label("showft"))
645  , m_xFtShowFrom(m_xBuilder->weld_label("showfromft"))
646  , m_xLbShowFrom(m_xBuilder->weld_combo_box("from"))
647  , m_xFtShowUsing(m_xBuilder->weld_label("usingft"))
648  , m_xLbShowUsing(m_xBuilder->weld_combo_box("using"))
649  , m_xHideFrame(m_xBuilder->weld_widget("hideframe"))
650  , m_xLbHide(m_xBuilder->weld_tree_view("hideitems"))
651  , m_xFtHierarchy(m_xBuilder->weld_label("hierarchyft"))
652  , m_xLbHierarchy(m_xBuilder->weld_combo_box("hierarchy"))
653  , m_xBtnOk(m_xBuilder->weld_button("ok"))
654  , m_xBtnCancel(m_xBuilder->weld_button("cancel"))
655  , mrDPObj(rDPObj)
656  , maLabelData(rLabelData)
657 {
658  m_xLbHide->enable_toggle_buttons(weld::ColumnToggleType::Check);
659 
660  m_xLbSortBy->set_size_request(m_xLbSortBy->get_approximate_digit_width() * 18, -1);
661  m_xLbHide->set_size_request(-1, m_xLbHide->get_height_rows(5));
662  Init(rDataFields, bEnableLayout);
663 }
664 
666 {
667 }
668 
670 {
671  // *** SORTING ***
672 
673  if (m_xRbSortMan->get_active())
674  rLabelData.maSortInfo.Mode = DataPilotFieldSortMode::MANUAL;
675  else if (m_xLbSortBy->get_active() == SC_SORTNAME_POS)
676  rLabelData.maSortInfo.Mode = DataPilotFieldSortMode::NAME;
677  else
678  rLabelData.maSortInfo.Mode = DataPilotFieldSortMode::DATA;
679 
680  ScDPName aFieldName = GetFieldName(m_xLbSortBy->get_active_text());
681  if (!aFieldName.maName.isEmpty())
682  {
683  rLabelData.maSortInfo.Field =
684  ScDPUtil::createDuplicateDimensionName(aFieldName.maName, aFieldName.mnDupCount);
685  rLabelData.maSortInfo.IsAscending = m_xRbSortAsc->get_active();
686  }
687 
688  // *** LAYOUT MODE ***
689 
690  rLabelData.maLayoutInfo.LayoutMode = ToDataPilotFieldLayoutMode(m_xLbLayout->get_active());
691  rLabelData.maLayoutInfo.AddEmptyLines = m_xCbLayoutEmpty->get_active();
692  rLabelData.mbRepeatItemLabels = m_xCbRepeatItemLabels->get_active();
693 
694  // *** AUTO SHOW ***
695 
696  aFieldName = GetFieldName(m_xLbShowUsing->get_active_text());
697  if (!aFieldName.maName.isEmpty())
698  {
699  rLabelData.maShowInfo.IsEnabled = m_xCbShow->get_active();
700  rLabelData.maShowInfo.ShowItemsMode = ToDataPilotFieldShowItemsMode(m_xLbShowFrom->get_active());
701  rLabelData.maShowInfo.ItemCount = sal::static_int_cast<sal_Int32>( m_xNfShow->get_value() );
702  rLabelData.maShowInfo.DataField =
703  ScDPUtil::createDuplicateDimensionName(aFieldName.maName, aFieldName.mnDupCount);
704  }
705 
706  // *** HIDDEN ITEMS ***
707 
708  rLabelData.maMembers = maLabelData.maMembers;
709  int nVisCount = m_xLbHide->n_children();
710  for (int nPos = 0; nPos < nVisCount; ++nPos)
711  rLabelData.maMembers[nPos].mbVisible = m_xLbHide->get_toggle(nPos) == TRISTATE_FALSE;
712 
713  // *** HIERARCHY ***
714 
715  rLabelData.mnUsedHier = m_xLbHierarchy->get_active() != -1 ? m_xLbHierarchy->get_active() : 0;
716 }
717 
718 void ScDPSubtotalOptDlg::Init( const ScDPNameVec& rDataFields, bool bEnableLayout )
719 {
720  m_xBtnOk->connect_clicked(LINK(this, ScDPSubtotalOptDlg, ButtonClicked));
721  m_xBtnCancel->connect_clicked(LINK(this, ScDPSubtotalOptDlg, ButtonClicked));
722 
723  // *** SORTING ***
724 
725  sal_Int32 nSortMode = maLabelData.maSortInfo.Mode;
726 
727  // sort fields list box
728  m_xLbSortBy->append_text(maLabelData.getDisplayName());
729 
730  for( const auto& rDataField : rDataFields )
731  {
732  // Cache names for later lookup.
733  maDataFieldNameMap.emplace(rDataField.maLayoutName, rDataField);
734 
735  m_xLbSortBy->append_text(rDataField.maLayoutName);
736  m_xLbShowUsing->append_text(rDataField.maLayoutName); // for AutoShow
737  }
738 
739  sal_Int32 nSortPos = SC_SORTNAME_POS;
740  if( nSortMode == DataPilotFieldSortMode::DATA )
741  {
742  nSortPos = FindListBoxEntry( *m_xLbSortBy, maLabelData.maSortInfo.Field, SC_SORTDATA_POS );
743  if( nSortPos == -1 )
744  {
745  nSortPos = SC_SORTNAME_POS;
746  nSortMode = DataPilotFieldSortMode::MANUAL;
747  }
748  }
749  m_xLbSortBy->set_active(nSortPos);
750 
751  // sorting mode
752  m_xRbSortAsc->connect_clicked( LINK( this, ScDPSubtotalOptDlg, RadioClickHdl ) );
753  m_xRbSortDesc->connect_clicked( LINK( this, ScDPSubtotalOptDlg, RadioClickHdl ) );
754  m_xRbSortMan->connect_clicked( LINK( this, ScDPSubtotalOptDlg, RadioClickHdl ) );
755 
756  weld::RadioButton* pRBtn = nullptr;
757  switch( nSortMode )
758  {
760  case DataPilotFieldSortMode::MANUAL:
761  pRBtn = m_xRbSortMan.get();
762  break;
763  default:
764  pRBtn = maLabelData.maSortInfo.IsAscending ? m_xRbSortAsc.get() : m_xRbSortDesc.get();
765  }
766  pRBtn->set_active(true);
767  RadioClickHdl(*pRBtn);
768 
769  // *** LAYOUT MODE ***
770 
771  m_xLayoutFrame->set_sensitive(bEnableLayout);
772 
773  m_xLbLayout->set_active(FromDataPilotFieldLayoutMode(maLabelData.maLayoutInfo.LayoutMode));
774  m_xCbLayoutEmpty->set_active( maLabelData.maLayoutInfo.AddEmptyLines );
776 
777  // *** AUTO SHOW ***
778 
779  m_xCbShow->set_active( maLabelData.maShowInfo.IsEnabled );
780  m_xCbShow->connect_clicked( LINK( this, ScDPSubtotalOptDlg, CheckHdl ) );
781 
782  m_xLbShowFrom->set_active(FromDataPilotFieldShowItemsMode(maLabelData.maShowInfo.ShowItemsMode));
783  tools::Long nCount = static_cast< tools::Long >( maLabelData.maShowInfo.ItemCount );
784  if( nCount < 1 )
785  nCount = SC_SHOW_DEFAULT;
786  m_xNfShow->set_value( nCount );
787 
788  // m_xLbShowUsing already filled above
789  m_xLbShowUsing->set_active_text(maLabelData.maShowInfo.DataField);
790  if (m_xLbShowUsing->get_active() == -1)
791  m_xLbShowUsing->set_active(0);
792 
793  CheckHdl(*m_xCbShow); // enable/disable dependent controls
794 
795  // *** HIDDEN ITEMS ***
796 
797  InitHideListBox();
798 
799  // *** HIERARCHY ***
800 
801  if( maLabelData.maHiers.getLength() > 1 )
802  {
803  lclFillListBox(*m_xLbHierarchy, maLabelData.maHiers);
804  sal_Int32 nHier = maLabelData.mnUsedHier;
805  if( (nHier < 0) || (nHier >= maLabelData.maHiers.getLength()) ) nHier = 0;
806  m_xLbHierarchy->set_active( nHier );
807  m_xLbHierarchy->connect_changed( LINK( this, ScDPSubtotalOptDlg, SelectHdl ) );
808  }
809  else
810  {
811  m_xFtHierarchy->set_sensitive(false);
812  m_xLbHierarchy->set_sensitive(false);
813  }
814 }
815 
817 {
818  m_xLbHide->clear();
819  lclFillListBox(*m_xLbHide, maLabelData.maMembers);
820  size_t n = maLabelData.maMembers.size();
821  for (size_t i = 0; i < n; ++i)
822  m_xLbHide->set_toggle(i, maLabelData.maMembers[i].mbVisible ? TRISTATE_FALSE : TRISTATE_TRUE);
823  bool bEnable = m_xLbHide->n_children() > 0;
824  m_xHideFrame->set_sensitive(bEnable);
825 }
826 
827 ScDPName ScDPSubtotalOptDlg::GetFieldName(const OUString& rLayoutName) const
828 {
829  NameMapType::const_iterator itr = maDataFieldNameMap.find(rLayoutName);
830  return itr == maDataFieldNameMap.end() ? ScDPName() : itr->second;
831 }
832 
834  const weld::ComboBox& rLBox, std::u16string_view rEntry, sal_Int32 nStartPos ) const
835 {
836  sal_Int32 nPos = nStartPos;
837  bool bFound = false;
838  while (nPos < rLBox.get_count())
839  {
840  // translate the displayed field name back to its original field name.
841  ScDPName aName = GetFieldName(rLBox.get_text(nPos));
842  OUString aUnoName = ScDPUtil::createDuplicateDimensionName(aName.maName, aName.mnDupCount);
843  if (aUnoName == rEntry)
844  {
845  bFound = true;
846  break;
847  }
848  ++nPos;
849  }
850  return bFound ? nPos : -1;
851 }
852 
853 IMPL_LINK(ScDPSubtotalOptDlg, ButtonClicked, weld::Button&, rButton, void)
854 {
855  if (&rButton == m_xBtnOk.get())
856  response(RET_OK);
857  else
858  response(RET_CANCEL);
859 }
860 
861 IMPL_LINK(ScDPSubtotalOptDlg, RadioClickHdl, weld::Button&, rBtn, void)
862 {
863  m_xLbSortBy->set_sensitive(&rBtn != m_xRbSortMan.get());
864 }
865 
866 IMPL_LINK(ScDPSubtotalOptDlg, CheckHdl, weld::Button&, rCBox, void)
867 {
868  if (&rCBox == m_xCbShow.get())
869  {
870  bool bEnable = m_xCbShow->get_active();
871  m_xNfShow->set_sensitive( bEnable );
872  m_xFtShow->set_sensitive( bEnable );
873  m_xFtShowFrom->set_sensitive( bEnable );
874  m_xLbShowFrom->set_sensitive( bEnable );
875 
876  bool bEnableUsing = bEnable && (m_xLbShowUsing->get_count() > 0);
877  m_xFtShowUsing->set_sensitive(bEnableUsing);
878  m_xLbShowUsing->set_sensitive(bEnableUsing);
879  }
880 }
881 
883 {
884  mrDPObj.GetMembers(maLabelData.mnCol, m_xLbHierarchy->get_active(), maLabelData.maMembers);
885  InitHideListBox();
886 }
887 
888 ScDPShowDetailDlg::ScDPShowDetailDlg(weld::Window* pParent, ScDPObject& rDPObj, css::sheet::DataPilotFieldOrientation nOrient)
889  : GenericDialogController(pParent, "modules/scalc/ui/showdetaildialog.ui", "ShowDetail")
890  , mrDPObj(rDPObj)
891  , mxLbDims(m_xBuilder->weld_tree_view("dimsTreeview"))
892 {
893  ScDPSaveData* pSaveData = rDPObj.GetSaveData();
894  tools::Long nDimCount = rDPObj.GetDimCount();
895  for (tools::Long nDim=0; nDim<nDimCount; nDim++)
896  {
897  bool bIsDataLayout;
898  sal_Int32 nDimFlags = 0;
899  OUString aName = rDPObj.GetDimName( nDim, bIsDataLayout, &nDimFlags );
900  if ( !bIsDataLayout && !rDPObj.IsDuplicated( nDim ) && ScDPObject::IsOrientationAllowed( nOrient, nDimFlags ) )
901  {
902  const ScDPSaveDimension* pDimension = pSaveData ? pSaveData->GetExistingDimensionByName(aName) : nullptr;
903  if ( !pDimension || (pDimension->GetOrientation() != nOrient) )
904  {
905  if (pDimension)
906  {
907  const std::optional<OUString> & pLayoutName = pDimension->GetLayoutName();
908  if (pLayoutName)
909  aName = *pLayoutName;
910  }
911  mxLbDims->append_text(aName);
912  maNameIndexMap.emplace(aName, nDim);
913  }
914  }
915  }
916  if (mxLbDims->n_children())
917  mxLbDims->select(0);
918 
919  mxLbDims->connect_row_activated(LINK(this, ScDPShowDetailDlg, DblClickHdl));
920 }
921 
923 {
924 }
925 
927 {
928  return mxLbDims->n_children() ? GenericDialogController::run() : static_cast<short>(RET_CANCEL);
929 }
930 
932 {
933  // Look up the internal dimension name which may be different from the
934  // displayed field name.
935  OUString aSelectedName = mxLbDims->get_selected_text();
936  DimNameIndexMap::const_iterator itr = maNameIndexMap.find(aSelectedName);
937  if (itr == maNameIndexMap.end())
938  // This should never happen!
939  return aSelectedName;
940 
941  tools::Long nDim = itr->second;
942  bool bIsDataLayout = false;
943  return mrDPObj.GetDimName(nDim, bIsDataLayout);
944 }
945 
947 {
948  m_xDialog->response(RET_OK);
949  return true;
950 }
951 
952 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void set_text(int row, const OUString &rText, int col=-1)=0
std::unique_ptr< weld::ComboBox > m_xLbShowUsing
Definition: pvfundlg.hxx:170
static SC_DLLPUBLIC OUString createDuplicateDimensionName(const OUString &rOriginal, size_t nDupCount)
Definition: dputil.cxx:90
void FillLabelData(ScDPLabelData &rLabelData) const
Definition: pvfundlg.cxx:499
std::unique_ptr< weld::Button > mxBtnCancel
Definition: pvfundlg.hxx:85
const std::optional< OUString > & GetLayoutName() const
Definition: dpsave.cxx:384
sal_Int32 nIndex
OUString maName
Original name of the dimension.
Definition: pivot.hxx:59
std::vector< Member > maMembers
Definition: pivot.hxx:99
void Init(const ScDPLabelData &rLabelData, const ScPivotFuncData &rFuncData)
Definition: pvfundlg.cxx:294
std::unique_ptr< ScDPFunctionListBox > mxLbFunc
Definition: pvfundlg.hxx:77
std::unique_ptr< weld::RadioButton > m_xRbSortAsc
Definition: pvfundlg.hxx:157
sal_Int32 FindBaseItemPos(std::u16string_view rEntry, sal_Int32 nStartPos) const
Searches for a listbox entry, starts search at specified position.
Definition: pvfundlg.cxx:371
void InitHideListBox()
Definition: pvfundlg.cxx:816
std::unique_ptr< weld::ComboBox > mxLbBaseField
Definition: pvfundlg.hxx:81
Reference< XControl > m_xControl
void insert_text(int pos, const OUString &rStr)
css::sheet::DataPilotFieldOrientation GetOrientation() const
Definition: dpsave.hxx:203
virtual ~ScDPSubtotalOptDlg() override
Definition: pvfundlg.cxx:665
tools::Long GetDimCount()
Definition: dpobject.cxx:1274
const ScDPLabelDataVector & mrLabelVec
Definition: pvfundlg.hxx:91
virtual OUString get_text(int pos) const =0
long Long
std::unique_ptr< weld::Button > mxBtnOk
Definition: pvfundlg.hxx:127
sal_Int64 n
ScDPSubtotalOptDlg(weld::Window *pParent, ScDPObject &rDPObj, const ScDPLabelData &rLabelData, const ScDPNameVec &rDataFields, bool bEnableLayout)
Definition: pvfundlg.cxx:629
sal_Int32 mnUsedHier
Used hierarchy.
Definition: pivot.hxx:75
bool mbShowAll
true = Show all (also empty) results.
Definition: pivot.hxx:78
virtual ~ScDPShowDetailDlg() override
Definition: pvfundlg.cxx:922
std::unique_ptr< weld::Button > mxBtnCancel
Definition: pvfundlg.hxx:128
int nDimCount
TRISTATE_TRUE
RET_CANCEL
std::unique_ptr< weld::ComboBox > mxLbBaseItem
Definition: pvfundlg.hxx:83
void Init(const ScDPNameVec &rDataFields, bool bEnableLayout)
Definition: pvfundlg.cxx:718
ScDPName GetFieldName(const OUString &rLayoutName) const
Definition: pvfundlg.cxx:827
virtual int get_count() const =0
PivotFunc mnFuncMask
Definition: pivot.hxx:162
css::sheet::DataPilotFieldLayoutInfo maLayoutInfo
Layout info.
Definition: pivot.hxx:102
std::unique_ptr< weld::ComboBox > m_xLbShowFrom
Definition: pvfundlg.hxx:168
HashMap_OWString_Interface aMap
std::unique_ptr< weld::Button > mxBtnOk
Definition: pvfundlg.hxx:84
bool mbRepeatItemLabels
Definition: pivot.hxx:81
ScDPSubtotalDlg(weld::Widget *pParent, ScDPObject &rDPObj, const ScDPLabelData &rLabelData, const ScPivotFuncData &rFuncData, const ScDPNameVec &rDataFields, bool bEnableLayout)
Definition: pvfundlg.cxx:460
void Init(const ScDPLabelData &rLabelData, const ScPivotFuncData &rFuncData)
Definition: pvfundlg.cxx:511
ScDPLabelData maLabelData
The list of all data field names.
Definition: pvfundlg.hxx:118
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
size_t pos
std::unique_ptr< weld::RadioButton > mxRbUser
Definition: pvfundlg.hxx:123
std::unique_ptr< ScDPFunctionListBox > mxLbFunc
Definition: pvfundlg.hxx:124
int nCount
virtual int n_children() const =0
std::unique_ptr< weld::Label > m_xFtHierarchy
Definition: pvfundlg.hxx:173
css::sheet::DataPilotFieldReference maFieldRef
Definition: pivot.hxx:159
sal_Int32 FindListBoxEntry(const weld::ComboBox &rLBox, std::u16string_view rEntry, sal_Int32 nStartPos) const
Searches for a listbox entry, starts search at specified position.
Definition: pvfundlg.cxx:833
PivotFunc mnFuncMask
Page/Column/Row subtotal function.
Definition: pivot.hxx:74
std::unique_ptr< weld::ComboBox > m_xLbLayout
Definition: pvfundlg.hxx:161
PivotFunc
Definition: dpglobal.hxx:25
virtual void set_active(bool active)=0
#define SAL_N_ELEMENTS(arr)
std::vector< ScDPName > ScDPNameVec
Definition: pivot.hxx:173
NameMapType maBaseFieldNameMap
Definition: pvfundlg.hxx:88
std::unique_ptr< weld::ComboBox > m_xLbHierarchy
Definition: pvfundlg.hxx:174
std::unique_ptr< weld::ComboBox > m_xLbSortBy
Definition: pvfundlg.hxx:156
virtual ~ScDPFunctionDlg() override
Definition: pvfundlg.cxx:258
virtual short run() override
Definition: pvfundlg.cxx:926
std::unique_ptr< weld::RadioButton > mxRbAuto
Definition: pvfundlg.hxx:122
ScDPShowDetailDlg(weld::Window *pParent, ScDPObject &rDPObj, css::sheet::DataPilotFieldOrientation nOrient)
Definition: pvfundlg.cxx:888
sal_uInt8 mnDupCount
Definition: pivot.hxx:61
int i
std::unique_ptr< weld::Label > mxFtName
Definition: pvfundlg.hxx:125
std::vector< std::unique_ptr< ScDPLabelData > > ScDPLabelDataVector
Definition: pivot.hxx:114
std::unique_ptr< weld::Button > mxBtnOptions
Definition: pvfundlg.hxx:129
std::unique_ptr< weld::RadioButton > mxRbNone
true = Enable Layout mode controls.
Definition: pvfundlg.hxx:121
virtual void set_toggle(int row, TriState eState, int col=-1)=0
std::unique_ptr< weld::Button > m_xBtnCancel
Definition: pvfundlg.hxx:176
TRISTATE_FALSE
std::unique_ptr< weld::Button > m_xBtnOk
Definition: pvfundlg.hxx:175
std::unique_ptr< weld::TreeView > m_xControl
Definition: pvfundlg.hxx:49
OUString ScResId(const char *pId)
Definition: scdll.cxx:89
OUString GetDimensionName() const
Definition: pvfundlg.cxx:931
DimNameIndexMap maNameIndexMap
Definition: pvfundlg.hxx:206
ScDPSaveData * GetSaveData() const
Definition: dpobject.hxx:141
SC_DLLPUBLIC OUString const & getDisplayName() const
Definition: pivot2.cxx:66
std::unique_ptr< weld::CheckButton > mxCbShowAll
Definition: pvfundlg.hxx:126
void SetSelection(PivotFunc nFuncMask)
Definition: pvfundlg.cxx:144
virtual ~ScDPSubtotalDlg() override
Definition: pvfundlg.cxx:483
IMPL_LINK_NOARG(ScDPFunctionDlg, DblClickHdl, weld::TreeView &, bool)
Definition: pvfundlg.cxx:454
SC_DLLPUBLIC ScDPSaveDimension * GetExistingDimensionByName(std::u16string_view rName) const
Definition: dpsave.cxx:845
const OUString & GetBaseItemName(const OUString &rLayoutName) const
Definition: pvfundlg.cxx:365
const OUString & GetBaseFieldName(const OUString &rLayoutName) const
Definition: pvfundlg.cxx:359
ScDPFunctionListBox(std::unique_ptr< weld::TreeView > xControl)
Definition: pvfundlg.cxx:138
std::unique_ptr< weld::CheckButton > m_xCbShow
Definition: pvfundlg.hxx:164
std::unique_ptr< weld::SpinButton > m_xNfShow
Definition: pvfundlg.hxx:165
ScDPObject & mrDPObj
Definition: pvfundlg.hxx:207
void FillLabelData(ScDPLabelData &rLabelData) const
Definition: pvfundlg.cxx:669
std::unique_ptr< weld::ComboBox > mxLbType
Definition: pvfundlg.hxx:79
OUString GetDimName(tools::Long nDim, bool &rIsDataLayout, sal_Int32 *pFlags=nullptr)
Definition: dpobject.cxx:1196
std::unique_ptr< weld::TreeView > m_xLbHide
Definition: pvfundlg.hxx:172
std::unique_ptr< weld::CheckButton > m_xCbRepeatItemLabels
Definition: pvfundlg.hxx:163
static bool IsOrientationAllowed(css::sheet::DataPilotFieldOrientation nOrient, sal_Int32 nDimFlags)
Definition: dpobject.cxx:2705
std::unique_ptr< weld::Label > mxFtName
Definition: pvfundlg.hxx:78
NameMapType maDataFieldNameMap
Definition: pvfundlg.hxx:182
css::sheet::DataPilotFieldReference GetFieldRef() const
Definition: pvfundlg.cxx:267
css::uno::Sequence< OUString > maHiers
Hierarchies.
Definition: pivot.hxx:100
OUString aName
NameMapType maBaseItemNameMap
Definition: pvfundlg.hxx:89
RET_OK
css::sheet::DataPilotFieldSortInfo maSortInfo
Sorting info.
Definition: pivot.hxx:101
Reference< XExecutableDialog > m_xDialog
std::unique_ptr< weld::Widget > m_xLayoutFrame
Definition: pvfundlg.hxx:160
std::unique_ptr< weld::TreeView > mxLbDims
Definition: pvfundlg.hxx:209
bool IsDuplicated(tools::Long nDim)
Definition: dpobject.cxx:1245
void append(TreeIter *pRet=nullptr)
std::unique_ptr< weld::RadioButton > m_xRbSortMan
Definition: pvfundlg.hxx:159
ScDPFunctionDlg(weld::Widget *pParent, const ScDPLabelDataVector &rLabelVec, const ScDPLabelData &rLabelData, const ScPivotFuncData &rFuncData)
Definition: pvfundlg.cxx:236
IMPL_LINK(ScDPFunctionDlg, SelectHdl, weld::ComboBox &, rLBox, void)
Definition: pvfundlg.cxx:390
void append_text(const OUString &rStr)
if(!pCandidateA->getEnd().equal(pCandidateB->getStart()))
PivotFunc GetSelection() const
Definition: pvfundlg.cxx:160
std::unique_ptr< weld::Widget > m_xHideFrame
Definition: pvfundlg.hxx:171
PivotFunc GetFuncMask() const
Definition: pvfundlg.cxx:262
std::unique_ptr< weld::RadioButton > m_xRbSortDesc
Definition: pvfundlg.hxx:158
std::unique_ptr< weld::CheckButton > m_xCbLayoutEmpty
Definition: pvfundlg.hxx:162
sal_uInt16 nPos
css::sheet::DataPilotFieldAutoShowInfo maShowInfo
AutoShow info.
Definition: pivot.hxx:103
void FillFunctionNames()
Definition: pvfundlg.cxx:169
PivotFunc GetFuncMask() const
Definition: pvfundlg.cxx:487
bool mbEmptyItem
Data of all labels.
Definition: pvfundlg.hxx:92
ScDPLabelData maLabelData
The DataPilot object (for member names).
Definition: pvfundlg.hxx:179