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