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