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