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  , pDoc ( 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  OSL_ENSURE( pDoc, "Error in Ctor" );
113 
114  OUString aStr;
115  sal_uInt16 i=0;
116 
117  m_xRbDataArea->SetReferences(this, m_xEdDataArea.get());
118  m_xEdDataArea->SetReferences(this, m_xDataFT.get());
119  m_xRbDestArea->SetReferences(this, m_xEdDestArea.get());
120  m_xEdDestArea->SetReferences(this, m_xDestFT.get());
121 
122  m_xEdDataArea->SetGetFocusHdl( LINK( this, ScConsolidateDlg, GetEditFocusHdl ) );
123  m_xEdDestArea->SetGetFocusHdl( LINK( this, ScConsolidateDlg, GetEditFocusHdl ) );
124  m_xLbDataArea->connect_focus_in( LINK( this, ScConsolidateDlg, GetFocusHdl ) );
125  m_xLbDestArea->connect_focus_in( LINK( this, ScConsolidateDlg, GetFocusHdl ) );
126  m_xEdDataArea->SetModifyHdl( LINK( this, ScConsolidateDlg, ModifyHdl ) );
127  m_xEdDestArea->SetModifyHdl( LINK( this, ScConsolidateDlg, ModifyHdl ) );
128  m_xLbConsAreas->connect_changed( LINK( this, ScConsolidateDlg, SelectTVHdl ) );
129  m_xLbDataArea->connect_changed( LINK( this, ScConsolidateDlg, SelectCBHdl ) );
130  m_xLbDestArea->connect_changed( LINK( this, ScConsolidateDlg, SelectCBHdl ) );
131  m_xBtnOk->connect_clicked( LINK( this, ScConsolidateDlg, OkHdl ) );
132  m_xBtnCancel->connect_clicked( LINK( this, ScConsolidateDlg, ClickHdl ) );
133  m_xBtnAdd->connect_clicked( LINK( this, ScConsolidateDlg, ClickHdl ) );
134  m_xBtnRemove->connect_clicked( LINK( this, ScConsolidateDlg, ClickHdl ) );
135 
136  m_xBtnAdd->set_sensitive(false);
137  m_xBtnRemove->set_sensitive(false);
138 
139  m_xBtnByRow->set_active( theConsData.bByRow );
140  m_xBtnByCol->set_active( theConsData.bByCol );
141  m_xBtnRefs->set_active( theConsData.bReferenceData );
142 
143  m_xLbFunc->set_active( FuncToLbPos( theConsData.eFunction ) );
144 
145  m_xLbConsAreas->set_selection_mode(SelectionMode::Multiple);
146  m_xLbConsAreas->set_size_request(m_xLbConsAreas->get_approximate_digit_width() * 16,
147  m_xLbConsAreas->get_height_rows(5));
148 
149  // read consolidation areas
150  m_xLbConsAreas->clear();
152  for ( i=0; i<theConsData.nDataAreaCount; i++ )
153  {
154  const ScArea& rArea = theConsData.pDataAreas[i];
155  if ( rArea.nTab < pDoc->GetTableCount() )
156  {
157  aStr = ScRange( rArea.nColStart, rArea.nRowStart, rArea.nTab,
158  rArea.nColEnd, rArea.nRowEnd, rArea.nTab ).Format( *pDoc,
159  ScRefFlags::RANGE_ABS_3D, eConv );
160  m_xLbConsAreas->append_text(aStr);
161  }
162  }
163 
164  if ( theConsData.nTab < pDoc->GetTableCount() )
165  {
167  ).Format( ScRefFlags::ADDR_ABS_3D, pDoc, eConv );
168  m_xEdDestArea->SetText( aStr );
169  }
170  else
171  m_xEdDestArea->SetText(OUString());
172 
173  // Use the ScAreaData helper class to save those range names from the
174  // RangeNames and database ranges that appear in the ListBoxes.
175 
176  ScRangeName* pRangeNames = pDoc->GetRangeName();
177  ScDBCollection* pDbNames = pDoc->GetDBCollection();
178  size_t nRangeCount = pRangeNames ? pRangeNames->size() : 0;
179  size_t nDbCount = pDbNames ? pDbNames->getNamedDBs().size() : 0;
180 
181  nAreaDataCount = nRangeCount+nDbCount;
182  pAreaData = nullptr;
183 
184  if ( nAreaDataCount > 0 )
185  {
186  pAreaData.reset( new ScAreaData[nAreaDataCount] );
187 
188  OUString aStrName;
189  sal_uInt16 nAt = 0;
190  ScRange aRange;
191  ScAreaNameIterator aIter( pDoc );
192  while ( aIter.Next( aStrName, aRange ) )
193  {
194  OUString aStrArea(aRange.Format(*pDoc, ScRefFlags::ADDR_ABS_3D, eConv));
195  pAreaData[nAt++].Set( aStrName, aStrArea );
196  }
197  }
198 
199  FillAreaLists();
200  ModifyHdl( *m_xEdDestArea );
201  m_xLbDataArea->set_active( 0 );
202  m_xEdDataArea->SetText(OUString());
203  m_xEdDataArea->GrabFocus();
204 
205  //aFlSep.SetStyle( aFlSep.GetStyle() | WB_VERT );
206 
207  //@BugID 54702 enable/disable only in base class
208  //SFX_APPWINDOW->set_sensitive(true);
209 }
210 
212 {
213  m_xLbDataArea->clear();
214  m_xLbDestArea->clear();
215  m_xLbDataArea->append_text( aStrUndefined );
216  m_xLbDestArea->append_text( aStrUndefined );
217 
218  if ( pAreaData && (nAreaDataCount > 0) )
219  {
220  for ( size_t i=0;
221  (i<nAreaDataCount) && (!pAreaData[i].aStrName.isEmpty());
222  i++ )
223  {
224  m_xLbDataArea->append_text(pAreaData[i].aStrName);
225  m_xLbDestArea->append_text(pAreaData[i].aStrName);
226  }
227  }
228 }
229 
230 // Handover of a range within a table that has been selected by the mouse.
231 // This range is then shown in the reference window as new selection.
232 
234 {
235  if ( !m_pRefInputEdit )
236  return;
237 
238  if ( rRef.aStart != rRef.aEnd )
240 
241  OUString aStr;
244 
245  if ( rRef.aStart.Tab() != rRef.aEnd.Tab() )
246  nFmt |= ScRefFlags::TAB2_3D;
247 
248  if ( m_pRefInputEdit == m_xEdDataArea.get())
249  aStr = rRef.Format(rDocP, nFmt, eConv);
250  else if ( m_pRefInputEdit == m_xEdDestArea.get() )
251  aStr = rRef.aStart.Format(nFmt, &rDocP, eConv);
252 
253  m_pRefInputEdit->SetRefString( aStr );
254  ModifyHdl( *m_pRefInputEdit );
255 }
256 
258 {
259  DoClose( ScConsolidateDlgWrapper::GetChildWindowId() );
260 }
261 
263 {
264  if ( bDlgLostFocus )
265  {
266  bDlgLostFocus = false;
267 
268  if ( m_pRefInputEdit )
269  {
271  ModifyHdl( *m_pRefInputEdit );
272  }
273  }
274  else
275  m_xDialog->grab_focus();
276 
277  RefInputDone();
278 }
279 
281 {
282  bDlgLostFocus = true;
283 }
284 
286 {
287  if ( !pDoc ||
288  ((pEd != m_xEdDataArea.get()) && (pEd != m_xEdDestArea.get())) )
289  return false;
290 
291  SCTAB nTab = rViewData.GetTabNo();
292  bool bEditOk = false;
293  OUString theCompleteStr;
295 
296  if ( pEd == m_xEdDataArea.get() )
297  {
298  bEditOk = ScRangeUtil::IsAbsArea( pEd->GetText(), pDoc,
299  nTab, &theCompleteStr, nullptr, nullptr, eConv );
300  }
301  else if ( pEd == m_xEdDestArea.get() )
302  {
303  OUString aPosStr;
304 
305  ScRangeUtil::CutPosString( pEd->GetText(), aPosStr );
306  bEditOk = ScRangeUtil::IsAbsPos( aPosStr, pDoc,
307  nTab, &theCompleteStr, nullptr, eConv );
308  }
309 
310  if ( bEditOk )
311  pEd->SetText( theCompleteStr );
312 
313  return bEditOk;
314 }
315 
316 // Handler:
317 
318 IMPL_LINK( ScConsolidateDlg, GetEditFocusHdl, formula::RefEdit&, rControl, void )
319 {
320  m_pRefInputEdit = &rControl;
321 }
322 
323 IMPL_LINK( ScConsolidateDlg, GetFocusHdl, weld::Widget&, rControl, void )
324 {
325  if (&rControl == m_xLbDataArea.get())
326  m_pRefInputEdit = m_xEdDataArea.get();
327  else if (&rControl == m_xLbDestArea.get())
328  m_pRefInputEdit = m_xEdDestArea.get();
329 }
330 
332 {
333  const sal_Int32 nDataAreaCount = m_xLbConsAreas->n_children();
334 
335  if ( nDataAreaCount > 0 )
336  {
337  ScRefAddress aDestAddress;
338  SCTAB nTab = rViewData.GetTabNo();
339  OUString aDestPosStr( m_xEdDestArea->GetText() );
340  const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
341 
342  if ( ScRangeUtil::IsAbsPos( aDestPosStr, pDoc, nTab, nullptr, &aDestAddress, eConv ) )
343  {
344  ScConsolidateParam theOutParam( theConsData );
345  std::unique_ptr<ScArea[]> pDataAreas(new ScArea[nDataAreaCount]);
346 
347  for ( sal_Int32 i=0; i<nDataAreaCount; ++i )
348  {
349  ScRangeUtil::MakeArea(m_xLbConsAreas->get_text(i),
350  pDataAreas[i], pDoc, nTab, eConv);
351  }
352 
353  theOutParam.nCol = aDestAddress.Col();
354  theOutParam.nRow = aDestAddress.Row();
355  theOutParam.nTab = aDestAddress.Tab();
356  theOutParam.eFunction = LbPosToFunc( m_xLbFunc->get_active() );
357  theOutParam.bByCol = m_xBtnByCol->get_active();
358  theOutParam.bByRow = m_xBtnByRow->get_active();
359  theOutParam.bReferenceData = m_xBtnRefs->get_active();
360  theOutParam.SetAreas( std::move(pDataAreas), nDataAreaCount );
361 
362  ScConsolidateItem aOutItem( nWhichCons, &theOutParam );
363 
364  SetDispatcherLock( false );
365  SwitchToDocument();
366  GetBindings().GetDispatcher()->ExecuteList(SID_CONSOLIDATE,
367  SfxCallMode::SLOT | SfxCallMode::RECORD,
368  { &aOutItem });
369  response(RET_OK);
370  }
371  else
372  {
373  INFOBOX(m_xDialog.get(), STR_INVALID_TABREF);
374  m_xEdDestArea->GrabFocus();
375  }
376  }
377  else
378  response(RET_CANCEL); // no area defined -> Cancel
379 }
380 
381 IMPL_LINK( ScConsolidateDlg, ClickHdl, weld::Button&, rBtn, void )
382 {
383  if ( &rBtn == m_xBtnCancel.get() )
384  response(RET_CANCEL);
385  else if ( &rBtn == m_xBtnAdd.get() )
386  {
387  if ( !m_xEdDataArea->GetText().isEmpty() )
388  {
389  OUString aNewEntry( m_xEdDataArea->GetText() );
390  std::unique_ptr<ScArea[]> ppAreas;
391  sal_uInt16 nAreaCount = 0;
392  const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
393 
394  if ( ScRangeUtil::IsAbsTabArea( aNewEntry, pDoc, &ppAreas, &nAreaCount, true, eConv ) )
395  {
396  // IsAbsTabArea() creates an array of ScArea pointers,
397  // which have been created dynamically as well.
398  // These objects need to be deleted here.
399 
400  for ( sal_uInt16 i=0; i<nAreaCount; i++ )
401  {
402  const ScArea& rArea = ppAreas[i];
403  OUString aNewArea = ScRange( rArea.nColStart, rArea.nRowStart, rArea.nTab,
404  rArea.nColEnd, rArea.nRowEnd, rArea.nTab
405  ).Format(*pDoc, ScRefFlags::RANGE_ABS_3D, eConv);
406 
407  if (m_xLbConsAreas->find_text(aNewArea) == -1)
408  {
409  m_xLbConsAreas->append_text( aNewArea );
410  }
411  }
412  }
413  else if ( VerifyEdit( m_xEdDataArea.get() ) )
414  {
415  OUString aNewArea( m_xEdDataArea->GetText() );
416 
417  if (m_xLbConsAreas->find_text(aNewArea) == -1)
418  m_xLbConsAreas->append_text(aNewArea);
419  else
420  INFOBOX(m_xDialog.get(), STR_AREA_ALREADY_INSERTED);
421  }
422  else
423  {
424  INFOBOX(m_xDialog.get(), STR_INVALID_TABREF);
425  m_xEdDataArea->GrabFocus();
426  }
427  }
428  }
429  else if ( &rBtn == m_xBtnRemove.get() )
430  {
431  std::vector<int> aSelectedRows(m_xLbConsAreas->get_selected_rows());
432  std::sort(aSelectedRows.begin(), aSelectedRows.end());
433  for (auto it = aSelectedRows.rbegin(); it != aSelectedRows.rend(); ++it)
434  m_xLbConsAreas->remove(*it);
435  m_xBtnRemove->set_sensitive(false);
436  }
437 }
438 
439 IMPL_LINK( ScConsolidateDlg, SelectTVHdl, weld::TreeView&, rLb, void )
440 {
441  if (rLb.get_selected_index() != -1)
442  m_xBtnRemove->set_sensitive(true);
443  else
444  m_xBtnRemove->set_sensitive(false);
445 }
446 
447 IMPL_LINK( ScConsolidateDlg, SelectCBHdl, weld::ComboBox&, rLb, void )
448 {
449  formula::RefEdit* pEd = (&rLb == m_xLbDataArea.get()) ? m_xEdDataArea.get() : m_xEdDestArea.get();
450  const sal_Int32 nSelPos = rLb.get_active();
451 
452  if ( (nSelPos > 0)
453  && (nAreaDataCount > 0)
454  && (pAreaData != nullptr) )
455  {
456  if ( o3tl::make_unsigned(nSelPos) <= nAreaDataCount )
457  {
458  OUString aString( pAreaData[nSelPos-1].aStrArea );
459 
460  if ( &rLb == m_xLbDestArea.get() )
461  ScRangeUtil::CutPosString( aString, aString );
462 
463  pEd->SetText( aString );
464 
465  if ( pEd == m_xEdDataArea.get() )
466  m_xBtnAdd->set_sensitive(true);
467  }
468  }
469  else
470  {
471  pEd->SetText( EMPTY_OUSTRING );
472  if ( pEd == m_xEdDataArea.get() )
473  m_xBtnAdd->set_sensitive(true);
474  }
475 }
476 
477 IMPL_LINK( ScConsolidateDlg, ModifyHdl, formula::RefEdit&, rEd, void )
478 {
479  if ( &rEd == m_xEdDataArea.get() )
480  {
481  OUString aAreaStr( rEd.GetText() );
482  if ( !aAreaStr.isEmpty() )
483  m_xBtnAdd->set_sensitive(true);
484  else
485  m_xBtnAdd->set_sensitive(false);
486  }
487  else if ( &rEd == m_xEdDestArea.get() )
488  {
489  m_xLbDestArea->set_active(0);
490  }
491 }
492 
493 // TODO: generalize!
494 // Resource of the ListBox and these two conversion methods are also in
495 // tpsubt and everywhere, where StarCalc functions are selectable.
496 
498 {
499  switch ( nPos )
500  {
501  case 2: return SUBTOTAL_FUNC_AVE;
502  case 6: return SUBTOTAL_FUNC_CNT;
503  case 1: return SUBTOTAL_FUNC_CNT2;
504  case 3: return SUBTOTAL_FUNC_MAX;
505  case 4: return SUBTOTAL_FUNC_MIN;
506  case 5: return SUBTOTAL_FUNC_PROD;
507  case 7: return SUBTOTAL_FUNC_STD;
508  case 8: return SUBTOTAL_FUNC_STDP;
509  case 9: return SUBTOTAL_FUNC_VAR;
510  case 10: return SUBTOTAL_FUNC_VARP;
511  case 0:
512  default:
513  return SUBTOTAL_FUNC_SUM;
514  }
515 }
516 
518 {
519  switch ( eFunc )
520  {
521  case SUBTOTAL_FUNC_AVE: return 2;
522  case SUBTOTAL_FUNC_CNT: return 6;
523  case SUBTOTAL_FUNC_CNT2: return 1;
524  case SUBTOTAL_FUNC_MAX: return 3;
525  case SUBTOTAL_FUNC_MIN: return 4;
526  case SUBTOTAL_FUNC_PROD: return 5;
527  case SUBTOTAL_FUNC_STD: return 7;
528  case SUBTOTAL_FUNC_STDP: return 8;
529  case SUBTOTAL_FUNC_VAR: return 9;
530  case SUBTOTAL_FUNC_VARP: return 10;
531  case SUBTOTAL_FUNC_NONE:
532  case SUBTOTAL_FUNC_SUM:
533  default:
534  return 0;
535  }
536 }
537 
538 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool Next(OUString &rName, ScRange &rRange)
Definition: rangeutl.cxx:949
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:2111
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:819
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:285
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:897
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:233
static bool IsAbsPos(const OUString &rPosStr, const ScDocument *pDoc, SCTAB nTab, OUString *pCompleteStr, ScRefAddress *pPosTripel=nullptr, ScAddress::Details const &rDetails=ScAddress::detailsOOOa1)
Definition: rangeutl.cxx:210
ScAddress aEnd
Definition: address.hxx:501
std::unique_ptr< ScArea[]> pDataAreas
Definition: global.hxx:898
RET_CANCEL
SC_DLLPUBLIC formula::FormulaGrammar::AddressConvention GetAddressConvention() const
Definition: documen3.cxx:475
OUString aStrName
Definition: consdlg.cxx:63
static bool MakeArea(const OUString &rAreaStr, ScArea &rArea, const ScDocument *pDoc, SCTAB nTab, ScAddress::Details const &rDetails)
Definition: rangeutl.cxx:36
IMPL_LINK_NOARG(ScConsolidateDlg, OkHdl, weld::Button &, void)
Definition: consdlg.cxx:331
SC_DLLPUBLIC SCTAB GetTableCount() const
Definition: document.cxx:313
virtual void Deactivate() override
Definition: consdlg.cxx:280
std::unique_ptr< ScAreaData[]> pAreaData
Definition: consdlg.hxx:52
SCROW nRowEnd
Definition: rangeutl.hxx:243
static ScSubTotalFunc LbPosToFunc(sal_Int32 nPos)
Definition: consdlg.cxx:497
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:257
void SetRefString(const OUString &rStr)
static bool IsAbsArea(const OUString &rAreaStr, const ScDocument *pDoc, SCTAB nTab, OUString *pCompleteStr, ScRefAddress *pStartPos=nullptr, ScRefAddress *pEndPos=nullptr, ScAddress::Details const &rDetails=ScAddress::detailsOOOa1)
Definition: rangeutl.cxx:171
std::unique_ptr< weld::ComboBox > m_xLbDataArea
Definition: consdlg.hxx:62
static sal_Int32 FuncToLbPos(ScSubTotalFunc eFunc)
Definition: consdlg.cxx:517
int i
std::unique_ptr< weld::ComboBox > m_xLbFunc
Definition: consdlg.hxx:59
ScDocument * pDoc
Definition: consdlg.hxx:51
void FillAreaLists()
Definition: consdlg.cxx:211
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:2207
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
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:262
#define GetWhich(nSlot)
SCROW Row() const
Definition: address.hxx:897
RET_OK
ScSubTotalFunc eFunction
Definition: global.hxx:896
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:318
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:848
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