LibreOffice Module sw (master) 1
unofield.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 <sal/config.h>
21#include <algorithm>
22#include <memory>
23
24#include <unofield.hxx>
25#include <unofieldcoll.hxx>
26#include <unobookmark.hxx>
27#include <swtypes.hxx>
28#include <cmdid.h>
29#include <doc.hxx>
34#include <IDocumentState.hxx>
35#include <fmtfld.hxx>
36#include <txtfld.hxx>
37#include <ndtxt.hxx>
38#include <unomap.hxx>
39#include <unoprnms.hxx>
40#include <unotextrange.hxx>
41#include <unotextcursor.hxx>
42#include <unocoll.hxx>
43#include <sfx2/linkmgr.hxx>
44#include <editsh.hxx>
45#include <viewsh.hxx>
48#include <comphelper/string.hxx>
50#include <com/sun/star/util/DateTime.hpp>
51#include <com/sun/star/util/Date.hpp>
52#include <com/sun/star/beans/PropertyAttribute.hpp>
53
54//undef to prevent error (from sfx2/docfile.cxx)
55#undef SEQUENCE
56#include <com/sun/star/text/SetVariableType.hpp>
57#include <com/sun/star/text/WrapTextMode.hpp>
58#include <com/sun/star/text/TextContentAnchorType.hpp>
59#include <authfld.hxx>
60#include <flddat.hxx>
61#include <dbfld.hxx>
62#include <usrfld.hxx>
63#include <docufld.hxx>
64#include <expfld.hxx>
65#include <chpfld.hxx>
66#include <flddropdown.hxx>
67#include <poolfmt.hxx>
68#include <strings.hrc>
69#include <pagedesc.hxx>
70#include <docary.hxx>
71#include <reffld.hxx>
72#include <ddefld.hxx>
73#include <SwStyleNameMapper.hxx>
74#include <swunohelper.hxx>
75#include <unofldmid.h>
76#include <scriptinfo.hxx>
77#include <tools/datetime.hxx>
78#include <tools/urlobj.hxx>
79#include <svl/itemprop.hxx>
80#include <svl/listener.hxx>
82#include <o3tl/any.hxx>
83#include <o3tl/safeint.hxx>
84#include <mutex>
85#include <vcl/svapp.hxx>
86#include <textapi.hxx>
87#include <fmtmeta.hxx>
88#include <vector>
89
90using namespace ::com::sun::star;
91using namespace nsSwDocInfoSubType;
92
93// case-corrected version of the first part for the service names (see #i67811)
94constexpr OUStringLiteral COM_TEXT_FLDMASTER_CC = u"com.sun.star.text.fieldmaster.";
95
96// note: this thing is indexed as an array, so do not insert/remove entries!
97const sal_uInt16 aDocInfoSubTypeFromService[] =
98{
99 DI_CHANGE | DI_SUB_AUTHOR, //PROPERTY_MAP_FLDTYP_DOCINFO_CHANGE_AUTHOR
100 DI_CHANGE | DI_SUB_DATE, //PROPERTY_MAP_FLDTYP_DOCINFO_CHANGE_DATE_TIME
101 DI_EDIT | DI_SUB_TIME, //PROPERTY_MAP_FLDTYP_DOCINFO_EDIT_TIME
102 DI_COMMENT, //PROPERTY_MAP_FLDTYP_DOCINFO_DESCRIPTION
103 DI_CREATE | DI_SUB_AUTHOR, //PROPERTY_MAP_FLDTYP_DOCINFO_CREATE_AUTHOR
104 DI_CREATE | DI_SUB_DATE, //PROPERTY_MAP_FLDTYP_DOCINFO_CREATE_DATE_TIME
105 0, //DUMMY
106 0, //DUMMY
107 0, //DUMMY
108 0, //DUMMY
109 DI_CUSTOM, //PROPERTY_MAP_FLDTYP_DOCINFO_CUSTOM
110 DI_PRINT | DI_SUB_AUTHOR, //PROPERTY_MAP_FLDTYP_DOCINFO_PRINT_AUTHOR
111 DI_PRINT | DI_SUB_DATE, //PROPERTY_MAP_FLDTYP_DOCINFO_PRINT_DATE_TIME
112 DI_KEYS, //PROPERTY_MAP_FLDTYP_DOCINFO_KEY_WORDS
113 DI_SUBJECT, //PROPERTY_MAP_FLDTYP_DOCINFO_SUBJECT
114 DI_TITLE, //PROPERTY_MAP_FLDTYP_DOCINFO_TITLE
115 DI_DOCNO //PROPERTY_MAP_FLDTYP_DOCINFO_REVISION
116};
117
118namespace {
119
120struct ServiceIdResId
121{
122 SwFieldIds nResId;
123 SwServiceType nServiceId;
124};
125
126}
127
128const ServiceIdResId aServiceToRes[] =
129{
182};
183
185{
186 for (auto const& aEntry : aServiceToRes)
187 if (aEntry.nServiceId == nServiceId)
188 return aEntry.nResId;
189#if OSL_DEBUG_LEVEL > 0
190 OSL_FAIL("service id not found");
191#endif
192 return SwFieldIds::Unknown;
193}
194
196{
197 const SwFieldIds nWhich = rField.Which();
199 //special handling for some fields
200 switch( nWhich )
201 {
203 if( INP_USR == (rField.GetSubType() & 0x00ff) )
205 break;
206
208 {
209 const sal_uInt16 nSubType = rField.GetSubType();
210 switch( nSubType & 0xff )
211 {
212 case DI_CHANGE:
213 nSrvId = ((nSubType&0x300) == DI_SUB_AUTHOR)
216 break;
217 case DI_CREATE:
218 nSrvId = ((nSubType&0x300) == DI_SUB_AUTHOR)
221 break;
222 case DI_PRINT:
223 nSrvId = ((nSubType&0x300) == DI_SUB_AUTHOR)
226 break;
234 }
235 }
236 break;
237
239 nSrvId = SwFieldTypesEnum::ConditionalText == static_cast<SwFieldTypesEnum>(rField.GetSubType())
242 break;
243
245 {
246 switch( rField.GetSubType() )
247 {
248 case DS_PAGE: nSrvId = SwServiceType::FieldTypePageCount; break;
250 case DS_WORD: nSrvId = SwServiceType::FieldTypeWordCount ; break;
252 case DS_TBL: nSrvId = SwServiceType::FieldTypeTableCount ; break;
255 }
256 }
257 break;
258 default: break;
259 }
260 if( SwServiceType::Invalid == nSrvId )
261 {
262 for( const ServiceIdResId* pMap = aServiceToRes;
263 SwFieldIds::Unknown != pMap->nResId; ++pMap )
264 if( nWhich == pMap->nResId )
265 {
266 nSrvId = pMap->nServiceId;
267 break;
268 }
269 }
270#if OSL_DEBUG_LEVEL > 0
271 if( SwServiceType::Invalid == nSrvId )
272 OSL_FAIL("resid not found");
273#endif
274 return nSrvId;
275}
276
277static sal_uInt16 lcl_GetPropMapIdForFieldType( SwFieldIds nWhich )
278{
279 sal_uInt16 nId;
280 switch( nWhich )
281 {
289 }
290 return nId;
291}
292
293static sal_Int32 lcl_PropName2TokenPos(std::u16string_view rPropertyName)
294{
295 if (rPropertyName == UNO_NAME_DDE_COMMAND_TYPE)
296 return 0;
297
298 if (rPropertyName == UNO_NAME_DDE_COMMAND_FILE)
299 return 1;
300
301 if (rPropertyName == UNO_NAME_DDE_COMMAND_ELEMENT)
302 return 2;
303
304 if (rPropertyName == UNO_NAME_IS_AUTOMATIC_UPDATE)
305 return 3;
306
307 return SAL_MAX_INT32;
308}
309
310static sal_uInt16 GetFieldTypeMId( std::u16string_view rProperty, const SwFieldType& rTyp )
311{
312 sal_uInt16 nId = lcl_GetPropMapIdForFieldType( rTyp.Which() );
314 if( !pSet )
315 nId = USHRT_MAX;
316 else
317 {
318 const SfxItemPropertyMapEntry* pEntry = pSet->getPropertyMap().getByName(rProperty);
319 nId = pEntry ? pEntry->nWID : USHRT_MAX;
320 }
321 return nId;
322}
323
324static sal_uInt16 lcl_GetPropertyMapOfService( SwServiceType nServiceId )
325{
326 sal_uInt16 nRet;
327 switch ( nServiceId)
328 {
386 nRet = PROPERTY_MAP_FLDTYP_DUMMY_0; break;
397 default:
398 nRet = USHRT_MAX;
399 }
400 assert(nRet != USHRT_MAX && "wrong service id");
401 return nRet;
402}
403
405 : public SvtListener
406{
407public:
408 std::mutex m_Mutex; // just for OInterfaceContainerHelper4
409
412
415
417
418 OUString m_sParam1; // Content / Database / NumberingSeparator
419 OUString m_sParam2; // - /DataTablename
420 OUString m_sParam3; // - /DataFieldName
421 OUString m_sParam5; // - /DataBaseURL
422 double m_fParam1; // Value / -
423 sal_Int8 m_nParam1; // ChapterNumberingLevel
424 bool m_bParam1; // IsExpression
425 sal_Int32 m_nParam2;
426
427 Impl(SwPageDesc* const pPageDesc, SwDoc* pDoc, SwFieldIds nResId)
428 : m_pDoc(pDoc)
429 , m_pType(nullptr)
430 , m_nResTypeId(nResId)
431 , m_fParam1(0.0)
432 , m_nParam1(-1)
433 , m_bParam1(false)
434 , m_nParam2(0)
435 {
436 StartListening(pPageDesc->GetNotifier());
437 }
438
439 Impl(SwFieldType* const pType, SwDoc* pDoc, SwFieldIds nResId)
440 : m_pDoc(pDoc)
441 , m_pType(pType)
442 , m_nResTypeId(nResId)
443 , m_fParam1(0.0)
444 , m_nParam1(-1)
445 , m_bParam1(false)
446 , m_nParam2(0)
447 {
448 StartListening(m_pType->GetNotifier());
449 }
451 {
453 m_pType = pType;
454 StartListening(m_pType->GetNotifier());
455 }
456protected:
457 virtual void Notify(const SfxHint& rHint) override;
458};
459
460OUString SAL_CALL
462{
463 return "SwXFieldMaster";
464}
465
466namespace
467{
468
469OUString getServiceName(const SwFieldIds aId)
470{
471 const char* pEntry;
472 switch (aId)
473 {
474 case SwFieldIds::User:
475 pEntry = "User";
476 break;
478 pEntry = "Database";
479 break;
481 pEntry = "SetExpression";
482 break;
483 case SwFieldIds::Dde:
484 pEntry = "DDE";
485 break;
487 pEntry = "Bibliography";
488 break;
489 default:
490 return OUString();
491 }
492
493 return "com.sun.star.text.fieldmaster." + OUString::createFromAscii(pEntry);
494}
495
496}
497
498sal_Bool SAL_CALL SwXFieldMaster::supportsService(const OUString& rServiceName)
499{
500 return cppu::supportsService(this, rServiceName);
501}
502
503uno::Sequence< OUString > SAL_CALL
505{
506 return { "com.sun.star.text.TextFieldMaster", getServiceName(m_pImpl->m_nResTypeId) };
507}
508
510 : m_pImpl(new Impl(rDoc.getIDocumentStylePoolAccess().GetPageDescFromPool(RES_POOLPAGE_STANDARD), &rDoc, nResId))
511{
512}
513
515 : m_pImpl(new Impl(&rType, pDoc, rType.Which()))
516{
517}
518
520{
521}
522
525 SwFieldIds nResId)
526{
527 // re-use existing SwXFieldMaster
529 if (pType)
530 {
531 xFM = pType->GetXObject().get();
532 }
533 if (!xFM.is())
534 {
535 SwXFieldMaster *const pFM( pType
536 ? new SwXFieldMaster(*pType, pDoc)
537 : new SwXFieldMaster(*pDoc, nResId));
538 xFM.set(pFM);
539 if (pType)
540 {
541 pType->SetXObject(xFM);
542 }
543 // need a permanent Reference to initialize m_wThis
544 pFM->m_pImpl->m_wThis = xFM.get();
545 }
546 return xFM;
547}
548
549uno::Reference<beans::XPropertySetInfo> SAL_CALL
551{
552 SolarMutexGuard aGuard;
553 uno::Reference< beans::XPropertySetInfo > aRef =
556 return aRef;
557}
558
560 const OUString& rPropertyName, const uno::Any& rValue)
561{
562 SolarMutexGuard aGuard;
563 SwFieldType* pType = GetFieldType(true);
564 if(pType)
565 {
566 bool bSetValue = true;
567 if( rPropertyName == UNO_NAME_SUB_TYPE )
568 {
569 const std::vector<OUString>& rExtraArr(
571 const OUString sTypeName = pType->GetName();
572 static sal_uInt16 nIds[] =
573 {
579 0
580 };
581 for(const sal_uInt16 * pIds = nIds; *pIds; ++pIds)
582 {
583 if(sTypeName == rExtraArr[ *pIds ] )
584 {
585 bSetValue = false;
586 break;
587 }
588 }
589 }
590 if ( bSetValue )
591 {
592 // nothing special to be done here for the properties
593 // UNO_NAME_DATA_BASE_NAME and UNO_NAME_DATA_BASE_URL.
594 // We just call PutValue (empty string is allowed).
595 // Thus the last property set will be used as Data Source.
596
597 const sal_uInt16 nMemberValueId = GetFieldTypeMId( rPropertyName, *pType );
598 if ( USHRT_MAX == nMemberValueId )
599 {
600 throw beans::UnknownPropertyException(
601 "Unknown property: " + rPropertyName,
602 static_cast< cppu::OWeakObject * >( this ) );
603 }
604
605 pType->PutValue( rValue, nMemberValueId );
606 if ( pType->Which() == SwFieldIds::User )
607 {
608 // trigger update of User field in order to get depending Input Fields updated.
609 pType->UpdateFields();
610 }
611
612 }
613 }
614 else if (m_pImpl->m_pDoc && rPropertyName == UNO_NAME_NAME)
615 {
616 OUString sTypeName;
617 rValue >>= sTypeName;
618 SwFieldType * pType2 = m_pImpl->m_pDoc->getIDocumentFieldsAccess().GetFieldType(
619 m_pImpl->m_nResTypeId, sTypeName, false);
620
621 if(pType2 ||
622 (SwFieldIds::SetExp == m_pImpl->m_nResTypeId &&
623 ( sTypeName == SwResId(STR_POOLCOLL_LABEL_TABLE) ||
624 sTypeName == SwResId(STR_POOLCOLL_LABEL_DRAWING) ||
625 sTypeName == SwResId(STR_POOLCOLL_LABEL_FRAME) ||
626 sTypeName == SwResId(STR_POOLCOLL_LABEL_ABB) ||
627 sTypeName == SwResId(STR_POOLCOLL_LABEL_FIGURE) )))
628 {
629 throw lang::IllegalArgumentException();
630 }
631
632 switch (m_pImpl->m_nResTypeId)
633 {
634 case SwFieldIds::User :
635 {
636 SwUserFieldType aType(m_pImpl->m_pDoc, sTypeName);
637 pType2 = m_pImpl->m_pDoc->getIDocumentFieldsAccess().InsertFieldType(aType);
638 static_cast<SwUserFieldType*>(pType2)->SetContent(m_pImpl->m_sParam1);
639 static_cast<SwUserFieldType*>(pType2)->SetValue(m_pImpl->m_fParam1);
640 static_cast<SwUserFieldType*>(pType2)->SetType(m_pImpl->m_bParam1
642 }
643 break;
644 case SwFieldIds::Dde :
645 {
646 SwDDEFieldType aType(sTypeName, m_pImpl->m_sParam1,
647 m_pImpl->m_bParam1 ? SfxLinkUpdateMode::ALWAYS : SfxLinkUpdateMode::ONCALL);
648 pType2 = m_pImpl->m_pDoc->getIDocumentFieldsAccess().InsertFieldType(aType);
649 }
650 break;
651 case SwFieldIds::SetExp :
652 {
653 SwSetExpFieldType aType(m_pImpl->m_pDoc, sTypeName);
654 if (!m_pImpl->m_sParam1.isEmpty())
655 aType.SetDelimiter(OUString(m_pImpl->m_sParam1[0]));
656 if (m_pImpl->m_nParam1 > -1 && m_pImpl->m_nParam1 < MAXLEVEL)
657 aType.SetOutlineLvl(m_pImpl->m_nParam1);
658 pType2 = m_pImpl->m_pDoc->getIDocumentFieldsAccess().InsertFieldType(aType);
659 }
660 break;
662 {
663 rValue >>= m_pImpl->m_sParam3;
664 pType2 = GetFieldType();
665 }
666 break;
667 default: break;
668 }
669 if (!pType2)
670 {
671 throw uno::RuntimeException("no field type found!", *this);
672 }
673 m_pImpl->SetFieldType(pType2);
674 }
675 else
676 {
677 switch (m_pImpl->m_nResTypeId)
678 {
679 case SwFieldIds::User:
680 if(rPropertyName == UNO_NAME_CONTENT)
681 rValue >>= m_pImpl->m_sParam1;
682 else if(rPropertyName == UNO_NAME_VALUE)
683 {
684 if(rValue.getValueType() != ::cppu::UnoType<double>::get())
685 throw lang::IllegalArgumentException();
686 rValue >>= m_pImpl->m_fParam1;
687 }
688 else if(rPropertyName == UNO_NAME_IS_EXPRESSION)
689 {
690 if(rValue.getValueType() != cppu::UnoType<bool>::get())
691 throw lang::IllegalArgumentException();
692 rValue >>= m_pImpl->m_bParam1;
693 }
694
695 break;
697 if(rPropertyName == UNO_NAME_DATA_BASE_NAME)
698 rValue >>= m_pImpl->m_sParam1;
699 else if(rPropertyName == UNO_NAME_DATA_TABLE_NAME)
700 rValue >>= m_pImpl->m_sParam2;
701 else if(rPropertyName == UNO_NAME_DATA_COLUMN_NAME)
702 rValue >>= m_pImpl->m_sParam3;
703 else if(rPropertyName == UNO_NAME_DATA_COMMAND_TYPE)
704 rValue >>= m_pImpl->m_nParam2;
705 if(rPropertyName == UNO_NAME_DATA_BASE_URL)
706 rValue >>= m_pImpl->m_sParam5;
707
708 if ( ( !m_pImpl->m_sParam1.isEmpty()
709 || !m_pImpl->m_sParam5.isEmpty())
710 && !m_pImpl->m_sParam2.isEmpty()
711 && !m_pImpl->m_sParam3.isEmpty())
712 {
713 GetFieldType();
714 }
715 break;
717 if(rPropertyName == UNO_NAME_NUMBERING_SEPARATOR)
718 rValue >>= m_pImpl->m_sParam1;
719 else if(rPropertyName == UNO_NAME_CHAPTER_NUMBERING_LEVEL)
720 rValue >>= m_pImpl->m_nParam1;
721 break;
722 case SwFieldIds::Dde:
723 {
724 sal_Int32 nPart = lcl_PropName2TokenPos(rPropertyName);
725 if(nPart < 3 )
726 {
727 if (m_pImpl->m_sParam1.isEmpty())
728 {
729 m_pImpl->m_sParam1
730 = OUStringChar(sfx2::cTokenSeparator)
731 + OUStringChar(sfx2::cTokenSeparator);
732 }
733 OUString sTmp;
734 rValue >>= sTmp;
735 sal_Int32 nIndex(0);
736 sal_Int32 nStart(0);
737 while (nIndex < m_pImpl->m_sParam1.getLength())
738 {
739 if (m_pImpl->m_sParam1[nIndex] == sfx2::cTokenSeparator)
740 {
741 if (0 == nPart)
742 break;
743 nStart = nIndex + 1;
744 --nPart;
745 }
746 ++nIndex;
747 }
748 assert(0 == nPart);
749 m_pImpl->m_sParam1 = m_pImpl->m_sParam1.replaceAt(
750 nStart, nIndex - nStart, sTmp);
751 }
752 else if(3 == nPart)
753 {
754 rValue >>= m_pImpl->m_bParam1;
755 }
756 }
757 break;
758 default:
759 throw beans::UnknownPropertyException( "Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
760 }
761 }
762}
763
764SwFieldType* SwXFieldMaster::GetFieldType(bool const bDontCreate) const
765{
766 if (!bDontCreate && SwFieldIds::Database == m_pImpl->m_nResTypeId
767 && !m_pImpl->m_pType && m_pImpl->m_pDoc)
768 {
770
771 // set DataSource
773 if (!m_pImpl->m_sParam1.isEmpty())
774 aAcc[svx::DataAccessDescriptorProperty::DataSource] <<= m_pImpl->m_sParam1; // DataBaseName
775 else if (!m_pImpl->m_sParam5.isEmpty())
776 aAcc[svx::DataAccessDescriptorProperty::DatabaseLocation] <<= m_pImpl->m_sParam5; // DataBaseURL
777 aData.sDataSource = aAcc.getDataSource();
778
779 aData.sCommand = m_pImpl->m_sParam2;
780 aData.nCommandType = m_pImpl->m_nParam2;
781
782 SwDBFieldType aType(m_pImpl->m_pDoc, m_pImpl->m_sParam3, std::move(aData));
783 SwFieldType *const pType = m_pImpl->m_pDoc->getIDocumentFieldsAccess().InsertFieldType(aType);
784 m_pImpl->SetFieldType(pType);
785 }
786 return m_pImpl->m_pType;
787}
788
789uno::Any SAL_CALL
790SwXFieldMaster::getPropertyValue(const OUString& rPropertyName)
791{
792 SolarMutexGuard aGuard;
793 uno::Any aRet;
794 SwFieldType* pType = GetFieldType(true);
795 if( rPropertyName == UNO_NAME_INSTANCE_NAME )
796 {
797 OUString sName;
798 if(pType)
800 aRet <<= sName;
801 }
802 else if(pType)
803 {
804 if(rPropertyName == UNO_NAME_NAME)
805 {
806 aRet <<= SwXFieldMaster::GetProgrammaticName(*pType, *m_pImpl->m_pDoc);
807 }
808 else if(rPropertyName == UNO_NAME_DEPENDENT_TEXT_FIELDS)
809 {
810 //fill all text fields into a sequence
811 std::vector<SwFormatField*> vpFields;
812 pType->GatherFields(vpFields);
813 uno::Sequence<uno::Reference <text::XDependentTextField> > aSeq(vpFields.size());
814 std::transform(vpFields.begin(), vpFields.end(), aSeq.getArray(),
815 [this](SwFormatField* pF) { return uno::Reference<text::XDependentTextField>(SwXTextField::CreateXTextField(m_pImpl->m_pDoc, pF)); });
816 aRet <<= aSeq;
817 }
818 else
819 {
820 //TODO: add properties for the other field types
821 const sal_uInt16 nMId = GetFieldTypeMId( rPropertyName, *pType );
822 if (USHRT_MAX == nMId)
823 {
824 throw beans::UnknownPropertyException(
825 "Unknown property: " + rPropertyName,
826 static_cast<cppu::OWeakObject *>(this));
827 }
828 pType->QueryValue( aRet, nMId );
829
830 if (rPropertyName == UNO_NAME_DATA_BASE_NAME ||
831 rPropertyName == UNO_NAME_DATA_BASE_URL)
832 {
833 OUString aDataSource;
834 aRet >>= aDataSource;
835 aRet <<= OUString();
836
837 OUString *pStr = nullptr; // only one of this properties will return
838 // a non-empty string.
839 INetURLObject aObj;
840 aObj.SetURL( aDataSource );
841 bool bIsURL = aObj.GetProtocol() != INetProtocol::NotValid;
842 if (bIsURL && rPropertyName == UNO_NAME_DATA_BASE_URL)
843 pStr = &aDataSource; // DataBaseURL
844 else if (!bIsURL && rPropertyName == UNO_NAME_DATA_BASE_NAME)
845 pStr = &aDataSource; // DataBaseName
846
847 if (pStr)
848 aRet <<= *pStr;
849 }
850 }
851 }
852 else
853 {
854 if(rPropertyName == UNO_NAME_DATA_COMMAND_TYPE)
855 aRet <<= m_pImpl->m_nParam2;
856 else if(rPropertyName == UNO_NAME_DEPENDENT_TEXT_FIELDS )
857 {
858 uno::Sequence<uno::Reference <text::XDependentTextField> > aRetSeq(0);
859 aRet <<= aRetSeq;
860 }
861 else
862 {
863 switch (m_pImpl->m_nResTypeId)
864 {
865 case SwFieldIds::User:
866 if( rPropertyName == UNO_NAME_CONTENT )
867 aRet <<= m_pImpl->m_sParam1;
868 else if(rPropertyName == UNO_NAME_VALUE)
869 aRet <<= m_pImpl->m_fParam1;
870 else if(rPropertyName == UNO_NAME_IS_EXPRESSION)
871 aRet <<= m_pImpl->m_bParam1;
872 break;
874 if(rPropertyName == UNO_NAME_DATA_BASE_NAME ||
875 rPropertyName == UNO_NAME_DATA_BASE_URL)
876 {
877 // only one of these properties returns a non-empty string.
878 INetURLObject aObj;
879 aObj.SetURL(m_pImpl->m_sParam5); // SetSmartURL
880 bool bIsURL = aObj.GetProtocol() != INetProtocol::NotValid;
881 if (bIsURL && rPropertyName == UNO_NAME_DATA_BASE_URL)
882 aRet <<= m_pImpl->m_sParam5; // DataBaseURL
883 else if ( rPropertyName == UNO_NAME_DATA_BASE_NAME)
884 aRet <<= m_pImpl->m_sParam1; // DataBaseName
885 }
886 else if(rPropertyName == UNO_NAME_DATA_TABLE_NAME)
887 aRet <<= m_pImpl->m_sParam2;
888 else if(rPropertyName == UNO_NAME_DATA_COLUMN_NAME)
889 aRet <<= m_pImpl->m_sParam3;
890 break;
892 if(rPropertyName == UNO_NAME_NUMBERING_SEPARATOR)
893 aRet <<= m_pImpl->m_sParam1;
894 else if(rPropertyName == UNO_NAME_CHAPTER_NUMBERING_LEVEL)
895 aRet <<= m_pImpl->m_nParam1;
896 break;
897 case SwFieldIds::Dde:
898 {
899 const sal_Int32 nPart = lcl_PropName2TokenPos(rPropertyName);
900 if(nPart < 3 )
901 aRet <<= m_pImpl->m_sParam1.getToken(nPart, sfx2::cTokenSeparator);
902 else if(3 == nPart)
903 aRet <<= m_pImpl->m_bParam1;
904 }
905 break;
906 default:
907 throw beans::UnknownPropertyException( "Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
908 }
909 }
910 }
911 return aRet;
912}
913
914void SwXFieldMaster::addPropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/)
915{
916 OSL_FAIL("not implemented");
917}
918
919void SwXFieldMaster::removePropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/)
920{
921 OSL_FAIL("not implemented");
922}
923
924void SwXFieldMaster::addVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/)
925{
926 OSL_FAIL("not implemented");
927}
928
929void SwXFieldMaster::removeVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/)
930{
931 OSL_FAIL("not implemented");
932}
933
935{
936 SolarMutexGuard aGuard;
937 SwFieldType *const pFieldType = GetFieldType(true);
938 if (!pFieldType)
939 throw uno::RuntimeException();
940 size_t nTypeIdx = SIZE_MAX;
941 const SwFieldTypes* pTypes = m_pImpl->m_pDoc->getIDocumentFieldsAccess().GetFieldTypes();
942 for( size_t i = 0; i < pTypes->size(); i++ )
943 {
944 if((*pTypes)[i].get()== pFieldType)
945 nTypeIdx = i;
946 }
947
948 // first delete all fields
949 std::vector<SwFormatField*> vpFields;
950 pFieldType->GatherFields(vpFields);
951 for(auto pField : vpFields)
952 SwTextField::DeleteTextField(*pField->GetTextField());
953 // then delete FieldType
954 m_pImpl->m_pDoc->getIDocumentFieldsAccess().RemoveFieldType(nTypeIdx);
955}
956
958 const uno::Reference<lang::XEventListener> & xListener)
959{
960 std::unique_lock aGuard(m_pImpl->m_Mutex);
961 m_pImpl->m_EventListeners.addInterface(aGuard, xListener);
962}
963
965 const uno::Reference<lang::XEventListener> & xListener)
966{
967 std::unique_lock aGuard(m_pImpl->m_Mutex);
968 m_pImpl->m_EventListeners.removeInterface(aGuard, xListener);
969}
970
972{
973 if(rHint.GetId() == SfxHintId::Dying)
974 {
975 m_pDoc = nullptr;
976 m_pType = nullptr;
977 uno::Reference<uno::XInterface> const xThis(m_wThis);
978 if (!xThis.is())
979 { // fdo#72695: if UNO object is already dead, don't revive it with event
980 return;
981 }
982 lang::EventObject const ev(xThis);
983 std::unique_lock aGuard(m_Mutex);
985 }
986}
987
989{
990 const OUString sName(rType.GetName());
991 if(SwFieldIds::SetExp == rType.Which())
992 {
993 const SwFieldTypes* pTypes = rDoc.getIDocumentFieldsAccess().GetFieldTypes();
994 for( size_t i = 0; i <= o3tl::make_unsigned(INIT_FLDTYPES); i++ )
995 {
996 if((*pTypes)[i].get() == &rType)
997 {
999 }
1000 }
1001 }
1002 return sName;
1003}
1004
1006 const SwSetExpField& rField,
1007 const OUString& rFormula,
1008 bool bQuery)
1009{
1010 const OUString sTypeName(rField.GetTyp()->GetName());
1011 const OUString sProgName(
1013 if(sProgName != sTypeName)
1014 {
1015 const OUString sSource = bQuery ? sTypeName : sProgName;
1016 const OUString sDest = bQuery ? sProgName : sTypeName;
1017 if(rFormula.startsWith(sSource))
1018 {
1019 return sDest + rFormula.subView(sSource.getLength());
1020 }
1021 }
1022 return rFormula;
1023}
1024
1025namespace {
1026
1027struct SwFieldProperties_Impl
1028{
1029 OUString sPar1;
1030 OUString sPar2;
1031 OUString sPar3;
1032 OUString sPar4;
1033 OUString sPar5;
1034 OUString sPar6;
1035 Date aDate;
1036 double fDouble;
1037 uno::Sequence<beans::PropertyValue> aPropSeq;
1038 uno::Sequence<OUString> aStrings;
1039 std::unique_ptr<util::DateTime> pDateTime;
1040
1041 sal_Int32 nSubType;
1042 sal_Int32 nFormat;
1043 sal_uInt16 nUSHORT1;
1044 sal_uInt16 nUSHORT2;
1045 sal_Int16 nSHORT1;
1046 sal_Int8 nByte1;
1047 bool bFormatIsDefault;
1048 bool bBool1;
1049 bool bBool2;
1050 bool bBool3;
1051 bool bBool4;
1052
1053 SwFieldProperties_Impl():
1054 aDate( Date::EMPTY ),
1055 fDouble(0.),
1056 nSubType(0),
1057 nFormat(0),
1058 nUSHORT1(0),
1059 nUSHORT2(0),
1060 nSHORT1(0),
1061 nByte1(0),
1062 bFormatIsDefault(true),
1063 bBool1(false),
1064 bBool2(false),
1065 bBool3(false),
1066 bBool4(true) //Automatic language
1067 {}
1068};
1069
1070}
1071
1073 : public SvtListener
1074{
1075public:
1076 std::mutex m_Mutex; // just for OInterfaceContainerHelper4
1079
1082
1088 OUString m_sTypeName;
1089 std::unique_ptr<SwFieldProperties_Impl> m_pProps;
1090
1091 Impl(SwDoc *const pDoc, SwFormatField *const pFormat, SwServiceType nServiceId)
1092 : m_pFieldType(nullptr)
1093 , m_pFormatField(pFormat)
1094 , m_pDoc(pDoc)
1095 , m_bIsDescriptor(pFormat == nullptr)
1096 , m_bCallUpdate(false)
1097 , m_nServiceId(pFormat
1098 ? lcl_GetServiceForField(*pFormat->GetField())
1099 : nServiceId)
1100 , m_pProps(pFormat ? nullptr : new SwFieldProperties_Impl)
1101 {
1102 if(m_pFormatField)
1103 StartListening(m_pFormatField->GetNotifier());
1104 }
1105
1106 virtual ~Impl() override
1107 {
1108 if (m_xTextObject.is())
1109 {
1110 m_xTextObject->DisposeEditSource();
1111 }
1112 }
1113
1114 void SetFormatField(SwFormatField* pFormatField, SwDoc* pDoc)
1115 {
1116 m_pFormatField = pFormatField;
1117 m_pDoc = pDoc;
1118 if(m_pFormatField)
1119 {
1120 EndListeningAll();
1121 StartListening(m_pFormatField->GetNotifier());
1122 }
1123 }
1125 {
1126 return m_pFormatField;
1127 }
1128 bool IsDescriptor() const
1129 {
1130 // ideally should be: !m_pFormatField && m_pDoc
1131 // but: SwXServiceProvider::MakeInstance() passes nullptr SwDoc, see comment there
1132 return m_bIsDescriptor;
1133 }
1134 void Invalidate();
1135
1136 const SwField* GetField() const;
1137
1139 {
1140 if(!m_pDoc && !IsDescriptor())
1141 throw uno::RuntimeException();
1142 else if (IsDescriptor())
1143 return m_pFieldType;
1144
1145 return m_pFormatField->GetField()->GetTyp();
1146 }
1148 {
1149 EndListeningAll();
1150 m_pFieldType = &rType;
1151 StartListening(m_pFieldType->GetNotifier());
1152 }
1154 {
1156 m_pFieldType = nullptr;
1157 }
1158 virtual void Notify(const SfxHint&) override;
1159};
1160
1162 SwServiceType nServiceId,
1163 SwDoc* pDoc)
1164 : m_pImpl(new Impl(pDoc, nullptr, nServiceId))
1165{
1166 //Set visible as default!
1167 if ( SwServiceType::FieldTypeSetExp == nServiceId
1169 || SwServiceType::FieldTypeDatabase == nServiceId
1170 || SwServiceType::FieldTypeDatabaseName == nServiceId )
1171 {
1172 m_pImpl->m_pProps->bBool2 = true;
1173 }
1174 else if(SwServiceType::FieldTypeTableFormula == nServiceId)
1175 {
1176 m_pImpl->m_pProps->bBool1 = true;
1177 }
1178 if(SwServiceType::FieldTypeSetExp == nServiceId)
1179 {
1180 m_pImpl->m_pProps->nUSHORT2 = USHRT_MAX;
1181 }
1182}
1183
1185 : m_pImpl(new Impl(&rDoc, &rFormat, SwServiceType::Invalid))
1186{
1187}
1188
1190{
1191}
1192
1195 SwServiceType nServiceId)
1196{
1197 assert(!pFormat || pDoc);
1198 assert(pFormat || nServiceId != SwServiceType::Invalid);
1199 // re-use existing SwXTextField
1201 if (pFormat)
1202 {
1203 xField = pFormat->GetXTextField();
1204 }
1205 if (!xField.is())
1206 {
1207 SwXTextField *const pField( pFormat
1208 ? new SwXTextField(const_cast<SwFormatField&>(*pFormat), *pDoc)
1209 : new SwXTextField(nServiceId, pDoc));
1210 xField.set(pField);
1211 if (pFormat)
1212 {
1213 const_cast<SwFormatField *>(pFormat)->SetXTextField(xField);
1214 }
1215 // need a permanent Reference to initialize m_wThis
1216 pField->m_pImpl->m_wThis = xField.get();
1217 }
1218 return xField;
1219}
1220
1222{
1223 return m_pImpl->m_nServiceId;
1224}
1225
1239{
1240 assert(rField.GetFormatField()->Which() == (rField.GetInputFlag() ? RES_TXTATR_INPUTFIELD : RES_TXTATR_FIELD));
1241 rtl::Reference<SwXTextField> const pXField(
1242 rField.GetFormatField()->GetXTextField());
1243 if (pXField)
1244 pXField->m_pImpl->SetFormatField(nullptr, nullptr);
1245 SwTextField *const pOldAttr(rField.GetFormatField()->GetTextField());
1246 SwSetExpField tempField(rField);
1247 tempField.SetInputFlag(!rField.GetInputFlag());
1248 SwFormatField tempFormat(tempField);
1249 assert(tempFormat.GetField() != &rField);
1250 assert(tempFormat.GetField() != &tempField); // this copies it again?
1251 assert(tempFormat.Which() == (static_cast<SwSetExpField const*>(tempFormat.GetField())->GetInputFlag() ? RES_TXTATR_INPUTFIELD : RES_TXTATR_FIELD));
1252 SwTextNode & rNode(pOldAttr->GetTextNode());
1253 std::shared_ptr<SwPaM> pPamForTextField;
1255 SwTextField::GetPamForTextField(*pOldAttr, pPamForTextField);
1256 assert(pPamForTextField);
1257 sal_Int32 const nStart(pPamForTextField->Start()->GetContentIndex());
1258 rIDCO.DeleteAndJoin(*pPamForTextField);
1259 // ATTENTION: rField is dead now! hope nobody accesses it...
1260 bool bSuccess = rIDCO.InsertPoolItem(*pPamForTextField, tempFormat);
1261 assert(bSuccess);
1262 (void) bSuccess;
1263 SwTextField const* pNewAttr(rNode.GetFieldTextAttrAt(nStart, ::sw::GetTextAttrMode::Default));
1264 assert(pNewAttr);
1265 SwFormatField const& rNewFormat(pNewAttr->GetFormatField());
1266 assert(rNewFormat.Which() == (static_cast<SwSetExpField const*>(rNewFormat.GetField())->GetInputFlag() ? RES_TXTATR_INPUTFIELD : RES_TXTATR_FIELD));
1267 assert(static_cast<SwSetExpField const*>(rNewFormat.GetField())->GetInputFlag() == (dynamic_cast<SwTextInputField const*>(pNewAttr) != nullptr));
1268 if (pXField)
1269 {
1270 pXField->m_pImpl->SetFormatField(const_cast<SwFormatField*>(&rNewFormat), &rNode.GetDoc());
1271 const_cast<SwFormatField&>(rNewFormat).SetXTextField(pXField);
1272 }
1273}
1274
1276 const uno::Reference< beans::XPropertySet > & xFieldMaster)
1277{
1278 SolarMutexGuard aGuard;
1279
1280 if (!m_pImpl->IsDescriptor())
1281 throw uno::RuntimeException();
1282 SwXFieldMaster* pMaster = dynamic_cast<SwXFieldMaster*>(xFieldMaster.get());
1283
1284 SwFieldType* pFieldType = pMaster ? pMaster->GetFieldType() : nullptr;
1285 if (!pFieldType ||
1286 pFieldType->Which() != lcl_ServiceIdToResId(m_pImpl->m_nServiceId))
1287 {
1288 throw lang::IllegalArgumentException();
1289 }
1290 m_pImpl->m_sTypeName = pFieldType->GetName();
1291 m_pImpl->SetFieldType(*pFieldType);
1292}
1293
1294uno::Reference< beans::XPropertySet > SAL_CALL
1296{
1297 SolarMutexGuard aGuard;
1298
1299 SwFieldType* pType = m_pImpl->GetFieldType();
1300 if (!pType && !m_pImpl->m_pDoc) // tdf#152619
1301 return nullptr;
1302 uno::Reference<beans::XPropertySet> const xRet(
1304 return xRet;
1305}
1306
1307OUString SAL_CALL SwXTextField::getPresentation(sal_Bool bShowCommand)
1308{
1309 SolarMutexGuard aGuard;
1310
1311 SwField const*const pField = m_pImpl->GetField();
1312 if (!pField)
1313 {
1314 throw uno::RuntimeException();
1315 }
1316 return bShowCommand ? pField->GetFieldName() : pField->ExpandField(true, nullptr);
1317}
1318
1320 const uno::Reference< text::XTextRange > & xTextRange)
1321{
1322 SolarMutexGuard aGuard;
1323 if (m_pImpl->IsDescriptor())
1324 {
1325 SwXTextRange* pRange = dynamic_cast<SwXTextRange*>(xTextRange.get());
1326 OTextCursorHelper* pCursor = dynamic_cast<OTextCursorHelper*>(xTextRange.get());
1327
1328 SwDoc* pDoc = pRange ? &pRange->GetDoc() : pCursor ? pCursor->GetDoc() : nullptr;
1329 // if a FieldMaster was attached, then the document is already fixed!
1330 // NOTE: sw.SwXAutoTextEntry unoapi test depends on m_pDoc = 0 being valid
1331 if (!pDoc || (m_pImpl->m_pDoc && m_pImpl->m_pDoc != pDoc))
1332 throw lang::IllegalArgumentException();
1333
1334 SwUnoInternalPaM aPam(*pDoc);
1335 // this now needs to return TRUE
1336 ::sw::XTextRangeToSwPaM(aPam, xTextRange);
1337 std::unique_ptr<SwField> xField;
1338 switch (m_pImpl->m_nServiceId)
1339 {
1341 {
1343
1344 DateTime aDateTime( DateTime::EMPTY );
1345 if (m_pImpl->m_pProps->pDateTime)
1346 {
1347 aDateTime = *(m_pImpl->m_pProps->pDateTime);
1348 }
1349
1350 sal_uInt32 nImportedId = 0;
1351 if (!m_pImpl->m_pProps->sPar6.isEmpty())
1352 nImportedId = m_pImpl->m_pProps->sPar6.toInt32(16);
1353 sal_uInt32 nParentId = 0;
1354 if (!m_pImpl->m_pProps->sPar5.isEmpty())
1355 nParentId = m_pImpl->m_pProps->sPar5.toInt32(16);
1356
1357 SwPostItField* pPostItField = new SwPostItField(
1358 static_cast<SwPostItFieldType*>(pFieldType),
1359 m_pImpl->m_pProps->sPar1, // author
1360 m_pImpl->m_pProps->sPar2, // content
1361 m_pImpl->m_pProps->sPar3, // author's initials
1362 m_pImpl->m_pProps->sPar4, // name
1363 aDateTime,
1364 m_pImpl->m_pProps->bBool1, // resolvedflag
1365 0, // id
1366 nParentId, // parent id
1367 nImportedId // imported para id
1368 );
1369 if ( m_pImpl->m_xTextObject.is() )
1370 {
1371 pPostItField->SetTextObject( m_pImpl->m_xTextObject->CreateText() );
1372 pPostItField->SetPar2(m_pImpl->m_xTextObject->GetText());
1373 }
1374 xField.reset(pPostItField);
1375 }
1376 break;
1378 {
1380 xField.reset(new SwScriptField(static_cast<SwScriptFieldType*>(pFieldType),
1381 m_pImpl->m_pProps->sPar1, m_pImpl->m_pProps->sPar2,
1382 m_pImpl->m_pProps->bBool1));
1383 }
1384 break;
1386 {
1387 sal_uInt16 nSub = 0;
1388 if (m_pImpl->m_pProps->bBool1)
1389 nSub |= FIXEDFLD;
1390 if (m_pImpl->m_pProps->bBool2)
1391 nSub |= DATEFLD;
1392 else
1393 nSub |= TIMEFLD;
1395 SwDateTimeField *const pDTField = new SwDateTimeField(
1396 static_cast<SwDateTimeFieldType*>(pFieldType),
1397 nSub, m_pImpl->m_pProps->nFormat);
1398 xField.reset(pDTField);
1399 if (m_pImpl->m_pProps->fDouble > 0.)
1400 {
1401 pDTField->SetValue(m_pImpl->m_pProps->fDouble);
1402 }
1403 if (m_pImpl->m_pProps->pDateTime)
1404 {
1405 uno::Any aVal; aVal <<= *m_pImpl->m_pProps->pDateTime;
1406 xField->PutValue( aVal, FIELD_PROP_DATE_TIME );
1407 }
1408 pDTField->SetOffset(m_pImpl->m_pProps->nSubType);
1409 }
1410 break;
1412 {
1414 sal_Int32 nFormat = m_pImpl->m_pProps->nFormat;
1415 if (m_pImpl->m_pProps->bBool2)
1416 nFormat |= FF_FIXED;
1417 SwFileNameField *const pFNField = new SwFileNameField(
1418 static_cast<SwFileNameFieldType*>(pFieldType), nFormat);
1419 xField.reset(pFNField);
1420 if (!m_pImpl->m_pProps->sPar3.isEmpty())
1421 pFNField->SetExpansion(m_pImpl->m_pProps->sPar3);
1422 uno::Any aFormat;
1423 aFormat <<= m_pImpl->m_pProps->nFormat;
1424 xField->PutValue( aFormat, FIELD_PROP_FORMAT );
1425 }
1426 break;
1428 {
1430 xField.reset(new SwTemplNameField(static_cast<SwTemplNameFieldType*>(pFieldType),
1431 m_pImpl->m_pProps->nFormat));
1432 uno::Any aFormat;
1433 aFormat <<= m_pImpl->m_pProps->nFormat;
1434 xField->PutValue(aFormat, FIELD_PROP_FORMAT);
1435 }
1436 break;
1438 {
1440 SwChapterField *const pChapterField = new SwChapterField(
1441 static_cast<SwChapterFieldType*>(pFieldType),
1442 m_pImpl->m_pProps->nUSHORT1);
1443 xField.reset(pChapterField);
1444 pChapterField->SetLevel(m_pImpl->m_pProps->nByte1);
1445 uno::Any aVal;
1446 aVal <<= static_cast<sal_Int16>(m_pImpl->m_pProps->nUSHORT1);
1447 xField->PutValue(aVal, FIELD_PROP_USHORT1 );
1448 }
1449 break;
1451 {
1452 tools::Long nFormat = m_pImpl->m_pProps->bBool1 ? AF_NAME : AF_SHORTCUT;
1453 if (m_pImpl->m_pProps->bBool2)
1454 nFormat |= AF_FIXED;
1455
1457 SwAuthorField *const pAuthorField = new SwAuthorField(
1458 static_cast<SwAuthorFieldType*>(pFieldType), nFormat);
1459 xField.reset(pAuthorField);
1460 pAuthorField->SetExpansion(m_pImpl->m_pProps->sPar1);
1461 }
1462 break;
1465 {
1467 SwHiddenTextField *const pHTField = new SwHiddenTextField(
1468 static_cast<SwHiddenTextFieldType*>(pFieldType),
1469 m_pImpl->m_pProps->sPar1,
1470 m_pImpl->m_pProps->sPar2, m_pImpl->m_pProps->sPar3,
1473 xField.reset(pHTField);
1474 pHTField->SetValue(m_pImpl->m_pProps->bBool1);
1475 uno::Any aVal;
1476 aVal <<= m_pImpl->m_pProps->sPar4;
1477 xField->PutValue(aVal, FIELD_PROP_PAR4 );
1478 }
1479 break;
1481 {
1483 SwHiddenParaField *const pHPField = new SwHiddenParaField(
1484 static_cast<SwHiddenParaFieldType*>(pFieldType),
1485 m_pImpl->m_pProps->sPar1);
1486 xField.reset(pHPField);
1487 pHPField->SetHidden(m_pImpl->m_pProps->bBool1);
1488 }
1489 break;
1491 {
1493 xField.reset(new SwGetRefField(static_cast<SwGetRefFieldType*>(pFieldType),
1494 m_pImpl->m_pProps->sPar1,
1495 m_pImpl->m_pProps->sPar4,
1496 0,
1497 0,
1498 0));
1499 if (!m_pImpl->m_pProps->sPar3.isEmpty())
1500 static_cast<SwGetRefField*>(xField.get())->SetExpand(m_pImpl->m_pProps->sPar3);
1501 uno::Any aVal;
1502 aVal <<= static_cast<sal_Int16>(m_pImpl->m_pProps->nUSHORT1);
1503 xField->PutValue(aVal, FIELD_PROP_USHORT1 );
1504 aVal <<= static_cast<sal_Int16>(m_pImpl->m_pProps->nUSHORT2);
1505 xField->PutValue(aVal, FIELD_PROP_USHORT2 );
1506 aVal <<= m_pImpl->m_pProps->nSHORT1;
1507 xField->PutValue(aVal, FIELD_PROP_SHORT1 );
1508 }
1509 break;
1511 {
1513 xField.reset(new SwJumpEditField(static_cast<SwJumpEditFieldType*>(pFieldType),
1514 m_pImpl->m_pProps->nUSHORT1, m_pImpl->m_pProps->sPar2,
1515 m_pImpl->m_pProps->sPar1));
1516 }
1517 break;
1532 {
1534 sal_uInt16 nSubType = aDocInfoSubTypeFromService[
1535 static_cast<sal_uInt16>(m_pImpl->m_nServiceId) - sal_uInt16(SwServiceType::FieldTypeDocInfoChangeAuthor)];
1540 {
1541 if (m_pImpl->m_pProps->bBool2) //IsDate
1542 {
1543 nSubType &= 0xf0ff;
1544 nSubType |= DI_SUB_DATE;
1545 }
1546 else
1547 {
1548 nSubType &= 0xf0ff;
1549 nSubType |= DI_SUB_TIME;
1550 }
1551 }
1552 if (m_pImpl->m_pProps->bBool1)
1553 nSubType |= DI_SUB_FIXED;
1554 xField.reset(new SwDocInfoField(
1555 static_cast<SwDocInfoFieldType*>(pFieldType), nSubType,
1556 m_pImpl->m_pProps->sPar4, m_pImpl->m_pProps->nFormat));
1557 if (!m_pImpl->m_pProps->sPar3.isEmpty())
1558 static_cast<SwDocInfoField*>(xField.get())->SetExpansion(m_pImpl->m_pProps->sPar3);
1559 }
1560 break;
1562 {
1563 sal_Int32 nFormat = 0;
1564 if (m_pImpl->m_pProps->bBool1)
1565 nFormat = AF_FIXED;
1566
1568 SwExtUserField *const pEUField = new SwExtUserField(
1569 static_cast<SwExtUserFieldType*>(pFieldType),
1570 m_pImpl->m_pProps->nUSHORT1, nFormat);
1571 xField.reset(pEUField);
1572 pEUField->SetExpansion(m_pImpl->m_pProps->sPar1);
1573 }
1574 break;
1576 {
1577 SwFieldType* pFieldType =
1579 if (!pFieldType)
1580 throw uno::RuntimeException();
1581 sal_uInt16 nUserSubType = (m_pImpl->m_pProps->bBool1)
1583 if (m_pImpl->m_pProps->bBool2)
1584 nUserSubType |= nsSwExtendedSubType::SUB_CMD;
1585 if (m_pImpl->m_pProps->bFormatIsDefault &&
1586 nsSwGetSetExpType::GSE_STRING == static_cast<SwUserFieldType*>(pFieldType)->GetType())
1587 {
1588 m_pImpl->m_pProps->nFormat = -1;
1589 }
1590 xField.reset(new SwUserField(static_cast<SwUserFieldType*>(pFieldType),
1591 nUserSubType,
1592 m_pImpl->m_pProps->nFormat));
1593 }
1594 break;
1596 {
1598 xField.reset(new SwRefPageSetField( static_cast<SwRefPageSetFieldType*>(pFieldType),
1599 m_pImpl->m_pProps->nUSHORT1,
1600 m_pImpl->m_pProps->bBool1 ));
1601 }
1602 break;
1604 {
1606 SwRefPageGetField *const pRGField = new SwRefPageGetField(
1607 static_cast<SwRefPageGetFieldType*>(pFieldType),
1608 m_pImpl->m_pProps->nUSHORT1 );
1609 xField.reset(pRGField);
1610 pRGField->SetText(m_pImpl->m_pProps->sPar1, nullptr);
1611 }
1612 break;
1614 {
1616 SwPageNumberField *const pPNField = new SwPageNumberField(
1617 static_cast<SwPageNumberFieldType*>(pFieldType), PG_RANDOM,
1618 m_pImpl->m_pProps->nFormat,
1619 m_pImpl->m_pProps->nUSHORT1);
1620 xField.reset(pPNField);
1621 pPNField->SetUserString(m_pImpl->m_pProps->sPar1);
1622 uno::Any aVal;
1623 aVal <<= m_pImpl->m_pProps->nSubType;
1624 xField->PutValue( aVal, FIELD_PROP_SUBTYPE );
1625 }
1626 break;
1628 {
1629 SwFieldType* pFieldType =
1630 pDoc->getIDocumentFieldsAccess().GetFieldType(SwFieldIds::Dde, m_pImpl->m_sTypeName, true);
1631 if (!pFieldType)
1632 throw uno::RuntimeException();
1633 xField.reset(new SwDDEField( static_cast<SwDDEFieldType*>(pFieldType) ));
1634 }
1635 break;
1637 {
1640 aData.sDataSource = m_pImpl->m_pProps->sPar1;
1641 aData.sCommand = m_pImpl->m_pProps->sPar2;
1642 aData.nCommandType = m_pImpl->m_pProps->nSHORT1;
1643 xField.reset(new SwDBNameField(static_cast<SwDBNameFieldType*>(pFieldType), aData));
1644 sal_uInt16 nSubType = xField->GetSubType();
1645 if (m_pImpl->m_pProps->bBool2)
1647 else
1649 xField->SetSubType(nSubType);
1650 }
1651 break;
1653 {
1655 aData.sDataSource = m_pImpl->m_pProps->sPar1;
1656 aData.sCommand = m_pImpl->m_pProps->sPar2;
1657 aData.nCommandType = m_pImpl->m_pProps->nSHORT1;
1659 xField.reset(new SwDBNextSetField(static_cast<SwDBNextSetFieldType*>(pFieldType),
1660 m_pImpl->m_pProps->sPar3, aData));
1661 }
1662 break;
1664 {
1666 aData.sDataSource = m_pImpl->m_pProps->sPar1;
1667 aData.sCommand = m_pImpl->m_pProps->sPar2;
1668 aData.nCommandType = m_pImpl->m_pProps->nSHORT1;
1669 xField.reset(new SwDBNumSetField( static_cast<SwDBNumSetFieldType*>(
1671 m_pImpl->m_pProps->sPar3,
1672 OUString::number(m_pImpl->m_pProps->nFormat),
1673 aData ));
1674 }
1675 break;
1677 {
1679 aData.sDataSource = m_pImpl->m_pProps->sPar1;
1680 aData.sCommand = m_pImpl->m_pProps->sPar2;
1681 aData.nCommandType = m_pImpl->m_pProps->nSHORT1;
1682 SwDBSetNumberField *const pDBSNField =
1685 m_pImpl->m_pProps->nUSHORT1);
1686 xField.reset(pDBSNField);
1687 pDBSNField->SetSetNumber(m_pImpl->m_pProps->nFormat);
1688 sal_uInt16 nSubType = xField->GetSubType();
1689 if (m_pImpl->m_pProps->bBool2)
1691 else
1693 xField->SetSubType(nSubType);
1694 }
1695 break;
1697 {
1698 SwFieldType* pFieldType =
1700 if (!pFieldType)
1701 throw uno::RuntimeException();
1702 xField.reset(new SwDBField(static_cast<SwDBFieldType*>(pFieldType),
1703 m_pImpl->m_pProps->nFormat));
1704 static_cast<SwDBField*>(xField.get())->InitContent(m_pImpl->m_pProps->sPar1);
1705 sal_uInt16 nSubType = xField->GetSubType();
1706 if (m_pImpl->m_pProps->bBool2)
1708 else
1710 xField->SetSubType(nSubType);
1711 }
1712 break;
1714 {
1715 SwFieldType* pFieldType =
1717 if (!pFieldType)
1718 throw uno::RuntimeException();
1719 // detect the field type's sub type and set an appropriate number format
1720 if (m_pImpl->m_pProps->bFormatIsDefault &&
1721 nsSwGetSetExpType::GSE_STRING == static_cast<SwSetExpFieldType*>(pFieldType)->GetType())
1722 {
1723 m_pImpl->m_pProps->nFormat = -1;
1724 }
1725 SwSetExpField *const pSEField = new SwSetExpField(
1726 static_cast<SwSetExpFieldType*>(pFieldType),
1727 m_pImpl->m_pProps->sPar2,
1728 m_pImpl->m_pProps->nUSHORT2 != USHRT_MAX ? //#i79471# the field can have a number format or a number_ing_ format
1729 m_pImpl->m_pProps->nUSHORT2 : m_pImpl->m_pProps->nFormat);
1730 xField.reset(pSEField);
1731
1732 sal_uInt16 nSubType = xField->GetSubType();
1733 if (m_pImpl->m_pProps->bBool2)
1735 else
1737 if (m_pImpl->m_pProps->bBool3)
1738 nSubType |= nsSwExtendedSubType::SUB_CMD;
1739 else
1741 xField->SetSubType(nSubType);
1742 pSEField->SetSeqNumber(m_pImpl->m_pProps->nUSHORT1);
1743 pSEField->SetInputFlag(m_pImpl->m_pProps->bBool1);
1744 pSEField->SetPromptText(m_pImpl->m_pProps->sPar3);
1745 if (!m_pImpl->m_pProps->sPar4.isEmpty())
1746 pSEField->ChgExpStr(m_pImpl->m_pProps->sPar4, nullptr);
1747
1748 }
1749 break;
1751 {
1752 sal_uInt16 nSubType;
1753 switch (m_pImpl->m_pProps->nSubType)
1754 {
1755 case text::SetVariableType::STRING: nSubType = nsSwGetSetExpType::GSE_STRING; break;
1756 case text::SetVariableType::VAR: nSubType = nsSwGetSetExpType::GSE_EXPR; break;
1757 //case text::SetVariableType::SEQUENCE: nSubType = nsSwGetSetExpType::GSE_SEQ; break;
1758 case text::SetVariableType::FORMULA: nSubType = nsSwGetSetExpType::GSE_FORMULA; break;
1759 default:
1760 OSL_FAIL("wrong value");
1761 nSubType = nsSwGetSetExpType::GSE_EXPR;
1762 }
1763 //make sure the SubType matches the field type
1764 SwFieldType* pSetExpField = pDoc->getIDocumentFieldsAccess().GetFieldType(
1765 SwFieldIds::SetExp, m_pImpl->m_pProps->sPar1, false);
1766 bool bSetGetExpFieldUninitialized = false;
1767 if (pSetExpField)
1768 {
1769 if (nSubType != nsSwGetSetExpType::GSE_STRING &&
1770 static_cast< SwSetExpFieldType* >(pSetExpField)->GetType() == nsSwGetSetExpType::GSE_STRING)
1772 }
1773 else
1774 bSetGetExpFieldUninitialized = true; // #i82544#
1775
1776 if (m_pImpl->m_pProps->bBool2)
1777 nSubType |= nsSwExtendedSubType::SUB_CMD;
1778 else
1780 SwGetExpField *const pGEField = new SwGetExpField(
1781 static_cast<SwGetExpFieldType*>(
1783 m_pImpl->m_pProps->sPar1, nSubType,
1784 m_pImpl->m_pProps->nFormat);
1785 xField.reset(pGEField);
1786 //TODO: evaluate SubType!
1787 if (!m_pImpl->m_pProps->sPar4.isEmpty())
1788 pGEField->ChgExpStr(m_pImpl->m_pProps->sPar4, nullptr);
1789 // #i82544#
1790 if (bSetGetExpFieldUninitialized)
1791 pGEField->SetLateInitialization();
1792 }
1793 break;
1796 {
1797 SwFieldType* pFieldType =
1799 if (!pFieldType)
1800 throw uno::RuntimeException();
1801 sal_uInt16 nInpSubType =
1802 sal::static_int_cast<sal_uInt16>(
1804 ? INP_USR : INP_TXT);
1805 SwInputField * pTextField =
1806 new SwInputField(static_cast<SwInputFieldType*>(pFieldType),
1807 m_pImpl->m_pProps->sPar1,
1808 m_pImpl->m_pProps->sPar2,
1809 nInpSubType);
1810 pTextField->SetHelp(m_pImpl->m_pProps->sPar3);
1811 pTextField->SetToolTip(m_pImpl->m_pProps->sPar4);
1812
1813 xField.reset(pTextField);
1814 }
1815 break;
1817 {
1819 OUString aName;
1820
1821 // support for Scripting Framework macros
1822 if (!m_pImpl->m_pProps->sPar4.isEmpty())
1823 {
1824 aName = m_pImpl->m_pProps->sPar4;
1825 }
1826 else
1827 {
1829 m_pImpl->m_pProps->sPar1, m_pImpl->m_pProps->sPar3);
1830 }
1831 xField.reset(new SwMacroField(static_cast<SwMacroFieldType*>(pFieldType), aName,
1832 m_pImpl->m_pProps->sPar2));
1833 }
1834 break;
1842 {
1843 sal_uInt16 nSubType = DS_PAGE;
1844 switch (m_pImpl->m_nServiceId)
1845 {
1846 case SwServiceType::FieldTypeParagraphCount : nSubType = DS_PARA; break;
1847 case SwServiceType::FieldTypeWordCount : nSubType = DS_WORD; break;
1848 case SwServiceType::FieldTypeCharacterCount : nSubType = DS_CHAR; break;
1849 case SwServiceType::FieldTypeTableCount : nSubType = DS_TBL; break;
1850 case SwServiceType::FieldTypeGraphicObjectCount : nSubType = DS_GRF; break;
1851 case SwServiceType::FieldTypeEmbeddedObjectCount : nSubType = DS_OLE; break;
1852 default: break;
1853 }
1855 xField.reset(new SwDocStatField(
1856 static_cast<SwDocStatFieldType*>(pFieldType),
1857 nSubType, m_pImpl->m_pProps->nUSHORT2));
1858 }
1859 break;
1861 {
1862 SwAuthorityFieldType const type(pDoc);
1863 xField.reset(new SwAuthorityField(static_cast<SwAuthorityFieldType*>(
1865 u""));
1866 if (m_pImpl->m_pProps->aPropSeq.hasElements())
1867 {
1868 uno::Any aVal;
1869 aVal <<= m_pImpl->m_pProps->aPropSeq;
1870 xField->PutValue( aVal, FIELD_PROP_PROP_SEQ );
1871 }
1872 }
1873 break;
1875 // create field
1876 xField.reset(new SwCombinedCharField( static_cast<SwCombinedCharFieldType*>(
1878 m_pImpl->m_pProps->sPar1));
1879 break;
1881 {
1882 SwDropDownField *const pDDField = new SwDropDownField(
1883 static_cast<SwDropDownFieldType *>(
1885 xField.reset(pDDField);
1886
1887 pDDField->SetItems(m_pImpl->m_pProps->aStrings);
1888 pDDField->SetSelectedItem(m_pImpl->m_pProps->sPar1);
1889 pDDField->SetName(m_pImpl->m_pProps->sPar2);
1890 pDDField->SetHelp(m_pImpl->m_pProps->sPar3);
1891 pDDField->SetToolTip(m_pImpl->m_pProps->sPar4);
1892 }
1893 break;
1894
1896 {
1897 // create field
1899 if (m_pImpl->m_pProps->bBool1)
1900 {
1902 if (m_pImpl->m_pProps->bFormatIsDefault)
1903 m_pImpl->m_pProps->nFormat = -1;
1904 }
1905 xField.reset(new SwTableField( static_cast<SwTableFieldType*>(
1907 m_pImpl->m_pProps->sPar2,
1908 nType,
1909 m_pImpl->m_pProps->nFormat));
1910 static_cast<SwTableField*>(xField.get())->ChgExpStr(m_pImpl->m_pProps->sPar1);
1911 }
1912 break;
1913 default: OSL_FAIL("What kind of type is that?");
1914 }
1915
1916 if (!xField)
1917 throw uno::RuntimeException("no SwField created?");
1918
1919 xField->SetAutomaticLanguage(!m_pImpl->m_pProps->bBool4);
1920 SwFormatField aFormat(*xField);
1921
1922 UnoActionContext aCont(pDoc);
1923 if (aPam.HasMark() &&
1925 {
1927 }
1928
1929 SwXTextCursor const*const pTextCursor(dynamic_cast<SwXTextCursor*>(pCursor));
1930 const bool bForceExpandHints(
1931 pTextCursor
1932 && pTextCursor->IsAtEndOfMeta() );
1933 const SetAttrMode nInsertFlags =
1934 bForceExpandHints
1937
1938 if (*aPam.GetPoint() != *aPam.GetMark() &&
1940 {
1941 // Make sure we always insert the field at the end
1942 SwPaM aEnd(*aPam.End(), *aPam.End());
1943 pDoc->getIDocumentContentOperations().InsertPoolItem(aEnd, aFormat, nInsertFlags);
1944 }
1945 else
1946 pDoc->getIDocumentContentOperations().InsertPoolItem(aPam, aFormat, nInsertFlags);
1947
1949
1950 // What about updating the fields? (see fldmgr.cxx)
1951 if (!pTextAttr)
1952 throw uno::RuntimeException("no SwTextAttr inserted?"); // could theoretically happen, if paragraph is full
1953
1954 m_pImpl->ClearFieldType();
1955 const SwFormatField& rField = pTextAttr->GetFormatField();
1956 m_pImpl->SetFormatField(const_cast<SwFormatField*>(&rField), pDoc);
1957
1958 if ( pTextAttr->Which() == RES_TXTATR_ANNOTATION
1959 && *aPam.GetPoint() != *aPam.GetMark() )
1960 {
1961 // create annotation mark
1962 const SwPostItField* pPostItField = dynamic_cast< const SwPostItField* >(pTextAttr->GetFormatField().GetField());
1963 OSL_ENSURE( pPostItField != nullptr, "<SwXTextField::attachToRange(..)> - annotation field missing!" );
1964 if ( pPostItField != nullptr )
1965 {
1966 IDocumentMarkAccess* pMarksAccess = pDoc->getIDocumentMarkAccess();
1967 pMarksAccess->makeAnnotationMark( aPam, pPostItField->GetName() );
1968 }
1969 }
1970
1971 xField.reset();
1972
1973 assert(m_pImpl->GetFormatField());
1974 m_pImpl->m_pDoc = pDoc;
1975 m_pImpl->GetFormatField()->SetXTextField(this);
1976 m_pImpl->m_wThis = this;
1977 m_pImpl->m_bIsDescriptor = false;
1978 m_pImpl->m_pProps.reset();
1979 if (m_pImpl->m_bCallUpdate)
1980 update();
1981 }
1982 else if ( !m_pImpl->IsDescriptor()
1983 && m_pImpl->m_pDoc != nullptr
1984 && m_pImpl->m_nServiceId == SwServiceType::FieldTypeAnnotation )
1985 {
1986 SwDoc* pDoc = m_pImpl->m_pDoc;
1987 SwUnoInternalPaM aIntPam( *pDoc );
1988 if ( !::sw::XTextRangeToSwPaM( aIntPam, xTextRange ) )
1989 throw lang::IllegalArgumentException();
1990
1991 // Nothing to do, if the text range has a separate start and end, but they have the same
1992 // value.
1993 if (!aIntPam.HasMark() || *aIntPam.Start() != *aIntPam.End())
1994 {
1995 UnoActionContext aCont( pDoc );
1996 // insert copy of annotation at new text range
1997 std::unique_ptr<SwPostItField> pPostItField(static_cast< SwPostItField* >(m_pImpl->GetFormatField()->GetField()->CopyField().release()));
1998 SwFormatField aFormatField( *pPostItField );
1999 pPostItField.reset();
2000 SwPaM aEnd( *aIntPam.End(), *aIntPam.End() );
2001 pDoc->getIDocumentContentOperations().InsertPoolItem( aEnd, aFormatField );
2002 // delete former annotation
2003 {
2004 const SwTextField* pTextField = m_pImpl->GetFormatField()->GetTextField();
2005 SwTextNode& rTextNode = *pTextField->GetpTextNode();
2006 SwPaM aPam( rTextNode, pTextField->GetStart() );
2007 aPam.SetMark();
2008 aPam.Move();
2010 }
2011 // keep inserted annotation
2012 {
2014 if ( pTextAttr != nullptr )
2015 {
2016 m_pImpl->SetFormatField(const_cast<SwFormatField*>(&pTextAttr->GetFormatField()), pDoc);
2017
2018 if ( *aIntPam.GetPoint() != *aIntPam.GetMark() )
2019 {
2020 // create annotation mark
2021 const SwPostItField* pField = dynamic_cast< const SwPostItField* >(pTextAttr->GetFormatField().GetField());
2022 OSL_ENSURE( pField != nullptr, "<SwXTextField::attach(..)> - annotation field missing!" );
2023 if ( pField != nullptr )
2024 {
2025 IDocumentMarkAccess* pMarksAccess = aIntPam.GetDoc().getIDocumentMarkAccess();
2026 pMarksAccess->makeAnnotationMark( aIntPam, pField->GetName() );
2027 }
2028 }
2029 }
2030 }
2031 }
2032
2033 }
2034 else
2035 throw lang::IllegalArgumentException();
2036}
2037
2038uno::Reference< text::XTextRange > SAL_CALL
2040{
2041 SolarMutexGuard aGuard;
2042
2043 SwField const*const pField = m_pImpl->GetField();
2044 if (!pField)
2045 return nullptr;
2046
2047 const SwTextField* pTextField = m_pImpl->GetFormatField()->GetTextField();
2048 if (!pTextField)
2049 throw uno::RuntimeException();
2050
2051 std::shared_ptr< SwPaM > pPamForTextField;
2052 SwTextField::GetPamForTextField(*pTextField, pPamForTextField);
2053 if (pPamForTextField == nullptr)
2054 return nullptr;
2055
2056 // If this is a postit field, then return the range of its annotation mark if it has one.
2057 if (pField->Which() == SwFieldIds::Postit)
2058 {
2059 const SwPostItField* pPostItField = static_cast<const SwPostItField*>(pField);
2060 IDocumentMarkAccess* pMarkAccess = m_pImpl->m_pDoc->getIDocumentMarkAccess();
2061 for (IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getAnnotationMarksBegin(); ppMark != pMarkAccess->getAnnotationMarksEnd(); ++ppMark)
2062 {
2063 if ((*ppMark)->GetName() == pPostItField->GetName())
2064 {
2065 pPamForTextField = std::make_shared<SwPaM>((*ppMark)->GetMarkStart(), (*ppMark)->GetMarkEnd());
2066 break;
2067 }
2068 }
2069 }
2070
2072 *m_pImpl->m_pDoc, *(pPamForTextField->GetPoint()), pPamForTextField->GetMark());
2073 return xRange;
2074}
2075
2077{
2078 SolarMutexGuard aGuard;
2079 SwField const*const pField = m_pImpl->GetField();
2080 if(pField && m_pImpl->m_pDoc)
2081 {
2082 UnoActionContext aContext(m_pImpl->m_pDoc);
2083 assert(m_pImpl->GetFormatField()->GetTextField() && "<SwXTextField::dispose()> - missing <SwTextField> --> crash");
2084 SwTextField::DeleteTextField(*(m_pImpl->GetFormatField()->GetTextField()));
2085 }
2086
2087 if (m_pImpl->m_xTextObject.is())
2088 {
2089 m_pImpl->m_xTextObject->DisposeEditSource();
2090 m_pImpl->m_xTextObject.clear();
2091 }
2092 m_pImpl->Invalidate();
2093}
2094
2096 const uno::Reference<lang::XEventListener> & xListener)
2097{
2098 std::unique_lock aGuard(m_pImpl->m_Mutex);
2099 m_pImpl->m_EventListeners.addInterface(aGuard, xListener);
2100}
2101
2103 const uno::Reference<lang::XEventListener> & xListener)
2104{
2105 std::unique_lock aGuard(m_pImpl->m_Mutex);
2106 m_pImpl->m_EventListeners.removeInterface(aGuard, xListener);
2107}
2108
2109uno::Reference< beans::XPropertySetInfo > SAL_CALL
2111{
2112 SolarMutexGuard aGuard;
2113 // no static
2114 uno::Reference< beans::XPropertySetInfo > aRef;
2115 if (m_pImpl->m_nServiceId == SwServiceType::Invalid)
2116 {
2117 throw uno::RuntimeException();
2118 }
2120 lcl_GetPropertyMapOfService(m_pImpl->m_nServiceId));
2121 const uno::Reference<beans::XPropertySetInfo>& xInfo = pPropSet->getPropertySetInfo();
2122 // extend PropertySetInfo!
2123 const uno::Sequence<beans::Property> aPropSeq = xInfo->getProperties();
2124 aRef = new SfxExtItemPropertySetInfo(
2126 aPropSeq );
2127 return aRef;
2128}
2129
2130void SAL_CALL
2132 const OUString& rPropertyName, const uno::Any& rValue)
2133{
2134 SolarMutexGuard aGuard;
2135 SwField const*const pField = m_pImpl->GetField();
2137 lcl_GetPropertyMapOfService(m_pImpl->m_nServiceId));
2138 const SfxItemPropertyMapEntry* pEntry = _pPropSet->getPropertyMap().getByName(rPropertyName);
2139
2140 if (!pEntry)
2141 throw beans::UnknownPropertyException( "Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
2142 if ( pEntry->nFlags & beans::PropertyAttribute::READONLY)
2143 throw beans::PropertyVetoException( "Property is read-only: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
2144
2145 if(pField)
2146 {
2147 // special treatment for mail merge fields
2148 const SwFieldIds nWhich = pField->Which();
2149 if( SwFieldIds::Database == nWhich &&
2150 (rPropertyName == UNO_NAME_DATA_BASE_NAME ||
2151 rPropertyName == UNO_NAME_DATA_BASE_URL||
2152 rPropertyName == UNO_NAME_DATA_TABLE_NAME||
2153 rPropertyName == UNO_NAME_DATA_COLUMN_NAME))
2154 {
2155 // here a new field type must be created and the field must
2156 // be registered at the new type
2157 OSL_FAIL("not implemented");
2158 }
2159 else
2160 {
2161 SwDoc * pDoc = m_pImpl->m_pDoc;
2162 assert(pDoc);
2163 const SwTextField* pTextField = m_pImpl->GetFormatField()->GetTextField();
2164 if(!pTextField)
2165 throw uno::RuntimeException();
2166 SwPosition aPosition( pTextField->GetTextNode(), pTextField->GetStart() );
2167 pDoc->getIDocumentFieldsAccess().PutValueToField( aPosition, rValue, pEntry->nWID);
2168 }
2169
2170 //#i100374# notify SwPostIt about new field content
2171 assert(m_pImpl->GetFormatField());
2172 if (SwFieldIds::Postit == nWhich)
2173 {
2174 m_pImpl->GetFormatField()->Broadcast(
2176 }
2177
2178 // fdo#42073 notify SwTextField about changes of the expanded string
2179 if (m_pImpl->GetFormatField()->GetTextField())
2180 {
2181 m_pImpl->GetFormatField()->GetTextField()->ExpandTextField();
2182 }
2183
2184 //#i100374# changing a document field should set the modify flag
2185 SwDoc* pDoc = m_pImpl->m_pDoc;
2186 if (pDoc)
2188
2189 }
2190 else if (m_pImpl->m_pProps)
2191 {
2192 bool* pBool = nullptr;
2193 switch(pEntry->nWID)
2194 {
2195 case FIELD_PROP_PAR1:
2196 rValue >>= m_pImpl->m_pProps->sPar1;
2197 break;
2198 case FIELD_PROP_PAR2:
2199 rValue >>= m_pImpl->m_pProps->sPar2;
2200 break;
2201 case FIELD_PROP_PAR3:
2202 rValue >>= m_pImpl->m_pProps->sPar3;
2203 break;
2204 case FIELD_PROP_PAR4:
2205 rValue >>= m_pImpl->m_pProps->sPar4;
2206 break;
2207 case FIELD_PROP_PAR5:
2208 rValue >>= m_pImpl->m_pProps->sPar5;
2209 break;
2210 case FIELD_PROP_PAR6:
2211 rValue >>= m_pImpl->m_pProps->sPar6;
2212 break;
2213 case FIELD_PROP_FORMAT:
2214 rValue >>= m_pImpl->m_pProps->nFormat;
2215 m_pImpl->m_pProps->bFormatIsDefault = false;
2216 break;
2217 case FIELD_PROP_SUBTYPE:
2218 m_pImpl->m_pProps->nSubType = SWUnoHelper::GetEnumAsInt32(rValue);
2219 break;
2220 case FIELD_PROP_BYTE1 :
2221 rValue >>= m_pImpl->m_pProps->nByte1;
2222 break;
2223 case FIELD_PROP_BOOL1 :
2224 pBool = &m_pImpl->m_pProps->bBool1;
2225 break;
2226 case FIELD_PROP_BOOL2 :
2227 pBool = &m_pImpl->m_pProps->bBool2;
2228 break;
2229 case FIELD_PROP_BOOL3 :
2230 pBool = &m_pImpl->m_pProps->bBool3;
2231 break;
2232 case FIELD_PROP_BOOL4:
2233 pBool = &m_pImpl->m_pProps->bBool4;
2234 break;
2235 case FIELD_PROP_DATE :
2236 {
2237 auto aTemp = o3tl::tryAccess<util::Date>(rValue);
2238 if(!aTemp)
2239 throw lang::IllegalArgumentException();
2240
2241 m_pImpl->m_pProps->aDate = Date(aTemp->Day, aTemp->Month, aTemp->Year);
2242 }
2243 break;
2244 case FIELD_PROP_USHORT1:
2245 case FIELD_PROP_USHORT2:
2246 {
2247 sal_Int16 nVal = 0;
2248 rValue >>= nVal;
2249 if( FIELD_PROP_USHORT1 == pEntry->nWID)
2250 m_pImpl->m_pProps->nUSHORT1 = nVal;
2251 else
2252 m_pImpl->m_pProps->nUSHORT2 = nVal;
2253 }
2254 break;
2255 case FIELD_PROP_SHORT1:
2256 rValue >>= m_pImpl->m_pProps->nSHORT1;
2257 break;
2258 case FIELD_PROP_DOUBLE:
2259 if(rValue.getValueType() != ::cppu::UnoType<double>::get())
2260 throw lang::IllegalArgumentException();
2261 rValue >>= m_pImpl->m_pProps->fDouble;
2262 break;
2263
2265 if (!m_pImpl->m_pProps->pDateTime)
2266 m_pImpl->m_pProps->pDateTime.reset( new util::DateTime );
2267 rValue >>= *m_pImpl->m_pProps->pDateTime;
2268 break;
2270 rValue >>= m_pImpl->m_pProps->aPropSeq;
2271 break;
2272 case FIELD_PROP_STRINGS:
2273 rValue >>= m_pImpl->m_pProps->aStrings;
2274 break;
2275 }
2276 if (pBool)
2277 {
2278 auto b = o3tl::tryAccess<bool>(rValue);
2279 if( !b )
2280 throw lang::IllegalArgumentException();
2281 *pBool = *b;
2282
2283 }
2284 }
2285 else
2286 throw uno::RuntimeException();
2287}
2288
2289uno::Any SAL_CALL SwXTextField::getPropertyValue(const OUString& rPropertyName)
2290{
2291 SolarMutexGuard aGuard;
2292 uno::Any aRet;
2293 SwField const*const pField = m_pImpl->GetField();
2295 lcl_GetPropertyMapOfService(m_pImpl->m_nServiceId));
2296 const SfxItemPropertyMapEntry* pEntry = _pPropSet->getPropertyMap().getByName(rPropertyName);
2297 if(!pEntry )
2298 {
2300 pEntry = _pParaPropSet->getPropertyMap().getByName(rPropertyName);
2301 }
2302 if (!pEntry)
2303 throw beans::UnknownPropertyException( "Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
2304
2305 switch( pEntry->nWID )
2306 {
2307 case FN_UNO_TEXT_WRAP:
2308 aRet <<= text::WrapTextMode_NONE;
2309 break;
2310 case FN_UNO_ANCHOR_TYPE:
2311 aRet <<= text::TextContentAnchorType_AS_CHARACTER;
2312 break;
2314 {
2315 uno::Sequence<text::TextContentAnchorType> aTypes { text::TextContentAnchorType_AS_CHARACTER };
2316 aRet <<= aTypes;
2317 }
2318 break;
2319
2320 default:
2321 if( pField )
2322 {
2323 if (FIELD_PROP_IS_FIELD_USED == pEntry->nWID ||
2325 {
2326 bool bIsFieldUsed = false;
2327 bool bIsFieldDisplayed = false;
2328
2329 // in order to have the information about fields
2330 // correctly evaluated the document needs a layout
2331 // (has to be already formatted)
2332 SwDoc *pDoc = m_pImpl->m_pDoc;
2333 SwViewShell *pViewShell = nullptr;
2334 SwEditShell *pEditShell = nullptr;
2335 if( pDoc )
2336 {
2337 pViewShell = pDoc->getIDocumentLayoutAccess().GetCurrentViewShell();
2338 pEditShell = pDoc->GetEditShell();
2339 }
2340
2341 if (pEditShell)
2342 pEditShell->CalcLayout();
2343 else if (pViewShell) // a page preview has no SwEditShell it should only have a view shell
2344 pViewShell->CalcLayout();
2345 else
2346 throw uno::RuntimeException();
2347
2348 // get text node for the text field
2349 const SwFormatField *pFieldFormat =
2350 (m_pImpl->GetField()) ? m_pImpl->GetFormatField() : nullptr;
2351 const SwTextField* pTextField = pFieldFormat
2352 ? m_pImpl->GetFormatField()->GetTextField() : nullptr;
2353 if(!pTextField)
2354 throw uno::RuntimeException();
2355 const SwTextNode& rTextNode = pTextField->GetTextNode();
2356
2357 // skip fields that are currently not in the document
2358 // e.g. fields in undo or redo array
2359 if (rTextNode.GetNodes().IsDocNodes())
2360 {
2361 bool bFrame = 0 != rTextNode.FindLayoutRect().Width(); // or so
2362 bool bHidden = rTextNode.IsHidden();
2363 if ( !bHidden )
2364 {
2365 sal_Int32 nHiddenStart;
2366 sal_Int32 nHiddenEnd;
2367 bHidden = SwScriptInfo::GetBoundsOfHiddenRange( pTextField->GetTextNode(),
2368 pTextField->GetStart(),
2369 nHiddenStart, nHiddenEnd );
2370 }
2371
2372 // !bFrame && !bHidden: most probably a field in an unused page style
2373
2374 // FME: Problem: hidden field in unused page template =>
2375 // bIsFieldUsed = true
2376 // bIsFieldDisplayed = false
2377 bIsFieldUsed = bFrame || bHidden;
2378 bIsFieldDisplayed = bIsFieldUsed && !bHidden;
2379 }
2380 aRet <<= (FIELD_PROP_IS_FIELD_USED == pEntry->nWID) ? bIsFieldUsed : bIsFieldDisplayed;
2381 }
2382 else
2383 pField->QueryValue( aRet, pEntry->nWID );
2384 }
2385 else if (m_pImpl->m_pProps) // currently just a descriptor...
2386 {
2387 switch(pEntry->nWID)
2388 {
2389 case FIELD_PROP_TEXT:
2390 {
2391 if (!m_pImpl->m_xTextObject.is())
2392 {
2393 m_pImpl->m_xTextObject
2394 = new SwTextAPIObject( std::make_unique<SwTextAPIEditSource>(m_pImpl->m_pDoc) );
2395 }
2396
2397 uno::Reference<text::XText> xText(m_pImpl->m_xTextObject);
2398 aRet <<= xText;
2399 break;
2400 }
2401 case FIELD_PROP_PAR1:
2402 aRet <<= m_pImpl->m_pProps->sPar1;
2403 break;
2404 case FIELD_PROP_PAR2:
2405 aRet <<= m_pImpl->m_pProps->sPar2;
2406 break;
2407 case FIELD_PROP_PAR3:
2408 aRet <<= m_pImpl->m_pProps->sPar3;
2409 break;
2410 case FIELD_PROP_PAR4:
2411 aRet <<= m_pImpl->m_pProps->sPar4;
2412 break;
2413 case FIELD_PROP_PAR5:
2414 aRet <<= m_pImpl->m_pProps->sPar5;
2415 break;
2416 case FIELD_PROP_PAR6:
2417 aRet <<= m_pImpl->m_pProps->sPar6;
2418 break;
2419 case FIELD_PROP_FORMAT:
2420 aRet <<= m_pImpl->m_pProps->nFormat;
2421 break;
2422 case FIELD_PROP_SUBTYPE:
2423 aRet <<= m_pImpl->m_pProps->nSubType;
2424 break;
2425 case FIELD_PROP_BYTE1 :
2426 aRet <<= m_pImpl->m_pProps->nByte1;
2427 break;
2428 case FIELD_PROP_BOOL1 :
2429 aRet <<= m_pImpl->m_pProps->bBool1;
2430 break;
2431 case FIELD_PROP_BOOL2 :
2432 aRet <<= m_pImpl->m_pProps->bBool2;
2433 break;
2434 case FIELD_PROP_BOOL3 :
2435 aRet <<= m_pImpl->m_pProps->bBool3;
2436 break;
2437 case FIELD_PROP_BOOL4 :
2438 aRet <<= m_pImpl->m_pProps->bBool4;
2439 break;
2440 case FIELD_PROP_DATE :
2441 aRet <<= m_pImpl->m_pProps->aDate.GetUNODate();
2442 break;
2443 case FIELD_PROP_USHORT1:
2444 aRet <<= static_cast<sal_Int16>(m_pImpl->m_pProps->nUSHORT1);
2445 break;
2446 case FIELD_PROP_USHORT2:
2447 aRet <<= static_cast<sal_Int16>(m_pImpl->m_pProps->nUSHORT2);
2448 break;
2449 case FIELD_PROP_SHORT1:
2450 aRet <<= m_pImpl->m_pProps->nSHORT1;
2451 break;
2452 case FIELD_PROP_DOUBLE:
2453 aRet <<= m_pImpl->m_pProps->fDouble;
2454 break;
2456 if (m_pImpl->m_pProps->pDateTime)
2457 aRet <<= *m_pImpl->m_pProps->pDateTime;
2458 break;
2460 aRet <<= m_pImpl->m_pProps->aPropSeq;
2461 break;
2462 case FIELD_PROP_STRINGS:
2463 aRet <<= m_pImpl->m_pProps->aStrings;
2464 break;
2467 aRet <<= false;
2468 break;
2469 }
2470 }
2471 else
2472 throw uno::RuntimeException();
2473 }
2474 return aRet;
2475}
2476
2477void SwXTextField::addPropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/)
2478{
2479 OSL_FAIL("not implemented");
2480}
2481
2482void SwXTextField::removePropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/)
2483{
2484 OSL_FAIL("not implemented");
2485}
2486
2487void SwXTextField::addVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/)
2488{
2489 OSL_FAIL("not implemented");
2490}
2491
2492void SwXTextField::removeVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/)
2493{
2494 OSL_FAIL("not implemented");
2495}
2496
2498{
2499 SolarMutexGuard aGuard;
2500 SwField * pField = const_cast<SwField*>(m_pImpl->GetField());
2501 if (pField)
2502 {
2503 switch(pField->Which())
2504 {
2506 static_cast<SwDateTimeField*>(pField)->SetDateTime( ::DateTime( ::DateTime::SYSTEM ) );
2507 break;
2508
2510 {
2511 SwExtUserField* pExtUserField = static_cast<SwExtUserField*>(pField);
2513 pExtUserField->GetSubType() ) );
2514 }
2515 break;
2516
2517 case SwFieldIds::Author:
2518 {
2519 SwAuthorField* pAuthorField = static_cast<SwAuthorField*>(pField);
2521 pAuthorField->GetFormat() ) );
2522 }
2523 break;
2524
2526 {
2527 SwFileNameField* pFileNameField = static_cast<SwFileNameField*>(pField);
2528 pFileNameField->SetExpansion( static_cast<SwFileNameFieldType*>(pField->GetTyp())->Expand(
2529 pFileNameField->GetFormat() ) );
2530 }
2531 break;
2532
2534 {
2535 SwDocInfoField* pDocInfField = static_cast<SwDocInfoField*>(pField);
2536 pDocInfField->SetExpansion( static_cast<SwDocInfoFieldType*>(pField->GetTyp())->Expand(
2537 pDocInfField->GetSubType(),
2538 pDocInfField->GetFormat(),
2539 pDocInfField->GetLanguage(),
2540 pDocInfField->GetName() ) );
2541 }
2542 break;
2543 default: break;
2544 }
2545 // Text formatting has to be triggered.
2546 m_pImpl->GetFormatField()->ForceUpdateTextNode();
2547 }
2548 else
2549 m_pImpl->m_bCallUpdate = true;
2550}
2551
2553{
2554 return "SwXTextField";
2555}
2556
2557static OUString OldNameToNewName_Impl( const OUString &rOld )
2558{
2559 static const char aOldNamePart1[] = ".TextField.DocInfo.";
2560 static const char aOldNamePart2[] = ".TextField.";
2561 OUString sServiceNameCC( rOld );
2562 sal_Int32 nIdx = sServiceNameCC.indexOf( aOldNamePart1 );
2563 if (nIdx >= 0)
2564 sServiceNameCC = sServiceNameCC.replaceAt( nIdx, strlen(aOldNamePart1), u".textfield.docinfo." );
2565 nIdx = sServiceNameCC.indexOf( aOldNamePart2 );
2566 if (nIdx >= 0)
2567 sServiceNameCC = sServiceNameCC.replaceAt( nIdx, strlen(aOldNamePart2), u".textfield." );
2568 return sServiceNameCC;
2569}
2570
2571sal_Bool SAL_CALL SwXTextField::supportsService(const OUString& rServiceName)
2572{
2573 return cppu::supportsService(this, rServiceName);
2574}
2575
2576uno::Sequence< OUString > SAL_CALL SwXTextField::getSupportedServiceNames()
2577{
2578 const OUString sServiceName =
2580
2581 // case-corrected version of service-name (see #i67811)
2582 // (need to supply both because of compatibility to older versions)
2583 const OUString sServiceNameCC( OldNameToNewName_Impl( sServiceName ) );
2584 sal_Int32 nLen = sServiceName == sServiceNameCC ? 2 : 3;
2585
2586 uno::Sequence< OUString > aRet( nLen );
2587 OUString* pArray = aRet.getArray();
2588 *pArray++ = sServiceName;
2589 if (nLen == 3)
2590 *pArray++ = sServiceNameCC;
2591 *pArray++ = "com.sun.star.text.TextContent";
2592 return aRet;
2593}
2594
2596{
2598 m_pFormatField = nullptr;
2599 m_pDoc = nullptr;
2600 uno::Reference<uno::XInterface> const xThis(m_wThis);
2601 if (!xThis.is())
2602 { // fdo#72695: if UNO object is already dead, don't revive it with event
2603 return;
2604 }
2605 lang::EventObject const ev(xThis);
2606 std::unique_lock aGuard(m_Mutex);
2608}
2609
2611{
2612
2613 if(rHint.GetId() == SfxHintId::Dying)
2614 Invalidate();
2615 else if (rHint.GetId() == SfxHintId::SwLegacyModify)
2616 {
2617 auto pLegacyHint = static_cast<const sw::LegacyModifyHint*>(&rHint);
2618 switch(pLegacyHint->m_pOld ? pLegacyHint->m_pOld->Which() : 0)
2619 {
2621 case RES_OBJECTDYING:
2622 Invalidate();
2623 break;
2624 }
2625 }
2626}
2627
2629{
2630 return m_pFormatField ? m_pFormatField->GetField() : nullptr;
2631}
2632
2634{
2635 return "SwXTextFieldMasters";
2636}
2637
2639{
2640 return cppu::supportsService(this, rServiceName);
2641}
2642
2644{
2645 uno::Sequence<OUString> aRet { "com.sun.star.text.TextFieldMasters" };
2646 return aRet;
2647}
2648
2650 SwUnoCollection(_pDoc)
2651{
2652}
2653
2655{
2656
2657}
2658
2659/*
2660 Iteration over non-standard field types
2661 USER/SETEXP/DDE/DATABASE
2662 Thus the names are:
2663 "com.sun.star.text.fieldmaster.User" + <field type name>
2664 "com.sun.star.text.fieldmaster.DDE" + <field type name>
2665 "com.sun.star.text.fieldmaster.SetExpression" + <field type name>
2666 "com.sun.star.text.fieldmaster.DataBase" + <field type name>
2667
2668 If too much, maybe one could leave out the "com.sun.star.text".
2669 */
2670static SwFieldIds lcl_GetIdByName( OUString& rName, OUString& rTypeName )
2671{
2672 if (rName.startsWithIgnoreAsciiCase(COM_TEXT_FLDMASTER_CC))
2673 rName = rName.copy(COM_TEXT_FLDMASTER_CC.getLength());
2674
2676 sal_Int32 nIdx = 0;
2677 rTypeName = rName.getToken( 0, '.', nIdx );
2678 if (rTypeName == "User")
2679 nResId = SwFieldIds::User;
2680 else if (rTypeName == "DDE")
2681 nResId = SwFieldIds::Dde;
2682 else if (rTypeName == "SetExpression")
2683 {
2684 nResId = SwFieldIds::SetExp;
2685
2686 const OUString sFieldTypName( rName.getToken( 0, '.', nIdx ));
2687 const OUString sUIName( SwStyleNameMapper::GetSpecialExtraUIName( sFieldTypName ) );
2688
2689 if( sUIName != sFieldTypName )
2690 rName = comphelper::string::setToken(rName, 1, '.', sUIName);
2691 }
2692 else if (rTypeName.equalsIgnoreAsciiCase("DataBase"))
2693 {
2694 rName = rName.copy(RTL_CONSTASCII_LENGTH("DataBase."));
2695 if (!rName.isEmpty())
2696 {
2697 // #i51815#
2698 rName = "DataBase." + rName;
2699 nResId = SwFieldIds::Database;
2700 }
2701 }
2702 else if (rTypeName == "Bibliography")
2704 return nResId;
2705}
2706
2708{
2709 SolarMutexGuard aGuard;
2710 if(!GetDoc())
2711 throw uno::RuntimeException();
2712
2713 OUString sName(rName), sTypeName;
2714 const SwFieldIds nResId = lcl_GetIdByName( sName, sTypeName );
2715 if( SwFieldIds::Unknown == nResId )
2716 throw container::NoSuchElementException(
2717 "SwXTextFieldMasters::getByName(" + rName + ")",
2718 css::uno::Reference<css::uno::XInterface>());
2719
2720 sName = sName.copy(std::min(sTypeName.getLength()+1, sName.getLength()));
2721 SwFieldType* pType = GetDoc()->getIDocumentFieldsAccess().GetFieldType(nResId, sName, true);
2722 if(!pType)
2723 throw container::NoSuchElementException(
2724 "SwXTextFieldMasters::getByName(" + rName + ")",
2725 css::uno::Reference<css::uno::XInterface>());
2726
2727 uno::Reference<beans::XPropertySet> const xRet(
2729 return uno::Any(xRet);
2730}
2731
2733 const SwFieldType& rFieldType, OUString& rName)
2734{
2735 OUString sField;
2736
2737 switch( rFieldType.Which() )
2738 {
2739 case SwFieldIds::User:
2740 sField = "User." + rFieldType.GetName();
2741 break;
2742 case SwFieldIds::Dde:
2743 sField = "DDE." + rFieldType.GetName();
2744 break;
2745
2746 case SwFieldIds::SetExp:
2747 sField = "SetExpression." + SwStyleNameMapper::GetSpecialExtraProgName( rFieldType.GetName() );
2748 break;
2749
2751 sField = "DataBase." + rFieldType.GetName().replaceAll(OUStringChar(DB_DELIM), ".");
2752 break;
2753
2755 sField = "Bibliography";
2756 break;
2757
2758 default:
2759 return false;
2760 }
2761
2762 rName += COM_TEXT_FLDMASTER_CC + sField;
2763 return true;
2764}
2765
2766uno::Sequence< OUString > SwXTextFieldMasters::getElementNames()
2767{
2768 SolarMutexGuard aGuard;
2769 if(!GetDoc())
2770 throw uno::RuntimeException();
2771
2772 const SwFieldTypes* pFieldTypes = GetDoc()->getIDocumentFieldsAccess().GetFieldTypes();
2773 const size_t nCount = pFieldTypes->size();
2774
2775 std::vector<OUString> aFieldNames;
2776 for( size_t i = 0; i < nCount; ++i )
2777 {
2778 SwFieldType& rFieldType = *((*pFieldTypes)[i]);
2779
2780 OUString sFieldName;
2781 if (SwXTextFieldMasters::getInstanceName(rFieldType, sFieldName))
2782 {
2783 aFieldNames.push_back(sFieldName);
2784 }
2785 }
2786
2788}
2789
2791{
2792 SolarMutexGuard aGuard;
2793 if(!GetDoc())
2794 throw uno::RuntimeException();
2795
2796 OUString sName(rName), sTypeName;
2797 const SwFieldIds nResId = lcl_GetIdByName( sName, sTypeName );
2798 bool bRet = false;
2799 if( SwFieldIds::Unknown != nResId )
2800 {
2801 sName = sName.copy(std::min(sTypeName.getLength()+1, sName.getLength()));
2802 bRet = nullptr != GetDoc()->getIDocumentFieldsAccess().GetFieldType(nResId, sName, true);
2803 }
2804 return bRet;
2805}
2806
2808{
2810
2811}
2812
2814{
2815 SolarMutexGuard aGuard;
2816 if(!IsValid())
2817 throw uno::RuntimeException();
2818 return true;
2819}
2820
2822{
2823public:
2824 std::mutex m_Mutex; // just for OInterfaceContainerHelper3
2826};
2827
2829{
2830 return "SwXTextFieldTypes";
2831}
2832
2834{
2835 return cppu::supportsService(this, rServiceName);
2836}
2837
2839{
2840 uno::Sequence<OUString> aRet { "com.sun.star.text.TextFields" };
2841 return aRet;
2842}
2843
2845 : SwUnoCollection (_pDoc)
2846 , m_pImpl(new Impl)
2847{
2848}
2849
2851{
2852}
2853
2855{
2857 lang::EventObject const ev(static_cast< ::cppu::OWeakObject&>(*this));
2858 std::unique_lock aGuard(m_pImpl->m_Mutex);
2859 m_pImpl->m_RefreshListeners.disposeAndClear(aGuard, ev);
2860}
2861
2862uno::Reference< container::XEnumeration > SwXTextFieldTypes::createEnumeration()
2863{
2864 SolarMutexGuard aGuard;
2865 if(!IsValid())
2866 throw uno::RuntimeException();
2867 return new SwXFieldEnumeration(*GetDoc());
2868}
2869
2871{
2873}
2874
2876{
2877 SolarMutexGuard aGuard;
2878 if(!IsValid())
2879 throw uno::RuntimeException();
2880 return true; // they always exist
2881}
2882
2884{
2885 {
2886 SolarMutexGuard aGuard;
2887 if (!IsValid())
2888 throw uno::RuntimeException();
2889 UnoActionContext aContext(GetDoc());
2890 GetDoc()->getIDocumentStatistics().UpdateDocStat( false, true );
2892 }
2893 // call refresh listeners (without SolarMutex locked)
2894 lang::EventObject const event(static_cast< ::cppu::OWeakObject*>(this));
2895 std::unique_lock aGuard(m_pImpl->m_Mutex);
2896 m_pImpl->m_RefreshListeners.notifyEach(aGuard,
2897 & util::XRefreshListener::refreshed, event);
2898}
2899
2901 const uno::Reference<util::XRefreshListener> & xListener)
2902{
2903 std::unique_lock aGuard(m_pImpl->m_Mutex);
2904 m_pImpl->m_RefreshListeners.addInterface(aGuard, xListener);
2905}
2906
2908 const uno::Reference<util::XRefreshListener> & xListener)
2909{
2910 std::unique_lock aGuard(m_pImpl->m_Mutex);
2911 m_pImpl->m_RefreshListeners.removeInterface(aGuard, xListener);
2912}
2913
2915 : public SvtListener
2916{
2917public:
2919 std::vector<uno::Reference<text::XTextField>> m_Items;
2920 sal_Int32 m_nNextIndex;
2921
2922 explicit Impl(SwDoc& rDoc)
2923 : m_pDoc(&rDoc)
2924 , m_nNextIndex(0)
2925 {
2927 }
2928
2929 virtual void Notify(const SfxHint& rHint) override
2930 {
2931 if(rHint.GetId() == SfxHintId::Dying)
2932 m_pDoc = nullptr;
2933 }
2934};
2935
2936OUString SAL_CALL
2938{
2939 return "SwXFieldEnumeration";
2940}
2941
2942sal_Bool SAL_CALL SwXFieldEnumeration::supportsService(const OUString& rServiceName)
2943{
2944 return cppu::supportsService(this, rServiceName);
2945}
2946
2947uno::Sequence<OUString> SAL_CALL
2949{
2950 return { "com.sun.star.text.FieldEnumeration" };
2951}
2952
2954 : m_pImpl(new Impl(rDoc))
2955{
2956 // build sequence
2957 m_pImpl->m_Items.clear();
2958
2959 const SwFieldTypes* pFieldTypes = m_pImpl->m_pDoc->getIDocumentFieldsAccess().GetFieldTypes();
2960 const size_t nCount = pFieldTypes->size();
2961 for(size_t nType = 0; nType < nCount; ++nType)
2962 {
2963 const SwFieldType* pCurType = (*pFieldTypes)[nType].get();
2964 std::vector<SwFormatField*> vFormatFields;
2965 pCurType->GatherFields(vFormatFields);
2966 std::for_each(vFormatFields.begin(), vFormatFields.end(),
2967 [this](SwFormatField* pF) { m_pImpl->m_Items.push_back(SwXTextField::CreateXTextField(m_pImpl->m_pDoc, pF)); });
2968 }
2969 // now handle meta-fields, which are not SwFields
2970 const std::vector< uno::Reference<text::XTextField> > MetaFields(
2971 m_pImpl->m_pDoc->GetMetaFieldManager().getMetaFields() );
2972 for (const auto & rMetaField : MetaFields)
2973 {
2974 m_pImpl->m_Items.push_back( rMetaField );
2975 }
2976 // also add fieldmarks
2977 IDocumentMarkAccess& rMarksAccess(*rDoc.getIDocumentMarkAccess());
2978 for (auto iter = rMarksAccess.getFieldmarksBegin(); iter != rMarksAccess.getFieldmarksEnd(); ++iter)
2979 {
2980 m_pImpl->m_Items.emplace_back(static_cast<cppu::OWeakObject*>(SwXFieldmark::CreateXFieldmark(rDoc, *iter).get()), uno::UNO_QUERY);
2981 }
2982}
2983
2985{
2986}
2987
2989{
2990 SolarMutexGuard aGuard;
2991
2992 return m_pImpl->m_nNextIndex < static_cast<sal_Int32>(m_pImpl->m_Items.size());
2993}
2994
2996{
2997 SolarMutexGuard aGuard;
2998
2999 if (m_pImpl->m_nNextIndex >= static_cast<sal_Int32>(m_pImpl->m_Items.size()))
3000 throw container::NoSuchElementException(
3001 "SwXFieldEnumeration::nextElement",
3002 css::uno::Reference<css::uno::XInterface>());
3003
3004 uno::Reference< text::XTextField > &rxField =
3005 m_pImpl->m_Items[ m_pImpl->m_nNextIndex++ ];
3006 uno::Any aRet;
3007 aRet <<= rxField;
3008 rxField = nullptr; // free memory for item that is no longer used
3009 return aRet;
3010}
3011
3012/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
::std::unique_ptr< XmlIdRegistry_Impl > m_pImpl
constexpr OUStringLiteral sServiceName
Definition: accdoc.cxx:54
const char *const aFieldNames[]
Definition: authfld.cxx:724
Text operation/manipulation interface.
virtual bool DeleteAndJoin(SwPaM &, SwDeleteFlags flags=SwDeleteFlags::Default)=0
complete delete of a given PaM
virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr, SwTextAttr **ppNewTextAttr=nullptr)=0
Insert an attribute.
virtual SwFieldType * GetSysFieldType(const SwFieldIds eWhich) const =0
virtual SwFieldType * GetFieldType(SwFieldIds nResId, const OUString &rName, bool bDbFieldMatching) const =0
virtual SwFieldType * InsertFieldType(const SwFieldType &)=0
virtual const SwFieldTypes * GetFieldTypes() const =0
virtual void UpdateFields(bool bCloseDB)=0
virtual void PutValueToField(const SwPosition &rPos, const css::uno::Any &rVal, sal_uInt16 nWhich)=0
Puts a value into a field at a certain position.
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
wrapper iterator: wraps iterator of implementation while hiding MarkBase class; only IMark instances ...
Provides access to the marks of a document.
virtual const_iterator_t getAnnotationMarksEnd() const =0
virtual const_iterator_t getFieldmarksBegin() const =0
returns a STL-like random access iterator to the begin of the sequence of fieldmarks.
virtual const_iterator_t getAnnotationMarksBegin() const =0
virtual const_iterator_t getFieldmarksEnd() const =0
returns a STL-like random access iterator to the end of the sequence of fieldmarks.
virtual sw::mark::IMark * makeAnnotationMark(const SwPaM &rPaM, const OUString &rName)=0
virtual void SetModified()=0
Must be called manually at changes of format.
virtual void UpdateDocStat(bool bCompleteAsync, bool bFields)=0
Updates the internal document's statistics.
virtual SwPageDesc * GetPageDescFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return required automatic page style.
INetProtocol GetProtocol() const
bool SetURL(std::u16string_view rTheAbsURIRef, EncodeMechanism eMechanism=EncodeMechanism::WasEncoded, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
SfxHintId GetId() const
const SfxItemPropertyMapEntry * getByName(std::u16string_view rName) const
const SfxItemPropertyMap & getPropertyMap() const
css::uno::Reference< css::beans::XPropertySetInfo > const & getPropertySetInfo() const
sal_uInt16 Which() const
void EndListeningAll()
bool StartListening(SvtBroadcaster &rBroadcaster)
static OUString Expand(sal_uLong)
Definition: docufld.cxx:314
void SetExpansion(const OUString &rStr)
Definition: docufld.hxx:198
Represents an inserted bibliography entry, created using Insert -> Table of Contents and Index -> Bib...
Definition: authfld.hxx:161
void SetLevel(sal_uInt8)
Definition: chpfld.cxx:86
SwRect FindLayoutRect(const bool bPrtArea=false, const Point *pPoint=nullptr) const
Definition: node.cxx:1231
virtual sal_uInt16 GetSubType() const override
Definition: dbfld.cxx:348
void SetSetNumber(tools::Long nNum)
Definition: dbfld.hxx:286
void SetOffset(tools::Long nMinutes)
Definition: flddat.hxx:65
void SetExpansion(const OUString &rStr)
Definition: docufld.hxx:550
const OUString & GetName() const
Definition: docufld.hxx:548
virtual sal_uInt16 GetSubType() const override
Definition: docufld.cxx:1154
Definition: doc.hxx:197
IDocumentState const & getIDocumentState() const
Definition: doc.cxx:408
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:329
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
Definition: doc.cxx:371
SwEditShell const * GetEditShell() const
Definition: doccorr.cxx:330
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:419
IDocumentMarkAccess * getIDocumentMarkAccess()
Definition: docbm.cxx:1890
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:440
IDocumentStatistics const & getIDocumentStatistics() const
Definition: doc.cxx:387
Field type for dropdown boxes.
Definition: flddropdown.hxx:32
Dropdown field.
Definition: flddropdown.hxx:59
void SetSelectedItem(const OUString &rItem)
Sets the selected item.
void SetToolTip(const OUString &rToolTip)
Sets the tool tip of the field.
void SetItems(std::vector< OUString > &&rItems)
Sets the items of the dropdown box.
void SetHelp(const OUString &rHelp)
Sets the help text of the field.
void SetName(const OUString &rName)
Sets the name of the field.
virtual void CalcLayout() override
To enable set up of StartActions and EndActions.
Definition: edws.cxx:108
static OUString Expand(sal_uInt16 nSubType)
Definition: docufld.cxx:2025
virtual sal_uInt16 GetSubType() const override
Definition: docufld.cxx:2082
void SetExpansion(const OUString &rStr)
Definition: docufld.hxx:579
Instances of SwFields and those derived from it occur 0 to n times.
Definition: fldbas.hxx:247
void SetXObject(rtl::Reference< SwXFieldMaster > const &xFieldMaster)
Definition: fldbas.cxx:224
virtual void UpdateFields()
Definition: fldbas.cxx:219
virtual OUString GetName() const
Only in derived classes.
Definition: fldbas.cxx:139
virtual void QueryValue(css::uno::Any &rVal, sal_uInt16 nWhich) const
Definition: fldbas.cxx:144
virtual void PutValue(const css::uno::Any &rVal, sal_uInt16 nWhich)
Definition: fldbas.cxx:147
SwFieldIds Which() const
Definition: fldbas.hxx:276
void GatherFields(std::vector< SwFormatField * > &rvFormatFields, bool bCollectOnlyInDocNodes=true) const
Definition: fldbas.cxx:205
unotools::WeakReference< SwXFieldMaster > const & GetXObject() const
Definition: fldbas.hxx:263
Base class of all fields.
Definition: fldbas.hxx:296
virtual sal_uInt16 GetSubType() const
Definition: fldbas.cxx:355
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
OUString ExpandField(bool bCached, SwRootFrame const *pLayout) const
expand the field.
Definition: fldbas.cxx:491
virtual OUString GetFieldName() const
get name or content
Definition: fldbas.cxx:318
SwFieldType * GetTyp() const
Definition: fldbas.hxx:402
SwFieldIds Which() const
ResId.
Definition: fldbas.cxx:263
LanguageType GetLanguage() const
Language at field position.
Definition: fldbas.hxx:412
void SetExpansion(const OUString &rStr)
Definition: docufld.hxx:224
const SwField * GetField() const
Definition: fmtfld.hxx:131
const SwTextField * GetTextField() const
Definition: fmtfld.hxx:149
SAL_DLLPRIVATE unotools::WeakReference< SwXTextField > const & GetXTextField() const
Definition: fmtfld.hxx:164
void ChgExpStr(const OUString &rExpand, SwRootFrame const *pLayout)
Definition: expfld.cxx:289
void SetLateInitialization()
Definition: expfld.hxx:135
Get reference.
Definition: reffld.hxx:66
void SetHidden(bool bHidden)
Definition: docufld.hxx:375
void SetValue(bool bHidden)
Definition: docufld.hxx:331
void SetToolTip(const OUString &rStr)
Definition: expfld.cxx:1417
void SetHelp(const OUString &rStr)
Definition: expfld.cxx:1407
static void CreateMacroString(OUString &rMacro, std::u16string_view rMacroName, const OUString &rLibraryName)
create an internally used macro name from the library and macro name parts
Definition: macrofld.cxx:196
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:901
SwNodes & GetNodes()
Node is in which nodes-array/doc?
Definition: node.hxx:706
SwDoc & GetDoc()
Definition: node.hxx:233
bool IsDocNodes() const
Is the NodesArray the regular one of Doc? (and not the UndoNds, ...) Implementation in doc....
Definition: nodes.cxx:2555
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:188
const SwPosition * GetMark() const
Definition: pam.hxx:255
SwNode & GetPointNode() const
Definition: pam.hxx:275
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
Definition: pam.cxx:643
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
Definition: pam.cxx:657
const SwPosition * End() const
Definition: pam.hxx:263
SwDoc & GetDoc() const
Definition: pam.hxx:291
const SwPosition * GetPoint() const
Definition: pam.hxx:253
const SwPosition * Start() const
Definition: pam.hxx:258
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
Definition: pam.hxx:251
void SetUserString(const OUString &rS)
Definition: docufld.hxx:176
const OUString & GetName() const
Definition: docufld.hxx:504
void SetTextObject(std::optional< OutlinerParaObject > pText)
Definition: docufld.cxx:1842
virtual void SetPar2(const OUString &rStr) override
set the PostIt's text
Definition: docufld.cxx:1824
void Width(tools::Long nNew)
Definition: swrect.hxx:189
void SetText(const OUString &rText, SwRootFrame const *pLayout)
Definition: docufld.cxx:2386
static bool GetBoundsOfHiddenRange(const SwTextNode &rNode, sal_Int32 nPos, sal_Int32 &rnStartPos, sal_Int32 &rnEndPos, std::vector< sal_Int32 > *pList=nullptr)
Hidden text range information - static and non-version.
Definition: porlay.cxx:2025
sal_uInt16 GetType() const
Definition: expfld.hxx:198
void SetOutlineLvl(sal_uInt8 n)
Definition: expfld.hxx:184
void SetDelimiter(const OUString &s)
Definition: expfld.hxx:182
void ChgExpStr(const OUString &rExpand, SwRootFrame const *pLayout)
Definition: expfld.cxx:534
void SetInputFlag(bool bInp)
Definition: expfld.hxx:266
SwFormatField * GetFormatField()
Definition: expfld.hxx:224
void SetPromptText(const OUString &rStr)
Definition: expfld.hxx:260
void SetSeqNumber(sal_uInt16 n)
Logical number, sequence fields.
Definition: expfld.hxx:247
bool GetInputFlag() const
Definition: expfld.hxx:269
static const std::vector< OUString > & GetExtraUINameArray()
static const OUString & GetProgName(const OUString &rName, SwGetPoolIdFromName)
static SW_DLLPUBLIC const OUString & GetSpecialExtraProgName(const OUString &rExtraUIName)
static const OUString & GetSpecialExtraUIName(const OUString &rExtraProgName)
Implementation in tblcalc.cxx.
Definition: expfld.hxx:374
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
Definition: txatbase.hxx:44
sal_Int32 GetStart() const
Definition: txatbase.hxx:88
sal_uInt16 Which() const
Definition: txatbase.hxx:116
const SwFormatField & GetFormatField() const
Definition: txatbase.hxx:199
SwTextNode & GetTextNode() const
Definition: txtfld.hxx:53
SwTextNode * GetpTextNode() const
Definition: txtfld.hxx:49
static void DeleteTextField(const SwTextField &rTextField)
Definition: atrfld.cxx:654
static void GetPamForTextField(const SwTextField &rTextField, std::shared_ptr< SwPaM > &rPamForTextField)
Definition: atrfld.cxx:634
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:112
SwTextField * GetFieldTextAttrAt(const sal_Int32 nIndex, ::sw::GetTextAttrMode const eMode=::sw::GetTextAttrMode::Expand) const
Definition: ndtxt.cxx:1849
bool IsHidden() const
Definition: ndtxt.cxx:4749
SwDoc * GetDoc() const
Definition: unocoll.hxx:59
bool IsValid() const
Definition: unocoll.hxx:57
virtual void Invalidate()
Definition: unocoll.cxx:1932
o3tl::span< const SfxItemPropertyMapEntry > GetPropertyMapEntries(sal_uInt16 PropertyId)
Definition: unomap.cxx:74
const SfxItemPropertySet * GetPropertySet(sal_uInt16 PropertyId)
Definition: unomap1.cxx:1111
The shared part of a user field.
Definition: usrfld.hxx:35
sal_uInt16 GetType() const
Definition: usrfld.hxx:90
The non-shared part of a user field.
Definition: usrfld.hxx:106
virtual void SetValue(const double &rVal)
Definition: fldbas.cxx:804
virtual void CalcLayout()
Definition: viewsh.cxx:1075
std::vector< uno::Reference< text::XTextField > > m_Items
Definition: unofield.cxx:2919
sal_Int32 m_nNextIndex
index of next element to be returned
Definition: unofield.cxx:2920
virtual void Notify(const SfxHint &rHint) override
Definition: unofield.cxx:2929
virtual ~SwXFieldEnumeration() override
Definition: unofield.cxx:2984
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unofield.cxx:2948
virtual sal_Bool SAL_CALL hasMoreElements() override
Definition: unofield.cxx:2988
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
Definition: unofield.cxx:2942
virtual css::uno::Any SAL_CALL nextElement() override
Definition: unofield.cxx:2995
SwXFieldEnumeration(SwDoc &rDoc)
Definition: unofield.cxx:2953
virtual OUString SAL_CALL getImplementationName() override
Definition: unofield.cxx:2937
::sw::UnoImplPtr< Impl > m_pImpl
Definition: unofield.hxx:206
unotools::WeakReference< SwXFieldMaster > m_wThis
Definition: unofield.cxx:410
Impl(SwPageDesc *const pPageDesc, SwDoc *pDoc, SwFieldIds nResId)
Definition: unofield.cxx:427
virtual void Notify(const SfxHint &rHint) override
Definition: unofield.cxx:971
void SetFieldType(SwFieldType *pType)
Definition: unofield.cxx:450
::comphelper::OInterfaceContainerHelper4< css::lang::XEventListener > m_EventListeners
Definition: unofield.cxx:411
SwFieldIds m_nResTypeId
Definition: unofield.cxx:416
Impl(SwFieldType *const pType, SwDoc *pDoc, SwFieldIds nResId)
Definition: unofield.cxx:439
std::mutex m_Mutex
Definition: unofield.cxx:408
SwFieldType * m_pType
Definition: unofield.cxx:414
virtual void SAL_CALL removePropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unofield.cxx:919
static OUString LocalizeFormula(const SwSetExpField &rField, const OUString &rFormula, bool bQuery)
Definition: unofield.cxx:1005
virtual ~SwXFieldMaster() override
Definition: unofield.cxx:519
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
Definition: unofield.cxx:957
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
Definition: unofield.cxx:498
virtual OUString SAL_CALL getImplementationName() override
Definition: unofield.cxx:461
static rtl::Reference< SwXFieldMaster > CreateXFieldMaster(SwDoc *pDoc, SwFieldType *pType, SwFieldIds nResId=SwFieldIds::Unknown)
Definition: unofield.cxx:524
SwXFieldMaster(SwFieldType &rType, SwDoc *pDoc)
Definition: unofield.cxx:514
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
Definition: unofield.cxx:964
SwFieldType * GetFieldType(bool bDontCreate=false) const
Definition: unofield.cxx:764
::sw::UnoImplPtr< Impl > m_pImpl
Definition: unofield.hxx:49
virtual void SAL_CALL setPropertyValue(const OUString &rPropertyName, const css::uno::Any &rValue) override
Definition: unofield.cxx:559
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unofield.cxx:550
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unofield.cxx:504
virtual void SAL_CALL addPropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unofield.cxx:914
static OUString GetProgrammaticName(const SwFieldType &rType, SwDoc &rDoc)
Definition: unofield.cxx:988
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &rPropertyName) override
Definition: unofield.cxx:790
virtual void SAL_CALL addVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
Definition: unofield.cxx:924
virtual void SAL_CALL dispose() override
Definition: unofield.cxx:934
virtual void SAL_CALL removeVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
Definition: unofield.cxx:929
static rtl::Reference< SwXBookmark > CreateXFieldmark(SwDoc &rDoc, ::sw::mark::IMark *pMark, bool isReplacementObject=false)
Definition: unobkm.cxx:674
static OUString GetProviderName(SwServiceType nObjectType)
Definition: unocoll.cxx:476
bool IsAtEndOfMeta() const
Definition: unoobj.cxx:876
SwXTextFieldMasters(SwDoc *pDoc)
Definition: unofield.cxx:2649
virtual OUString SAL_CALL getImplementationName() override
Definition: unofield.cxx:2633
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unofield.cxx:2643
virtual sal_Bool SAL_CALL hasByName(const OUString &rName) override
Definition: unofield.cxx:2790
virtual css::uno::Type SAL_CALL getElementType() override
Definition: unofield.cxx:2807
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
Definition: unofield.cxx:2638
virtual sal_Bool SAL_CALL hasElements() override
Definition: unofield.cxx:2813
virtual ~SwXTextFieldMasters() override
Definition: unofield.cxx:2654
virtual css::uno::Any SAL_CALL getByName(const OUString &rName) override
Definition: unofield.cxx:2707
static bool getInstanceName(const SwFieldType &rFieldType, OUString &rName)
Definition: unofield.cxx:2732
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
Definition: unofield.cxx:2766
::comphelper::OInterfaceContainerHelper4< util::XRefreshListener > m_RefreshListeners
Definition: unofield.cxx:2825
SwXTextFieldTypes(SwDoc *pDoc)
Definition: unofield.cxx:2844
virtual void SAL_CALL removeRefreshListener(const css::uno::Reference< css::util::XRefreshListener > &xListener) override
Definition: unofield.cxx:2907
virtual void SAL_CALL refresh() override
Definition: unofield.cxx:2883
virtual void SAL_CALL addRefreshListener(const css::uno::Reference< css::util::XRefreshListener > &xListener) override
Definition: unofield.cxx:2900
virtual OUString SAL_CALL getImplementationName() override
Definition: unofield.cxx:2828
virtual void Invalidate() override
Definition: unofield.cxx:2854
std::unique_ptr< Impl > m_pImpl
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
Definition: unofield.cxx:2862
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unofield.cxx:2838
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
Definition: unofield.cxx:2833
virtual sal_Bool SAL_CALL hasElements() override
Definition: unofield.cxx:2875
virtual ~SwXTextFieldTypes() override
Definition: unofield.cxx:2850
virtual css::uno::Type SAL_CALL getElementType() override
Definition: unofield.cxx:2870
virtual ~Impl() override
Definition: unofield.cxx:1106
OUString m_sTypeName
Definition: unofield.cxx:1088
::comphelper::OInterfaceContainerHelper4< css::lang::XEventListener > m_EventListeners
Definition: unofield.cxx:1081
SwFormatField * m_pFormatField
Definition: unofield.cxx:1078
std::unique_ptr< SwFieldProperties_Impl > m_pProps
Definition: unofield.cxx:1089
SwFieldType * m_pFieldType
Definition: unofield.cxx:1077
Impl(SwDoc *const pDoc, SwFormatField *const pFormat, SwServiceType nServiceId)
Definition: unofield.cxx:1091
std::mutex m_Mutex
Definition: unofield.cxx:1076
rtl::Reference< SwTextAPIObject > m_xTextObject
Definition: unofield.cxx:1084
const SwField * GetField() const
Definition: unofield.cxx:2628
SwServiceType m_nServiceId
Definition: unofield.cxx:1087
bool IsDescriptor() const
Definition: unofield.cxx:1128
void SetFieldType(SwFieldType &rType)
Definition: unofield.cxx:1147
unotools::WeakReference< SwXTextField > m_wThis
Definition: unofield.cxx:1080
void SetFormatField(SwFormatField *pFormatField, SwDoc *pDoc)
Definition: unofield.cxx:1114
SwFieldType * GetFieldType() const
Definition: unofield.cxx:1138
virtual void Notify(const SfxHint &) override
Definition: unofield.cxx:2610
SwFormatField * GetFormatField()
Definition: unofield.cxx:1124
UNO wrapper around an SwFormatField, i.e.
Definition: unofield.hxx:120
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
Definition: unofield.cxx:2095
virtual OUString SAL_CALL getPresentation(sal_Bool bShowCommand) override
Definition: unofield.cxx:1307
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unofield.cxx:2110
virtual void SAL_CALL dispose() override
Definition: unofield.cxx:2076
virtual void SAL_CALL removePropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unofield.cxx:2482
SwServiceType GetServiceId() const
Definition: unofield.cxx:1221
virtual void SAL_CALL removeVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
Definition: unofield.cxx:2492
virtual void SAL_CALL attachTextFieldMaster(const css::uno::Reference< css::beans::XPropertySet > &xFieldMaster) override
Definition: unofield.cxx:1275
SwXTextField(SwFormatField &rFormat, SwDoc &rDoc)
Definition: unofield.cxx:1184
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
Definition: unofield.cxx:2571
virtual void SAL_CALL update() override
Definition: unofield.cxx:2497
virtual void SAL_CALL addPropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unofield.cxx:2477
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &rPropertyName) override
Definition: unofield.cxx:2289
static rtl::Reference< SwXTextField > CreateXTextField(SwDoc *pDoc, SwFormatField const *pFormat, SwServiceType nServiceId=SwServiceType::Invalid)
Definition: unofield.cxx:1194
::sw::UnoImplPtr< Impl > m_pImpl
Definition: unofield.hxx:123
static void TransmuteLeadToInputField(SwSetExpField &rField)
Convert between SwSetExpField with InputFlag false and InputFlag true.
Definition: unofield.cxx:1238
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
Definition: unofield.cxx:2102
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unofield.cxx:2576
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getTextFieldMaster() override
Definition: unofield.cxx:1295
virtual void SAL_CALL addVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
Definition: unofield.cxx:2487
virtual ~SwXTextField() override
Definition: unofield.cxx:1189
virtual void SAL_CALL attach(const css::uno::Reference< css::text::XTextRange > &xTextRange) override
Definition: unofield.cxx:1319
virtual void SAL_CALL setPropertyValue(const OUString &rPropertyName, const css::uno::Any &rValue) override
Definition: unofield.cxx:2131
virtual OUString SAL_CALL getImplementationName() override
Definition: unofield.cxx:2552
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() override
Definition: unofield.cxx:2039
const SwDoc & GetDoc() const
Definition: unoobj2.cxx:762
static rtl::Reference< SwXTextRange > CreateXTextRange(SwDoc &rDoc, const SwPosition &rPos, const SwPosition *const pMark)
Definition: unoobj2.cxx:1221
void disposeAndClear(::std::unique_lock<::std::mutex > &rGuard, const css::lang::EventObject &rEvt)
css::uno::Type const & get()
OUString getDataSource() const
rtl::Reference< interface_type > SAL_CALL get() const
#define FN_UNO_ANCHOR_TYPE
Definition: cmdid.h:600
#define FN_UNO_ANCHOR_TYPES
Definition: cmdid.h:593
#define FN_UNO_TEXT_WRAP
Definition: cmdid.h:599
int nCount
virtual void SetValue(tools::Long nNew) override
@ PG_RANDOM
Definition: docufld.hxx:92
@ 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
float u
SwFieldTypesEnum
List of FieldTypes at UI.
Definition: fldbas.hxx:98
@ FF_FIXED
Definition: fldbas.hxx:166
@ FIXEDFLD
Definition: fldbas.hxx:233
@ DATEFLD
Definition: fldbas.hxx:234
@ TIMEFLD
Definition: fldbas.hxx:235
@ INP_USR
Definition: fldbas.hxx:223
@ INP_TXT
Definition: fldbas.hxx:222
SwFieldIds
Definition: fldbas.hxx:49
@ Database
For old documents the Field-Which IDs must be preserved !!!
@ TableOfAuthorities
OUString sName
void Notify(SwFlyFrame *pFly, SwPageFrame *pOld, const SwRect &rOld, const SwRect *pOldRect=nullptr)
Notify the background based on the difference between old and new rectangle.
Definition: frmtool.cxx:3254
constexpr TypedWhichId< SwPtrMsgPoolItem > RES_REMOVE_UNO_OBJECT(181)
constexpr TypedWhichId< SwFormatField > RES_TXTATR_ANNOTATION(60)
constexpr TypedWhichId< SwFormatField > RES_TXTATR_FIELD(RES_TXTATR_NOEND_BEGIN)
constexpr TypedWhichId< SwFormatField > RES_TXTATR_INPUTFIELD(55)
constexpr TypedWhichId< SwPtrMsgPoolItem > RES_OBJECTDYING(RES_FORMAT_MSG_BEGIN)
sal_Int32 nIndex
OUString aName
Sequence< sal_Int8 > aSeq
constexpr OUStringLiteral aData
Definition: ww8scan.hxx:48
sal_Int32 GetEnumAsInt32(const css::uno::Any &rVal)
Definition: swunohelper.cxx:50
OUString setToken(const OUString &rIn, sal_Int32 nToken, sal_Unicode cTok, std::u16string_view rNewToken)
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
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_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
const SwExtendedSubType SUB_CMD
Show command.
Definition: fldbas.hxx:216
const SwExtendedSubType SUB_INVISIBLE
Invisible.
Definition: fldbas.hxx:217
const SwGetSetExpType GSE_EXPR
Expression.
Definition: fldbas.hxx:208
const SwGetSetExpType GSE_FORMULA
Formula.
Definition: fldbas.hxx:210
const SwGetSetExpType GSE_STRING
String.
Definition: fldbas.hxx:207
detail::Optional< bool >::type tryAccess< bool >(css::uno::Any const &any)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
constexpr OUStringLiteral EMPTY
const sal_Unicode cTokenSeparator
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
bool XTextRangeToSwPaM(SwUnoInternalPaM &rToFill, const uno::Reference< text::XTextRange > &xTextRange, ::sw::TextRangeMode const eMode)
Definition: unoobj2.cxx:1108
long Long
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
Definition: nodeoffset.hxx:35
sal_Int16 nId
@ RES_POOLCOLL_LABEL_DRAWING
Label drawing objects.
Definition: poolfmt.hxx:358
@ RES_POOLCOLL_EXTRA_BEGIN
Special ranges.
Definition: poolfmt.hxx:327
@ RES_POOLCOLL_LABEL_FRAME
Label frame.
Definition: poolfmt.hxx:348
@ RES_POOLCOLL_LABEL_FIGURE
Label figure.
Definition: poolfmt.hxx:349
@ RES_POOLCOLL_LABEL_TABLE
Label table.
Definition: poolfmt.hxx:347
@ RES_POOLCOLL_LABEL_ABB
Label illustration.
Definition: poolfmt.hxx:346
@ RES_POOLPAGE_STANDARD
Standard page.
Definition: poolfmt.hxx:170
QPRO_FUNC_TYPE nType
Marks a position in the document model.
Definition: pam.hxx:38
sal_Int32 GetContentIndex() const
Definition: pam.hxx:85
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:168
SetAttrMode
Definition: swtypes.hxx:133
@ FORCEHINTEXPAND
Force hint expand (only matters for hints with CH_TXTATR).
#define INIT_FLDTYPES
Definition: swtypes.hxx:105
#define DB_DELIM
Definition: swtypes.hxx:130
constexpr sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:92
#define SAL_MAX_INT32
unsigned char sal_Bool
signed char sal_Int8
ResultType type
SwServiceType
entries in this enum are mapped in an array in unocoll.cxx
Definition: unocoll.hxx:63
@ FieldTypeConditionedText
@ FieldTypeGraphicObjectCount
@ FieldTypeDocInfoRevision
@ FieldTypeDatabaseNextSet
@ FieldTypeDocInfoPrintAuthor
@ FieldTypeDocInfoCreateDateTime
@ FieldTypeDocInfoKeywords
@ FieldTypeDocInfoDescription
@ FieldTypeDocInfoChangeAuthor
@ FieldTypeEmbeddedObjectCount
@ FieldTypeDocInfoEditTime
@ FieldTypeCombinedCharacters
@ FieldTypeDocInfoCreateAuthor
@ FieldTypeDocInfoPrintDateTime
@ FieldTypeDocInfoChangeDateTime
static sal_uInt16 lcl_GetPropertyMapOfService(SwServiceType nServiceId)
Definition: unofield.cxx:324
static sal_uInt16 GetFieldTypeMId(std::u16string_view rProperty, const SwFieldType &rTyp)
Definition: unofield.cxx:310
static SwFieldIds lcl_GetIdByName(OUString &rName, OUString &rTypeName)
Definition: unofield.cxx:2670
const sal_uInt16 aDocInfoSubTypeFromService[]
Definition: unofield.cxx:97
static OUString OldNameToNewName_Impl(const OUString &rOld)
Definition: unofield.cxx:2557
static SwFieldIds lcl_ServiceIdToResId(SwServiceType nServiceId)
Definition: unofield.cxx:184
static sal_uInt16 lcl_GetPropMapIdForFieldType(SwFieldIds nWhich)
Definition: unofield.cxx:277
const ServiceIdResId aServiceToRes[]
Definition: unofield.cxx:128
constexpr OUStringLiteral COM_TEXT_FLDMASTER_CC
Definition: unofield.cxx:94
static SwServiceType lcl_GetServiceForField(const SwField &rField)
Definition: unofield.cxx:195
static sal_Int32 lcl_PropName2TokenPos(std::u16string_view rPropertyName)
Definition: unofield.cxx:293
#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_IS_FIELD_DISPLAYED
Definition: unofldmid.h:47
#define FIELD_PROP_STRINGS
Definition: unofldmid.h:42
#define FIELD_PROP_PAR3
Definition: unofldmid.h:25
#define FIELD_PROP_PROP_SEQ
Definition: unofldmid.h:39
#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_BOOL4
Definition: unofldmid.h:41
#define FIELD_PROP_TEXT
Definition: unofldmid.h:49
#define FIELD_PROP_BOOL3
Definition: unofldmid.h:35
#define FIELD_PROP_SHORT1
Definition: unofldmid.h:37
#define FIELD_PROP_PAR1
Definition: unofldmid.h:23
#define FIELD_PROP_PAR4
Definition: unofldmid.h:36
#define FIELD_PROP_IS_FIELD_USED
Definition: unofldmid.h:46
#define FIELD_PROP_BYTE1
Definition: unofldmid.h:33
#define FIELD_PROP_PAR2
Definition: unofldmid.h:24
SwUnoPropertyMapProvider aSwMapProvider
Definition: unomap1.cxx:88
#define PROPERTY_MAP_FLDTYP_GET_EXP
Definition: unomap.hxx:70
#define PROPERTY_MAP_FLDTYP_JUMP_EDIT
Definition: unomap.hxx:88
#define PROPERTY_MAP_FLDTYP_DDE
Definition: unomap.hxx:81
#define PROPERTY_MAP_FLDTYP_DATETIME
Definition: unomap.hxx:67
#define PROPERTY_MAP_FLDTYP_DOC_INFO
Definition: unomap.hxx:83
#define PROPERTY_MAP_FLDMSTR_USER
Definition: unomap.hxx:106
#define PROPERTY_MAP_FLDTYP_TABLE_FORMULA
Definition: unomap.hxx:105
#define PROPERTY_MAP_FLDTYP_SET_EXP
Definition: unomap.hxx:69
#define PROPERTY_MAP_FLDTYP_ANNOTATION
Definition: unomap.hxx:78
#define PROPERTY_MAP_FLDTYP_FILE_NAME
Definition: unomap.hxx:71
#define PROPERTY_MAP_FLDTYP_CHAPTER
Definition: unomap.hxx:74
#define PROPERTY_MAP_FLDTYP_DOCINFO_EDIT_TIME
Definition: unomap.hxx:100
#define PROPERTY_MAP_FLDTYP_DOCINFO_REVISION
Definition: unomap.hxx:102
#define PROPERTY_MAP_FLDTYP_DATABASE_NEXT_SET
Definition: unomap.hxx:90
#define PROPERTY_MAP_FLDTYP_DOCINFO_AUTHOR
Definition: unomap.hxx:96
#define PROPERTY_MAP_FLDTYP_DOCINFO_DATE_TIME
Definition: unomap.hxx:97
#define PROPERTY_MAP_FLDTYP_AUTHOR
Definition: unomap.hxx:73
#define PROPERTY_MAP_FLDTYP_MACRO
Definition: unomap.hxx:80
#define PROPERTY_MAP_FLDTYP_GET_REFERENCE
Definition: unomap.hxx:75
#define PROPERTY_MAP_PARAGRAPH_EXTENSIONS
Definition: unomap.hxx:52
#define PROPERTY_MAP_FLDMSTR_BIBLIOGRAPHY
Definition: unomap.hxx:112
#define PROPERTY_MAP_FLDTYP_COMBINED_CHARACTERS
Definition: unomap.hxx:103
#define PROPERTY_MAP_FLDMSTR_DDE
Definition: unomap.hxx:107
#define PROPERTY_MAP_FLDTYP_DOCSTAT
Definition: unomap.hxx:95
#define PROPERTY_MAP_FLDTYP_USER
Definition: unomap.hxx:68
#define PROPERTY_MAP_FLDTYP_SCRIPT
Definition: unomap.hxx:89
#define PROPERTY_MAP_FLDTYP_DATABASE
Definition: unomap.hxx:93
#define PROPERTY_MAP_FLDTYP_USER_EXT
Definition: unomap.hxx:85
#define PROPERTY_MAP_FLDMSTR_DUMMY0
Definition: unomap.hxx:110
#define PROPERTY_MAP_FLDTYP_REF_PAGE_GET
Definition: unomap.hxx:87
#define PROPERTY_MAP_FLDTYP_INPUT
Definition: unomap.hxx:79
#define PROPERTY_MAP_FLDTYP_HIDDEN_PARA
Definition: unomap.hxx:82
#define PROPERTY_MAP_FLDTYP_REF_PAGE_SET
Definition: unomap.hxx:86
#define PROPERTY_MAP_FLDTYP_DROPDOWN
Definition: unomap.hxx:116
#define PROPERTY_MAP_FLDTYP_DOCINFO_CUSTOM
Definition: unomap.hxx:123
#define PROPERTY_MAP_FLDTYP_DATABASE_NAME
Definition: unomap.hxx:94
#define PROPERTY_MAP_FLDTYP_DATABASE_SET_NUM
Definition: unomap.hxx:92
#define PROPERTY_MAP_FLDTYP_PAGE_NUM
Definition: unomap.hxx:72
#define PROPERTY_MAP_FLDTYP_DATABASE_NUM_SET
Definition: unomap.hxx:91
#define PROPERTY_MAP_FLDMSTR_SET_EXP
Definition: unomap.hxx:108
#define PROPERTY_MAP_FLDTYP_CONDITIONED_TEXT
Definition: unomap.hxx:76
#define PROPERTY_MAP_FLDMSTR_DATABASE
Definition: unomap.hxx:109
#define PROPERTY_MAP_FLDTYP_DOCINFO_MISC
Definition: unomap.hxx:101
#define PROPERTY_MAP_FLDTYP_BIBLIOGRAPHY
Definition: unomap.hxx:111
#define PROPERTY_MAP_FLDTYP_HIDDEN_TEXT
Definition: unomap.hxx:77
#define PROPERTY_MAP_FLDTYP_TEMPLATE_NAME
Definition: unomap.hxx:84
#define PROPERTY_MAP_FLDTYP_DUMMY_0
Definition: unomap.hxx:104
constexpr OUStringLiteral UNO_NAME_DDE_COMMAND_TYPE
Definition: unoprnms.hxx:171
constexpr OUStringLiteral UNO_NAME_DEPENDENT_TEXT_FIELDS
Definition: unoprnms.hxx:505
constexpr OUStringLiteral UNO_NAME_VALUE
Definition: unoprnms.hxx:349
constexpr OUStringLiteral UNO_NAME_DDE_COMMAND_ELEMENT
Definition: unoprnms.hxx:173
constexpr OUStringLiteral UNO_NAME_IS_AUTOMATIC_UPDATE
Definition: unoprnms.hxx:174
constexpr OUStringLiteral UNO_NAME_NAME
Definition: unoprnms.hxx:90
constexpr OUStringLiteral UNO_NAME_DATA_COLUMN_NAME
Definition: unoprnms.hxx:270
constexpr OUStringLiteral UNO_NAME_DATA_TABLE_NAME
Definition: unoprnms.hxx:268
constexpr OUStringLiteral UNO_NAME_DATA_BASE_NAME
Definition: unoprnms.hxx:267
constexpr OUStringLiteral UNO_NAME_CONTENT
Definition: unoprnms.hxx:261
constexpr OUStringLiteral UNO_NAME_DATA_BASE_URL
Definition: unoprnms.hxx:782
constexpr OUStringLiteral UNO_NAME_DDE_COMMAND_FILE
Definition: unoprnms.hxx:172
constexpr OUStringLiteral UNO_NAME_DATA_COMMAND_TYPE
Definition: unoprnms.hxx:269
constexpr OUStringLiteral UNO_NAME_INSTANCE_NAME
Definition: unoprnms.hxx:508
constexpr OUStringLiteral UNO_NAME_NUMBERING_SEPARATOR
Definition: unoprnms.hxx:500
constexpr OUStringLiteral UNO_NAME_IS_EXPRESSION
Definition: unoprnms.hxx:334
constexpr OUStringLiteral UNO_NAME_SUB_TYPE
Definition: unoprnms.hxx:332
constexpr OUStringLiteral UNO_NAME_CHAPTER_NUMBERING_LEVEL
Definition: unoprnms.hxx:499
const SvXMLTokenMapEntry aTypes[]