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