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  const OUString* pArray = aItems.getConstArray();
262  m_xListItemsLB->clear();
263  for (sal_Int32 i = 0; i < aItems.getLength(); i++)
264  m_xListItemsLB->append_text(pArray[i]);
265  m_xListItemsLB->select_text(pDrop->GetSelectedItem());
266  m_xListNameED->set_text(pDrop->GetPar2());
267  m_xListNameED->save_value();
268  bDropDownLBChanged = false;
269  }
270  else
271  {
272  m_xNameED->set_text(GetCurField()->GetPar1());
273  m_xValueED->set_text(GetCurField()->GetPar2());
274  }
275  }
276  else
277  {
278  m_xNameED->set_text(OUString());
279  m_xValueED->set_text(OUString());
280  }
281  if(bDropDown)
282  ListEnableHdl(*m_xListItemED);
283 
284  if (m_xNameFT->get_label() != m_sOldNameFT)
285  m_xNameFT->set_label(m_sOldNameFT);
286  if (m_xValueFT->get_label() != m_sOldValueFT)
287  m_xValueFT->set_label(m_sOldValueFT);
288 
289  switch (nTypeId)
290  {
291  case TYP_MACROFLD:
292  bMacro = true;
293  if (!GetFieldMgr().GetMacroPath().isEmpty())
294  bValue = true;
295  else
296  bInsert = false;
297 
298  m_xNameFT->set_label(SwResId(STR_MACNAME));
299  m_xValueFT->set_label(SwResId(STR_PROMPT));
300  m_xNameED->set_text(GetFieldMgr().GetMacroName());
301  m_xNameED->set_accessible_name(m_xNameFT->get_label());
302  m_xValueED->set_accessible_name(m_xValueFT->get_label());
303  break;
304 
305  case TYP_HIDDENPARAFLD:
306  m_xNameFT->set_label(SwResId(STR_COND));
307  m_xNameED->SetDropEnable(true);
308  bName = true;
309  m_xNameED->set_accessible_name(m_xNameFT->get_label());
310  m_xValueED->set_accessible_name(m_xValueFT->get_label());
311  break;
312 
313  case TYP_HIDDENTXTFLD:
314  {
315  m_xNameFT->set_label(SwResId(STR_COND));
316  m_xNameED->SetDropEnable(true);
317  m_xValueFT->set_label(SwResId(STR_INSTEXT));
318  SwWrtShell* pSh = GetActiveWrtShell();
319  if (!IsFieldEdit() && pSh )
320  m_xValueED->set_text(pSh->GetSelText());
321  bName = bValue = true;
322  m_xNameED->set_accessible_name(m_xNameFT->get_label());
323  m_xValueED->set_accessible_name(m_xValueFT->get_label());
324  }
325  break;
326 
327  case TYP_CONDTXTFLD:
328  m_xNameFT->set_label(SwResId(STR_COND));
329  m_xNameED->SetDropEnable(true);
330  if (IsFieldEdit())
331  {
332  sal_Int32 nIdx{ 0 };
333  m_xCond1ED->set_text(GetCurField()->GetPar2().getToken(0, '|', nIdx));
334  m_xCond2ED->set_text(GetCurField()->GetPar2().getToken(0, '|', nIdx));
335  }
336 
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 
342  case TYP_JUMPEDITFLD:
343  m_xNameFT->set_label(SwResId(STR_JUMPEDITFLD));
344  m_xValueFT->set_label(SwResId(STR_PROMPT));
345  bName = bValue = true;
346  m_xNameED->set_accessible_name(m_xNameFT->get_label());
347  m_xValueED->set_accessible_name(m_xValueFT->get_label());
348  break;
349 
350  case TYP_INPUTFLD:
351  m_xValueFT->set_label(SwResId(STR_PROMPT));
352  bValue = true;
353  m_xNameED->set_accessible_name(m_xNameFT->get_label());
354  m_xValueED->set_accessible_name(m_xValueFT->get_label());
355  break;
356 
357  case TYP_COMBINED_CHARS:
358  {
359  m_xNameFT->set_label(SwResId(STR_COMBCHRS_FT));
360  m_xNameED->SetDropEnable(true);
361  bName = true;
362 
363  const sal_Int32 nLen = m_xNameED->get_text().getLength();
364  if( !nLen || nLen > MAX_COMBINED_CHARACTERS )
365  bInsert = false;
366  m_xNameED->set_accessible_name(m_xNameFT->get_label());
367  m_xValueED->set_accessible_name(m_xValueFT->get_label());
368  }
369  break;
370  case TYP_DROPDOWN :
371  break;
372  default:
373  break;
374  }
375 
376  m_xSelectionLB->hide();
377 
378  m_xFormat->set_sensitive(bFormat);
379  m_xNameFT->set_sensitive(bName);
380  m_xNameED->set_sensitive(bName);
381  m_xValueGroup->set_sensitive(bValue);
382  m_xMacroBT->set_sensitive(bMacro);
383 
384  EnableInsert( bInsert );
385 }
386 
388 {
389  const sal_uInt16 nTypeId = m_xTypeLB->get_id(GetTypeSel()).toUInt32();
390 
391  if( TYP_MACROFLD == nTypeId )
392  m_xNameED->set_text( m_xSelectionLB->get_selected_text() );
393 }
394 
396 {
397  SelectHdl(*m_xSelectionLB);
398  InsertHdl(nullptr);
399 }
400 
401 IMPL_LINK(SwFieldFuncPage, ListModifyButtonHdl, weld::Button&, rControl, void)
402 {
403  ListModifyHdl(&rControl);
404 }
405 
406 IMPL_LINK(SwFieldFuncPage, ListModifyReturnActionHdl, weld::Entry&, rControl, bool)
407 {
408  ListModifyHdl(&rControl);
409  return true;
410 }
411 
413 {
414  if (pControl == m_xListAddPB.get() ||
415  (pControl == m_xListItemED.get() && m_xListAddPB->get_sensitive()))
416  {
417  const OUString sEntry(m_xListItemED->get_text());
418  m_xListItemsLB->append_text(sEntry);
419  m_xListItemsLB->select_text(sEntry);
420  }
421  else if (m_xListItemsLB->get_selected_index() != -1)
422  {
423  sal_Int32 nSelPos = m_xListItemsLB->get_selected_index();
424  if (pControl == m_xListRemovePB.get())
425  {
426  m_xListItemsLB->remove(nSelPos);
427  m_xListItemsLB->select(nSelPos ? nSelPos - 1 : 0);
428  }
429  else if (pControl == m_xListUpPB.get())
430  {
431  if(nSelPos)
432  {
433  const OUString sEntry = m_xListItemsLB->get_selected_text();
434  m_xListItemsLB->remove(nSelPos);
435  nSelPos--;
436  m_xListItemsLB->insert_text(nSelPos, sEntry);
437  m_xListItemsLB->select(nSelPos);
438  }
439  }
440  else if (pControl == m_xListDownPB.get())
441  {
442  if( nSelPos < m_xListItemsLB->n_children() - 1)
443  {
444  const OUString sEntry = m_xListItemsLB->get_selected_text();
445  m_xListItemsLB->remove(nSelPos);
446  nSelPos++;
447  m_xListItemsLB->insert_text(nSelPos, sEntry);
448  m_xListItemsLB->select(nSelPos);
449  }
450  }
451  }
452  bDropDownLBChanged = true;
453  ListEnableHdl(*m_xListItemED);
454 }
455 
456 IMPL_LINK_NOARG(SwFieldFuncPage, ListEnableListBoxHdl, weld::TreeView&, void)
457 {
458  ListEnableHdl(*m_xListItemED);
459 }
460 
462 {
463  //enable "Add" button when text is in the Edit that's not already member of the box
464  m_xListAddPB->set_sensitive(!m_xListItemED->get_text().isEmpty() &&
465  -1 == m_xListItemsLB->find_text(m_xListItemED->get_text()));
466  bool bEnableButtons = m_xListItemsLB->get_selected_index() != -1;
467  m_xListRemovePB->set_sensitive(bEnableButtons);
468  m_xListUpPB->set_sensitive(bEnableButtons && (m_xListItemsLB->get_selected_index() > 0));
469  m_xListDownPB->set_sensitive(bEnableButtons &&
470  (m_xListItemsLB->get_selected_index() < (m_xListItemsLB->n_children() - 1)));
471 }
472 
473 // renew types in SelectionBox
475 {
476  const sal_uInt16 nTypeId = m_xTypeLB->get_id(GetTypeSel()).toUInt32();
477 
478  // fill Selection-Listbox
479  m_xSelectionLB->freeze();
480  m_xSelectionLB->clear();
481 
482  std::vector<OUString> aLst;
483  GetFieldMgr().GetSubTypes(nTypeId, aLst);
484  const size_t nCount = aLst.size();
485 
486  for (size_t i = 0; i < nCount; ++i)
487  m_xSelectionLB->append(OUString::number(i), aLst[i]);
488  m_xSelectionLB->thaw();
489 
490  bool bEnable = nCount != 0;
491 
492  m_xSelectionLB->set_sensitive( bEnable );
493 
494  if (bEnable)
495  m_xSelectionLB->select(0);
496 
497  if (nTypeId == TYP_MACROFLD)
498  {
499  const bool bHasMacro = !GetFieldMgr().GetMacroPath().isEmpty();
500 
501  if (bHasMacro)
502  {
503  m_xNameED->set_text(GetFieldMgr().GetMacroName());
504  m_xValueGroup->set_sensitive(true);
505  }
506  EnableInsert(bHasMacro);
507  }
508 }
509 
510 // call MacroBrowser, fill Listbox with Macros
512 {
513  if (GetFieldMgr().ChooseMacro(GetDialogFrameWeld()))
514  UpdateSubType();
515 }
516 
518 {
519  const sal_uInt16 nTypeId = m_xTypeLB->get_id(GetTypeSel()).toUInt32();
520 
521  sal_uInt16 nSubType = 0;
522 
523  const sal_Int32 nEntryPos = m_xFormatLB->get_selected_index();
524  const sal_uLong nFormat = (nEntryPos == -1)
525  ? 0 : m_xFormatLB->get_id(nEntryPos).toUInt32();
526 
527  OUString aVal(m_xValueED->get_text());
528  OUString aName(m_xNameED->get_text());
529 
530  switch(nTypeId)
531  {
532  case TYP_INPUTFLD:
533  nSubType = INP_TXT;
534  // to prevent removal of CR/LF restore old content
535  if (!m_xNameED->get_value_changed_from_saved() && IsFieldEdit())
536  aName = GetCurField()->GetPar1();
537 
538  break;
539 
540  case TYP_MACROFLD:
541  // use the full script URL, not the name in the Edit control
543  break;
544 
545  case TYP_CONDTXTFLD:
546  aVal = m_xCond1ED->get_text() + "|" + m_xCond2ED->get_text();
547  break;
548  case TYP_DROPDOWN :
549  {
550  aName = m_xListNameED->get_text();
551  for (sal_Int32 i = 0, nEntryCount = m_xListItemsLB->n_children(); i < nEntryCount; ++i)
552  {
553  if(i)
554  aVal += OUStringLiteral1(DB_DELIM);
555  aVal += m_xListItemsLB->get_text(i);
556  }
557  }
558  break;
559  default:
560  break;
561  }
562 
563  if (!IsFieldEdit() ||
564  m_xNameED->get_value_changed_from_saved() ||
565  m_xValueED->get_value_changed_from_saved() ||
566  m_xCond1ED->get_value_changed_from_saved() ||
567  m_xCond2ED->get_value_changed_from_saved() ||
568  m_xListNameED->get_value_changed_from_saved() ||
570  nOldFormat != nFormat)
571  {
572  InsertField( nTypeId, nSubType, aName, aVal, nFormat );
573  }
574 
575  ModifyHdl(m_xNameED->get_widget()); // enable/disable Insert if applicable
576 
577  return false;
578 }
579 
581  const SfxItemSet *const pAttrSet)
582 {
583  return VclPtr<SwFieldFuncPage>::Create( pParent, pAttrSet );
584 }
585 
587 {
588  return GRP_FKT;
589 }
590 
592 {
593  const sal_Int32 nEntryPos = m_xTypeLB->get_selected_index();
594  const sal_uInt16 nTypeSel = ( -1 == nEntryPos )
595  ? USHRT_MAX
596  : m_xTypeLB->get_id(nEntryPos).toUInt32();
597  SetUserData(USER_DATA_VERSION ";" + OUString::number( nTypeSel ));
598 }
599 
601 {
602  const sal_Int32 nLen = m_xNameED->get_text().getLength();
603 
604  bool bEnable = true;
605  sal_uInt16 nTypeId = m_xTypeLB->get_id(GetTypeSel()).toUInt32();
606 
607  if( TYP_COMBINED_CHARS == nTypeId &&
608  (!nLen || nLen > MAX_COMBINED_CHARACTERS ))
609  bEnable = false;
610 
611  EnableInsert( bEnable );
612 }
613 
614 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt16 const nStart
Definition: fldmgr.hxx:63
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:412
void SetUserData(const OUString &rString)
std::unique_ptr< weld::Button > m_xListDownPB
Definition: fldfunc.hxx:64
virtual sal_uInt16 GetGroup() override
Definition: fldfunc.cxx:586
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:401
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: fldfunc.cxx:517
Used by the UI to modify the document model.
Definition: wrtsh.hxx:86
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:1803
std::unique_ptr< ConditionEdit > m_xCond1ED
Definition: fldfunc.hxx:50
void UpdateSubType()
Definition: fldfunc.cxx:474
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:143
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:64
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:259
OUString GetSelText() const
get selected text of a node at current cursor
Definition: crsrsh.cxx:2429
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:580
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:591
css::uno::Sequence< OUString > GetItemSequence() const
Returns the items of the dropdown box.