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