1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <memory>
#include <sal/config.h>
#include <cassert>
#include <comphelper/string.hxx>
#include <vcl/msgbox.hxx>
#include <reffact.hxx>
#include <document.hxx>
#include <scresid.hxx>
#include <globstr.hrc>
#include <rangenam.hxx>
#include <globalnames.hxx>
#include <dbnamdlg.hxx>
#include <dbdocfun.hxx>
class DBSaveData;
static DBSaveData* pSaveObj = nullptr;
#define ERRORBOX(s) ScopedVclPtrInstance<MessageDialog>(this, s)->Execute()
// class DBSaveData
class DBSaveData
{
public:
DBSaveData( Edit& rEd, CheckBox& rHdr, CheckBox& rTot, CheckBox& rSize, CheckBox& rFmt,
CheckBox& rStrip, ScRange& rArea )
: rEdAssign(rEd)
, rBtnHeader(rHdr)
, rBtnTotals(rTot)
, rBtnSize(rSize)
, rBtnFormat(rFmt)
, rBtnStrip(rStrip)
, rCurArea(rArea)
, bHeader(false)
, bTotals(false)
, bSize(false)
, bFormat(false)
, bStrip(false)
, bDirty(false)
{
}
void Save();
void Restore();
private:
Edit& rEdAssign;
CheckBox& rBtnHeader;
CheckBox& rBtnTotals;
CheckBox& rBtnSize;
CheckBox& rBtnFormat;
CheckBox& rBtnStrip;
ScRange& rCurArea;
OUString aStr;
ScRange aArea;
bool bHeader:1;
bool bTotals:1;
bool bSize:1;
bool bFormat:1;
bool bStrip:1;
bool bDirty:1;
};
void DBSaveData::Save()
{
aArea = rCurArea;
aStr = rEdAssign.GetText();
bHeader = rBtnHeader.IsChecked();
bTotals = rBtnTotals.IsChecked();
bSize = rBtnSize.IsChecked();
bFormat = rBtnFormat.IsChecked();
bStrip = rBtnStrip.IsChecked();
bDirty = true;
}
void DBSaveData::Restore()
{
if ( bDirty )
{
rCurArea = aArea;
rEdAssign.SetText( aStr );
rBtnHeader.Check ( bHeader );
rBtnTotals.Check ( bTotals );
rBtnSize.Check ( bSize );
rBtnFormat.Check ( bFormat );
rBtnStrip.Check ( bStrip );
bDirty = false;
}
}
// class ScDbNameDlg
ScDbNameDlg::ScDbNameDlg(SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent,
ScViewData* ptrViewData)
: ScAnyRefDlg(pB, pCW, pParent,
"DefineDatabaseRangeDialog",
"modules/scalc/ui/definedatabaserangedialog.ui")
, pViewData(ptrViewData)
, pDoc(ptrViewData->GetDocument())
, bRefInputMode(false)
, aAddrDetails(pDoc->GetAddressConvention(), 0, 0)
, aLocalDbCol(*(pDoc->GetDBCollection()))
{
get(m_pEdName, "entry");
m_pEdName->set_height_request(m_pEdName->GetOptimalSize().Height() + m_pEdName->GetTextHeight() * 8);
get(m_pEdAssign, "assign");
get(m_pAssignFrame, "RangeFrame");
m_pEdAssign->SetReferences(this, m_pAssignFrame->get_label_widget());
get(m_pRbAssign, "assignrb");
m_pRbAssign->SetReferences(this, m_pEdAssign);
get(m_pOptions, "Options");
get(m_pBtnHeader, "ContainsColumnLabels");
get(m_pBtnTotals, "ContainsTotalsRow");
get(m_pBtnDoSize, "InsertOrDeleteCells");
get(m_pBtnKeepFmt, "KeepFormatting");
get(m_pBtnStripData, "DontSaveImportedData");
get(m_pFTSource, "Source");
get(m_pFTOperations, "Operations");
get(m_pBtnOk, "ok");
get(m_pBtnCancel, "cancel");
get(m_pBtnAdd, "add");
aStrAdd = m_pBtnAdd->GetText();
aStrModify = get<vcl::Window>("modify")->GetText();
get(m_pBtnRemove, "delete");
aStrInvalid = get<vcl::Window>("invalid")->GetText();
m_pFTSource->SetStyle(m_pFTSource->GetStyle() | WB_NOLABEL);
m_pFTOperations->SetStyle(m_pFTOperations->GetStyle() | WB_NOLABEL);
// so that the strings in the resource can stay with fixed texts:
aStrSource = m_pFTSource->GetText();
aStrOperations = m_pFTOperations->GetText();
pSaveObj = new DBSaveData( *m_pEdAssign, *m_pBtnHeader, *m_pBtnTotals,
*m_pBtnDoSize, *m_pBtnKeepFmt, *m_pBtnStripData, theCurArea );
Init();
}
ScDbNameDlg::~ScDbNameDlg()
{
disposeOnce();
}
void ScDbNameDlg::dispose()
{
DELETEZ( pSaveObj );
m_pEdName.clear();
m_pAssignFrame.clear();
m_pEdAssign.clear();
m_pRbAssign.clear();
m_pOptions.clear();
m_pBtnHeader.clear();
m_pBtnTotals.clear();
m_pBtnDoSize.clear();
m_pBtnKeepFmt.clear();
m_pBtnStripData.clear();
m_pFTSource.clear();
m_pFTOperations.clear();
m_pBtnOk.clear();
m_pBtnCancel.clear();
m_pBtnAdd.clear();
m_pBtnRemove.clear();
ScAnyRefDlg::dispose();
}
void ScDbNameDlg::Init()
{
m_pBtnHeader->Check(); // Default: with column headers
m_pBtnTotals->Check( false ); // Default: without totals row
m_pBtnDoSize->Check();
m_pBtnKeepFmt->Check();
m_pBtnOk->SetClickHdl ( LINK( this, ScDbNameDlg, OkBtnHdl ) );
m_pBtnCancel->SetClickHdl ( LINK( this, ScDbNameDlg, CancelBtnHdl ) );
m_pBtnAdd->SetClickHdl ( LINK( this, ScDbNameDlg, AddBtnHdl ) );
m_pBtnRemove->SetClickHdl ( LINK( this, ScDbNameDlg, RemoveBtnHdl ) );
m_pEdName->SetModifyHdl ( LINK( this, ScDbNameDlg, NameModifyHdl ) );
m_pEdAssign->SetModifyHdl ( LINK( this, ScDbNameDlg, AssModifyHdl ) );
UpdateNames();
OUString theAreaStr;
if ( pViewData && pDoc )
{
SCCOL nStartCol = 0;
SCROW nStartRow = 0;
SCTAB nStartTab = 0;
SCCOL nEndCol = 0;
SCROW nEndRow = 0;
SCTAB nEndTab = 0;
ScDBCollection* pDBColl = pDoc->GetDBCollection();
ScDBData* pDBData = nullptr;
pViewData->GetSimpleArea( nStartCol, nStartRow, nStartTab,
nEndCol, nEndRow, nEndTab );
theCurArea = ScRange( nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, nEndTab);
theAreaStr = theCurArea.Format(ScRefFlags::RANGE_ABS_3D, pDoc, aAddrDetails);
if ( pDBColl )
{
// determine if the defined DB area has been marked:
pDBData = pDBColl->GetDBAtCursor( nStartCol, nStartRow, nStartTab, ScDBDataPortion::TOP_LEFT );
if ( pDBData )
{
ScAddress& rStart = theCurArea.aStart;
ScAddress& rEnd = theCurArea.aEnd;
SCCOL nCol1;
SCCOL nCol2;
SCROW nRow1;
SCROW nRow2;
SCTAB nTab;
pDBData->GetArea( nTab, nCol1, nRow1, nCol2, nRow2 );
if ( (rStart.Tab() == nTab)
&& (rStart.Col() == nCol1) && (rStart.Row() == nRow1)
&& (rEnd.Col() == nCol2) && (rEnd.Row() == nRow2 ) )
{
OUString aDBName = pDBData->GetName();
if ( aDBName != STR_DB_LOCAL_NONAME )
m_pEdName->SetText(aDBName);
m_pBtnHeader->Check( pDBData->HasHeader() );
m_pBtnTotals->Check( pDBData->HasTotals() );
m_pBtnDoSize->Check( pDBData->IsDoSize() );
m_pBtnKeepFmt->Check( pDBData->IsKeepFmt() );
m_pBtnStripData->Check( pDBData->IsStripData() );
SetInfoStrings( pDBData );
}
}
}
}
m_pEdAssign->SetText( theAreaStr );
m_pEdName->GrabFocus();
bSaved = true;
pSaveObj->Save();
NameModifyHdl( *m_pEdName );
}
void ScDbNameDlg::SetInfoStrings( const ScDBData* pDBData )
{
OUStringBuffer aBuf;
aBuf.append(aStrSource);
if (pDBData)
{
aBuf.append(' ');
aBuf.append(pDBData->GetSourceString());
}
m_pFTSource->SetText(aBuf.makeStringAndClear());
aBuf.append(aStrOperations);
if (pDBData)
{
aBuf.append(' ');
aBuf.append(pDBData->GetOperations());
}
m_pFTOperations->SetText(aBuf.makeStringAndClear());
}
// Transfer of a table area selected with the mouse, which is then displayed
// as a new selection in the reference window.
void ScDbNameDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
{
if ( m_pEdAssign->IsEnabled() )
{
if ( rRef.aStart != rRef.aEnd )
RefInputStart(m_pEdAssign);
theCurArea = rRef;
OUString aRefStr(theCurArea.Format(ScRefFlags::RANGE_ABS_3D, pDocP, aAddrDetails));
m_pEdAssign->SetRefString( aRefStr );
m_pOptions->Enable();
m_pBtnAdd->Enable();
bSaved = true;
pSaveObj->Save();
}
}
bool ScDbNameDlg::Close()
{
return DoClose( ScDbNameDlgWrapper::GetChildWindowId() );
}
void ScDbNameDlg::SetActive()
{
m_pEdAssign->GrabFocus();
// No NameModifyHdl, because otherwise areas can not be changed
// (the old content would be displayed again after the reference selection is pulled)
// (the selected DB name has not changed either)
RefInputDone();
}
void ScDbNameDlg::UpdateNames()
{
typedef ScDBCollection::NamedDBs DBsType;
const DBsType& rDBs = aLocalDbCol.getNamedDBs();
m_pEdName->SetUpdateMode( false );
m_pEdName->Clear();
m_pEdAssign->SetText( EMPTY_OUSTRING );
if (!rDBs.empty())
{
DBsType::const_iterator itr = rDBs.begin(), itrEnd = rDBs.end();
for (; itr != itrEnd; ++itr)
m_pEdName->InsertEntry((*itr)->GetName());
}
else
{
m_pBtnAdd->SetText( aStrAdd );
m_pBtnAdd->Disable();
m_pBtnRemove->Disable();
}
m_pEdName->SetUpdateMode( true );
m_pEdName->Invalidate();
}
void ScDbNameDlg::UpdateDBData( const OUString& rStrName )
{
const ScDBData* pData = aLocalDbCol.getNamedDBs().findByUpperName(ScGlobal::pCharClass->uppercase(rStrName));
if ( pData )
{
SCCOL nColStart = 0;
SCROW nRowStart = 0;
SCCOL nColEnd = 0;
SCROW nRowEnd = 0;
SCTAB nTab = 0;
pData->GetArea( nTab, nColStart, nRowStart, nColEnd, nRowEnd );
theCurArea = ScRange( ScAddress( nColStart, nRowStart, nTab ),
ScAddress( nColEnd, nRowEnd, nTab ) );
OUString theArea(theCurArea.Format(ScRefFlags::RANGE_ABS_3D, pDoc, aAddrDetails));
m_pEdAssign->SetText( theArea );
m_pBtnAdd->SetText( aStrModify );
m_pBtnHeader->Check( pData->HasHeader() );
m_pBtnTotals->Check( pData->HasTotals() );
m_pBtnDoSize->Check( pData->IsDoSize() );
m_pBtnKeepFmt->Check( pData->IsKeepFmt() );
m_pBtnStripData->Check( pData->IsStripData() );
SetInfoStrings( pData );
}
m_pBtnAdd->SetText( aStrModify );
m_pBtnAdd->Enable();
m_pBtnRemove->Enable();
m_pOptions->Enable();
}
bool ScDbNameDlg::IsRefInputMode() const
{
return bRefInputMode;
}
// Handler:
IMPL_LINK_NOARG(ScDbNameDlg, OkBtnHdl, Button*, void)
{
AddBtnHdl( nullptr );
// Pass the changes and the remove list to the view: both are
// transferred as a reference only, so that no dead memory can
// be created at this point:
if ( pViewData )
{
ScDBDocFunc aFunc(*pViewData->GetDocShell());
aFunc.ModifyAllDBData(aLocalDbCol, aRemoveList);
}
Close();
}
IMPL_LINK_NOARG(ScDbNameDlg, CancelBtnHdl, Button*, void)
{
Close();
}
IMPL_LINK_NOARG(ScDbNameDlg, AddBtnHdl, Button*, void)
{
OUString aNewName = comphelper::string::strip(m_pEdName->GetText(), ' ');
OUString aNewArea = m_pEdAssign->GetText();
if ( !aNewName.isEmpty() && !aNewArea.isEmpty() )
{
if ( ScRangeData::IsNameValid( aNewName, pDoc ) == ScRangeData::NAME_VALID && aNewName != STR_DB_LOCAL_NONAME )
{
// because editing can be done now, parsing is needed first
ScRange aTmpRange;
OUString aText = m_pEdAssign->GetText();
if ( aTmpRange.ParseAny( aText, pDoc, aAddrDetails ) & ScRefFlags::VALID )
{
theCurArea = aTmpRange;
ScAddress aStart = theCurArea.aStart;
ScAddress aEnd = theCurArea.aEnd;
ScDBData* pOldEntry = aLocalDbCol.getNamedDBs().findByUpperName(ScGlobal::pCharClass->uppercase(aNewName));
if (pOldEntry)
{
// modify area
pOldEntry->MoveTo( aStart.Tab(), aStart.Col(), aStart.Row(),
aEnd.Col(), aEnd.Row() );
pOldEntry->SetByRow( true );
pOldEntry->SetHeader( m_pBtnHeader->IsChecked() );
pOldEntry->SetTotals( m_pBtnTotals->IsChecked() );
pOldEntry->SetDoSize( m_pBtnDoSize->IsChecked() );
pOldEntry->SetKeepFmt( m_pBtnKeepFmt->IsChecked() );
pOldEntry->SetStripData( m_pBtnStripData->IsChecked() );
}
else
{
// insert new area
ScDBData* pNewEntry = new ScDBData( aNewName, aStart.Tab(),
aStart.Col(), aStart.Row(),
aEnd.Col(), aEnd.Row(),
true, m_pBtnHeader->IsChecked(),
m_pBtnTotals->IsChecked() );
pNewEntry->SetDoSize( m_pBtnDoSize->IsChecked() );
pNewEntry->SetKeepFmt( m_pBtnKeepFmt->IsChecked() );
pNewEntry->SetStripData( m_pBtnStripData->IsChecked() );
bool ins = aLocalDbCol.getNamedDBs().insert(pNewEntry);
assert(ins); (void)ins;
}
UpdateNames();
m_pEdName->SetText( EMPTY_OUSTRING );
m_pEdName->GrabFocus();
m_pBtnAdd->SetText( aStrAdd );
m_pBtnAdd->Disable();
m_pBtnRemove->Disable();
m_pEdAssign->SetText( EMPTY_OUSTRING );
m_pBtnHeader->Check(); // Default: with column headers
m_pBtnTotals->Check( false ); // Default: without totals row
m_pBtnDoSize->Check( false );
m_pBtnKeepFmt->Check( false );
m_pBtnStripData->Check( false );
SetInfoStrings( nullptr ); // empty
theCurArea = ScRange();
bSaved = true;
pSaveObj->Save();
NameModifyHdl( *m_pEdName );
}
else
{
ERRORBOX( aStrInvalid );
m_pEdAssign->SetSelection( Selection( 0, SELECTION_MAX ) );
m_pEdAssign->GrabFocus();
}
}
else
{
ERRORBOX( ScGlobal::GetRscString(STR_INVALIDNAME) );
m_pEdName->SetSelection( Selection( 0, SELECTION_MAX ) );
m_pEdName->GrabFocus();
}
}
}
namespace {
class FindByName
{
const OUString& mrName;
public:
explicit FindByName(const OUString& rName) : mrName(rName) {}
bool operator() (std::unique_ptr<ScDBData> const& p) const
{
return p->GetName() == mrName;
}
};
}
IMPL_LINK_NOARG(ScDbNameDlg, RemoveBtnHdl, Button*, void)
{
OUString aStrEntry = m_pEdName->GetText();
ScDBCollection::NamedDBs& rDBs = aLocalDbCol.getNamedDBs();
ScDBCollection::NamedDBs::iterator itr =
::std::find_if(rDBs.begin(), rDBs.end(), FindByName(aStrEntry));
if (itr != rDBs.end())
{
OUString aStrDelMsg = ScGlobal::GetRscString( STR_QUERY_DELENTRY );
OUStringBuffer aBuf;
aBuf.append(aStrDelMsg.getToken(0, '#'));
aBuf.append(aStrEntry);
aBuf.append(aStrDelMsg.getToken(1, '#'));
ScopedVclPtrInstance< QueryBox > aBox(this, MessBoxStyle::YesNo|MessBoxStyle::DefaultYes, aBuf.makeStringAndClear());
if (RET_YES == aBox->Execute())
{
SCTAB nTab;
SCCOL nColStart, nColEnd;
SCROW nRowStart, nRowEnd;
(*itr)->GetArea( nTab, nColStart, nRowStart, nColEnd, nRowEnd );
aRemoveList.emplace_back( ScAddress( nColStart, nRowStart, nTab ),
ScAddress( nColEnd, nRowEnd, nTab ) );
rDBs.erase(itr);
UpdateNames();
m_pEdName->SetText( EMPTY_OUSTRING );
m_pEdName->GrabFocus();
m_pBtnAdd->SetText( aStrAdd );
m_pBtnAdd->Disable();
m_pBtnRemove->Disable();
m_pEdAssign->SetText( EMPTY_OUSTRING );
theCurArea = ScRange();
m_pBtnHeader->Check(); // Default: with column headers
m_pBtnTotals->Check( false ); // Default: without totals row
m_pBtnDoSize->Check( false );
m_pBtnKeepFmt->Check( false );
m_pBtnStripData->Check( false );
SetInfoStrings( nullptr ); // empty
bSaved=false;
pSaveObj->Restore();
NameModifyHdl( *m_pEdName );
}
}
}
IMPL_LINK_NOARG(ScDbNameDlg, NameModifyHdl, Edit&, void)
{
OUString theName = m_pEdName->GetText();
bool bNameFound = (COMBOBOX_ENTRY_NOTFOUND
!= m_pEdName->GetEntryPos( theName ));
if ( theName.isEmpty() )
{
if (m_pBtnAdd->GetText() != aStrAdd)
m_pBtnAdd->SetText( aStrAdd );
m_pBtnAdd->Disable();
m_pBtnRemove->Disable();
m_pAssignFrame->Disable();
m_pOptions->Disable();
//bSaved=sal_False;
//pSaveObj->Restore();
//@BugID 54702 enable/disable in the base class only
//SFX_APPWINDOW->Disable(sal_False); //! general method in ScAnyRefDlg
bRefInputMode = false;
}
else
{
if ( bNameFound )
{
if (m_pBtnAdd->GetText() != aStrModify)
m_pBtnAdd->SetText( aStrModify );
if(!bSaved)
{
bSaved = true;
pSaveObj->Save();
}
UpdateDBData( theName );
}
else
{
if (m_pBtnAdd->GetText() != aStrAdd)
m_pBtnAdd->SetText( aStrAdd );
bSaved=false;
pSaveObj->Restore();
if ( !m_pEdAssign->GetText().isEmpty() )
{
m_pBtnAdd->Enable();
m_pOptions->Enable();
}
else
{
m_pBtnAdd->Disable();
m_pOptions->Disable();
}
m_pBtnRemove->Disable();
}
m_pAssignFrame->Enable();
//@BugID 54702 enable/disable in the base class only
//SFX_APPWINDOW->Enable();
bRefInputMode = true;
}
}
IMPL_LINK_NOARG(ScDbNameDlg, AssModifyHdl, Edit&, void)
{
// parse here for Save(), etc.
ScRange aTmpRange;
OUString aText = m_pEdAssign->GetText();
if ( aTmpRange.ParseAny( aText, pDoc, aAddrDetails ) & ScRefFlags::VALID )
theCurArea = aTmpRange;
if (!aText.isEmpty() && !m_pEdName->GetText().isEmpty())
{
m_pBtnAdd->Enable();
m_pBtnHeader->Enable();
m_pBtnTotals->Enable();
m_pBtnDoSize->Enable();
m_pBtnKeepFmt->Enable();
m_pBtnStripData->Enable();
m_pFTSource->Enable();
m_pFTOperations->Enable();
}
else
{
m_pBtnAdd->Disable();
m_pBtnHeader->Disable();
m_pBtnTotals->Disable();
m_pBtnDoSize->Disable();
m_pBtnKeepFmt->Disable();
m_pBtnStripData->Disable();
m_pFTSource->Disable();
m_pFTOperations->Disable();
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|