LibreOffice Module sw (master)  1
flddb.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 <swmodule.hxx>
21 #include <wrtsh.hxx>
22 #include <dbfld.hxx>
23 #include <doc.hxx>
24 
25 #include "flddb.hxx"
26 #include <dbconfig.hxx>
27 #include <dbmgr.hxx>
28 #include <o3tl/string_view.hxx>
29 
30 #define USER_DATA_VERSION_1 "1"
31 #define USER_DATA_VERSION USER_DATA_VERSION_1
32 
34  : SwFieldPage(pPage, pController, "modules/swriter/ui/flddbpage.ui", "FieldDbPage", pCoreSet)
35  , m_nOldFormat(0)
36  , m_nOldSubType(0)
37  , m_xTypeLB(m_xBuilder->weld_tree_view("type"))
38  , m_xDatabaseTLB(new SwDBTreeList(m_xBuilder->weld_tree_view("select")))
39  , m_xAddDBPB(m_xBuilder->weld_button("browse"))
40  , m_xCondition(m_xBuilder->weld_widget("condgroup"))
41  , m_xConditionED(new ConditionEdit(m_xBuilder->weld_entry("condition")))
42  , m_xValue(m_xBuilder->weld_widget("recgroup"))
43  , m_xValueED(m_xBuilder->weld_entry("recnumber"))
44  , m_xDBFormatRB(m_xBuilder->weld_radio_button("fromdatabasecb"))
45  , m_xNewFormatRB(m_xBuilder->weld_radio_button("userdefinedcb"))
46  , m_xNumFormatLB(new NumFormatListBox(m_xBuilder->weld_combo_box("numformat")))
47  , m_xFormatLB(m_xBuilder->weld_combo_box("format"))
48  , m_xFormat(m_xBuilder->weld_widget("formatframe"))
49 {
50  SetTypeSel(-1); //TODO
51 
52  m_xTypeLB->make_sorted();
53  m_xFormatLB->make_sorted();
54 
55  auto nWidth = m_xTypeLB->get_approximate_digit_width() * FIELD_COLUMN_WIDTH;
56  auto nHeight = m_xTypeLB->get_height_rows(10);
57  m_xTypeLB->set_size_request(nWidth, nHeight);
58  m_xDatabaseTLB->set_size_request(nWidth*2, nHeight);
59 
60  m_xNumFormatLB->connect_changed(LINK(this, SwFieldDBPage, NumSelectHdl));
61  m_xDatabaseTLB->connect_changed(LINK(this, SwFieldDBPage, TreeSelectHdl));
62  m_xDatabaseTLB->connect_row_activated(LINK(this, SwFieldDBPage, TreeViewInsertHdl));
63 
64  m_xValueED->connect_changed(LINK(this, SwFieldDBPage, ModifyHdl));
65  m_xAddDBPB->connect_clicked(LINK(this, SwFieldDBPage, AddDBHdl));
66 
67  // uitests
68  m_xTypeLB->set_buildable_name(m_xTypeLB->get_buildable_name() + "-db");
69  m_xNumFormatLB->set_buildable_name(m_xNumFormatLB->get_buildable_name() + "-db");
70  m_xFormatLB->set_buildable_name(m_xFormatLB->get_buildable_name() + "-db");
71 }
72 
74 {
75  // If we have no stored SwWrtShell, it means we didn't do anything useful - no need to revoke.
76  if (SwWrtShell* pSh = GetWrtShell())
77  {
78  // This would cleanup in the case of cancelled dialog
79  SwDBManager* pDbManager = pSh->GetDoc()->GetDBManager();
80  if (pDbManager)
81  pDbManager->RevokeLastRegistrations();
82  }
83 }
84 
85 // initialise TabPage
87 {
88  Init(); // general initialization
89 
90  const sal_Int32 nOldPos = m_xTypeLB->get_selected_index();
91  m_xTypeLB->freeze();
93 
94  m_xTypeLB->clear();
95 
96  if (!IsFieldEdit())
97  {
98  // initialise TypeListBox
100 
101  for(sal_uInt16 i = rRg.nStart; i < rRg.nEnd; ++i)
102  {
103  const SwFieldTypesEnum nTypeId = SwFieldMgr::GetTypeId(i);
104  m_xTypeLB->append(OUString::number(static_cast<sal_uInt16>(nTypeId)), SwFieldMgr::GetTypeStr(i));
105  }
106  }
107  else
108  {
109  const SwFieldTypesEnum nTypeId = GetCurField()->GetTypeId();
110  m_xTypeLB->append(OUString::number(static_cast<sal_uInt16>(nTypeId)),
112  }
113 
114  m_xTypeLB->thaw();
115 
116  // select old Pos
117  if (GetTypeSel() != -1)
118  m_xTypeLB->select(GetTypeSel());
119 
120  m_xFormatLB->clear();
121 
123  for( sal_uInt16 i = 0; i < nSize; ++i )
124  {
125  const sal_uInt16 nFormatId = GetFieldMgr().GetFormatId( SwFieldTypesEnum::DatabaseSetNumber, i );
126  OUString sId(OUString::number(nFormatId));
127  m_xFormatLB->append(sId, GetFieldMgr().GetFormatStr(SwFieldTypesEnum::DatabaseSetNumber, i));
128  if (SVX_NUM_ARABIC == nFormatId)
129  m_xFormatLB->set_active_id(sId);
130  }
131 
132  if (!IsFieldEdit())
133  {
134  if (nOldPos != -1)
135  m_xTypeLB->select(nOldPos);
136 
137  if (!m_sOldDBName.isEmpty())
138  {
140  }
141  else
142  {
144  if(pSh)
145  {
146  SwDBData aTmp(pSh->GetDBData());
147  m_xDatabaseTLB->Select(aTmp.sDataSource, aTmp.sCommand, u"");
148  }
149  }
150  }
151 
152  if( !IsRefresh() )
153  {
154  const OUString sUserData = GetUserData();
155  sal_Int32 nIdx{ 0 };
156  if (o3tl::equalsIgnoreAsciiCase(o3tl::getToken(sUserData, 0, ';', nIdx), u"" USER_DATA_VERSION_1))
157  {
158  const sal_uInt16 nVal = o3tl::narrowing<sal_uInt16>(o3tl::toInt32(o3tl::getToken(sUserData, 0, ';', nIdx)));
159  if (nVal != USHRT_MAX)
160  {
161  for (sal_Int32 i = 0, nEntryCount = m_xTypeLB->n_children(); i < nEntryCount; ++i)
162  {
163  if (nVal == m_xTypeLB->get_id(i).toUInt32())
164  {
165  m_xTypeLB->select(i);
166  break;
167  }
168  }
169  }
170  }
171  }
172  TypeHdl(nullptr);
173 
174  m_xTypeLB->connect_changed(LINK(this, SwFieldDBPage, TypeListBoxHdl));
175  m_xTypeLB->connect_row_activated(LINK(this, SwFieldDBPage, TreeViewInsertHdl));
176 
177  if (IsFieldEdit())
178  {
179  m_xConditionED->save_value();
180  m_xValueED->save_value();
184  }
185 }
186 
187 // SwFieldDBPage may ask for password to select current document's data source,
188 // so only do that when activating the page, not when dialog is creating all pages
190 
192 {
193  OUString sTableName;
194  OUString sColumnName;
195  SwDBData aData;
196  sal_Bool bIsTable;
197  aData.sDataSource = m_xDatabaseTLB->GetDBName(sTableName, sColumnName, &bIsTable);
198  aData.sCommand = sTableName;
199  aData.nCommandType = bIsTable ? 0 : 1;
201  assert(pSh);
202 
203  SwDBManager* pDbManager = pSh->GetDoc()->GetDBManager();
204  if (pDbManager)
205  pDbManager->CommitLastRegistrations();
206 
207  if (aData.sDataSource.isEmpty())
208  aData = pSh->GetDBData();
209 
210  if(!aData.sDataSource.isEmpty()) // without database no new field command
211  {
212  const SwFieldTypesEnum nTypeId = static_cast<SwFieldTypesEnum>(m_xTypeLB->get_id(GetTypeSel()).toUInt32());
213  sal_uLong nFormat = 0;
214  sal_uInt16 nSubType = 0;
215 
216  OUString sDBName = aData.sDataSource
217  + OUStringChar(DB_DELIM)
218  + aData.sCommand
219  + OUStringChar(DB_DELIM)
220  + OUString::number(aData.nCommandType)
221  + OUStringChar(DB_DELIM);
222  if (!sColumnName.isEmpty())
223  {
224  sDBName += sColumnName + OUStringChar(DB_DELIM);
225  }
226  OUString aName = sDBName + m_xConditionED->get_text();
227 
228  switch (nTypeId)
229  {
231  nFormat = m_xNumFormatLB->GetFormat();
232  if (m_xNewFormatRB->get_sensitive() && m_xNewFormatRB->get_active())
234  aName = sDBName;
235  break;
236 
238  nFormat = m_xFormatLB->get_active_id().toUInt32();
239  break;
240  default: break;
241  }
242 
243  const OUString aVal(m_xValueED->get_text());
244  OUString sTempTableName;
245  OUString sTempColumnName;
246  OUString sTempDBName = m_xDatabaseTLB->GetDBName(sTempTableName, sTempColumnName);
247  bool bDBListBoxChanged = m_sOldDBName != sTempDBName ||
248  m_sOldTableName != sTempTableName || m_sOldColumnName != sTempColumnName;
249  if (!IsFieldEdit() ||
250  m_xConditionED->get_value_changed_from_saved() ||
251  m_xValueED->get_saved_value() != aVal ||
252  bDBListBoxChanged ||
253  m_nOldFormat != nFormat || m_nOldSubType != nSubType)
254  {
255  InsertField( nTypeId, nSubType, aName, aVal, nFormat);
256  }
257  }
258 
259  return false;
260 }
261 
262 std::unique_ptr<SfxTabPage> SwFieldDBPage::Create( weld::Container* pPage, weld::DialogController* pController,
263  const SfxItemSet *const pAttrSet )
264 {
265  return std::make_unique<SwFieldDBPage>( pPage, pController, pAttrSet );
266 }
267 
269 {
270  return GRP_DB;
271 }
272 
273 IMPL_LINK( SwFieldDBPage, TypeListBoxHdl, weld::TreeView&, rBox, void )
274 {
275  TypeHdl(&rBox);
276 }
277 
279 {
280  // save old ListBoxPos
281  const sal_Int32 nOld = GetTypeSel();
282 
283  // current ListBoxPos
284  SetTypeSel(m_xTypeLB->get_selected_index());
285 
286  if (GetTypeSel() == -1)
287  {
288  SetTypeSel(0);
289  m_xTypeLB->select(0);
290  }
291 
292  if (nOld == GetTypeSel())
293  return;
294 
296  assert(pSh);
297  bool bCond = false, bSetNo = false, bFormat = false, bDBFormat = false;
298  const SwFieldTypesEnum nTypeId = static_cast<SwFieldTypesEnum>(m_xTypeLB->get_id(GetTypeSel()).toUInt32());
299 
300  m_xDatabaseTLB->ShowColumns(nTypeId == SwFieldTypesEnum::Database);
301 
302  if (IsFieldEdit())
303  {
304  SwDBData aData;
305  OUString sColumnName;
306  if (nTypeId == SwFieldTypesEnum::Database)
307  {
308  if (auto const*const pField = dynamic_cast<SwDBField*>(GetCurField()))
309  {
310  aData = pField->GetDBData();
311  sColumnName = static_cast<SwDBFieldType*>(GetCurField()->GetTyp())->GetColumnName();
312  }
313  }
314  else
315  {
316  if (auto *const pField = dynamic_cast<SwDBNameInfField*>(GetCurField()))
317  {
318  aData = pField->GetDBData(pSh->GetDoc());
319  }
320  }
321  m_xDatabaseTLB->Select(aData.sDataSource, aData.sCommand, sColumnName);
322  }
323 
324  switch (nTypeId)
325  {
327  {
328  bFormat = true;
329  bDBFormat = true;
330  m_xNumFormatLB->show();
331  m_xFormatLB->hide();
332 
333  weld::Widget& rWidget = m_xNumFormatLB->get_widget();
335 
336  if (pBox) // type was changed by user
337  m_xDBFormatRB->set_active(true);
338 
339  if (IsFieldEdit())
340  {
341  if (GetCurField()->GetFormat() != 0 && GetCurField()->GetFormat() != SAL_MAX_UINT32)
342  m_xNumFormatLB->SetDefFormat(GetCurField()->GetFormat());
343 
344  if (GetCurField()->GetSubType() & nsSwExtendedSubType::SUB_OWN_FMT)
345  m_xNewFormatRB->set_active(true);
346  else
347  m_xDBFormatRB->set_active(true);
348  }
349  break;
350  }
352  bSetNo = true;
353  [[fallthrough]];
355  bCond = true;
356  if (IsFieldEdit())
357  {
358  m_xConditionED->set_text(GetCurField()->GetPar1());
359  m_xValueED->set_text(GetCurField()->GetPar2());
360  }
361  break;
362 
364  break;
365 
367  {
368  bFormat = true;
369  m_xNewFormatRB->set_active(true);
370  m_xNumFormatLB->hide();
371  m_xFormatLB->show();
372 
373  m_xFormatLB->set_accessible_relation_labeled_by(m_xNewFormatRB.get());
374 
375  if( IsFieldEdit() )
376  {
377  for (sal_Int32 nI = m_xFormatLB->get_count(); nI;)
378  {
379  if (GetCurField()->GetFormat() == m_xFormatLB->get_id(--nI).toUInt32())
380  {
381  m_xFormatLB->set_active( nI );
382  break;
383  }
384  }
385  }
386  break;
387  }
388  default: break;
389  }
390 
391  m_xCondition->set_sensitive(bCond);
392  m_xValue->set_sensitive(bSetNo);
393  if (nTypeId != SwFieldTypesEnum::Database)
394  {
395  m_xDBFormatRB->set_sensitive(bDBFormat);
396  m_xNewFormatRB->set_sensitive(bDBFormat || bFormat);
397  m_xNumFormatLB->set_sensitive(bDBFormat);
398  m_xFormatLB->set_sensitive(bFormat);
399  }
400  m_xFormat->set_sensitive(bDBFormat || bFormat);
401 
402  if (!IsFieldEdit())
403  {
404  m_xValueED->set_text(OUString());
405  if (bCond)
406  m_xConditionED->set_text("TRUE");
407  else
408  m_xConditionED->set_text(OUString());
409  }
410 
411  CheckInsert();
412 }
413 
415 {
416  m_xNewFormatRB->set_active(true);
417  m_xNumFormatLB->CallSelectHdl();
418 }
419 
421 {
422  bool bInsert = true;
423  const SwFieldTypesEnum nTypeId = static_cast<SwFieldTypesEnum>(m_xTypeLB->get_id(GetTypeSel()).toUInt32());
424 
425  std::unique_ptr<weld::TreeIter> xIter(m_xDatabaseTLB->make_iterator());
426  if (m_xDatabaseTLB->get_selected(xIter.get()))
427  {
428  bool bEntry = m_xDatabaseTLB->iter_parent(*xIter);
429 
430  if (nTypeId == SwFieldTypesEnum::Database && bEntry)
431  bEntry = m_xDatabaseTLB->iter_parent(*xIter);
432 
433  bInsert &= bEntry;
434  }
435  else
436  bInsert = false;
437 
439  {
440  bool bHasValue = !m_xValueED->get_text().isEmpty();
441 
442  bInsert &= bHasValue;
443  }
444 
445  EnableInsert(bInsert);
446 }
447 
448 IMPL_LINK(SwFieldDBPage, TreeSelectHdl, weld::TreeView&, rBox, void)
449 {
450  std::unique_ptr<weld::TreeIter> xIter(rBox.make_iterator());
451  if (!rBox.get_selected(xIter.get()))
452  return;
453 
454  const SwFieldTypesEnum nTypeId = static_cast<SwFieldTypesEnum>(m_xTypeLB->get_id(GetTypeSel()).toUInt32());
455 
456  bool bEntry = m_xDatabaseTLB->iter_parent(*xIter);
457 
458  if (nTypeId == SwFieldTypesEnum::Database && bEntry)
459  bEntry = m_xDatabaseTLB->iter_parent(*xIter);
460 
461  CheckInsert();
462 
463  if (nTypeId != SwFieldTypesEnum::Database)
464  return;
465 
466  bool bNumFormat = false;
467 
468  if (bEntry)
469  {
470  OUString sTableName;
471  OUString sColumnName;
472  sal_Bool bIsTable;
473  OUString sDBName = m_xDatabaseTLB->GetDBName(sTableName, sColumnName, &bIsTable);
474  bNumFormat = GetFieldMgr().IsDBNumeric(sDBName,
475  sTableName,
476  bIsTable,
477  sColumnName);
478  if (!IsFieldEdit())
479  m_xDBFormatRB->set_active(true);
480  }
481 
482  m_xDBFormatRB->set_sensitive(bNumFormat);
483  m_xNewFormatRB->set_sensitive(bNumFormat);
484  m_xNumFormatLB->set_sensitive(bNumFormat);
485  m_xFormat->set_sensitive(bNumFormat);
486 }
487 
489 {
490  if (SwWrtShell* pSh = CheckAndGetWrtShell())
491  {
492  OUString sNewDB
493  = SwDBManager::LoadAndRegisterDataSource(GetFrameWeld(), pSh->GetDoc()->GetDocShell());
494  if (!sNewDB.isEmpty())
495  {
496  m_xDatabaseTLB->AddDataSource(sNewDB);
497  }
498  }
499 }
500 
501 // Modify
503 {
504  CheckInsert();
505 }
506 
508 {
509  const sal_Int32 nEntryPos = m_xTypeLB->get_selected_index();
510  const sal_uInt16 nTypeSel = ( -1 == nEntryPos )
511  ? USHRT_MAX : m_xTypeLB->get_id(nEntryPos).toUInt32();
512  SetUserData(USER_DATA_VERSION ";" + OUString::number( nTypeSel ));
513 }
514 
516 {
517  m_xTypeLB->select_id(OUString::number(static_cast<sal_uInt16>(SwFieldTypesEnum::Database)));
518  TypeListBoxHdl(*m_xTypeLB);
519  const SwDBData& rData = SW_MOD()->GetDBConfig()->GetAddressSource();
520  m_xDatabaseTLB->Select(rData.sDataSource, rData.sCommand, u"");
521 }
522 
524 {
525  // We need to remember the shell to be able to call correct SwDBManager
527  m_xDatabaseTLB->SetWrtShell(rSh);
528 }
529 
531 {
532  SwWrtShell* pSh = GetWrtShell();
533  if (!pSh)
534  {
535  pSh = ::GetActiveWrtShell();
536  if (pSh) // this is not guaranteed: e.g., activating print preview with dialog active
537  SetWrtShell(*pSh);
538  }
539  return pSh;
540 }
541 
542 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
IMPL_LINK(SwFieldDBPage, TypeListBoxHdl, weld::TreeView &, rBox, void)
Definition: flddb.cxx:273
void RevokeLastRegistrations()
Revoke not committed registrations in case of mail merge cancel.
Definition: dbmgr.cxx:3226
sal_Int32 nCommandType
Definition: swdbdata.hxx:32
std::unique_ptr< weld::TreeView > m_xTypeLB
Definition: flddb.hxx:36
void SetUserData(const OUString &rString)
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: flddb.cxx:191
sal_uInt32 GetFormat() const
Query parameters for dialog and for BASIC.
Definition: fldbas.hxx:403
std::unique_ptr< NumFormatListBox > m_xNumFormatLB
Definition: flddb.hxx:45
std::unique_ptr< weld::Entry > m_xValueED
Definition: flddb.hxx:42
sal_uIntPtr sal_uLong
OUString sDataSource
Definition: swdbdata.hxx:30
std::unique_ptr< weld::Widget > m_xCondition
Definition: flddb.hxx:39
SwWrtShell * GetActiveWrtShell()
Definition: swmodul1.cxx:108
virtual void Reset(const SfxItemSet *rSet) override
Definition: flddb.cxx:86
const ContentProperties & rData
static const OUString & GetTypeStr(sal_uInt16 nPos)
Definition: fldmgr.cxx:532
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
std::unique_ptr< weld::ComboBox > m_xFormatLB
Definition: flddb.hxx:46
std::unique_ptr< weld::Widget > m_xValue
Definition: flddb.hxx:41
static sal_uInt16 GetPos(SwFieldTypesEnum nTypeId)
Definition: fldmgr.cxx:554
virtual void set_accessible_relation_labeled_by(weld::Widget *pLabel)=0
Used by the UI to modify the document model.
Definition: wrtsh.hxx:96
#define SAL_MAX_UINT32
SwFieldMgr & GetFieldMgr()
Definition: fldpage.hxx:81
IMPL_LINK_NOARG(SwFieldDBPage, NumSelectHdl, weld::ComboBox &, void)
Definition: flddb.cxx:414
static SwFieldTypesEnum GetTypeId(sal_uInt16 nPos)
Definition: fldmgr.cxx:526
void SetWrtShell(SwWrtShell &rSh)
Definition: flddb.cxx:523
sal_uInt16 nEnd
Definition: fldmgr.hxx:63
#define USER_DATA_VERSION
Definition: flddb.cxx:31
SwFieldDBPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
Definition: flddb.cxx:33
SVX_NUM_ARABIC
const OUString & GetUserData() const
sal_uInt16 GetFormatCount(SwFieldTypesEnum nTypeId, bool bHtmlMode) const
Definition: fldmgr.cxx:676
std::unique_ptr< SwDBTreeList > m_xDatabaseTLB
Definition: flddb.hxx:37
void CommitLastRegistrations()
Accept not committed registrations.
Definition: dbmgr.cxx:3254
SwDoc * GetDoc() const
Definition: viewsh.hxx:282
bool IsFieldDlgHtmlMode() const
Definition: fldpage.hxx:49
OUString m_sOldDBName
Definition: flddb.hxx:30
void CheckInsert()
Definition: flddb.cxx:420
constexpr OUStringLiteral aData
Definition: ww8scan.hxx:48
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
Definition: dialoghelp.cxx:19
void ActivateMailMergeAddress()
Definition: flddb.cxx:515
void EnableInsert(bool bEnable)
Definition: fldpage.cxx:317
#define SW_MOD()
Definition: swmodule.hxx:255
sal_uLong m_nOldFormat
Definition: flddb.hxx:33
int i
std::unique_ptr< weld::RadioButton > m_xNewFormatRB
Definition: flddb.hxx:44
SwFieldTypesEnum
List of FieldTypes at UI.
Definition: fldbas.hxx:94
void Init()
Definition: fldpage.cxx:64
bool IsRefresh() const
Definition: fldpage.hxx:50
float u
unsigned char sal_Bool
SwDBData const & GetDBData() const
Database information.
Definition: edfld.cxx:291
void InsertField(SwFieldTypesEnum nTypeId, sal_uInt16 nSubType, const OUString &rPar1, const OUString &rPar2, sal_uInt32 nFormatId, sal_Unicode cDelim= ' ', bool bIsAutomaticLanguage=true)
Definition: fldpage.cxx:116
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: flddb.cxx:262
sal_Int32 GetTypeSel() const
Definition: fldpage.hxx:45
SwField * GetCurField()
Definition: fldpage.hxx:51
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
SwWrtShell * CheckAndGetWrtShell()
Definition: flddb.cxx:530
sal_uInt16 GetFormatId(SwFieldTypesEnum nTypeId, sal_uInt32 nFormatId) const
Definition: fldmgr.cxx:773
std::unique_ptr< weld::RadioButton > m_xDBFormatRB
Definition: flddb.hxx:43
#define DB_DELIM
Definition: swtypes.hxx:130
virtual sal_uInt16 GetSubType() const
Definition: fldbas.cxx:342
#define FIELD_COLUMN_WIDTH
Definition: fldpage.hxx:25
virtual SotClipboardFormatId GetFormat(const TransferableDataHelper &aHelper) override
SwFieldType * GetTyp() const
Definition: fldbas.hxx:398
sal_uInt16 nStart
Definition: fldmgr.hxx:62
virtual bool DeferResetToFirstActivation() override
Definition: flddb.cxx:189
SwFieldTypesEnum GetTypeId() const
Definition: fldbas.cxx:257
SwWrtShell * GetWrtShell()
Definition: fldpage.hxx:52
virtual ~SwFieldDBPage() override
Definition: flddb.cxx:73
bool equalsIgnoreAsciiCase(std::u16string_view s1, std::u16string_view s2)
void SetWrtShell(SwWrtShell *m_pWrtShell)
Definition: fldpage.cxx:339
OUString aName
const SwExtendedSubType SUB_OWN_FMT
SwDBField: Don't accept formatting from database.
Definition: fldbas.hxx:214
void TypeHdl(const weld::TreeView *)
Definition: flddb.cxx:278
sal_uInt16 m_nOldSubType
Definition: flddb.hxx:34
#define USER_DATA_VERSION_1
Definition: flddb.cxx:30
virtual void FillUserData() override
Definition: flddb.cxx:507
bool IsFieldEdit() const
Definition: fldpage.hxx:62
static OUString LoadAndRegisterDataSource(weld::Window *pParent, SwDocShell *pDocShell=nullptr)
Loads a data source from file and registers it.
Definition: dbmgr.cxx:2779
OUString m_sOldColumnName
Definition: flddb.hxx:32
virtual sal_uInt16 GetGroup() override
Definition: flddb.cxx:268
static const SwFieldGroupRgn & GetGroupRange(bool bHtmlMode, sal_uInt16 nGrpId)
Definition: fldmgr.cxx:470
std::unique_ptr< ConditionEdit > m_xConditionED
Definition: flddb.hxx:40
OUString sCommand
Definition: swdbdata.hxx:31
std::unique_ptr< weld::Button > m_xAddDBPB
Definition: flddb.hxx:38
SwDBManager * GetDBManager() const
Definition: doc.hxx:669
void SetTypeSel(sal_Int32 nSet)
Definition: fldpage.hxx:46
std::unique_ptr< weld::Widget > m_xFormat
Definition: flddb.hxx:47
OUString m_sOldTableName
Definition: flddb.hxx:31
OUString sId