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  mxOptionsDlg = std::make_shared<ScDPSubtotalOptDlg>(m_xDialog.get(), mrDPObj, maLabelData, mrDataFields, mbEnableLayout);
569 
570  weld::DialogController::runAsync(mxOptionsDlg, [this](int nResult) {
571  if (nResult == RET_OK)
572  mxOptionsDlg->FillLabelData(maLabelData);
573  });
574  }
575 }
576 
577 namespace
578 {
579  int FromDataPilotFieldLayoutMode(int eMode)
580  {
581  switch (eMode)
582  {
583  case DataPilotFieldLayoutMode::TABULAR_LAYOUT:
584  return 0;
585  case DataPilotFieldLayoutMode::OUTLINE_SUBTOTALS_TOP:
586  return 1;
587  case DataPilotFieldLayoutMode::OUTLINE_SUBTOTALS_BOTTOM:
588  return 2;
589  }
590  return -1;
591  }
592 
593  int ToDataPilotFieldLayoutMode(int nPos)
594  {
595  switch (nPos)
596  {
597  case 0:
598  return DataPilotFieldLayoutMode::TABULAR_LAYOUT;
599  case 1:
600  return DataPilotFieldLayoutMode::OUTLINE_SUBTOTALS_TOP;
601  case 2:
602  return DataPilotFieldLayoutMode::OUTLINE_SUBTOTALS_BOTTOM;
603  }
604  return DataPilotFieldLayoutMode::TABULAR_LAYOUT;
605  }
606 
607  int FromDataPilotFieldShowItemsMode(int eMode)
608  {
609  switch (eMode)
610  {
611  case DataPilotFieldShowItemsMode::FROM_TOP:
612  return 0;
613  case DataPilotFieldShowItemsMode::FROM_BOTTOM:
614  return 1;
615  }
616  return -1;
617  }
618 
619  int ToDataPilotFieldShowItemsMode(int nPos)
620  {
621  switch (nPos)
622  {
623  case 0:
624  return DataPilotFieldShowItemsMode::FROM_TOP;
625  case 1:
626  return DataPilotFieldShowItemsMode::FROM_BOTTOM;
627  }
628  return DataPilotFieldShowItemsMode::FROM_TOP;
629  }
630 }
631 
633  const ScDPLabelData& rLabelData, const ScDPNameVec& rDataFields,
634  bool bEnableLayout )
635  : GenericDialogController(pParent, "modules/scalc/ui/datafieldoptionsdialog.ui",
636  "DataFieldOptionsDialog")
637  , m_xLbSortBy(m_xBuilder->weld_combo_box("sortby"))
638  , m_xRbSortAsc(m_xBuilder->weld_radio_button("ascending"))
639  , m_xRbSortDesc(m_xBuilder->weld_radio_button("descending"))
640  , m_xRbSortMan(m_xBuilder->weld_radio_button("manual"))
641  , m_xLayoutFrame(m_xBuilder->weld_widget("layoutframe"))
642  , m_xLbLayout(m_xBuilder->weld_combo_box("layout"))
643  , m_xCbLayoutEmpty(m_xBuilder->weld_check_button("emptyline"))
644  , m_xCbRepeatItemLabels(m_xBuilder->weld_check_button("repeatitemlabels"))
645  , m_xCbShow(m_xBuilder->weld_check_button("show"))
646  , m_xNfShow(m_xBuilder->weld_spin_button("items"))
647  , m_xFtShow(m_xBuilder->weld_label("showft"))
648  , m_xFtShowFrom(m_xBuilder->weld_label("showfromft"))
649  , m_xLbShowFrom(m_xBuilder->weld_combo_box("from"))
650  , m_xFtShowUsing(m_xBuilder->weld_label("usingft"))
651  , m_xLbShowUsing(m_xBuilder->weld_combo_box("using"))
652  , m_xHideFrame(m_xBuilder->weld_widget("hideframe"))
653  , m_xLbHide(m_xBuilder->weld_tree_view("hideitems"))
654  , m_xFtHierarchy(m_xBuilder->weld_label("hierarchyft"))
655  , m_xLbHierarchy(m_xBuilder->weld_combo_box("hierarchy"))
656  , m_xBtnOk(m_xBuilder->weld_button("ok"))
657  , m_xBtnCancel(m_xBuilder->weld_button("cancel"))
658  , mrDPObj(rDPObj)
659  , maLabelData(rLabelData)
660 {
661  m_xLbHide->enable_toggle_buttons(weld::ColumnToggleType::Check);
662 
663  m_xLbSortBy->set_size_request(m_xLbSortBy->get_approximate_digit_width() * 18, -1);
664  m_xLbHide->set_size_request(-1, m_xLbHide->get_height_rows(5));
665  Init(rDataFields, bEnableLayout);
666 }
667 
669 {
670 }
671 
673 {
674  // *** SORTING ***
675 
676  if (m_xRbSortMan->get_active())
677  rLabelData.maSortInfo.Mode = DataPilotFieldSortMode::MANUAL;
678  else if (m_xLbSortBy->get_active() == SC_SORTNAME_POS)
679  rLabelData.maSortInfo.Mode = DataPilotFieldSortMode::NAME;
680  else
681  rLabelData.maSortInfo.Mode = DataPilotFieldSortMode::DATA;
682 
683  ScDPName aFieldName = GetFieldName(m_xLbSortBy->get_active_text());
684  if (!aFieldName.maName.isEmpty())
685  {
686  rLabelData.maSortInfo.Field =
687  ScDPUtil::createDuplicateDimensionName(aFieldName.maName, aFieldName.mnDupCount);
688  rLabelData.maSortInfo.IsAscending = m_xRbSortAsc->get_active();
689  }
690 
691  // *** LAYOUT MODE ***
692 
693  rLabelData.maLayoutInfo.LayoutMode = ToDataPilotFieldLayoutMode(m_xLbLayout->get_active());
694  rLabelData.maLayoutInfo.AddEmptyLines = m_xCbLayoutEmpty->get_active();
695  rLabelData.mbRepeatItemLabels = m_xCbRepeatItemLabels->get_active();
696 
697  // *** AUTO SHOW ***
698 
699  aFieldName = GetFieldName(m_xLbShowUsing->get_active_text());
700  if (!aFieldName.maName.isEmpty())
701  {
702  rLabelData.maShowInfo.IsEnabled = m_xCbShow->get_active();
703  rLabelData.maShowInfo.ShowItemsMode = ToDataPilotFieldShowItemsMode(m_xLbShowFrom->get_active());
704  rLabelData.maShowInfo.ItemCount = sal::static_int_cast<sal_Int32>( m_xNfShow->get_value() );
705  rLabelData.maShowInfo.DataField =
706  ScDPUtil::createDuplicateDimensionName(aFieldName.maName, aFieldName.mnDupCount);
707  }
708 
709  // *** HIDDEN ITEMS ***
710 
711  rLabelData.maMembers = maLabelData.maMembers;
712  int nVisCount = m_xLbHide->n_children();
713  for (int nPos = 0; nPos < nVisCount; ++nPos)
714  rLabelData.maMembers[nPos].mbVisible = m_xLbHide->get_toggle(nPos) == TRISTATE_FALSE;
715 
716  // *** HIERARCHY ***
717 
718  rLabelData.mnUsedHier = m_xLbHierarchy->get_active() != -1 ? m_xLbHierarchy->get_active() : 0;
719 }
720 
721 void ScDPSubtotalOptDlg::Init( const ScDPNameVec& rDataFields, bool bEnableLayout )
722 {
723  m_xBtnOk->connect_clicked(LINK(this, ScDPSubtotalOptDlg, ButtonClicked));
724  m_xBtnCancel->connect_clicked(LINK(this, ScDPSubtotalOptDlg, ButtonClicked));
725 
726  // *** SORTING ***
727 
728  sal_Int32 nSortMode = maLabelData.maSortInfo.Mode;
729 
730  // sort fields list box
731  m_xLbSortBy->append_text(maLabelData.getDisplayName());
732 
733  for( const auto& rDataField : rDataFields )
734  {
735  // Cache names for later lookup.
736  maDataFieldNameMap.emplace(rDataField.maLayoutName, rDataField);
737 
738  m_xLbSortBy->append_text(rDataField.maLayoutName);
739  m_xLbShowUsing->append_text(rDataField.maLayoutName); // for AutoShow
740  }
741 
742  sal_Int32 nSortPos = SC_SORTNAME_POS;
743  if( nSortMode == DataPilotFieldSortMode::DATA )
744  {
745  nSortPos = FindListBoxEntry( *m_xLbSortBy, maLabelData.maSortInfo.Field, SC_SORTDATA_POS );
746  if( nSortPos == -1 )
747  {
748  nSortPos = SC_SORTNAME_POS;
749  nSortMode = DataPilotFieldSortMode::MANUAL;
750  }
751  }
752  m_xLbSortBy->set_active(nSortPos);
753 
754  // sorting mode
755  m_xRbSortAsc->connect_clicked( LINK( this, ScDPSubtotalOptDlg, RadioClickHdl ) );
756  m_xRbSortDesc->connect_clicked( LINK( this, ScDPSubtotalOptDlg, RadioClickHdl ) );
757  m_xRbSortMan->connect_clicked( LINK( this, ScDPSubtotalOptDlg, RadioClickHdl ) );
758 
759  weld::RadioButton* pRBtn = nullptr;
760  switch( nSortMode )
761  {
763  case DataPilotFieldSortMode::MANUAL:
764  pRBtn = m_xRbSortMan.get();
765  break;
766  default:
767  pRBtn = maLabelData.maSortInfo.IsAscending ? m_xRbSortAsc.get() : m_xRbSortDesc.get();
768  }
769  pRBtn->set_active(true);
770  RadioClickHdl(*pRBtn);
771 
772  // *** LAYOUT MODE ***
773 
774  m_xLayoutFrame->set_sensitive(bEnableLayout);
775 
776  m_xLbLayout->set_active(FromDataPilotFieldLayoutMode(maLabelData.maLayoutInfo.LayoutMode));
777  m_xCbLayoutEmpty->set_active( maLabelData.maLayoutInfo.AddEmptyLines );
779 
780  // *** AUTO SHOW ***
781 
782  m_xCbShow->set_active( maLabelData.maShowInfo.IsEnabled );
783  m_xCbShow->connect_clicked( LINK( this, ScDPSubtotalOptDlg, CheckHdl ) );
784 
785  m_xLbShowFrom->set_active(FromDataPilotFieldShowItemsMode(maLabelData.maShowInfo.ShowItemsMode));
786  tools::Long nCount = static_cast< tools::Long >( maLabelData.maShowInfo.ItemCount );
787  if( nCount < 1 )
788  nCount = SC_SHOW_DEFAULT;
789  m_xNfShow->set_value( nCount );
790 
791  // m_xLbShowUsing already filled above
792  m_xLbShowUsing->set_active_text(maLabelData.maShowInfo.DataField);
793  if (m_xLbShowUsing->get_active() == -1)
794  m_xLbShowUsing->set_active(0);
795 
796  CheckHdl(*m_xCbShow); // enable/disable dependent controls
797 
798  // *** HIDDEN ITEMS ***
799 
800  InitHideListBox();
801 
802  // *** HIERARCHY ***
803 
804  if( maLabelData.maHiers.getLength() > 1 )
805  {
806  lclFillListBox(*m_xLbHierarchy, maLabelData.maHiers);
807  sal_Int32 nHier = maLabelData.mnUsedHier;
808  if( (nHier < 0) || (nHier >= maLabelData.maHiers.getLength()) ) nHier = 0;
809  m_xLbHierarchy->set_active( nHier );
810  m_xLbHierarchy->connect_changed( LINK( this, ScDPSubtotalOptDlg, SelectHdl ) );
811  }
812  else
813  {
814  m_xFtHierarchy->set_sensitive(false);
815  m_xLbHierarchy->set_sensitive(false);
816  }
817 }
818 
820 {
821  m_xLbHide->clear();
822  lclFillListBox(*m_xLbHide, maLabelData.maMembers);
823  size_t n = maLabelData.maMembers.size();
824  for (size_t i = 0; i < n; ++i)
825  m_xLbHide->set_toggle(i, maLabelData.maMembers[i].mbVisible ? TRISTATE_FALSE : TRISTATE_TRUE);
826  bool bEnable = m_xLbHide->n_children() > 0;
827  m_xHideFrame->set_sensitive(bEnable);
828 }
829 
830 ScDPName ScDPSubtotalOptDlg::GetFieldName(const OUString& rLayoutName) const
831 {
832  NameMapType::const_iterator itr = maDataFieldNameMap.find(rLayoutName);
833  return itr == maDataFieldNameMap.end() ? ScDPName() : itr->second;
834 }
835 
837  const weld::ComboBox& rLBox, std::u16string_view rEntry, sal_Int32 nStartPos ) const
838 {
839  sal_Int32 nPos = nStartPos;
840  bool bFound = false;
841  while (nPos < rLBox.get_count())
842  {
843  // translate the displayed field name back to its original field name.
844  ScDPName aName = GetFieldName(rLBox.get_text(nPos));
845  OUString aUnoName = ScDPUtil::createDuplicateDimensionName(aName.maName, aName.mnDupCount);
846  if (aUnoName == rEntry)
847  {
848  bFound = true;
849  break;
850  }
851  ++nPos;
852  }
853  return bFound ? nPos : -1;
854 }
855 
856 IMPL_LINK(ScDPSubtotalOptDlg, ButtonClicked, weld::Button&, rButton, void)
857 {
858  if (&rButton == m_xBtnOk.get())
859  response(RET_OK);
860  else
861  response(RET_CANCEL);
862 }
863 
864 IMPL_LINK(ScDPSubtotalOptDlg, RadioClickHdl, weld::Button&, rBtn, void)
865 {
866  m_xLbSortBy->set_sensitive(&rBtn != m_xRbSortMan.get());
867 }
868 
869 IMPL_LINK(ScDPSubtotalOptDlg, CheckHdl, weld::Button&, rCBox, void)
870 {
871  if (&rCBox == m_xCbShow.get())
872  {
873  bool bEnable = m_xCbShow->get_active();
874  m_xNfShow->set_sensitive( bEnable );
875  m_xFtShow->set_sensitive( bEnable );
876  m_xFtShowFrom->set_sensitive( bEnable );
877  m_xLbShowFrom->set_sensitive( bEnable );
878 
879  bool bEnableUsing = bEnable && (m_xLbShowUsing->get_count() > 0);
880  m_xFtShowUsing->set_sensitive(bEnableUsing);
881  m_xLbShowUsing->set_sensitive(bEnableUsing);
882  }
883 }
884 
886 {
887  mrDPObj.GetMembers(maLabelData.mnCol, m_xLbHierarchy->get_active(), maLabelData.maMembers);
888  InitHideListBox();
889 }
890 
891 ScDPShowDetailDlg::ScDPShowDetailDlg(weld::Window* pParent, ScDPObject& rDPObj, css::sheet::DataPilotFieldOrientation nOrient)
892  : GenericDialogController(pParent, "modules/scalc/ui/showdetaildialog.ui", "ShowDetail")
893  , mrDPObj(rDPObj)
894  , mxLbDims(m_xBuilder->weld_tree_view("dimsTreeview"))
895 {
896  ScDPSaveData* pSaveData = rDPObj.GetSaveData();
897  tools::Long nDimCount = rDPObj.GetDimCount();
898  for (tools::Long nDim=0; nDim<nDimCount; nDim++)
899  {
900  bool bIsDataLayout;
901  sal_Int32 nDimFlags = 0;
902  OUString aName = rDPObj.GetDimName( nDim, bIsDataLayout, &nDimFlags );
903  if ( !bIsDataLayout && !rDPObj.IsDuplicated( nDim ) && ScDPObject::IsOrientationAllowed( nOrient, nDimFlags ) )
904  {
905  const ScDPSaveDimension* pDimension = pSaveData ? pSaveData->GetExistingDimensionByName(aName) : nullptr;
906  if ( !pDimension || (pDimension->GetOrientation() != nOrient) )
907  {
908  if (pDimension)
909  {
910  const std::optional<OUString> & pLayoutName = pDimension->GetLayoutName();
911  if (pLayoutName)
912  aName = *pLayoutName;
913  }
914  mxLbDims->append_text(aName);
915  maNameIndexMap.emplace(aName, nDim);
916  }
917  }
918  }
919  if (mxLbDims->n_children())
920  mxLbDims->select(0);
921 
922  mxLbDims->connect_row_activated(LINK(this, ScDPShowDetailDlg, DblClickHdl));
923 }
924 
926 {
927 }
928 
930 {
931  return mxLbDims->n_children() ? GenericDialogController::run() : static_cast<short>(RET_CANCEL);
932 }
933 
935 {
936  // Look up the internal dimension name which may be different from the
937  // displayed field name.
938  OUString aSelectedName = mxLbDims->get_selected_text();
939  DimNameIndexMap::const_iterator itr = maNameIndexMap.find(aSelectedName);
940  if (itr == maNameIndexMap.end())
941  // This should never happen!
942  return aSelectedName;
943 
944  tools::Long nDim = itr->second;
945  bool bIsDataLayout = false;
946  return mrDPObj.GetDimName(nDim, bIsDataLayout);
947 }
948 
950 {
951  m_xDialog->response(RET_OK);
952  return true;
953 }
954 
955 /* 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:173
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:84
const std::optional< OUString > & GetLayoutName() const
Definition: dpsave.cxx:384
sal_Int32 nIndex
OUString maName
Original name of the dimension.
Definition: pivot.hxx:58
std::vector< Member > maMembers
Definition: pivot.hxx:98
void Init(const ScDPLabelData &rLabelData, const ScPivotFuncData &rFuncData)
Definition: pvfundlg.cxx:294
std::unique_ptr< ScDPFunctionListBox > mxLbFunc
Definition: pvfundlg.hxx:76
std::unique_ptr< weld::RadioButton > m_xRbSortAsc
Definition: pvfundlg.hxx:160
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:819
std::unique_ptr< weld::ComboBox > mxLbBaseField
Definition: pvfundlg.hxx:80
Reference< XControl > m_xControl
void insert_text(int pos, const OUString &rStr)
css::sheet::DataPilotFieldOrientation GetOrientation() const
Definition: dpsave.hxx:202
virtual ~ScDPSubtotalOptDlg() override
Definition: pvfundlg.cxx:668
tools::Long GetDimCount()
Definition: dpobject.cxx:1273
const ScDPLabelDataVector & mrLabelVec
Definition: pvfundlg.hxx:90
virtual OUString get_text(int pos) const =0
long Long
std::unique_ptr< weld::Button > mxBtnOk
Definition: pvfundlg.hxx:128
sal_Int64 n
ScDPSubtotalOptDlg(weld::Window *pParent, ScDPObject &rDPObj, const ScDPLabelData &rLabelData, const ScDPNameVec &rDataFields, bool bEnableLayout)
Definition: pvfundlg.cxx:632
sal_Int32 mnUsedHier
Used hierarchy.
Definition: pivot.hxx:74
bool mbShowAll
true = Show all (also empty) results.
Definition: pivot.hxx:77
virtual ~ScDPShowDetailDlg() override
Definition: pvfundlg.cxx:925
std::unique_ptr< weld::Button > mxBtnCancel
Definition: pvfundlg.hxx:129
int nDimCount
TRISTATE_TRUE
RET_CANCEL
std::unique_ptr< weld::ComboBox > mxLbBaseItem
Definition: pvfundlg.hxx:82
void Init(const ScDPNameVec &rDataFields, bool bEnableLayout)
Definition: pvfundlg.cxx:721
ScDPName GetFieldName(const OUString &rLayoutName) const
Definition: pvfundlg.cxx:830
virtual int get_count() const =0
PivotFunc mnFuncMask
Definition: pivot.hxx:161
css::sheet::DataPilotFieldLayoutInfo maLayoutInfo
Layout info.
Definition: pivot.hxx:101
std::unique_ptr< weld::ComboBox > m_xLbShowFrom
Definition: pvfundlg.hxx:171
HashMap_OWString_Interface aMap
std::unique_ptr< weld::Button > mxBtnOk
Definition: pvfundlg.hxx:83
static bool runAsync(const std::shared_ptr< DialogController > &rController, const std::function< void(sal_Int32)> &)
bool mbRepeatItemLabels
Definition: pivot.hxx:80
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:119
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
size_t pos
std::unique_ptr< weld::RadioButton > mxRbUser
Definition: pvfundlg.hxx:124
std::unique_ptr< ScDPFunctionListBox > mxLbFunc
Definition: pvfundlg.hxx:125
int nCount
virtual int n_children() const =0
std::unique_ptr< weld::Label > m_xFtHierarchy
Definition: pvfundlg.hxx:176
css::sheet::DataPilotFieldReference maFieldRef
Definition: pivot.hxx:158
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:836
PivotFunc mnFuncMask
Page/Column/Row subtotal function.
Definition: pivot.hxx:73
std::unique_ptr< weld::ComboBox > m_xLbLayout
Definition: pvfundlg.hxx:164
PivotFunc
Definition: dpglobal.hxx:24
virtual void set_active(bool active)=0
#define SAL_N_ELEMENTS(arr)
std::vector< ScDPName > ScDPNameVec
Definition: pivot.hxx:172
NameMapType maBaseFieldNameMap
Definition: pvfundlg.hxx:87
std::unique_ptr< weld::ComboBox > m_xLbHierarchy
Definition: pvfundlg.hxx:177
std::unique_ptr< weld::ComboBox > m_xLbSortBy
Definition: pvfundlg.hxx:159
virtual ~ScDPFunctionDlg() override
Definition: pvfundlg.cxx:258
virtual short run() override
Definition: pvfundlg.cxx:929
std::unique_ptr< weld::RadioButton > mxRbAuto
Definition: pvfundlg.hxx:123
ScDPShowDetailDlg(weld::Window *pParent, ScDPObject &rDPObj, css::sheet::DataPilotFieldOrientation nOrient)
Definition: pvfundlg.cxx:891
sal_uInt8 mnDupCount
Definition: pivot.hxx:60
int i
std::unique_ptr< weld::Label > mxFtName
Definition: pvfundlg.hxx:126
std::vector< std::unique_ptr< ScDPLabelData > > ScDPLabelDataVector
Definition: pivot.hxx:113
std::unique_ptr< weld::Button > mxBtnOptions
Definition: pvfundlg.hxx:130
std::unique_ptr< weld::RadioButton > mxRbNone
true = Enable Layout mode controls.
Definition: pvfundlg.hxx:122
virtual void set_toggle(int row, TriState eState, int col=-1)=0
std::unique_ptr< weld::Button > m_xBtnCancel
Definition: pvfundlg.hxx:179
TRISTATE_FALSE
std::unique_ptr< weld::Button > m_xBtnOk
Definition: pvfundlg.hxx:178
std::unique_ptr< weld::TreeView > m_xControl
Definition: pvfundlg.hxx:48
OUString ScResId(const char *pId)
Definition: scdll.cxx:89
OUString GetDimensionName() const
Definition: pvfundlg.cxx:934
DimNameIndexMap maNameIndexMap
Definition: pvfundlg.hxx:209
ScDPSaveData * GetSaveData() const
Definition: dpobject.hxx:140
SC_DLLPUBLIC OUString const & getDisplayName() const
Definition: pivot2.cxx:66
std::unique_ptr< weld::CheckButton > mxCbShowAll
Definition: pvfundlg.hxx:127
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:167
std::unique_ptr< weld::SpinButton > m_xNfShow
Definition: pvfundlg.hxx:168
ScDPObject & mrDPObj
Definition: pvfundlg.hxx:210
void FillLabelData(ScDPLabelData &rLabelData) const
Definition: pvfundlg.cxx:672
std::unique_ptr< weld::ComboBox > mxLbType
Definition: pvfundlg.hxx:78
OUString GetDimName(tools::Long nDim, bool &rIsDataLayout, sal_Int32 *pFlags=nullptr)
Definition: dpobject.cxx:1195
std::unique_ptr< weld::TreeView > m_xLbHide
Definition: pvfundlg.hxx:175
std::unique_ptr< weld::CheckButton > m_xCbRepeatItemLabels
Definition: pvfundlg.hxx:166
static bool IsOrientationAllowed(css::sheet::DataPilotFieldOrientation nOrient, sal_Int32 nDimFlags)
Definition: dpobject.cxx:2704
std::unique_ptr< weld::Label > mxFtName
Definition: pvfundlg.hxx:77
NameMapType maDataFieldNameMap
Definition: pvfundlg.hxx:185
css::sheet::DataPilotFieldReference GetFieldRef() const
Definition: pvfundlg.cxx:267
css::uno::Sequence< OUString > maHiers
Hierarchies.
Definition: pivot.hxx:99
OUString aName
NameMapType maBaseItemNameMap
Definition: pvfundlg.hxx:88
RET_OK
css::sheet::DataPilotFieldSortInfo maSortInfo
Sorting info.
Definition: pivot.hxx:100
Reference< XExecutableDialog > m_xDialog
std::unique_ptr< weld::Widget > m_xLayoutFrame
Definition: pvfundlg.hxx:163
std::unique_ptr< weld::TreeView > mxLbDims
Definition: pvfundlg.hxx:212
bool IsDuplicated(tools::Long nDim)
Definition: dpobject.cxx:1244
void append(TreeIter *pRet=nullptr)
std::unique_ptr< weld::RadioButton > m_xRbSortMan
Definition: pvfundlg.hxx:162
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:174
PivotFunc GetFuncMask() const
Definition: pvfundlg.cxx:262
std::unique_ptr< weld::RadioButton > m_xRbSortDesc
Definition: pvfundlg.hxx:161
std::unique_ptr< weld::CheckButton > m_xCbLayoutEmpty
Definition: pvfundlg.hxx:165
sal_uInt16 nPos
css::sheet::DataPilotFieldAutoShowInfo maShowInfo
AutoShow info.
Definition: pivot.hxx:102
void FillFunctionNames()
Definition: pvfundlg.cxx:169
PivotFunc GetFuncMask() const
Definition: pvfundlg.cxx:487
bool mbEmptyItem
Data of all labels.
Definition: pvfundlg.hxx:91
ScDPLabelData maLabelData
The DataPilot object (for member names).
Definition: pvfundlg.hxx:182