LibreOffice Module sw (master)  1
docufld.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <config_features.h>
21 
22 #include <textapi.hxx>
23 
24 #include <hintids.hxx>
25 #include <com/sun/star/frame/XModel.hpp>
26 #include <com/sun/star/text/XText.hpp>
27 #include <com/sun/star/script/Converter.hpp>
28 #include <com/sun/star/text/PlaceholderType.hpp>
29 #include <com/sun/star/text/TemplateDisplayFormat.hpp>
30 #include <com/sun/star/text/PageNumberType.hpp>
31 #include <com/sun/star/text/FilenameDisplayFormat.hpp>
32 #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
33 #include <com/sun/star/document/XDocumentProperties.hpp>
34 #include <com/sun/star/util/Date.hpp>
35 #include <com/sun/star/util/Duration.hpp>
36 #include <o3tl/any.hxx>
39 #include <comphelper/string.hxx>
40 #include <tools/urlobj.hxx>
41 #include <svl/urihelper.hxx>
42 #include <unotools/useroptions.hxx>
43 #include <unotools/syslocale.hxx>
44 #include <svl/zforlist.hxx>
45 #include <libxml/xmlstring.h>
46 #include <libxml/xmlwriter.h>
47 
48 #include <tools/time.hxx>
49 #include <tools/datetime.hxx>
50 
51 #include <com/sun/star/util/DateTime.hpp>
52 
53 #include <swmodule.hxx>
54 #include <sfx2/docfile.hxx>
55 #include <sfx2/doctempl.hxx>
56 #include <fmtfld.hxx>
57 #include <txtfld.hxx>
58 #include <charfmt.hxx>
59 #include <docstat.hxx>
60 #include <pagedesc.hxx>
61 #include <fmtpdsc.hxx>
62 #include <doc.hxx>
64 #include <IDocumentStatistics.hxx>
67 #include <rootfrm.hxx>
68 #include <pagefrm.hxx>
69 #include <cntfrm.hxx>
70 #include <pam.hxx>
71 #include <viewsh.hxx>
72 #include <dbmgr.hxx>
73 #include <shellres.hxx>
74 #include <docufld.hxx>
75 #include <flddat.hxx>
76 #include <docfld.hxx>
77 #include <ndtxt.hxx>
78 #include <expfld.hxx>
79 #include <poolfmt.hxx>
80 #include <docsh.hxx>
81 #include <unofldmid.h>
82 #include <swunohelper.hxx>
83 #include <strings.hrc>
84 
85 #include <editeng/outlobj.hxx>
86 #include <calbck.hxx>
87 #include <hints.hxx>
88 
89 #define URL_DECODE INetURLObject::DecodeMechanism::Unambiguous
90 
91 using namespace ::com::sun::star;
92 using namespace ::com::sun::star::uno;
93 using namespace nsSwDocInfoSubType;
94 
97  m_nNumberingType( SVX_NUM_ARABIC ),
98  m_bVirtual( false )
99 {
100 }
101 
102 OUString SwPageNumberFieldType::Expand( SvxNumType nFormat, short nOff,
103  sal_uInt16 const nPageNumber, sal_uInt16 const nMaxPage,
104  const OUString& rUserStr, LanguageType nLang ) const
105 {
106  SvxNumType nTmpFormat = (SVX_NUM_PAGEDESC == nFormat) ? m_nNumberingType : nFormat;
107  int const nTmp = nPageNumber + nOff;
108 
109  if (0 > nTmp || SVX_NUM_NUMBER_NONE == nTmpFormat || (!m_bVirtual && nTmp > nMaxPage))
110  return OUString();
111 
112  if( SVX_NUM_CHAR_SPECIAL == nTmpFormat )
113  return rUserStr;
114 
115  return FormatNumber( nTmp, nTmpFormat, nLang );
116 }
117 
118 std::unique_ptr<SwFieldType> SwPageNumberFieldType::Copy() const
119 {
120  std::unique_ptr<SwPageNumberFieldType> pTmp(new SwPageNumberFieldType());
121 
122  pTmp->m_nNumberingType = m_nNumberingType;
123  pTmp->m_bVirtual = m_bVirtual;
124 
125  return pTmp;
126 }
127 
129  bool bVirt,
130  const SvxNumType* pNumFormat )
131 {
132  if( pNumFormat )
133  m_nNumberingType = *pNumFormat;
134 
135  m_bVirtual = false;
136  if (!(bVirt && pDoc))
137  return;
138 
139  // check the flag since the layout NEVER sets it back
140  const SfxItemPool &rPool = pDoc->GetAttrPool();
141  for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(RES_PAGEDESC))
142  {
143  auto pDesc = dynamic_cast<const SwFormatPageDesc*>(pItem);
144  if( pDesc && pDesc->GetNumOffset() && pDesc->GetDefinedIn() )
145  {
146  const SwContentNode* pNd = dynamic_cast<const SwContentNode*>( pDesc->GetDefinedIn() );
147  if( pNd )
148  {
150  // sw_redlinehide: not sure if this should happen only if
151  // it's the first node, because that's where RES_PAGEDESC
152  // is effective?
153  m_bVirtual = true;
154  }
155  else if( dynamic_cast< const SwFormat* >(pDesc->GetDefinedIn()) != nullptr)
156  {
157  SwAutoFormatGetDocNode aGetHt( &pDoc->GetNodes() );
158  m_bVirtual = !pDesc->GetDefinedIn()->GetInfo( aGetHt );
159  break;
160  }
161  }
162  }
163 }
164 
166  sal_uInt16 nSub, sal_uInt32 nFormat, short nOff,
167  sal_uInt16 const nPageNumber, sal_uInt16 const nMaxPage)
168  : SwField(pTyp, nFormat), m_nSubType(nSub), m_nOffset(nOff)
169  , m_nPageNumber(nPageNumber)
170  , m_nMaxPage(nMaxPage)
171 {
172 }
173 
174 void SwPageNumberField::ChangeExpansion(sal_uInt16 const nPageNumber,
175  sal_uInt16 const nMaxPage)
176 {
177  m_nPageNumber = nPageNumber;
178  m_nMaxPage = nMaxPage;
179 }
180 
181 OUString SwPageNumberField::ExpandImpl(SwRootFrame const*const) const
182 {
183  OUString sRet;
184  SwPageNumberFieldType* pFieldType = static_cast<SwPageNumberFieldType*>(GetTyp());
185 
186  if( PG_NEXT == m_nSubType && 1 != m_nOffset )
187  {
188  sRet = pFieldType->Expand(static_cast<SvxNumType>(GetFormat()), 1, m_nPageNumber, m_nMaxPage, m_sUserStr, GetLanguage());
189  if (!sRet.isEmpty())
190  {
191  sRet = pFieldType->Expand(static_cast<SvxNumType>(GetFormat()), m_nOffset, m_nPageNumber, m_nMaxPage, m_sUserStr, GetLanguage());
192  }
193  }
194  else if( PG_PREV == m_nSubType && -1 != m_nOffset )
195  {
196  sRet = pFieldType->Expand(static_cast<SvxNumType>(GetFormat()), -1, m_nPageNumber, m_nMaxPage, m_sUserStr, GetLanguage());
197  if (!sRet.isEmpty())
198  {
199  sRet = pFieldType->Expand(static_cast<SvxNumType>(GetFormat()), m_nOffset, m_nPageNumber, m_nMaxPage, m_sUserStr, GetLanguage());
200  }
201  }
202  else
203  sRet = pFieldType->Expand(static_cast<SvxNumType>(GetFormat()), m_nOffset, m_nPageNumber, m_nMaxPage, m_sUserStr, GetLanguage());
204  return sRet;
205 }
206 
207 std::unique_ptr<SwField> SwPageNumberField::Copy() const
208 {
209  std::unique_ptr<SwPageNumberField> pTmp(new SwPageNumberField(
210  static_cast<SwPageNumberFieldType*>(GetTyp()), m_nSubType,
212  pTmp->SetLanguage( GetLanguage() );
213  pTmp->SetUserString( m_sUserStr );
214  return std::unique_ptr<SwField>(pTmp.release());
215 }
216 
218 {
219  return OUString::number(m_nOffset);
220 }
221 
222 void SwPageNumberField::SetPar2(const OUString& rStr)
223 {
224  m_nOffset = static_cast<short>(rStr.toInt32());
225 }
226 
228 {
229  return m_nSubType;
230 }
231 
232 bool SwPageNumberField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
233 {
234  switch( nWhichId )
235  {
236  case FIELD_PROP_FORMAT:
237  rAny <<= static_cast<sal_Int16>(GetFormat());
238  break;
239  case FIELD_PROP_USHORT1:
240  rAny <<= m_nOffset;
241  break;
242  case FIELD_PROP_SUBTYPE:
243  {
244  text::PageNumberType eType;
245  eType = text::PageNumberType_CURRENT;
246  if(m_nSubType == PG_PREV)
247  eType = text::PageNumberType_PREV;
248  else if(m_nSubType == PG_NEXT)
249  eType = text::PageNumberType_NEXT;
250  rAny <<= eType;
251  }
252  break;
253  case FIELD_PROP_PAR1:
254  rAny <<= m_sUserStr;
255  break;
256 
257  default:
258  assert(false);
259  }
260  return true;
261 }
262 
263 bool SwPageNumberField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
264 {
265  bool bRet = true;
266  sal_Int16 nSet = 0;
267  switch( nWhichId )
268  {
269  case FIELD_PROP_FORMAT:
270  rAny >>= nSet;
271 
272  // TODO: where do the defines come from?
273  if(nSet <= SVX_NUM_PAGEDESC )
274  SetFormat(nSet);
275  break;
276  case FIELD_PROP_USHORT1:
277  rAny >>= nSet;
278  m_nOffset = nSet;
279  break;
280  case FIELD_PROP_SUBTYPE:
281  switch( static_cast<text::PageNumberType>(SWUnoHelper::GetEnumAsInt32( rAny )) )
282  {
283  case text::PageNumberType_CURRENT:
285  break;
286  case text::PageNumberType_PREV:
288  break;
289  case text::PageNumberType_NEXT:
291  break;
292  default:
293  bRet = false;
294  }
295  break;
296  case FIELD_PROP_PAR1:
297  rAny >>= m_sUserStr;
298  break;
299 
300  default:
301  assert(false);
302  }
303  return bRet;
304 }
305 
308 {
309 }
310 
312 {
313  SvtUserOptions& rOpt = SW_MOD()->GetUserOptions();
314  if((nFormat & 0xff) == AF_NAME)
315  return rOpt.GetFullName();
316 
317  return rOpt.GetID();
318 }
319 
320 std::unique_ptr<SwFieldType> SwAuthorFieldType::Copy() const
321 {
322  return std::make_unique<SwAuthorFieldType>();
323 }
324 
326  : SwField(pTyp, nFormat)
327 {
329 }
330 
331 OUString SwAuthorField::ExpandImpl(SwRootFrame const*const) const
332 {
333  if (!IsFixed())
334  const_cast<SwAuthorField*>(this)->m_aContent =
336 
337  return m_aContent;
338 }
339 
340 std::unique_ptr<SwField> SwAuthorField::Copy() const
341 {
342  std::unique_ptr<SwAuthorField> pTmp(new SwAuthorField( static_cast<SwAuthorFieldType*>(GetTyp()),
343  GetFormat()));
344  pTmp->SetExpansion(m_aContent);
345  return std::unique_ptr<SwField>(pTmp.release());
346 }
347 
348 bool SwAuthorField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
349 {
350  switch( nWhichId )
351  {
352  case FIELD_PROP_BOOL1:
353  rAny <<= (GetFormat() & 0xff) == AF_NAME;
354  break;
355 
356  case FIELD_PROP_BOOL2:
357  rAny <<= IsFixed();
358  break;
359 
360  case FIELD_PROP_PAR1:
361  rAny <<= m_aContent;
362  break;
363 
364  default:
365  assert(false);
366  }
367  return true;
368 }
369 
370 bool SwAuthorField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
371 {
372  switch( nWhichId )
373  {
374  case FIELD_PROP_BOOL1:
375  SetFormat( *o3tl::doAccess<bool>(rAny) ? AF_NAME : AF_SHORTCUT );
376  break;
377 
378  case FIELD_PROP_BOOL2:
379  if( *o3tl::doAccess<bool>(rAny) )
381  else
383  break;
384 
385  case FIELD_PROP_PAR1:
386  rAny >>= m_aContent;
387  break;
388 
389  default:
390  assert(false);
391  }
392  return true;
393 }
394 
397  , m_rDoc(rDocument)
398 {
399 }
400 
401 OUString SwFileNameFieldType::Expand(sal_uLong nFormat) const
402 {
403  OUString aRet;
404  const SwDocShell* pDShell = m_rDoc.GetDocShell();
405  if( pDShell && pDShell->HasName() )
406  {
407  const INetURLObject& rURLObj = pDShell->GetMedium()->GetURLObject();
408  switch( nFormat & ~FF_FIXED )
409  {
410  case FF_PATH:
411  {
412  if( INetProtocol::File == rURLObj.GetProtocol() )
413  {
414  INetURLObject aTemp(rURLObj);
415  aTemp.removeSegment();
416  // last slash should belong to the pathname
417  aRet = aTemp.PathToFileName();
418  }
419  else
420  {
424  const sal_Int32 nPos = aRet.indexOf(rURLObj.GetLastName( URL_DECODE ));
425  if (nPos>=0)
426  {
427  aRet = aRet.copy(0, nPos);
428  }
429  }
430  }
431  break;
432 
433  case FF_NAME:
435  break;
436 
437  case FF_NAME_NOEXT:
438  aRet = rURLObj.GetBase();
439  break;
440 
441  default:
442  if( INetProtocol::File == rURLObj.GetProtocol() )
443  aRet = rURLObj.GetFull();
444  else
448  }
449  }
450  return aRet;
451 }
452 
453 std::unique_ptr<SwFieldType> SwFileNameFieldType::Copy() const
454 {
455  return std::make_unique<SwFileNameFieldType>(m_rDoc);
456 }
457 
459  : SwField(pTyp, nFormat)
460 {
461  m_aContent = static_cast<SwFileNameFieldType*>(GetTyp())->Expand(GetFormat());
462 }
463 
464 OUString SwFileNameField::ExpandImpl(SwRootFrame const*const) const
465 {
466  if (!IsFixed())
467  const_cast<SwFileNameField*>(this)->m_aContent = static_cast<SwFileNameFieldType*>(GetTyp())->Expand(GetFormat());
468 
469  return m_aContent;
470 }
471 
472 std::unique_ptr<SwField> SwFileNameField::Copy() const
473 {
474  std::unique_ptr<SwFileNameField> pTmp(
475  new SwFileNameField(static_cast<SwFileNameFieldType*>(GetTyp()), GetFormat()));
476  pTmp->SetExpansion(m_aContent);
477 
478  return std::unique_ptr<SwField>(pTmp.release());
479 }
480 
481 bool SwFileNameField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
482 {
483  switch( nWhichId )
484  {
485  case FIELD_PROP_FORMAT:
486  {
487  sal_Int16 nRet;
488  switch( GetFormat() &(~FF_FIXED) )
489  {
490  case FF_PATH:
491  nRet = text::FilenameDisplayFormat::PATH;
492  break;
493  case FF_NAME_NOEXT:
495  break;
496  case FF_NAME:
497  nRet = text::FilenameDisplayFormat::NAME_AND_EXT;
498  break;
499  default: nRet = text::FilenameDisplayFormat::FULL;
500  }
501  rAny <<= nRet;
502  }
503  break;
504 
505  case FIELD_PROP_BOOL2:
506  rAny <<= IsFixed();
507  break;
508 
509  case FIELD_PROP_PAR3:
510  rAny <<= m_aContent;
511  break;
512 
513  default:
514  assert(false);
515  }
516  return true;
517 }
518 
519 bool SwFileNameField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
520 {
521  switch( nWhichId )
522  {
523  case FIELD_PROP_FORMAT:
524  {
525  //JP 24.10.2001: int32 because in UnoField.cxx a putvalue is
526  // called with a int32 value! But normally we need
527  // here only a int16
528  sal_Int32 nType = 0;
529  rAny >>= nType;
530  bool bFixed = IsFixed();
531  switch( nType )
532  {
533  case text::FilenameDisplayFormat::PATH:
534  nType = FF_PATH;
535  break;
537  nType = FF_NAME_NOEXT;
538  break;
539  case text::FilenameDisplayFormat::NAME_AND_EXT:
540  nType = FF_NAME;
541  break;
542  default: nType = FF_PATHNAME;
543  }
544  if(bFixed)
545  nType |= FF_FIXED;
546  SetFormat(nType);
547  }
548  break;
549 
550  case FIELD_PROP_BOOL2:
551  if( *o3tl::doAccess<bool>(rAny) )
553  else
555  break;
556 
557  case FIELD_PROP_PAR3:
558  rAny >>= m_aContent;
559  break;
560 
561  default:
562  assert(false);
563  }
564  return true;
565 }
566 
569  , m_rDoc(rDocument)
570 {
571 }
572 
574 {
575  OSL_ENSURE( nFormat < FF_END, "Expand: no valid Format!" );
576 
577  OUString aRet;
578  SwDocShell *pDocShell(m_rDoc.GetDocShell());
579  OSL_ENSURE(pDocShell, "no SwDocShell");
580  if (pDocShell) {
581  uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
582  pDocShell->GetModel(), uno::UNO_QUERY_THROW);
583  uno::Reference<document::XDocumentProperties> xDocProps(
584  xDPS->getDocumentProperties());
585  OSL_ENSURE(xDocProps.is(), "Doc has no DocumentProperties");
586 
587  if( FF_UI_NAME == nFormat )
588  aRet = xDocProps->getTemplateName();
589  else if( !xDocProps->getTemplateURL().isEmpty() )
590  {
591  if( FF_UI_RANGE == nFormat )
592  {
593  // for getting region names!
595  OUString sTmp;
596  OUString sRegion;
597  aFac.GetLogicNames( xDocProps->getTemplateURL(), sRegion, sTmp );
598  aRet = sRegion;
599  }
600  else
601  {
602  INetURLObject aPathName( xDocProps->getTemplateURL() );
603  if( FF_NAME == nFormat )
604  aRet = aPathName.GetLastName(URL_DECODE);
605  else if( FF_NAME_NOEXT == nFormat )
606  aRet = aPathName.GetBase();
607  else
608  {
609  if( FF_PATH == nFormat )
610  {
611  aPathName.removeSegment();
612  aRet = aPathName.GetFull();
613  }
614  else
615  aRet = aPathName.GetFull();
616  }
617  }
618  }
619  }
620  return aRet;
621 }
622 
623 std::unique_ptr<SwFieldType> SwTemplNameFieldType::Copy() const
624 {
625  return std::make_unique<SwTemplNameFieldType>(m_rDoc);
626 }
627 
629  : SwField(pTyp, nFormat)
630 {}
631 
632 OUString SwTemplNameField::ExpandImpl(SwRootFrame const*const) const
633 {
634  return static_cast<SwTemplNameFieldType*>(GetTyp())->Expand(GetFormat());
635 }
636 
637 std::unique_ptr<SwField> SwTemplNameField::Copy() const
638 {
639  return std::make_unique<SwTemplNameField>(static_cast<SwTemplNameFieldType*>(GetTyp()), GetFormat());
640 }
641 
642 bool SwTemplNameField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
643 {
644  switch ( nWhichId )
645  {
646  case FIELD_PROP_FORMAT:
647  {
648  sal_Int16 nRet;
649  switch( GetFormat() )
650  {
651  case FF_PATH: nRet = text::FilenameDisplayFormat::PATH; break;
653  case FF_NAME: nRet = text::FilenameDisplayFormat::NAME_AND_EXT; break;
654  case FF_UI_RANGE: nRet = text::TemplateDisplayFormat::AREA; break;
655  case FF_UI_NAME: nRet = text::TemplateDisplayFormat::TITLE; break;
656  default: nRet = text::FilenameDisplayFormat::FULL;
657 
658  }
659  rAny <<= nRet;
660  }
661  break;
662 
663  default:
664  assert(false);
665  }
666  return true;
667 }
668 
669 bool SwTemplNameField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
670 {
671  switch ( nWhichId )
672  {
673  case FIELD_PROP_FORMAT:
674  {
675  //JP 24.10.2001: int32 because in UnoField.cxx a putvalue is
676  // called with a int32 value! But normally we need
677  // here only a int16
678  sal_Int32 nType = 0;
679  rAny >>= nType;
680  switch( nType )
681  {
682  case text::FilenameDisplayFormat::PATH:
684  break;
687  break;
688  case text::FilenameDisplayFormat::NAME_AND_EXT:
690  break;
691  case text::TemplateDisplayFormat::AREA :
693  break;
694  case text::TemplateDisplayFormat::TITLE :
696  break;
697  default: SetFormat(FF_PATHNAME);
698  }
699  }
700  break;
701 
702  default:
703  assert(false);
704  }
705  return true;
706 }
707 
710  , m_rDoc(rDocument)
711  , m_nNumberingType(SVX_NUM_ARABIC)
712 {
713 }
714 
715 OUString SwDocStatFieldType::Expand(sal_uInt16 nSubType, SvxNumType nFormat) const
716 {
717  sal_uInt32 nVal = 0;
719  switch( nSubType )
720  {
721  case DS_TBL: nVal = rDStat.nTable; break;
722  case DS_GRF: nVal = rDStat.nGrf; break;
723  case DS_OLE: nVal = rDStat.nOLE; break;
724  case DS_PARA: nVal = rDStat.nPara; break;
725  case DS_WORD: nVal = rDStat.nWord; break;
726  case DS_CHAR: nVal = rDStat.nChar; break;
727  case DS_PAGE:
729  const_cast<SwDocStat &>(rDStat).nPage = m_rDoc.getIDocumentLayoutAccess().GetCurrentLayout()->GetPageNum();
730  nVal = rDStat.nPage;
731  if( SVX_NUM_PAGEDESC == nFormat )
732  nFormat = m_nNumberingType;
733  break;
734  default:
735  OSL_FAIL( "SwDocStatFieldType::Expand: unknown SubType" );
736  }
737 
738  if( nVal <= SHRT_MAX )
739  return FormatNumber( nVal, nFormat );
740 
741  return OUString::number( nVal );
742 }
743 
744 std::unique_ptr<SwFieldType> SwDocStatFieldType::Copy() const
745 {
746  return std::make_unique<SwDocStatFieldType>(m_rDoc);
747 }
748 
754 SwDocStatField::SwDocStatField(SwDocStatFieldType* pTyp, sal_uInt16 nSub, sal_uInt32 nFormat)
755  : SwField(pTyp, nFormat),
756  m_nSubType(nSub)
757 {}
758 
759 OUString SwDocStatField::ExpandImpl(SwRootFrame const*const) const
760 {
761  return static_cast<SwDocStatFieldType*>(GetTyp())->Expand(m_nSubType, static_cast<SvxNumType>(GetFormat()));
762 }
763 
764 std::unique_ptr<SwField> SwDocStatField::Copy() const
765 {
766  return std::make_unique<SwDocStatField>(
767  static_cast<SwDocStatFieldType*>(GetTyp()), m_nSubType, GetFormat() );
768 }
769 
770 sal_uInt16 SwDocStatField::GetSubType() const
771 {
772  return m_nSubType;
773 }
774 
775 void SwDocStatField::SetSubType(sal_uInt16 nSub)
776 {
777  m_nSubType = nSub;
778 }
779 
781 {
783  static_cast<SwDocStatFieldType*>(GetTyp())->SetNumFormat(
785 }
786 
787 bool SwDocStatField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
788 {
789  switch ( nWhichId )
790  {
791  case FIELD_PROP_USHORT2:
792  rAny <<= static_cast<sal_Int16>(GetFormat());
793  break;
794 
795  default:
796  assert(false);
797  }
798  return true;
799 }
800 
801 bool SwDocStatField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
802 {
803  bool bRet = false;
804  switch ( nWhichId )
805  {
806  case FIELD_PROP_USHORT2:
807  {
808  sal_Int16 nSet = 0;
809  rAny >>= nSet;
810  if(nSet <= SVX_NUM_CHARS_LOWER_LETTER_N &&
811  nSet != SVX_NUM_CHAR_SPECIAL &&
812  nSet != SVX_NUM_BITMAP)
813  {
814  SetFormat(nSet);
815  bRet = true;
816  }
817  }
818  break;
819 
820  default:
821  assert(false);
822  }
823  return bRet;
824 }
825 
826 // Document info field type
827 
830 {
831 }
832 
833 std::unique_ptr<SwFieldType> SwDocInfoFieldType::Copy() const
834 {
835  return std::make_unique<SwDocInfoFieldType>(GetDoc());
836 }
837 
839  const LocaleDataWrapper **ppAppLocalData,
840  const LocaleDataWrapper **ppLocalData )
841 {
842  SvtSysLocale aLocale;
843  *ppAppLocalData = &aLocale.GetLocaleData();
844  *ppLocalData = *ppAppLocalData;
845  if( nLang != (*ppLocalData)->getLanguageTag().getLanguageType() )
846  *ppLocalData = new LocaleDataWrapper(LanguageTag( nLang ));
847 }
848 
849 OUString SwDocInfoFieldType::Expand( sal_uInt16 nSub, sal_uInt32 nFormat,
850  LanguageType nLang, const OUString& rName ) const
851 {
852  const LocaleDataWrapper *pAppLocalData = nullptr, *pLocalData = nullptr;
853  SwDocShell *pDocShell(GetDoc()->GetDocShell());
854  OSL_ENSURE(pDocShell, "no SwDocShell");
855  if (!pDocShell) { return OUString(); }
856 
857  uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
858  pDocShell->GetModel(), uno::UNO_QUERY_THROW);
859  uno::Reference<document::XDocumentProperties> xDocProps(
860  xDPS->getDocumentProperties());
861  OSL_ENSURE(xDocProps.is(), "Doc has no DocumentProperties");
862 
863  sal_uInt16 nExtSub = nSub & 0xff00;
864  nSub &= 0xff; // do not consider extended SubTypes
865 
866  OUString aStr;
867  switch(nSub)
868  {
869  case DI_TITLE: aStr = xDocProps->getTitle(); break;
870  case DI_SUBJECT:aStr = xDocProps->getSubject(); break;
871  case DI_KEYS: aStr = ::comphelper::string::convertCommaSeparated(
872  xDocProps->getKeywords());
873  break;
874  case DI_COMMENT:aStr = xDocProps->getDescription(); break;
875  case DI_DOCNO: aStr = OUString::number(
876  xDocProps->getEditingCycles() );
877  break;
878  case DI_EDIT:
879  if ( !nFormat )
880  {
881  lcl_GetLocalDataWrapper( nLang, &pAppLocalData, &pLocalData );
882  sal_Int32 dur = xDocProps->getEditingDuration();
883  // If Seconds > 0 then bSec should be TRUE otherwise Seconds
884  // information will be lost if file has EditTime in Seconds format.
885  aStr = pLocalData->getTime( tools::Time(dur/3600, (dur%3600)/60, dur%60),
886  dur%60 > 0);
887  }
888  else
889  {
890  sal_Int32 dur = xDocProps->getEditingDuration();
891  double fVal = tools::Time(dur/3600, (dur%3600)/60, dur%60).GetTimeInDays();
892  aStr = ExpandValue(fVal, nFormat, nLang);
893  }
894  break;
895  case DI_CUSTOM:
896  {
897  OUString sVal;
898  try
899  {
900  uno::Any aAny;
901  uno::Reference < beans::XPropertySet > xSet(
902  xDocProps->getUserDefinedProperties(),
903  uno::UNO_QUERY_THROW);
904  aAny = xSet->getPropertyValue( rName );
905 
906  uno::Reference < script::XTypeConverter > xConverter( script::Converter::create(comphelper::getProcessComponentContext()) );
907  uno::Any aNew = xConverter->convertToSimpleType( aAny, uno::TypeClass_STRING );
908  aNew >>= sVal;
909  }
910  catch (uno::Exception&) {}
911  return sVal;
912  }
913 
914  default:
915  {
916  OUString aName( xDocProps->getAuthor() );
917  util::DateTime uDT( xDocProps->getCreationDate() );
918  DateTime aDate(uDT);
919  if( nSub == DI_CREATE )
920  ; // that's it !!
921  else if( nSub == DI_CHANGE )
922  {
923  aName = xDocProps->getModifiedBy();
924  uDT = xDocProps->getModificationDate();
925  aDate = DateTime(uDT);
926  }
927  else if( nSub == DI_PRINT )
928  {
929  aName = xDocProps->getPrintedBy();
930  uDT = xDocProps->getPrintDate();
931  aDate = DateTime(uDT);
932  }
933  else
934  break;
935 
936  if (aDate.IsValidAndGregorian())
937  {
938  switch (nExtSub & ~DI_SUB_FIXED)
939  {
940  case DI_SUB_AUTHOR:
941  aStr = aName;
942  break;
943 
944  case DI_SUB_TIME:
945  if (!nFormat)
946  {
947  lcl_GetLocalDataWrapper( nLang, &pAppLocalData,
948  &pLocalData );
949  aStr = pLocalData->getTime( aDate,
950  false);
951  }
952  else
953  {
954  // start the number formatter
955  double fVal = SwDateTimeField::GetDateTime( *GetDoc(),
956  aDate);
957  aStr = ExpandValue(fVal, nFormat, nLang);
958  }
959  break;
960 
961  case DI_SUB_DATE:
962  if (!nFormat)
963  {
964  lcl_GetLocalDataWrapper( nLang, &pAppLocalData,
965  &pLocalData );
966  aStr = pLocalData->getDate( aDate );
967  }
968  else
969  {
970  // start the number formatter
971  double fVal = SwDateTimeField::GetDateTime( *GetDoc(),
972  aDate);
973  aStr = ExpandValue(fVal, nFormat, nLang);
974  }
975  break;
976  }
977  }
978  }
979  break;
980  }
981 
982  if( pAppLocalData != pLocalData )
983  delete pLocalData;
984 
985  return aStr;
986 }
987 
988 // document info field
989 
990 SwDocInfoField::SwDocInfoField(SwDocInfoFieldType* pTyp, sal_uInt16 nSub, const OUString& rName, sal_uInt32 nFormat) :
991  SwValueField(pTyp, nFormat), m_nSubType(nSub)
992 {
993  m_aName = rName;
994  m_aContent = static_cast<SwDocInfoFieldType*>(GetTyp())->Expand(m_nSubType, nFormat, GetLanguage(), m_aName);
995 }
996 
997 SwDocInfoField::SwDocInfoField(SwDocInfoFieldType* pTyp, sal_uInt16 nSub, const OUString& rName, const OUString& rValue, sal_uInt32 nFormat) :
998  SwValueField(pTyp, nFormat), m_nSubType(nSub)
999 {
1000  m_aName = rName;
1001  m_aContent = rValue;
1002 }
1003 
1004 template<class T>
1005 static double lcl_TimeToDouble( const T& rTime )
1006 {
1007  const double fNanoSecondsPerDay = 86400000000000.0;
1008  return ( (rTime.Hours * SAL_CONST_INT64(3600000000000))
1009  + (rTime.Minutes * SAL_CONST_INT64( 60000000000))
1010  + (rTime.Seconds * SAL_CONST_INT64( 1000000000))
1011  + (rTime.NanoSeconds))
1012  / fNanoSecondsPerDay;
1013 }
1014 
1015 template<class D>
1016 static double lcl_DateToDouble( const D& rDate, const Date& rNullDate )
1017 {
1018  tools::Long nDate = Date::DateToDays( rDate.Day, rDate.Month, rDate.Year );
1019  tools::Long nNullDate = Date::DateToDays( rNullDate.GetDay(), rNullDate.GetMonth(), rNullDate.GetYear() );
1020  return double( nDate - nNullDate );
1021 }
1022 
1023 OUString SwDocInfoField::ExpandImpl(SwRootFrame const*const) const
1024 {
1025  if ( ( m_nSubType & 0xFF ) == DI_CUSTOM )
1026  {
1027  // custom properties currently need special treatment
1028  // We don't have a secure way to detect "real" custom properties in Word import of text
1029  // fields, so we treat *every* unknown property as a custom property, even the "built-in"
1030  // section in Word's document summary information stream as these properties have not been
1031  // inserted when the document summary information was imported, we do it here.
1032  // This approach is still a lot better than the old one to import such fields as
1033  // "user fields" and simple text
1034  SwDocShell* pDocShell = GetDoc()->GetDocShell();
1035  if( !pDocShell )
1036  return m_aContent;
1037  try
1038  {
1039  uno::Reference<document::XDocumentPropertiesSupplier> xDPS( pDocShell->GetModel(), uno::UNO_QUERY_THROW);
1040  uno::Reference<document::XDocumentProperties> xDocProps( xDPS->getDocumentProperties());
1041  uno::Reference < beans::XPropertySet > xSet( xDocProps->getUserDefinedProperties(), uno::UNO_QUERY_THROW);
1042  uno::Reference < beans::XPropertySetInfo > xSetInfo = xSet->getPropertySetInfo();
1043 
1044  uno::Any aAny;
1045  if( xSetInfo->hasPropertyByName( m_aName ) )
1046  aAny = xSet->getPropertyValue( m_aName );
1047  if ( aAny.getValueType() != cppu::UnoType<void>::get() )
1048  {
1049  // "void" type means that the property has not been inserted until now
1050  if ( !IsFixed() )
1051  {
1052  // if the field is "fixed" we don't update it from the property
1053  OUString sVal;
1054  uno::Reference < script::XTypeConverter > xConverter( script::Converter::create(comphelper::getProcessComponentContext()) );
1055  util::Date aDate;
1056  util::DateTime aDateTime;
1057  util::Duration aDuration;
1058  if( aAny >>= aDate)
1059  {
1060  SvNumberFormatter* pFormatter = pDocShell->GetDoc()->GetNumberFormatter();
1061  const Date& rNullDate = pFormatter->GetNullDate();
1062  sVal = ExpandValue( lcl_DateToDouble<util::Date>( aDate, rNullDate ), GetFormat(), GetLanguage());
1063  }
1064  else if( aAny >>= aDateTime )
1065  {
1066  double fDateTime = lcl_TimeToDouble<util::DateTime>( aDateTime );
1067  SvNumberFormatter* pFormatter = pDocShell->GetDoc()->GetNumberFormatter();
1068  const Date& rNullDate = pFormatter->GetNullDate();
1069  fDateTime += lcl_DateToDouble<util::DateTime>( aDateTime, rNullDate );
1070  sVal = ExpandValue( fDateTime, GetFormat(), GetLanguage());
1071  }
1072  else if( aAny >>= aDuration )
1073  {
1074  sVal = OUStringChar(aDuration.Negative ? '-' : '+')
1076  sVal = sVal.replaceFirst("%1", OUString::number( aDuration.Years ) );
1077  sVal = sVal.replaceFirst("%2", OUString::number( aDuration.Months ) );
1078  sVal = sVal.replaceFirst("%3", OUString::number( aDuration.Days ) );
1079  sVal = sVal.replaceFirst("%4", OUString::number( aDuration.Hours ) );
1080  sVal = sVal.replaceFirst("%5", OUString::number( aDuration.Minutes) );
1081  sVal = sVal.replaceFirst("%6", OUString::number( aDuration.Seconds) );
1082  }
1083  else
1084  {
1085  uno::Any aNew = xConverter->convertToSimpleType( aAny, uno::TypeClass_STRING );
1086  aNew >>= sVal;
1087  }
1088  const_cast<SwDocInfoField*>(this)->m_aContent = sVal;
1089  }
1090  }
1091  }
1092  catch (uno::Exception&) {}
1093  }
1094  else if ( !IsFixed() )
1095  const_cast<SwDocInfoField*>(this)->m_aContent = static_cast<SwDocInfoFieldType*>(GetTyp())->Expand(m_nSubType, GetFormat(), GetLanguage(), m_aName);
1096 
1097  return m_aContent;
1098 }
1099 
1101 {
1102  OUString aStr(SwFieldType::GetTypeStr(GetTypeId()) + ":");
1103 
1104  sal_uInt16 const nSub = m_nSubType & 0xff;
1105 
1106  switch (nSub)
1107  {
1108  case DI_CUSTOM:
1109  aStr += m_aName;
1110  break;
1111 
1112  default:
1113  aStr += SwViewShell::GetShellRes()
1114  ->aDocInfoLst[ nSub - DI_SUBTYPE_BEGIN ];
1115  break;
1116  }
1117  if (IsFixed())
1118  {
1119  aStr += " " + SwViewShell::GetShellRes()->aFixedStr;
1120  }
1121  return aStr;
1122 }
1123 
1124 std::unique_ptr<SwField> SwDocInfoField::Copy() const
1125 {
1126  std::unique_ptr<SwDocInfoField> pField(new SwDocInfoField(static_cast<SwDocInfoFieldType*>(GetTyp()), m_nSubType, m_aName, GetFormat()));
1127  pField->SetAutomaticLanguage(IsAutomaticLanguage());
1128  pField->m_aContent = m_aContent;
1129 
1130  return std::unique_ptr<SwField>(pField.release());
1131 }
1132 
1133 sal_uInt16 SwDocInfoField::GetSubType() const
1134 {
1135  return m_nSubType;
1136 }
1137 
1138 void SwDocInfoField::SetSubType(sal_uInt16 nSub)
1139 {
1140  m_nSubType = nSub;
1141 }
1142 
1144 {
1145  if (!GetFormat())
1146  SwField::SetLanguage(nLng);
1147  else
1149 }
1150 
1151 bool SwDocInfoField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
1152 {
1153  switch( nWhichId )
1154  {
1155  case FIELD_PROP_PAR1:
1156  rAny <<= m_aContent;
1157  break;
1158 
1159  case FIELD_PROP_PAR4:
1160  rAny <<= m_aName;
1161  break;
1162 
1163  case FIELD_PROP_USHORT1:
1164  rAny <<= static_cast<sal_Int16>(m_aContent.toInt32());
1165  break;
1166 
1167  case FIELD_PROP_BOOL1:
1168  rAny <<= 0 != (m_nSubType & DI_SUB_FIXED);
1169  break;
1170 
1171  case FIELD_PROP_FORMAT:
1172  rAny <<= static_cast<sal_Int32>(GetFormat());
1173  break;
1174 
1175  case FIELD_PROP_DOUBLE:
1176  {
1177  double fVal = GetValue();
1178  rAny <<= fVal;
1179  }
1180  break;
1181  case FIELD_PROP_PAR3:
1182  rAny <<= ExpandImpl(nullptr);
1183  break;
1184  case FIELD_PROP_BOOL2:
1185  {
1186  sal_uInt16 nExtSub = (m_nSubType & 0xff00) & ~DI_SUB_FIXED;
1187  rAny <<= nExtSub == DI_SUB_DATE;
1188  }
1189  break;
1190  default:
1191  return SwField::QueryValue(rAny, nWhichId);
1192  }
1193  return true;
1194 }
1195 
1196 bool SwDocInfoField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
1197 {
1198  sal_Int32 nValue = 0;
1199  switch( nWhichId )
1200  {
1201  case FIELD_PROP_PAR1:
1202  if( m_nSubType & DI_SUB_FIXED )
1203  rAny >>= m_aContent;
1204  break;
1205 
1206  case FIELD_PROP_USHORT1:
1207  if( m_nSubType & DI_SUB_FIXED )
1208  {
1209  rAny >>= nValue;
1210  m_aContent = OUString::number(nValue);
1211  }
1212  break;
1213 
1214  case FIELD_PROP_BOOL1:
1215  if(*o3tl::doAccess<bool>(rAny))
1217  else
1218  m_nSubType &= ~DI_SUB_FIXED;
1219  break;
1220  case FIELD_PROP_FORMAT:
1221  {
1222  rAny >>= nValue;
1223  if( nValue >= 0)
1224  SetFormat(nValue);
1225  }
1226  break;
1227 
1228  case FIELD_PROP_PAR3:
1229  rAny >>= m_aContent;
1230  break;
1231  case FIELD_PROP_BOOL2:
1232  m_nSubType &= 0xf0ff;
1233  if(*o3tl::doAccess<bool>(rAny))
1235  else
1237  break;
1238  default:
1239  return SwField::PutValue(rAny, nWhichId);
1240  }
1241  return true;
1242 }
1243 
1245  : SwFieldType( SwFieldIds::HiddenText ), m_bHidden( bSetHidden )
1246 {
1247 }
1248 
1249 std::unique_ptr<SwFieldType> SwHiddenTextFieldType::Copy() const
1250 {
1251  return std::make_unique<SwHiddenTextFieldType>( m_bHidden );
1252 }
1253 
1255 {
1256  if( m_bHidden != bSetHidden )
1257  {
1258  m_bHidden = bSetHidden;
1259  UpdateFields(); // notify all HiddenTexts
1260  }
1261 }
1262 
1264  bool bConditional,
1265  const OUString& rCond,
1266  const OUString& rStr,
1267  bool bHidden,
1268  SwFieldTypesEnum nSub) :
1269  SwField( pFieldType ), m_aCond(rCond), m_nSubType(nSub),
1270  m_bCanToggle(bConditional), m_bIsHidden(bHidden), m_bValid(false)
1271 {
1273  {
1274  sal_Int32 nPos = 0;
1275  m_aTRUEText = rStr.getToken(0, '|', nPos);
1276 
1277  if(nPos != -1)
1278  {
1279  m_aFALSEText = rStr.getToken(0, '|', nPos);
1280  if(nPos != -1)
1281  {
1282  m_aContent = rStr.getToken(0, '|', nPos);
1283  m_bValid = true;
1284  }
1285  }
1286  }
1287  else
1288  m_aTRUEText = rStr;
1289 }
1290 
1292  const OUString& rCond,
1293  const OUString& rTrue,
1294  const OUString& rFalse,
1295  SwFieldTypesEnum nSub)
1296  : SwField( pFieldType ), m_aTRUEText(rTrue), m_aFALSEText(rFalse), m_aCond(rCond), m_nSubType(nSub),
1297  m_bIsHidden(true), m_bValid(false)
1298 {
1299  m_bCanToggle = !m_aCond.isEmpty();
1300 }
1301 
1302 OUString SwHiddenTextField::ExpandImpl(SwRootFrame const*const) const
1303 {
1304  // Type: !Hidden -> show always
1305  // Hide -> evaluate condition
1306 
1308  {
1309  if( m_bValid )
1310  return m_aContent;
1311 
1312  if( m_bCanToggle && !m_bIsHidden )
1313  return m_aTRUEText;
1314  }
1315  else if( !static_cast<SwHiddenTextFieldType*>(GetTyp())->GetHiddenFlag() ||
1316  ( m_bCanToggle && m_bIsHidden ))
1317  return m_aTRUEText;
1318 
1319  return m_aFALSEText;
1320 }
1321 
1324 {
1326  return;
1327 
1328 #if !HAVE_FEATURE_DBCONNECTIVITY
1329  (void) rDoc;
1330 #else
1331  SwDBManager* pMgr = rDoc.GetDBManager();
1332 #endif
1333  m_bValid = false;
1334  OUString sTmpName = (m_bCanToggle && !m_bIsHidden) ? m_aTRUEText : m_aFALSEText;
1335 
1336  // Database expressions need to be different from normal text. Therefore, normal text is set
1337  // in quotes. If the latter exist they will be removed. If not, check if potential DB name.
1338  // Only if there are two or more dots and no quotes, we assume a database.
1339  if (sTmpName.getLength()>1 &&
1340  sTmpName.startsWith("\"") &&
1341  sTmpName.endsWith("\""))
1342  {
1343  m_aContent = sTmpName.copy(1, sTmpName.getLength() - 2);
1344  m_bValid = true;
1345  }
1346  else if(sTmpName.indexOf('\"')<0 &&
1347  comphelper::string::getTokenCount(sTmpName, '.') > 2)
1348  {
1349  sTmpName = ::ReplacePoint(sTmpName);
1350  if(sTmpName.startsWith("[") && sTmpName.endsWith("]"))
1351  { // remove brackets
1352  sTmpName = sTmpName.copy(1, sTmpName.getLength() - 2);
1353  }
1354 #if HAVE_FEATURE_DBCONNECTIVITY
1355  if( pMgr)
1356  {
1357  sal_Int32 nIdx{ 0 };
1358  OUString sDBName( GetDBName( sTmpName, rDoc ));
1359  OUString sDataSource(sDBName.getToken(0, DB_DELIM, nIdx));
1360  OUString sDataTableOrQuery(sDBName.getToken(0, DB_DELIM, nIdx));
1361  if( pMgr->IsInMerge() && !sDBName.isEmpty() &&
1362  pMgr->IsDataSourceOpen( sDataSource,
1363  sDataTableOrQuery, false))
1364  {
1365  double fNumber;
1366  pMgr->GetMergeColumnCnt(GetColumnName( sTmpName ),
1367  GetLanguage(), m_aContent, &fNumber );
1368  m_bValid = true;
1369  }
1370  else if( !sDBName.isEmpty() && !sDataSource.isEmpty() &&
1371  !sDataTableOrQuery.isEmpty() )
1372  m_bValid = true;
1373  }
1374 #endif
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& rDoc)
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 = rDoc.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  , mrDoc(rDoc)
1713 {}
1714 
1715 std::unique_ptr<SwFieldType> SwPostItFieldType::Copy() const
1716 {
1717  return std::make_unique<SwPostItFieldType>(mrDoc);
1718 }
1719 
1720 // PostIt field
1721 
1722 sal_uInt32 SwPostItField::s_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 ? s_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& rDoc = pGetType->GetDoc();
1859  auto pObj = std::make_unique<SwTextAPIEditSource>( &rDoc );
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_rDoc( rDc ), 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_rDoc ));
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  {
2176  std::vector<SwFormatField*> vFields;
2177  GatherFields(vFields);
2178  for(auto pFormatField: vFields)
2179  UpdateField(pFormatField->GetTextField(), aTmpLst, pLayout);
2180  }
2181  };
2182 
2183  // update all GetReference fields
2184  if( !pNew && !pOld && HasWriterListeners() )
2185  {
2186  SwRootFrame const* pLayout(nullptr);
2187  SwRootFrame const* pLayoutRLHidden(nullptr);
2188  for (SwRootFrame const*const pLay : m_rDoc.GetAllLayouts())
2189  {
2190  if (pLay->IsHideRedlines())
2191  {
2192  pLayoutRLHidden = pLay;
2193  }
2194  else
2195  {
2196  pLayout = pLay;
2197  }
2198  }
2199  ModifyImpl(pLayout);
2200  if (pLayoutRLHidden)
2201  {
2202  ModifyImpl(pLayoutRLHidden);
2203  }
2204  }
2205 
2206  // forward to text fields, they "expand" the text
2207  NotifyClients( pOld, pNew );
2208 }
2209 
2211  SwRootFrame const*const pLayout)
2212 {
2214  std::vector<SwFormatField*> vFields;
2215  GatherFields(vFields);
2216  for(auto pFormatField: vFields)
2217  {
2218  // update only the GetRef fields
2219  const SwTextField* pTField = pFormatField->GetTextField();
2220  if (!pLayout || !pLayout->IsHideRedlines() || !sw::IsFieldDeletedInModel(rIDRA, *pTField))
2221  {
2222  const SwTextNode& rTextNd = pTField->GetTextNode();
2223 
2224  // Always the first! (in Tab-Headline, header/footer )
2225  Point aPt;
2226  std::pair<Point, bool> const tmp(aPt, false);
2227  const SwContentFrame *const pFrame = rTextNd.getLayoutFrame(
2228  pLayout, nullptr, &tmp);
2229 
2230  std::unique_ptr<SetGetExpField> pNew;
2231 
2232  if( !pFrame ||
2233  pFrame->IsInDocBody() ||
2234  // #i31868#
2235  // Check if pFrame is not yet connected to the layout.
2236  !pFrame->FindPageFrame() )
2237  {
2238  // create index for determination of the TextNode
2239  SwNodeIndex aIdx( rTextNd );
2240  pNew.reset( new SetGetExpField( aIdx, pTField ) );
2241  }
2242  else
2243  {
2244  // create index for determination of the TextNode
2246  bool const bResult = GetBodyTextNode( m_rDoc, aPos, *pFrame );
2247  OSL_ENSURE(bResult, "where is the Field?");
2248  pNew.reset( new SetGetExpField( aPos.nNode, pTField,
2249  &aPos.nContent ) );
2250  }
2251 
2252  rTmpLst.insert( std::move(pNew) );
2253  }
2254  }
2255  return !rTmpLst.empty();
2256 }
2257 
2259  SetGetExpFields const & rSetList,
2260  SwRootFrame const*const pLayout)
2261 {
2262  SwRefPageGetField* pGetField = const_cast<SwRefPageGetField*>(static_cast<const SwRefPageGetField*>(pTextField->GetFormatField().GetField()));
2263  pGetField->SetText( OUString(), pLayout );
2264 
2265  // then search the correct RefPageSet field
2266  SwTextNode* pTextNode = &pTextField->GetTextNode();
2267  if( pTextNode->StartOfSectionIndex() >
2269  {
2270  SwNodeIndex aIdx( *pTextNode );
2271  SetGetExpField aEndField( aIdx, pTextField );
2272 
2273  SetGetExpFields::const_iterator itLast = rSetList.lower_bound( &aEndField );
2274 
2275  if( itLast != rSetList.begin() )
2276  {
2277  --itLast;
2278  const SwTextField* pRefTextField = (*itLast)->GetTextField();
2279  const SwRefPageSetField* pSetField =
2280  static_cast<const SwRefPageSetField*>(pRefTextField->GetFormatField().GetField());
2281  if( pSetField->IsOn() )
2282  {
2283  // determine the correct offset
2284  Point aPt;
2285  std::pair<Point, bool> const tmp(aPt, false);
2286  const SwContentFrame *const pFrame = pTextNode->getLayoutFrame(
2287  pLayout, nullptr, &tmp);
2288  const SwContentFrame *const pRefFrame = pRefTextField->GetTextNode().getLayoutFrame(
2289  pLayout, nullptr, &tmp);
2290  const SwPageFrame* pPgFrame = nullptr;
2291  short nDiff = 1;
2292  if ( pFrame && pRefFrame )
2293  {
2294  pPgFrame = pFrame->FindPageFrame();
2295  nDiff = pPgFrame->GetPhyPageNum() -
2296  pRefFrame->FindPageFrame()->GetPhyPageNum() + 1;
2297  }
2298 
2299  SvxNumType nTmpFormat = SVX_NUM_PAGEDESC == static_cast<SvxNumType>(pGetField->GetFormat())
2300  ? ( !pPgFrame
2301  ? SVX_NUM_ARABIC
2302  : pPgFrame->GetPageDesc()->GetNumType().GetNumberingType() )
2303  : static_cast<SvxNumType>(pGetField->GetFormat());
2304  const short nPageNum = std::max<short>(0, pSetField->GetOffset() + nDiff);
2305  pGetField->SetText(FormatNumber(nPageNum, nTmpFormat), pLayout);
2306  }
2307  }
2308  }
2309  // start formatting
2310  const_cast<SwFormatField&>(pTextField->GetFormatField()).UpdateTextNode(nullptr, nullptr);
2311 }
2312 
2313 // queries for relative page numbering
2314 
2316  sal_uInt32 nFormat )
2317  : SwField( pTyp, nFormat )
2318 {
2319 }
2320 
2321 void SwRefPageGetField::SetText(const OUString& rText,
2322  SwRootFrame const*const pLayout)
2323 {
2324  if (!pLayout || !pLayout->IsHideRedlines())
2325  {
2326  m_sText = rText;
2327  }
2328  if (!pLayout || pLayout->IsHideRedlines())
2329  {
2330  m_sTextRLHidden = rText;
2331  }
2332 }
2333 
2334 OUString SwRefPageGetField::ExpandImpl(SwRootFrame const*const pLayout) const
2335 {
2336  return pLayout && pLayout->IsHideRedlines() ? m_sTextRLHidden : m_sText;
2337 }
2338 
2339 std::unique_ptr<SwField> SwRefPageGetField::Copy() const
2340 {
2341  std::unique_ptr<SwRefPageGetField> pCpy(new SwRefPageGetField(
2342  static_cast<SwRefPageGetFieldType*>(GetTyp()), GetFormat() ));
2343  pCpy->m_sText = m_sText;
2344  pCpy->m_sTextRLHidden = m_sTextRLHidden;
2345  return std::unique_ptr<SwField>(pCpy.release());
2346 }
2347 
2349  const SwTextField* pField )
2350 {
2351  // only fields in Footer, Header, FootNote, Flys
2352  SwRefPageGetFieldType* pGetType = static_cast<SwRefPageGetFieldType*>(GetTyp());
2353  SwDoc& rDoc = pGetType->GetDoc();
2354  if( pField->GetTextNode().StartOfSectionIndex() >
2355  rDoc.GetNodes().GetEndOfExtras().GetIndex() )
2356  return;
2357 
2358  SwRootFrame const& rLayout(*rFrame.getRootFrame());
2359  OUString & rText(rLayout.IsHideRedlines() ? m_sTextRLHidden : m_sText);
2360  rText.clear();
2361 
2362  OSL_ENSURE(!rFrame.IsInDocBody(), "Flag incorrect, frame is in DocBody");
2363 
2364  // collect all SetPageRefFields
2365  SetGetExpFields aTmpLst;
2366  if (!pGetType->MakeSetList(aTmpLst, &rLayout))
2367  return ;
2368 
2369  // create index for determination of the TextNode
2370  SwPosition aPos( SwNodeIndex( rDoc.GetNodes() ) );
2371  SwTextNode* pTextNode = const_cast<SwTextNode*>(GetBodyTextNode(rDoc, aPos, rFrame));
2372 
2373  // If no layout exists, ChangeExpansion is called for header and
2374  // footer lines via layout formatting without existing TextNode.
2375  if(!pTextNode)
2376  return;
2377 
2378  SetGetExpField aEndField( aPos.nNode, pField, &aPos.nContent );
2379 
2380  SetGetExpFields::const_iterator itLast = aTmpLst.lower_bound( &aEndField );
2381 
2382  if( itLast == aTmpLst.begin() )
2383  return; // there is no corresponding set-field in front
2384  --itLast;
2385 
2386  const SwTextField* pRefTextField = (*itLast)->GetTextField();
2387  const SwRefPageSetField* pSetField =
2388  static_cast<const SwRefPageSetField*>(pRefTextField->GetFormatField().GetField());
2389  Point aPt;
2390  std::pair<Point, bool> const tmp(aPt, false);
2391  const SwContentFrame *const pRefFrame = pRefTextField->GetTextNode().getLayoutFrame(
2392  &rLayout, nullptr, &tmp);
2393  if( !(pSetField->IsOn() && pRefFrame) )
2394  return;
2395 
2396  // determine the correct offset
2397  const SwPageFrame* pPgFrame = rFrame.FindPageFrame();
2398  const short nDiff = pPgFrame->GetPhyPageNum() -
2399  pRefFrame->FindPageFrame()->GetPhyPageNum() + 1;
2400 
2401  SwRefPageGetField* pGetField = const_cast<SwRefPageGetField*>(static_cast<const SwRefPageGetField*>(pField->GetFormatField().GetField()));
2402  SvxNumType nTmpFormat = SVX_NUM_PAGEDESC == pGetField->GetFormat()
2403  ? pPgFrame->GetPageDesc()->GetNumType().GetNumberingType()
2404  : static_cast<SvxNumType>(pGetField->GetFormat());
2405  const short nPageNum = std::max<short>(0, pSetField->GetOffset() + nDiff);
2406  pGetField->SetText(FormatNumber(nPageNum, nTmpFormat), &rLayout);
2407 }
2408 
2409 bool SwRefPageGetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
2410 {
2411  switch( nWhichId )
2412  {
2413  case FIELD_PROP_USHORT1:
2414  rAny <<= static_cast<sal_Int16>(GetFormat());
2415  break;
2416  case FIELD_PROP_PAR1:
2417  rAny <<= m_sText;
2418  break;
2419  default:
2420  assert(false);
2421  }
2422  return true;
2423 }
2424 
2425 bool SwRefPageGetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
2426 {
2427  switch( nWhichId )
2428  {
2429  case FIELD_PROP_USHORT1:
2430  {
2431  sal_Int16 nSet = 0;
2432  rAny >>= nSet;
2433  if(nSet <= SVX_NUM_PAGEDESC )
2434  SetFormat(nSet);
2435  }
2436  break;
2437  case FIELD_PROP_PAR1:
2438  rAny >>= m_sText;
2440  break;
2441  default:
2442  assert(false);
2443  }
2444  return true;
2445 }
2446 
2447 // field type to jump to and edit
2448 
2450  : SwFieldType( SwFieldIds::JumpEdit ), m_rDoc( rD ), m_aDep( *this )
2451 {
2452 }
2453 
2454 std::unique_ptr<SwFieldType> SwJumpEditFieldType::Copy() const
2455 {
2456  return std::make_unique<SwJumpEditFieldType>( m_rDoc );
2457 }
2458 
2460 {
2462  m_aDep.StartListening(pFormat);
2463  return pFormat;
2464 }
2465 
2467  const OUString& rText, const OUString& rHelp )
2468  : SwField( pTyp, nForm ), m_sText( rText ), m_sHelp( rHelp )
2469 {
2470 }
2471 
2472 OUString SwJumpEditField::ExpandImpl(SwRootFrame const*const) const
2473 {
2474  return "<" + m_sText + ">";
2475 }
2476 
2477 std::unique_ptr<SwField> SwJumpEditField::Copy() const
2478 {
2479  return std::make_unique<SwJumpEditField>( static_cast<SwJumpEditFieldType*>(GetTyp()), GetFormat(),
2480  m_sText, m_sHelp );
2481 }
2482 
2485 {
2486  return m_sText;
2487 }
2488 
2490 void SwJumpEditField::SetPar1(const OUString& rStr)
2491 {
2492  m_sText = rStr;
2493 }
2494 
2497 {
2498  return m_sHelp;
2499 }
2500 
2502 void SwJumpEditField::SetPar2(const OUString& rStr)
2503 {
2504  m_sHelp = rStr;
2505 }
2506 
2507 bool SwJumpEditField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
2508 {
2509  switch( nWhichId )
2510  {
2511  case FIELD_PROP_USHORT1:
2512  {
2513  sal_Int16 nRet;
2514  switch( GetFormat() )
2515  {
2516  case JE_FMT_TABLE: nRet = text::PlaceholderType::TABLE; break;
2517  case JE_FMT_FRAME: nRet = text::PlaceholderType::TEXTFRAME; break;
2518  case JE_FMT_GRAPHIC:nRet = text::PlaceholderType::GRAPHIC; break;
2519  case JE_FMT_OLE: nRet = text::PlaceholderType::OBJECT; break;
2520  default:
2521  nRet = text::PlaceholderType::TEXT; break;
2522  }
2523  rAny <<= nRet;
2524  }
2525  break;
2526  case FIELD_PROP_PAR1 :
2527  rAny <<= m_sHelp;
2528  break;
2529  case FIELD_PROP_PAR2 :
2530  rAny <<= m_sText;
2531  break;
2532  default:
2533  assert(false);
2534  }
2535  return true;
2536 }
2537 
2538 bool SwJumpEditField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
2539 {
2540  switch( nWhichId )
2541  {
2542  case FIELD_PROP_USHORT1:
2543  {
2544  //JP 24.10.2001: int32 because in UnoField.cxx a putvalue is
2545  // called with a int32 value! But normally we need
2546  // here only a int16
2547  sal_Int32 nSet = 0;
2548  rAny >>= nSet;
2549  switch( nSet )
2550  {
2551  case text::PlaceholderType::TEXT : SetFormat(JE_FMT_TEXT); break;
2552  case text::PlaceholderType::TABLE : SetFormat(JE_FMT_TABLE); break;
2553  case text::PlaceholderType::TEXTFRAME: SetFormat(JE_FMT_FRAME); break;
2554  case text::PlaceholderType::GRAPHIC : SetFormat(JE_FMT_GRAPHIC); break;
2555  case text::PlaceholderType::OBJECT : SetFormat(JE_FMT_OLE); break;
2556  }
2557  }
2558  break;
2559  case FIELD_PROP_PAR1 :
2560  rAny >>= m_sHelp;
2561  break;
2562  case FIELD_PROP_PAR2 :
2563  rAny >>= m_sText;
2564  break;
2565  default:
2566  assert(false);
2567  }
2568  return true;
2569 }
2570 
2571 // combined character field type
2572 
2575 {
2576 }
2577 
2578 std::unique_ptr<SwFieldType> SwCombinedCharFieldType::Copy() const
2579 {
2580  return std::make_unique<SwCombinedCharFieldType>();
2581 }
2582 
2583 // combined character field
2584 
2586  const OUString& rChars )
2587  : SwField( pFTyp, 0 ),
2588  m_sCharacters( rChars.copy( 0, std::min<sal_Int32>(rChars.getLength(), MAX_COMBINED_CHARACTERS) ))
2589 {
2590 }
2591 
2593 {
2594  return m_sCharacters;
2595 }
2596 
2597 std::unique_ptr<SwField> SwCombinedCharField::Copy() const
2598 {
2599  return std::make_unique<SwCombinedCharField>( static_cast<SwCombinedCharFieldType*>(GetTyp()),
2600  m_sCharacters );
2601 }
2602 
2604 {
2605  return m_sCharacters;
2606 }
2607 
2608 void SwCombinedCharField::SetPar1(const OUString& rStr)
2609 {
2610  m_sCharacters = rStr.copy(0, std::min<sal_Int32>(rStr.getLength(), MAX_COMBINED_CHARACTERS));
2611 }
2612 
2614  sal_uInt16 nWhichId ) const
2615 {
2616  switch( nWhichId )
2617  {
2618  case FIELD_PROP_PAR1:
2619  rAny <<= m_sCharacters;
2620  break;
2621  default:
2622  assert(false);
2623  }
2624  return true;
2625 }
2626 
2628  sal_uInt16 nWhichId )
2629 {
2630  switch( nWhichId )
2631  {
2632  case FIELD_PROP_PAR1:
2633  {
2634  OUString sTmp;
2635  rAny >>= sTmp;
2636  SetPar1(sTmp);
2637  }
2638  break;
2639  default:
2640  assert(false);
2641  }
2642  return true;
2643 }
2644 
2645 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual SwCharFormat * GetCharFormatFromPool(sal_uInt16 nId)=0
Reference< XTypeConverter > xConverter
virtual void SetPar1(const OUString &rStr) override
set place holder text
Definition: docufld.cxx:2490
SwDoc & GetDoc() const
Definition: docufld.hxx:435
SvxNumType GetNumberingType() const
Instances of SwFields and those derived from it occur 0 to n times.
Definition: fldbas.hxx:240
static sal_uInt32 s_nLastPostItId
Definition: docufld.hxx:454
const SwDocInfoSubType DI_SUB_TIME
Definition: docufld.hxx:79
Base class of the Writer layout elements.
Definition: frame.hxx:298
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(93)
const_iterator lower_bound(const Value &x) const
sal_uLong GetIndex() const
Definition: node.hxx:290
IDocumentStatistics const & getIDocumentStatistics() const
Definition: doc.cxx:373
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
Definition: docufld.cxx:1023
SwDoc & GetDoc() const
Definition: docufld.hxx:619
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: fldbas.cxx:823
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:1005
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:2608
virtual void SetPar2(const OUString &rStr) override
True/False - String.
Definition: docufld.cxx:1416
const SwField * GetField() const
Definition: fmtfld.hxx:111
bool IsInDocBody() const
Definition: frame.hxx:924
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhich) const override
Definition: docufld.cxx:1151
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
Definition: fmtpdsc.hxx:35
LanguageType GetLanguage() const
Language at field position.
Definition: fldbas.hxx:402
sal_uInt16 m_nPageNumber
Definition: docufld.hxx:148
sal_uLong StartOfSectionIndex() const
Definition: node.hxx:676
virtual std::unique_ptr< SwFieldType > Copy() const override
Definition: docufld.cxx:2454
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:2627
const char aData[]
Definition: ww8scan.hxx:47
virtual const SwRootFrame * GetCurrentLayout() const =0
static ShellResource * GetShellRes()
Definition: viewsh.cxx:2548
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhich) override
Definition: docufld.cxx:2138
DateTime m_aDateTime
Definition: docufld.hxx:447
OUString sDurationFormat
Definition: shellres.hxx:49
SwDocShell * GetDocShell()
Definition: doc.hxx:1350
sal_uInt32 GetFormat() const
Query parameters for dialog and for BASIC.
Definition: fldbas.hxx:397
virtual sal_uInt16 GetSubType() const override
Definition: docufld.cxx:2017
SvNumberFormatter * GetNumberFormatter(bool bCreate=true)
Definition: doc.hxx:1409
SwDocStatField(SwDocStatFieldType *, sal_uInt16 nSubType, sal_uInt32 nFormat)
Definition: docufld.cxx:754
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
Definition: docufld.cxx:632
virtual OUString GetPar2() const override
Definition: docufld.cxx:2112
virtual std::unique_ptr< SwFieldType > Copy() const override
Definition: docufld.cxx:320
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhich) const override
Definition: docufld.cxx:232
SwNodeIndex nNode
Definition: pam.hxx:37
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: docufld.cxx:1932
sal_uInt16 char char * pDesc
void ChangeExpansion(const SwFrame &rFrame, const SwTextField *pField)
Definition: docufld.cxx:2348
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
long Long
OUString sDataSource
Definition: swdbdata.hxx:30
virtual std::unique_ptr< SwField > Copy() const override
Definition: docufld.cxx:2009
bool IsFixed() const
Definition: fldbas.cxx:423
Base class of all fields.
Definition: fldbas.hxx:289
OUString Expand(sal_uLong) const
Definition: docufld.cxx:573
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:1208
Definition: doc.hxx:186
virtual std::unique_ptr< SwFieldType > Copy() const override
Definition: docufld.cxx:2578
SVL_DLLPUBLIC OUString removePassword(OUString const &rURI, INetURLObject::EncodeMechanism eEncodeMechanism, INetURLObject::DecodeMechanism eDecodeMechanism=INetURLObject::DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
virtual OUString GetPar2() const override
Definition: docufld.cxx:217
sal_uLong nChar
Definition: docstat.hxx:37
sal_uInt16 nTable
Definition: docstat.hxx:27
virtual OUString GetPar1() const override
Author.
Definition: docufld.cxx:1798
OUString m_aTRUEText
Text if condition true.
Definition: docufld.hxx:293
const SwDocInfoSubType DI_COMMENT
Definition: docufld.hxx:69
sal_Int16 m_nNumberingType
Definition: docufld.hxx:608
void SetTextObject(std::unique_ptr< OutlinerParaObject > pText)
Definition: docufld.cxx:1822
static double GetDateTime(SwDoc &rDoc, const DateTime &rDT)
Definition: flddat.cxx:121
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhich) override
Definition: docufld.cxx:801
#define URL_DECODE
Definition: docufld.cxx:89
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhich) const override
Definition: docufld.cxx:481
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:2315
SwNode & GetEndOfPostIts() const
A still empty section.
Definition: ndarr.hxx:152
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:341
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
Definition: docufld.cxx:759
SwFileNameField(SwFileNameFieldType *, sal_uInt32 nFormat)
Definition: docufld.cxx:458
virtual std::unique_ptr< SwField > Copy() const override
Definition: docufld.cxx:2477
SwDoc * GetDoc() const
Definition: fldbas.hxx:453
SwJumpEditField(SwJumpEditFieldType *, sal_uInt32 nFormat, const OUString &sText, const OUString &sHelp)
Definition: docufld.cxx:2466
OUString m_aContent
Definition: docufld.hxx:185
void SetResolved(bool bNewState)
Definition: docufld.cxx:1764
bool HasWriterListeners() const
Definition: calbck.hxx:209
SwTemplNameField(SwTemplNameFieldType *, sal_uInt32 nFormat)
Definition: docufld.cxx:628
The root element of a Writer document layout.
Definition: rootfrm.hxx:82
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhich) const override
Definition: docufld.cxx:2027
const SwDocInfoSubType DI_EDIT
Definition: docufld.hxx:74
virtual std::unique_ptr< SwField > Copy() const override
Definition: docufld.cxx:340
#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
sal_Int32 getTokenCount(const OString &rIn, char cTok)
static void ParseIfFieldDefinition(const OUString &aFieldDefinition, OUString &rCondition, OUString &rTrue, OUString &rFalse)
Definition: docufld.cxx:1532
SvxNumType
static LanguageType nLang
Definition: srtdlg.cxx:51
void GatherFields(std::vector< SwFormatField * > &rvFormatFields, bool bCollectOnlyInDocNodes=true) const
Definition: fldbas.cxx:205
#define FIELD_PROP_FORMAT
Definition: unofldmid.h:26
OUString PathToFileName() const
sal_uInt16 GetPhyPageNum() const
Definition: pagefrm.hxx:191
void UpdateFields() const
Definition: fldbas.cxx:148
virtual std::unique_ptr< SwField > Copy() const override
Definition: docufld.cxx:2107
virtual std::unique_ptr< SwFieldType > Copy() const override
Definition: docufld.cxx:833
OUString GetBase() const
css::util::Date GetUNODate() const
SwDoc & m_rDoc
Definition: docbm.cxx:1205
rtl::Reference< SwTextAPIObject > m_xTextObject
Definition: docufld.hxx:450
const LocaleDataWrapper & GetLocaleData() const
OUString m_sName
OUString ReplacePoint(const OUString &rTmpName, bool bWithCommandType)
Definition: expfld.cxx:104
OUString m_sCharacters
combine these characters
Definition: docufld.hxx:732
#define min(a, b)
virtual OUString GetFieldName() const override
get name or content
Definition: docufld.cxx:1100
SwIndex nContent
Definition: pam.hxx:38
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
void ChangeExpansion(SwDoc *pDoc, bool bVirtPageNum, const SvxNumType *pNumFormat)
Definition: docufld.cxx:128
sal_uInt16 GetMonth() const
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:426
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:357
virtual sal_uInt16 GetSubType() const override
Definition: docufld.cxx:1133
#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
const SwDocInfoSubType DI_SUBJECT
Definition: docufld.hxx:67
virtual void SetPar2(const OUString &rStr) override
set hint text
Definition: docufld.cxx:2502
virtual std::unique_ptr< SwField > Copy() const override
Definition: docufld.cxx:764
virtual void SetLanguage(LanguageType nLng) override
set language of the format
Definition: fldbas.cxx:674
OUString FormatNumber(sal_uInt32 nNum, SvxNumType nFormat, LanguageType nLang)
expand numbering
Definition: fldbas.cxx:487
void SetHiddenFlag(bool bSetHidden)
Definition: docufld.cxx:1254
double GetTimeInDays() const
virtual OUString GetPar1() const override
Placeholder-Text.
Definition: docufld.cxx:2484
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
Definition: docufld.cxx:181
OUString m_sText
Definition: docufld.hxx:625
const SwFormatField & GetFormatField() const
Definition: txatbase.hxx:191
o3tl::sorted_vector< SwRootFrame * > GetAllLayouts()
Definition: doclay.cxx:1669
virtual OUString GetPar1() const override
Characters.
Definition: docufld.cxx:2603
OUString Expand(sal_uInt16 nSubType, sal_uInt32 nFormat, LanguageType nLang, const OUString &rName) const
Definition: docufld.cxx:849
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:775
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:1138
SwTemplNameFieldType(SwDoc &)
Definition: docufld.cxx:567
SwHiddenTextField(SwHiddenTextFieldType *, bool bConditional, const OUString &rCond, const OUString &rText, bool bHidden, SwFieldTypesEnum nSubType=SwFieldTypesEnum::HiddenText)
Definition: docufld.cxx:1263
#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:519
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhichId) const
Definition: fldbas.cxx:344
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
DocumentType eType
css::util::DateTime GetUNODateTime() const
sal_Int16 GetYear() const
SVX_NUM_BITMAP
SVX_NUM_CHAR_SPECIAL
virtual std::unique_ptr< SwFieldType > Copy() const override
Definition: docufld.cxx:623
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:1016
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:121
SwAuthorField(SwAuthorFieldType *, sal_uInt32 nFormat)
Definition: docufld.cxx:325
#define SW_MOD()
Definition: swmodule.hxx:255
virtual std::unique_ptr< SwField > Copy() const override
Definition: docufld.cxx:1779
SwDBData const & GetDBData()
Definition: docfld.cxx:343
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhich) const override
Definition: docufld.cxx:2409
OUString m_sAuthor
Definition: docufld.hxx:444
int i
static OUString GetDBName(const OUString &rName, SwDoc &rDoc)
Definition: docufld.cxx:1516
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:453
SwRefPageGetFieldType(SwDoc &rDoc)
Definition: docufld.cxx:2156
virtual std::unique_ptr< SwField > Copy() const override
Definition: docufld.cxx:207
void Evaluate(SwDoc &rDoc)
get current field value and cache it
Definition: docufld.cxx:1323
virtual std::unique_ptr< SwFieldType > Copy() const override
Definition: docufld.cxx:1715
SwCharFormat * GetCharFormat()
Definition: docufld.cxx:2459
const SwDocInfoSubType DI_KEYS
Definition: docufld.hxx:68
bool GetMergeColumnCnt(const OUString &rColumnName, LanguageType nLanguage, OUString &rResult, double *pNumber)
Definition: dbmgr.cxx:2083
SwPageFrame * FindPageFrame()
Definition: frame.hxx:663
void ChangeExpansion(const SwFrame *pFrame)
Definition: docufld.cxx:780
#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
TElementType * First()
Definition: calbck.hxx:346
SwPageDesc * GetPageDesc()
Definition: pagefrm.hxx:130
#define FIELD_PROP_USHORT2
Definition: unofldmid.h:32
virtual sal_uInt16 GetSubType() const override
Definition: docufld.cxx:227
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:93
SwFieldIds
Definition: fldbas.hxx:44
virtual OUString GetPar2() const override
Hint-Text.
Definition: docufld.cxx:2496
sw::WriterMultiListener m_aDep
Definition: docufld.hxx:645
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
Definition: docufld.cxx:2592
std::vector< OUString > aDocInfoLst
Definition: shellres.hxx:61
static void lcl_GetLocalDataWrapper(LanguageType nLang, const LocaleDataWrapper **ppAppLocalData, const LocaleDataWrapper **ppLocalData)
Definition: docufld.cxx:838
SwDocStatFieldType(SwDoc &)
Definition: docufld.cxx:708
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:303
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:2334
sal_uInt16 GetDay() const
virtual OUString GetPar2() const override
get True/False text
Definition: docufld.cxx:1434
virtual std::unique_ptr< SwFieldType > Copy() const override
Definition: docufld.cxx:744
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
OUString SwResId(const char *pId)
Definition: swmodule.cxx:165
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:419
bool IsAutomaticLanguage() const
Definition: fldbas.hxx:379
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:41
SVX_NUM_CHARS_LOWER_LETTER_N
#define DB_DELIM
Definition: swtypes.hxx:133
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:405
#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:392
void SetText(const OUString &rText, SwRootFrame const *pLayout)
Definition: docufld.cxx:2321
virtual ~SwPostItField() override
Definition: docufld.cxx:1744
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhich) override
Definition: docufld.cxx:263
void ChangeExpansion(sal_uInt16 const nPageNumber, sal_uInt16 const nMaxPage)
Definition: docufld.cxx:174
const_iterator begin() const
void NotifyClients(const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue)
Definition: calbck.cxx:170
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
Definition: docufld.cxx:464
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:408
void StartListening(SwModify *pDepend)
Definition: calbck.cxx:328
SwHiddenTextFieldType(bool bSetHidden=true)
Definition: docufld.cxx:1244
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhich) const override
Definition: docufld.cxx:348
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:250
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:80
virtual std::unique_ptr< SwField > Copy() const override
Definition: docufld.cxx:1124
virtual std::unique_ptr< SwFieldType > Copy() const override
Definition: docufld.cxx:1955
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
Definition: docufld.cxx:1302
SVX_NUM_PAGEDESC
virtual std::unique_ptr< SwField > Copy() const override
Definition: docufld.cxx:637
SwFileNameFieldType(SwDoc &)
Definition: docufld.cxx:395
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:335
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:990
OUString m_aContent
Definition: docufld.hxx:517
virtual void SetLanguage(LanguageType nLng)
Definition: fldbas.cxx:413
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhich) const override
Definition: docufld.cxx:642
#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:518
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:715
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:2339
static OUString Expand(sal_uInt16 nSubType)
Definition: docufld.cxx:1960
virtual std::unique_ptr< SwField > Copy() const override
Definition: docufld.cxx:472
sal_uInt32 m_nPostItId
Definition: docufld.hxx:451
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:254
SwPageNumberField(SwPageNumberFieldType *, sal_uInt16 nSub, sal_uInt32 nFormat, short nOff=0, sal_uInt16 const nPageNumber=0, sal_uInt16 const nMaxPage=0)
Definition: docufld.cxx:165
SwRefPageSetField(SwRefPageSetFieldType *, short nOff, bool bOn)
Definition: docufld.cxx:2096
OUString Expand(sal_uLong) const
Definition: docufld.cxx:401
virtual const SwDocStat & GetDocStat() const =0
Document - Statistics.
OUString aName
static OUString Expand(sal_uLong)
Definition: docufld.cxx:311
INetProtocol GetProtocol() const
virtual std::unique_ptr< SwFieldType > Copy() const override
Definition: docufld.cxx:118
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhich) const override
Definition: docufld.cxx:2507
SwNodes & GetNodes()
Definition: doc.hxx:405
Item2Range GetItemSurrogates(sal_uInt16 nWhich) const
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhich) override
Definition: docufld.cxx:2538
SwJumpEditFieldType(SwDoc &rDoc)
Definition: docufld.cxx:2449
void copy(const fs::path &src, const fs::path &dest)
SwDocInfoFieldType(SwDoc *pDc)
Definition: docufld.cxx:828
const INetURLObject & GetURLObject() const
Reference< XComponentContext > getProcessComponentContext()
QPRO_FUNC_TYPE nType
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:420
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:770
sal_uInt16 m_nType
Definition: docufld.hxx:551
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhich) override
Definition: docufld.cxx:2425
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
Definition: docufld.cxx:331
OUString m_sTextRLHidden
hidden redlines
Definition: docufld.hxx:626
SwPostItFieldType(SwDoc &rDoc)
Definition: docufld.cxx:1710
void SetOffset(short nOff)
Definition: docufld.hxx:599
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhich) override
Definition: docufld.cxx:669
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:1999
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhich) override
Definition: docufld.cxx:370
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhich) override
Definition: docufld.cxx:1196
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:2613
OUString GetFullName() const
OUString aFixedStr
Definition: shellres.hxx:47
#define FIELD_PROP_DATE
Definition: unofldmid.h:30
#define FIELD_PROP_PAR4
Definition: unofldmid.h:36
SwFieldTypesEnum m_nSubType
Definition: docufld.hxx:298
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:787
virtual std::unique_ptr< SwFieldType > Copy() const override
Definition: docufld.cxx:1249
sal_uLong nWord
Definition: docstat.hxx:35
SwTextNode & GetTextNode() const
Definition: txtfld.hxx:53
std::pair< const_iterator, bool > insert(Value &&x)
SvxNumType m_nNumberingType
Definition: docufld.hxx:128
bool m_bIsHidden
Is it not visible?
Definition: docufld.hxx:301
const SwDocInfoSubType DI_TITLE
Definition: docufld.hxx:66
bool MakeSetList(SetGetExpFields &rTmpLst, SwRootFrame const *pLayout)
Definition: docufld.cxx:2210
const Date & GetNullDate() const
SwNode & GetEndOfExtras() const
This is the last EndNode of a special section.
Definition: ndarr.hxx:161
virtual void SetPar2(const OUString &rStr) override
Definition: docufld.cxx:222
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:460
virtual std::unique_ptr< SwField > Copy() const override
Definition: docufld.cxx:2597
bool m_bCanToggle
Can field be toggled alone?
Definition: docufld.hxx:300
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
Definition: docufld.cxx:2472
OUString Expand(SvxNumType nFormat, short nOff, sal_uInt16 const nPageNumber, sal_uInt16 const nMaxPage, const OUString &, LanguageType=LANGUAGE_NONE) const
Definition: docufld.cxx:102
virtual double GetValue() const
Definition: fldbas.cxx:716
OUString sCommand
Definition: swdbdata.hxx:31
virtual sal_uInt16 GetSubType() const override
Definition: docufld.cxx:1443
aStr
sal_uInt16 GetPageNum() const
Definition: rootfrm.hxx:311
void UpdateField(SwTextField const *pTextField, SetGetExpFields const &rSetList, SwRootFrame const *pLayout)
Definition: docufld.cxx:2258
SwRootFrame * getRootFrame()
Definition: frame.hxx:662
sal_Int32 GetEnumAsInt32(const css::uno::Any &rVal)
Definition: swunohelper.cxx:49
SwExtUserField(SwExtUserFieldType *, sal_uInt16 nSub, sal_uInt32 nFormat)
Definition: docufld.cxx:1995
OUString GetFull() const
virtual void SetPar2(const OUString &rStr) override
Definition: docufld.cxx:2117
SwDBManager * GetDBManager() const
Definition: doc.hxx:666
bool GetResolved() const
Definition: docufld.cxx:1774
sal_uInt16 nPos
std::vector< std::unique_ptr< SetGetExpField > >::const_iterator const_iterator
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1317
virtual void SetLanguage(LanguageType nLng) override
set language of the format
Definition: docufld.cxx:1143
sal_Int16 nValue
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:2585
Placeholder.
Definition: poolfmt.hxx:122
bool m_bValid
Is DB-field evaluated?
Definition: docufld.hxx:302
virtual void SetPar1(const OUString &rStr) override
set condition
Definition: docufld.cxx:1698
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo
SfxMedium * GetMedium() const
const SvxNumberType & GetNumType() const
Definition: pagedesc.hxx:192