LibreOffice Module sc (master)  1
dbnamdlg.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 <sal/config.h>
22 
23 #include <cassert>
24 
25 #include <comphelper/string.hxx>
26 #include <unotools/charclass.hxx>
27 #include <vcl/svapp.hxx>
28 #include <vcl/weld.hxx>
29 
30 #include <reffact.hxx>
31 #include <document.hxx>
32 #include <globstr.hrc>
33 #include <scresid.hxx>
34 #include <rangenam.hxx>
35 #include <globalnames.hxx>
36 #include <dbnamdlg.hxx>
37 #include <dbdocfun.hxx>
38 
39 namespace {
40 
41 class DBSaveData;
42 
43 }
44 
45 static std::unique_ptr<DBSaveData> xSaveObj;
46 
47 namespace
48 {
49  void ERRORBOX(weld::Window* pParent, const OUString& rString)
50  {
51  std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pParent,
52  VclMessageType::Warning, VclButtonsType::Ok,
53  rString));
54  xBox->run();
55  }
56 
57 
58 class DBSaveData
59 {
60 public:
61  DBSaveData( formula::RefEdit& rEd, weld::CheckButton& rHdr, weld::CheckButton& rTot, weld::CheckButton& rSize, weld::CheckButton& rFmt,
62  weld::CheckButton& rStrip, ScRange& rArea )
63  : rEdAssign(rEd)
64  , rBtnHeader(rHdr)
65  , rBtnTotals(rTot)
66  , rBtnSize(rSize)
67  , rBtnFormat(rFmt)
68  , rBtnStrip(rStrip)
69  , rCurArea(rArea)
70  , bHeader(false)
71  , bTotals(false)
72  , bSize(false)
73  , bFormat(false)
74  , bStrip(false)
75  , bDirty(false)
76  {
77  }
78  void Save();
79  void Restore();
80 
81 private:
82  formula::RefEdit& rEdAssign;
83  weld::CheckButton& rBtnHeader;
84  weld::CheckButton& rBtnTotals;
85  weld::CheckButton& rBtnSize;
86  weld::CheckButton& rBtnFormat;
87  weld::CheckButton& rBtnStrip;
88  ScRange& rCurArea;
89  OUString aStr;
90  ScRange aArea;
91  bool bHeader:1;
92  bool bTotals:1;
93  bool bSize:1;
94  bool bFormat:1;
95  bool bStrip:1;
96  bool bDirty:1;
97 };
98 
99 }
100 
101 void DBSaveData::Save()
102 {
103  aArea = rCurArea;
104  aStr = rEdAssign.GetText();
105  bHeader = rBtnHeader.get_active();
106  bTotals = rBtnTotals.get_active();
107  bSize = rBtnSize.get_active();
108  bFormat = rBtnFormat.get_active();
109  bStrip = rBtnStrip.get_active();
110  bDirty = true;
111 }
112 
113 void DBSaveData::Restore()
114 {
115  if ( bDirty )
116  {
117  rCurArea = aArea;
118  rEdAssign.SetText( aStr );
119  rBtnHeader.set_active ( bHeader );
120  rBtnTotals.set_active ( bTotals );
121  rBtnSize.set_active ( bSize );
122  rBtnFormat.set_active ( bFormat );
123  rBtnStrip.set_active ( bStrip );
124  bDirty = false;
125  }
126 }
127 
128 
130  ScViewData& rViewData)
131  : ScAnyRefDlgController(pB, pCW, pParent,
132  "modules/scalc/ui/definedatabaserangedialog.ui", "DefineDatabaseRangeDialog")
133  , m_rViewData(rViewData)
134  , rDoc(rViewData.GetDocument())
135  , bRefInputMode(false)
136  , aAddrDetails(rDoc.GetAddressConvention(), 0, 0)
137  , aLocalDbCol(*(rDoc.GetDBCollection()))
138  , m_xEdName(m_xBuilder->weld_entry_tree_view("entrygrid", "entry", "entry-list"))
139  , m_xAssignFrame(m_xBuilder->weld_frame("RangeFrame"))
140  , m_xEdAssign(new formula::RefEdit(m_xBuilder->weld_entry("assign")))
141  , m_xRbAssign(new formula::RefButton(m_xBuilder->weld_button("assignrb")))
142  , m_xOptions(m_xBuilder->weld_widget("Options"))
143  , m_xBtnHeader(m_xBuilder->weld_check_button("ContainsColumnLabels"))
144  , m_xBtnTotals(m_xBuilder->weld_check_button("ContainsTotalsRow"))
145  , m_xBtnDoSize(m_xBuilder->weld_check_button("InsertOrDeleteCells"))
146  , m_xBtnKeepFmt(m_xBuilder->weld_check_button("KeepFormatting"))
147  , m_xBtnStripData(m_xBuilder->weld_check_button("DontSaveImportedData"))
148  , m_xFTSource(m_xBuilder->weld_label("Source"))
149  , m_xFTOperations(m_xBuilder->weld_label("Operations"))
150  , m_xBtnOk(m_xBuilder->weld_button("ok"))
151  , m_xBtnCancel(m_xBuilder->weld_button("cancel"))
152  , m_xBtnAdd(m_xBuilder->weld_button("add"))
153  , m_xBtnRemove(m_xBuilder->weld_button("delete"))
154  , m_xModifyPB(m_xBuilder->weld_button("modify"))
155  , m_xInvalidFT(m_xBuilder->weld_label("invalid"))
156  , m_xFrameLabel(m_xAssignFrame->weld_label_widget())
157  , m_xExpander(m_xBuilder->weld_expander("more"))
158 {
159  m_xEdName->set_height_request_by_rows(4);
160  m_xEdAssign->SetReferences(this, m_xFrameLabel.get());
161  m_xRbAssign->SetReferences(this, m_xEdAssign.get());
162  aStrAdd = m_xBtnAdd->get_label();
163  aStrModify = m_xModifyPB->get_label();
164  aStrInvalid = m_xInvalidFT->get_label();
165 
166  // so that the strings in the resource can stay with fixed texts:
167  aStrSource = m_xFTSource->get_label();
168  aStrOperations = m_xFTOperations->get_label();
169 
170  xSaveObj.reset(new DBSaveData( *m_xEdAssign, *m_xBtnHeader, *m_xBtnTotals,
172  Init();
173 }
174 
176 {
177  xSaveObj.reset();
178 }
179 
181 {
182  m_xBtnHeader->set_active(true); // Default: with column headers
183  m_xBtnTotals->set_active( false ); // Default: without totals row
184  m_xBtnDoSize->set_active(true);
185  m_xBtnKeepFmt->set_active(true);
186 
187  m_xBtnOk->connect_clicked ( LINK( this, ScDbNameDlg, OkBtnHdl ) );
188  m_xBtnCancel->connect_clicked ( LINK( this, ScDbNameDlg, CancelBtnHdl ) );
189  m_xBtnAdd->connect_clicked ( LINK( this, ScDbNameDlg, AddBtnHdl ) );
190  m_xBtnRemove->connect_clicked ( LINK( this, ScDbNameDlg, RemoveBtnHdl ) );
191  m_xEdName->connect_changed( LINK( this, ScDbNameDlg, NameModifyHdl ) );
192  m_xEdAssign->SetModifyHdl ( LINK( this, ScDbNameDlg, AssModifyHdl ) );
193  UpdateNames();
194 
195  OUString theAreaStr;
196 
197  SCCOL nStartCol = 0;
198  SCROW nStartRow = 0;
199  SCTAB nStartTab = 0;
200  SCCOL nEndCol = 0;
201  SCROW nEndRow = 0;
202  SCTAB nEndTab = 0;
203 
204  ScDBCollection* pDBColl = rDoc.GetDBCollection();
205 
206  m_rViewData.GetSimpleArea( nStartCol, nStartRow, nStartTab,
207  nEndCol, nEndRow, nEndTab );
208 
209  theCurArea = ScRange( nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, nEndTab);
210 
212 
213  if ( pDBColl )
214  {
215  // determine if the defined DB area has been marked:
216  ScDBData* pDBData = pDBColl->GetDBAtCursor( nStartCol, nStartRow, nStartTab, ScDBDataPortion::TOP_LEFT );
217  if ( pDBData )
218  {
219  ScAddress& rStart = theCurArea.aStart;
220  ScAddress& rEnd = theCurArea.aEnd;
221  SCCOL nCol1;
222  SCCOL nCol2;
223  SCROW nRow1;
224  SCROW nRow2;
225  SCTAB nTab;
226 
227  pDBData->GetArea( nTab, nCol1, nRow1, nCol2, nRow2 );
228 
229  if ( (rStart.Tab() == nTab)
230  && (rStart.Col() == nCol1) && (rStart.Row() == nRow1)
231  && (rEnd.Col() == nCol2) && (rEnd.Row() == nRow2 ) )
232  {
233  OUString aDBName = pDBData->GetName();
234  if ( aDBName != STR_DB_LOCAL_NONAME )
235  m_xEdName->set_entry_text(aDBName);
236 
237  m_xBtnHeader->set_active( pDBData->HasHeader() );
238  m_xBtnTotals->set_active( pDBData->HasTotals() );
239  m_xBtnDoSize->set_active( pDBData->IsDoSize() );
240  m_xBtnKeepFmt->set_active( pDBData->IsKeepFmt() );
241  m_xBtnStripData->set_active( pDBData->IsStripData() );
242  SetInfoStrings( pDBData );
243  }
244  }
245  }
246 
247  m_xEdAssign->SetText( theAreaStr );
248  m_xEdName->grab_focus();
249  bSaved = true;
250  xSaveObj->Save();
251  NameModifyHdl( *m_xEdName );
252 }
253 
254 void ScDbNameDlg::SetInfoStrings( const ScDBData* pDBData )
255 {
256  OUStringBuffer aBuf;
257  aBuf.append(aStrSource);
258  if (pDBData)
259  {
260  aBuf.append(' ');
261  aBuf.append(pDBData->GetSourceString());
262  }
263  m_xFTSource->set_label(aBuf.makeStringAndClear());
264 
265  aBuf.append(aStrOperations);
266  if (pDBData)
267  {
268  aBuf.append(' ');
269  aBuf.append(pDBData->GetOperations());
270  }
271  m_xFTOperations->set_label(aBuf.makeStringAndClear());
272 }
273 
274 // Transfer of a table area selected with the mouse, which is then displayed
275 // as a new selection in the reference window.
276 
277 void ScDbNameDlg::SetReference( const ScRange& rRef, ScDocument& rDocP )
278 {
279  if (!m_xEdAssign->GetWidget()->get_sensitive())
280  return;
281 
282  if ( rRef.aStart != rRef.aEnd )
283  RefInputStart(m_xEdAssign.get());
284 
285  theCurArea = rRef;
286 
287  OUString aRefStr(theCurArea.Format(rDocP, ScRefFlags::RANGE_ABS_3D, aAddrDetails));
288  m_xEdAssign->SetRefString( aRefStr );
289  m_xOptions->set_sensitive(true);
290  m_xBtnAdd->set_sensitive(true);
291  bSaved = true;
292  xSaveObj->Save();
293 }
294 
296 {
297  DoClose( ScDbNameDlgWrapper::GetChildWindowId() );
298 }
299 
301 {
302  m_xEdAssign->GrabFocus();
303 
304  // No NameModifyHdl, because otherwise areas can not be changed
305  // (the old content would be displayed again after the reference selection is pulled)
306  // (the selected DB name has not changed either)
307 
308  RefInputDone();
309 }
310 
312 {
313  typedef ScDBCollection::NamedDBs DBsType;
314 
315  const DBsType& rDBs = aLocalDbCol.getNamedDBs();
316 
317  m_xEdName->freeze();
318 
319  m_xEdName->clear();
320  m_xEdAssign->SetText( EMPTY_OUSTRING );
321 
322  if (!rDBs.empty())
323  {
324  for (const auto& rxDB : rDBs)
325  m_xEdName->append_text(rxDB->GetName());
326  }
327  else
328  {
329  m_xBtnAdd->set_label( aStrAdd );
330  m_xBtnAdd->set_sensitive(false);
331  m_xBtnRemove->set_sensitive(false);
332  }
333 
334  m_xEdName->thaw();
335 }
336 
337 void ScDbNameDlg::UpdateDBData( const OUString& rStrName )
338 {
339 
341 
342  if ( pData )
343  {
344  SCCOL nColStart = 0;
345  SCROW nRowStart = 0;
346  SCCOL nColEnd = 0;
347  SCROW nRowEnd = 0;
348  SCTAB nTab = 0;
349 
350  pData->GetArea( nTab, nColStart, nRowStart, nColEnd, nRowEnd );
351  theCurArea = ScRange( ScAddress( nColStart, nRowStart, nTab ),
352  ScAddress( nColEnd, nRowEnd, nTab ) );
354  m_xEdAssign->SetText( theArea );
355  m_xBtnAdd->set_label( aStrModify );
356  m_xBtnHeader->set_active( pData->HasHeader() );
357  m_xBtnTotals->set_active( pData->HasTotals() );
358  m_xBtnDoSize->set_active( pData->IsDoSize() );
359  m_xBtnKeepFmt->set_active( pData->IsKeepFmt() );
360  m_xBtnStripData->set_active( pData->IsStripData() );
361  SetInfoStrings( pData );
362  }
363 
364  m_xBtnAdd->set_label( aStrModify );
365  m_xBtnAdd->set_sensitive(true);
366  m_xBtnRemove->set_sensitive(true);
367  m_xOptions->set_sensitive(true);
368 }
369 
371 {
372  return bRefInputMode;
373 }
374 
375 // Handler:
376 
378 {
379  AddBtnHdl(*m_xBtnAdd);
380 
381  // Pass the changes and the remove list to the view: both are
382  // transferred as a reference only, so that no dead memory can
383  // be created at this point:
384  {
385  ScDBDocFunc aFunc(*m_rViewData.GetDocShell());
386  aFunc.ModifyAllDBData(aLocalDbCol, aRemoveList);
387  }
388 
389  response(RET_OK);
390 }
391 
393 {
394  response(RET_CANCEL);
395 }
396 
398 {
399  OUString aNewName = comphelper::string::strip(m_xEdName->get_active_text(), ' ');
400  OUString aNewArea = m_xEdAssign->GetText();
401 
402  if ( aNewName.isEmpty() || aNewArea.isEmpty() )
403  return;
404 
406  && aNewName != STR_DB_LOCAL_NONAME)
407  {
408  // because editing can be done now, parsing is needed first
409  ScRange aTmpRange;
410  OUString aText = m_xEdAssign->GetText();
411  if ( aTmpRange.ParseAny( aText, rDoc, aAddrDetails ) & ScRefFlags::VALID )
412  {
413  theCurArea = aTmpRange;
414  ScAddress aStart = theCurArea.aStart;
415  ScAddress aEnd = theCurArea.aEnd;
416 
417  ScDBData* pOldEntry = aLocalDbCol.getNamedDBs().findByUpperName(ScGlobal::getCharClassPtr()->uppercase(aNewName));
418  if (pOldEntry)
419  {
420  // modify area
421 
422  pOldEntry->MoveTo( aStart.Tab(), aStart.Col(), aStart.Row(),
423  aEnd.Col(), aEnd.Row() );
424  pOldEntry->SetByRow( true );
425  pOldEntry->SetHeader( m_xBtnHeader->get_active() );
426  pOldEntry->SetTotals( m_xBtnTotals->get_active() );
427  pOldEntry->SetDoSize( m_xBtnDoSize->get_active() );
428  pOldEntry->SetKeepFmt( m_xBtnKeepFmt->get_active() );
429  pOldEntry->SetStripData( m_xBtnStripData->get_active() );
430  }
431  else
432  {
433  // insert new area
434 
435  std::unique_ptr<ScDBData> pNewEntry(new ScDBData( aNewName, aStart.Tab(),
436  aStart.Col(), aStart.Row(),
437  aEnd.Col(), aEnd.Row(),
438  true, m_xBtnHeader->get_active(),
439  m_xBtnTotals->get_active() ));
440  pNewEntry->SetDoSize( m_xBtnDoSize->get_active() );
441  pNewEntry->SetKeepFmt( m_xBtnKeepFmt->get_active() );
442  pNewEntry->SetStripData( m_xBtnStripData->get_active() );
443 
444  bool ins = aLocalDbCol.getNamedDBs().insert(std::move(pNewEntry));
445  assert(ins); (void)ins;
446  }
447 
448  UpdateNames();
449 
450  m_xEdName->set_entry_text( EMPTY_OUSTRING );
451  m_xEdName->grab_focus();
452  m_xBtnAdd->set_label( aStrAdd );
453  m_xBtnAdd->set_sensitive(false);
454  m_xBtnRemove->set_sensitive(false);
455  m_xEdAssign->SetText( EMPTY_OUSTRING );
456  m_xBtnHeader->set_active(true); // Default: with column headers
457  m_xBtnTotals->set_active( false ); // Default: without totals row
458  m_xBtnDoSize->set_active( false );
459  m_xBtnKeepFmt->set_active( false );
460  m_xBtnStripData->set_active( false );
461  SetInfoStrings( nullptr ); // empty
462  theCurArea = ScRange();
463  bSaved = true;
464  xSaveObj->Save();
465  NameModifyHdl( *m_xEdName );
466  }
467  else
468  {
469  ERRORBOX(m_xDialog.get(), aStrInvalid);
470  m_xEdAssign->SelectAll();
471  m_xEdAssign->GrabFocus();
472  }
473  }
474  else
475  {
476  ERRORBOX(m_xDialog.get(), ScResId(STR_INVALIDNAME));
477  m_xEdName->select_entry_region(0, -1);
478  m_xEdName->grab_focus();
479  }
480 }
481 
482 namespace {
483 
484 class FindByName
485 {
486  const OUString& mrName;
487 public:
488  explicit FindByName(const OUString& rName) : mrName(rName) {}
489  bool operator() (std::unique_ptr<ScDBData> const& p) const
490  {
491  return p->GetName() == mrName;
492  }
493 };
494 
495 }
496 
498 {
499  OUString aStrEntry = m_xEdName->get_active_text();
500  ScDBCollection::NamedDBs& rDBs = aLocalDbCol.getNamedDBs();
502  ::std::find_if(rDBs.begin(), rDBs.end(), FindByName(aStrEntry));
503 
504  if (itr == rDBs.end())
505  return;
506 
507  OUString aStrDelMsg = ScResId( STR_QUERY_DELENTRY );
508  OUString sMsg{ aStrDelMsg.getToken(0, '#') + aStrEntry + aStrDelMsg.getToken(1, '#') };
509  std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(m_xDialog.get(),
510  VclMessageType::Question, VclButtonsType::YesNo,
511  sMsg));
512  xQueryBox->set_default_response(RET_YES);
513  if (RET_YES != xQueryBox->run())
514  return;
515 
516  SCTAB nTab;
517  SCCOL nColStart, nColEnd;
518  SCROW nRowStart, nRowEnd;
519  (*itr)->GetArea( nTab, nColStart, nRowStart, nColEnd, nRowEnd );
520  aRemoveList.emplace_back( ScAddress( nColStart, nRowStart, nTab ),
521  ScAddress( nColEnd, nRowEnd, nTab ) );
522 
523  rDBs.erase(itr);
524 
525  UpdateNames();
526 
527  m_xEdName->set_entry_text( EMPTY_OUSTRING );
528  m_xEdName->grab_focus();
529  m_xBtnAdd->set_label( aStrAdd );
530  m_xBtnAdd->set_sensitive(false);
531  m_xBtnRemove->set_sensitive(false);
532  m_xEdAssign->SetText( EMPTY_OUSTRING );
533  theCurArea = ScRange();
534  m_xBtnHeader->set_active(true); // Default: with column headers
535  m_xBtnTotals->set_active( false ); // Default: without totals row
536  m_xBtnDoSize->set_active( false );
537  m_xBtnKeepFmt->set_active( false );
538  m_xBtnStripData->set_active( false );
539  SetInfoStrings( nullptr ); // empty
540  bSaved=false;
541  xSaveObj->Restore();
542  NameModifyHdl( *m_xEdName );
543 }
544 
546 {
547  OUString theName = m_xEdName->get_active_text();
548  bool bNameFound = m_xEdName->find_text(theName) != -1;
549 
550  if ( theName.isEmpty() )
551  {
552  if (m_xBtnAdd->get_label() != aStrAdd)
553  m_xBtnAdd->set_label( aStrAdd );
554  m_xBtnAdd->set_sensitive(false);
555  m_xBtnRemove->set_sensitive(false);
556  m_xAssignFrame->set_sensitive(false);
557  m_xOptions->set_sensitive(false);
558  //bSaved=sal_False;
559  //xSaveObj->Restore();
560  //@BugID 54702 enable/disable in the base class only
561  //SFX_APPWINDOW->Disable(sal_False); //! general method in ScAnyRefDlg
562  bRefInputMode = false;
563  }
564  else
565  {
566  if ( bNameFound )
567  {
568  if (m_xBtnAdd->get_label() != aStrModify)
569  m_xBtnAdd->set_label( aStrModify );
570 
571  if(!bSaved)
572  {
573  bSaved = true;
574  xSaveObj->Save();
575  }
576  UpdateDBData( theName );
577  }
578  else
579  {
580  if (m_xBtnAdd->get_label() != aStrAdd)
581  m_xBtnAdd->set_label( aStrAdd );
582 
583  bSaved=false;
584  xSaveObj->Restore();
585 
586  if ( !m_xEdAssign->GetText().isEmpty() )
587  {
588  m_xBtnAdd->set_sensitive(true);
589  m_xOptions->set_sensitive(true);
590  }
591  else
592  {
593  m_xBtnAdd->set_sensitive(false);
594  m_xOptions->set_sensitive(false);
595  }
596  m_xBtnRemove->set_sensitive(false);
597  }
598 
599  m_xAssignFrame->set_sensitive(true);
600 
601  //@BugID 54702 enable/disable in the base class only
602  //SFX_APPWINDOW->set_sensitive(true);
603  bRefInputMode = true;
604  }
605 }
606 
608 {
609  // parse here for Save(), etc.
610 
611  ScRange aTmpRange;
612  OUString aText = m_xEdAssign->GetText();
613  if ( aTmpRange.ParseAny( aText, rDoc, aAddrDetails ) & ScRefFlags::VALID )
614  theCurArea = aTmpRange;
615 
616  if (!aText.isEmpty() && !m_xEdName->get_active_text().isEmpty())
617  {
618  m_xBtnAdd->set_sensitive(true);
619  m_xBtnHeader->set_sensitive(true);
620  m_xBtnTotals->set_sensitive(true);
621  m_xBtnDoSize->set_sensitive(true);
622  m_xBtnKeepFmt->set_sensitive(true);
623  m_xBtnStripData->set_sensitive(true);
624  m_xFTSource->set_sensitive(true);
625  m_xFTOperations->set_sensitive(true);
626  }
627  else
628  {
629  m_xBtnAdd->set_sensitive(false);
630  m_xBtnHeader->set_sensitive(false);
631  m_xBtnTotals->set_sensitive(false);
632  m_xBtnDoSize->set_sensitive(false);
633  m_xBtnKeepFmt->set_sensitive(false);
634  m_xBtnStripData->set_sensitive(false);
635  m_xFTSource->set_sensitive(false);
636  m_xFTOperations->set_sensitive(false);
637  }
638 }
639 
640 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SC_DLLPUBLIC ScRefFlags ParseAny(const OUString &, const ScDocument &, const ScAddress::Details &rDetails=ScAddress::detailsOOOa1)
Definition: address.cxx:1775
std::unique_ptr< weld::CheckButton > m_xBtnKeepFmt
Definition: dbnamdlg.hxx:71
std::unique_ptr< weld::Button > m_xBtnAdd
Definition: dbnamdlg.hxx:78
SC_DLLPUBLIC ScDBCollection * GetDBCollection() const
Definition: document.hxx:813
ScAddress aStart
Definition: address.hxx:499
std::unique_ptr< weld::Widget > m_xOptions
Definition: dbnamdlg.hxx:67
#define EMPTY_OUSTRING
Definition: global.hxx:213
virtual void Close() override
Definition: dbnamdlg.cxx:295
SCROW Row() const
Definition: address.hxx:261
virtual bool IsRefInputMode() const override
Definition: dbnamdlg.cxx:370
std::unique_ptr< ContentProperties > pData
bool HasHeader() const
Definition: dbdata.hxx:129
OUString GetSourceString() const
Definition: dbdata.cxx:258
static std::unique_ptr< DBSaveData > xSaveObj
Definition: dbnamdlg.cxx:45
void SetInfoStrings(const ScDBData *pDBData)
Definition: dbnamdlg.cxx:254
#define STR_DB_LOCAL_NONAME
Definition: globalnames.hxx:12
ScRange theCurArea
Definition: dbnamdlg.hxx:58
std::unique_ptr< weld::CheckButton > m_xBtnTotals
Definition: dbnamdlg.hxx:69
void SetDoSize(bool bSet)
Definition: dbdata.hxx:136
bool bRefInputMode
Definition: dbnamdlg.hxx:54
aBuf
ScAddress::Details aAddrDetails
Definition: dbnamdlg.hxx:55
ScAddress aEnd
Definition: address.hxx:500
std::unique_ptr< formula::RefEdit > m_xEdAssign
Definition: dbnamdlg.hxx:64
OUString aStrAdd
Definition: dbnamdlg.hxx:45
void SetKeepFmt(bool bSet)
Definition: dbdata.hxx:138
RET_CANCEL
bool IsDoSize() const
Definition: dbdata.hxx:135
OUString aStrOperations
Definition: dbnamdlg.hxx:50
std::unique_ptr< weld::Button > m_xBtnRemove
Definition: dbnamdlg.hxx:79
ScViewData & m_rViewData
Definition: dbnamdlg.hxx:52
RET_YES
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
void Init()
Definition: dbnamdlg.cxx:180
SCTAB Tab() const
Definition: address.hxx:270
std::unique_ptr< weld::CheckButton > m_xBtnHeader
Definition: dbnamdlg.hxx:68
std::unique_ptr< weld::Button > m_xBtnCancel
Definition: dbnamdlg.hxx:77
void UpdateDBData(const OUString &rStrName)
Definition: dbnamdlg.cxx:337
std::unique_ptr< weld::Label > m_xFTOperations
Definition: dbnamdlg.hxx:74
void UpdateNames()
Definition: dbnamdlg.cxx:311
sal_Int16 SCCOL
Definition: types.hxx:21
OUString aStrInvalid
Definition: dbnamdlg.hxx:47
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
bool bSaved
Definition: dbnamdlg.hxx:43
DBsType::iterator iterator
Definition: dbdata.hxx:249
static SC_DLLPUBLIC IsNameValidType IsNameValid(const OUString &rName, const ScDocument &rDoc)
Definition: rangenam.cxx:464
OUString ScResId(const char *pId)
Definition: scdll.cxx:89
ScMarkType GetSimpleArea(SCCOL &rStartCol, SCROW &rStartRow, SCTAB &rStartTab, SCCOL &rEndCol, SCROW &rEndRow, SCTAB &rEndTab) const
Definition: viewdata.cxx:1171
const OUString & GetName() const
Definition: dbdata.hxx:121
virtual void RefInputDone(bool bForced=false) override
Definition: anyrefdg.cxx:756
bool IsKeepFmt() const
Definition: dbdata.hxx:137
const ScDocument & rDoc
Definition: dbnamdlg.hxx:53
OUString GetOperations() const
Definition: dbdata.cxx:270
void MoveTo(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
Definition: dbdata.cxx:344
void GetArea(SCTAB &rTab, SCCOL &rCol1, SCROW &rRow1, SCCOL &rCol2, SCROW &rRow2) const
Definition: dbdata.cxx:300
void SetHeader(bool bHasH)
Definition: dbdata.hxx:130
bool IsStripData() const
Definition: dbdata.hxx:139
std::unique_ptr< formula::RefButton > m_xRbAssign
Definition: dbnamdlg.hxx:65
SCCOL Col() const
Definition: address.hxx:266
std::unique_ptr< weld::Button > m_xModifyPB
Definition: dbnamdlg.hxx:81
void SetByRow(bool bByR)
Definition: dbdata.hxx:128
ScDBData * findByUpperName(const OUString &rName)
Definition: dbdata.cxx:1147
void SetStripData(bool bSet)
Definition: dbdata.hxx:140
top left cell of area
ScDBCollection aLocalDbCol
Definition: dbnamdlg.hxx:57
Stores global named database ranges.
Definition: dbdata.hxx:234
sal_Int32 SCROW
Definition: types.hxx:17
void erase(const iterator &itr)
Definition: dbdata.cxx:1183
std::unique_ptr< weld::Label > m_xFTSource
Definition: dbnamdlg.hxx:73
virtual void SetActive() override
Definition: dbnamdlg.cxx:300
std::unique_ptr< weld::Label > m_xInvalidFT
Definition: dbnamdlg.hxx:82
ScDbNameDlg(SfxBindings *pB, SfxChildWindow *pCW, weld::Window *pParent, ScViewData &rViewData)
Definition: dbnamdlg.cxx:129
RET_OK
OString strip(const OString &rIn, char c)
std::unique_ptr< weld::CheckButton > m_xBtnStripData
Definition: dbnamdlg.hxx:72
void ModifyAllDBData(const ScDBCollection &rNewColl, const std::vector< ScRange > &rDelAreaList)
Definition: dbdocfun.cxx:245
Reference< XExecutableDialog > m_xDialog
static SC_DLLPUBLIC const CharClass * getCharClassPtr()
Definition: global.cxx:1009
const ScDBData * GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, ScDBDataPortion ePortion) const
Definition: dbdata.cxx:1298
void SetTotals(bool bTotals)
Definition: dbdata.hxx:132
virtual ~ScDbNameDlg() override
Definition: dbnamdlg.cxx:175
NamedDBs & getNamedDBs()
Definition: dbdata.hxx:314
std::unique_ptr< weld::EntryTreeView > m_xEdName
Definition: dbnamdlg.hxx:61
std::unique_ptr< weld::Label > m_xFrameLabel
Definition: dbnamdlg.hxx:84
IMPL_LINK_NOARG(ScDbNameDlg, OkBtnHdl, weld::Button &, void)
Definition: dbnamdlg.cxx:377
std::unique_ptr< weld::Button > m_xBtnOk
Definition: dbnamdlg.hxx:76
OUString aStrModify
Definition: dbnamdlg.hxx:46
std::unique_ptr< weld::CheckButton > m_xBtnDoSize
Definition: dbnamdlg.hxx:70
OUString aStrSource
Definition: dbnamdlg.hxx:49
bool DoClose(sal_uInt16 nId)
Definition: anyrefdg.cxx:695
aStr
bool HasTotals() const
Definition: dbdata.hxx:131
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, bool bMobile=false)
sal_Int16 SCTAB
Definition: types.hxx:22
virtual void SetReference(const ScRange &rRef, ScDocument &rDoc) override
Definition: dbnamdlg.cxx:277
virtual void RefInputStart(formula::RefEdit *pEdit, formula::RefButton *pButton=nullptr) override
Definition: anyrefdg.cxx:726
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo