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 rAny <<= OUString(OUString::number(m_nParentId, 16).toAsciiUpperCase());
1917 }
1918 break;
1919 case FIELD_PROP_PAR6:
1920 {
1921 rAny <<= OUString(OUString::number(m_nPostItId, 16).toAsciiUpperCase());
1922 }
1923 break;
1924 default:
1925 assert(false);
1926 }
1927 return true;
1928}
1929
1930bool SwPostItField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
1931{
1932 switch( nWhichId )
1933 {
1934 case FIELD_PROP_PAR1:
1935 rAny >>= m_sAuthor;
1936 break;
1937 case FIELD_PROP_PAR2:
1938 rAny >>= m_sText;
1939 //#i100374# new string via api, delete complex text object so SwPostItNote picks up the new string
1940 mpText.reset();
1941 break;
1942 case FIELD_PROP_PAR3:
1943 rAny >>= m_sInitials;
1944 break;
1945 case FIELD_PROP_PAR4:
1946 rAny >>= m_sName;
1947 break;
1948 case FIELD_PROP_BOOL1:
1949 rAny >>= m_bResolved;
1950 break;
1951 case FIELD_PROP_TEXT:
1952 OSL_FAIL("Not implemented!");
1953 break;
1954 case FIELD_PROP_DATE:
1955 if( auto aSetDate = o3tl::tryAccess<util::Date>(rAny) )
1956 {
1957 m_aDateTime = Date(aSetDate->Day, aSetDate->Month, aSetDate->Year);
1958 }
1959 break;
1961 {
1962 util::DateTime aDateTimeValue;
1963 if(!(rAny >>= aDateTimeValue))
1964 return false;
1965 m_aDateTime = DateTime(aDateTimeValue);
1966 }
1967 break;
1968 case FIELD_PROP_PAR5:
1969 {
1970 OUString sTemp;
1971 rAny >>= sTemp;
1972 m_nParentId = sTemp.toInt32(16);
1973 }
1974 break;
1975 case FIELD_PROP_PAR6:
1976 {
1977 OUString sTemp;
1978 rAny >>= sTemp;
1979 m_nPostItId = sTemp.toInt32(16);
1980 }
1981 break;
1982 default:
1983 assert(false);
1984 }
1985 return true;
1986}
1987
1989{
1990 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwPostItField"));
1991 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("name"), BAD_CAST(GetName().toUtf8().getStr()));
1992
1993 SwField::dumpAsXml(pWriter);
1994
1995 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("mpText"));
1996 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", mpText ? &*mpText : nullptr);
1997 if (mpText)
1998 mpText->dumpAsXml(pWriter);
1999 (void)xmlTextWriterEndElement(pWriter);
2000
2001 (void)xmlTextWriterEndElement(pWriter);
2002}
2003
2004// extended user information field type
2005
2008{
2009}
2010
2011std::unique_ptr<SwFieldType> SwExtUserFieldType::Copy() const
2012{
2013 return std::make_unique<SwExtUserFieldType>();
2014}
2015
2016OUString SwExtUserFieldType::Expand(sal_uInt16 nSub )
2017{
2018 UserOptToken nRet = static_cast<UserOptToken>(USHRT_MAX);
2019 switch(nSub)
2020 {
2021 case EU_FIRSTNAME: nRet = UserOptToken::FirstName; break;
2022 case EU_NAME: nRet = UserOptToken::LastName; break;
2023 case EU_SHORTCUT: nRet = UserOptToken::ID; break;
2024
2025 case EU_COMPANY: nRet = UserOptToken::Company; break;
2026 case EU_STREET: nRet = UserOptToken::Street; break;
2027 case EU_TITLE: nRet = UserOptToken::Title; break;
2028 case EU_POSITION: nRet = UserOptToken::Position; break;
2029 case EU_PHONE_PRIVATE: nRet = UserOptToken::TelephoneHome; break;
2030 case EU_PHONE_COMPANY: nRet = UserOptToken::TelephoneWork; break;
2031 case EU_FAX: nRet = UserOptToken::Fax; break;
2032 case EU_EMAIL: nRet = UserOptToken::Email; break;
2033 case EU_COUNTRY: nRet = UserOptToken::Country; break;
2034 case EU_ZIP: nRet = UserOptToken::Zip; break;
2035 case EU_CITY: nRet = UserOptToken::City; break;
2036 case EU_STATE: nRet = UserOptToken::State; break;
2037 case EU_FATHERSNAME: nRet = UserOptToken::FathersName; break;
2038 case EU_APARTMENT: nRet = UserOptToken::Apartment; break;
2039 default: OSL_ENSURE( false, "Field unknown");
2040 }
2041 if( static_cast<UserOptToken>(USHRT_MAX) != nRet )
2042 {
2043 SvtUserOptions& rUserOpt = SW_MOD()->GetUserOptions();
2044 return rUserOpt.GetToken( nRet );
2045 }
2046 return OUString();
2047}
2048
2049// extended user information field
2050
2051SwExtUserField::SwExtUserField(SwExtUserFieldType* pTyp, sal_uInt16 nSubTyp, sal_uInt32 nFormat) :
2052 SwField(pTyp, nFormat), m_nType(nSubTyp)
2053{
2055}
2056
2057OUString SwExtUserField::ExpandImpl(SwRootFrame const*const) const
2058{
2059 if (!IsFixed())
2061
2062 return m_aContent;
2063}
2064
2065std::unique_ptr<SwField> SwExtUserField::Copy() const
2066{
2067 std::unique_ptr<SwExtUserField> pField(new SwExtUserField(static_cast<SwExtUserFieldType*>(GetTyp()), m_nType, GetFormat()));
2068 pField->SetExpansion(m_aContent);
2069
2070 return std::unique_ptr<SwField>(pField.release());
2071}
2072
2074{
2075 return m_nType;
2076}
2077
2078void SwExtUserField::SetSubType(sal_uInt16 nSub)
2079{
2080 m_nType = nSub;
2081}
2082
2083bool SwExtUserField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
2084{
2085 switch( nWhichId )
2086 {
2087 case FIELD_PROP_PAR1:
2088 rAny <<= m_aContent;
2089 break;
2090
2091 case FIELD_PROP_USHORT1:
2092 {
2093 sal_Int16 nTmp = m_nType;
2094 rAny <<= nTmp;
2095 }
2096 break;
2097 case FIELD_PROP_BOOL1:
2098 rAny <<= IsFixed();
2099 break;
2100 default:
2101 assert(false);
2102 }
2103 return true;
2104}
2105
2106bool SwExtUserField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
2107{
2108 switch( nWhichId )
2109 {
2110 case FIELD_PROP_PAR1:
2111 rAny >>= m_aContent;
2112 break;
2113
2114 case FIELD_PROP_USHORT1:
2115 {
2116 sal_Int16 nTmp = 0;
2117 rAny >>= nTmp;
2118 m_nType = nTmp;
2119 }
2120 break;
2121 case FIELD_PROP_BOOL1:
2122 if( *o3tl::doAccess<bool>(rAny) )
2124 else
2126 break;
2127 default:
2128 assert(false);
2129 }
2130 return true;
2131}
2132
2133// field type for relative page numbers
2134
2137{
2138}
2139
2140std::unique_ptr<SwFieldType> SwRefPageSetFieldType::Copy() const
2141{
2142 return std::make_unique<SwRefPageSetFieldType>();
2143}
2144
2145// overridden since there is nothing to update
2147{
2148}
2149
2150// field for relative page numbers
2151
2153 short nOff, bool bFlag )
2154 : SwField( pTyp ), m_nOffset( nOff ), m_bOn( bFlag )
2155{
2156}
2157
2159{
2160 return OUString();
2161}
2162
2163std::unique_ptr<SwField> SwRefPageSetField::Copy() const
2164{
2165 return std::make_unique<SwRefPageSetField>( static_cast<SwRefPageSetFieldType*>(GetTyp()), m_nOffset, m_bOn );
2166}
2167
2169{
2170 return OUString::number(GetOffset());
2171}
2172
2173void SwRefPageSetField::SetPar2(const OUString& rStr)
2174{
2175 SetOffset( static_cast<short>(rStr.toInt32()) );
2176}
2177
2178bool SwRefPageSetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
2179{
2180 switch( nWhichId )
2181 {
2182 case FIELD_PROP_BOOL1:
2183 rAny <<= m_bOn;
2184 break;
2185 case FIELD_PROP_USHORT1:
2186 rAny <<= static_cast<sal_Int16>(m_nOffset);
2187 break;
2188 default:
2189 assert(false);
2190 }
2191 return true;
2192}
2193
2194bool SwRefPageSetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
2195{
2196 switch( nWhichId )
2197 {
2198 case FIELD_PROP_BOOL1:
2199 m_bOn = *o3tl::doAccess<bool>(rAny);
2200 break;
2201 case FIELD_PROP_USHORT1:
2202 rAny >>=m_nOffset;
2203 break;
2204 default:
2205 assert(false);
2206 }
2207 return true;
2208}
2209
2210// relative page numbers - query field
2211
2213 : SwFieldType( SwFieldIds::RefPageGet ), m_rDoc( rDc ), m_nNumberingType( SVX_NUM_ARABIC )
2214{
2215}
2216
2217std::unique_ptr<SwFieldType> SwRefPageGetFieldType::Copy() const
2218{
2219 std::unique_ptr<SwRefPageGetFieldType> pNew(new SwRefPageGetFieldType( m_rDoc ));
2220 pNew->m_nNumberingType = m_nNumberingType;
2221 return pNew;
2222}
2223
2225{
2226 if (rHint.GetId() != SfxHintId::SwLegacyModify)
2227 return;
2228 auto pLegacy = static_cast<const sw::LegacyModifyHint*>(&rHint);
2229 auto const ModifyImpl = [this](SwRootFrame const*const pLayout)
2230 {
2231 // first collect all SetPageRefFields
2232 SetGetExpFields aTmpLst;
2233 if (MakeSetList(aTmpLst, pLayout))
2234 {
2235 std::vector<SwFormatField*> vFields;
2236 GatherFields(vFields);
2237 for(auto pFormatField: vFields)
2238 UpdateField(pFormatField->GetTextField(), aTmpLst, pLayout);
2239 }
2240 };
2241
2242 // update all GetReference fields
2243 if( !pLegacy->m_pNew && !pLegacy->m_pOld && HasWriterListeners() )
2244 {
2245 SwRootFrame const* pLayout(nullptr);
2246 SwRootFrame const* pLayoutRLHidden(nullptr);
2247 for (SwRootFrame const*const pLay : m_rDoc.GetAllLayouts())
2248 {
2249 if (pLay->IsHideRedlines())
2250 {
2251 pLayoutRLHidden = pLay;
2252 }
2253 else
2254 {
2255 pLayout = pLay;
2256 }
2257 }
2258 ModifyImpl(pLayout);
2259 if (pLayoutRLHidden)
2260 {
2261 ModifyImpl(pLayoutRLHidden);
2262 }
2263 }
2264
2265 // forward to text fields, they "expand" the text
2266 CallSwClientNotify(rHint);
2267}
2268
2270 SwRootFrame const*const pLayout)
2271{
2273 std::vector<SwFormatField*> vFields;
2275 for(auto pFormatField: vFields)
2276 {
2277 // update only the GetRef fields
2278 const SwTextField* pTField = pFormatField->GetTextField();
2279 if (!pLayout || !pLayout->IsHideRedlines() || !sw::IsFieldDeletedInModel(rIDRA, *pTField))
2280 {
2281 const SwTextNode& rTextNd = pTField->GetTextNode();
2282
2283 // Always the first! (in Tab-Headline, header/footer )
2284 Point aPt;
2285 std::pair<Point, bool> const tmp(aPt, false);
2286 const SwContentFrame *const pFrame = rTextNd.getLayoutFrame(
2287 pLayout, nullptr, &tmp);
2288
2289 std::unique_ptr<SetGetExpField> pNew;
2290
2291 if( !pFrame ||
2292 pFrame->IsInDocBody() ||
2293 // #i31868#
2294 // Check if pFrame is not yet connected to the layout.
2295 !pFrame->FindPageFrame() )
2296 {
2297 pNew.reset( new SetGetExpField( rTextNd, pTField ) );
2298 }
2299 else
2300 {
2301 // create index for determination of the TextNode
2303 bool const bResult = GetBodyTextNode( m_rDoc, aPos, *pFrame );
2304 OSL_ENSURE(bResult, "where is the Field?");
2305 pNew.reset( new SetGetExpField( aPos.GetNode(), pTField,
2306 aPos.GetContentIndex() ) );
2307 }
2308
2309 rTmpLst.insert( std::move(pNew) );
2310 }
2311 }
2312 return !rTmpLst.empty();
2313}
2314
2316 SetGetExpFields const & rSetList,
2317 SwRootFrame const*const pLayout)
2318{
2319 SwRefPageGetField* pGetField = const_cast<SwRefPageGetField*>(static_cast<const SwRefPageGetField*>(pTextField->GetFormatField().GetField()));
2320 pGetField->SetText( OUString(), pLayout );
2321
2322 // then search the correct RefPageSet field
2323 SwTextNode* pTextNode = &pTextField->GetTextNode();
2324 if( pTextNode->StartOfSectionIndex() >
2326 {
2327 SetGetExpField aEndField( *pTextNode, pTextField );
2328
2329 SetGetExpFields::const_iterator itLast = rSetList.lower_bound( &aEndField );
2330
2331 if( itLast != rSetList.begin() )
2332 {
2333 --itLast;
2334 const SwTextField* pRefTextField = (*itLast)->GetTextField();
2335 const SwRefPageSetField* pSetField =
2336 static_cast<const SwRefPageSetField*>(pRefTextField->GetFormatField().GetField());
2337 if( pSetField->IsOn() )
2338 {
2339 // determine the correct offset
2340 Point aPt;
2341 std::pair<Point, bool> const tmp(aPt, false);
2342 const SwContentFrame *const pFrame = pTextNode->getLayoutFrame(
2343 pLayout, nullptr, &tmp);
2344 const SwContentFrame *const pRefFrame = pRefTextField->GetTextNode().getLayoutFrame(
2345 pLayout, nullptr, &tmp);
2346 const SwPageFrame* pPgFrame = nullptr;
2347 short nDiff = 1;
2348 if ( pFrame && pRefFrame )
2349 {
2350 pPgFrame = pFrame->FindPageFrame();
2351 nDiff = pPgFrame->GetPhyPageNum() -
2352 pRefFrame->FindPageFrame()->GetPhyPageNum() + 1;
2353 }
2354
2355 SvxNumType nTmpFormat = SVX_NUM_PAGEDESC == static_cast<SvxNumType>(pGetField->GetFormat())
2356 ? ( !pPgFrame
2358 : pPgFrame->GetPageDesc()->GetNumType().GetNumberingType() )
2359 : static_cast<SvxNumType>(pGetField->GetFormat());
2360 const short nPageNum = std::max<short>(0, pSetField->GetOffset() + nDiff);
2361 pGetField->SetText(FormatNumber(nPageNum, nTmpFormat), pLayout);
2362 }
2363 }
2364 }
2365 // start formatting
2366 const_cast<SwFormatField&>(pTextField->GetFormatField()).ForceUpdateTextNode();
2367}
2368
2369// queries for relative page numbering
2370
2372 sal_uInt32 nFormat )
2373 : SwField( pTyp, nFormat )
2374{
2375}
2376
2377void SwRefPageGetField::SetText(const OUString& rText,
2378 SwRootFrame const*const pLayout)
2379{
2380 if (!pLayout || !pLayout->IsHideRedlines())
2381 {
2382 m_sText = rText;
2383 }
2384 if (!pLayout || pLayout->IsHideRedlines())
2385 {
2386 m_sTextRLHidden = rText;
2387 }
2388}
2389
2390OUString SwRefPageGetField::ExpandImpl(SwRootFrame const*const pLayout) const
2391{
2392 return pLayout && pLayout->IsHideRedlines() ? m_sTextRLHidden : m_sText;
2393}
2394
2395std::unique_ptr<SwField> SwRefPageGetField::Copy() const
2396{
2397 std::unique_ptr<SwRefPageGetField> pCpy(new SwRefPageGetField(
2398 static_cast<SwRefPageGetFieldType*>(GetTyp()), GetFormat() ));
2399 pCpy->m_sText = m_sText;
2400 pCpy->m_sTextRLHidden = m_sTextRLHidden;
2401 return std::unique_ptr<SwField>(pCpy.release());
2402}
2403
2405 const SwTextField* pField )
2406{
2407 // only fields in Footer, Header, FootNote, Flys
2408 SwRefPageGetFieldType* pGetType = static_cast<SwRefPageGetFieldType*>(GetTyp());
2409 SwDoc& rDoc = pGetType->GetDoc();
2410 if( pField->GetTextNode().StartOfSectionIndex() >
2411 rDoc.GetNodes().GetEndOfExtras().GetIndex() )
2412 return;
2413
2414 SwRootFrame const& rLayout(*rFrame.getRootFrame());
2415 OUString & rText(rLayout.IsHideRedlines() ? m_sTextRLHidden : m_sText);
2416 rText.clear();
2417
2418 OSL_ENSURE(!rFrame.IsInDocBody(), "Flag incorrect, frame is in DocBody");
2419
2420 // collect all SetPageRefFields
2421 SetGetExpFields aTmpLst;
2422 if (!pGetType->MakeSetList(aTmpLst, &rLayout))
2423 return ;
2424
2425 // create index for determination of the TextNode
2426 SwPosition aPos( rDoc.GetNodes() );
2427 SwTextNode* pTextNode = const_cast<SwTextNode*>(GetBodyTextNode(rDoc, aPos, rFrame));
2428
2429 // If no layout exists, ChangeExpansion is called for header and
2430 // footer lines via layout formatting without existing TextNode.
2431 if(!pTextNode)
2432 return;
2433
2434 SetGetExpField aEndField( aPos.GetNode(), pField, aPos.GetContentIndex() );
2435
2436 SetGetExpFields::const_iterator itLast = aTmpLst.lower_bound( &aEndField );
2437
2438 if( itLast == aTmpLst.begin() )
2439 return; // there is no corresponding set-field in front
2440 --itLast;
2441
2442 const SwTextField* pRefTextField = (*itLast)->GetTextField();
2443 const SwRefPageSetField* pSetField =
2444 static_cast<const SwRefPageSetField*>(pRefTextField->GetFormatField().GetField());
2445 Point aPt;
2446 std::pair<Point, bool> const tmp(aPt, false);
2447 const SwContentFrame *const pRefFrame = pRefTextField->GetTextNode().getLayoutFrame(
2448 &rLayout, nullptr, &tmp);
2449 if( !(pSetField->IsOn() && pRefFrame) )
2450 return;
2451
2452 // determine the correct offset
2453 const SwPageFrame* pPgFrame = rFrame.FindPageFrame();
2454 const short nDiff = pPgFrame->GetPhyPageNum() -
2455 pRefFrame->FindPageFrame()->GetPhyPageNum() + 1;
2456
2457 SwRefPageGetField* pGetField = const_cast<SwRefPageGetField*>(static_cast<const SwRefPageGetField*>(pField->GetFormatField().GetField()));
2458 SvxNumType nTmpFormat = SVX_NUM_PAGEDESC == pGetField->GetFormat()
2459 ? pPgFrame->GetPageDesc()->GetNumType().GetNumberingType()
2460 : static_cast<SvxNumType>(pGetField->GetFormat());
2461 const short nPageNum = std::max<short>(0, pSetField->GetOffset() + nDiff);
2462 pGetField->SetText(FormatNumber(nPageNum, nTmpFormat), &rLayout);
2463}
2464
2465bool SwRefPageGetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
2466{
2467 switch( nWhichId )
2468 {
2469 case FIELD_PROP_USHORT1:
2470 rAny <<= static_cast<sal_Int16>(GetFormat());
2471 break;
2472 case FIELD_PROP_PAR1:
2473 rAny <<= m_sText;
2474 break;
2475 default:
2476 assert(false);
2477 }
2478 return true;
2479}
2480
2481bool SwRefPageGetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
2482{
2483 switch( nWhichId )
2484 {
2485 case FIELD_PROP_USHORT1:
2486 {
2487 sal_Int16 nSet = 0;
2488 rAny >>= nSet;
2489 if(nSet <= SVX_NUM_PAGEDESC )
2490 SetFormat(nSet);
2491 }
2492 break;
2493 case FIELD_PROP_PAR1:
2494 rAny >>= m_sText;
2496 break;
2497 default:
2498 assert(false);
2499 }
2500 return true;
2501}
2502
2503// field type to jump to and edit
2504
2506 : SwFieldType( SwFieldIds::JumpEdit ), m_rDoc( rD ), m_aDep( *this )
2507{
2508}
2509
2510std::unique_ptr<SwFieldType> SwJumpEditFieldType::Copy() const
2511{
2512 return std::make_unique<SwJumpEditFieldType>( m_rDoc );
2513}
2514
2516{
2518 m_aDep.StartListening(pFormat);
2519 return pFormat;
2520}
2521
2523 OUString aText, OUString aHelp )
2524 : SwField( pTyp, nForm ), m_sText( std::move(aText) ), m_sHelp( std::move(aHelp) )
2525{
2526}
2527
2528OUString SwJumpEditField::ExpandImpl(SwRootFrame const*const) const
2529{
2530 return "<" + m_sText + ">";
2531}
2532
2533std::unique_ptr<SwField> SwJumpEditField::Copy() const
2534{
2535 return std::make_unique<SwJumpEditField>( static_cast<SwJumpEditFieldType*>(GetTyp()), GetFormat(),
2536 m_sText, m_sHelp );
2537}
2538
2541{
2542 return m_sText;
2543}
2544
2546void SwJumpEditField::SetPar1(const OUString& rStr)
2547{
2548 m_sText = rStr;
2549}
2550
2553{
2554 return m_sHelp;
2555}
2556
2558void SwJumpEditField::SetPar2(const OUString& rStr)
2559{
2560 m_sHelp = rStr;
2561}
2562
2563bool SwJumpEditField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
2564{
2565 switch( nWhichId )
2566 {
2567 case FIELD_PROP_USHORT1:
2568 {
2569 sal_Int16 nRet;
2570 switch( GetFormat() )
2571 {
2572 case JE_FMT_TABLE: nRet = text::PlaceholderType::TABLE; break;
2573 case JE_FMT_FRAME: nRet = text::PlaceholderType::TEXTFRAME; break;
2574 case JE_FMT_GRAPHIC:nRet = text::PlaceholderType::GRAPHIC; break;
2575 case JE_FMT_OLE: nRet = text::PlaceholderType::OBJECT; break;
2576 default:
2577 nRet = text::PlaceholderType::TEXT; break;
2578 }
2579 rAny <<= nRet;
2580 }
2581 break;
2582 case FIELD_PROP_PAR1 :
2583 rAny <<= m_sHelp;
2584 break;
2585 case FIELD_PROP_PAR2 :
2586 rAny <<= m_sText;
2587 break;
2588 default:
2589 assert(false);
2590 }
2591 return true;
2592}
2593
2594bool SwJumpEditField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
2595{
2596 switch( nWhichId )
2597 {
2598 case FIELD_PROP_USHORT1:
2599 {
2600 //JP 24.10.2001: int32 because in UnoField.cxx a putvalue is
2601 // called with a int32 value! But normally we need
2602 // here only a int16
2603 sal_Int32 nSet = 0;
2604 rAny >>= nSet;
2605 switch( nSet )
2606 {
2607 case text::PlaceholderType::TEXT : SetFormat(JE_FMT_TEXT); break;
2608 case text::PlaceholderType::TABLE : SetFormat(JE_FMT_TABLE); break;
2609 case text::PlaceholderType::TEXTFRAME: SetFormat(JE_FMT_FRAME); break;
2610 case text::PlaceholderType::GRAPHIC : SetFormat(JE_FMT_GRAPHIC); break;
2611 case text::PlaceholderType::OBJECT : SetFormat(JE_FMT_OLE); break;
2612 }
2613 }
2614 break;
2615 case FIELD_PROP_PAR1 :
2616 rAny >>= m_sHelp;
2617 break;
2618 case FIELD_PROP_PAR2 :
2619 rAny >>= m_sText;
2620 break;
2621 default:
2622 assert(false);
2623 }
2624 return true;
2625}
2626
2627// combined character field type
2628
2631{
2632}
2633
2634std::unique_ptr<SwFieldType> SwCombinedCharFieldType::Copy() const
2635{
2636 return std::make_unique<SwCombinedCharFieldType>();
2637}
2638
2639// combined character field
2640
2642 const OUString& rChars )
2643 : SwField( pFTyp, 0 ),
2644 m_sCharacters( rChars.copy( 0, std::min<sal_Int32>(rChars.getLength(), MAX_COMBINED_CHARACTERS) ))
2645{
2646}
2647
2649{
2650 return m_sCharacters;
2651}
2652
2653std::unique_ptr<SwField> SwCombinedCharField::Copy() const
2654{
2655 return std::make_unique<SwCombinedCharField>( static_cast<SwCombinedCharFieldType*>(GetTyp()),
2656 m_sCharacters );
2657}
2658
2660{
2661 return m_sCharacters;
2662}
2663
2664void SwCombinedCharField::SetPar1(const OUString& rStr)
2665{
2666 m_sCharacters = rStr.copy(0, std::min<sal_Int32>(rStr.getLength(), MAX_COMBINED_CHARACTERS));
2667}
2668
2670 sal_uInt16 nWhichId ) const
2671{
2672 switch( nWhichId )
2673 {
2674 case FIELD_PROP_PAR1:
2675 rAny <<= m_sCharacters;
2676 break;
2677 default:
2678 assert(false);
2679 }
2680 return true;
2681}
2682
2684 sal_uInt16 nWhichId )
2685{
2686 switch( nWhichId )
2687 {
2688 case FIELD_PROP_PAR1:
2689 {
2690 OUString sTmp;
2691 rAny >>= sTmp;
2692 SetPar1(sTmp);
2693 }
2694 break;
2695 default:
2696 assert(false);
2697 }
2698 return true;
2699}
2700
2701/* 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 SwFieldType * GetSysFieldType(const SwFieldIds eWhich) const =0
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:2634
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhich) override
Definition: docufld.cxx:2683
virtual void SetPar1(const OUString &rStr) override
Definition: docufld.cxx:2664
virtual std::unique_ptr< SwField > Copy() const override
Definition: docufld.cxx:2653
OUString m_sCharacters
combine these characters
Definition: docufld.hxx:750
virtual OUString GetPar1() const override
Characters.
Definition: docufld.cxx:2659
SwCombinedCharField(SwCombinedCharFieldType *, const OUString &rChars)
Definition: docufld.cxx:2641
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhich) const override
Definition: docufld.cxx:2669
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
Definition: docufld.cxx:2648
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
Definition: cntfrm.hxx:59
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
Definition: node.cxx:1223
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:2026
bool GetMergeColumnCnt(const OUString &rColumnName, LanguageType nLanguage, OUString &rResult, double *pNumber)
Definition: dbmgr.cxx:2110
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:197
SwDBData const & GetDBData()
Definition: docfld.cxx:386
o3tl::sorted_vector< SwRootFrame * > GetAllLayouts()
Definition: doclay.cxx:1680
SwDBManager * GetDBManager() const
Definition: doc.hxx:683
SwNodes & GetNodes()
Definition: doc.hxx:422
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
Definition: doc.cxx:371
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:349
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:419
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:440
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1334
SvNumberFormatter * GetNumberFormatter(bool bCreate=true)
Definition: doc.hxx:1426
SwDocShell * GetDocShell()
Definition: doc.hxx:1367
IDocumentStatistics const & getIDocumentStatistics() const
Definition: doc.cxx:387
static OUString Expand(sal_uInt16 nSubType)
Definition: docufld.cxx:2016
virtual std::unique_ptr< SwFieldType > Copy() const override
Definition: docufld.cxx:2011
virtual sal_uInt16 GetSubType() const override
Definition: docufld.cxx:2073
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
Definition: docufld.cxx:2057
virtual std::unique_ptr< SwField > Copy() const override
Definition: docufld.cxx:2065
SwExtUserField(SwExtUserFieldType *, sal_uInt16 nSub, sal_uInt32 nFormat)
Definition: docufld.cxx:2051
OUString m_aContent
Definition: docufld.hxx:566
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhich) override
Definition: docufld.cxx:2106
sal_uInt16 m_nType
Definition: docufld.hxx:567
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhich) const override
Definition: docufld.cxx:2083
virtual void SetSubType(sal_uInt16 nSub) override
Definition: docufld.cxx:2078
Instances of SwFields and those derived from it occur 0 to n times.
Definition: fldbas.hxx:247
static const OUString & GetTypeStr(SwFieldTypesEnum nTypeId)
Definition: fldbas.cxx:124
void GatherFields(std::vector< SwFormatField * > &rvFormatFields, bool bCollectOnlyInDocNodes=true) const
Definition: fldbas.cxx:205
Base class of all fields.
Definition: fldbas.hxx:296
virtual void SetLanguage(LanguageType nLng)
Definition: fldbas.cxx:449
SwFieldTypesEnum GetTypeId() const
Definition: fldbas.cxx:270
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: fldbas.cxx:931
bool IsAutomaticLanguage() const
Definition: fldbas.hxx:387
void SetFormat(sal_uInt32 const nSet)
Definition: fldbas.hxx:311
sal_uInt32 GetFormat() const
Query parameters for dialog and for BASIC.
Definition: fldbas.hxx:407
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhichId) const
Definition: fldbas.cxx:364
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhichId)
Definition: fldbas.cxx:382
SwFieldType * GetTyp() const
Definition: fldbas.hxx:402
LanguageType GetLanguage() const
Language at field position.
Definition: fldbas.hxx:412
bool IsFixed() const
Definition: fldbas.cxx:459
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:131
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:949
SwRootFrame * getRootFrame()
Definition: frame.hxx:685
SwPageFrame * FindPageFrame()
Definition: frame.hxx:686
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:372
SwCharFormat * GetCharFormat()
Definition: docufld.cxx:2515
sw::WriterMultiListener m_aDep
Definition: docufld.hxx:662
SwJumpEditFieldType(SwDoc &rDoc)
Definition: docufld.cxx:2505
virtual std::unique_ptr< SwFieldType > Copy() const override
Definition: docufld.cxx:2510
OUString m_sText
Definition: docufld.hxx:674
virtual void SetPar2(const OUString &rStr) override
set hint text
Definition: docufld.cxx:2558
virtual std::unique_ptr< SwField > Copy() const override
Definition: docufld.cxx:2533
virtual OUString GetPar1() const override
Placeholder-Text.
Definition: docufld.cxx:2540
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
Definition: docufld.cxx:2528
SwJumpEditField(SwJumpEditFieldType *, sal_uInt32 nFormat, OUString sText, OUString sHelp)
Definition: docufld.cxx:2522
virtual void SetPar1(const OUString &rStr) override
set place holder text
Definition: docufld.cxx:2546
OUString m_sHelp
Definition: docufld.hxx:675
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhich) override
Definition: docufld.cxx:2594
virtual OUString GetPar2() const override
Hint-Text.
Definition: docufld.cxx:2552
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhich) const override
Definition: docufld.cxx:2563
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:59
sal_uInt16 GetPhyPageNum() const
Definition: pagefrm.hxx:205
SwPageDesc * GetPageDesc()
Definition: pagefrm.hxx:144
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:1988
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:1930
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:2217
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
overwritten to update all RefPageGet fields
Definition: docufld.cxx:2224
sal_Int16 m_nNumberingType
Definition: docufld.hxx:625
SwRefPageGetFieldType(SwDoc &rDoc)
Definition: docufld.cxx:2212
bool MakeSetList(SetGetExpFields &rTmpLst, SwRootFrame const *pLayout)
Definition: docufld.cxx:2269
void UpdateField(SwTextField const *pTextField, SetGetExpFields const &rSetList, SwRootFrame const *pLayout)
Definition: docufld.cxx:2315
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhich) const override
Definition: docufld.cxx:2465
void ChangeExpansion(const SwFrame &rFrame, const SwTextField *pField)
Definition: docufld.cxx:2404
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhich) override
Definition: docufld.cxx:2481
OUString m_sText
Definition: docufld.hxx:642
virtual std::unique_ptr< SwField > Copy() const override
Definition: docufld.cxx:2395
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
Definition: docufld.cxx:2390
void SetText(const OUString &rText, SwRootFrame const *pLayout)
Definition: docufld.cxx:2377
OUString m_sTextRLHidden
hidden redlines
Definition: docufld.hxx:643
SwRefPageGetField(SwRefPageGetFieldType *, sal_uInt32 nFormat)
Definition: docufld.cxx:2371
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
noop, there is nothing to update!
Definition: docufld.cxx:2146
virtual std::unique_ptr< SwFieldType > Copy() const override
Definition: docufld.cxx:2140
void SetOffset(short nOff)
Definition: docufld.hxx:616
SwRefPageSetField(SwRefPageSetFieldType *, short nOff, bool bOn)
Definition: docufld.cxx:2152
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
Definition: docufld.cxx:2158
bool IsOn() const
Definition: docufld.hxx:613
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhich) override
Definition: docufld.cxx:2194
virtual OUString GetPar2() const override
Definition: docufld.cxx:2168
virtual void SetPar2(const OUString &rStr) override
Definition: docufld.cxx:2173
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhich) const override
Definition: docufld.cxx:2178
short GetOffset() const
Definition: docufld.hxx:615
virtual std::unique_ptr< SwField > Copy() const override
Definition: docufld.cxx:2163
The root element of a Writer document layout.
Definition: rootfrm.hxx:85
sal_uInt16 GetPageNum() const
Definition: rootfrm.hxx:321
bool IsHideRedlines() const
Replacement for sw::DocumentRedlineManager::GetRedlineFlags() (this is layout-level redline hiding).
Definition: rootfrm.hxx:434
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:112
Fields containing values that have to be formatted via number formatter.
Definition: fldbas.hxx:419
OUString ExpandValue(const double &rVal, sal_uInt32 nFormat, LanguageType nLng) const
return value formatted as string
Definition: fldbas.cxx:585
SwDoc * GetDoc() const
Definition: fldbas.hxx:429
virtual void SetLanguage(LanguageType nLng) override
set language of the format
Definition: fldbas.cxx:757
OUString ExpandValue(const double &rVal, sal_uInt32 nFormat, LanguageType nLng) const
Definition: fldbas.hxx:472
virtual double GetValue() const
Definition: fldbas.cxx:799
SwDoc * GetDoc() const
Definition: fldbas.hxx:465
static ShellResource * GetShellRes()
Definition: viewsh.cxx:2648
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:1228
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:523
SwFieldTypesEnum
List of FieldTypes at UI.
Definition: fldbas.hxx:98
@ FF_UI_RANGE
Definition: fldbas.hxx:164
@ FF_UI_NAME
Definition: fldbas.hxx:163
@ FF_FIXED
Definition: fldbas.hxx:166
@ FF_NAME_NOEXT
Definition: fldbas.hxx:162
@ FF_PATH
Definition: fldbas.hxx:161
@ FF_END
Definition: fldbas.hxx:165
@ FF_NAME
Definition: fldbas.hxx:159
@ FF_PATHNAME
Definition: fldbas.hxx:160
SwFieldIds
Definition: fldbas.hxx:49
DocumentType eType
sal_Int16 nValue
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(99)
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::basic_string_view< charT, traits > trim(std::basic_string_view< charT, traits > 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:38
SwNode & GetNode() const
Definition: pam.hxx:81
sal_Int32 GetContentIndex() const
Definition: pam.hxx:85
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