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  CloseSubdialog();
486 }
487 
489 {
490  if (mxOptionsDlg && mxOptionsDlg->getDialog())
491  {
492  mxOptionsDlg->getDialog()->response(RET_CANCEL);
493  mxOptionsDlg = nullptr;
494  }
495 }
496 
498 {
499  PivotFunc nFuncMask = PivotFunc::NONE;
500 
501  if (mxRbAuto->get_active())
502  nFuncMask = PivotFunc::Auto;
503  else if (mxRbUser->get_active())
504  nFuncMask = mxLbFunc->GetSelection();
505 
506  return nFuncMask;
507 }
508 
510 {
511  rLabelData.mnFuncMask = GetFuncMask();
512  rLabelData.mnUsedHier = maLabelData.mnUsedHier;
513  rLabelData.mbShowAll = mxCbShowAll->get_active();
514  rLabelData.maMembers = maLabelData.maMembers;
515  rLabelData.maSortInfo = maLabelData.maSortInfo;
517  rLabelData.maShowInfo = maLabelData.maShowInfo;
519 }
520 
521 void ScDPSubtotalDlg::Init( const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData )
522 {
523  mxBtnOk->connect_clicked( LINK( this, ScDPSubtotalDlg, ButtonClicked ) );
524  mxBtnCancel->connect_clicked( LINK( this, ScDPSubtotalDlg, ButtonClicked ) );
525 
526  // field name
527  mxFtName->set_label(rLabelData.getDisplayName());
528 
529  // radio buttons
530  mxRbNone->connect_toggled( LINK( this, ScDPSubtotalDlg, RadioClickHdl ) );
531  mxRbAuto->connect_toggled( LINK( this, ScDPSubtotalDlg, RadioClickHdl ) );
532  mxRbUser->connect_toggled( LINK( this, ScDPSubtotalDlg, RadioClickHdl ) );
533 
534  weld::RadioButton* pRBtn = nullptr;
535  switch( rFuncData.mnFuncMask )
536  {
537  case PivotFunc::NONE: pRBtn = mxRbNone.get(); break;
538  case PivotFunc::Auto: pRBtn = mxRbAuto.get(); break;
539  default: pRBtn = mxRbUser.get();
540  }
541  pRBtn->set_active(true);
542  RadioClickHdl(*pRBtn);
543 
544  // list box
545  mxLbFunc->SetSelection( rFuncData.mnFuncMask );
546  mxLbFunc->connect_row_activated( LINK( this, ScDPSubtotalDlg, DblClickHdl ) );
547 
548  // show all
549  mxCbShowAll->set_active( rLabelData.mbShowAll );
550 
551  // options
552  mxBtnOptions->connect_clicked( LINK( this, ScDPSubtotalDlg, ClickHdl ) );
553 }
554 
555 IMPL_LINK(ScDPSubtotalDlg, ButtonClicked, weld::Button&, rButton, void)
556 {
557  CloseSubdialog();
558 
559  if (&rButton == mxBtnOk.get())
560  response(RET_OK);
561  else
562  response(RET_CANCEL);
563 }
564 
565 IMPL_LINK(ScDPSubtotalDlg, RadioClickHdl, weld::Toggleable&, rBtn, void)
566 {
567  if (!rBtn.get_active())
568  return;
569  mxLbFunc->set_sensitive(mxRbUser->get_active());
570 }
571 
573 {
574  m_xDialog->response(RET_OK);
575  return true;
576 }
577 
578 IMPL_LINK(ScDPSubtotalDlg, ClickHdl, weld::Button&, rBtn, void)
579 {
580  if (&rBtn == mxBtnOptions.get())
581  {
582  mxOptionsDlg = std::make_shared<ScDPSubtotalOptDlg>(m_xDialog.get(), mrDPObj, maLabelData, mrDataFields, mbEnableLayout);
583 
584  weld::DialogController::runAsync(mxOptionsDlg, [this](int nResult) {
585  if (nResult == RET_OK)
586  mxOptionsDlg->FillLabelData(maLabelData);
587  mxOptionsDlg = nullptr;
588  });
589  }
590 }
591 
592 namespace
593 {
594  int FromDataPilotFieldLayoutMode(int eMode)
595  {
596  switch (eMode)
597  {
598  case DataPilotFieldLayoutMode::TABULAR_LAYOUT:
599  return 0;
600  case DataPilotFieldLayoutMode::OUTLINE_SUBTOTALS_TOP:
601  return 1;
602  case DataPilotFieldLayoutMode::OUTLINE_SUBTOTALS_BOTTOM:
603  return 2;
604  }
605  return -1;
606  }
607 
608  int ToDataPilotFieldLayoutMode(int nPos)
609  {
610  switch (nPos)
611  {
612  case 0:
613  return DataPilotFieldLayoutMode::TABULAR_LAYOUT;
614  case 1:
615  return DataPilotFieldLayoutMode::OUTLINE_SUBTOTALS_TOP;
616  case 2:
617  return DataPilotFieldLayoutMode::OUTLINE_SUBTOTALS_BOTTOM;
618  }
619  return DataPilotFieldLayoutMode::TABULAR_LAYOUT;
620  }
621 
622  int FromDataPilotFieldShowItemsMode(int eMode)
623  {
624  switch (eMode)
625  {
626  case DataPilotFieldShowItemsMode::FROM_TOP:
627  return 0;
628  case DataPilotFieldShowItemsMode::FROM_BOTTOM:
629  return 1;
630  }
631  return -1;
632  }
633 
634  int ToDataPilotFieldShowItemsMode(int nPos)
635  {
636  switch (nPos)
637  {
638  case 0:
639  return DataPilotFieldShowItemsMode::FROM_TOP;
640  case 1:
641  return DataPilotFieldShowItemsMode::FROM_BOTTOM;
642  }
643  return DataPilotFieldShowItemsMode::FROM_TOP;
644  }
645 }
646 
648  const ScDPLabelData& rLabelData, const ScDPNameVec& rDataFields,
649  bool bEnableLayout )
650  : GenericDialogController(pParent, "modules/scalc/ui/datafieldoptionsdialog.ui",
651  "DataFieldOptionsDialog")
652  , m_xLbSortBy(m_xBuilder->weld_combo_box("sortby"))
653  , m_xRbSortAsc(m_xBuilder->weld_radio_button("ascending"))
654  , m_xRbSortDesc(m_xBuilder->weld_radio_button("descending"))
655  , m_xRbSortMan(m_xBuilder->weld_radio_button("manual"))
656  , m_xLayoutFrame(m_xBuilder->weld_widget("layoutframe"))
657  , m_xLbLayout(m_xBuilder->weld_combo_box("layout"))
658  , m_xCbLayoutEmpty(m_xBuilder->weld_check_button("emptyline"))
659  , m_xCbRepeatItemLabels(m_xBuilder->weld_check_button("repeatitemlabels"))
660  , m_xCbShow(m_xBuilder->weld_check_button("show"))
661  , m_xNfShow(m_xBuilder->weld_spin_button("items"))
662  , m_xFtShow(m_xBuilder->weld_label("showft"))
663  , m_xFtShowFrom(m_xBuilder->weld_label("showfromft"))
664  , m_xLbShowFrom(m_xBuilder->weld_combo_box("from"))
665  , m_xFtShowUsing(m_xBuilder->weld_label("usingft"))
666  , m_xLbShowUsing(m_xBuilder->weld_combo_box("using"))
667  , m_xHideFrame(m_xBuilder->weld_widget("hideframe"))
668  , m_xLbHide(m_xBuilder->weld_tree_view("hideitems"))
669  , m_xFtHierarchy(m_xBuilder->weld_label("hierarchyft"))
670  , m_xLbHierarchy(m_xBuilder->weld_combo_box("hierarchy"))
671  , m_xBtnOk(m_xBuilder->weld_button("ok"))
672  , m_xBtnCancel(m_xBuilder->weld_button("cancel"))
673  , mrDPObj(rDPObj)
674  , maLabelData(rLabelData)
675 {
676  m_xLbHide->enable_toggle_buttons(weld::ColumnToggleType::Check);
677 
678  m_xLbSortBy->set_size_request(m_xLbSortBy->get_approximate_digit_width() * 18, -1);
679  m_xLbHide->set_size_request(-1, m_xLbHide->get_height_rows(5));
680  Init(rDataFields, bEnableLayout);
681 }
682 
684 {
685 }
686 
688 {
689  // *** SORTING ***
690 
691  if (m_xRbSortMan->get_active())
692  rLabelData.maSortInfo.Mode = DataPilotFieldSortMode::MANUAL;
693  else if (m_xLbSortBy->get_active() == SC_SORTNAME_POS)
694  rLabelData.maSortInfo.Mode = DataPilotFieldSortMode::NAME;
695  else
696  rLabelData.maSortInfo.Mode = DataPilotFieldSortMode::DATA;
697 
698  ScDPName aFieldName = GetFieldName(m_xLbSortBy->get_active_text());
699  if (!aFieldName.maName.isEmpty())
700  {
701  rLabelData.maSortInfo.Field =
702  ScDPUtil::createDuplicateDimensionName(aFieldName.maName, aFieldName.mnDupCount);
703  rLabelData.maSortInfo.IsAscending = m_xRbSortAsc->get_active();
704  }
705 
706  // *** LAYOUT MODE ***
707 
708  rLabelData.maLayoutInfo.LayoutMode = ToDataPilotFieldLayoutMode(m_xLbLayout->get_active());
709  rLabelData.maLayoutInfo.AddEmptyLines = m_xCbLayoutEmpty->get_active();
710  rLabelData.mbRepeatItemLabels = m_xCbRepeatItemLabels->get_active();
711 
712  // *** AUTO SHOW ***
713 
714  aFieldName = GetFieldName(m_xLbShowUsing->get_active_text());
715  if (!aFieldName.maName.isEmpty())
716  {
717  rLabelData.maShowInfo.IsEnabled = m_xCbShow->get_active();
718  rLabelData.maShowInfo.ShowItemsMode = ToDataPilotFieldShowItemsMode(m_xLbShowFrom->get_active());
719  rLabelData.maShowInfo.ItemCount = sal::static_int_cast<sal_Int32>( m_xNfShow->get_value() );
720  rLabelData.maShowInfo.DataField =
721  ScDPUtil::createDuplicateDimensionName(aFieldName.maName, aFieldName.mnDupCount);
722  }
723 
724  // *** HIDDEN ITEMS ***
725 
726  rLabelData.maMembers = maLabelData.maMembers;
727  int nVisCount = m_xLbHide->n_children();
728  for (int nPos = 0; nPos < nVisCount; ++nPos)
729  rLabelData.maMembers[nPos].mbVisible = m_xLbHide->get_toggle(nPos) == TRISTATE_FALSE;
730 
731  // *** HIERARCHY ***
732 
733  rLabelData.mnUsedHier = m_xLbHierarchy->get_active() != -1 ? m_xLbHierarchy->get_active() : 0;
734 }
735 
736 void ScDPSubtotalOptDlg::Init( const ScDPNameVec& rDataFields, bool bEnableLayout )
737 {
738  m_xBtnOk->connect_clicked(LINK(this, ScDPSubtotalOptDlg, ButtonClicked));
739  m_xBtnCancel->connect_clicked(LINK(this, ScDPSubtotalOptDlg, ButtonClicked));
740 
741  // *** SORTING ***
742 
743  sal_Int32 nSortMode = maLabelData.maSortInfo.Mode;
744 
745  // sort fields list box
746  m_xLbSortBy->append_text(maLabelData.getDisplayName());
747 
748  for( const auto& rDataField : rDataFields )
749  {
750  // Cache names for later lookup.
751  maDataFieldNameMap.emplace(rDataField.maLayoutName, rDataField);
752 
753  m_xLbSortBy->append_text(rDataField.maLayoutName);
754  m_xLbShowUsing->append_text(rDataField.maLayoutName); // for AutoShow
755  }
756 
757  sal_Int32 nSortPos = SC_SORTNAME_POS;
758  if( nSortMode == DataPilotFieldSortMode::DATA )
759  {
760  nSortPos = FindListBoxEntry( *m_xLbSortBy, maLabelData.maSortInfo.Field, SC_SORTDATA_POS );
761  if( nSortPos == -1 )
762  {
763  nSortPos = SC_SORTNAME_POS;
764  nSortMode = DataPilotFieldSortMode::MANUAL;
765  }
766  }
767  m_xLbSortBy->set_active(nSortPos);
768 
769  // sorting mode
770  m_xRbSortAsc->connect_toggled( LINK( this, ScDPSubtotalOptDlg, RadioClickHdl ) );
771  m_xRbSortDesc->connect_toggled( LINK( this, ScDPSubtotalOptDlg, RadioClickHdl ) );
772  m_xRbSortMan->connect_toggled( LINK( this, ScDPSubtotalOptDlg, RadioClickHdl ) );
773 
774  weld::RadioButton* pRBtn = nullptr;
775  switch( nSortMode )
776  {
778  case DataPilotFieldSortMode::MANUAL:
779  pRBtn = m_xRbSortMan.get();
780  break;
781  default:
782  pRBtn = maLabelData.maSortInfo.IsAscending ? m_xRbSortAsc.get() : m_xRbSortDesc.get();
783  }
784  pRBtn->set_active(true);
785  RadioClickHdl(*pRBtn);
786 
787  // *** LAYOUT MODE ***
788 
789  m_xLayoutFrame->set_sensitive(bEnableLayout);
790 
791  m_xLbLayout->set_active(FromDataPilotFieldLayoutMode(maLabelData.maLayoutInfo.LayoutMode));
792  m_xCbLayoutEmpty->set_active( maLabelData.maLayoutInfo.AddEmptyLines );
794 
795  // *** AUTO SHOW ***
796 
797  m_xCbShow->set_active( maLabelData.maShowInfo.IsEnabled );
798  m_xCbShow->connect_toggled( LINK( this, ScDPSubtotalOptDlg, CheckHdl ) );
799 
800  m_xLbShowFrom->set_active(FromDataPilotFieldShowItemsMode(maLabelData.maShowInfo.ShowItemsMode));
801  tools::Long nCount = static_cast< tools::Long >( maLabelData.maShowInfo.ItemCount );
802  if( nCount < 1 )
803  nCount = SC_SHOW_DEFAULT;
804  m_xNfShow->set_value( nCount );
805 
806  // m_xLbShowUsing already filled above
807  m_xLbShowUsing->set_active_text(maLabelData.maShowInfo.DataField);
808  if (m_xLbShowUsing->get_active() == -1)
809  m_xLbShowUsing->set_active(0);
810 
811  CheckHdl(*m_xCbShow); // enable/disable dependent controls
812 
813  // *** HIDDEN ITEMS ***
814 
815  InitHideListBox();
816 
817  // *** HIERARCHY ***
818 
819  if( maLabelData.maHiers.getLength() > 1 )
820  {
821  lclFillListBox(*m_xLbHierarchy, maLabelData.maHiers);
822  sal_Int32 nHier = maLabelData.mnUsedHier;
823  if( (nHier < 0) || (nHier >= maLabelData.maHiers.getLength()) ) nHier = 0;
824  m_xLbHierarchy->set_active( nHier );
825  m_xLbHierarchy->connect_changed( LINK( this, ScDPSubtotalOptDlg, SelectHdl ) );
826  }
827  else
828  {
829  m_xFtHierarchy->set_sensitive(false);
830  m_xLbHierarchy->set_sensitive(false);
831  }
832 }
833 
835 {
836  m_xLbHide->clear();
837  lclFillListBox(*m_xLbHide, maLabelData.maMembers);
838  size_t n = maLabelData.maMembers.size();
839  for (size_t i = 0; i < n; ++i)
840  m_xLbHide->set_toggle(i, maLabelData.maMembers[i].mbVisible ? TRISTATE_FALSE : TRISTATE_TRUE);
841  bool bEnable = m_xLbHide->n_children() > 0;
842  m_xHideFrame->set_sensitive(bEnable);
843 }
844 
845 ScDPName ScDPSubtotalOptDlg::GetFieldName(const OUString& rLayoutName) const
846 {
847  NameMapType::const_iterator itr = maDataFieldNameMap.find(rLayoutName);
848  return itr == maDataFieldNameMap.end() ? ScDPName() : itr->second;
849 }
850 
852  const weld::ComboBox& rLBox, std::u16string_view rEntry, sal_Int32 nStartPos ) const
853 {
854  sal_Int32 nPos = nStartPos;
855  bool bFound = false;
856  while (nPos < rLBox.get_count())
857  {
858  // translate the displayed field name back to its original field name.
859  ScDPName aName = GetFieldName(rLBox.get_text(nPos));
860  OUString aUnoName = ScDPUtil::createDuplicateDimensionName(aName.maName, aName.mnDupCount);
861  if (aUnoName == rEntry)
862  {
863  bFound = true;
864  break;
865  }
866  ++nPos;
867  }
868  return bFound ? nPos : -1;
869 }
870 
871 IMPL_LINK(ScDPSubtotalOptDlg, ButtonClicked, weld::Button&, rButton, void)
872 {
873  if (&rButton == m_xBtnOk.get())
874  response(RET_OK);
875  else
876  response(RET_CANCEL);
877 }
878 
879 IMPL_LINK(ScDPSubtotalOptDlg, RadioClickHdl, weld::Toggleable&, rBtn, void)
880 {
881  if (!rBtn.get_active())
882  return;
883 
884  m_xLbSortBy->set_sensitive(m_xRbSortMan->get_active());
885 }
886 
888 {
889  if (&rCBox == m_xCbShow.get())
890  {
891  bool bEnable = m_xCbShow->get_active();
892  m_xNfShow->set_sensitive( bEnable );
893  m_xFtShow->set_sensitive( bEnable );
894  m_xFtShowFrom->set_sensitive( bEnable );
895  m_xLbShowFrom->set_sensitive( bEnable );
896 
897  bool bEnableUsing = bEnable && (m_xLbShowUsing->get_count() > 0);
898  m_xFtShowUsing->set_sensitive(bEnableUsing);
899  m_xLbShowUsing->set_sensitive(bEnableUsing);
900  }
901 }
902 
904 {
905  mrDPObj.GetMembers(maLabelData.mnCol, m_xLbHierarchy->get_active(), maLabelData.maMembers);
906  InitHideListBox();
907 }
908 
909 ScDPShowDetailDlg::ScDPShowDetailDlg(weld::Window* pParent, ScDPObject& rDPObj, css::sheet::DataPilotFieldOrientation nOrient)
910  : GenericDialogController(pParent, "modules/scalc/ui/showdetaildialog.ui", "ShowDetail")
911  , mrDPObj(rDPObj)
912  , mxLbDims(m_xBuilder->weld_tree_view("dimsTreeview"))
913 {
914  ScDPSaveData* pSaveData = rDPObj.GetSaveData();
915  tools::Long nDimCount = rDPObj.GetDimCount();
916  for (tools::Long nDim=0; nDim<nDimCount; nDim++)
917  {
918  bool bIsDataLayout;
919  sal_Int32 nDimFlags = 0;
920  OUString aName = rDPObj.GetDimName( nDim, bIsDataLayout, &nDimFlags );
921  if ( !bIsDataLayout && !rDPObj.IsDuplicated( nDim ) && ScDPObject::IsOrientationAllowed( nOrient, nDimFlags ) )
922  {
923  const ScDPSaveDimension* pDimension = pSaveData ? pSaveData->GetExistingDimensionByName(aName) : nullptr;
924  if ( !pDimension || (pDimension->GetOrientation() != nOrient) )
925  {
926  if (pDimension)
927  {
928  const std::optional<OUString> & pLayoutName = pDimension->GetLayoutName();
929  if (pLayoutName)
930  aName = *pLayoutName;
931  }
932  mxLbDims->append_text(aName);
933  maNameIndexMap.emplace(aName, nDim);
934  }
935  }
936  }
937  if (mxLbDims->n_children())
938  mxLbDims->select(0);
939 
940  mxLbDims->connect_row_activated(LINK(this, ScDPShowDetailDlg, DblClickHdl));
941 }
942 
944 {
945 }
946 
948 {
949  return mxLbDims->n_children() ? GenericDialogController::run() : static_cast<short>(RET_CANCEL);
950 }
951 
953 {
954  // Look up the internal dimension name which may be different from the
955  // displayed field name.
956  OUString aSelectedName = mxLbDims->get_selected_text();
957  DimNameIndexMap::const_iterator itr = maNameIndexMap.find(aSelectedName);
958  if (itr == maNameIndexMap.end())
959  // This should never happen!
960  return aSelectedName;
961 
962  tools::Long nDim = itr->second;
963  bool bIsDataLayout = false;
964  return mrDPObj.GetDimName(nDim, bIsDataLayout);
965 }
966 
968 {
969  m_xDialog->response(RET_OK);
970  return true;
971 }
972 
973 /* 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:174
static SC_DLLPUBLIC OUString createDuplicateDimensionName(const OUString &rOriginal, size_t nDupCount)
Definition: dputil.cxx:92
void FillLabelData(ScDPLabelData &rLabelData) const
Definition: pvfundlg.cxx:509
std::unique_ptr< weld::Button > mxBtnCancel
Definition: pvfundlg.hxx:84
const std::optional< OUString > & GetLayoutName() const
Definition: dpsave.cxx:384
std::shared_ptr< ScDPSubtotalOptDlg > mxOptionsDlg
Definition: pvfundlg.hxx:133
sal_Int32 nIndex
OUString maName
Original name of the dimension.
Definition: pivot.hxx:58
OUString ScResId(TranslateId aId)
Definition: scdll.cxx:89
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:161
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:834
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:683
tools::Long GetDimCount()
Definition: dpobject.cxx:1274
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:129
sal_Int64 n
ScDPSubtotalOptDlg(weld::Window *pParent, ScDPObject &rDPObj, const ScDPLabelData &rLabelData, const ScDPNameVec &rDataFields, bool bEnableLayout)
Definition: pvfundlg.cxx:647
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:943
std::unique_ptr< weld::Button > mxBtnCancel
Definition: pvfundlg.hxx:130
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:736
ScDPName GetFieldName(const OUString &rLayoutName) const
Definition: pvfundlg.cxx:845
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:172
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:521
ScDPLabelData maLabelData
The list of all data field names.
Definition: pvfundlg.hxx:120
size_t pos
std::unique_ptr< weld::RadioButton > mxRbUser
Definition: pvfundlg.hxx:125
std::unique_ptr< ScDPFunctionListBox > mxLbFunc
Definition: pvfundlg.hxx:126
int nCount
virtual int n_children() const =0
std::unique_ptr< weld::Label > m_xFtHierarchy
Definition: pvfundlg.hxx:177
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:851
PivotFunc mnFuncMask
Page/Column/Row subtotal function.
Definition: pivot.hxx:73
std::unique_ptr< weld::ComboBox > m_xLbLayout
Definition: pvfundlg.hxx:165
PivotFunc
Definition: dpglobal.hxx:24
#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:178
std::unique_ptr< weld::ComboBox > m_xLbSortBy
Definition: pvfundlg.hxx:160
virtual ~ScDPFunctionDlg() override
Definition: pvfundlg.cxx:258
virtual short run() override
Definition: pvfundlg.cxx:947
std::unique_ptr< weld::RadioButton > mxRbAuto
Definition: pvfundlg.hxx:124
ScDPShowDetailDlg(weld::Window *pParent, ScDPObject &rDPObj, css::sheet::DataPilotFieldOrientation nOrient)
Definition: pvfundlg.cxx:909
sal_uInt8 mnDupCount
Definition: pivot.hxx:60
int i
std::unique_ptr< weld::Label > mxFtName
Definition: pvfundlg.hxx:127
std::vector< std::unique_ptr< ScDPLabelData > > ScDPLabelDataVector
Definition: pivot.hxx:113
std::unique_ptr< weld::Button > mxBtnOptions
Definition: pvfundlg.hxx:131
std::unique_ptr< weld::RadioButton > mxRbNone
true = Enable Layout mode controls.
Definition: pvfundlg.hxx:123
virtual void set_toggle(int row, TriState eState, int col=-1)=0
std::unique_ptr< weld::Button > m_xBtnCancel
Definition: pvfundlg.hxx:180
TRISTATE_FALSE
virtual void set_active(bool active)=0
std::unique_ptr< weld::Button > m_xBtnOk
Definition: pvfundlg.hxx:179
std::unique_ptr< weld::TreeView > m_xControl
Definition: pvfundlg.hxx:48
OUString GetDimensionName() const
Definition: pvfundlg.cxx:952
DimNameIndexMap maNameIndexMap
Definition: pvfundlg.hxx:210
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:128
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:168
std::unique_ptr< weld::SpinButton > m_xNfShow
Definition: pvfundlg.hxx:169
ScDPObject & mrDPObj
Definition: pvfundlg.hxx:211
void FillLabelData(ScDPLabelData &rLabelData) const
Definition: pvfundlg.cxx:687
std::unique_ptr< weld::ComboBox > mxLbType
Definition: pvfundlg.hxx:78
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:176
std::unique_ptr< weld::CheckButton > m_xCbRepeatItemLabels
Definition: pvfundlg.hxx:167
static bool IsOrientationAllowed(css::sheet::DataPilotFieldOrientation nOrient, sal_Int32 nDimFlags)
Definition: dpobject.cxx:2703
std::unique_ptr< weld::Label > mxFtName
Definition: pvfundlg.hxx:77
NameMapType maDataFieldNameMap
Definition: pvfundlg.hxx:186
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
if(aStr!=aBuf) UpdateName_Impl(m_xFollowLb.get()
RET_OK
css::sheet::DataPilotFieldSortInfo maSortInfo
Sorting info.
Definition: pivot.hxx:100
void CloseSubdialog()
Definition: pvfundlg.cxx:488
Reference< XExecutableDialog > m_xDialog
std::unique_ptr< weld::Widget > m_xLayoutFrame
Definition: pvfundlg.hxx:164
std::unique_ptr< weld::TreeView > mxLbDims
Definition: pvfundlg.hxx:213
bool IsDuplicated(tools::Long nDim)
Definition: dpobject.cxx:1245
void append(TreeIter *pRet=nullptr)
std::unique_ptr< weld::RadioButton > m_xRbSortMan
Definition: pvfundlg.hxx:163
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)
PivotFunc GetSelection() const
Definition: pvfundlg.cxx:160
std::unique_ptr< weld::Widget > m_xHideFrame
Definition: pvfundlg.hxx:175
PivotFunc GetFuncMask() const
Definition: pvfundlg.cxx:262
std::unique_ptr< weld::RadioButton > m_xRbSortDesc
Definition: pvfundlg.hxx:162
std::unique_ptr< weld::CheckButton > m_xCbLayoutEmpty
Definition: pvfundlg.hxx:166
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:497
bool mbEmptyItem
Data of all labels.
Definition: pvfundlg.hxx:91
ScDPLabelData maLabelData
The DataPilot object (for member names).
Definition: pvfundlg.hxx:183