LibreOffice Module sw (master) 1
flddok.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 <flddat.hxx>
21#include <docufld.hxx>
22#include <strings.hrc>
23#include <chpfld.hxx>
24#include "flddok.hxx"
25#include <swmodule.hxx>
26#include <wrtsh.hxx>
27#include <svl/numformat.hxx>
28#include <svl/zformat.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
35 : SwFieldPage(pPage, pController, "modules/swriter/ui/flddocumentpage.ui",
36 "FieldDocumentPage", pCoreSet)
37 , m_nOldSel(0)
38 , m_nOldFormat(0)
39 , m_xTypeLB(m_xBuilder->weld_tree_view("type"))
40 , m_xSelection(m_xBuilder->weld_widget("selectframe"))
41 , m_xSelectionLB(m_xBuilder->weld_tree_view("select"))
42 , m_xValueFT(m_xBuilder->weld_label("valueft"))
43 , m_xValueED(m_xBuilder->weld_entry("value"))
44 , m_xLevelFT(m_xBuilder->weld_label("levelft"))
45 , m_xLevelED(m_xBuilder->weld_spin_button("level"))
46 , m_xDateFT(m_xBuilder->weld_label("daysft"))
47 , m_xTimeFT(m_xBuilder->weld_label("minutesft"))
48 , m_xDateOffsetED(m_xBuilder->weld_spin_button("offset"))
49 , m_xFormat(m_xBuilder->weld_widget("formatframe"))
50 , m_xFormatLB(m_xBuilder->weld_tree_view("format"))
51 , m_xNumFormatLB(new SwNumFormatTreeView(m_xBuilder->weld_tree_view("numformat")))
52 , m_xFixedCB(m_xBuilder->weld_check_button("fixed"))
53{
54 m_xTypeLB->make_sorted();
55 m_xFormatLB->make_sorted();
56
57 auto nWidth = m_xTypeLB->get_approximate_digit_width() * FIELD_COLUMN_WIDTH;
58 auto nHeight = m_xTypeLB->get_height_rows(10);
59
60 m_xTypeLB->set_size_request(nWidth, nHeight);
61 m_xSelectionLB->set_size_request(nWidth, nHeight);
62 m_xFormatLB->set_size_request(nWidth * 2, nHeight);
63
64 m_xSelectionLB->connect_row_activated(LINK(this, SwFieldDokPage, TreeViewInsertHdl));
65 m_xFormatLB->connect_row_activated(LINK(this, SwFieldDokPage, TreeViewInsertHdl));
66 m_xNumFormatLB->connect_row_activated(LINK(this, SwFieldDokPage, NumFormatHdl));
67
68 m_xLevelED->set_max(MAXLEVEL);
69 m_xDateOffsetED->set_range(INT_MIN, INT_MAX);
70 //enable 'active' language selection
71 m_xNumFormatLB->SetShowLanguageControl(true);
72
73 // uitests
74 m_xTypeLB->set_buildable_name(m_xTypeLB->get_buildable_name() + "-doc");
75 m_xValueED->set_buildable_name(m_xValueED->get_buildable_name() + "-doc");
76 m_xNumFormatLB->set_buildable_name(m_xNumFormatLB->get_buildable_name() + "-doc");
77 m_xSelectionLB->set_buildable_name(m_xSelectionLB->get_buildable_name() + "-doc");
78 m_xFormatLB->set_buildable_name(m_xFormatLB->get_buildable_name() + "-doc");
79}
80
82{
83}
84
86{
88 Init(); // general initialisation
89
90 // initialise TypeListBox
92
93 m_xTypeLB->freeze();
94 m_xTypeLB->clear();
95
96 if (!IsFieldEdit())
97 {
98 bool bPage = false;
99 // fill Type-Listbox
100 for(sal_uInt16 i = rRg.nStart; i < rRg.nEnd; ++i)
101 {
103
104 switch (nTypeId)
105 {
109 if (!bPage)
110 {
111 m_xTypeLB->append(OUString::number(USHRT_MAX), SwResId(FMT_REF_PAGE));
112 bPage = true;
113 }
114 break;
115
116 default:
117 m_xTypeLB->append(OUString::number(static_cast<sal_uInt16>(nTypeId)), SwFieldMgr::GetTypeStr(i));
118 break;
119 }
120 }
121 }
122 else
123 {
124 const SwField* pCurField = GetCurField();
125 SwFieldTypesEnum nTypeId = pCurField->GetTypeId();
126 if (nTypeId == SwFieldTypesEnum::FixedDate)
127 nTypeId = SwFieldTypesEnum::Date;
128 if (nTypeId == SwFieldTypesEnum::FixedTime)
129 nTypeId = SwFieldTypesEnum::Time;
130 m_xTypeLB->append(OUString::number(static_cast<sal_uInt16>(nTypeId)), SwFieldMgr::GetTypeStr(SwFieldMgr::GetPos(nTypeId)));
131 m_xNumFormatLB->SetAutomaticLanguage(pCurField->IsAutomaticLanguage());
132 SwWrtShell *pSh = GetWrtShell();
133 if(!pSh)
134 pSh = ::GetActiveWrtShell();
135 if(pSh)
136 {
137 const SvNumberformat* pFormat = pSh->GetNumberFormatter()->GetEntry(pCurField->GetFormat());
138 if(pFormat)
139 m_xNumFormatLB->SetLanguage(pFormat->GetLanguage());
140 }
141 }
142
143
144 m_xTypeLB->thaw();
145
146 // select old Pos
148
149 m_xTypeLB->connect_row_activated(LINK(this, SwFieldDokPage, TreeViewInsertHdl));
150 m_xTypeLB->connect_changed(LINK(this, SwFieldDokPage, TypeHdl));
151 m_xFormatLB->connect_changed(LINK(this, SwFieldDokPage, FormatHdl));
152
153 if( !IsRefresh() )
154 {
155 const OUString sUserData = GetUserData();
156 sal_Int32 nIdx{ 0 };
157 if (o3tl::equalsIgnoreAsciiCase(o3tl::getToken(sUserData, 0, ';', nIdx), u"" USER_DATA_VERSION_1))
158 {
159 const sal_uInt16 nVal = static_cast< sal_uInt16 >(o3tl::toInt32(o3tl::getToken(sUserData, 0, ';', nIdx)));
160 if(nVal != USHRT_MAX)
161 {
162 for (int i = 0, nEntryCount = m_xTypeLB->n_children(); i < nEntryCount; i++)
163 {
164 if (nVal == m_xTypeLB->get_id(i).toUInt32())
165 {
166 m_xTypeLB->select(i);
167 break;
168 }
169 }
170 }
171 }
172 }
173 TypeHdl(*m_xTypeLB);
174
175 if (IsFieldEdit())
176 {
177 m_nOldSel = m_xSelectionLB->get_selected_index();
179 m_xFixedCB->save_state();
180 m_xValueED->save_value();
181 m_xLevelED->save_value();
182 m_xDateOffsetED->save_value();
183 }
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 size_t nCount;
204
205 m_xDateFT->hide();
206 m_xTimeFT->hide();
207
208 SwFieldTypesEnum nTypeId = static_cast<SwFieldTypesEnum>(m_xTypeLB->get_id(GetTypeSel()).toUInt32());
209
210 // fill Selection-Listbox
211 m_xSelectionLB->clear();
212
213 if (nTypeId != SwFieldTypesEnum::Unknown)
214 {
215 std::vector<OUString> aLst;
216 GetFieldMgr().GetSubTypes(nTypeId, aLst);
217
218 if (nTypeId != SwFieldTypesEnum::Author)
219 nCount = aLst.size();
220 else
221 nCount = GetFieldMgr().GetFormatCount(nTypeId, IsFieldDlgHtmlMode());
222
223 for (size_t i = 0; i < nCount; ++i)
224 {
225 if (!IsFieldEdit())
226 {
227 OUString sId(OUString::number(i));
228 if (nTypeId != SwFieldTypesEnum::Author)
229 m_xSelectionLB->append(sId, aLst[i]);
230 else
231 m_xSelectionLB->append(sId, GetFieldMgr().GetFormatStr(nTypeId, i));
232 }
233 else
234 {
235 bool bInsert = false;
236
237 OUString sId(OUString::number(i));
238
239 switch (nTypeId)
240 {
243 m_xSelectionLB->append(sId, aLst[i]);
244 if (static_cast<SwDateTimeField*>(GetCurField())->IsFixed() && i)
245 m_xSelectionLB->select_id(sId);
246 if (!static_cast<SwDateTimeField*>(GetCurField())->IsFixed() && !i)
247 m_xSelectionLB->select_id(sId);
248 break;
251 m_xSelectionLB->append(sId, aLst[i]);
252 if (GetCurField()->GetSubType() == i)
253 m_xSelectionLB->select_id(sId);
254 break;
255
257 {
258 const OUString sFormat(GetFieldMgr().GetFormatStr(nTypeId, i));
259 m_xSelectionLB->append(sId, sFormat);
260 m_xSelectionLB->select_text(GetFieldMgr().GetFormatStr(nTypeId, GetCurField()->GetFormat()));
261 break;
262 }
263
264 default:
265 if (aLst[i] == GetCurField()->GetPar1())
266 bInsert = true;
267 break;
268 }
269 if (bInsert)
270 {
271 m_xSelectionLB->append(sId, aLst[i]);
272 break;
273 }
274 }
275 }
276 m_xSelectionLB->connect_changed(Link<weld::TreeView&,void>());
277 }
278 else
279 {
282 AddSubType(SwFieldTypesEnum::NextPage);
283 nTypeId = static_cast<SwFieldTypesEnum>(m_xSelectionLB->get_id(0).toUInt32());
284 nCount = 3;
285 m_xSelectionLB->connect_changed(LINK(this, SwFieldDokPage, SubTypeHdl));
286 }
287
288 bool bEnable = nCount != 0;
289
290 if (bEnable && m_xSelectionLB->get_selected_index() == -1)
291 m_xSelectionLB->select(0);
292
293 m_xSelection->set_sensitive( bEnable );
294
295 // fill Format-Listbox
296 sal_Int32 nSize = FillFormatLB(nTypeId);
297
298 bool bValue = false, bLevel = false, bNumFormat = false, bOffset = false;
299 bool bFormat = nSize != 0;
300 bool bOneArea = false;
301 bool bFixed = false;
302 SvNumFormatType nFormatType = SvNumFormatType::ALL;
303
304 switch (nTypeId)
305 {
307 bFormat = bNumFormat = bOneArea = bOffset = true;
308
309 nFormatType = SvNumFormatType::DATE;
310
311 m_xDateFT->show();
312
313 m_xDateOffsetED->set_range(INT_MIN, INT_MAX); // no limit
314
315 if (IsFieldEdit())
316 m_xDateOffsetED->set_value( static_cast<SwDateTimeField*>(GetCurField())->GetOffset() / 24 / 60);
317 break;
318
320 bFormat = bNumFormat = bOneArea = bOffset = true;
321
322 nFormatType = SvNumFormatType::TIME;
323
324 m_xTimeFT->show();
325
326 m_xDateOffsetED->set_range(-1440, 1440); // one day
327
328 if (IsFieldEdit())
329 m_xDateOffsetED->set_value( static_cast<SwDateTimeField*>(GetCurField())->GetOffset() );
330 break;
331
334 if (IsFieldEdit())
335 {
336 const sal_uInt16 nTmp = m_xFormatLB->get_selected_id().toUInt32();
337
338 if(SVX_NUM_CHAR_SPECIAL != nTmp)
339 {
340 sal_Int32 nOff = GetCurField()->GetPar2().toInt32();
341 if( SwFieldTypesEnum::NextPage == nTypeId && 1 != nOff )
342 m_xValueED->set_text(
343 OUString::number(nOff - 1) );
344 else if( SwFieldTypesEnum::PreviousPage == nTypeId && -1 != nOff )
345 m_xValueED->set_text(
346 OUString::number(nOff + 1) );
347 else
348 m_xValueED->set_text(OUString());
349 }
350 else
351 m_xValueED->set_text(static_cast<SwPageNumberField*>(GetCurField())->GetUserString());
352 }
353 bValue = true;
354 break;
355
357 m_xValueFT->set_label(SwResId(STR_LEVEL));
358 if (IsFieldEdit())
359 m_xLevelED->set_text(OUString::number(static_cast<SwChapterField*>(GetCurField())->GetLevel(GetWrtShell()->GetLayout()) + 1));
360 bLevel = true;
361 break;
362
364 m_xValueFT->set_label( SwResId( STR_OFFSET ));
365 if (IsFieldEdit())
366 m_xValueED->set_text(GetCurField()->GetPar2());
367 bValue = true;
368 break;
369
373 bFixed = true;
374 break;
375
376 default:
377 break;
378 }
379
380 if (bNumFormat)
381 {
382 if (IsFieldEdit())
383 {
384 m_xNumFormatLB->SetDefFormat(GetCurField()->GetFormat());
385
386 if (m_xNumFormatLB->GetFormatType() == (SvNumFormatType::DATE|SvNumFormatType::TIME))
387 {
388 // always set Format-Type because otherwise when date/time formats are combined,
389 // both formats would be displayed at the same time
390 m_xNumFormatLB->SetFormatType(SvNumFormatType::ALL);
391 m_xNumFormatLB->SetFormatType(nFormatType);
392 // set correct format once again
393 m_xNumFormatLB->SetDefFormat(GetCurField()->GetFormat());
394 }
395 }
396 else
397 m_xNumFormatLB->SetFormatType(nFormatType);
398
399 m_xNumFormatLB->SetOneArea(bOneArea);
400 }
401
402 m_xFormatLB->set_visible(!bNumFormat);
403 m_xNumFormatLB->set_visible(bNumFormat);
404
405 m_xValueFT->set_visible(bValue);
406 m_xValueED->set_visible(bValue);
407 m_xLevelFT->set_visible(bLevel);
408 m_xLevelED->set_visible(bLevel);
409 m_xDateOffsetED->set_visible(bOffset);
410 m_xFixedCB->set_visible(!bValue && !bLevel && !bOffset);
411
412 m_xFormat->set_sensitive(bFormat);
413 m_xFixedCB->set_sensitive(bFixed);
414
415 if (IsFieldEdit())
416 m_xFixedCB->set_active((GetCurField()->GetFormat() & AF_FIXED) != 0 && bFixed);
417
418 if (m_xNumFormatLB->get_selected_index() == -1)
419 m_xNumFormatLB->select(0);
420 m_xValueFT->set_sensitive(bValue || bLevel || bOffset);
421 m_xValueED->set_sensitive(bValue);
422}
423
425{
426 m_xSelectionLB->append(OUString::number(static_cast<sal_uInt16>(nTypeId)), SwFieldType::GetTypeStr(nTypeId));
427}
428
430{
431 sal_Int32 nPos = m_xSelectionLB->get_selected_index();
432 if(nPos == -1)
433 nPos = 0;
434
435 const SwFieldTypesEnum nTypeId = static_cast<SwFieldTypesEnum>(m_xSelectionLB->get_id(nPos).toUInt32());
436 FillFormatLB(nTypeId);
437
438 TranslateId pTextRes;
439 switch (nTypeId)
440 {
442 pTextRes = STR_LEVEL;
443 break;
444
447 pTextRes = SVX_NUM_CHAR_SPECIAL == m_xFormatLB->get_selected_id().toUInt32()
448 ? STR_VALUE : STR_OFFSET;
449 break;
450
452 pTextRes = STR_OFFSET;
453 break;
454 default: break;
455 }
456
457 if (pTextRes)
458 m_xValueFT->set_label(SwResId(pTextRes));
459}
460
462{
463 // fill Format-Listbox
464 m_xFormatLB->clear();
465
466 if (nTypeId == SwFieldTypesEnum::Author)
467 return m_xFormatLB->n_children();
468
469 const sal_uInt16 nSize = GetFieldMgr().GetFormatCount(nTypeId, IsFieldDlgHtmlMode());
470
471 for( sal_uInt16 i = 0; i < nSize; ++i )
472 {
473 const sal_uInt16 nFormatId = GetFieldMgr().GetFormatId( nTypeId, i );
474 OUString sId(OUString::number(nFormatId));
475 m_xFormatLB->append(sId, GetFieldMgr().GetFormatStr(nTypeId, i));
476 }
477
478 if (IsFieldEdit())
479 {
480 m_xFormatLB->select_id(OUString::number(GetCurField()->GetFormat() & ~AF_FIXED));
481 }
482 else
483 {
484 // Select default selected value for "Insert" dialog
485 switch (nTypeId)
486 {
489 m_xFormatLB->select_text(SwResId(FMT_NUM_PAGEDESC));
490 break;
491 default:
492 m_xFormatLB->select(0);
493 }
494 }
495
496 FormatHdl(*m_xFormatLB);
497
498 return nSize;
499}
500
502{
503 SwFieldTypesEnum nTypeId = static_cast<SwFieldTypesEnum>(m_xTypeLB->get_id(GetTypeSel()).toUInt32());
504
505 if (nTypeId == SwFieldTypesEnum::Unknown)
506 {
507 sal_Int32 nPos = m_xSelectionLB->get_selected_index();
508 if(nPos == -1)
509 nPos = 0;
510
511 nTypeId = static_cast<SwFieldTypesEnum>(m_xSelectionLB->get_id(nPos).toUInt32());
512 }
513
515 return;
516
517 // Prev/Next - PageNumFields special treatment:
518 sal_uInt16 nTmp = m_xFormatLB->get_selected_id().toUInt32();
519 const OUString sOldText( m_xValueFT->get_label() );
520 const OUString sNewText( SwResId( SVX_NUM_CHAR_SPECIAL == nTmp ? STR_VALUE
521 : STR_OFFSET ));
522
523 if (sOldText != sNewText)
524 m_xValueFT->set_label(sNewText);
525
526 if (sOldText != m_xValueFT->get_label())
527 m_xValueED->set_text(OUString());
528}
529
531{
532 SwFieldTypesEnum nTypeId = static_cast<SwFieldTypesEnum>(m_xTypeLB->get_id(GetTypeSel()).toUInt32());
533
534 if (nTypeId == SwFieldTypesEnum::Unknown)
535 {
536 sal_Int32 nPos = m_xSelectionLB->get_selected_index();
537 if(nPos == -1)
538 nPos = 0;
539 nTypeId = static_cast<SwFieldTypesEnum>(m_xSelectionLB->get_id(nPos).toUInt32());
540 }
541
542 OUString aVal(m_xValueED->get_text());
543 sal_uInt32 nFormat = 0;
544 sal_uInt16 nSubType = 0;
545
546 if (m_xFormatLB->get_sensitive())
547 {
548 sal_Int32 nPos = m_xFormatLB->get_selected_index();
549 if(nPos != -1)
550 nFormat = m_xFormatLB->get_id(nPos).toUInt32();
551 }
552
553 if (m_xSelectionLB->get_sensitive())
554 {
555 sal_Int32 nPos = m_xSelectionLB->get_selected_index();
556 if(nPos != -1)
557 nSubType = m_xSelectionLB->get_id(nPos).toUInt32();
558 }
559
560 switch (nTypeId)
561 {
563 nFormat = nSubType;
564 nSubType = 0;
565 [[fallthrough]];
567 nFormat |= m_xFixedCB->get_active() ? AF_FIXED : 0;
568 break;
569
571 nFormat |= m_xFixedCB->get_active() ? FF_FIXED : 0;
572 break;
573
576 {
577 nFormat = m_xNumFormatLB->GetFormat();
578 tools::Long nVal = static_cast< tools::Long >(m_xDateOffsetED->get_value());
579 if (nTypeId == SwFieldTypesEnum::Date)
580 aVal = OUString::number(nVal * 60 * 24);
581 else
582 aVal = OUString::number(nVal);
583 break;
584 }
585
590 {
591 if( SVX_NUM_CHAR_SPECIAL != nFormat &&
593 {
594 sal_Int32 nVal = m_xValueED->get_text().toInt32();
595 aVal = OUString::number(nVal);
596 }
597 break;
598 }
599
601 aVal = m_xLevelED->get_text();
602 break;
603
604 default:
605 break;
606 }
607
608 if (!IsFieldEdit() ||
609 m_nOldSel != m_xSelectionLB->get_selected_index() ||
610 m_nOldFormat != nFormat ||
611 m_xFixedCB->get_state_changed_from_saved() ||
612 m_xValueED->get_value_changed_from_saved() ||
613 m_xLevelED->get_value_changed_from_saved() ||
614 m_xDateOffsetED->get_value_changed_from_saved())
615 {
616 InsertField(nTypeId, nSubType, OUString(), aVal, nFormat, ' ', m_xNumFormatLB->IsAutomaticLanguage());
617 }
618
619 return false;
620}
621
622std::unique_ptr<SfxTabPage> SwFieldDokPage::Create(weld::Container* pPage, weld::DialogController* pController,
623 const SfxItemSet *const pAttrSet)
624{
625 return std::make_unique<SwFieldDokPage>(pPage, pController, pAttrSet);
626}
627
629{
630 return GRP_DOC;
631}
632
634{
635 const sal_Int32 nEntryPos = m_xTypeLB->get_selected_index();
636 const sal_uInt16 nTypeSel = ( -1 == nEntryPos )
637 ? USHRT_MAX : m_xTypeLB->get_id(nEntryPos).toUInt32();
638 SetUserData(USER_DATA_VERSION ";" + OUString::number( nTypeSel ));
639}
640
641/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetUserData(const OUString &rString)
const OUString & GetUserData() const
const SvNumberformat * GetEntry(sal_uInt32 nKey) const
LanguageType GetLanguage() const
SvNumberFormatter * GetNumberFormatter()
Query NumberFormatter from document.
Definition: editsh.cxx:756
std::unique_ptr< weld::TreeView > m_xSelectionLB
Definition: flddok.hxx:34
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: flddok.cxx:530
void AddSubType(SwFieldTypesEnum nTypeId)
Definition: flddok.cxx:424
std::unique_ptr< weld::TreeView > m_xFormatLB
Definition: flddok.hxx:43
std::unique_ptr< weld::Entry > m_xValueED
Definition: flddok.hxx:36
std::unique_ptr< weld::CheckButton > m_xFixedCB
Definition: flddok.hxx:45
sal_uInt32 m_nOldFormat
Definition: flddok.hxx:30
std::unique_ptr< weld::SpinButton > m_xLevelED
Definition: flddok.hxx:38
virtual void Reset(const SfxItemSet *rSet) override
Definition: flddok.cxx:85
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: flddok.cxx:622
std::unique_ptr< weld::SpinButton > m_xDateOffsetED
Definition: flddok.hxx:41
sal_Int32 FillFormatLB(SwFieldTypesEnum nTypeId)
Definition: flddok.cxx:461
sal_Int32 m_nOldSel
Definition: flddok.hxx:29
virtual sal_uInt16 GetGroup() override
Definition: flddok.cxx:628
SwFieldDokPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *pSet)
Definition: flddok.cxx:34
virtual void FillUserData() override
Definition: flddok.cxx:633
virtual ~SwFieldDokPage() override
Definition: flddok.cxx:81
std::unique_ptr< SwNumFormatTreeView > m_xNumFormatLB
Definition: flddok.hxx:44
std::unique_ptr< weld::TreeView > m_xTypeLB
Definition: flddok.hxx:32
static const SwFieldGroupRgn & GetGroupRange(bool bHtmlMode, sal_uInt16 nGrpId)
Definition: fldmgr.cxx:470
sal_uInt16 GetFormatCount(SwFieldTypesEnum nTypeId, bool bHtmlMode) const
Definition: fldmgr.cxx:676
sal_uInt16 GetFormatId(SwFieldTypesEnum nTypeId, sal_uInt32 nFormatId) const
Definition: fldmgr.cxx:773
static const OUString & GetTypeStr(sal_uInt16 nPos)
Definition: fldmgr.cxx:532
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
bool IsRefresh() const
Definition: fldpage.hxx:50
SwField * GetCurField()
Definition: fldpage.hxx:51
SwWrtShell * GetWrtShell()
Definition: fldpage.hxx:52
static const OUString & GetTypeStr(SwFieldTypesEnum nTypeId)
Definition: fldbas.cxx:124
Base class of all fields.
Definition: fldbas.hxx:296
SwFieldTypesEnum GetTypeId() const
Definition: fldbas.cxx:270
bool IsAutomaticLanguage() const
Definition: fldbas.hxx:387
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
virtual SotClipboardFormatId GetFormat(const TransferableDataHelper &aHelper) override
@ AF_FIXED
Definition: docufld.hxx:47
float u
SwFieldTypesEnum
List of FieldTypes at UI.
Definition: fldbas.hxx:98
@ FF_FIXED
Definition: fldbas.hxx:166
#define USER_DATA_VERSION_1
Definition: flddok.cxx:31
#define USER_DATA_VERSION
Definition: flddok.cxx:32
IMPL_LINK_NOARG(SwFieldDokPage, TypeHdl, weld::TreeView &, void)
Definition: flddok.cxx:186
@ GRP_DOC
Definition: fldmgr.hxx:54
#define FIELD_COLUMN_WIDTH
Definition: fldpage.hxx:25
sal_uInt16 nPos
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)
long Long
sal_uInt16 nStart
Definition: fldmgr.hxx:64
sal_uInt16 nEnd
Definition: fldmgr.hxx:65
SVX_NUM_CHAR_SPECIAL
SwWrtShell * GetActiveWrtShell()
Definition: swmodul1.cxx:108
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:168
constexpr sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:92
OUString sId
SvNumFormatType