LibreOffice Module sc (master)  1
namedlg.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 <memory>
21 #include <global.hxx>
22 #include <reffact.hxx>
23 #include <compiler.hxx>
24 #include <document.hxx>
25 #include <docfunc.hxx>
26 #include <globstr.hrc>
27 #include <scresid.hxx>
28 #include <namedlg.hxx>
29 #include <viewdata.hxx>
30 #include <tabvwsh.hxx>
31 
32 #include <globalnames.hxx>
33 #include <tokenarray.hxx>
34 
35 #include <vcl/settings.hxx>
36 #include <vcl/svapp.hxx>
37 #include <formula/errorcodes.hxx>
38 #include <unotools/charclass.hxx>
39 
40 #include <map>
41 
42 //logic
43 
45  ScViewData* ptrViewData,
46  const ScAddress& aCursorPos,
47  std::map<OUString, std::unique_ptr<ScRangeName>> *const pRangeMap)
48  : ScAnyRefDlgController(pB, pCW, pParent, "modules/scalc/ui/managenamesdialog.ui",
49  "ManageNamesDialog")
50 
51  , maGlobalNameStr(ScResId(STR_GLOBAL_SCOPE))
52  , maErrInvalidNameStr(ScResId(STR_ERR_NAME_INVALID))
53  , maErrNameInUse(ScResId(STR_ERR_NAME_EXISTS))
54  , maStrMultiSelect(ScResId(STR_MULTI_SELECT))
55 
56  , mpViewData(ptrViewData)
57  , mpDoc(ptrViewData->GetDocument())
58  , maCursorPos(aCursorPos)
59  , mbDataChanged(false)
60  , mbCloseWithoutUndo(false)
61 
62  , m_xEdName(m_xBuilder->weld_entry("name"))
63  , m_xFtAssign(m_xBuilder->weld_label("label3"))
64  , m_xEdAssign(new formula::RefEdit(m_xBuilder->weld_entry("range")))
65  , m_xRbAssign(new formula::RefButton(m_xBuilder->weld_button("assign")))
66  , m_xLbScope(m_xBuilder->weld_combo_box("scope"))
67  , m_xBtnPrintArea(m_xBuilder->weld_check_button("printrange"))
68  , m_xBtnColHeader(m_xBuilder->weld_check_button("colheader"))
69  , m_xBtnCriteria(m_xBuilder->weld_check_button("filter"))
70  , m_xBtnRowHeader(m_xBuilder->weld_check_button("rowheader"))
71  , m_xBtnAdd(m_xBuilder->weld_button("add"))
72  , m_xBtnDelete(m_xBuilder->weld_button("delete"))
73  , m_xBtnOk(m_xBuilder->weld_button("ok"))
74  , m_xBtnCancel(m_xBuilder->weld_button("cancel"))
75  , m_xFtInfo(m_xBuilder->weld_label("info"))
76  , m_xExpander(m_xBuilder->weld_expander("more"))
77 {
78  m_xEdAssign->SetReferences(this, m_xFtAssign.get());
79  m_xRbAssign->SetReferences(this, m_xEdAssign.get());
80  maStrInfoDefault = m_xFtInfo->get_label();
81  m_xFtInfo->set_label(OUString());
82 
83  if (!pRangeMap)
84  {
85  std::map<OUString, ScRangeName*> aRangeMap;
86  mpDoc->GetRangeNameMap(aRangeMap);
87  for (const auto& [aTemp, pRangeName] : aRangeMap)
88  {
89  m_RangeMap.insert(std::make_pair(aTemp, std::make_unique<ScRangeName>(*pRangeName)));
90  }
91  }
92  else
93  {
94  m_RangeMap.swap(*pRangeMap);
95  }
96  Init();
97 }
98 
100 {
101 }
102 
104 {
105  OSL_ENSURE( mpViewData && mpDoc, "ViewData or Document not found!" );
106 
107  //init UI
108 
109  std::unique_ptr<weld::TreeView> xTreeView(m_xBuilder->weld_tree_view("names"));
110  xTreeView->set_size_request(xTreeView->get_approximate_digit_width() * 75,
111  xTreeView->get_height_rows(10));
112  m_xRangeManagerTable.reset(new ScRangeManagerTable(std::move(xTreeView), m_RangeMap, maCursorPos));
113 
114  if (m_xRangeManagerTable->n_children())
115  {
116  m_xRangeManagerTable->set_cursor(0);
117  m_xRangeManagerTable->CheckForFormulaString();
119  }
120 
121  m_xRangeManagerTable->connect_changed( LINK( this, ScNameDlg, SelectionChangedHdl_Impl ) );
122 
123  m_xBtnOk->connect_clicked( LINK( this, ScNameDlg, OkBtnHdl ) );
124  m_xBtnCancel->connect_clicked( LINK( this, ScNameDlg, CancelBtnHdl ) );
125  m_xBtnAdd->connect_clicked( LINK( this, ScNameDlg, AddBtnHdl ) );
126  m_xEdAssign->SetGetFocusHdl( LINK( this, ScNameDlg, AssignGetFocusHdl ) );
127  m_xEdAssign->SetModifyHdl ( LINK( this, ScNameDlg, RefEdModifyHdl ) );
128  m_xEdName->connect_changed( LINK( this, ScNameDlg, EdModifyHdl ) );
129  m_xLbScope->connect_changed( LINK(this, ScNameDlg, ScopeChangedHdl) );
130  m_xBtnDelete->connect_clicked( LINK( this, ScNameDlg, RemoveBtnHdl ) );
131  m_xBtnPrintArea->connect_toggled( LINK(this, ScNameDlg, EdModifyCheckBoxHdl ) );
132  m_xBtnCriteria->connect_toggled( LINK(this, ScNameDlg, EdModifyCheckBoxHdl ) );
133  m_xBtnRowHeader->connect_toggled( LINK(this, ScNameDlg, EdModifyCheckBoxHdl ) );
134  m_xBtnColHeader->connect_toggled( LINK(this, ScNameDlg, EdModifyCheckBoxHdl ) );
135 
136  // Initialize scope list.
137  m_xLbScope->append_text(maGlobalNameStr);
138  m_xLbScope->set_active(0);
139  SCTAB n = mpDoc->GetTableCount();
140  for (SCTAB i = 0; i < n; ++i)
141  {
142  OUString aTabName;
143  mpDoc->GetName(i, aTabName);
144  m_xLbScope->append_text(aTabName);
145  }
146 
148 }
149 
151 {
152  return m_xEdAssign->GetWidget()->get_sensitive();
153 }
154 
155 void ScNameDlg::RefInputDone( bool bForced)
156 {
158  RefEdModifyHdl(*m_xEdAssign);
159 }
160 
161 void ScNameDlg::SetReference( const ScRange& rRef, ScDocument& rDocP )
162 {
163  if (m_xEdAssign->GetWidget()->get_sensitive())
164  {
165  if ( rRef.aStart != rRef.aEnd )
166  RefInputStart(m_xEdAssign.get());
167  OUString aRefStr(rRef.Format(rDocP, ScRefFlags::RANGE_ABS_3D,
168  ScAddress::Details(rDocP.GetAddressConvention(), 0, 0)));
169  m_xEdAssign->SetRefString( aRefStr );
170  }
171 }
172 
174 {
177  DoClose(ScNameDlgWrapper::GetChildWindowId());
178 }
179 
181 {
182  if (!m_xRangeManagerTable->n_children())
183  {
184  m_xBtnDelete->set_sensitive(false);
185  m_xEdAssign->GetWidget()->set_sensitive(false);
186  m_xRbAssign->GetWidget()->set_sensitive(false);
187  m_xEdName->set_sensitive(false);
188  m_xLbScope->set_sensitive(false);
189 
190  m_xBtnCriteria->set_sensitive(false);
191  m_xBtnPrintArea->set_sensitive(false);
192  m_xBtnColHeader->set_sensitive(false);
193  m_xBtnRowHeader->set_sensitive(false);
194  }
195  else
196  {
197  m_xBtnDelete->set_sensitive(true);
198  m_xEdAssign->GetWidget()->set_sensitive(true);
199  m_xRbAssign->GetWidget()->set_sensitive(true);
200  m_xEdName->set_sensitive(true);
201  m_xLbScope->set_sensitive(true);
202 
203  m_xBtnCriteria->set_sensitive(true);
204  m_xBtnPrintArea->set_sensitive(true);
205  m_xBtnColHeader->set_sensitive(true);
206  m_xBtnRowHeader->set_sensitive(true);
207  }
208 }
209 
211 {
212  m_xEdAssign->GrabFocus();
213  RefInputDone();
214 }
215 
217 {
218  // remove handlers, we only want the handlers to process
219  // user input and not when we are syncing the controls with our internal
220  // model ( also UpdateChecks is called already from some other event
221  // handlers, triggering handlers while already processing a handler can
222  // ( and does in this case ) corrupt the internal data
223 
224  m_xBtnCriteria->connect_toggled( Link<weld::ToggleButton&,void>() );
225  m_xBtnPrintArea->connect_toggled( Link<weld::ToggleButton&,void>() );
226  m_xBtnColHeader->connect_toggled( Link<weld::ToggleButton&,void>() );
227  m_xBtnRowHeader->connect_toggled( Link<weld::ToggleButton&,void>() );
228 
229  m_xBtnCriteria->set_active( pData->HasType( ScRangeData::Type::Criteria ) );
230  m_xBtnPrintArea->set_active( pData->HasType( ScRangeData::Type::PrintArea ) );
231  m_xBtnColHeader->set_active( pData->HasType( ScRangeData::Type::ColHeader ) );
232  m_xBtnRowHeader->set_active( pData->HasType( ScRangeData::Type::RowHeader ) );
233 
234  // Restore handlers so user input is processed again
235  Link<weld::ToggleButton&,void> aToggleHandler = LINK( this, ScNameDlg, EdModifyCheckBoxHdl );
236  m_xBtnCriteria->connect_toggled( aToggleHandler );
237  m_xBtnPrintArea->connect_toggled( aToggleHandler );
238  m_xBtnColHeader->connect_toggled( aToggleHandler );
239  m_xBtnRowHeader->connect_toggled( aToggleHandler );
240 }
241 
243 {
244  OUString aScope = m_xLbScope->get_active_text();
245  OUString aName = m_xEdName->get_text();
246  aName = aName.trim();
247 
248  if (aName.isEmpty())
249  return false;
250 
251  ScRangeName* pRangeName = GetRangeName( aScope );
252 
254  {
255  m_xFtInfo->set_label_type(weld::LabelType::Error);
256  m_xFtInfo->set_label(maErrInvalidNameStr);
257  return false;
258  }
259  else if (pRangeName && pRangeName->findByUpperName(ScGlobal::getCharClassPtr()->uppercase(aName)))
260  {
261  m_xFtInfo->set_label_type(weld::LabelType::Error);
262  m_xFtInfo->set_label(maErrNameInUse);
263  return false;
264  }
265  m_xFtInfo->set_label( maStrInfoDefault );
266  return true;
267 }
268 
270 {
272  std::unique_ptr<ScTokenArray> pCode = aComp.CompileString(m_xEdAssign->GetText());
273  if (pCode->GetCodeError() != FormulaError::NONE)
274  {
275  m_xFtInfo->set_label_type(weld::LabelType::Error);
276  return false;
277  }
278  else
279  {
280  return true;
281  }
282 }
283 
284 ScRangeName* ScNameDlg::GetRangeName(const OUString& rScope)
285 {
286  if (rScope == maGlobalNameStr)
287  return m_RangeMap.find(OUString(STR_GLOBAL_RANGE_NAME))->second.get();
288  else
289  return m_RangeMap.find(rScope)->second.get();
290 }
291 
293 {
294  ScRangeName* pRangeName = GetRangeName(rLine.aScope);
295  ScRangeData* pData = pRangeName->findByUpperName(ScGlobal::getCharClassPtr()->uppercase(rLine.aName));
296  if (pData)
297  {
298  UpdateChecks(pData);
299  }
300 }
301 
303 {
304  mbCloseWithoutUndo = true;
306  pViewSh->SwitchBetweenRefDialogs(this);
307 }
308 
309 void ScNameDlg::SetEntry(const OUString& rName, const OUString& rScope)
310 {
311  if (!rName.isEmpty())
312  {
313  mbDataChanged = true;
314  ScRangeNameLine aLine;
315  aLine.aName = rName;
316  aLine.aScope = rScope;
317  m_xRangeManagerTable->SetEntry(aLine);
318  }
319 }
320 
322 {
323  std::vector<ScRangeNameLine> aEntries = m_xRangeManagerTable->GetSelectedEntries();
324  m_xRangeManagerTable->DeleteSelectedEntries();
325  for (const auto& rEntry : aEntries)
326  {
327  ScRangeName* pRangeName = GetRangeName(rEntry.aScope);
328  ScRangeData* pData = pRangeName->findByUpperName(ScGlobal::getCharClassPtr()->uppercase(rEntry.aName));
329  OSL_ENSURE(pData, "table and model should be in sync");
330  // be safe and check for possible problems
331  if (pData)
332  pRangeName->erase(*pData);
333 
334  mbDataChanged = true;
335  }
337 }
338 
340 {
341  ScRangeNameLine aLine;
342  m_xRangeManagerTable->GetCurrentLine(aLine);
343  OUString aOldName = aLine.aName;
344  OUString aNewName = m_xEdName->get_text();
345  aNewName = aNewName.trim();
346  m_xFtInfo->set_label_type(weld::LabelType::Normal);
347  if (aNewName != aOldName)
348  {
349  if (!IsNameValid())
350  return;
351  }
352  else
353  {
354  m_xFtInfo->set_label( maStrInfoDefault );
355  }
356 
357  if (!IsFormulaValid())
358  {
359  //TODO: implement an info text
360  return;
361  }
362 
363  OUString aOldScope = aLine.aScope;
364  //empty table
365  if (aOldScope.isEmpty())
366  return;
367  OUString aExpr = m_xEdAssign->GetText();
368  OUString aNewScope = m_xLbScope->get_active_text();
369 
370  ScRangeName* pOldRangeName = GetRangeName( aOldScope );
371  ScRangeData* pData = pOldRangeName->findByUpperName( ScGlobal::getCharClassPtr()->uppercase(aOldName) );
372  ScRangeName* pNewRangeName = GetRangeName( aNewScope );
373  OSL_ENSURE(pData, "model and table should be in sync");
374  // be safe and check for range data
375  if (!pData)
376  return;
377 
378  // Assign new index (0) only if the scope is changed, else keep the
379  // existing index.
380  sal_uInt16 nIndex = (aNewScope != aOldScope ? 0 : pData->GetIndex());
381 
382  pOldRangeName->erase(*pData);
383  m_xRangeManagerTable->BlockUpdate();
384  m_xRangeManagerTable->DeleteSelectedEntries();
386  if ( m_xBtnRowHeader->get_active() ) nType |= ScRangeData::Type::RowHeader;
387  if ( m_xBtnColHeader->get_active() ) nType |= ScRangeData::Type::ColHeader;
388  if ( m_xBtnPrintArea->get_active() ) nType |= ScRangeData::Type::PrintArea;
389  if ( m_xBtnCriteria->get_active() ) nType |= ScRangeData::Type::Criteria;
390 
391  ScRangeData* pNewEntry = new ScRangeData( mpDoc, aNewName, aExpr,
392  maCursorPos, nType);
393  pNewEntry->SetIndex( nIndex);
394  pNewRangeName->insert(pNewEntry, false /*bReuseFreeIndex*/);
395  aLine.aName = aNewName;
396  aLine.aExpression = aExpr;
397  aLine.aScope = aNewScope;
398  m_xRangeManagerTable->addEntry(aLine, true);
399  // tdf#128137 process pending async row change events while UpdatesBlocked in place
401  m_xRangeManagerTable->UnblockUpdate();
402  mbDataChanged = true;
403 }
404 
406 {
407  //don't update if we have just modified due to user input
408  if (m_xRangeManagerTable->UpdatesBlocked())
409  {
410  return;
411  }
412 
413  if (m_xRangeManagerTable->IsMultiSelection())
414  {
415  m_xEdName->set_text(maStrMultiSelect);
416  m_xEdAssign->SetText(maStrMultiSelect);
417 
418  m_xEdName->set_sensitive(false);
419  m_xEdAssign->GetWidget()->set_sensitive(false);
420  m_xRbAssign->GetWidget()->set_sensitive(false);
421  m_xLbScope->set_sensitive(false);
422  m_xBtnRowHeader->set_sensitive(false);
423  m_xBtnColHeader->set_sensitive(false);
424  m_xBtnPrintArea->set_sensitive(false);
425  m_xBtnCriteria->set_sensitive(false);
426  }
427  else
428  {
429  ScRangeNameLine aLine;
430  m_xRangeManagerTable->GetCurrentLine(aLine);
431  m_xEdAssign->SetText(aLine.aExpression);
432  m_xEdName->set_text(aLine.aName);
433  m_xLbScope->set_active_text(aLine.aScope);
434  ShowOptions(aLine);
435  m_xBtnDelete->set_sensitive(true);
436  m_xEdName->set_sensitive(true);
437  m_xEdAssign->GetWidget()->set_sensitive(true);
438  m_xRbAssign->GetWidget()->set_sensitive(true);
439  m_xLbScope->set_sensitive(true);
440  m_xBtnRowHeader->set_sensitive(true);
441  m_xBtnColHeader->set_sensitive(true);
442  m_xBtnPrintArea->set_sensitive(true);
443  m_xBtnCriteria->set_sensitive(true);
444  }
445 }
446 
448 {
449  NameModified();
450 }
451 
452 void ScNameDlg::GetRangeNames(std::map<OUString, std::unique_ptr<ScRangeName>>& rRangeMap)
453 {
454  m_RangeMap.swap(rRangeMap);
455 }
456 
458 {
459  response(RET_OK);
460 }
461 
462 IMPL_LINK_NOARG(ScNameDlg, CancelBtnHdl, weld::Button&, void)
463 {
464  response(RET_CANCEL);
465 }
466 
468 {
469  AddPushed();
470 }
471 
472 IMPL_LINK_NOARG(ScNameDlg, RemoveBtnHdl, weld::Button&, void)
473 {
474  RemovePushed();
475 }
476 
477 IMPL_LINK_NOARG(ScNameDlg, EdModifyCheckBoxHdl, weld::ToggleButton&, void)
478 {
479  NameModified();
480 }
481 
482 IMPL_LINK_NOARG(ScNameDlg, EdModifyHdl, weld::Entry&, void)
483 {
484  NameModified();
485 }
486 
488 {
489  NameModified();
490 }
491 
492 IMPL_LINK_NOARG(ScNameDlg, AssignGetFocusHdl, formula::RefEdit&, void)
493 {
494  RefEdModifyHdl(*m_xEdAssign);
495 }
496 
497 IMPL_LINK_NOARG(ScNameDlg, SelectionChangedHdl_Impl, weld::TreeView&, void)
498 {
499  SelectionChanged();
500 }
501 
502 IMPL_LINK_NOARG(ScNameDlg, ScopeChangedHdl, weld::ComboBox&, void)
503 {
504  ScopeChanged();
505 }
506 
507 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_Int32 nIndex
ScAddress aStart
Definition: address.hxx:500
std::unique_ptr< weld::Label > m_xFtAssign
Definition: namedlg.hxx:55
const OUString maErrNameInUse
Definition: namedlg.hxx:38
virtual void SetActive() override
Definition: namedlg.cxx:210
const OUString maStrMultiSelect
Definition: namedlg.hxx:39
std::unique_ptr< ContentProperties > pData
const OUString maErrInvalidNameStr
Definition: namedlg.hxx:37
sal_uInt16 GetIndex() const
Definition: rangenam.hxx:117
void SetEntry(const OUString &rName, const OUString &rScope)
Definition: namedlg.cxx:309
ScDocFunc & GetDocFunc() const
Definition: viewdata.cxx:3036
std::unique_ptr< weld::Button > m_xBtnCancel
Definition: namedlg.hxx:68
virtual ~ScNameDlg() override
Definition: namedlg.cxx:99
sal_Int64 n
std::unique_ptr< ScTokenArray > CompileString(const OUString &rFormula)
Tokenize formula expression string into an array of tokens.
Definition: compiler.cxx:4499
virtual void Close() override
Definition: namedlg.cxx:173
virtual void SetReference(const ScRange &rRef, ScDocument &rDoc) override
Definition: namedlg.cxx:161
ScAddress aEnd
Definition: address.hxx:501
SC_DLLPUBLIC formula::FormulaGrammar::Grammar GetGrammar() const
Definition: document.hxx:985
void RemovePushed()
Definition: namedlg.cxx:321
void ScopeChanged()
Definition: namedlg.cxx:447
ScViewData * mpViewData
Definition: namedlg.hxx:42
std::unique_ptr< formula::RefButton > m_xRbAssign
Definition: namedlg.hxx:57
RET_CANCEL
SC_DLLPUBLIC formula::FormulaGrammar::AddressConvention GetAddressConvention() const
Definition: documen3.cxx:475
SC_DLLPUBLIC SCTAB GetTableCount() const
Definition: document.cxx:314
IMPL_LINK_NOARG(ScNameDlg, OkBtnHdl, weld::Button &, void)
Definition: namedlg.cxx:457
std::unique_ptr< weld::Button > m_xBtnAdd
Definition: namedlg.hxx:65
bool IsNameValid()
Definition: namedlg.cxx:242
std::unique_ptr< weld::Entry > m_xEdName
Definition: namedlg.hxx:54
OUString aExpression
std::unique_ptr< weld::ComboBox > m_xLbScope
Definition: namedlg.hxx:58
void GetRangeNames(std::map< OUString, std::unique_ptr< ScRangeName >> &rRangeMap)
Definition: namedlg.cxx:452
void NameModified()
Definition: namedlg.cxx:339
SC_DLLPUBLIC ScRangeData * findByUpperName(const OUString &rName)
Definition: rangenam.cxx:682
static bool Reschedule(bool bHandleAllCurrentEvents=false)
#define STR_GLOBAL_RANGE_NAME
Definition: globalnames.hxx:16
SC_DLLPUBLIC void GetRangeNameMap(std::map< OUString, ScRangeName * > &rRangeName)
Definition: documen3.cxx:146
int i
void CheckForEmptyTable()
Definition: namedlg.cxx:180
RangeNameContainer m_RangeMap
Definition: namedlg.hxx:52
ScRangeName * GetRangeName(const OUString &rScope)
Definition: namedlg.cxx:284
OUString maStrInfoDefault
Definition: namedlg.hxx:40
std::unique_ptr< weld::Label > m_xFtInfo
Definition: namedlg.hxx:70
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:2208
OUString uppercase(const OUString &rStr, sal_Int32 nPos, sal_Int32 nCount) const
OUString ScResId(const char *pId)
Definition: scdll.cxx:95
std::unique_ptr< weld::CheckButton > m_xBtnPrintArea
Definition: namedlg.hxx:60
virtual void RefInputDone(bool bForced=false) override
Definition: anyrefdg.cxx:755
void SelectionChanged()
Definition: namedlg.cxx:405
std::unique_ptr< formula::RefEdit > m_xEdAssign
Definition: namedlg.hxx:56
virtual bool IsRefInputMode() const override
Definition: namedlg.cxx:150
void ModifyAllRangeNames(const std::map< OUString, std::unique_ptr< ScRangeName >> &rRangeMap)
Modify all range names, global scope names as well as sheet local ones, in one go.
Definition: docfunc.cxx:5177
const OUString maGlobalNameStr
Definition: namedlg.hxx:36
void erase(const ScRangeData &r)
Definition: rangenam.cxx:853
ScNameDlg(SfxBindings *pB, SfxChildWindow *pCW, weld::Window *pParent, ScViewData *ptrViewData, const ScAddress &aCursorPos, std::map< OUString, std::unique_ptr< ScRangeName >> *pRangeMap=nullptr)
Definition: namedlg.cxx:44
bool IsFormulaValid()
Definition: namedlg.cxx:269
std::unique_ptr< weld::CheckButton > m_xBtnCriteria
Definition: namedlg.hxx:62
bool HasType(Type nType) const
Definition: rangenam.hxx:177
ScDocument * mpDoc
Definition: namedlg.hxx:43
virtual void RefInputDone(bool bForced=false) override
Definition: namedlg.cxx:155
void Init()
Definition: namedlg.cxx:103
std::unique_ptr< ScRangeManagerTable > m_xRangeManagerTable
Definition: namedlg.hxx:74
void SetIndex(sal_uInt16 nInd)
Definition: rangenam.hxx:116
const ScAddress maCursorPos
Definition: namedlg.hxx:44
std::unique_ptr< weld::CheckButton > m_xBtnRowHeader
Definition: namedlg.hxx:63
static ScTabViewShell * GetActiveViewShell()
Definition: tabvwsh4.cxx:1023
std::unique_ptr< weld::Button > m_xBtnOk
Definition: namedlg.hxx:67
static SC_DLLPUBLIC IsNameValidType IsNameValid(const OUString &rName, const ScDocument *pDoc)
Definition: rangenam.cxx:467
void AddPushed()
Definition: namedlg.cxx:302
OUString aName
RET_OK
bool mbCloseWithoutUndo
Definition: namedlg.hxx:48
static SC_DLLPUBLIC const CharClass * getCharClassPtr()
Definition: global.cxx:1010
QPRO_FUNC_TYPE nType
Definition: qproform.cxx:401
void ShowOptions(const ScRangeNameLine &rLine)
Definition: namedlg.cxx:292
ScXMLEditAttributeMap::Entry const aEntries[]
std::unique_ptr< weld::CheckButton > m_xBtnColHeader
Definition: namedlg.hxx:61
bool mbDataChanged
Definition: namedlg.hxx:46
bool DoClose(sal_uInt16 nId)
Definition: anyrefdg.cxx:694
std::unique_ptr< weld::Button > m_xBtnDelete
Definition: namedlg.hxx:66
SC_DLLPUBLIC bool GetName(SCTAB nTab, OUString &rName) const
Definition: document.cxx:213
SC_DLLPUBLIC bool insert(ScRangeData *p, bool bReuseFreeIndex=true)
Insert object into set.
Definition: rangenam.cxx:810
sal_Int16 SCTAB
Definition: types.hxx:23
void SwitchBetweenRefDialogs(SfxModelessDialogController *pDialog)
Definition: tabvwshc.cxx:85
void UpdateChecks(const ScRangeData *pData)
Definition: namedlg.cxx:216
virtual void RefInputStart(formula::RefEdit *pEdit, formula::RefButton *pButton=nullptr) override
Definition: anyrefdg.cxx:725