LibreOffice Module sw (master)  1
docufld.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 <config_features.h>
21 #include <config_fuzzers.h>
22 
23 #include <textapi.hxx>
24 
25 #include <hintids.hxx>
26 #include <com/sun/star/frame/XModel.hpp>
27 #include <com/sun/star/text/XText.hpp>
28 #include <com/sun/star/script/Converter.hpp>
29 #include <com/sun/star/text/PlaceholderType.hpp>
30 #include <com/sun/star/text/TemplateDisplayFormat.hpp>
31 #include <com/sun/star/text/PageNumberType.hpp>
32 #include <com/sun/star/text/FilenameDisplayFormat.hpp>
33 #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
34 #include <com/sun/star/document/XDocumentProperties.hpp>
35 #include <com/sun/star/util/Date.hpp>
36 #include <com/sun/star/util/Duration.hpp>
37 #include <o3tl/any.hxx>
40 #include <comphelper/string.hxx>
41 #include <tools/urlobj.hxx>
42 #include <svl/numformat.hxx>
43 #include <svl/urihelper.hxx>
44 #include <unotools/useroptions.hxx>
45 #include <unotools/syslocale.hxx>
46 #include <svl/zforlist.hxx>
47 #include <libxml/xmlstring.h>
48 #include <libxml/xmlwriter.h>
49 
50 #include <tools/time.hxx>
51 #include <tools/datetime.hxx>
52 
53 #include <com/sun/star/util/DateTime.hpp>
54 
55 #include <swmodule.hxx>
56 #include <sfx2/docfile.hxx>
57 #include <sfx2/doctempl.hxx>
58 #include <fmtfld.hxx>
59 #include <txtfld.hxx>
60 #include <charfmt.hxx>
61 #include <docstat.hxx>
62 #include <pagedesc.hxx>
63 #include <fmtpdsc.hxx>
64 #include <doc.hxx>
66 #include <IDocumentStatistics.hxx>
69 #include <rootfrm.hxx>
70 #include <pagefrm.hxx>
71 #include <cntfrm.hxx>
72 #include <pam.hxx>
73 #include <viewsh.hxx>
74 #include <dbmgr.hxx>
75 #include <shellres.hxx>
76 #include <docufld.hxx>
77 #include <flddat.hxx>
78 #include <docfld.hxx>
79 #include <ndtxt.hxx>
80 #include <expfld.hxx>
81 #include <poolfmt.hxx>
82 #include <docsh.hxx>
83 #include <unofldmid.h>
84 #include <swunohelper.hxx>
85 #include <strings.hrc>
86 
87 #include <editeng/outlobj.hxx>
88 #include <calbck.hxx>
89 #include <hints.hxx>
90 
91 #define URL_DECODE INetURLObject::DecodeMechanism::Unambiguous
92 
93 using namespace ::com::sun::star;
94 using namespace ::com::sun::star::uno;
95 using namespace nsSwDocInfoSubType;
96 
99  m_nNumberingType( SVX_NUM_ARABIC ),
100  m_bVirtual( false )
101 {
102 }
103 
104 OUString SwPageNumberFieldType::Expand( SvxNumType nFormat, short nOff,
105  sal_uInt16 const nPageNumber, sal_uInt16 const nMaxPage,
106  const OUString& rUserStr, LanguageType nLang ) const
107 {
108  SvxNumType nTmpFormat = (SVX_NUM_PAGEDESC == nFormat) ? m_nNumberingType : nFormat;
109  int const nTmp = nPageNumber + nOff;
110 
111  if (0 > nTmp || SVX_NUM_NUMBER_NONE == nTmpFormat || (!m_bVirtual && nTmp > nMaxPage))
112  return OUString();
113 
114  if( SVX_NUM_CHAR_SPECIAL == nTmpFormat )
115  return rUserStr;
116 
117  return FormatNumber( nTmp, nTmpFormat, nLang );
118 }
119 
120 std::unique_ptr<SwFieldType> SwPageNumberFieldType::Copy() const
121 {
122  std::unique_ptr<SwPageNumberFieldType> pTmp(new SwPageNumberFieldType());
123 
124  pTmp->m_nNumberingType = m_nNumberingType;
125  pTmp->m_bVirtual = m_bVirtual;
126 
127  return pTmp;
128 }
129 
131  bool bVirt,
132  const SvxNumType* pNumFormat )
133 {
134  if( pNumFormat )
135  m_nNumberingType = *pNumFormat;
136 
137  m_bVirtual = false;
138  if (!(bVirt && pDoc))
139  return;
140 
141  // check the flag since the layout NEVER sets it back
142  const SfxItemPool &rPool = pDoc->GetAttrPool();
143  for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(RES_PAGEDESC))
144  {
145  auto pDesc = dynamic_cast<const SwFormatPageDesc*>(pItem);
146  if( pDesc && pDesc->GetNumOffset() && pDesc->GetDefinedIn() )
147  {
148  const SwContentNode* pNd = dynamic_cast<const SwContentNode*>( pDesc->GetDefinedIn() );
149  if( pNd )
150  {
152  // sw_redlinehide: not sure if this should happen only if
153  // it's the first node, because that's where RES_PAGEDESC
154  // is effective?
155  m_bVirtual = true;
156  }
157  else if( dynamic_cast< const SwFormat* >(pDesc->GetDefinedIn()) != nullptr)
158  {
159  SwAutoFormatGetDocNode aGetHt( &pDoc->GetNodes() );
160  m_bVirtual = !pDesc->GetDefinedIn()->GetInfo( aGetHt );
161  break;
162  }
163  }
164  }
165 }
166 
168  sal_uInt16 nSub, sal_uInt32 nFormat, short nOff,
169  sal_uInt16 const nPageNumber, sal_uInt16 const nMaxPage)
170  : SwField(pTyp, nFormat), m_nSubType(nSub), m_nOffset(nOff)
171  , m_nPageNumber(nPageNumber)
172  , m_nMaxPage(nMaxPage)
173 {
174 }
175 
176 void SwPageNumberField::ChangeExpansion(sal_uInt16 const nPageNumber,
177  sal_uInt16 const nMaxPage)
178 {
179  m_nPageNumber = nPageNumber;
180  m_nMaxPage = nMaxPage;
181 }
182 
183 OUString SwPageNumberField::ExpandImpl(SwRootFrame const*const) const
184 {
185  OUString sRet;
186  SwPageNumberFieldType* pFieldType = static_cast<SwPageNumberFieldType*>(GetTyp());
187 
188  if( PG_NEXT == m_nSubType && 1 != m_nOffset )
189  {
190  sRet = pFieldType->Expand(static_cast<SvxNumType>(GetFormat()), 1, m_nPageNumber, m_nMaxPage, m_sUserStr, GetLanguage());
191  if (!sRet.isEmpty())
192  {
193  sRet = pFieldType->Expand(static_cast<SvxNumType>(GetFormat()), m_nOffset, m_nPageNumber, m_nMaxPage, m_sUserStr, GetLanguage());
194  }
195  }
196  else if( PG_PREV == m_nSubType && -1 != m_nOffset )
197  {
198  sRet = pFieldType->Expand(static_cast<SvxNumType>(GetFormat()), -1, m_nPageNumber, m_nMaxPage, m_sUserStr, GetLanguage());
199  if (!sRet.isEmpty())
200  {
201  sRet = pFieldType->Expand(static_cast<SvxNumType>(GetFormat()), m_nOffset, m_nPageNumber, m_nMaxPage, m_sUserStr, GetLanguage());
202  }
203  }
204  else
205  sRet = pFieldType->Expand(static_cast<SvxNumType>(GetFormat()), m_nOffset, m_nPageNumber, m_nMaxPage, m_sUserStr, GetLanguage());
206  return sRet;
207 }
208 
209 std::unique_ptr<SwField> SwPageNumberField::Copy() const
210 {
211  std::unique_ptr<SwPageNumberField> pTmp(new SwPageNumberField(
212  static_cast<SwPageNumberFieldType*>(GetTyp()), m_nSubType,
214  pTmp->SetLanguage( GetLanguage() );
215  pTmp->SetUserString( m_sUserStr );
216  return std::unique_ptr<SwField>(pTmp.release());
217 }
218 
220 {
221  return OUString::number(m_nOffset);
222 }
223 
224 void SwPageNumberField::SetPar2(const OUString& rStr)
225 {
226  m_nOffset = static_cast<short>(rStr.toInt32());
227 }
228 
230 {
231  return m_nSubType;
232 }
233 
234 bool SwPageNumberField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
235 {
236  switch( nWhichId )
237  {
238  case FIELD_PROP_FORMAT:
239  rAny <<= static_cast<sal_Int16>(GetFormat());
240  break;
241  case FIELD_PROP_USHORT1:
242  rAny <<= m_nOffset;
243  break;
244  case FIELD_PROP_SUBTYPE:
245  {
246  text::PageNumberType eType;
247  eType = text::PageNumberType_CURRENT;
248  if(m_nSubType == PG_PREV)
249  eType = text::PageNumberType_PREV;
250  else if(m_nSubType == PG_NEXT)
251  eType = text::PageNumberType_NEXT;
252  rAny <<= eType;
253  }
254  break;
255  case FIELD_PROP_PAR1:
256  rAny <<= m_sUserStr;
257  break;
258 
259  default:
260  assert(false);
261  }
262  return true;
263 }
264 
265 bool SwPageNumberField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
266 {
267  bool bRet = true;
268  sal_Int16 nSet = 0;
269  switch( nWhichId )
270  {
271  case FIELD_PROP_FORMAT:
272  rAny >>= nSet;
273 
274  // TODO: where do the defines come from?
275  if(nSet <= SVX_NUM_PAGEDESC )
276  SetFormat(nSet);
277  break;
278  case FIELD_PROP_USHORT1:
279  rAny >>= nSet;
280  m_nOffset = nSet;
281  break;
282  case FIELD_PROP_SUBTYPE:
283  switch( static_cast<text::PageNumberType>(SWUnoHelper::GetEnumAsInt32( rAny )) )
284  {
285  case text::PageNumberType_CURRENT:
287  break;
288  case text::PageNumberType_PREV:
290  break;
291  case text::PageNumberType_NEXT:
293  break;
294  default:
295  bRet = false;
296  }
297  break;
298  case FIELD_PROP_PAR1:
299  rAny >>= m_sUserStr;
300  break;
301 
302  default:
303  assert(false);
304  }
305  return bRet;
306 }
307 
310 {
311 }
312 
314 {
315  SvtUserOptions& rOpt = SW_MOD()->GetUserOptions();
316  if((nFormat & 0xff) == AF_NAME)
317  return rOpt.GetFullName();
318 
319  return rOpt.GetID();
320 }
321 
322 std::unique_ptr<SwFieldType> SwAuthorFieldType::Copy() const
323 {
324  return std::make_unique<SwAuthorFieldType>();
325 }
326 
328  : SwField(pTyp, nFormat)
329 {
331 }
332 
333 OUString SwAuthorField::ExpandImpl(SwRootFrame const*const) const
334 {
335  if (!IsFixed())
336  const_cast<SwAuthorField*>(this)->m_aContent =
338 
339  return m_aContent;
340 }
341 
342 std::unique_ptr<SwField> SwAuthorField::Copy() const
343 {
344  std::unique_ptr<SwAuthorField> pTmp(new SwAuthorField( static_cast<SwAuthorFieldType*>(GetTyp()),
345  GetFormat()));
346  pTmp->SetExpansion(m_aContent);
347  return std::unique_ptr<SwField>(pTmp.release());
348 }
349 
350 bool SwAuthorField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
351 {
352  switch( nWhichId )
353  {
354  case FIELD_PROP_BOOL1:
355  rAny <<= (GetFormat() & 0xff) == AF_NAME;
356  break;
357 
358  case FIELD_PROP_BOOL2:
359  rAny <<= IsFixed();
360  break;
361 
362  case FIELD_PROP_PAR1:
363  rAny <<= m_aContent;
364  break;
365 
366  default:
367  assert(false);
368  }
369  return true;
370 }
371 
372 bool SwAuthorField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
373 {
374  switch( nWhichId )
375  {
376  case FIELD_PROP_BOOL1:
377  SetFormat( *o3tl::doAccess<bool>(rAny) ? AF_NAME : AF_SHORTCUT );
378  break;
379 
380  case FIELD_PROP_BOOL2:
381  if( *o3tl::doAccess<bool>(rAny) )
383  else
385  break;
386 
387  case FIELD_PROP_PAR1:
388  rAny >>= m_aContent;
389  break;
390 
391  default:
392  assert(false);
393  }
394  return true;
395 }
396 
399  , m_rDoc(rDocument)
400 {
401 }
402 
403 OUString SwFileNameFieldType::Expand(sal_uLong nFormat) const
404 {
405  OUString aRet;
406  const SwDocShell* pDShell = m_rDoc.GetDocShell();
407  if( pDShell && pDShell->HasName() )
408  {
409  const INetURLObject& rURLObj = pDShell->GetMedium()->GetURLObject();
410  switch( nFormat & ~FF_FIXED )
411  {
412  case FF_PATH:
413  {
414  if( INetProtocol::File == rURLObj.GetProtocol() )
415  {
416  INetURLObject aTemp(rURLObj);
417  aTemp.removeSegment();
418  // last slash should belong to the pathname
419  aRet = aTemp.PathToFileName();
420  }
421  else
422  {
426  const sal_Int32 nPos = aRet.indexOf(rURLObj.GetLastName( URL_DECODE ));
427  if (nPos>=0)
428  {
429  aRet = aRet.copy(0, nPos);
430  }
431  }
432  }
433  break;
434 
435  case FF_NAME:
437  break;
438 
439  case FF_NAME_NOEXT:
440  aRet = rURLObj.GetBase();
441  break;
442 
443  default:
444  if( INetProtocol::File == rURLObj.GetProtocol() )
445  aRet = rURLObj.GetFull();
446  else
450  }
451  }
452  return aRet;
453 }
454 
455 std::unique_ptr<SwFieldType> SwFileNameFieldType::Copy() const
456 {
457  return std::make_unique<SwFileNameFieldType>(m_rDoc);
458 }
459 
461  : SwField(pTyp, nFormat)
462 {
463  m_aContent = static_cast<SwFileNameFieldType*>(GetTyp())->Expand(GetFormat());
464 }
465 
466 OUString SwFileNameField::ExpandImpl(SwRootFrame const*const) const
467 {
468  if (!IsFixed())
469  const_cast<SwFileNameField*>(this)->m_aContent = static_cast<SwFileNameFieldType*>(GetTyp())->Expand(GetFormat());
470 
471  return m_aContent;
472 }
473 
474 std::unique_ptr<SwField> SwFileNameField::Copy() const
475 {
476  std::unique_ptr<SwFileNameField> pTmp(
477  new SwFileNameField(static_cast<SwFileNameFieldType*>(GetTyp()), GetFormat()));
478  pTmp->SetExpansion(m_aContent);
479 
480  return std::unique_ptr<SwField>(pTmp.release());
481 }
482 
483 bool SwFileNameField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
484 {
485  switch( nWhichId )
486  {
487  case FIELD_PROP_FORMAT:
488  {
489  sal_Int16 nRet;
490  switch( GetFormat() &(~FF_FIXED) )
491  {
492  case FF_PATH:
493  nRet = text::FilenameDisplayFormat::PATH;
494  break;
495  case FF_NAME_NOEXT:
497  break;
498  case FF_NAME:
499  nRet = text::FilenameDisplayFormat::NAME_AND_EXT;
500  break;
501  default: nRet = text::FilenameDisplayFormat::FULL;
502  }
503  rAny <<= nRet;
504  }
505  break;
506 
507  case FIELD_PROP_BOOL2:
508  rAny <<= IsFixed();
509  break;
510 
511  case FIELD_PROP_PAR3:
512  rAny <<= m_aContent;
513  break;
514 
515  default:
516  assert(false);
517  }
518  return true;
519 }
520 
521 bool SwFileNameField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
522 {
523  switch( nWhichId )
524  {
525  case FIELD_PROP_FORMAT:
526  {
527  //JP 24.10.2001: int32 because in UnoField.cxx a putvalue is
528  // called with a int32 value! But normally we need
529  // here only a int16
530  sal_Int32 nType = 0;
531  rAny >>= nType;
532  bool bFixed = IsFixed();
533  switch( nType )
534  {
535  case text::FilenameDisplayFormat::PATH:
536  nType = FF_PATH;
537  break;
539  nType = FF_NAME_NOEXT;
540  break;
541  case text::FilenameDisplayFormat::NAME_AND_EXT:
542  nType = FF_NAME;
543  break;
544  default: nType = FF_PATHNAME;
545  }
546  if(bFixed)
547  nType |= FF_FIXED;
548  SetFormat(nType);
549  }
550  break;
551 
552  case FIELD_PROP_BOOL2:
553  if( *o3tl::doAccess<bool>(rAny) )
555  else
557  break;
558 
559  case FIELD_PROP_PAR3:
560  rAny >>= m_aContent;
561  break;
562 
563  default:
564  assert(false);
565  }
566  return true;
567 }
568 
571  , m_rDoc(rDocument)
572 {
573 }
574 
576 {
577  OSL_ENSURE( nFormat < FF_END, "Expand: no valid Format!" );
578 
579  OUString aRet;
580  SwDocShell *pDocShell(m_rDoc.GetDocShell());
581  OSL_ENSURE(pDocShell, "no SwDocShell");
582  if (pDocShell) {
583  uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
584  pDocShell->GetModel(), uno::UNO_QUERY_THROW);
585  uno::Reference<document::XDocumentProperties> xDocProps(
586  xDPS->getDocumentProperties());
587  OSL_ENSURE(xDocProps.is(), "Doc has no DocumentProperties");
588 
589  if( FF_UI_NAME == nFormat )
590  aRet = xDocProps->getTemplateName();
591  else if( !xDocProps->getTemplateURL().isEmpty() )
592  {
593  if( FF_UI_RANGE == nFormat )
594  {
595  // for getting region names!
597  OUString sTmp;
598  OUString sRegion;
599  aFac.GetLogicNames( xDocProps->getTemplateURL(), sRegion, sTmp );
600  aRet = sRegion;
601  }
602  else
603  {
604  INetURLObject aPathName( xDocProps->getTemplateURL() );
605  if( FF_NAME == nFormat )
606  aRet = aPathName.GetLastName(URL_DECODE);
607  else if( FF_NAME_NOEXT == nFormat )
608  aRet = aPathName.GetBase();
609  else
610  {
611  if( FF_PATH == nFormat )
612  {
613  aPathName.removeSegment();
614  aRet = aPathName.GetFull();
615  }
616  else
617  aRet = aPathName.GetFull();
618  }
619  }
620  }
621  }
622  return aRet;
623 }
624 
625 std::unique_ptr<SwFieldType> SwTemplNameFieldType::Copy() const
626 {
627  return std::make_unique<SwTemplNameFieldType>(m_rDoc);
628 }
629 
631  : SwField(pTyp, nFormat)
632 {}
633 
634 OUString SwTemplNameField::ExpandImpl(SwRootFrame const*const) const
635 {
636  return static_cast<SwTemplNameFieldType*>(GetTyp())->Expand(GetFormat());
637 }
638 
639 std::unique_ptr<SwField> SwTemplNameField::Copy() const
640 {
641  return std::make_unique<SwTemplNameField>(static_cast<SwTemplNameFieldType*>(GetTyp()), GetFormat());
642 }
643 
644 bool SwTemplNameField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
645 {
646  switch ( nWhichId )
647  {
648  case FIELD_PROP_FORMAT:
649  {
650  sal_Int16 nRet;
651  switch( GetFormat() )
652  {
653  case FF_PATH: nRet = text::FilenameDisplayFormat::PATH; break;
655  case FF_NAME: nRet = text::FilenameDisplayFormat::NAME_AND_EXT; break;
656  case FF_UI_RANGE: nRet = text::TemplateDisplayFormat::AREA; break;
657  case FF_UI_NAME: nRet = text::TemplateDisplayFormat::TITLE; break;
658  default: nRet = text::FilenameDisplayFormat::FULL;
659 
660  }
661  rAny <<= nRet;
662  }
663  break;
664 
665  default:
666  assert(false);
667  }
668  return true;
669 }
670 
671 bool SwTemplNameField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
672 {
673  switch ( nWhichId )
674  {
675  case FIELD_PROP_FORMAT:
676  {
677  //JP 24.10.2001: int32 because in UnoField.cxx a putvalue is
678  // called with a int32 value! But normally we need
679  // here only a int16
680  sal_Int32 nType = 0;
681  rAny >>= nType;
682  switch( nType )
683  {
684  case text::FilenameDisplayFormat::PATH:
686  break;
689  break;
690  case text::FilenameDisplayFormat::NAME_AND_EXT:
692  break;
693  case text::TemplateDisplayFormat::AREA :
695  break;
696  case text::TemplateDisplayFormat::TITLE :
698  break;
699  default: SetFormat(FF_PATHNAME);
700  }
701  }
702  break;
703 
704  default:
705  assert(false);
706  }
707  return true;
708 }
709 
712  , m_rDoc(rDocument)
713  , m_nNumberingType(SVX_NUM_ARABIC)
714 {
715 }
716 
717 OUString SwDocStatFieldType::Expand(sal_uInt16 nSubType, SvxNumType nFormat) const
718 {
719  sal_uInt32 nVal = 0;
721  switch( nSubType )
722  {
723  case DS_TBL: nVal = rDStat.nTable; break;
724  case DS_GRF: nVal = rDStat.nGrf; break;
725  case DS_OLE: nVal = rDStat.nOLE; break;
726  case DS_PARA: nVal = rDStat.nPara; break;
727  case DS_WORD: nVal = rDStat.nWord; break;
728  case DS_CHAR: nVal = rDStat.nChar; break;
729  case DS_PAGE:
731  const_cast<SwDocStat &>(rDStat).nPage = m_rDoc.getIDocumentLayoutAccess().GetCurrentLayout()->GetPageNum();
732  nVal = rDStat.nPage;
733  if( SVX_NUM_PAGEDESC == nFormat )
734  nFormat = m_nNumberingType;
735  break;
736  default:
737  OSL_FAIL( "SwDocStatFieldType::Expand: unknown SubType" );
738  }
739 
740  if( nVal <= SHRT_MAX )
741  return FormatNumber( nVal, nFormat );
742 
743  return OUString::number( nVal );
744 }
745 
746 std::unique_ptr<SwFieldType> SwDocStatFieldType::Copy() const
747 {
748  return std::make_unique<SwDocStatFieldType>(m_rDoc);
749 }
750 
756 SwDocStatField::SwDocStatField(SwDocStatFieldType* pTyp, sal_uInt16 nSub, sal_uInt32 nFormat)
757  : SwField(pTyp, nFormat),
758  m_nSubType(nSub)
759 {}
760 
761 OUString SwDocStatField::ExpandImpl(SwRootFrame const*const) const
762 {
763  return static_cast<SwDocStatFieldType*>(GetTyp())->Expand(m_nSubType, static_cast<SvxNumType>(GetFormat()));
764 }
765 
766 std::unique_ptr<SwField> SwDocStatField::Copy() const
767 {
768  return std::make_unique<SwDocStatField>(
769  static_cast<SwDocStatFieldType*>(GetTyp()), m_nSubType, GetFormat() );
770 }
771 
772 sal_uInt16 SwDocStatField::GetSubType() const
773 {
774  return m_nSubType;
775 }
776 
777 void SwDocStatField::SetSubType(sal_uInt16 nSub)
778 {
779  m_nSubType = nSub;
780 }
781 
783 {
785  static_cast<SwDocStatFieldType*>(GetTyp())->SetNumFormat(
787 }
788 
789 bool SwDocStatField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
790 {
791  switch ( nWhichId )
792  {
793  case FIELD_PROP_USHORT2:
794  rAny <<= static_cast<sal_Int16>(GetFormat());
795  break;
796 
797  default:
798  assert(false);
799  }
800  return true;
801 }
802 
803 bool SwDocStatField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
804 {
805  bool bRet = false;
806  switch ( nWhichId )
807  {
808  case FIELD_PROP_USHORT2:
809  {
810  sal_Int16 nSet = 0;
811  rAny >>= nSet;
812  if(nSet <= SVX_NUM_CHARS_LOWER_LETTER_N &&
813  nSet != SVX_NUM_CHAR_SPECIAL &&
814  nSet != SVX_NUM_BITMAP)
815  {
816  SetFormat(nSet);
817  bRet = true;
818  }
819  }
820  break;
821 
822  default:
823  assert(false);
824  }
825  return bRet;
826 }
827 
828 // Document info field type
829 
832 {
833 }
834 
835 std::unique_ptr<SwFieldType> SwDocInfoFieldType::Copy() const
836 {
837  return std::make_unique<SwDocInfoFieldType>(GetDoc());
838 }
839 
841  const LocaleDataWrapper **ppAppLocalData,
842  const LocaleDataWrapper **ppLocalData )
843 {
844  SvtSysLocale aLocale;
845  *ppAppLocalData = &aLocale.GetLocaleData();
846  *ppLocalData = *ppAppLocalData;
847  if( nLang != (*ppLocalData)->getLanguageTag().getLanguageType() )
848  *ppLocalData = new LocaleDataWrapper(LanguageTag( nLang ));
849 }
850 
851 OUString SwDocInfoFieldType::Expand( sal_uInt16 nSub, sal_uInt32 nFormat,
852  LanguageType nLang, const OUString& rName ) const
853 {
854  const LocaleDataWrapper *pAppLocalData = nullptr, *pLocalData = nullptr;
855  SwDocShell *pDocShell(GetDoc()->GetDocShell());
856  OSL_ENSURE(pDocShell, "no SwDocShell");
857  if (!pDocShell) { return OUString(); }
858 
859  uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
860  pDocShell->GetModel(), uno::UNO_QUERY_THROW);
861  uno::Reference<document::XDocumentProperties> xDocProps(
862  xDPS->getDocumentProperties());
863  OSL_ENSURE(xDocProps.is(), "Doc has no DocumentProperties");
864 
865  sal_uInt16 nExtSub = nSub & 0xff00;
866  nSub &= 0xff; // do not consider extended SubTypes
867 
868  OUString aStr;
869  switch(nSub)
870  {
871  case DI_TITLE: aStr = xDocProps->getTitle(); break;
872  case DI_SUBJECT:aStr = xDocProps->getSubject(); break;
873  case DI_KEYS: aStr = ::comphelper::string::convertCommaSeparated(
874  xDocProps->getKeywords());
875  break;
876  case DI_COMMENT:aStr = xDocProps->getDescription(); break;
877  case DI_DOCNO: aStr = OUString::number(
878  xDocProps->getEditingCycles() );
879  break;
880  case DI_EDIT:
881  if ( !nFormat )
882  {
883  lcl_GetLocalDataWrapper( nLang, &pAppLocalData, &pLocalData );
884  sal_Int32 dur = xDocProps->getEditingDuration();
885  // If Seconds > 0 then bSec should be TRUE otherwise Seconds
886  // information will be lost if file has EditTime in Seconds format.
887  aStr = pLocalData->getTime( tools::Time(dur/3600, (dur%3600)/60, dur%60),
888  dur%60 > 0);
889  }
890  else
891  {
892  sal_Int32 dur = xDocProps->getEditingDuration();
893  double fVal = tools::Time(dur/3600, (dur%3600)/60, dur%60).GetTimeInDays();
894  aStr = ExpandValue(fVal, nFormat, nLang);
895  }
896  break;
897  case DI_CUSTOM:
898  {
899  OUString sVal;
900  try
901  {
902  uno::Any aAny;
903  uno::Reference < beans::XPropertySet > xSet(
904  xDocProps->getUserDefinedProperties(),
905  uno::UNO_QUERY_THROW);
906  aAny = xSet->getPropertyValue( rName );
907 
908  uno::Reference < script::XTypeConverter > xConverter( script::Converter::create(comphelper::getProcessComponentContext()) );
909  uno::Any aNew = xConverter->convertToSimpleType( aAny, uno::TypeClass_STRING );
910  aNew >>= sVal;
911  }
912  catch (uno::Exception&) {}
913  return sVal;
914  }
915 
916  default:
917  {
918  OUString aName( xDocProps->getAuthor() );
919  util::DateTime uDT( xDocProps->getCreationDate() );
920  DateTime aDate(uDT);
921  if( nSub == DI_CREATE )
922  ; // that's it !!
923  else if( nSub == DI_CHANGE )
924  {
925  aName = xDocProps->getModifiedBy();
926  uDT = xDocProps->getModificationDate();
927  aDate = DateTime(uDT);
928  }
929  else if( nSub == DI_PRINT )
930  {
931  aName = xDocProps->getPrintedBy();
932  uDT = xDocProps->getPrintDate();
933  aDate = DateTime(uDT);
934  }
935  else
936  break;
937 
938  if (aDate.IsValidAndGregorian())
939  {
940  switch (nExtSub & ~DI_SUB_FIXED)
941  {
942  case DI_SUB_AUTHOR:
943  aStr = aName;
944  break;
945 
946  case DI_SUB_TIME:
947  if (!nFormat)
948  {
949  lcl_GetLocalDataWrapper( nLang, &pAppLocalData,
950  &pLocalData );
951  aStr = pLocalData->getTime( aDate,
952  false);
953  }
954  else
955  {
956  // start the number formatter
957  double fVal = SwDateTimeField::GetDateTime( *GetDoc(),
958  aDate);
959  aStr = ExpandValue(fVal, nFormat, nLang);
960  }
961  break;
962 
963  case DI_SUB_DATE:
964  if (!nFormat)
965  {
966  lcl_GetLocalDataWrapper( nLang, &pAppLocalData,
967  &pLocalData );
968  aStr = pLocalData->getDate( aDate );
969  }
970  else
971  {
972  // start the number formatter
973  double fVal = SwDateTimeField::GetDateTime( *GetDoc(),
974  aDate);
975  aStr = ExpandValue(fVal, nFormat, nLang);
976  }
977  break;
978  }
979  }
980  }
981  break;
982  }
983 
984  if( pAppLocalData != pLocalData )
985  delete pLocalData;
986 
987  return aStr;
988 }
989 
990 // document info field
991 
992 SwDocInfoField::SwDocInfoField(SwDocInfoFieldType* pTyp, sal_uInt16 nSub, const OUString& rName, sal_uInt32 nFormat) :
993  SwValueField(pTyp, nFormat), m_nSubType(nSub)
994 {
995  m_aName = rName;
996  m_aContent = static_cast<SwDocInfoFieldType*>(GetTyp())->Expand(m_nSubType, nFormat, GetLanguage(), m_aName);
997 }
998 
999 SwDocInfoField::SwDocInfoField(SwDocInfoFieldType* pTyp, sal_uInt16 nSub, const OUString& rName, const OUString& rValue, sal_uInt32 nFormat) :
1000  SwValueField(pTyp, nFormat), m_nSubType(nSub)
1001 {
1002  m_aName = rName;
1003  m_aContent = rValue;
1004 }
1005 
1006 template<class T>
1007 static double lcl_TimeToDouble( const T& rTime )
1008 {
1009  const double fNanoSecondsPerDay = 86400000000000.0;
1010  return ( (rTime.Hours * SAL_CONST_INT64(3600000000000))
1011  + (rTime.Minutes * SAL_CONST_INT64( 60000000000))
1012  + (rTime.Seconds * SAL_CONST_INT64( 1000000000))
1013  + (rTime.NanoSeconds))
1014  / fNanoSecondsPerDay;
1015 }
1016 
1017 template<class D>
1018 static double lcl_DateToDouble( const D& rDate, const Date& rNullDate )
1019 {
1020  tools::Long nDate = Date::DateToDays( rDate.Day, rDate.Month, rDate.Year );
1021  tools::Long nNullDate = Date::DateToDays( rNullDate.GetDay(), rNullDate.GetMonth(), rNullDate.GetYear() );
1022  return double( nDate - nNullDate );
1023 }
1024 
1025 OUString SwDocInfoField::ExpandImpl(SwRootFrame const*const) const
1026 {
1027  if ( ( m_nSubType & 0xFF ) == DI_CUSTOM )
1028  {
1029  // custom properties currently need special treatment
1030  // We don't have a secure way to detect "real" custom properties in Word import of text
1031  // fields, so we treat *every* unknown property as a custom property, even the "built-in"
1032  // section in Word's document summary information stream as these properties have not been
1033  // inserted when the document summary information was imported, we do it here.
1034  // This approach is still a lot better than the old one to import such fields as
1035  // "user fields" and simple text
1036  SwDocShell* pDocShell = GetDoc()->GetDocShell();
1037  if( !pDocShell )
1038  return m_aContent;
1039  try
1040  {
1041  uno::Reference<document::XDocumentPropertiesSupplier> xDPS( pDocShell->GetModel(), uno::UNO_QUERY_THROW);
1042  uno::Reference<document::XDocumentProperties> xDocProps( xDPS->getDocumentProperties());
1043  uno::Reference < beans::XPropertySet > xSet( xDocProps->getUserDefinedProperties(), uno::UNO_QUERY_THROW);
1044  uno::Reference < beans::XPropertySetInfo > xSetInfo = xSet->getPropertySetInfo();
1045 
1046  uno::Any aAny;
1047  if( xSetInfo->hasPropertyByName( m_aName ) )
1048  aAny = xSet->getPropertyValue( m_aName );
1049  if ( aAny.getValueType() != cppu::UnoType<void>::get() )
1050  {
1051  // "void" type means that the property has not been inserted until now
1052  if ( !IsFixed() )
1053  {
1054  // if the field is "fixed" we don't update it from the property
1055  OUString sVal;
1056  uno::Reference < script::XTypeConverter > xConverter( script::Converter::create(comphelper::getProcessComponentContext()) );
1057  util::Date aDate;
1058  util::DateTime aDateTime;
1059  util::Duration aDuration;
1060  if( aAny >>= aDate)
1061  {
1062  SvNumberFormatter* pFormatter = pDocShell->GetDoc()->GetNumberFormatter();
1063  const Date& rNullDate = pFormatter->GetNullDate();
1064  sVal = ExpandValue( lcl_DateToDouble<util::Date>( aDate, rNullDate ), GetFormat(), GetLanguage());
1065  }
1066  else if( aAny >>= aDateTime )
1067  {
1068  double fDateTime = lcl_TimeToDouble<util::DateTime>( aDateTime );
1069  SvNumberFormatter* pFormatter = pDocShell->GetDoc()->GetNumberFormatter();
1070  const Date& rNullDate = pFormatter->GetNullDate();
1071  fDateTime += lcl_DateToDouble<util::DateTime>( aDateTime, rNullDate );
1072  sVal = ExpandValue( fDateTime, GetFormat(), GetLanguage());
1073  }
1074  else if( aAny >>= aDuration )
1075  {
1076  sVal = OUStringChar(aDuration.Negative ? '-' : '+')
1078  sVal = sVal.replaceFirst("%1", OUString::number( aDuration.Years ) );
1079  sVal = sVal.replaceFirst("%2", OUString::number( aDuration.Months ) );
1080  sVal = sVal.replaceFirst("%3", OUString::number( aDuration.Days ) );
1081  sVal = sVal.replaceFirst("%4", OUString::number( aDuration.Hours ) );
1082  sVal = sVal.replaceFirst("%5", OUString::number( aDuration.Minutes) );
1083  sVal = sVal.replaceFirst("%6", OUString::number( aDuration.Seconds) );
1084  }
1085  else
1086  {
1087  uno::Any aNew = xConverter->convertToSimpleType( aAny, uno::TypeClass_STRING );
1088  aNew >>= sVal;
1089  }
1090  const_cast<SwDocInfoField*>(this)->m_aContent = sVal;
1091  }
1092  }
1093  }
1094  catch (uno::Exception&) {}
1095  }
1096  else if ( !IsFixed() )
1097  const_cast<SwDocInfoField*>(this)->m_aContent = static_cast<SwDocInfoFieldType*>(GetTyp())->Expand(m_nSubType, GetFormat(), GetLanguage(), m_aName);
1098 
1099  return m_aContent;
1100 }
1101 
1103 {
1104  OUString aStr(SwFieldType::GetTypeStr(GetTypeId()) + ":");
1105 
1106  sal_uInt16 const nSub = m_nSubType & 0xff;
1107 
1108  switch (nSub)
1109  {
1110  case DI_CUSTOM:
1111  aStr += m_aName;
1112  break;
1113 
1114  default:
1115  aStr += SwViewShell::GetShellRes()
1116  ->aDocInfoLst[ nSub - DI_SUBTYPE_BEGIN ];
1117  break;
1118  }
1119  if (IsFixed())
1120  {
1121  aStr += " " + SwViewShell::GetShellRes()->aFixedStr;
1122  }
1123  return aStr;
1124 }
1125 
1126 std::unique_ptr<SwField> SwDocInfoField::Copy() const
1127 {
1128  std::unique_ptr<SwDocInfoField> pField(new SwDocInfoField(static_cast<SwDocInfoFieldType*>(GetTyp()), m_nSubType, m_aName, GetFormat()));
1129  pField->SetAutomaticLanguage(IsAutomaticLanguage());
1130  pField->m_aContent = m_aContent;
1131 
1132  return std::unique_ptr<SwField>(pField.release());
1133 }
1134 
1135 sal_uInt16 SwDocInfoField::GetSubType() const
1136 {
1137  return m_nSubType;
1138 }
1139 
1140 void SwDocInfoField::SetSubType(sal_uInt16 nSub)
1141 {
1142  m_nSubType = nSub;
1143 }
1144 
1146 {
1147  if (!GetFormat())
1148  SwField::SetLanguage(nLng);
1149  else
1151 }
1152 
1153 bool SwDocInfoField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
1154 {
1155  switch( nWhichId )
1156  {
1157  case FIELD_PROP_PAR1:
1158  rAny <<= m_aContent;
1159  break;
1160 
1161  case FIELD_PROP_PAR4:
1162  rAny <<= m_aName;
1163  break;
1164 
1165  case FIELD_PROP_USHORT1:
1166  rAny <<= static_cast<sal_Int16>(m_aContent.toInt32());
1167  break;
1168 
1169  case FIELD_PROP_BOOL1:
1170  rAny <<= 0 != (m_nSubType & DI_SUB_FIXED);
1171  break;
1172 
1173  case FIELD_PROP_FORMAT:
1174  rAny <<= static_cast<sal_Int32>(GetFormat());
1175  break;
1176 
1177  case FIELD_PROP_DOUBLE:
1178  {
1179  double fVal = GetValue();
1180  rAny <<= fVal;
1181  }
1182  break;
1183  case FIELD_PROP_PAR3:
1184  rAny <<= ExpandImpl(nullptr);
1185  break;
1186  case FIELD_PROP_BOOL2:
1187  {
1188  sal_uInt16 nExtSub = (m_nSubType & 0xff00) & ~DI_SUB_FIXED;
1189  rAny <<= nExtSub == DI_SUB_DATE;
1190  }
1191  break;
1192  default:
1193  return SwField::QueryValue(rAny, nWhichId);
1194  }
1195  return true;
1196 }
1197 
1198 bool SwDocInfoField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
1199 {
1200  sal_Int32 nValue = 0;
1201  switch( nWhichId )
1202  {
1203  case FIELD_PROP_PAR1:
1204  if( m_nSubType & DI_SUB_FIXED )
1205  rAny >>= m_aContent;
1206  break;
1207 
1208  case FIELD_PROP_USHORT1:
1209  if( m_nSubType & DI_SUB_FIXED )
1210  {
1211  rAny >>= nValue;
1212  m_aContent = OUString::number(nValue);
1213  }
1214  break;
1215 
1216  case FIELD_PROP_BOOL1:
1217  if(*o3tl::doAccess<bool>(rAny))
1219  else
1220  m_nSubType &= ~DI_SUB_FIXED;
1221  break;
1222  case FIELD_PROP_FORMAT:
1223  {
1224  rAny >>= nValue;
1225  if( nValue >= 0)
1226  SetFormat(nValue);
1227  }
1228  break;
1229 
1230  case FIELD_PROP_PAR3:
1231  rAny >>= m_aContent;
1232  break;
1233  case FIELD_PROP_BOOL2:
1234  m_nSubType &= 0xf0ff;
1235  if(*o3tl::doAccess<bool>(rAny))
1237  else
1239  break;
1240  default:
1241  return SwField::PutValue(rAny, nWhichId);
1242  }
1243  return true;
1244 }
1245 
1247  : SwFieldType( SwFieldIds::HiddenText ), m_bHidden( bSetHidden )
1248 {
1249 }
1250 
1251 std::unique_ptr<SwFieldType> SwHiddenTextFieldType::Copy() const
1252 {
1253  return std::make_unique<SwHiddenTextFieldType>( m_bHidden );
1254 }
1255 
1257 {
1258  if( m_bHidden != bSetHidden )
1259  {
1260  m_bHidden = bSetHidden;
1261  UpdateFields(); // notify all HiddenTexts
1262  }
1263 }
1264 
1266  bool bConditional,
1267  const OUString& rCond,
1268  const OUString& rStr,
1269  bool bHidden,
1270  SwFieldTypesEnum nSub) :
1271  SwField( pFieldType ), m_aCond(rCond), m_nSubType(nSub),
1272  m_bCanToggle(bConditional), m_bIsHidden(bHidden), m_bValid(false)
1273 {
1275  {
1276  sal_Int32 nPos = 0;
1277  m_aTRUEText = rStr.getToken(0, '|', nPos);
1278 
1279  if(nPos != -1)
1280  {
1281  m_aFALSEText = rStr.getToken(0, '|', nPos);
1282  if(nPos != -1)
1283  {
1284  m_aContent = rStr.getToken(0, '|', nPos);
1285  m_bValid = true;
1286  }
1287  }
1288  }
1289  else
1290  m_aTRUEText = rStr;
1291 }
1292 
1294  const OUString& rCond,
1295  const OUString& rTrue,
1296  const OUString& rFalse,
1297  SwFieldTypesEnum nSub)
1298  : SwField( pFieldType ), m_aTRUEText(rTrue), m_aFALSEText(rFalse), m_aCond(rCond), m_nSubType(nSub),
1299  m_bIsHidden(true), m_bValid(false)
1300 {
1301  m_bCanToggle = !m_aCond.isEmpty();
1302 }
1303 
1304 OUString SwHiddenTextField::ExpandImpl(SwRootFrame const*const) const
1305 {
1306  // Type: !Hidden -> show always
1307  // Hide -> evaluate condition
1308 
1310  {
1311  if( m_bValid )
1312  return m_aContent;
1313 
1314  if( m_bCanToggle && !m_bIsHidden )
1315  return m_aTRUEText;
1316  }
1317  else if( !static_cast<SwHiddenTextFieldType*>(GetTyp())->GetHiddenFlag() ||
1318  ( m_bCanToggle && m_bIsHidden ))
1319  return m_aTRUEText;
1320 
1321  return m_aFALSEText;
1322 }
1323 
1326 {
1328  return;
1329 
1330 #if !HAVE_FEATURE_DBCONNECTIVITY || ENABLE_FUZZERS
1331  (void) rDoc;
1332 #else
1333  SwDBManager* pMgr = rDoc.GetDBManager();
1334 #endif
1335  m_bValid = false;
1336  OUString sTmpName = (m_bCanToggle && !m_bIsHidden) ? m_aTRUEText : m_aFALSEText;
1337 
1338  // Database expressions need to be different from normal text. Therefore, normal text is set
1339  // in quotes. If the latter exist they will be removed. If not, check if potential DB name.
1340  // Only if there are two or more dots and no quotes, we assume a database.
1341  if (sTmpName.getLength()>1 &&
1342  sTmpName.startsWith("\"") &&
1343  sTmpName.endsWith("\""))
1344  {
1345  m_aContent = sTmpName.copy(1, sTmpName.getLength() - 2);
1346  m_bValid = true;
1347  }
1348  else if(sTmpName.indexOf('\"')<0 &&
1349  comphelper::string::getTokenCount(sTmpName, '.') > 2)
1350  {
1351  sTmpName = ::ReplacePoint(sTmpName);
1352  if(sTmpName.startsWith("[") && sTmpName.endsWith("]"))
1353  { // remove brackets
1354  sTmpName = sTmpName.copy(1, sTmpName.getLength() - 2);
1355  }
1356 #if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS
1357  if( pMgr)
1358  {
1359  sal_Int32 nIdx{ 0 };
1360  OUString sDBName( GetDBName( sTmpName, rDoc ));
1361  OUString sDataSource(sDBName.getToken(0, DB_DELIM, nIdx));
1362  OUString sDataTableOrQuery(sDBName.getToken(0, DB_DELIM, nIdx));
1363  if( pMgr->IsInMerge() && !sDBName.isEmpty() &&
1364  pMgr->IsDataSourceOpen( sDataSource,
1365  sDataTableOrQuery, false))
1366  {
1367  double fNumber;
1368  pMgr->GetMergeColumnCnt(GetColumnName( sTmpName ),
1369  GetLanguage(), m_aContent, &fNumber );
1370  m_bValid = true;
1371  }
1372  else if( !sDBName.isEmpty() && !sDataSource.isEmpty() &&
1373  !sDataTableOrQuery.isEmpty() )
1374  m_bValid = true;
1375  }
1376 #endif
1377  }
1378 }
1379 
1381 {
1383  " " + m_aCond + " " + m_aTRUEText;
1384 
1386  {
1387  aStr += " : " + m_aFALSEText;
1388  }
1389  return aStr;
1390 }
1391 
1392 std::unique_ptr<SwField> SwHiddenTextField::Copy() const
1393 {
1394  std::unique_ptr<SwHiddenTextField> pField(
1395  new SwHiddenTextField(static_cast<SwHiddenTextFieldType*>(GetTyp()), m_aCond,
1397  pField->m_bIsHidden = m_bIsHidden;
1398  pField->m_bValid = m_bValid;
1399  pField->m_aContent = m_aContent;
1400  pField->SetFormat(GetFormat());
1401  pField->m_nSubType = m_nSubType;
1402  return std::unique_ptr<SwField>(pField.release());
1403 }
1404 
1406 void SwHiddenTextField::SetPar1(const OUString& rStr)
1407 {
1408  m_aCond = rStr;
1409  m_bCanToggle = !m_aCond.isEmpty();
1410 }
1411 
1413 {
1414  return m_aCond;
1415 }
1416 
1418 void SwHiddenTextField::SetPar2(const OUString& rStr)
1419 {
1421  {
1422  sal_Int32 nPos = rStr.indexOf('|');
1423  if (nPos == -1)
1424  m_aTRUEText = rStr;
1425  else
1426  {
1427  m_aTRUEText = rStr.copy(0, nPos);
1428  m_aFALSEText = rStr.copy(nPos + 1);
1429  }
1430  }
1431  else
1432  m_aTRUEText = rStr;
1433 }
1434 
1437 {
1439  {
1440  return m_aTRUEText;
1441  }
1442  return m_aTRUEText + "|" + m_aFALSEText;
1443 }
1444 
1446 {
1447  return static_cast<sal_uInt16>(m_nSubType);
1448 }
1449 
1450 bool SwHiddenTextField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
1451 {
1452  switch( nWhichId )
1453  {
1454  case FIELD_PROP_PAR1:
1455  rAny <<= m_aCond;
1456  break;
1457  case FIELD_PROP_PAR2:
1458  rAny <<= m_aTRUEText;
1459  break;
1460  case FIELD_PROP_PAR3:
1461  rAny <<= m_aFALSEText;
1462  break;
1463  case FIELD_PROP_PAR4 :
1464  rAny <<= m_aContent;
1465  break;
1466  case FIELD_PROP_BOOL1:
1467  rAny <<= m_bIsHidden;
1468  break;
1469  default:
1470  assert(false);
1471  }
1472  return true;
1473 }
1474 
1475 bool SwHiddenTextField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
1476 {
1477  switch( nWhichId )
1478  {
1479  case FIELD_PROP_PAR1:
1480  {
1481  OUString sVal;
1482  rAny >>= sVal;
1483  SetPar1(sVal);
1484  }
1485  break;
1486  case FIELD_PROP_PAR2:
1487  rAny >>= m_aTRUEText;
1488  break;
1489  case FIELD_PROP_PAR3:
1490  rAny >>= m_aFALSEText;
1491  break;
1492  case FIELD_PROP_BOOL1:
1493  m_bIsHidden = *o3tl::doAccess<bool>(rAny);
1494  break;
1495  case FIELD_PROP_PAR4:
1496  rAny >>= m_aContent;
1497  m_bValid = true;
1498  break;
1499  default:
1500  assert(false);
1501  }
1502  return true;
1503 }
1504 
1505 OUString SwHiddenTextField::GetColumnName(const OUString& rName)
1506 {
1507  sal_Int32 nPos = rName.indexOf(DB_DELIM);
1508  if( nPos>=0 )
1509  {
1510  nPos = rName.indexOf(DB_DELIM, nPos + 1);
1511 
1512  if( nPos>=0 )
1513  return rName.copy(nPos + 1);
1514  }
1515  return rName;
1516 }
1517 
1518 OUString SwHiddenTextField::GetDBName(const OUString& rName, SwDoc& rDoc)
1519 {
1520  sal_Int32 nPos = rName.indexOf(DB_DELIM);
1521  if( nPos>=0 )
1522  {
1523  nPos = rName.indexOf(DB_DELIM, nPos + 1);
1524 
1525  if( nPos>=0 )
1526  return rName.copy(0, nPos);
1527  }
1528 
1529  SwDBData aData = rDoc.GetDBData();
1530  return aData.sDataSource + OUStringChar(DB_DELIM) + aData.sCommand;
1531 }
1532 
1533 // [aFieldDefinition] value sample : " IF A == B \"TrueText\" \"FalseText\""
1534 void SwHiddenTextField::ParseIfFieldDefinition(const OUString& aFieldDefinition,
1535  OUString& rCondition,
1536  OUString& rTrue,
1537  OUString& rFalse)
1538 {
1539  // get all positions inside the input string where words are started
1540  //
1541  // In: " IF A == B \"TrueText\" \"FalseText\""
1542  // 0 1 2 3
1543  // 01234567890 123456789 01 2345678901 2
1544  //
1545  // result:
1546  // [1, 4, 6, 9, 11, 22]
1547  std::vector<sal_Int32> wordPosition;
1548  {
1549  bool quoted = false;
1550  bool insideWord = false;
1551  for (sal_Int32 i = 0; i < aFieldDefinition.getLength(); i++)
1552  {
1553  if (quoted)
1554  {
1555  if (aFieldDefinition[i] == '\"')
1556  {
1557  quoted = false;
1558  insideWord = false;
1559  }
1560  }
1561  else
1562  {
1563  if (aFieldDefinition[i] == ' ')
1564  {
1565  // word delimiter
1566  insideWord = false;
1567  }
1568  else
1569  {
1570  if (insideWord)
1571  {
1572  quoted = (aFieldDefinition[i] == '\"');
1573  }
1574  else
1575  {
1576  insideWord = true;
1577  wordPosition.push_back(i);
1578  quoted = (aFieldDefinition[i] == '\"');
1579  }
1580  }
1581  }
1582  }
1583  }
1584 
1585  // first word is always "IF"
1586  // last two words are: true-case and false-case,
1587  // everything before is treated as condition expression
1588  // => we need at least 4 words to be inside the input string
1589  if (wordPosition.size() < 4)
1590  {
1591  return;
1592  }
1593 
1594 
1595  const sal_Int32 conditionBegin = wordPosition[1];
1596  const sal_Int32 trueBegin = wordPosition[wordPosition.size() - 2];
1597  const sal_Int32 falseBegin = wordPosition[wordPosition.size() - 1];
1598 
1599  const sal_Int32 conditionLength = trueBegin - conditionBegin;
1600  const sal_Int32 trueLength = falseBegin - trueBegin;
1601 
1602  // Syntax
1603  // OUString::copy( sal_Int32 beginIndex, sal_Int32 count )
1604  rCondition = aFieldDefinition.copy(conditionBegin, conditionLength);
1605  rTrue = aFieldDefinition.copy(trueBegin, trueLength);
1606  rFalse = aFieldDefinition.copy(falseBegin);
1607 
1608  // trim
1609  rCondition = rCondition.trim();
1610  rTrue = rTrue.trim();
1611  rFalse = rFalse.trim();
1612 
1613  // remove quotes
1614  if (rCondition.getLength() >= 2)
1615  {
1616  if (rCondition[0] == '\"' && rCondition[rCondition.getLength() - 1] == '\"')
1617  rCondition = rCondition.copy(1, rCondition.getLength() - 2);
1618  }
1619  if (rTrue.getLength() >= 2)
1620  {
1621  if (rTrue[0] == '\"' && rTrue[rTrue.getLength() - 1] == '\"')
1622  rTrue = rTrue.copy(1, rTrue.getLength() - 2);
1623  }
1624  if (rFalse.getLength() >= 2)
1625  {
1626  if (rFalse[0] == '\"' && rFalse[rFalse.getLength() - 1] == '\"')
1627  rFalse = rFalse.copy(1, rFalse.getLength() - 2);
1628  }
1629 
1630  // Note: do not make trim once again, while this is a user defined data
1631 }
1632 
1633 // field type for line height 0
1634 
1637 {
1638 }
1639 
1640 std::unique_ptr<SwFieldType> SwHiddenParaFieldType::Copy() const
1641 {
1642  return std::make_unique<SwHiddenParaFieldType>();
1643 }
1644 
1645 // field for line height 0
1646 
1648  : SwField(pTyp), m_aCond(rStr)
1649 {
1650  m_bIsHidden = false;
1651 }
1652 
1653 OUString SwHiddenParaField::ExpandImpl(SwRootFrame const*const) const
1654 {
1655  return OUString();
1656 }
1657 
1658 std::unique_ptr<SwField> SwHiddenParaField::Copy() const
1659 {
1660  std::unique_ptr<SwHiddenParaField> pField(new SwHiddenParaField(static_cast<SwHiddenParaFieldType*>(GetTyp()), m_aCond));
1661  pField->m_bIsHidden = m_bIsHidden;
1662  return std::unique_ptr<SwField>(pField.release());
1663 }
1664 
1665 bool SwHiddenParaField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
1666 {
1667  switch ( nWhichId )
1668  {
1669  case FIELD_PROP_PAR1:
1670  rAny <<= m_aCond;
1671  break;
1672  case FIELD_PROP_BOOL1:
1673  rAny <<= m_bIsHidden;
1674  break;
1675 
1676  default:
1677  assert(false);
1678  }
1679  return true;
1680 }
1681 
1682 bool SwHiddenParaField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
1683 {
1684  switch ( nWhichId )
1685  {
1686  case FIELD_PROP_PAR1:
1687  rAny >>= m_aCond;
1688  break;
1689  case FIELD_PROP_BOOL1:
1690  m_bIsHidden = *o3tl::doAccess<bool>(rAny);
1691  break;
1692 
1693  default:
1694  assert(false);
1695  }
1696  return true;
1697 }
1698 
1700 void SwHiddenParaField::SetPar1(const OUString& rStr)
1701 {
1702  m_aCond = rStr;
1703 }
1704 
1706 {
1707  return m_aCond;
1708 }
1709 
1710 // PostIt field type
1711 
1714  , mrDoc(rDoc)
1715 {}
1716 
1717 std::unique_ptr<SwFieldType> SwPostItFieldType::Copy() const
1718 {
1719  return std::make_unique<SwPostItFieldType>(mrDoc);
1720 }
1721 
1722 // PostIt field
1723 
1724 sal_uInt32 SwPostItField::s_nLastPostItId = 1;
1725 
1727  const OUString& rAuthor,
1728  const OUString& rText,
1729  const OUString& rInitials,
1730  const OUString& rName,
1731  const DateTime& rDateTime,
1732  const bool bResolved,
1733  const sal_uInt32 nPostItId
1734 )
1735  : SwField( pT )
1736  , m_sText( rText )
1737  , m_sAuthor( rAuthor )
1738  , m_sInitials( rInitials )
1739  , m_sName( rName )
1740  , m_aDateTime( rDateTime )
1741  , m_bResolved( bResolved )
1742 {
1743  m_nPostItId = nPostItId == 0 ? s_nLastPostItId++ : nPostItId;
1744 }
1745 
1747 {
1748  if ( m_xTextObject.is() )
1749  {
1750  m_xTextObject->DisposeEditSource();
1751  }
1752 
1753  mpText.reset();
1754 }
1755 
1756 OUString SwPostItField::ExpandImpl(SwRootFrame const*const) const
1757 {
1758  return OUString();
1759 }
1760 
1762 {
1763  return SwResId(STR_NOTE);
1764 }
1765 
1766 void SwPostItField::SetResolved(bool bNewState)
1767 {
1768  m_bResolved = bNewState;
1769 }
1770 
1772 {
1774 }
1775 
1777 {
1778  return m_bResolved;
1779 }
1780 
1781 std::unique_ptr<SwField> SwPostItField::Copy() const
1782 {
1783  std::unique_ptr<SwPostItField> pRet(new SwPostItField( static_cast<SwPostItFieldType*>(GetTyp()), m_sAuthor, m_sText, m_sInitials, m_sName,
1785  if (mpText)
1786  pRet->SetTextObject( *mpText );
1787 
1788  // Note: member <m_xTextObject> not copied.
1789 
1790  return std::unique_ptr<SwField>(pRet.release());
1791 }
1792 
1794 void SwPostItField::SetPar1(const OUString& rStr)
1795 {
1796  m_sAuthor = rStr;
1797 }
1798 
1800 OUString SwPostItField::GetPar1() const
1801 {
1802  return m_sAuthor;
1803 }
1804 
1806 void SwPostItField::SetPar2(const OUString& rStr)
1807 {
1808  m_sText = rStr;
1809 }
1810 
1812 OUString SwPostItField::GetPar2() const
1813 {
1814  return m_sText;
1815 }
1816 
1817 
1818 void SwPostItField::SetName(const OUString& rName)
1819 {
1820  m_sName = rName;
1821 }
1822 
1823 
1825 {
1826  mpText = std::move(pText);
1827 }
1828 
1830 {
1831  return mpText ? mpText->Count() : 1;
1832 }
1833 
1834 bool SwPostItField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
1835 {
1836  switch( nWhichId )
1837  {
1838  case FIELD_PROP_PAR1:
1839  rAny <<= m_sAuthor;
1840  break;
1841  case FIELD_PROP_PAR2:
1842  {
1843  rAny <<= m_sText;
1844  break;
1845  }
1846  case FIELD_PROP_PAR3:
1847  rAny <<= m_sInitials;
1848  break;
1849  case FIELD_PROP_PAR4:
1850  rAny <<= m_sName;
1851  break;
1852  case FIELD_PROP_BOOL1:
1853  rAny <<= m_bResolved;
1854  break;
1855  case FIELD_PROP_TEXT:
1856  {
1857  if ( !m_xTextObject.is() )
1858  {
1859  SwPostItFieldType* pGetType = static_cast<SwPostItFieldType*>(GetTyp());
1860  SwDoc& rDoc = pGetType->GetDoc();
1861  auto pObj = std::make_unique<SwTextAPIEditSource>( &rDoc );
1862  const_cast <SwPostItField*> (this)->m_xTextObject = new SwTextAPIObject( std::move(pObj) );
1863  }
1864 
1865  if ( mpText )
1866  m_xTextObject->SetText( *mpText );
1867  else
1868  m_xTextObject->SetString( m_sText );
1869 
1870  uno::Reference < text::XText > xText( m_xTextObject );
1871  rAny <<= xText;
1872  break;
1873  }
1874  case FIELD_PROP_DATE:
1875  {
1876  rAny <<= m_aDateTime.GetUNODate();
1877  }
1878  break;
1879  case FIELD_PROP_DATE_TIME:
1880  {
1881  rAny <<= m_aDateTime.GetUNODateTime();
1882  }
1883  break;
1884  default:
1885  assert(false);
1886  }
1887  return true;
1888 }
1889 
1890 bool SwPostItField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
1891 {
1892  switch( nWhichId )
1893  {
1894  case FIELD_PROP_PAR1:
1895  rAny >>= m_sAuthor;
1896  break;
1897  case FIELD_PROP_PAR2:
1898  rAny >>= m_sText;
1899  //#i100374# new string via api, delete complex text object so SwPostItNote picks up the new string
1900  mpText.reset();
1901  break;
1902  case FIELD_PROP_PAR3:
1903  rAny >>= m_sInitials;
1904  break;
1905  case FIELD_PROP_PAR4:
1906  rAny >>= m_sName;
1907  break;
1908  case FIELD_PROP_BOOL1:
1909  rAny >>= m_bResolved;
1910  break;
1911  case FIELD_PROP_TEXT:
1912  OSL_FAIL("Not implemented!");
1913  break;
1914  case FIELD_PROP_DATE:
1915  if( auto aSetDate = o3tl::tryAccess<util::Date>(rAny) )
1916  {
1917  m_aDateTime = Date(aSetDate->Day, aSetDate->Month, aSetDate->Year);
1918  }
1919  break;
1920  case FIELD_PROP_DATE_TIME:
1921  {
1922  util::DateTime aDateTimeValue;
1923  if(!(rAny >>= aDateTimeValue))
1924  return false;
1925  m_aDateTime = DateTime(aDateTimeValue);
1926  }
1927  break;
1928  default:
1929  assert(false);
1930  }
1931  return true;
1932 }
1933 
1935 {
1936  (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwPostItField"));
1937  (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("name"), BAD_CAST(GetName().toUtf8().getStr()));
1938 
1939  SwField::dumpAsXml(pWriter);
1940 
1941  (void)xmlTextWriterStartElement(pWriter, BAD_CAST("mpText"));
1942  (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", mpText ? &*mpText : nullptr);
1943  if (mpText)
1944  mpText->dumpAsXml(pWriter);
1945  (void)xmlTextWriterEndElement(pWriter);
1946 
1947  (void)xmlTextWriterEndElement(pWriter);
1948 }
1949 
1950 // extended user information field type
1951 
1954 {
1955 }
1956 
1957 std::unique_ptr<SwFieldType> SwExtUserFieldType::Copy() const
1958 {
1959  return std::make_unique<SwExtUserFieldType>();
1960 }
1961 
1962 OUString SwExtUserFieldType::Expand(sal_uInt16 nSub )
1963 {
1964  UserOptToken nRet = static_cast<UserOptToken>(USHRT_MAX);
1965  switch(nSub)
1966  {
1967  case EU_FIRSTNAME: nRet = UserOptToken::FirstName; break;
1968  case EU_NAME: nRet = UserOptToken::LastName; break;
1969  case EU_SHORTCUT: nRet = UserOptToken::ID; break;
1970 
1971  case EU_COMPANY: nRet = UserOptToken::Company; break;
1972  case EU_STREET: nRet = UserOptToken::Street; break;
1973  case EU_TITLE: nRet = UserOptToken::Title; break;
1974  case EU_POSITION: nRet = UserOptToken::Position; break;
1975  case EU_PHONE_PRIVATE: nRet = UserOptToken::TelephoneHome; break;
1976  case EU_PHONE_COMPANY: nRet = UserOptToken::TelephoneWork; break;
1977  case EU_FAX: nRet = UserOptToken::Fax; break;
1978  case EU_EMAIL: nRet = UserOptToken::Email; break;
1979  case EU_COUNTRY: nRet = UserOptToken::Country; break;
1980  case EU_ZIP: nRet = UserOptToken::Zip; break;
1981  case EU_CITY: nRet = UserOptToken::City; break;
1982  case EU_STATE: nRet = UserOptToken::State; break;
1983  case EU_FATHERSNAME: nRet = UserOptToken::FathersName; break;
1984  case EU_APARTMENT: nRet = UserOptToken::Apartment; break;
1985  default: OSL_ENSURE( false, "Field unknown");
1986  }
1987  if( static_cast<UserOptToken>(USHRT_MAX) != nRet )
1988  {
1989  SvtUserOptions& rUserOpt = SW_MOD()->GetUserOptions();
1990  return rUserOpt.GetToken( nRet );
1991  }
1992  return OUString();
1993 }
1994 
1995 // extended user information field
1996 
1997 SwExtUserField::SwExtUserField(SwExtUserFieldType* pTyp, sal_uInt16 nSubTyp, sal_uInt32 nFormat) :
1998  SwField(pTyp, nFormat), m_nType(nSubTyp)
1999 {
2001 }
2002 
2003 OUString SwExtUserField::ExpandImpl(SwRootFrame const*const) const
2004 {
2005  if (!IsFixed())
2007 
2008  return m_aContent;
2009 }
2010 
2011 std::unique_ptr<SwField> SwExtUserField::Copy() const
2012 {
2013  std::unique_ptr<SwExtUserField> pField(new SwExtUserField(static_cast<SwExtUserFieldType*>(GetTyp()), m_nType, GetFormat()));
2014  pField->SetExpansion(m_aContent);
2015 
2016  return std::unique_ptr<SwField>(pField.release());
2017 }
2018 
2019 sal_uInt16 SwExtUserField::GetSubType() const
2020 {
2021  return m_nType;
2022 }
2023 
2024 void SwExtUserField::SetSubType(sal_uInt16 nSub)
2025 {
2026  m_nType = nSub;
2027 }
2028 
2029 bool SwExtUserField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
2030 {
2031  switch( nWhichId )
2032  {
2033  case FIELD_PROP_PAR1:
2034  rAny <<= m_aContent;
2035  break;
2036 
2037  case FIELD_PROP_USHORT1:
2038  {
2039  sal_Int16 nTmp = m_nType;
2040  rAny <<= nTmp;
2041  }
2042  break;
2043  case FIELD_PROP_BOOL1:
2044  rAny <<= IsFixed();
2045  break;
2046  default:
2047  assert(false);
2048  }
2049  return true;
2050 }
2051 
2052 bool SwExtUserField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
2053 {
2054  switch( nWhichId )
2055  {
2056  case FIELD_PROP_PAR1:
2057  rAny >>= m_aContent;
2058  break;
2059 
2060  case FIELD_PROP_USHORT1:
2061  {
2062  sal_Int16 nTmp = 0;
2063  rAny >>= nTmp;
2064  m_nType = nTmp;
2065  }
2066  break;
2067  case FIELD_PROP_BOOL1:
2068  if( *o3tl::doAccess<bool>(rAny) )
2070  else
2072  break;
2073  default:
2074  assert(false);
2075  }
2076  return true;
2077 }
2078 
2079 // field type for relative page numbers
2080 
2083 {
2084 }
2085 
2086 std::unique_ptr<SwFieldType> SwRefPageSetFieldType::Copy() const
2087 {
2088  return std::make_unique<SwRefPageSetFieldType>();
2089 }
2090 
2091 // overridden since there is nothing to update
2093 {
2094 }
2095 
2096 // field for relative page numbers
2097 
2099  short nOff, bool bFlag )
2100  : SwField( pTyp ), m_nOffset( nOff ), m_bOn( bFlag )
2101 {
2102 }
2103 
2104 OUString SwRefPageSetField::ExpandImpl(SwRootFrame const*const) const
2105 {
2106  return OUString();
2107 }
2108 
2109 std::unique_ptr<SwField> SwRefPageSetField::Copy() const
2110 {
2111  return std::make_unique<SwRefPageSetField>( static_cast<SwRefPageSetFieldType*>(GetTyp()), m_nOffset, m_bOn );
2112 }
2113 
2115 {
2116  return OUString::number(GetOffset());
2117 }
2118 
2119 void SwRefPageSetField::SetPar2(const OUString& rStr)
2120 {
2121  SetOffset( static_cast<short>(rStr.toInt32()) );
2122 }
2123 
2124 bool SwRefPageSetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
2125 {
2126  switch( nWhichId )
2127  {
2128  case FIELD_PROP_BOOL1:
2129  rAny <<= m_bOn;
2130  break;
2131  case FIELD_PROP_USHORT1:
2132  rAny <<= static_cast<sal_Int16>(m_nOffset);
2133  break;
2134  default:
2135  assert(false);
2136  }
2137  return true;
2138 }
2139 
2140 bool SwRefPageSetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
2141 {
2142  switch( nWhichId )
2143  {
2144  case FIELD_PROP_BOOL1:
2145  m_bOn = *o3tl::doAccess<bool>(rAny);
2146  break;
2147  case FIELD_PROP_USHORT1:
2148  rAny >>=m_nOffset;
2149  break;
2150  default:
2151  assert(false);
2152  }
2153  return true;
2154 }
2155 
2156 // relative page numbers - query field
2157 
2159  : SwFieldType( SwFieldIds::RefPageGet ), m_rDoc( rDc ), m_nNumberingType( SVX_NUM_ARABIC )
2160 {
2161 }
2162 
2163 std::unique_ptr<SwFieldType> SwRefPageGetFieldType::Copy() const
2164 {
2165  std::unique_ptr<SwRefPageGetFieldType> pNew(new SwRefPageGetFieldType( m_rDoc ));
2166  pNew->m_nNumberingType = m_nNumberingType;
2167  return pNew;
2168 }
2169 
2171 {
2172  if (rHint.GetId() != SfxHintId::SwLegacyModify)
2173  return;
2174  auto pLegacy = static_cast<const sw::LegacyModifyHint*>(&rHint);
2175  auto const ModifyImpl = [this](SwRootFrame const*const pLayout)
2176  {
2177  // first collect all SetPageRefFields
2178  SetGetExpFields aTmpLst;
2179  if (MakeSetList(aTmpLst, pLayout))
2180  {
2181  std::vector<SwFormatField*> vFields;
2182  GatherFields(vFields);
2183  for(auto pFormatField: vFields)
2184  UpdateField(pFormatField->GetTextField(), aTmpLst, pLayout);
2185  }
2186  };
2187 
2188  // update all GetReference fields
2189  if( !pLegacy->m_pNew && !pLegacy->m_pOld && HasWriterListeners() )
2190  {
2191  SwRootFrame const* pLayout(nullptr);
2192  SwRootFrame const* pLayoutRLHidden(nullptr);
2193  for (SwRootFrame const*const pLay : m_rDoc.GetAllLayouts())
2194  {
2195  if (pLay->IsHideRedlines())
2196  {
2197  pLayoutRLHidden = pLay;
2198  }
2199  else
2200  {
2201  pLayout = pLay;
2202  }
2203  }
2204  ModifyImpl(pLayout);
2205  if (pLayoutRLHidden)
2206  {
2207  ModifyImpl(pLayoutRLHidden);
2208  }
2209  }
2210 
2211  // forward to text fields, they "expand" the text
2212  CallSwClientNotify(rHint);
2213 }
2214 
2216  SwRootFrame const*const pLayout)
2217 {
2219  std::vector<SwFormatField*> vFields;
2220  GatherFields(vFields);
2221  for(auto pFormatField: vFields)
2222  {
2223  // update only the GetRef fields
2224  const SwTextField* pTField = pFormatField->GetTextField();
2225  if (!pLayout || !pLayout->IsHideRedlines() || !sw::IsFieldDeletedInModel(rIDRA, *pTField))
2226  {
2227  const SwTextNode& rTextNd = pTField->GetTextNode();
2228 
2229  // Always the first! (in Tab-Headline, header/footer )
2230  Point aPt;
2231  std::pair<Point, bool> const tmp(aPt, false);
2232  const SwContentFrame *const pFrame = rTextNd.getLayoutFrame(
2233  pLayout, nullptr, &tmp);
2234 
2235  std::unique_ptr<SetGetExpField> pNew;
2236 
2237  if( !pFrame ||
2238  pFrame->IsInDocBody() ||
2239  // #i31868#
2240  // Check if pFrame is not yet connected to the layout.
2241  !pFrame->FindPageFrame() )
2242  {
2243  // create index for determination of the TextNode
2244  SwNodeIndex aIdx( rTextNd );
2245  pNew.reset( new SetGetExpField( aIdx, pTField ) );
2246  }
2247  else
2248  {
2249  // create index for determination of the TextNode
2251  bool const bResult = GetBodyTextNode( m_rDoc, aPos, *pFrame );
2252  OSL_ENSURE(bResult, "where is the Field?");
2253  pNew.reset( new SetGetExpField( aPos.nNode, pTField,
2254  &aPos.nContent ) );
2255  }
2256 
2257  rTmpLst.insert( std::move(pNew) );
2258  }
2259  }
2260  return !rTmpLst.empty();
2261 }
2262 
2264  SetGetExpFields const & rSetList,
2265  SwRootFrame const*const pLayout)
2266 {
2267  SwRefPageGetField* pGetField = const_cast<SwRefPageGetField*>(static_cast<const SwRefPageGetField*>(pTextField->GetFormatField().GetField()));
2268  pGetField->SetText( OUString(), pLayout );
2269 
2270  // then search the correct RefPageSet field
2271  SwTextNode* pTextNode = &pTextField->GetTextNode();
2272  if( pTextNode->StartOfSectionIndex() >
2274  {
2275  SwNodeIndex aIdx( *pTextNode );
2276  SetGetExpField aEndField( aIdx, pTextField );
2277 
2278  SetGetExpFields::const_iterator itLast = rSetList.lower_bound( &aEndField );
2279 
2280  if( itLast != rSetList.begin() )
2281  {
2282  --itLast;
2283  const SwTextField* pRefTextField = (*itLast)->GetTextField();
2284  const SwRefPageSetField* pSetField =
2285  static_cast<const SwRefPageSetField*>(pRefTextField->GetFormatField().GetField());
2286  if( pSetField->IsOn() )
2287  {
2288  // determine the correct offset
2289  Point aPt;
2290  std::pair<Point, bool> const tmp(aPt, false);
2291  const SwContentFrame *const pFrame = pTextNode->getLayoutFrame(
2292  pLayout, nullptr, &tmp);
2293  const SwContentFrame *const pRefFrame = pRefTextField->GetTextNode().getLayoutFrame(
2294  pLayout, nullptr, &tmp);
2295  const SwPageFrame* pPgFrame = nullptr;
2296  short nDiff = 1;
2297  if ( pFrame && pRefFrame )
2298  {
2299  pPgFrame = pFrame->FindPageFrame();
2300  nDiff = pPgFrame->GetPhyPageNum() -
2301  pRefFrame->FindPageFrame()->GetPhyPageNum() + 1;
2302  }
2303 
2304  SvxNumType nTmpFormat = SVX_NUM_PAGEDESC == static_cast<SvxNumType>(pGetField->GetFormat())
2305  ? ( !pPgFrame
2306  ? SVX_NUM_ARABIC
2307  : pPgFrame->GetPageDesc()->GetNumType().GetNumberingType() )
2308  : static_cast<SvxNumType>(pGetField->GetFormat());
2309  const short nPageNum = std::max<short>(0, pSetField->GetOffset() + nDiff);
2310  pGetField->SetText(FormatNumber(nPageNum, nTmpFormat), pLayout);
2311  }
2312  }
2313  }
2314  // start formatting
2315  const_cast<SwFormatField&>(pTextField->GetFormatField()).UpdateTextNode(nullptr, nullptr);
2316 }
2317 
2318 // queries for relative page numbering
2319 
2321  sal_uInt32 nFormat )
2322  : SwField( pTyp, nFormat )
2323 {
2324 }
2325 
2326 void SwRefPageGetField::SetText(const OUString& rText,
2327  SwRootFrame const*const pLayout)
2328 {
2329  if (!pLayout || !pLayout->IsHideRedlines())
2330  {
2331  m_sText = rText;
2332  }
2333  if (!pLayout || pLayout->IsHideRedlines())
2334  {
2335  m_sTextRLHidden = rText;
2336  }
2337 }
2338 
2339 OUString SwRefPageGetField::ExpandImpl(SwRootFrame const*const pLayout) const
2340 {
2341  return pLayout && pLayout->IsHideRedlines() ? m_sTextRLHidden : m_sText;
2342 }
2343 
2344 std::unique_ptr<SwField> SwRefPageGetField::Copy() const
2345 {
2346  std::unique_ptr<SwRefPageGetField> pCpy(new SwRefPageGetField(
2347  static_cast<SwRefPageGetFieldType*>(GetTyp()), GetFormat() ));
2348  pCpy->m_sText = m_sText;
2349  pCpy->m_sTextRLHidden = m_sTextRLHidden;
2350  return std::unique_ptr<SwField>(pCpy.release());
2351 }
2352 
2354  const SwTextField* pField )
2355 {
2356  // only fields in Footer, Header, FootNote, Flys
2357  SwRefPageGetFieldType* pGetType = static_cast<SwRefPageGetFieldType*>(GetTyp());
2358  SwDoc& rDoc = pGetType->GetDoc();
2359  if( pField->GetTextNode().StartOfSectionIndex() >
2360  rDoc.GetNodes().GetEndOfExtras().GetIndex() )
2361  return;
2362 
2363  SwRootFrame const& rLayout(*rFrame.getRootFrame());
2364  OUString & rText(rLayout.IsHideRedlines() ? m_sTextRLHidden : m_sText);
2365  rText.clear();
2366 
2367  OSL_ENSURE(!rFrame.IsInDocBody(), "Flag incorrect, frame is in DocBody");
2368 
2369  // collect all SetPageRefFields
2370  SetGetExpFields aTmpLst;
2371  if (!pGetType->MakeSetList(aTmpLst, &rLayout))
2372  return ;
2373 
2374  // create index for determination of the TextNode
2375  SwPosition aPos( SwNodeIndex( rDoc.GetNodes() ) );
2376  SwTextNode* pTextNode = const_cast<SwTextNode*>(GetBodyTextNode(rDoc, aPos, rFrame));
2377 
2378  // If no layout exists, ChangeExpansion is called for header and
2379  // footer lines via layout formatting without existing TextNode.
2380  if(!pTextNode)
2381  return;
2382 
2383  SetGetExpField aEndField( aPos.nNode, pField, &aPos.nContent );
2384 
2385  SetGetExpFields::const_iterator itLast = aTmpLst.lower_bound( &aEndField );
2386 
2387  if( itLast == aTmpLst.begin() )
2388  return; // there is no corresponding set-field in front
2389  --itLast;
2390 
2391  const SwTextField* pRefTextField = (*itLast)->GetTextField();
2392  const SwRefPageSetField* pSetField =
2393  static_cast<const SwRefPageSetField*>(pRefTextField->GetFormatField().GetField());
2394  Point aPt;
2395  std::pair<Point, bool> const tmp(aPt, false);
2396  const SwContentFrame *const pRefFrame = pRefTextField->GetTextNode().getLayoutFrame(
2397  &rLayout, nullptr, &tmp);
2398  if( !(pSetField->IsOn() && pRefFrame) )
2399  return;
2400 
2401  // determine the correct offset
2402  const SwPageFrame* pPgFrame = rFrame.FindPageFrame();
2403  const short nDiff = pPgFrame->GetPhyPageNum() -
2404  pRefFrame->FindPageFrame()->GetPhyPageNum() + 1;
2405 
2406  SwRefPageGetField* pGetField = const_cast<SwRefPageGetField*>(static_cast<const SwRefPageGetField*>(pField->GetFormatField().GetField()));
2407  SvxNumType nTmpFormat = SVX_NUM_PAGEDESC == pGetField->GetFormat()
2408  ? pPgFrame->GetPageDesc()->GetNumType().GetNumberingType()
2409  : static_cast<SvxNumType>(pGetField->GetFormat());
2410  const short nPageNum = std::max<short>(0, pSetField->GetOffset() + nDiff);
2411  pGetField->SetText(FormatNumber(nPageNum, nTmpFormat), &rLayout);
2412 }
2413 
2414 bool SwRefPageGetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
2415 {
2416  switch( nWhichId )
2417  {
2418  case FIELD_PROP_USHORT1:
2419  rAny <<= static_cast<sal_Int16>(GetFormat());
2420  break;
2421  case FIELD_PROP_PAR1:
2422  rAny <<= m_sText;
2423  break;
2424  default:
2425  assert(false);
2426  }
2427  return true;
2428 }
2429 
2430 bool SwRefPageGetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
2431 {
2432  switch( nWhichId )
2433  {
2434  case FIELD_PROP_USHORT1:
2435  {
2436  sal_Int16 nSet = 0;
2437  rAny >>= nSet;
2438  if(nSet <= SVX_NUM_PAGEDESC )
2439  SetFormat(nSet);
2440  }
2441  break;
2442  case FIELD_PROP_PAR1:
2443  rAny >>= m_sText;
2445  break;
2446  default:
2447  assert(false);
2448  }
2449  return true;
2450 }
2451 
2452 // field type to jump to and edit
2453 
2455  : SwFieldType( SwFieldIds::JumpEdit ), m_rDoc( rD ), m_aDep( *this )
2456 {
2457 }
2458 
2459 std::unique_ptr<SwFieldType> SwJumpEditFieldType::Copy() const
2460 {
2461  return std::make_unique<SwJumpEditFieldType>( m_rDoc );
2462 }
2463 
2465 {
2467  m_aDep.StartListening(pFormat);
2468  return pFormat;
2469 }
2470 
2472  const OUString& rText, const OUString& rHelp )
2473  : SwField( pTyp, nForm ), m_sText( rText ), m_sHelp( rHelp )
2474 {
2475 }
2476 
2477 OUString SwJumpEditField::ExpandImpl(SwRootFrame const*const) const
2478 {
2479  return "<" + m_sText + ">";
2480 }
2481 
2482 std::unique_ptr<SwField> SwJumpEditField::Copy() const
2483 {
2484  return std::make_unique<SwJumpEditField>( static_cast<SwJumpEditFieldType*>(GetTyp()), GetFormat(),
2485  m_sText, m_sHelp );
2486 }
2487 
2490 {
2491  return m_sText;
2492 }
2493 
2495 void SwJumpEditField::SetPar1(const OUString& rStr)
2496 {
2497  m_sText = rStr;
2498 }
2499 
2502 {
2503  return m_sHelp;
2504 }
2505 
2507 void SwJumpEditField::SetPar2(const OUString& rStr)
2508 {
2509  m_sHelp = rStr;
2510 }
2511 
2512 bool SwJumpEditField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
2513 {
2514  switch( nWhichId )
2515  {
2516  case FIELD_PROP_USHORT1:
2517  {
2518  sal_Int16 nRet;
2519  switch( GetFormat() )
2520  {
2521  case JE_FMT_TABLE: nRet = text::PlaceholderType::TABLE; break;
2522  case JE_FMT_FRAME: nRet = text::PlaceholderType::TEXTFRAME; break;
2523  case JE_FMT_GRAPHIC:nRet = text::PlaceholderType::GRAPHIC; break;
2524  case JE_FMT_OLE: nRet = text::PlaceholderType::OBJECT; break;
2525  default:
2526  nRet = text::PlaceholderType::TEXT; break;
2527  }
2528  rAny <<= nRet;
2529  }
2530  break;
2531  case FIELD_PROP_PAR1 :
2532  rAny <<= m_sHelp;
2533  break;
2534  case FIELD_PROP_PAR2 :
2535  rAny <<= m_sText;
2536  break;
2537  default:
2538  assert(false);
2539  }
2540  return true;
2541 }
2542 
2543 bool SwJumpEditField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
2544 {
2545  switch( nWhichId )
2546  {
2547  case FIELD_PROP_USHORT1:
2548  {
2549  //JP 24.10.2001: int32 because in UnoField.cxx a putvalue is
2550  // called with a int32 value! But normally we need
2551  // here only a int16
2552  sal_Int32 nSet = 0;
2553  rAny >>= nSet;
2554  switch( nSet )
2555  {
2556  case text::PlaceholderType::TEXT : SetFormat(JE_FMT_TEXT); break;
2557  case text::PlaceholderType::TABLE : SetFormat(JE_FMT_TABLE); break;
2558  case text::PlaceholderType::TEXTFRAME: SetFormat(JE_FMT_FRAME); break;
2559  case text::PlaceholderType::GRAPHIC : SetFormat(JE_FMT_GRAPHIC); break;
2560  case text::PlaceholderType::OBJECT : SetFormat(JE_FMT_OLE); break;
2561  }
2562  }
2563  break;
2564  case FIELD_PROP_PAR1 :
2565  rAny >>= m_sHelp;
2566  break;
2567  case FIELD_PROP_PAR2 :
2568  rAny >>= m_sText;
2569  break;
2570  default:
2571  assert(false);
2572  }
2573  return true;
2574 }
2575 
2576 // combined character field type
2577 
2580 {
2581 }
2582 
2583 std::unique_ptr<SwFieldType> SwCombinedCharFieldType::Copy() const
2584 {
2585  return std::make_unique<SwCombinedCharFieldType>();
2586 }
2587 
2588 // combined character field
2589 
2591  const OUString& rChars )
2592  : SwField( pFTyp, 0 ),
2593  m_sCharacters( rChars.copy( 0, std::min<sal_Int32>(rChars.getLength(), MAX_COMBINED_CHARACTERS) ))
2594 {
2595 }
2596 
2598 {
2599  return m_sCharacters;
2600 }
2601 
2602 std::unique_ptr<SwField> SwCombinedCharField::Copy() const
2603 {
2604  return std::make_unique<SwCombinedCharField>( static_cast<SwCombinedCharFieldType*>(GetTyp()),
2605  m_sCharacters );
2606 }
2607 
2609 {
2610  return m_sCharacters;
2611 }
2612 
2613 void SwCombinedCharField::SetPar1(const OUString& rStr)
2614 {
2615  m_sCharacters = rStr.copy(0, std::min<sal_Int32>(rStr.getLength(), MAX_COMBINED_CHARACTERS));
2616 }
2617 
2619  sal_uInt16 nWhichId ) const
2620 {
2621  switch( nWhichId )
2622  {
2623  case FIELD_PROP_PAR1:
2624  rAny <<= m_sCharacters;
2625  break;
2626  default:
2627  assert(false);
2628  }
2629  return true;
2630 }
2631 
2633  sal_uInt16 nWhichId )
2634 {
2635  switch( nWhichId )
2636  {
2637  case FIELD_PROP_PAR1:
2638  {
2639  OUString sTmp;
2640  rAny >>= sTmp;
2641  SetPar1(sTmp);
2642  }
2643  break;
2644  default:
2645  assert(false);
2646  }
2647  return true;
2648 }
2649 
2650 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual SwCharFormat * GetCharFormatFromPool(sal_uInt16 nId)=0
Reference< XTypeConverter > xConverter
virtual void SetPar1(const OUString &rStr) override
set place holder text
Definition: docufld.cxx:2495
SwDoc & GetDoc() const
Definition: docufld.hxx:442
SvxNumType GetNumberingType() const
Instances of SwFields and those derived from it occur 0 to n times.
Definition: fldbas.hxx:242
static sal_uInt32 s_nLastPostItId
Definition: docufld.hxx:461
const SwDocInfoSubType DI_SUB_TIME
Definition: docufld.hxx:84
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
Definition: nodeoffset.hxx:35
Base class of the Writer layout elements.
Definition: frame.hxx:315
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(93)
const_iterator lower_bound(const Value &x) const
IDocumentStatistics const & getIDocumentStatistics() const
Definition: doc.cxx:373
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
Definition: docufld.cxx:1025
SwDoc & GetDoc() const
Definition: docufld.hxx:627
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: fldbas.cxx:844
SwPostItField(SwPostItFieldType *, const OUString &rAuthor, const OUString &rText, const OUString &rInitials, const OUString &rName, const DateTime &rDate, const bool bResolved=false, const sal_uInt32 nPostItId=0)
Definition: docufld.cxx:1726
static double lcl_TimeToDouble(const T &rTime)
Definition: docufld.cxx:1007
OUString GetToken(UserOptToken nToken) const
sal_Int32 GetNumberOfParagraphs() const
Definition: docufld.cxx:1829
#define FIELD_PROP_DATE_TIME
Definition: unofldmid.h:38
Marks a position in the document model.
Definition: pam.hxx:36
virtual void SetPar1(const OUString &rStr) override
Definition: docufld.cxx:2613
virtual void SetPar2(const OUString &rStr) override
True/False - String.
Definition: docufld.cxx:1418
const SwField * GetField() const
Definition: fmtfld.hxx:116
bool IsInDocBody() const
Definition: frame.hxx:944
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhich) const override
Definition: docufld.cxx:1153
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
Definition: fmtpdsc.hxx:35
LanguageType GetLanguage() const
Language at field position.
Definition: fldbas.hxx:406
sal_uInt16 m_nPageNumber
Definition: docufld.hxx:153
virtual std::unique_ptr< SwFieldType > Copy() const override
Definition: docufld.cxx:2459
sal_uLong nPara
paragraphs for document statistic: non-empty and non-hidden ones
Definition: docstat.hxx:32
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhich) override
Definition: docufld.cxx:2632
virtual const SwRootFrame * GetCurrentLayout() const =0
static ShellResource * GetShellRes()
Definition: viewsh.cxx:2604
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhich) override
Definition: docufld.cxx:2140
DateTime m_aDateTime
Definition: docufld.hxx:454
OUString sDurationFormat
Definition: shellres.hxx:50
SwDocShell * GetDocShell()
Definition: doc.hxx:1352
sal_uInt32 GetFormat() const
Query parameters for dialog and for BASIC.
Definition: fldbas.hxx:401
virtual sal_uInt16 GetSubType() const override
Definition: docufld.cxx:2019
SvNumberFormatter * GetNumberFormatter(bool bCreate=true)
Definition: doc.hxx:1411
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
noop, there is nothing to update!
Definition: docufld.cxx:2092
SwDocStatField(SwDocStatFieldType *, sal_uInt16 nSubType, sal_uInt32 nFormat)
Definition: docufld.cxx:756
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
Definition: docufld.cxx:634
virtual OUString GetPar2() const override
Definition: docufld.cxx:2114
SwNodeOffset StartOfSectionIndex() const
Definition: node.hxx:675
virtual std::unique_ptr< SwFieldType > Copy() const override
Definition: docufld.cxx:322
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhich) const override
Definition: docufld.cxx:234
SwNodeIndex nNode
Definition: pam.hxx:38
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: docufld.cxx:1934
sal_uInt16 char char * pDesc
void ChangeExpansion(const SwFrame &rFrame, const SwTextField *pField)
Definition: docufld.cxx:2353
const SwTextNode * GetBodyTextNode(const SwDoc &rDoc, SwPosition &rPos, const SwFrame &rFrame)
Forward declaration: get "BodyTextNode" for exp.fld in Fly's headers/footers/footnotes.
Definition: expfld.cxx:163
bool GetLogicNames(const OUString &rPath, OUString &rRegion, OUString &rName) const
SVX_NUM_NUMBER_NONE
OUString m_sUserStr
Definition: docufld.hxx:149
sal_uIntPtr sal_uLong
long Long
OUString sDataSource
Definition: swdbdata.hxx:30
virtual std::unique_ptr< SwField > Copy() const override
Definition: docufld.cxx:2011
bool IsFixed() const
Definition: fldbas.cxx:443
Base class of all fields.
Definition: fldbas.hxx:293
OUString Expand(sal_uLong) const
Definition: docufld.cxx:575
virtual void SetPar2(const OUString &rStr) override
set the PostIt's text
Definition: docufld.cxx:1806
#define FIELD_PROP_USHORT1
Definition: unofldmid.h:31
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhich) const override
Definition: docufld.cxx:1665
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
Definition: node.cxx:1213
css::uno::Reference< css::frame::XModel3 > GetModel() const
Definition: doc.hxx:188
virtual std::unique_ptr< SwFieldType > Copy() const override
Definition: docufld.cxx:2583
SVL_DLLPUBLIC OUString removePassword(OUString const &rURI, INetURLObject::EncodeMechanism eEncodeMechanism, INetURLObject::DecodeMechanism eDecodeMechanism=INetURLObject::DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
virtual OUString GetPar2() const override
Definition: docufld.cxx:219
sal_uLong nChar
Definition: docstat.hxx:37
sal_uInt16 nTable
Definition: docstat.hxx:27
virtual OUString GetPar1() const override
Author.
Definition: docufld.cxx:1800
OUString m_aTRUEText
Text if condition true.
Definition: docufld.hxx:299
const SwDocInfoSubType DI_COMMENT
Definition: docufld.hxx:74
sal_Int16 m_nNumberingType
Definition: docufld.hxx:616
static double GetDateTime(SwDoc &rDoc, const DateTime &rDT)
Definition: flddat.cxx:122
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhich) override
Definition: docufld.cxx:803
#define URL_DECODE
Definition: docufld.cxx:91
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhich) const override
Definition: docufld.cxx:483
OUString m_aCond
Condition.
Definition: docufld.hxx:303
void ToggleResolved()
Definition: docufld.cxx:1771
OUString GetLastName(DecodeMechanism eMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
SwRefPageGetField(SwRefPageGetFieldType *, sal_uInt32 nFormat)
Definition: docufld.cxx:2320
SwNode & GetEndOfPostIts() const
A still empty section.
Definition: ndarr.hxx:150
static sal_Int32 DateToDays(sal_uInt16 nDay, sal_uInt16 nMonth, sal_Int16 nYear)
bool IsInMerge() const
Definition: dbmgr.hxx:342
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
Definition: docufld.cxx:761
SwFileNameField(SwFileNameFieldType *, sal_uInt32 nFormat)
Definition: docufld.cxx:460
virtual std::unique_ptr< SwField > Copy() const override
Definition: docufld.cxx:2482
SwDoc * GetDoc() const
Definition: fldbas.hxx:457
SwJumpEditField(SwJumpEditFieldType *, sal_uInt32 nFormat, const OUString &sText, const OUString &sHelp)
Definition: docufld.cxx:2471
OUString m_aContent
Definition: docufld.hxx:190
void SetResolved(bool bNewState)
Definition: docufld.cxx:1766
static const OUString & GetTypeStr(SwFieldTypesEnum nTypeId)
Definition: fldbas.cxx:122
bool HasWriterListeners() const
Definition: calbck.hxx:203
SwTemplNameField(SwTemplNameFieldType *, sal_uInt32 nFormat)
Definition: docufld.cxx:630
The root element of a Writer document layout.
Definition: rootfrm.hxx:82
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhich) const override
Definition: docufld.cxx:2029
const SwDocInfoSubType DI_EDIT
Definition: docufld.hxx:79
virtual std::unique_ptr< SwField > Copy() const override
Definition: docufld.cxx:342
#define FIELD_PROP_SUBTYPE
Definition: unofldmid.h:27
SfxHintId GetId() const
static void ParseIfFieldDefinition(const OUString &aFieldDefinition, OUString &rCondition, OUString &rTrue, OUString &rFalse)
Definition: docufld.cxx:1534
SvxNumType
static LanguageType nLang
Definition: srtdlg.cxx:51
void GatherFields(std::vector< SwFormatField * > &rvFormatFields, bool bCollectOnlyInDocNodes=true) const
Definition: fldbas.cxx:208
#define FIELD_PROP_FORMAT
Definition: unofldmid.h:26
OUString PathToFileName() const
sal_uInt16 GetPhyPageNum() const
Definition: pagefrm.hxx:204
virtual std::unique_ptr< SwField > Copy() const override
Definition: docufld.cxx:2109
virtual std::unique_ptr< SwFieldType > Copy() const override
Definition: docufld.cxx:835
OUString GetBase() const
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:165
css::util::Date GetUNODate() const
SwDoc & m_rDoc
Definition: docbm.cxx:1204
rtl::Reference< SwTextAPIObject > m_xTextObject
Definition: docufld.hxx:457
const LocaleDataWrapper & GetLocaleData() const
OUString m_sName
OUString ReplacePoint(const OUString &rTmpName, bool bWithCommandType)
Definition: expfld.cxx:104
OUString m_sCharacters
combine these characters
Definition: docufld.hxx:741
virtual OUString GetFieldName() const override
get name or content
Definition: docufld.cxx:1102
SwIndex nContent
Definition: pam.hxx:39
void ChangeExpansion(SwDoc *pDoc, bool bVirtPageNum, const SvxNumType *pNumFormat)
Definition: docufld.cxx:130
sal_uInt16 GetMonth() const
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:426
OUString m_aContent
Definition: docufld.hxx:557
bool m_bResolved
Definition: docufld.hxx:455
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhichId)
Definition: fldbas.cxx:369
virtual sal_uInt16 GetSubType() const override
Definition: docufld.cxx:1135
#define MAX_COMBINED_CHARACTERS
Definition: docufld.hxx:737
virtual void SetPar1(const OUString &rStr) override
Condition.
Definition: docufld.cxx:1406
virtual std::unique_ptr< SwFieldType > Copy() const override
Definition: docufld.cxx:2163
SVX_NUM_ARABIC
const SwDocInfoSubType DI_SUBJECT
Definition: docufld.hxx:72
virtual void SetPar2(const OUString &rStr) override
set hint text
Definition: docufld.cxx:2507
virtual std::unique_ptr< SwField > Copy() const override
Definition: docufld.cxx:766
virtual void SetLanguage(LanguageType nLng) override
set language of the format
Definition: fldbas.cxx:694
OUString FormatNumber(sal_uInt32 nNum, SvxNumType nFormat, LanguageType nLang)
expand numbering
Definition: fldbas.cxx:507
void SetHiddenFlag(bool bSetHidden)
Definition: docufld.cxx:1256
double GetTimeInDays() const
virtual OUString GetPar1() const override
Placeholder-Text.
Definition: docufld.cxx:2489
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
Definition: docufld.cxx:183
OUString m_sText
Definition: docufld.hxx:633
const SwFormatField & GetFormatField() const
Definition: txatbase.hxx:195
o3tl::sorted_vector< SwRootFrame * > GetAllLayouts()
Definition: doclay.cxx:1670
virtual OUString GetPar1() const override
Characters.
Definition: docufld.cxx:2608
OUString Expand(sal_uInt16 nSubType, sal_uInt32 nFormat, LanguageType nLang, const OUString &rName) const
Definition: docufld.cxx:851
SwHiddenParaField(SwHiddenParaFieldType *, const OUString &rCond)
Direct input, delete old value.
Definition: docufld.cxx:1647
sal_uInt16 nOLE
Definition: docstat.hxx:29
virtual std::unique_ptr< SwFieldType > Copy() const override
Definition: docufld.cxx:2086
virtual void SetSubType(sal_uInt16 nSub) override
Definition: docufld.cxx:777
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhich) override
Definition: docufld.cxx:1682
virtual void SetSubType(sal_uInt16) override
Definition: docufld.cxx:1140
SwTemplNameFieldType(SwDoc &)
Definition: docufld.cxx:569
SwHiddenTextField(SwHiddenTextFieldType *, bool bConditional, const OUString &rCond, const OUString &rText, bool bHidden, SwFieldTypesEnum nSubType=SwFieldTypesEnum::HiddenText)
Definition: docufld.cxx:1265
#define FIELD_PROP_DOUBLE
Definition: unofldmid.h:34
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhich) override
Definition: docufld.cxx:2052
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhich) override
Definition: docufld.cxx:521
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhichId) const
Definition: fldbas.cxx:356
sal_Int32 getTokenCount(std::string_view rIn, char cTok)
virtual OUString GetPar1() const override
Query, set condition.
Definition: docufld.cxx:1705
constexpr OUStringLiteral aData
Definition: ww8scan.hxx:48
OUString m_sText
Definition: docufld.hxx:450
const SwDocInfoSubType DI_CUSTOM
Definition: docufld.hxx:80
DocumentType eType
css::util::DateTime GetUNODateTime() const
sal_Int16 GetYear() const
SVX_NUM_BITMAP
SVX_NUM_CHAR_SPECIAL
virtual std::unique_ptr< SwFieldType > Copy() const override
Definition: docufld.cxx:625
SwDoc * GetDoc()
returns Doc. But be careful!
Definition: docsh.hxx:204
OUString m_aName
Definition: docufld.hxx:525
static double lcl_DateToDouble(const D &rDate, const Date &rNullDate)
Definition: docufld.cxx:1018
const SwDocInfoSubType DI_PRINT
Definition: docufld.hxx:77
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhich) const override
Definition: docufld.cxx:1834
OUString m_aCond
Definition: docufld.hxx:366
SwAuthorField(SwAuthorFieldType *, sal_uInt32 nFormat)
Definition: docufld.cxx:327
#define SW_MOD()
Definition: swmodule.hxx:256
virtual std::unique_ptr< SwField > Copy() const override
Definition: docufld.cxx:1781
SwDBData const & GetDBData()
Definition: docfld.cxx:371
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhich) const override
Definition: docufld.cxx:2414
OUString m_sAuthor
Definition: docufld.hxx:451
int i
static OUString GetDBName(const OUString &rName, SwDoc &rDoc)
Definition: docufld.cxx:1518
void SetName(const OUString &rStr)
Definition: docufld.cxx:1818
virtual OUString GetFieldName() const override
get name or content
Definition: docufld.cxx:1380
virtual std::unique_ptr< SwFieldType > Copy() const override
Definition: docufld.cxx:455
SwRefPageGetFieldType(SwDoc &rDoc)
Definition: docufld.cxx:2158
virtual std::unique_ptr< SwField > Copy() const override
Definition: docufld.cxx:209
void Evaluate(SwDoc &rDoc)
get current field value and cache it
Definition: docufld.cxx:1325
virtual std::unique_ptr< SwFieldType > Copy() const override
Definition: docufld.cxx:1717
SwCharFormat * GetCharFormat()
Definition: docufld.cxx:2464
const SwDocInfoSubType DI_KEYS
Definition: docufld.hxx:73
bool GetMergeColumnCnt(const OUString &rColumnName, LanguageType nLanguage, OUString &rResult, double *pNumber)
Definition: dbmgr.cxx:2082
SwPageFrame * FindPageFrame()
Definition: frame.hxx:681
void ChangeExpansion(const SwFrame *pFrame)
Definition: docufld.cxx:782
#define FIELD_PROP_TEXT
Definition: unofldmid.h:48
#define FIELD_PROP_BOOL2
Definition: unofldmid.h:29
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
Definition: docufld.cxx:2003
sal_uInt16 m_nSubType
Definition: docufld.hxx:267
sal_uInt16 m_nSubType
Definition: docufld.hxx:523
TElementType * First()
Definition: calbck.hxx:357
SwPageDesc * GetPageDesc()
Definition: pagefrm.hxx:143
#define FIELD_PROP_USHORT2
Definition: unofldmid.h:32
virtual sal_uInt16 GetSubType() const override
Definition: docufld.cxx:229
OUString m_aFALSEText
If condition false.
Definition: docufld.hxx:300
SwNodeOffset GetIndex() const
Definition: node.hxx:292
const SwDocInfoSubType DI_CREATE
Definition: docufld.hxx:75
SwFieldTypesEnum
List of FieldTypes at UI.
Definition: fldbas.hxx:95
SwFieldIds
Definition: fldbas.hxx:46
virtual OUString GetPar2() const override
Hint-Text.
Definition: docufld.cxx:2501
void dumpAsXml(xmlTextWriterPtr pWriter) const
sw::WriterMultiListener m_aDep
Definition: docufld.hxx:653
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
Definition: docufld.cxx:2597
std::vector< OUString > aDocInfoLst
Definition: shellres.hxx:62
static void lcl_GetLocalDataWrapper(LanguageType nLang, const LocaleDataWrapper **ppAppLocalData, const LocaleDataWrapper **ppLocalData)
Definition: docufld.cxx:840
SwDocStatFieldType(SwDoc &)
Definition: docufld.cxx:710
OUString m_aContent
Definition: docufld.hxx:216
static OUString GetColumnName(const OUString &rName)
Definition: docufld.cxx:1505
void SetFormat(sal_uInt32 const nSet)
Definition: fldbas.hxx:307
bool IsOn() const
Definition: docufld.hxx:604
sal_uInt16 m_nMaxPage
Definition: docufld.hxx:154
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
Definition: docufld.cxx:2339
sal_uInt16 GetDay() const
virtual OUString GetPar2() const override
get True/False text
Definition: docufld.cxx:1436
virtual std::unique_ptr< SwFieldType > Copy() const override
Definition: docufld.cxx:746
virtual void SetPar1(const OUString &rStr) override
set author
Definition: docufld.cxx:1794
const SwDocInfoSubType DI_SUB_DATE
Definition: docufld.hxx:85
Marks a node in the document model.
Definition: ndindex.hxx:32
bool HasName() const
css::uno::Type const & get()
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhich) const override
Definition: docufld.cxx:1450
sal_uInt16 m_nSubType
Definition: docufld.hxx:150
OUString GetID() const
bool empty() const
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhich) const override
Definition: docufld.cxx:2124
SwDoc * GetDoc() const
Definition: fldbas.hxx:423
bool IsAutomaticLanguage() const
Definition: fldbas.hxx:383
SvxNumType m_nNumberingType
Definition: docufld.hxx:255
virtual std::unique_ptr< SwField > Copy() const override
Definition: docufld.cxx:1392
Represents the style of a text portion.
Definition: charfmt.hxx:26
A page of the document layout.
Definition: pagefrm.hxx:57
SVX_NUM_CHARS_LOWER_LETTER_N
#define DB_DELIM
Definition: swtypes.hxx:131
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:405
#define FIELD_PROP_PAR3
Definition: unofldmid.h:25
const OUString & GetName() const
Definition: docufld.hxx:495
short GetOffset() const
Definition: docufld.hxx:606
sal_uLong nPage
Definition: docstat.hxx:30
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhich) override
Definition: docufld.cxx:1890
SwFieldType * GetTyp() const
Definition: fldbas.hxx:396
void SetText(const OUString &rText, SwRootFrame const *pLayout)
Definition: docufld.cxx:2326
virtual ~SwPostItField() override
Definition: docufld.cxx:1746
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhich) override
Definition: docufld.cxx:265
void ChangeExpansion(sal_uInt16 const nPageNumber, sal_uInt16 const nMaxPage)
Definition: docufld.cxx:176
const_iterator begin() const
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
Definition: docufld.cxx:466
const SwDocInfoSubType DI_SUB_AUTHOR
Definition: docufld.hxx:83
virtual void UpdateFields() override
Definition: docufld.hxx:291
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
sal_Int32 Count() const
#define FIELD_PROP_BOOL1
Definition: unofldmid.h:28
Fields containing values that have to be formatted via number formatter.
Definition: fldbas.hxx:412
void StartListening(SwModify *pDepend)
Definition: calbck.cxx:270
SwHiddenTextFieldType(bool bSetHidden=true)
Definition: docufld.cxx:1246
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhich) const override
Definition: docufld.cxx:350
OUString m_sHelp
Definition: docufld.hxx:666
virtual std::unique_ptr< SwField > Copy() const override
Definition: docufld.cxx:1658
SwFieldTypesEnum GetTypeId() const
Definition: fldbas.cxx:262
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
virtual std::unique_ptr< SwField > Copy() const override
Definition: docufld.cxx:1126
virtual std::unique_ptr< SwFieldType > Copy() const override
Definition: docufld.cxx:1957
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
Definition: docufld.cxx:1304
SVX_NUM_PAGEDESC
virtual std::unique_ptr< SwField > Copy() const override
Definition: docufld.cxx:639
SwFileNameFieldType(SwDoc &)
Definition: docufld.cxx:397
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:335
sal_uInt16 nGrf
Definition: docstat.hxx:28
SwDocInfoField(SwDocInfoFieldType *, sal_uInt16 nSub, const OUString &rName, sal_uInt32 nFormat=0)
Definition: docufld.cxx:992
std::optional< OutlinerParaObject > mpText
Definition: docufld.hxx:456
OUString m_aContent
Definition: docufld.hxx:524
virtual void SetLanguage(LanguageType nLng)
Definition: fldbas.cxx:433
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhich) const override
Definition: docufld.cxx:644
#define FIELD_PROP_PAR1
Definition: unofldmid.h:23
OUString m_sInitials
Initials of the author.
Definition: docufld.hxx:452
OUString ExpandValue(const double &rVal, sal_uInt32 nFormat, LanguageType nLng) const
return value formatted as string
Definition: fldbas.cxx:538
const SwDocInfoSubType DI_SUBTYPE_BEGIN
NB: these must denote consecutive integers! NB2: these are extended by 4 DI_INFO values for backward ...
Definition: docufld.hxx:70
OUString Expand(sal_uInt16 nSubType, SvxNumType nFormat) const
Definition: docufld.cxx:717
UserOptToken
#define FIELD_PROP_PAR2
Definition: unofldmid.h:24
bool IsFieldDeletedInModel(IDocumentRedlineAccess const &rIDRA, SwTextField const &rTextField)
const SwDocInfoSubType DI_DOCNO
Definition: docufld.hxx:78
virtual std::unique_ptr< SwFieldType > Copy() const override
Definition: docufld.cxx:1640
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
Definition: docufld.cxx:2104
virtual std::unique_ptr< SwField > Copy() const override
Definition: docufld.cxx:2344
static OUString Expand(sal_uInt16 nSubType)
Definition: docufld.cxx:1962
virtual std::unique_ptr< SwField > Copy() const override
Definition: docufld.cxx:474
sal_uInt32 m_nPostItId
Definition: docufld.hxx:458
SwPageNumberField(SwPageNumberFieldType *, sal_uInt16 nSub, sal_uInt32 nFormat, short nOff=0, sal_uInt16 const nPageNumber=0, sal_uInt16 const nMaxPage=0)
Definition: docufld.cxx:167
SwRefPageSetField(SwRefPageSetFieldType *, short nOff, bool bOn)
Definition: docufld.cxx:2098
OUString Expand(sal_uLong) const
Definition: docufld.cxx:403
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
overwritten to update all RefPageGet fields
Definition: docufld.cxx:2170
virtual const SwDocStat & GetDocStat() const =0
Document - Statistics.
OUString aName
static OUString Expand(sal_uLong)
Definition: docufld.cxx:313
INetProtocol GetProtocol() const
virtual std::unique_ptr< SwFieldType > Copy() const override
Definition: docufld.cxx:120
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhich) const override
Definition: docufld.cxx:2512
SwNodes & GetNodes()
Definition: doc.hxx:409
Item2Range GetItemSurrogates(sal_uInt16 nWhich) const
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhich) override
Definition: docufld.cxx:2543
SwJumpEditFieldType(SwDoc &rDoc)
Definition: docufld.cxx:2454
void copy(const fs::path &src, const fs::path &dest)
SwDocInfoFieldType(SwDoc *pDc)
Definition: docufld.cxx:830
const INetURLObject & GetURLObject() const
Reference< XComponentContext > getProcessComponentContext()
QPRO_FUNC_TYPE nType
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
Definition: docufld.cxx:1756
double getLength(const B2DPolygon &rCandidate)
bool IsHideRedlines() const
Replacement for sw::DocumentRedlineManager::GetRedlineFlags() (this is layout-level redline hiding)...
Definition: rootfrm.hxx:422
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhich) override
Definition: docufld.cxx:1475
virtual sal_uInt16 GetSubType() const override
Definition: docufld.cxx:772
sal_uInt16 m_nType
Definition: docufld.hxx:558
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhich) override
Definition: docufld.cxx:2430
virtual void CallSwClientNotify(const SfxHint &rHint) const override
Definition: calbck.cxx:326
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
Definition: docufld.cxx:333
OUString m_sTextRLHidden
hidden redlines
Definition: docufld.hxx:634
SwPostItFieldType(SwDoc &rDoc)
Definition: docufld.cxx:1712
void SetOffset(short nOff)
Definition: docufld.hxx:607
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhich) override
Definition: docufld.cxx:671
OUString m_sName
Name of the comment.
Definition: docufld.hxx:453
bool IsDataSourceOpen(const OUString &rDataSource, const OUString &rTableOrQuery, bool bMergeShell)
check if a data source is open
Definition: dbmgr.cxx:1998
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhich) override
Definition: docufld.cxx:372
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhich) override
Definition: docufld.cxx:1198
virtual OUString GetPar2() const override
Text.
Definition: docufld.cxx:1812
virtual OUString GetDescription() const override
Definition: docufld.cxx:1761
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhich) const override
Definition: docufld.cxx:2618
OUString GetFullName() const
OUString aFixedStr
Definition: shellres.hxx:48
#define FIELD_PROP_DATE
Definition: unofldmid.h:30
#define FIELD_PROP_PAR4
Definition: unofldmid.h:36
struct _xmlTextWriter * xmlTextWriterPtr
SwFieldTypesEnum m_nSubType
Definition: docufld.hxx:304
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
Definition: docufld.cxx:1653
OUString m_aContent
Evaluated DB-text.
Definition: docufld.hxx:301
const SwDocInfoSubType DI_SUB_FIXED
Definition: docufld.hxx:86
const SwDocInfoSubType DI_CHANGE
Definition: docufld.hxx:76
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhich) const override
Definition: docufld.cxx:789
virtual std::unique_ptr< SwFieldType > Copy() const override
Definition: docufld.cxx:1251
sal_uLong nWord
Definition: docstat.hxx:35
SwTextNode & GetTextNode() const
Definition: txtfld.hxx:53
std::pair< const_iterator, bool > insert(Value &&x)
SvxNumType m_nNumberingType
Definition: docufld.hxx:133
bool m_bIsHidden
Is it not visible?
Definition: docufld.hxx:307
const SwDocInfoSubType DI_TITLE
Definition: docufld.hxx:71
bool MakeSetList(SetGetExpFields &rTmpLst, SwRootFrame const *pLayout)
Definition: docufld.cxx:2215
const Date & GetNullDate() const
SwNode & GetEndOfExtras() const
This is the last EndNode of a special section.
Definition: ndarr.hxx:159
virtual void SetPar2(const OUString &rStr) override
Definition: docufld.cxx:224
virtual void SetSubType(sal_uInt16 nSub) override
Definition: docufld.cxx:2024
OUString ExpandValue(const double &rVal, sal_uInt32 nFormat, LanguageType nLng) const
Definition: fldbas.hxx:464
virtual std::unique_ptr< SwField > Copy() const override
Definition: docufld.cxx:2602
bool m_bCanToggle
Can field be toggled alone?
Definition: docufld.hxx:306
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
Definition: docufld.cxx:2477
OUString Expand(SvxNumType nFormat, short nOff, sal_uInt16 const nPageNumber, sal_uInt16 const nMaxPage, const OUString &, LanguageType=LANGUAGE_NONE) const
Definition: docufld.cxx:104
virtual double GetValue() const
Definition: fldbas.cxx:736
OUString sCommand
Definition: swdbdata.hxx:31
virtual sal_uInt16 GetSubType() const override
Definition: docufld.cxx:1445
aStr
sal_uInt16 GetPageNum() const
Definition: rootfrm.hxx:313
void UpdateField(SwTextField const *pTextField, SetGetExpFields const &rSetList, SwRootFrame const *pLayout)
Definition: docufld.cxx:2263
SwRootFrame * getRootFrame()
Definition: frame.hxx:680
sal_Int32 GetEnumAsInt32(const css::uno::Any &rVal)
Definition: swunohelper.cxx:50
SwExtUserField(SwExtUserFieldType *, sal_uInt16 nSub, sal_uInt32 nFormat)
Definition: docufld.cxx:1997
OUString GetFull() const
virtual void SetPar2(const OUString &rStr) override
Definition: docufld.cxx:2119
SwDBManager * GetDBManager() const
Definition: doc.hxx:670
bool GetResolved() const
Definition: docufld.cxx:1776
sal_uInt16 nPos
std::vector< std::unique_ptr< SetGetExpField > >::const_iterator const_iterator
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1319
virtual void SetLanguage(LanguageType nLng) override
set language of the format
Definition: docufld.cxx:1145
sal_Int16 nValue
OUString m_sText
Definition: docufld.hxx:665
virtual OUString GetPar1() const override
Definition: docufld.cxx:1412
bool removeSegment(sal_Int32 nIndex=LAST_SEGMENT, bool bIgnoreFinalSlash=true)
SwCombinedCharField(SwCombinedCharFieldType *, const OUString &rChars)
Definition: docufld.cxx:2590
Placeholder.
Definition: poolfmt.hxx:122
void SetTextObject(std::optional< OutlinerParaObject > pText)
Definition: docufld.cxx:1824
bool m_bValid
Is DB-field evaluated?
Definition: docufld.hxx:308
virtual void SetPar1(const OUString &rStr) override
set condition
Definition: docufld.cxx:1700
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo
SfxMedium * GetMedium() const
const SvxNumberType & GetNumType() const
Definition: pagedesc.hxx:202