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