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 
405  if ( ScRangeData::IsNameValid( aNewName, rDoc ) == ScRangeData::NAME_VALID && aNewName != STR_DB_LOCAL_NONAME )
406  {
407  // because editing can be done now, parsing is needed first
408  ScRange aTmpRange;
409  OUString aText = m_xEdAssign->GetText();
410  if ( aTmpRange.ParseAny( aText, rDoc, aAddrDetails ) & ScRefFlags::VALID )
411  {
412  theCurArea = aTmpRange;
413  ScAddress aStart = theCurArea.aStart;
414  ScAddress aEnd = theCurArea.aEnd;
415 
416  ScDBData* pOldEntry = aLocalDbCol.getNamedDBs().findByUpperName(ScGlobal::getCharClassPtr()->uppercase(aNewName));
417  if (pOldEntry)
418  {
419  // modify area
420 
421  pOldEntry->MoveTo( aStart.Tab(), aStart.Col(), aStart.Row(),
422  aEnd.Col(), aEnd.Row() );
423  pOldEntry->SetByRow( true );
424  pOldEntry->SetHeader( m_xBtnHeader->get_active() );
425  pOldEntry->SetTotals( m_xBtnTotals->get_active() );
426  pOldEntry->SetDoSize( m_xBtnDoSize->get_active() );
427  pOldEntry->SetKeepFmt( m_xBtnKeepFmt->get_active() );
428  pOldEntry->SetStripData( m_xBtnStripData->get_active() );
429  }
430  else
431  {
432  // insert new area
433 
434  std::unique_ptr<ScDBData> pNewEntry(new ScDBData( aNewName, aStart.Tab(),
435  aStart.Col(), aStart.Row(),
436  aEnd.Col(), aEnd.Row(),
437  true, m_xBtnHeader->get_active(),
438  m_xBtnTotals->get_active() ));
439  pNewEntry->SetDoSize( m_xBtnDoSize->get_active() );
440  pNewEntry->SetKeepFmt( m_xBtnKeepFmt->get_active() );
441  pNewEntry->SetStripData( m_xBtnStripData->get_active() );
442 
443  bool ins = aLocalDbCol.getNamedDBs().insert(std::move(pNewEntry));
444  assert(ins); (void)ins;
445  }
446 
447  UpdateNames();
448 
449  m_xEdName->set_entry_text( EMPTY_OUSTRING );
450  m_xEdName->grab_focus();
451  m_xBtnAdd->set_label( aStrAdd );
452  m_xBtnAdd->set_sensitive(false);
453  m_xBtnRemove->set_sensitive(false);
454  m_xEdAssign->SetText( EMPTY_OUSTRING );
455  m_xBtnHeader->set_active(true); // Default: with column headers
456  m_xBtnTotals->set_active( false ); // Default: without totals row
457  m_xBtnDoSize->set_active( false );
458  m_xBtnKeepFmt->set_active( false );
459  m_xBtnStripData->set_active( false );
460  SetInfoStrings( nullptr ); // empty
461  theCurArea = ScRange();
462  bSaved = true;
463  xSaveObj->Save();
464  NameModifyHdl( *m_xEdName );
465  }
466  else
467  {
468  ERRORBOX(m_xDialog.get(), aStrInvalid);
469  m_xEdAssign->SelectAll();
470  m_xEdAssign->GrabFocus();
471  }
472  }
473  else
474  {
475  ERRORBOX(m_xDialog.get(), ScResId(STR_INVALIDNAME));
476  m_xEdName->select_entry_region(0, -1);
477  m_xEdName->grab_focus();
478  }
479 }
480 
481 namespace {
482 
483 class FindByName
484 {
485  const OUString& mrName;
486 public:
487  explicit FindByName(const OUString& rName) : mrName(rName) {}
488  bool operator() (std::unique_ptr<ScDBData> const& p) const
489  {
490  return p->GetName() == mrName;
491  }
492 };
493 
494 }
495 
497 {
498  OUString aStrEntry = m_xEdName->get_active_text();
499  ScDBCollection::NamedDBs& rDBs = aLocalDbCol.getNamedDBs();
501  ::std::find_if(rDBs.begin(), rDBs.end(), FindByName(aStrEntry));
502 
503  if (itr == rDBs.end())
504  return;
505 
506  OUString aStrDelMsg = ScResId( STR_QUERY_DELENTRY );
507  OUString sMsg{ aStrDelMsg.getToken(0, '#') + aStrEntry + aStrDelMsg.getToken(1, '#') };
508  std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(m_xDialog.get(),
509  VclMessageType::Question, VclButtonsType::YesNo,
510  sMsg));
511  xQueryBox->set_default_response(RET_YES);
512  if (RET_YES != xQueryBox->run())
513  return;
514 
515  SCTAB nTab;
516  SCCOL nColStart, nColEnd;
517  SCROW nRowStart, nRowEnd;
518  (*itr)->GetArea( nTab, nColStart, nRowStart, nColEnd, nRowEnd );
519  aRemoveList.emplace_back( ScAddress( nColStart, nRowStart, nTab ),
520  ScAddress( nColEnd, nRowEnd, nTab ) );
521 
522  rDBs.erase(itr);
523 
524  UpdateNames();
525 
526  m_xEdName->set_entry_text( EMPTY_OUSTRING );
527  m_xEdName->grab_focus();
528  m_xBtnAdd->set_label( aStrAdd );
529  m_xBtnAdd->set_sensitive(false);
530  m_xBtnRemove->set_sensitive(false);
531  m_xEdAssign->SetText( EMPTY_OUSTRING );
532  theCurArea = ScRange();
533  m_xBtnHeader->set_active(true); // Default: with column headers
534  m_xBtnTotals->set_active( false ); // Default: without totals row
535  m_xBtnDoSize->set_active( false );
536  m_xBtnKeepFmt->set_active( false );
537  m_xBtnStripData->set_active( false );
538  SetInfoStrings( nullptr ); // empty
539  bSaved=false;
540  xSaveObj->Restore();
541  NameModifyHdl( *m_xEdName );
542 }
543 
545 {
546  OUString theName = m_xEdName->get_active_text();
547  bool bNameFound = m_xEdName->find_text(theName) != -1;
548 
549  if ( theName.isEmpty() )
550  {
551  if (m_xBtnAdd->get_label() != aStrAdd)
552  m_xBtnAdd->set_label( aStrAdd );
553  m_xBtnAdd->set_sensitive(false);
554  m_xBtnRemove->set_sensitive(false);
555  m_xAssignFrame->set_sensitive(false);
556  m_xOptions->set_sensitive(false);
557  //bSaved=sal_False;
558  //xSaveObj->Restore();
559  //@BugID 54702 enable/disable in the base class only
560  //SFX_APPWINDOW->Disable(sal_False); //! general method in ScAnyRefDlg
561  bRefInputMode = false;
562  }
563  else
564  {
565  if ( bNameFound )
566  {
567  if (m_xBtnAdd->get_label() != aStrModify)
568  m_xBtnAdd->set_label( aStrModify );
569 
570  if(!bSaved)
571  {
572  bSaved = true;
573  xSaveObj->Save();
574  }
575  UpdateDBData( theName );
576  }
577  else
578  {
579  if (m_xBtnAdd->get_label() != aStrAdd)
580  m_xBtnAdd->set_label( aStrAdd );
581 
582  bSaved=false;
583  xSaveObj->Restore();
584 
585  if ( !m_xEdAssign->GetText().isEmpty() )
586  {
587  m_xBtnAdd->set_sensitive(true);
588  m_xOptions->set_sensitive(true);
589  }
590  else
591  {
592  m_xBtnAdd->set_sensitive(false);
593  m_xOptions->set_sensitive(false);
594  }
595  m_xBtnRemove->set_sensitive(false);
596  }
597 
598  m_xAssignFrame->set_sensitive(true);
599 
600  //@BugID 54702 enable/disable in the base class only
601  //SFX_APPWINDOW->set_sensitive(true);
602  bRefInputMode = true;
603  }
604 }
605 
607 {
608  // parse here for Save(), etc.
609 
610  ScRange aTmpRange;
611  OUString aText = m_xEdAssign->GetText();
612  if ( aTmpRange.ParseAny( aText, rDoc, aAddrDetails ) & ScRefFlags::VALID )
613  theCurArea = aTmpRange;
614 
615  if (!aText.isEmpty() && !m_xEdName->get_active_text().isEmpty())
616  {
617  m_xBtnAdd->set_sensitive(true);
618  m_xBtnHeader->set_sensitive(true);
619  m_xBtnTotals->set_sensitive(true);
620  m_xBtnDoSize->set_sensitive(true);
621  m_xBtnKeepFmt->set_sensitive(true);
622  m_xBtnStripData->set_sensitive(true);
623  m_xFTSource->set_sensitive(true);
624  m_xFTOperations->set_sensitive(true);
625  }
626  else
627  {
628  m_xBtnAdd->set_sensitive(false);
629  m_xBtnHeader->set_sensitive(false);
630  m_xBtnTotals->set_sensitive(false);
631  m_xBtnDoSize->set_sensitive(false);
632  m_xBtnKeepFmt->set_sensitive(false);
633  m_xBtnStripData->set_sensitive(false);
634  m_xFTSource->set_sensitive(false);
635  m_xFTOperations->set_sensitive(false);
636  }
637 }
638 
639 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SC_DLLPUBLIC ScRefFlags ParseAny(const OUString &, const ScDocument &, const ScAddress::Details &rDetails=ScAddress::detailsOOOa1)
Definition: address.cxx:1766
std::unique_ptr< weld::CheckButton > m_xBtnKeepFmt
Definition: dbnamdlg.hxx:72
std::unique_ptr< weld::Button > m_xBtnAdd
Definition: dbnamdlg.hxx:79
SC_DLLPUBLIC ScDBCollection * GetDBCollection() const
Definition: document.hxx:816
ScAddress aStart
Definition: address.hxx:500
std::unique_ptr< weld::Widget > m_xOptions
Definition: dbnamdlg.hxx:68
#define EMPTY_OUSTRING
Definition: global.hxx:215
virtual void Close() override
Definition: dbnamdlg.cxx:295
SCROW Row() const
Definition: address.hxx:262
virtual bool IsRefInputMode() const override
Definition: dbnamdlg.cxx:370
std::unique_ptr< ContentProperties > pData
bool HasHeader() const
Definition: dbdata.hxx:130
OUString GetSourceString() const
Definition: dbdata.cxx:259
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:13
ScRange theCurArea
Definition: dbnamdlg.hxx:59
std::unique_ptr< weld::CheckButton > m_xBtnTotals
Definition: dbnamdlg.hxx:70
void SetDoSize(bool bSet)
Definition: dbdata.hxx:137
bool bRefInputMode
Definition: dbnamdlg.hxx:55
aBuf
ScAddress::Details aAddrDetails
Definition: dbnamdlg.hxx:56
ScAddress aEnd
Definition: address.hxx:501
std::unique_ptr< formula::RefEdit > m_xEdAssign
Definition: dbnamdlg.hxx:65
OUString aStrAdd
Definition: dbnamdlg.hxx:46
void SetKeepFmt(bool bSet)
Definition: dbdata.hxx:139
RET_CANCEL
bool IsDoSize() const
Definition: dbdata.hxx:136
OUString aStrOperations
Definition: dbnamdlg.hxx:51
std::unique_ptr< weld::Button > m_xBtnRemove
Definition: dbnamdlg.hxx:80
ScViewData & m_rViewData
Definition: dbnamdlg.hxx:53
RET_YES
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
void Init()
Definition: dbnamdlg.cxx:180
SCTAB Tab() const
Definition: address.hxx:271
std::unique_ptr< weld::CheckButton > m_xBtnHeader
Definition: dbnamdlg.hxx:69
std::unique_ptr< weld::Button > m_xBtnCancel
Definition: dbnamdlg.hxx:78
void UpdateDBData(const OUString &rStrName)
Definition: dbnamdlg.cxx:337
std::unique_ptr< weld::Label > m_xFTOperations
Definition: dbnamdlg.hxx:75
void UpdateNames()
Definition: dbnamdlg.cxx:311
sal_Int16 SCCOL
Definition: types.hxx:22
OUString aStrInvalid
Definition: dbnamdlg.hxx:48
SC_DLLPUBLIC OUString Format(const ScDocument &rDocument, ScRefFlags nFlags=ScRefFlags::ZERO, const ScAddress::Details &rDetails=ScAddress::detailsOOOa1, bool bFullAddressNotation=false) const
Returns string with formatted cell range from aStart to aEnd, according to provided address conventio...
Definition: address.cxx:2203
bool bSaved
Definition: dbnamdlg.hxx:44
DBsType::iterator iterator
Definition: dbdata.hxx:250
static SC_DLLPUBLIC IsNameValidType IsNameValid(const OUString &rName, const ScDocument &rDoc)
Definition: rangenam.cxx:467
OUString ScResId(const char *pId)
Definition: scdll.cxx:95
ScMarkType GetSimpleArea(SCCOL &rStartCol, SCROW &rStartRow, SCTAB &rStartTab, SCCOL &rEndCol, SCROW &rEndRow, SCTAB &rEndTab) const
Definition: viewdata.cxx:1170
const OUString & GetName() const
Definition: dbdata.hxx:122
virtual void RefInputDone(bool bForced=false) override
Definition: anyrefdg.cxx:755
bool IsKeepFmt() const
Definition: dbdata.hxx:138
const ScDocument & rDoc
Definition: dbnamdlg.hxx:54
OUString GetOperations() const
Definition: dbdata.cxx:271
void MoveTo(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
Definition: dbdata.cxx:345
void GetArea(SCTAB &rTab, SCCOL &rCol1, SCROW &rRow1, SCCOL &rCol2, SCROW &rRow2) const
Definition: dbdata.cxx:301
void SetHeader(bool bHasH)
Definition: dbdata.hxx:131
bool IsStripData() const
Definition: dbdata.hxx:140
std::unique_ptr< formula::RefButton > m_xRbAssign
Definition: dbnamdlg.hxx:66
SCCOL Col() const
Definition: address.hxx:267
std::unique_ptr< weld::Button > m_xModifyPB
Definition: dbnamdlg.hxx:82
void SetByRow(bool bByR)
Definition: dbdata.hxx:129
ScDBData * findByUpperName(const OUString &rName)
Definition: dbdata.cxx:1145
void SetStripData(bool bSet)
Definition: dbdata.hxx:141
top left cell of area
ScDBCollection aLocalDbCol
Definition: dbnamdlg.hxx:58
Stores global named database ranges.
Definition: dbdata.hxx:235
sal_Int32 SCROW
Definition: types.hxx:18
void erase(const iterator &itr)
Definition: dbdata.cxx:1181
std::unique_ptr< weld::Label > m_xFTSource
Definition: dbnamdlg.hxx:74
virtual void SetActive() override
Definition: dbnamdlg.cxx:300
std::unique_ptr< weld::Label > m_xInvalidFT
Definition: dbnamdlg.hxx:83
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:73
void ModifyAllDBData(const ScDBCollection &rNewColl, const std::vector< ScRange > &rDelAreaList)
Definition: dbdocfun.cxx:244
Reference< XExecutableDialog > m_xDialog
static SC_DLLPUBLIC const CharClass * getCharClassPtr()
Definition: global.cxx:1010
const ScDBData * GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, ScDBDataPortion ePortion) const
Definition: dbdata.cxx:1296
void SetTotals(bool bTotals)
Definition: dbdata.hxx:133
virtual ~ScDbNameDlg() override
Definition: dbnamdlg.cxx:175
NamedDBs & getNamedDBs()
Definition: dbdata.hxx:315
std::unique_ptr< weld::EntryTreeView > m_xEdName
Definition: dbnamdlg.hxx:62
std::unique_ptr< weld::Label > m_xFrameLabel
Definition: dbnamdlg.hxx:85
IMPL_LINK_NOARG(ScDbNameDlg, OkBtnHdl, weld::Button &, void)
Definition: dbnamdlg.cxx:377
std::unique_ptr< weld::Button > m_xBtnOk
Definition: dbnamdlg.hxx:77
OUString aStrModify
Definition: dbnamdlg.hxx:47
std::unique_ptr< weld::CheckButton > m_xBtnDoSize
Definition: dbnamdlg.hxx:71
OUString aStrSource
Definition: dbnamdlg.hxx:50
bool DoClose(sal_uInt16 nId)
Definition: anyrefdg.cxx:694
aStr
bool HasTotals() const
Definition: dbdata.hxx:132
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, bool bMobile=false)
sal_Int16 SCTAB
Definition: types.hxx:23
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:725
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo