LibreOffice Module sw (master)  1
fldfunc.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 <swtypes.hxx>
21 #include <strings.hrc>
22 #include <fldbas.hxx>
23 #include <docufld.hxx>
24 #include <wrtsh.hxx>
25 #include <swmodule.hxx>
26 #include "fldfunc.hxx"
27 #include "flddinf.hxx"
28 #include <flddropdown.hxx>
29 
30 #define USER_DATA_VERSION_1 "1"
31 #define USER_DATA_VERSION USER_DATA_VERSION_1
32 
33 using namespace ::com::sun::star;
34 
36  : SwFieldPage(pPage, pController, "modules/swriter/ui/fldfuncpage.ui", "FieldFuncPage", pCoreSet)
37  , nOldFormat(0)
38  , bDropDownLBChanged(false)
39  , m_xTypeLB(m_xBuilder->weld_tree_view("type"))
40  , m_xSelectionLB(m_xBuilder->weld_tree_view("select"))
41  , m_xFormat(m_xBuilder->weld_widget("formatframe"))
42  , m_xFormatLB(m_xBuilder->weld_tree_view("format"))
43  , m_xNameFT(m_xBuilder->weld_label("nameft"))
44  , m_xNameED(new ConditionEdit(m_xBuilder->weld_entry("condFunction")))
45  , m_xValueGroup(m_xBuilder->weld_widget("valuegroup"))
46  , m_xValueFT(m_xBuilder->weld_label("valueft"))
47  , m_xValueED(m_xBuilder->weld_entry("value"))
48  , m_xCond1FT(m_xBuilder->weld_label("cond1ft"))
49  , m_xCond1ED(new ConditionEdit(m_xBuilder->weld_entry("cond1")))
50  , m_xCond2FT(m_xBuilder->weld_label("cond2ft"))
51  , m_xCond2ED(new ConditionEdit(m_xBuilder->weld_entry("cond2")))
52  , m_xMacroBT(m_xBuilder->weld_button("macro"))
53  , m_xListGroup(m_xBuilder->weld_widget("listgroup"))
54  , m_xListItemFT(m_xBuilder->weld_label("itemft"))
55  , m_xListItemED(m_xBuilder->weld_entry("item"))
56  , m_xListAddPB(m_xBuilder->weld_button("add"))
57  , m_xListItemsFT(m_xBuilder->weld_label("listitemft"))
58  , m_xListItemsLB(m_xBuilder->weld_tree_view("listitems"))
59  , m_xListRemovePB(m_xBuilder->weld_button("remove"))
60  , m_xListUpPB(m_xBuilder->weld_button("up"))
61  , m_xListDownPB(m_xBuilder->weld_button("down"))
62  , m_xListNameFT(m_xBuilder->weld_label("listnameft"))
63  , m_xListNameED(m_xBuilder->weld_entry("listname"))
64 {
67  m_xListItemsLB->set_size_request(m_xListItemED->get_preferred_size().Width(),
68  m_xListItemsLB->get_height_rows(5));
69 
70  auto nWidth = m_xTypeLB->get_approximate_digit_width() * FIELD_COLUMN_WIDTH;
71  auto nHeight = m_xTypeLB->get_height_rows(20);
72  m_xTypeLB->set_size_request(nWidth, nHeight);
73  m_xFormatLB->set_size_request(nWidth, nHeight);
74 
75  m_xNameED->connect_changed(LINK(this, SwFieldFuncPage, ModifyHdl));
76 
77  m_sOldValueFT = m_xValueFT->get_label();
78  m_sOldNameFT = m_xNameFT->get_label();
79 
80  m_xCond1ED->ShowBrackets(false);
81  m_xCond2ED->ShowBrackets(false);
82 }
83 
85 {
86 }
87 
89 {
91  Init(); // general initialisation
92 
93  m_xTypeLB->freeze();
94  m_xTypeLB->clear();
95 
96  if (!IsFieldEdit())
97  {
98  // initialise TypeListBox
100 
101  // fill Typ-Listbox
102  for(sal_uInt16 i = rRg.nStart; i < rRg.nEnd; ++i)
103  {
104  const SwFieldTypesEnum nTypeId = SwFieldMgr::GetTypeId(i);
105  m_xTypeLB->append(OUString::number(static_cast<sal_uInt16>(nTypeId)), SwFieldMgr::GetTypeStr(i));
106  }
107  }
108  else
109  {
110  const SwFieldTypesEnum nTypeId = GetCurField()->GetTypeId();
111  m_xTypeLB->append(OUString::number(static_cast<sal_uInt16>(nTypeId)), SwFieldMgr::GetTypeStr(SwFieldMgr::GetPos(nTypeId)));
112 
113  if (nTypeId == SwFieldTypesEnum::Macro)
114  {
115  GetFieldMgr().SetMacroPath(GetCurField()->GetPar1());
116  }
117  }
118 
119  m_xTypeLB->connect_row_activated(LINK(this, SwFieldFuncPage, TreeViewInsertHdl));
120  m_xTypeLB->connect_changed(LINK(this, SwFieldFuncPage, TypeHdl));
121  m_xSelectionLB->connect_changed(LINK(this, SwFieldFuncPage, SelectHdl));
122  m_xSelectionLB->connect_row_activated(LINK(this, SwFieldFuncPage, InsertMacroHdl));
123  m_xFormatLB->connect_row_activated(LINK(this, SwFieldFuncPage, TreeViewInsertHdl));
124  m_xMacroBT->connect_clicked(LINK(this, SwFieldFuncPage, MacroHdl));
125  Link<weld::Button&,void> aListModifyLk( LINK(this, SwFieldFuncPage, ListModifyButtonHdl));
126  m_xListAddPB->connect_clicked(aListModifyLk);
127  m_xListRemovePB->connect_clicked(aListModifyLk);
128  m_xListUpPB->connect_clicked(aListModifyLk);
129  m_xListDownPB->connect_clicked(aListModifyLk);
130  m_xListItemED->connect_activate(LINK(this, SwFieldFuncPage, ListModifyReturnActionHdl));
131  Link<weld::Entry&,void> aListEnableLk = LINK(this, SwFieldFuncPage, ListEnableHdl);
132  m_xListItemED->connect_changed(aListEnableLk);
133  m_xListItemsLB->connect_changed(LINK(this, SwFieldFuncPage, ListEnableListBoxHdl));
134 
135  int nSelect = -1;
136  if( !IsRefresh() )
137  {
138  const OUString sUserData = GetUserData();
139  sal_Int32 nIdx{ 0 };
140  if(sUserData.getToken(0, ';', nIdx).equalsIgnoreAsciiCase(USER_DATA_VERSION_1))
141  {
142  const sal_uInt16 nVal = static_cast< sal_uInt16 >(sUserData.getToken(0, ';', nIdx).toInt32());
143  if(nVal != USHRT_MAX)
144  {
145  for (sal_Int32 i = 0, nEntryCount = m_xTypeLB->n_children(); i < nEntryCount; ++i)
146  {
147  if (nVal == m_xTypeLB->get_id(i).toUInt32())
148  {
149  nSelect = i;
150  break;
151  }
152  }
153  }
154  }
155  }
156 
157  m_xTypeLB->thaw();
158  if (nSelect != -1)
159  m_xTypeLB->select(nSelect);
160  else
161  {
162  // select old Pos
164  }
165  TypeHdl(*m_xTypeLB);
166 
167  if (IsFieldEdit())
168  {
169  m_xNameED->save_value();
170  m_xValueED->save_value();
171  m_xCond1ED->save_value();
172  m_xCond2ED->save_value();
174  }
175 }
176 
177 static const char* FMT_MARK_ARY[] =
178 {
179  FMT_MARK_TEXT,
180  FMT_MARK_TABLE,
181  FMT_MARK_FRAME,
182  FMT_MARK_GRAFIC,
183  FMT_MARK_OLE
184 };
185 
187 {
188  // save old ListBoxPos
189  const sal_Int32 nOld = GetTypeSel();
190 
191  // current ListBoxPos
192  SetTypeSel(m_xTypeLB->get_selected_index());
193 
194  if(GetTypeSel() == -1)
195  {
196  SetTypeSel(0);
197  m_xTypeLB->select(0);
198  }
199 
200  if (nOld == GetTypeSel())
201  return;
202 
203  const SwFieldTypesEnum nTypeId = static_cast<SwFieldTypesEnum>(m_xTypeLB->get_id(GetTypeSel()).toUInt32());
204 
205  // fill Selection-Listbox
206  UpdateSubType();
207 
208  // fill Format-Listbox
209  m_xFormatLB->clear();
210 
211  const sal_uInt16 nSize = GetFieldMgr().GetFormatCount(nTypeId, IsFieldDlgHtmlMode());
212 
213  for (sal_uInt16 i = 0; i < nSize; i++)
214  {
215  m_xFormatLB->append(OUString::number(GetFieldMgr().GetFormatId(nTypeId, i)),
216  GetFieldMgr().GetFormatStr(nTypeId, i));
217  }
218 
219  if (nSize)
220  {
221  if (IsFieldEdit() && nTypeId == SwFieldTypesEnum::JumpEdit)
222  m_xFormatLB->select_text(SwResId(FMT_MARK_ARY[GetCurField()->GetFormat()]));
223 
224  if (m_xFormatLB->get_selected_index() == -1)
225  m_xFormatLB->select(0);
226  }
227 
228  bool bValue = false, bName = false, bMacro = false, bInsert = true;
229  bool bFormat = nSize != 0;
230 
231  // two controls for conditional text
232  bool bDropDown = SwFieldTypesEnum::Dropdown == nTypeId;
233  bool bCondTextField = SwFieldTypesEnum::ConditionalText == nTypeId;
234 
235  m_xCond1FT->set_visible(!bDropDown && bCondTextField);
236  m_xCond1ED->set_visible(!bDropDown && bCondTextField);
237  m_xCond2FT->set_visible(!bDropDown && bCondTextField);
238  m_xCond2ED->set_visible(!bDropDown && bCondTextField);
239  m_xValueGroup->set_visible(!bDropDown && !bCondTextField);
240  m_xMacroBT->set_visible(!bDropDown);
241  m_xNameED->set_visible(!bDropDown);
242  m_xNameFT->set_visible(!bDropDown);
243 
244  m_xListGroup->set_visible(bDropDown);
245 
246  m_xNameED->SetDropEnable(false);
247 
248  if (IsFieldEdit())
249  {
250  if(bDropDown)
251  {
252  const SwDropDownField* pDrop = static_cast<const SwDropDownField*>(GetCurField());
253  const uno::Sequence<OUString> aItems = pDrop->GetItemSequence();
254  m_xListItemsLB->clear();
255  for (const OUString& rItem : aItems)
256  m_xListItemsLB->append_text(rItem);
257  m_xListItemsLB->select_text(pDrop->GetSelectedItem());
258  m_xListNameED->set_text(pDrop->GetPar2());
259  m_xListNameED->save_value();
260  bDropDownLBChanged = false;
261  }
262  else
263  {
264  m_xNameED->set_text(GetCurField()->GetPar1());
265  m_xValueED->set_text(GetCurField()->GetPar2());
266  }
267  }
268  else
269  {
270  m_xNameED->set_text(OUString());
271  m_xValueED->set_text(OUString());
272  }
273  if(bDropDown)
274  ListEnableHdl(*m_xListItemED);
275 
276  if (m_xNameFT->get_label() != m_sOldNameFT)
277  m_xNameFT->set_label(m_sOldNameFT);
278  if (m_xValueFT->get_label() != m_sOldValueFT)
279  m_xValueFT->set_label(m_sOldValueFT);
280 
281  switch (nTypeId)
282  {
284  bMacro = true;
285  if (!GetFieldMgr().GetMacroPath().isEmpty())
286  bValue = true;
287  else
288  bInsert = false;
289 
290  m_xNameFT->set_label(SwResId(STR_MACNAME));
291  m_xValueFT->set_label(SwResId(STR_PROMPT));
292  m_xNameED->set_text(GetFieldMgr().GetMacroName());
293  m_xNameED->set_accessible_name(m_xNameFT->get_label());
294  m_xValueED->set_accessible_name(m_xValueFT->get_label());
295  break;
296 
298  m_xNameFT->set_label(SwResId(STR_COND));
299  m_xNameED->SetDropEnable(true);
300  bName = true;
301  m_xNameED->set_accessible_name(m_xNameFT->get_label());
302  m_xValueED->set_accessible_name(m_xValueFT->get_label());
303  break;
304 
306  {
307  m_xNameFT->set_label(SwResId(STR_COND));
308  m_xNameED->SetDropEnable(true);
309  m_xValueFT->set_label(SwResId(STR_INSTEXT));
310  SwWrtShell* pSh = GetActiveWrtShell();
311  if (!IsFieldEdit() && pSh )
312  m_xValueED->set_text(pSh->GetSelText());
313  bName = bValue = true;
314  m_xNameED->set_accessible_name(m_xNameFT->get_label());
315  m_xValueED->set_accessible_name(m_xValueFT->get_label());
316  }
317  break;
318 
320  m_xNameFT->set_label(SwResId(STR_COND));
321  m_xNameED->SetDropEnable(true);
322  if (IsFieldEdit())
323  {
324  sal_Int32 nIdx{ 0 };
325  m_xCond1ED->set_text(GetCurField()->GetPar2().getToken(0, '|', nIdx));
326  m_xCond2ED->set_text(GetCurField()->GetPar2().getToken(0, '|', nIdx));
327  }
328 
329  bName = bValue = true;
330  m_xNameED->set_accessible_name(m_xNameFT->get_label());
331  m_xValueED->set_accessible_name(m_xValueFT->get_label());
332  break;
333 
335  m_xNameFT->set_label(SwResId(STR_JUMPEDITFLD));
336  m_xValueFT->set_label(SwResId(STR_PROMPT));
337  bName = bValue = true;
338  m_xNameED->set_accessible_name(m_xNameFT->get_label());
339  m_xValueED->set_accessible_name(m_xValueFT->get_label());
340  break;
341 
343  m_xValueFT->set_label(SwResId(STR_PROMPT));
344  bValue = true;
345  m_xNameED->set_accessible_name(m_xNameFT->get_label());
346  m_xValueED->set_accessible_name(m_xValueFT->get_label());
347  break;
348 
350  {
351  m_xNameFT->set_label(SwResId(STR_COMBCHRS_FT));
352  m_xNameED->SetDropEnable(true);
353  bName = true;
354 
355  const sal_Int32 nLen = m_xNameED->get_text().getLength();
356  if( !nLen || nLen > MAX_COMBINED_CHARACTERS )
357  bInsert = false;
358  m_xNameED->set_accessible_name(m_xNameFT->get_label());
359  m_xValueED->set_accessible_name(m_xValueFT->get_label());
360  }
361  break;
363  break;
364  default:
365  break;
366  }
367 
368  m_xSelectionLB->hide();
369 
370  m_xFormat->set_sensitive(bFormat);
371  m_xNameFT->set_sensitive(bName);
372  m_xNameED->set_sensitive(bName);
373  m_xValueGroup->set_sensitive(bValue);
374  m_xMacroBT->set_sensitive(bMacro);
375 
376  EnableInsert( bInsert );
377 }
378 
380 {
381  const SwFieldTypesEnum nTypeId = static_cast<SwFieldTypesEnum>(m_xTypeLB->get_id(GetTypeSel()).toUInt32());
382 
383  if( SwFieldTypesEnum::Macro == nTypeId )
384  m_xNameED->set_text( m_xSelectionLB->get_selected_text() );
385 }
386 
388 {
389  SelectHdl(*m_xSelectionLB);
390  InsertHdl(nullptr);
391  return true;
392 }
393 
394 IMPL_LINK(SwFieldFuncPage, ListModifyButtonHdl, weld::Button&, rControl, void)
395 {
396  ListModifyHdl(&rControl);
397 }
398 
399 IMPL_LINK(SwFieldFuncPage, ListModifyReturnActionHdl, weld::Entry&, rControl, bool)
400 {
401  ListModifyHdl(&rControl);
402  return true;
403 }
404 
406 {
407  if (pControl == m_xListAddPB.get() ||
408  (pControl == m_xListItemED.get() && m_xListAddPB->get_sensitive()))
409  {
410  const OUString sEntry(m_xListItemED->get_text());
411  m_xListItemsLB->append_text(sEntry);
412  m_xListItemsLB->select_text(sEntry);
413  }
414  else if (m_xListItemsLB->get_selected_index() != -1)
415  {
416  sal_Int32 nSelPos = m_xListItemsLB->get_selected_index();
417  if (pControl == m_xListRemovePB.get())
418  {
419  m_xListItemsLB->remove(nSelPos);
420  m_xListItemsLB->select(nSelPos ? nSelPos - 1 : 0);
421  }
422  else if (pControl == m_xListUpPB.get())
423  {
424  if(nSelPos)
425  {
426  const OUString sEntry = m_xListItemsLB->get_selected_text();
427  m_xListItemsLB->remove(nSelPos);
428  nSelPos--;
429  m_xListItemsLB->insert_text(nSelPos, sEntry);
430  m_xListItemsLB->select(nSelPos);
431  }
432  }
433  else if (pControl == m_xListDownPB.get())
434  {
435  if( nSelPos < m_xListItemsLB->n_children() - 1)
436  {
437  const OUString sEntry = m_xListItemsLB->get_selected_text();
438  m_xListItemsLB->remove(nSelPos);
439  nSelPos++;
440  m_xListItemsLB->insert_text(nSelPos, sEntry);
441  m_xListItemsLB->select(nSelPos);
442  }
443  }
444  }
445  bDropDownLBChanged = true;
446  ListEnableHdl(*m_xListItemED);
447 }
448 
449 IMPL_LINK_NOARG(SwFieldFuncPage, ListEnableListBoxHdl, weld::TreeView&, void)
450 {
451  ListEnableHdl(*m_xListItemED);
452 }
453 
455 {
456  //enable "Add" button when text is in the Edit that's not already member of the box
457  m_xListAddPB->set_sensitive(!m_xListItemED->get_text().isEmpty() &&
458  -1 == m_xListItemsLB->find_text(m_xListItemED->get_text()));
459  bool bEnableButtons = m_xListItemsLB->get_selected_index() != -1;
460  m_xListRemovePB->set_sensitive(bEnableButtons);
461  m_xListUpPB->set_sensitive(bEnableButtons && (m_xListItemsLB->get_selected_index() > 0));
462  m_xListDownPB->set_sensitive(bEnableButtons &&
463  (m_xListItemsLB->get_selected_index() < (m_xListItemsLB->n_children() - 1)));
464 }
465 
466 // renew types in SelectionBox
468 {
469  const SwFieldTypesEnum nTypeId = static_cast<SwFieldTypesEnum>(m_xTypeLB->get_id(GetTypeSel()).toUInt32());
470 
471  // fill Selection-Listbox
472  m_xSelectionLB->freeze();
473  m_xSelectionLB->clear();
474 
475  std::vector<OUString> aLst;
476  GetFieldMgr().GetSubTypes(nTypeId, aLst);
477  const size_t nCount = aLst.size();
478 
479  for (size_t i = 0; i < nCount; ++i)
480  m_xSelectionLB->append(OUString::number(i), aLst[i]);
481  m_xSelectionLB->thaw();
482 
483  bool bEnable = nCount != 0;
484 
485  m_xSelectionLB->set_sensitive( bEnable );
486 
487  if (bEnable)
488  m_xSelectionLB->select(0);
489 
490  if (nTypeId == SwFieldTypesEnum::Macro)
491  {
492  const bool bHasMacro = !GetFieldMgr().GetMacroPath().isEmpty();
493 
494  if (bHasMacro)
495  {
496  m_xNameED->set_text(GetFieldMgr().GetMacroName());
497  m_xValueGroup->set_sensitive(true);
498  }
499  EnableInsert(bHasMacro);
500  }
501 }
502 
503 // call MacroBrowser, fill Listbox with Macros
505 {
506  if (GetFieldMgr().ChooseMacro(GetFrameWeld()))
507  UpdateSubType();
508 }
509 
511 {
512  const SwFieldTypesEnum nTypeId = static_cast<SwFieldTypesEnum>(m_xTypeLB->get_id(GetTypeSel()).toUInt32());
513 
514  sal_uInt16 nSubType = 0;
515 
516  const sal_Int32 nEntryPos = m_xFormatLB->get_selected_index();
517  const sal_uLong nFormat = (nEntryPos == -1)
518  ? 0 : m_xFormatLB->get_id(nEntryPos).toUInt32();
519 
520  OUString aVal(m_xValueED->get_text());
521  OUString aName(m_xNameED->get_text());
522 
523  switch(nTypeId)
524  {
526  nSubType = INP_TXT;
527  // to prevent removal of CR/LF restore old content
528  if (!m_xNameED->get_value_changed_from_saved() && IsFieldEdit())
529  aName = GetCurField()->GetPar1();
530 
531  break;
532 
534  // use the full script URL, not the name in the Edit control
536  break;
537 
539  aVal = m_xCond1ED->get_text() + "|" + m_xCond2ED->get_text();
540  break;
542  {
543  aName = m_xListNameED->get_text();
544  for (sal_Int32 i = 0, nEntryCount = m_xListItemsLB->n_children(); i < nEntryCount; ++i)
545  {
546  if(i)
547  aVal += OUStringChar(DB_DELIM);
548  aVal += m_xListItemsLB->get_text(i);
549  }
550  }
551  break;
552  default:
553  break;
554  }
555 
556  if (!IsFieldEdit() ||
557  m_xNameED->get_value_changed_from_saved() ||
558  m_xValueED->get_value_changed_from_saved() ||
559  m_xCond1ED->get_value_changed_from_saved() ||
560  m_xCond2ED->get_value_changed_from_saved() ||
561  m_xListNameED->get_value_changed_from_saved() ||
563  nOldFormat != nFormat)
564  {
565  InsertField( nTypeId, nSubType, aName, aVal, nFormat );
566  }
567 
568  ModifyHdl(m_xNameED->get_widget()); // enable/disable Insert if applicable
569 
570  return false;
571 }
572 
573 std::unique_ptr<SfxTabPage> SwFieldFuncPage::Create( weld::Container* pPage, weld::DialogController* pController,
574  const SfxItemSet *const pAttrSet)
575 {
576  return std::make_unique<SwFieldFuncPage>(pPage, pController, pAttrSet);
577 }
578 
580 {
581  return GRP_FKT;
582 }
583 
585 {
586  const sal_Int32 nEntryPos = m_xTypeLB->get_selected_index();
587  const sal_uInt16 nTypeSel = ( -1 == nEntryPos )
588  ? USHRT_MAX
589  : m_xTypeLB->get_id(nEntryPos).toUInt32();
590  SetUserData(USER_DATA_VERSION ";" + OUString::number( nTypeSel ));
591 }
592 
594 {
595  const sal_Int32 nLen = m_xNameED->get_text().getLength();
596 
597  bool bEnable = true;
598  SwFieldTypesEnum nTypeId = static_cast<SwFieldTypesEnum>(m_xTypeLB->get_id(GetTypeSel()).toUInt32());
599 
600  if( SwFieldTypesEnum::CombinedChars == nTypeId &&
601  (!nLen || nLen > MAX_COMBINED_CHARACTERS ))
602  bEnable = false;
603 
604  EnableInsert( bEnable );
605 }
606 
607 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::Button > m_xListRemovePB
Definition: fldfunc.hxx:57
IMPL_LINK_NOARG(SwFieldFuncPage, TypeHdl, weld::TreeView &, void)
Definition: fldfunc.cxx:186
void RestorePos(weld::TreeView &rLst1)
Definition: fldpage.cxx:284
void ListModifyHdl(const weld::Widget *)
Definition: fldfunc.cxx:405
void SetUserData(const OUString &rString)
std::unique_ptr< weld::Button > m_xListDownPB
Definition: fldfunc.hxx:59
virtual sal_uInt16 GetGroup() override
Definition: fldfunc.cxx:579
sal_uInt32 GetFormat() const
Query parameters for dialog and for BASIC.
Definition: fldbas.hxx:401
std::unique_ptr< weld::TreeView > m_xTypeLB
Definition: fldfunc.hxx:35
sal_uIntPtr sal_uLong
SwWrtShell * GetActiveWrtShell()
Definition: swmodul1.cxx:108
std::unique_ptr< weld::Label > m_xNameFT
Definition: fldfunc.hxx:39
static const char * FMT_MARK_ARY[]
Definition: fldfunc.cxx:177
sal_uLong nOldFormat
Definition: fldfunc.hxx:32
std::unique_ptr< weld::Label > m_xValueFT
Definition: fldfunc.hxx:42
static sal_uInt16 GetPos(SwFieldTypesEnum nTypeId)
Definition: fldmgr.cxx:549
IMPL_LINK(SwFieldFuncPage, ListModifyButtonHdl, weld::Button &, rControl, void)
Definition: fldfunc.cxx:394
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: fldfunc.cxx:510
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
virtual OUString GetPar1() const
Definition: fldbas.cxx:302
SwFieldMgr & GetFieldMgr()
Definition: fldpage.hxx:81
void SetMacroPath(const OUString &rPath)
Definition: fldmgr.cxx:1790
static SwFieldTypesEnum GetTypeId(sal_uInt16 nPos)
Definition: fldmgr.cxx:521
sal_uInt16 nEnd
Definition: fldmgr.hxx:64
std::unique_ptr< ConditionEdit > m_xCond1ED
Definition: fldfunc.hxx:45
void UpdateSubType()
Definition: fldfunc.cxx:467
virtual ~SwFieldFuncPage() override
Definition: fldfunc.cxx:84
int nCount
#define MAX_COMBINED_CHARACTERS
Definition: docufld.hxx:728
const OUString & GetSelectedItem() const
Returns the selected item.
const OUString & GetUserData() const
bool IsFieldDlgHtmlMode() const
Definition: fldpage.hxx:49
OUString m_sOldValueFT
Definition: fldfunc.hxx:29
std::unique_ptr< weld::TreeView > m_xListItemsLB
Definition: fldfunc.hxx:56
void FillFieldSelect(weld::TreeView &rListBox)
Definition: flddinf.cxx:45
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
Definition: dialoghelp.cxx:20
virtual void Reset(const SfxItemSet *rSet) override
Definition: fldfunc.cxx:88
void EnableInsert(bool bEnable)
Definition: fldpage.cxx:316
const OUString & GetMacroPath() const
Definition: fldmgr.hxx:145
int i
void SavePos(const weld::TreeView &rLst1)
Definition: fldpage.cxx:274
SwFieldFuncPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *pSet)
Definition: fldfunc.cxx:35
#define USER_DATA_VERSION_1
Definition: fldfunc.cxx:30
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: fldfunc.cxx:573
SwFieldTypesEnum
List of FieldTypes at UI.
Definition: fldbas.hxx:93
void Init()
Definition: fldpage.cxx:63
bool IsRefresh() const
Definition: fldpage.hxx:50
#define USER_DATA_VERSION
Definition: fldfunc.cxx:31
std::unique_ptr< ConditionEdit > m_xNameED
Definition: fldfunc.hxx:40
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:115
std::unique_ptr< weld::Entry > m_xListNameED
Definition: fldfunc.hxx:61
sal_Int32 GetTypeSel() const
Definition: fldpage.hxx:45
std::unique_ptr< weld::TreeView > m_xFormatLB
Definition: fldfunc.hxx:38
SwField * GetCurField()
Definition: fldpage.hxx:51
OUString SwResId(const char *pId)
Definition: swmodule.cxx:165
#define DB_DELIM
Definition: swtypes.hxx:133
#define FIELD_COLUMN_WIDTH
Definition: fldpage.hxx:25
Dropdown field.
Definition: flddropdown.hxx:58
sal_uInt16 nStart
Definition: fldmgr.hxx:63
std::unique_ptr< ConditionEdit > m_xCond2ED
Definition: fldfunc.hxx:47
SwFieldTypesEnum GetTypeId() const
Definition: fldbas.cxx:238
std::unique_ptr< weld::Button > m_xMacroBT
Definition: fldfunc.hxx:48
virtual OUString GetPar2() const override
Returns the name of the field.
Definition: flddropdown.cxx:88
std::unique_ptr< weld::Entry > m_xListItemED
Definition: fldfunc.hxx:53
std::unique_ptr< weld::Entry > m_xValueED
Definition: fldfunc.hxx:43
OUString ChooseMacro(weld::Window *pParent, const css::uno::Reference< css::frame::XModel > &rxLimitToDocument, const css::uno::Reference< css::frame::XFrame > &xDocFrame, bool bChooseOnly)
std::unique_ptr< weld::TreeView > m_xSelectionLB
Definition: fldfunc.hxx:36
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:254
OUString GetSelText() const
get selected text of a node at current cursor
Definition: crsrsh.cxx:2526
OUString aName
std::unique_ptr< weld::Widget > m_xValueGroup
Definition: fldfunc.hxx:41
OUString m_sOldNameFT
Definition: fldfunc.hxx:30
sal_Int32 getToken(const Context &rContext, const char *pToken)
std::unique_ptr< weld::Button > m_xListAddPB
Definition: fldfunc.hxx:54
static OUString GetTypeStr(sal_uInt16 nPos)
Definition: fldmgr.cxx:527
bool IsFieldEdit() const
Definition: fldpage.hxx:62
bool bDropDownLBChanged
Definition: fldfunc.hxx:33
static const SwFieldGroupRgn & GetGroupRange(bool bHtmlMode, sal_uInt16 nGrpId)
Definition: fldmgr.cxx:465
std::unique_ptr< weld::Button > m_xListUpPB
Definition: fldfunc.hxx:58
virtual void FillUserData() override
Definition: fldfunc.cxx:584
css::uno::Sequence< OUString > GetItemSequence() const
Returns the items of the dropdown box.
void GetSubTypes(SwFieldTypesEnum nId, std::vector< OUString > &rToFill)
Definition: fldmgr.cxx:568