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