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;
251 aBuf.append(aStrSource);
252 if (pDBData)
253 {
254 aBuf.append(' ');
255 aBuf.append(pDBData->GetSourceString());
256 }
257 m_xFTSource->set_label(aBuf.makeStringAndClear());
258
259 aBuf.append(aStrOperations);
260 if (pDBData)
261 {
262 aBuf.append(' ');
263 aBuf.append(pDBData->GetOperations());
264 }
265 m_xFTOperations->set_label(aBuf.makeStringAndClear());
266}
267
268// Transfer of a table area selected with the mouse, which is then displayed
269// as a new selection in the reference window.
270
272{
273 if (!m_xEdAssign->GetWidget()->get_sensitive())
274 return;
275
276 if ( rRef.aStart != rRef.aEnd )
278
279 theCurArea = rRef;
280
281 OUString aRefStr(theCurArea.Format(rDocP, ScRefFlags::RANGE_ABS_3D, aAddrDetails));
282 m_xEdAssign->SetRefString( aRefStr );
283 m_xOptions->set_sensitive(true);
284 m_xBtnAdd->set_sensitive(true);
285 bSaved = true;
286 xSaveObj->Save();
287}
288
290{
291 DoClose( ScDbNameDlgWrapper::GetChildWindowId() );
292}
293
295{
296 m_xEdAssign->GrabFocus();
297
298 // No NameModifyHdl, because otherwise areas can not be changed
299 // (the old content would be displayed again after the reference selection is pulled)
300 // (the selected DB name has not changed either)
301
302 RefInputDone();
303}
304
306{
307 typedef ScDBCollection::NamedDBs DBsType;
308
309 const DBsType& rDBs = aLocalDbCol.getNamedDBs();
310
311 m_xEdName->freeze();
312
313 m_xEdName->clear();
314 m_xEdAssign->SetText( OUString() );
315
316 if (!rDBs.empty())
317 {
318 for (const auto& rxDB : rDBs)
319 m_xEdName->append_text(rxDB->GetName());
320 }
321 else
322 {
323 m_xBtnAdd->set_label( aStrAdd );
324 m_xBtnAdd->set_sensitive(false);
325 m_xBtnRemove->set_sensitive(false);
326 }
327
328 m_xEdName->thaw();
329}
330
331void ScDbNameDlg::UpdateDBData( const OUString& rStrName )
332{
333
335
336 if ( pData )
337 {
338 SCCOL nColStart = 0;
339 SCROW nRowStart = 0;
340 SCCOL nColEnd = 0;
341 SCROW nRowEnd = 0;
342 SCTAB nTab = 0;
343
344 pData->GetArea( nTab, nColStart, nRowStart, nColEnd, nRowEnd );
345 theCurArea = ScRange( ScAddress( nColStart, nRowStart, nTab ),
346 ScAddress( nColEnd, nRowEnd, nTab ) );
348 m_xEdAssign->SetText( theArea );
349 m_xBtnAdd->set_label( aStrModify );
350 m_xBtnHeader->set_active( pData->HasHeader() );
351 m_xBtnTotals->set_active( pData->HasTotals() );
352 m_xBtnDoSize->set_active( pData->IsDoSize() );
353 m_xBtnKeepFmt->set_active( pData->IsKeepFmt() );
354 m_xBtnStripData->set_active( pData->IsStripData() );
356 }
357
358 m_xBtnAdd->set_label( aStrModify );
359 m_xBtnAdd->set_sensitive(true);
360 m_xBtnRemove->set_sensitive(true);
361 m_xOptions->set_sensitive(true);
362}
363
365{
366 return bRefInputMode;
367}
368
369// Handler:
370
372{
373 bInvalid = false;
374 AddBtnHdl(*m_xBtnAdd);
375
376 // Pass the changes and the remove list to the view: both are
377 // transferred as a reference only, so that no dead memory can
378 // be created at this point:
379 if (!bInvalid)
380 {
381 ScDBDocFunc aFunc(*m_rViewData.GetDocShell());
382 aFunc.ModifyAllDBData(aLocalDbCol, aRemoveList);
383 response(RET_OK);
384 }
385}
386
388{
389 response(RET_CANCEL);
390}
391
393{
394 OUString aNewName = comphelper::string::strip(m_xEdName->get_active_text(), ' ');
395 OUString aNewArea = m_xEdAssign->GetText();
396
397 if ( aNewName.isEmpty() || aNewArea.isEmpty() )
398 return;
399
401 && aNewName != STR_DB_LOCAL_NONAME)
402 {
403 // because editing can be done now, parsing is needed first
404 ScRange aTmpRange;
405 OUString aText = m_xEdAssign->GetText();
406 if ( aTmpRange.ParseAny( aText, rDoc, aAddrDetails ) & ScRefFlags::VALID )
407 {
408 theCurArea = aTmpRange;
409 ScAddress aStart = theCurArea.aStart;
410 ScAddress aEnd = theCurArea.aEnd;
411
412 ScDBData* pOldEntry = aLocalDbCol.getNamedDBs().findByUpperName(ScGlobal::getCharClass().uppercase(aNewName));
413 if (pOldEntry)
414 {
415 // modify area
416
417 pOldEntry->MoveTo( aStart.Tab(), aStart.Col(), aStart.Row(),
418 aEnd.Col(), aEnd.Row() );
419 pOldEntry->SetByRow( true );
420 pOldEntry->SetHeader( m_xBtnHeader->get_active() );
421 pOldEntry->SetTotals( m_xBtnTotals->get_active() );
422 pOldEntry->SetDoSize( m_xBtnDoSize->get_active() );
423 pOldEntry->SetKeepFmt( m_xBtnKeepFmt->get_active() );
424 pOldEntry->SetStripData( m_xBtnStripData->get_active() );
425 }
426 else
427 {
428 // insert new area
429
430 std::unique_ptr<ScDBData> pNewEntry(new ScDBData( aNewName, aStart.Tab(),
431 aStart.Col(), aStart.Row(),
432 aEnd.Col(), aEnd.Row(),
433 true, m_xBtnHeader->get_active(),
434 m_xBtnTotals->get_active() ));
435 pNewEntry->SetDoSize( m_xBtnDoSize->get_active() );
436 pNewEntry->SetKeepFmt( m_xBtnKeepFmt->get_active() );
437 pNewEntry->SetStripData( m_xBtnStripData->get_active() );
438
439 bool ins = aLocalDbCol.getNamedDBs().insert(std::move(pNewEntry));
440 assert(ins); (void)ins;
441 }
442
443 UpdateNames();
444
445 m_xEdName->set_entry_text( OUString() );
446 m_xEdName->grab_focus();
447 m_xBtnAdd->set_label( aStrAdd );
448 m_xBtnAdd->set_sensitive(false);
449 m_xBtnRemove->set_sensitive(false);
450 m_xEdAssign->SetText( OUString() );
451 m_xBtnHeader->set_active(true); // Default: with column headers
452 m_xBtnTotals->set_active( false ); // Default: without totals row
453 m_xBtnDoSize->set_active( false );
454 m_xBtnKeepFmt->set_active( false );
455 m_xBtnStripData->set_active( false );
456 SetInfoStrings( nullptr ); // empty
457 theCurArea = ScRange();
458 bSaved = true;
459 xSaveObj->Save();
460 NameModifyHdl( *m_xEdName );
461 }
462 else
463 {
464 ERRORBOX(m_xDialog.get(), aStrInvalid);
465 m_xEdAssign->SelectAll();
466 m_xEdAssign->GrabFocus();
467 bInvalid = true;
468 }
469 }
470 else
471 {
472 ERRORBOX(m_xDialog.get(), ScResId(STR_INVALIDNAME));
473 m_xEdName->select_entry_region(0, -1);
474 m_xEdName->grab_focus();
475 bInvalid = true;
476 }
477}
478
479namespace {
480
481class FindByName
482{
483 const OUString& mrName;
484public:
485 explicit FindByName(const OUString& rName) : mrName(rName) {}
486 bool operator() (std::unique_ptr<ScDBData> const& p) const
487 {
488 return p->GetName() == mrName;
489 }
490};
491
492}
493
495{
496 OUString aStrEntry = m_xEdName->get_active_text();
497 ScDBCollection::NamedDBs& rDBs = aLocalDbCol.getNamedDBs();
499 ::std::find_if(rDBs.begin(), rDBs.end(), FindByName(aStrEntry));
500
501 if (itr == rDBs.end())
502 return;
503
504 OUString aStrDelMsg = ScResId( STR_QUERY_DELENTRY );
505 OUString sMsg{ o3tl::getToken(aStrDelMsg, 0, '#') + aStrEntry + o3tl::getToken(aStrDelMsg, 1, '#') };
506 std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(m_xDialog.get(),
507 VclMessageType::Question, VclButtonsType::YesNo,
508 sMsg));
509 xQueryBox->set_default_response(RET_YES);
510 if (RET_YES != xQueryBox->run())
511 return;
512
513 SCTAB nTab;
514 SCCOL nColStart, nColEnd;
515 SCROW nRowStart, nRowEnd;
516 (*itr)->GetArea( nTab, nColStart, nRowStart, nColEnd, nRowEnd );
517 aRemoveList.emplace_back( ScAddress( nColStart, nRowStart, nTab ),
518 ScAddress( nColEnd, nRowEnd, nTab ) );
519
520 rDBs.erase(itr);
521
522 UpdateNames();
523
524 m_xEdName->set_entry_text( OUString() );
525 m_xEdName->grab_focus();
526 m_xBtnAdd->set_label( aStrAdd );
527 m_xBtnAdd->set_sensitive(false);
528 m_xBtnRemove->set_sensitive(false);
529 m_xEdAssign->SetText( OUString() );
530 theCurArea = ScRange();
531 m_xBtnHeader->set_active(true); // Default: with column headers
532 m_xBtnTotals->set_active( false ); // Default: without totals row
533 m_xBtnDoSize->set_active( false );
534 m_xBtnKeepFmt->set_active( false );
535 m_xBtnStripData->set_active( false );
536 SetInfoStrings( nullptr ); // empty
537 bSaved=false;
538 xSaveObj->Restore();
539 NameModifyHdl( *m_xEdName );
540}
541
543{
544 OUString theName = m_xEdName->get_active_text();
545 bool bNameFound = m_xEdName->find_text(theName) != -1;
546
547 if ( theName.isEmpty() )
548 {
549 if (m_xBtnAdd->get_label() != aStrAdd)
550 m_xBtnAdd->set_label( aStrAdd );
551 m_xBtnAdd->set_sensitive(false);
552 m_xBtnRemove->set_sensitive(false);
553 m_xAssignFrame->set_sensitive(false);
554 m_xOptions->set_sensitive(false);
555 //bSaved=sal_False;
556 //xSaveObj->Restore();
557 //@BugID 54702 enable/disable in the base class only
558 //SFX_APPWINDOW->Disable(sal_False); //! general method in ScAnyRefDlg
559 bRefInputMode = false;
560 }
561 else
562 {
563 if ( bNameFound )
564 {
565 if (m_xBtnAdd->get_label() != aStrModify)
566 m_xBtnAdd->set_label( aStrModify );
567
568 if(!bSaved)
569 {
570 bSaved = true;
571 xSaveObj->Save();
572 }
573 UpdateDBData( theName );
574 }
575 else
576 {
577 if (m_xBtnAdd->get_label() != aStrAdd)
578 m_xBtnAdd->set_label( aStrAdd );
579
580 bSaved=false;
581 xSaveObj->Restore();
582
583 if ( !m_xEdAssign->GetText().isEmpty() )
584 {
585 m_xBtnAdd->set_sensitive(true);
586 m_xOptions->set_sensitive(true);
587 }
588 else
589 {
590 m_xBtnAdd->set_sensitive(false);
591 m_xOptions->set_sensitive(false);
592 }
593 m_xBtnRemove->set_sensitive(false);
594 }
595
596 m_xAssignFrame->set_sensitive(true);
597
598 //@BugID 54702 enable/disable in the base class only
599 //SFX_APPWINDOW->set_sensitive(true);
600 bRefInputMode = true;
601 }
602}
603
605{
606 // parse here for Save(), etc.
607
608 ScRange aTmpRange;
609 OUString aText = m_xEdAssign->GetText();
610 if ( aTmpRange.ParseAny( aText, rDoc, aAddrDetails ) & ScRefFlags::VALID )
611 theCurArea = aTmpRange;
612
613 if (!aText.isEmpty() && !m_xEdName->get_active_text().isEmpty())
614 {
615 m_xBtnAdd->set_sensitive(true);
616 m_xBtnHeader->set_sensitive(true);
617 m_xBtnTotals->set_sensitive(true);
618 m_xBtnDoSize->set_sensitive(true);
619 m_xBtnKeepFmt->set_sensitive(true);
620 m_xBtnStripData->set_sensitive(true);
621 m_xFTSource->set_sensitive(true);
622 m_xFTOperations->set_sensitive(true);
623 }
624 else
625 {
626 m_xBtnAdd->set_sensitive(false);
627 m_xBtnHeader->set_sensitive(false);
628 m_xBtnTotals->set_sensitive(false);
629 m_xBtnDoSize->set_sensitive(false);
630 m_xBtnKeepFmt->set_sensitive(false);
631 m_xBtnStripData->set_sensitive(false);
632 m_xFTSource->set_sensitive(false);
633 m_xFTOperations->set_sensitive(false);
634 }
635}
636
637/* 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, bool bMobile=false)
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:344
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:300
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:270
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:258
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:305
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:331
virtual void Close() override
Definition: dbnamdlg.cxx:289
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:294
ScViewData & m_rViewData
Definition: dbnamdlg.hxx:53
virtual void SetReference(const ScRange &rRef, ScDocument &rDoc) override
Definition: dbnamdlg.cxx:271
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:364
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:826
static SC_DLLPUBLIC const CharClass & getCharClass()
Definition: global.cxx:1062
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:749
virtual void RefInputDone(bool bForced=false) override
Definition: anyrefdg.cxx:779
bool DoClose(sal_uInt16 nId)
Definition: anyrefdg.cxx:718
ScMarkType GetSimpleArea(SCCOL &rStartCol, SCROW &rStartRow, SCTAB &rStartTab, SCCOL &rEndCol, SCROW &rEndRow, SCTAB &rEndTab) const
Definition: viewdata.cxx:1181
@ 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:371
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