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