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