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