LibreOffice Module sc (master)  1
consdlg.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 #include <sfx2/dispatch.hxx>
21 
22 #include <tabvwsh.hxx>
23 #include <uiitems.hxx>
24 #include <dbdata.hxx>
25 #include <rangenam.hxx>
26 #include <rangeutl.hxx>
27 #include <reffact.hxx>
28 #include <document.hxx>
29 #include <scresid.hxx>
30 
31 #include <globstr.hrc>
32 #include <strings.hrc>
33 
34 #include <consdlg.hxx>
35 #include <o3tl/safeint.hxx>
36 #include <vcl/svapp.hxx>
37 #include <vcl/weld.hxx>
38 
39 namespace
40 {
41  void INFOBOX(weld::Window* pWindow, const char* id)
42  {
43  std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWindow,
44  VclMessageType::Info, VclButtonsType::Ok,
45  ScResId(id)));
46  xInfoBox->run();
47  }
48 }
49 
51 {
52 public:
54  {
55  }
56 
57  void Set( const OUString& rName, const OUString& rArea )
58  {
59  aStrName = rName;
60  aStrArea = rArea;
61  }
62 
63  OUString aStrName;
64  OUString aStrArea;
65 };
66 
68  const SfxItemSet& rArgSet)
69 
70  : ScAnyRefDlgController(pB, pCW, pParent, "modules/scalc/ui/consolidatedialog.ui", "ConsolidateDialog")
71  , aStrUndefined ( ScResId( SCSTR_UNDEFINED ) )
72  , theConsData ( static_cast<const ScConsolidateItem&>(
73  rArgSet.Get( rArgSet.GetPool()->
74  GetWhich( SID_CONSOLIDATE ) )
75  ).GetData() )
76  , rViewData ( static_cast<ScTabViewShell*>(SfxViewShell::Current())->
77  GetViewData() )
78  , rDoc ( static_cast<ScTabViewShell*>(SfxViewShell::Current())->
79  GetViewData().GetDocument() )
80  , nAreaDataCount ( 0 )
81  , nWhichCons ( rArgSet.GetPool()->GetWhich( SID_CONSOLIDATE ) )
82  , bDlgLostFocus ( false )
83  , m_xLbFunc(m_xBuilder->weld_combo_box("func"))
84  , m_xLbConsAreas(m_xBuilder->weld_tree_view("consareas"))
85  , m_xLbDataArea(m_xBuilder->weld_combo_box("lbdataarea"))
86  , m_xEdDataArea(new formula::RefEdit(m_xBuilder->weld_entry("eddataarea")))
87  , m_xRbDataArea(new formula::RefButton(m_xBuilder->weld_button("rbdataarea")))
88  , m_xLbDestArea(m_xBuilder->weld_combo_box("lbdestarea"))
89  , m_xEdDestArea(new formula::RefEdit(m_xBuilder->weld_entry("eddestarea")))
90  , m_xRbDestArea(new formula::RefButton(m_xBuilder->weld_button("rbdestarea")))
91  , m_xExpander(m_xBuilder->weld_expander("more"))
92  , m_xBtnByRow(m_xBuilder->weld_check_button("byrow"))
93  , m_xBtnByCol(m_xBuilder->weld_check_button("bycol"))
94  , m_xBtnRefs(m_xBuilder->weld_check_button("refs"))
95  , m_xBtnOk(m_xBuilder->weld_button("ok"))
96  , m_xBtnCancel(m_xBuilder->weld_button("cancel"))
97  , m_xBtnAdd(m_xBuilder->weld_button("add"))
98  , m_xBtnRemove(m_xBuilder->weld_button("delete"))
99  , m_xDataFT(m_xBuilder->weld_label("ftdataarea"))
100  , m_xDestFT(m_xBuilder->weld_label("ftdestarea"))
101 {
103  Init();
104 }
105 
107 {
108 }
109 
111 {
112  OUString aStr;
113  sal_uInt16 i=0;
114 
115  m_xRbDataArea->SetReferences(this, m_xEdDataArea.get());
116  m_xEdDataArea->SetReferences(this, m_xDataFT.get());
117  m_xRbDestArea->SetReferences(this, m_xEdDestArea.get());
118  m_xEdDestArea->SetReferences(this, m_xDestFT.get());
119 
120  m_xEdDataArea->SetGetFocusHdl( LINK( this, ScConsolidateDlg, GetEditFocusHdl ) );
121  m_xEdDestArea->SetGetFocusHdl( LINK( this, ScConsolidateDlg, GetEditFocusHdl ) );
122  m_xLbDataArea->connect_focus_in( LINK( this, ScConsolidateDlg, GetFocusHdl ) );
123  m_xLbDestArea->connect_focus_in( LINK( this, ScConsolidateDlg, GetFocusHdl ) );
124  m_xEdDataArea->SetModifyHdl( LINK( this, ScConsolidateDlg, ModifyHdl ) );
125  m_xEdDestArea->SetModifyHdl( LINK( this, ScConsolidateDlg, ModifyHdl ) );
126  m_xLbConsAreas->connect_changed( LINK( this, ScConsolidateDlg, SelectTVHdl ) );
127  m_xLbDataArea->connect_changed( LINK( this, ScConsolidateDlg, SelectCBHdl ) );
128  m_xLbDestArea->connect_changed( LINK( this, ScConsolidateDlg, SelectCBHdl ) );
129  m_xBtnOk->connect_clicked( LINK( this, ScConsolidateDlg, OkHdl ) );
130  m_xBtnCancel->connect_clicked( LINK( this, ScConsolidateDlg, ClickHdl ) );
131  m_xBtnAdd->connect_clicked( LINK( this, ScConsolidateDlg, ClickHdl ) );
132  m_xBtnRemove->connect_clicked( LINK( this, ScConsolidateDlg, ClickHdl ) );
133 
134  m_xBtnAdd->set_sensitive(false);
135  m_xBtnRemove->set_sensitive(false);
136 
137  m_xBtnByRow->set_active( theConsData.bByRow );
138  m_xBtnByCol->set_active( theConsData.bByCol );
139  m_xBtnRefs->set_active( theConsData.bReferenceData );
140 
141  m_xLbFunc->set_active( FuncToLbPos( theConsData.eFunction ) );
142 
143  m_xLbConsAreas->set_selection_mode(SelectionMode::Multiple);
144  m_xLbConsAreas->set_size_request(m_xLbConsAreas->get_approximate_digit_width() * 16,
145  m_xLbConsAreas->get_height_rows(5));
146 
147  // read consolidation areas
148  m_xLbConsAreas->clear();
150  for ( i=0; i<theConsData.nDataAreaCount; i++ )
151  {
152  const ScArea& rArea = theConsData.pDataAreas[i];
153  if ( rArea.nTab < rDoc.GetTableCount() )
154  {
155  aStr = ScRange( rArea.nColStart, rArea.nRowStart, rArea.nTab,
156  rArea.nColEnd, rArea.nRowEnd, rArea.nTab ).Format( rDoc,
157  ScRefFlags::RANGE_ABS_3D, eConv );
158  m_xLbConsAreas->append_text(aStr);
159  }
160  }
161 
163  {
165  ).Format( ScRefFlags::ADDR_ABS_3D, &rDoc, eConv );
166  m_xEdDestArea->SetText( aStr );
167  }
168  else
169  m_xEdDestArea->SetText(OUString());
170 
171  // Use the ScAreaData helper class to save those range names from the
172  // RangeNames and database ranges that appear in the ListBoxes.
173 
174  ScRangeName* pRangeNames = rDoc.GetRangeName();
175  ScDBCollection* pDbNames = rDoc.GetDBCollection();
176  size_t nRangeCount = pRangeNames ? pRangeNames->size() : 0;
177  size_t nDbCount = pDbNames ? pDbNames->getNamedDBs().size() : 0;
178 
179  nAreaDataCount = nRangeCount+nDbCount;
180  pAreaData = nullptr;
181 
182  if ( nAreaDataCount > 0 )
183  {
184  pAreaData.reset( new ScAreaData[nAreaDataCount] );
185 
186  OUString aStrName;
187  sal_uInt16 nAt = 0;
188  ScRange aRange;
189  ScAreaNameIterator aIter( rDoc );
190  while ( aIter.Next( aStrName, aRange ) )
191  {
192  OUString aStrArea(aRange.Format(rDoc, ScRefFlags::ADDR_ABS_3D, eConv));
193  pAreaData[nAt++].Set( aStrName, aStrArea );
194  }
195  }
196 
197  FillAreaLists();
198  ModifyHdl( *m_xEdDestArea );
199  m_xLbDataArea->set_active( 0 );
200  m_xEdDataArea->SetText(OUString());
201  m_xEdDataArea->GrabFocus();
202 
203  //aFlSep.SetStyle( aFlSep.GetStyle() | WB_VERT );
204 
205  //@BugID 54702 enable/disable only in base class
206  //SFX_APPWINDOW->set_sensitive(true);
207 }
208 
210 {
211  m_xLbDataArea->clear();
212  m_xLbDestArea->clear();
213  m_xLbDataArea->append_text( aStrUndefined );
214  m_xLbDestArea->append_text( aStrUndefined );
215 
216  if ( pAreaData && (nAreaDataCount > 0) )
217  {
218  for ( size_t i=0;
219  (i<nAreaDataCount) && (!pAreaData[i].aStrName.isEmpty());
220  i++ )
221  {
222  m_xLbDataArea->append_text(pAreaData[i].aStrName);
223  m_xLbDestArea->append_text(pAreaData[i].aStrName);
224  }
225  }
226 }
227 
228 // Handover of a range within a table that has been selected by the mouse.
229 // This range is then shown in the reference window as new selection.
230 
232 {
233  if ( !m_pRefInputEdit )
234  return;
235 
236  if ( rRef.aStart != rRef.aEnd )
238 
239  OUString aStr;
242 
243  if ( rRef.aStart.Tab() != rRef.aEnd.Tab() )
244  nFmt |= ScRefFlags::TAB2_3D;
245 
246  if ( m_pRefInputEdit == m_xEdDataArea.get())
247  aStr = rRef.Format(rDocP, nFmt, eConv);
248  else if ( m_pRefInputEdit == m_xEdDestArea.get() )
249  aStr = rRef.aStart.Format(nFmt, &rDocP, eConv);
250 
251  m_pRefInputEdit->SetRefString( aStr );
252  ModifyHdl( *m_pRefInputEdit );
253 }
254 
256 {
257  DoClose( ScConsolidateDlgWrapper::GetChildWindowId() );
258 }
259 
261 {
262  if ( bDlgLostFocus )
263  {
264  bDlgLostFocus = false;
265 
266  if ( m_pRefInputEdit )
267  {
269  ModifyHdl( *m_pRefInputEdit );
270  }
271  }
272  else
273  m_xDialog->grab_focus();
274 
275  RefInputDone();
276 }
277 
279 {
280  bDlgLostFocus = true;
281 }
282 
284 {
285  if (pEd != m_xEdDataArea.get() && pEd != m_xEdDestArea.get())
286  return false;
287 
288  SCTAB nTab = rViewData.GetTabNo();
289  bool bEditOk = false;
290  OUString theCompleteStr;
292 
293  if ( pEd == m_xEdDataArea.get() )
294  {
295  bEditOk = ScRangeUtil::IsAbsArea( pEd->GetText(), rDoc,
296  nTab, &theCompleteStr, nullptr, nullptr, eConv );
297  }
298  else if ( pEd == m_xEdDestArea.get() )
299  {
300  OUString aPosStr;
301 
302  ScRangeUtil::CutPosString( pEd->GetText(), aPosStr );
303  bEditOk = ScRangeUtil::IsAbsPos( aPosStr, rDoc,
304  nTab, &theCompleteStr, nullptr, eConv );
305  }
306 
307  if ( bEditOk )
308  pEd->SetText( theCompleteStr );
309 
310  return bEditOk;
311 }
312 
313 // Handler:
314 
315 IMPL_LINK( ScConsolidateDlg, GetEditFocusHdl, formula::RefEdit&, rControl, void )
316 {
317  m_pRefInputEdit = &rControl;
318 }
319 
320 IMPL_LINK( ScConsolidateDlg, GetFocusHdl, weld::Widget&, rControl, void )
321 {
322  if (&rControl == m_xLbDataArea.get())
323  m_pRefInputEdit = m_xEdDataArea.get();
324  else if (&rControl == m_xLbDestArea.get())
325  m_pRefInputEdit = m_xEdDestArea.get();
326 }
327 
329 {
330  const sal_Int32 nDataAreaCount = m_xLbConsAreas->n_children();
331 
332  if ( nDataAreaCount > 0 )
333  {
334  ScRefAddress aDestAddress;
335  SCTAB nTab = rViewData.GetTabNo();
336  OUString aDestPosStr( m_xEdDestArea->GetText() );
337  const formula::FormulaGrammar::AddressConvention eConv = rDoc.GetAddressConvention();
338 
339  if ( ScRangeUtil::IsAbsPos( aDestPosStr, rDoc, nTab, nullptr, &aDestAddress, eConv ) )
340  {
341  ScConsolidateParam theOutParam( theConsData );
342  std::unique_ptr<ScArea[]> pDataAreas(new ScArea[nDataAreaCount]);
343 
344  for ( sal_Int32 i=0; i<nDataAreaCount; ++i )
345  {
346  ScRangeUtil::MakeArea(m_xLbConsAreas->get_text(i),
347  pDataAreas[i], rDoc, nTab, eConv);
348  }
349 
350  theOutParam.nCol = aDestAddress.Col();
351  theOutParam.nRow = aDestAddress.Row();
352  theOutParam.nTab = aDestAddress.Tab();
353  theOutParam.eFunction = LbPosToFunc( m_xLbFunc->get_active() );
354  theOutParam.bByCol = m_xBtnByCol->get_active();
355  theOutParam.bByRow = m_xBtnByRow->get_active();
356  theOutParam.bReferenceData = m_xBtnRefs->get_active();
357  theOutParam.SetAreas( std::move(pDataAreas), nDataAreaCount );
358 
359  ScConsolidateItem aOutItem( nWhichCons, &theOutParam );
360 
361  SetDispatcherLock( false );
362  SwitchToDocument();
363  GetBindings().GetDispatcher()->ExecuteList(SID_CONSOLIDATE,
364  SfxCallMode::SLOT | SfxCallMode::RECORD,
365  { &aOutItem });
366  response(RET_OK);
367  }
368  else
369  {
370  INFOBOX(m_xDialog.get(), STR_INVALID_TABREF);
371  m_xEdDestArea->GrabFocus();
372  }
373  }
374  else
375  response(RET_CANCEL); // no area defined -> Cancel
376 }
377 
378 IMPL_LINK( ScConsolidateDlg, ClickHdl, weld::Button&, rBtn, void )
379 {
380  if ( &rBtn == m_xBtnCancel.get() )
381  response(RET_CANCEL);
382  else if ( &rBtn == m_xBtnAdd.get() )
383  {
384  if ( !m_xEdDataArea->GetText().isEmpty() )
385  {
386  OUString aNewEntry( m_xEdDataArea->GetText() );
387  std::unique_ptr<ScArea[]> ppAreas;
388  sal_uInt16 nAreaCount = 0;
389  const formula::FormulaGrammar::AddressConvention eConv = rDoc.GetAddressConvention();
390 
391  if ( ScRangeUtil::IsAbsTabArea( aNewEntry, &rDoc, &ppAreas, &nAreaCount, true, eConv ) )
392  {
393  // IsAbsTabArea() creates an array of ScArea pointers,
394  // which have been created dynamically as well.
395  // These objects need to be deleted here.
396 
397  for ( sal_uInt16 i=0; i<nAreaCount; i++ )
398  {
399  const ScArea& rArea = ppAreas[i];
400  OUString aNewArea = ScRange( rArea.nColStart, rArea.nRowStart, rArea.nTab,
401  rArea.nColEnd, rArea.nRowEnd, rArea.nTab
402  ).Format(rDoc, ScRefFlags::RANGE_ABS_3D, eConv);
403 
404  if (m_xLbConsAreas->find_text(aNewArea) == -1)
405  {
406  m_xLbConsAreas->append_text( aNewArea );
407  }
408  }
409  }
410  else if ( VerifyEdit( m_xEdDataArea.get() ) )
411  {
412  OUString aNewArea( m_xEdDataArea->GetText() );
413 
414  if (m_xLbConsAreas->find_text(aNewArea) == -1)
415  m_xLbConsAreas->append_text(aNewArea);
416  else
417  INFOBOX(m_xDialog.get(), STR_AREA_ALREADY_INSERTED);
418  }
419  else
420  {
421  INFOBOX(m_xDialog.get(), STR_INVALID_TABREF);
422  m_xEdDataArea->GrabFocus();
423  }
424  }
425  }
426  else if ( &rBtn == m_xBtnRemove.get() )
427  {
428  std::vector<int> aSelectedRows(m_xLbConsAreas->get_selected_rows());
429  std::sort(aSelectedRows.begin(), aSelectedRows.end());
430  for (auto it = aSelectedRows.rbegin(); it != aSelectedRows.rend(); ++it)
431  m_xLbConsAreas->remove(*it);
432  m_xBtnRemove->set_sensitive(false);
433  }
434 }
435 
436 IMPL_LINK( ScConsolidateDlg, SelectTVHdl, weld::TreeView&, rLb, void )
437 {
438  if (rLb.get_selected_index() != -1)
439  m_xBtnRemove->set_sensitive(true);
440  else
441  m_xBtnRemove->set_sensitive(false);
442 }
443 
444 IMPL_LINK( ScConsolidateDlg, SelectCBHdl, weld::ComboBox&, rLb, void )
445 {
446  formula::RefEdit* pEd = (&rLb == m_xLbDataArea.get()) ? m_xEdDataArea.get() : m_xEdDestArea.get();
447  const sal_Int32 nSelPos = rLb.get_active();
448 
449  if ( (nSelPos > 0)
450  && (nAreaDataCount > 0)
451  && (pAreaData != nullptr) )
452  {
453  if ( o3tl::make_unsigned(nSelPos) <= nAreaDataCount )
454  {
455  OUString aString( pAreaData[nSelPos-1].aStrArea );
456 
457  if ( &rLb == m_xLbDestArea.get() )
458  ScRangeUtil::CutPosString( aString, aString );
459 
460  pEd->SetText( aString );
461 
462  if ( pEd == m_xEdDataArea.get() )
463  m_xBtnAdd->set_sensitive(true);
464  }
465  }
466  else
467  {
468  pEd->SetText( EMPTY_OUSTRING );
469  if ( pEd == m_xEdDataArea.get() )
470  m_xBtnAdd->set_sensitive(true);
471  }
472 }
473 
474 IMPL_LINK( ScConsolidateDlg, ModifyHdl, formula::RefEdit&, rEd, void )
475 {
476  if ( &rEd == m_xEdDataArea.get() )
477  {
478  OUString aAreaStr( rEd.GetText() );
479  if ( !aAreaStr.isEmpty() )
480  m_xBtnAdd->set_sensitive(true);
481  else
482  m_xBtnAdd->set_sensitive(false);
483  }
484  else if ( &rEd == m_xEdDestArea.get() )
485  {
486  m_xLbDestArea->set_active(0);
487  }
488 }
489 
490 // TODO: generalize!
491 // Resource of the ListBox and these two conversion methods are also in
492 // tpsubt and everywhere, where StarCalc functions are selectable.
493 
495 {
496  switch ( nPos )
497  {
498  case 2: return SUBTOTAL_FUNC_AVE;
499  case 6: return SUBTOTAL_FUNC_CNT;
500  case 1: return SUBTOTAL_FUNC_CNT2;
501  case 3: return SUBTOTAL_FUNC_MAX;
502  case 4: return SUBTOTAL_FUNC_MIN;
503  case 5: return SUBTOTAL_FUNC_PROD;
504  case 7: return SUBTOTAL_FUNC_STD;
505  case 8: return SUBTOTAL_FUNC_STDP;
506  case 9: return SUBTOTAL_FUNC_VAR;
507  case 10: return SUBTOTAL_FUNC_VARP;
508  case 0:
509  default:
510  return SUBTOTAL_FUNC_SUM;
511  }
512 }
513 
515 {
516  switch ( eFunc )
517  {
518  case SUBTOTAL_FUNC_AVE: return 2;
519  case SUBTOTAL_FUNC_CNT: return 6;
520  case SUBTOTAL_FUNC_CNT2: return 1;
521  case SUBTOTAL_FUNC_MAX: return 3;
522  case SUBTOTAL_FUNC_MIN: return 4;
523  case SUBTOTAL_FUNC_PROD: return 5;
524  case SUBTOTAL_FUNC_STD: return 7;
525  case SUBTOTAL_FUNC_STDP: return 8;
526  case SUBTOTAL_FUNC_VAR: return 9;
527  case SUBTOTAL_FUNC_VARP: return 10;
528  case SUBTOTAL_FUNC_NONE:
529  case SUBTOTAL_FUNC_SUM:
530  default:
531  return 0;
532  }
533 }
534 
535 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool Next(OUString &rName, ScRange &rRange)
Definition: rangeutl.cxx:947
ScViewData & rViewData
Definition: consdlg.hxx:50
SC_DLLPUBLIC void Format(OStringBuffer &r, ScRefFlags nFlags, const ScDocument *pDocument=nullptr, const Details &rDetails=detailsOOOa1) const
Definition: address.cxx:2107
SCCOL nColEnd
Definition: rangeutl.hxx:242
SCCOL nColStart
Definition: rangeutl.hxx:240
std::unique_ptr< weld::CheckButton > m_xBtnRefs
Definition: consdlg.hxx:74
SC_DLLPUBLIC ScDBCollection * GetDBCollection() const
Definition: document.hxx:816
ScAddress aStart
Definition: address.hxx:500
std::unique_ptr< formula::RefEdit > m_xEdDestArea
Definition: consdlg.hxx:67
#define EMPTY_OUSTRING
Definition: global.hxx:214
OUString aStrArea
Definition: consdlg.cxx:64
SCROW nRowStart
Definition: rangeutl.hxx:241
void Set(const OUString &rName, const OUString &rArea)
Definition: consdlg.cxx:57
std::unique_ptr< weld::Button > m_xBtnAdd
Definition: consdlg.hxx:78
ScAreaData()
Definition: consdlg.cxx:53
OUString aStrUndefined
Definition: consdlg.hxx:47
bool VerifyEdit(formula::RefEdit *pEd)
Definition: consdlg.cxx:283
SC_DLLPUBLIC ScRangeName * GetRangeName(SCTAB nTab) const
Definition: documen3.cxx:168
void SetAreas(std::unique_ptr< ScArea[]> pAreas, sal_uInt16 nCount)
Definition: global2.cxx:181
sal_uInt16 nDataAreaCount
Definition: global.hxx:893
std::unique_ptr< weld::Button > m_xBtnOk
Definition: consdlg.hxx:76
std::unique_ptr< formula::RefEdit > m_xEdDataArea
Definition: consdlg.hxx:63
SCTAB GetTabNo() const
Definition: viewdata.hxx:395
virtual void SetReference(const ScRange &rRef, ScDocument &rDoc) override
Definition: consdlg.cxx:231
ScAddress aEnd
Definition: address.hxx:501
std::unique_ptr< ScArea[]> pDataAreas
Definition: global.hxx:894
RET_CANCEL
SC_DLLPUBLIC formula::FormulaGrammar::AddressConvention GetAddressConvention() const
Definition: documen3.cxx:489
OUString aStrName
Definition: consdlg.cxx:63
IMPL_LINK_NOARG(ScConsolidateDlg, OkHdl, weld::Button &, void)
Definition: consdlg.cxx:328
SC_DLLPUBLIC SCTAB GetTableCount() const
Definition: document.cxx:314
virtual void Deactivate() override
Definition: consdlg.cxx:278
std::unique_ptr< ScAreaData[]> pAreaData
Definition: consdlg.hxx:52
SCROW nRowEnd
Definition: rangeutl.hxx:243
static ScSubTotalFunc LbPosToFunc(sal_Int32 nPos)
Definition: consdlg.cxx:494
SCTAB Tab() const
Definition: address.hxx:271
size_t nAreaDataCount
Definition: consdlg.hxx:53
bool bDlgLostFocus
Definition: consdlg.hxx:55
ScConsolidateParam theConsData
Definition: consdlg.hxx:49
virtual void Close() override
Definition: consdlg.cxx:255
ScDocument & rDoc
Definition: consdlg.hxx:51
void SetRefString(const OUString &rStr)
static bool MakeArea(const OUString &rAreaStr, ScArea &rArea, const ScDocument &rDoc, SCTAB nTab, ScAddress::Details const &rDetails)
Definition: rangeutl.cxx:36
std::unique_ptr< weld::ComboBox > m_xLbDataArea
Definition: consdlg.hxx:62
static sal_Int32 FuncToLbPos(ScSubTotalFunc eFunc)
Definition: consdlg.cxx:514
int i
std::unique_ptr< weld::ComboBox > m_xLbFunc
Definition: consdlg.hxx:59
void FillAreaLists()
Definition: consdlg.cxx:209
std::unique_ptr< weld::TreeView > m_xLbConsAreas
Definition: consdlg.hxx:60
std::unique_ptr< weld::CheckButton > m_xBtnByRow
Definition: consdlg.hxx:71
SC_DLLPUBLIC OUString Format(const ScDocument &rDocument, ScRefFlags nFlags=ScRefFlags::ZERO, const ScAddress::Details &rDetails=ScAddress::detailsOOOa1, bool bFullAddressNotation=false) const
Returns string with formatted cell range from aStart to aEnd, according to provided address conventio...
Definition: address.cxx:2203
static bool IsAbsArea(const OUString &rAreaStr, const ScDocument &rDoc, SCTAB nTab, OUString *pCompleteStr, ScRefAddress *pStartPos=nullptr, ScRefAddress *pEndPos=nullptr, ScAddress::Details const &rDetails=ScAddress::detailsOOOa1)
Definition: rangeutl.cxx:169
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
static bool IsAbsPos(const OUString &rPosStr, const ScDocument &rDoc, SCTAB nTab, OUString *pCompleteStr, ScRefAddress *pPosTripel=nullptr, ScAddress::Details const &rDetails=ScAddress::detailsOOOa1)
Definition: rangeutl.cxx:208
OUString ScResId(const char *pId)
Definition: scdll.cxx:95
void SetText(const OUString &rStr)
virtual void RefInputDone(bool bForced=false) override
Definition: anyrefdg.cxx:755
static bool IsAbsTabArea(const OUString &rAreaStr, const ScDocument *pDoc, std::unique_ptr< ScArea[]> *ppAreas, sal_uInt16 *pAreaCount, bool bAcceptCellRef=false, ScAddress::Details const &rDetails=ScAddress::detailsOOOa1)
Definition: rangeutl.cxx:86
std::unique_ptr< formula::RefButton > m_xRbDataArea
Definition: consdlg.hxx:64
OUString GetText() const
virtual ~ScConsolidateDlg() override
Definition: consdlg.cxx:106
std::unique_ptr< weld::CheckButton > m_xBtnByCol
Definition: consdlg.hxx:72
size_t size() const
Definition: dbdata.cxx:1191
std::unique_ptr< weld::ComboBox > m_xLbDestArea
Definition: consdlg.hxx:66
std::unique_ptr< weld::Label > m_xDestFT
Definition: consdlg.hxx:82
virtual void SetActive() override
Definition: consdlg.cxx:260
#define GetWhich(nSlot)
SCROW Row() const
Definition: address.hxx:897
RET_OK
ScSubTotalFunc eFunction
Definition: global.hxx:892
SCCOL Col() const
Definition: address.hxx:893
std::unique_ptr< weld::Label > m_xDataFT
Definition: consdlg.hxx:81
Reference< XExecutableDialog > m_xDialog
IMPL_LINK(ScConsolidateDlg, GetEditFocusHdl, formula::RefEdit &, rControl, void)
Definition: consdlg.cxx:315
NamedDBs & getNamedDBs()
Definition: dbdata.hxx:315
formula::RefEdit * m_pRefInputEdit
Definition: consdlg.hxx:57
SCTAB nTab
Definition: rangeutl.hxx:239
SC_DLLPUBLIC size_t size() const
Definition: rangenam.cxx:800
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
std::unique_ptr< weld::Button > m_xBtnCancel
Definition: consdlg.hxx:77
SCTAB Tab() const
Definition: address.hxx:901
ScRefFlags
Definition: address.hxx:145
ScSubTotalFunc
Definition: global.hxx:844
bool DoClose(sal_uInt16 nId)
Definition: anyrefdg.cxx:694
static void CutPosString(const OUString &theAreaStr, OUString &thePosStr)
Definition: rangeutl.cxx:69
aStr
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, bool bMobile=false)
std::unique_ptr< weld::Button > m_xBtnRemove
Definition: consdlg.hxx:79
sal_Int16 SCTAB
Definition: types.hxx:23
ScConsolidateDlg(SfxBindings *pB, SfxChildWindow *pCW, weld::Window *pParent, const SfxItemSet &rArgSet)
Definition: consdlg.cxx:67
std::unique_ptr< formula::RefButton > m_xRbDestArea
Definition: consdlg.hxx:68
virtual void RefInputStart(formula::RefEdit *pEdit, formula::RefButton *pButton=nullptr) override
Definition: anyrefdg.cxx:725