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 (size_t i=0; i<SAL_N_ELEMENTS(aServiceToRes); ++i)
187 if (aServiceToRes[i].nServiceId == nServiceId)
188 return aServiceToRes[i].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(pDoc->getIDocumentStylePoolAccess().GetPageDescFromPool(RES_POOLPAGE_STANDARD), pDoc, 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 = dynamic_cast<SwXFieldMaster*>(pType->GetXObject().get().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 uno::Reference<beans::XPropertySet> const xRet(
1302 return xRet;
1303}
1304
1305OUString SAL_CALL SwXTextField::getPresentation(sal_Bool bShowCommand)
1306{
1307 SolarMutexGuard aGuard;
1308
1309 SwField const*const pField = m_pImpl->GetField();
1310 if (!pField)
1311 {
1312 throw uno::RuntimeException();
1313 }
1314 return bShowCommand ? pField->GetFieldName() : pField->ExpandField(true, nullptr);
1315}
1316
1318 const uno::Reference< text::XTextRange > & xTextRange)
1319{
1320 SolarMutexGuard aGuard;
1321 if (m_pImpl->IsDescriptor())
1322 {
1323 SwXTextRange* pRange = dynamic_cast<SwXTextRange*>(xTextRange.get());
1324 OTextCursorHelper* pCursor = dynamic_cast<OTextCursorHelper*>(xTextRange.get());
1325
1326 SwDoc* pDoc = pRange ? &pRange->GetDoc() : pCursor ? pCursor->GetDoc() : nullptr;
1327 // if a FieldMaster was attached, then the document is already fixed!
1328 // NOTE: sw.SwXAutoTextEntry unoapi test depends on m_pDoc = 0 being valid
1329 if (!pDoc || (m_pImpl->m_pDoc && m_pImpl->m_pDoc != pDoc))
1330 throw lang::IllegalArgumentException();
1331
1332 SwUnoInternalPaM aPam(*pDoc);
1333 // this now needs to return TRUE
1334 ::sw::XTextRangeToSwPaM(aPam, xTextRange);
1335 std::unique_ptr<SwField> xField;
1336 switch (m_pImpl->m_nServiceId)
1337 {
1339 {
1341
1342 DateTime aDateTime( DateTime::EMPTY );
1343 if (m_pImpl->m_pProps->pDateTime)
1344 {
1345 aDateTime = *(m_pImpl->m_pProps->pDateTime);
1346 }
1347
1348 sal_uInt32 nImportedId = 0;
1349 if (!m_pImpl->m_pProps->sPar6.isEmpty())
1350 nImportedId = m_pImpl->m_pProps->sPar6.toInt32(16);
1351 sal_uInt32 nParentId = 0;
1352 if (!m_pImpl->m_pProps->sPar5.isEmpty())
1353 nParentId = m_pImpl->m_pProps->sPar5.toInt32(16);
1354
1355 SwPostItField* pPostItField = new SwPostItField(
1356 static_cast<SwPostItFieldType*>(pFieldType),
1357 m_pImpl->m_pProps->sPar1, // author
1358 m_pImpl->m_pProps->sPar2, // content
1359 m_pImpl->m_pProps->sPar3, // author's initials
1360 m_pImpl->m_pProps->sPar4, // name
1361 aDateTime,
1362 m_pImpl->m_pProps->bBool1, // resolvedflag
1363 0, // id
1364 nParentId, // parent id
1365 nImportedId // imported para id
1366 );
1367 if ( m_pImpl->m_xTextObject.is() )
1368 {
1369 pPostItField->SetTextObject( m_pImpl->m_xTextObject->CreateText() );
1370 pPostItField->SetPar2(m_pImpl->m_xTextObject->GetText());
1371 }
1372 xField.reset(pPostItField);
1373 }
1374 break;
1376 {
1378 xField.reset(new SwScriptField(static_cast<SwScriptFieldType*>(pFieldType),
1379 m_pImpl->m_pProps->sPar1, m_pImpl->m_pProps->sPar2,
1380 m_pImpl->m_pProps->bBool1));
1381 }
1382 break;
1384 {
1385 sal_uInt16 nSub = 0;
1386 if (m_pImpl->m_pProps->bBool1)
1387 nSub |= FIXEDFLD;
1388 if (m_pImpl->m_pProps->bBool2)
1389 nSub |= DATEFLD;
1390 else
1391 nSub |= TIMEFLD;
1393 SwDateTimeField *const pDTField = new SwDateTimeField(
1394 static_cast<SwDateTimeFieldType*>(pFieldType),
1395 nSub, m_pImpl->m_pProps->nFormat);
1396 xField.reset(pDTField);
1397 if (m_pImpl->m_pProps->fDouble > 0.)
1398 {
1399 pDTField->SetValue(m_pImpl->m_pProps->fDouble);
1400 }
1401 if (m_pImpl->m_pProps->pDateTime)
1402 {
1403 uno::Any aVal; aVal <<= *m_pImpl->m_pProps->pDateTime;
1404 xField->PutValue( aVal, FIELD_PROP_DATE_TIME );
1405 }
1406 pDTField->SetOffset(m_pImpl->m_pProps->nSubType);
1407 }
1408 break;
1410 {
1412 sal_Int32 nFormat = m_pImpl->m_pProps->nFormat;
1413 if (m_pImpl->m_pProps->bBool2)
1414 nFormat |= FF_FIXED;
1415 SwFileNameField *const pFNField = new SwFileNameField(
1416 static_cast<SwFileNameFieldType*>(pFieldType), nFormat);
1417 xField.reset(pFNField);
1418 if (!m_pImpl->m_pProps->sPar3.isEmpty())
1419 pFNField->SetExpansion(m_pImpl->m_pProps->sPar3);
1420 uno::Any aFormat;
1421 aFormat <<= m_pImpl->m_pProps->nFormat;
1422 xField->PutValue( aFormat, FIELD_PROP_FORMAT );
1423 }
1424 break;
1426 {
1428 xField.reset(new SwTemplNameField(static_cast<SwTemplNameFieldType*>(pFieldType),
1429 m_pImpl->m_pProps->nFormat));
1430 uno::Any aFormat;
1431 aFormat <<= m_pImpl->m_pProps->nFormat;
1432 xField->PutValue(aFormat, FIELD_PROP_FORMAT);
1433 }
1434 break;
1436 {
1438 SwChapterField *const pChapterField = new SwChapterField(
1439 static_cast<SwChapterFieldType*>(pFieldType),
1440 m_pImpl->m_pProps->nUSHORT1);
1441 xField.reset(pChapterField);
1442 pChapterField->SetLevel(m_pImpl->m_pProps->nByte1);
1443 uno::Any aVal;
1444 aVal <<= static_cast<sal_Int16>(m_pImpl->m_pProps->nUSHORT1);
1445 xField->PutValue(aVal, FIELD_PROP_USHORT1 );
1446 }
1447 break;
1449 {
1450 tools::Long nFormat = m_pImpl->m_pProps->bBool1 ? AF_NAME : AF_SHORTCUT;
1451 if (m_pImpl->m_pProps->bBool2)
1452 nFormat |= AF_FIXED;
1453
1455 SwAuthorField *const pAuthorField = new SwAuthorField(
1456 static_cast<SwAuthorFieldType*>(pFieldType), nFormat);
1457 xField.reset(pAuthorField);
1458 pAuthorField->SetExpansion(m_pImpl->m_pProps->sPar1);
1459 }
1460 break;
1463 {
1465 SwHiddenTextField *const pHTField = new SwHiddenTextField(
1466 static_cast<SwHiddenTextFieldType*>(pFieldType),
1467 m_pImpl->m_pProps->sPar1,
1468 m_pImpl->m_pProps->sPar2, m_pImpl->m_pProps->sPar3,
1471 xField.reset(pHTField);
1472 pHTField->SetValue(m_pImpl->m_pProps->bBool1);
1473 uno::Any aVal;
1474 aVal <<= m_pImpl->m_pProps->sPar4;
1475 xField->PutValue(aVal, FIELD_PROP_PAR4 );
1476 }
1477 break;
1479 {
1481 SwHiddenParaField *const pHPField = new SwHiddenParaField(
1482 static_cast<SwHiddenParaFieldType*>(pFieldType),
1483 m_pImpl->m_pProps->sPar1);
1484 xField.reset(pHPField);
1485 pHPField->SetHidden(m_pImpl->m_pProps->bBool1);
1486 }
1487 break;
1489 {
1491 xField.reset(new SwGetRefField(static_cast<SwGetRefFieldType*>(pFieldType),
1492 m_pImpl->m_pProps->sPar1,
1493 m_pImpl->m_pProps->sPar4,
1494 0,
1495 0,
1496 0));
1497 if (!m_pImpl->m_pProps->sPar3.isEmpty())
1498 static_cast<SwGetRefField*>(xField.get())->SetExpand(m_pImpl->m_pProps->sPar3);
1499 uno::Any aVal;
1500 aVal <<= static_cast<sal_Int16>(m_pImpl->m_pProps->nUSHORT1);
1501 xField->PutValue(aVal, FIELD_PROP_USHORT1 );
1502 aVal <<= static_cast<sal_Int16>(m_pImpl->m_pProps->nUSHORT2);
1503 xField->PutValue(aVal, FIELD_PROP_USHORT2 );
1504 aVal <<= m_pImpl->m_pProps->nSHORT1;
1505 xField->PutValue(aVal, FIELD_PROP_SHORT1 );
1506 }
1507 break;
1509 {
1511 xField.reset(new SwJumpEditField(static_cast<SwJumpEditFieldType*>(pFieldType),
1512 m_pImpl->m_pProps->nUSHORT1, m_pImpl->m_pProps->sPar2,
1513 m_pImpl->m_pProps->sPar1));
1514 }
1515 break;
1530 {
1532 sal_uInt16 nSubType = aDocInfoSubTypeFromService[
1533 static_cast<sal_uInt16>(m_pImpl->m_nServiceId) - sal_uInt16(SwServiceType::FieldTypeDocInfoChangeAuthor)];
1538 {
1539 if (m_pImpl->m_pProps->bBool2) //IsDate
1540 {
1541 nSubType &= 0xf0ff;
1542 nSubType |= DI_SUB_DATE;
1543 }
1544 else
1545 {
1546 nSubType &= 0xf0ff;
1547 nSubType |= DI_SUB_TIME;
1548 }
1549 }
1550 if (m_pImpl->m_pProps->bBool1)
1551 nSubType |= DI_SUB_FIXED;
1552 xField.reset(new SwDocInfoField(
1553 static_cast<SwDocInfoFieldType*>(pFieldType), nSubType,
1554 m_pImpl->m_pProps->sPar4, m_pImpl->m_pProps->nFormat));
1555 if (!m_pImpl->m_pProps->sPar3.isEmpty())
1556 static_cast<SwDocInfoField*>(xField.get())->SetExpansion(m_pImpl->m_pProps->sPar3);
1557 }
1558 break;
1560 {
1561 sal_Int32 nFormat = 0;
1562 if (m_pImpl->m_pProps->bBool1)
1563 nFormat = AF_FIXED;
1564
1566 SwExtUserField *const pEUField = new SwExtUserField(
1567 static_cast<SwExtUserFieldType*>(pFieldType),
1568 m_pImpl->m_pProps->nUSHORT1, nFormat);
1569 xField.reset(pEUField);
1570 pEUField->SetExpansion(m_pImpl->m_pProps->sPar1);
1571 }
1572 break;
1574 {
1575 SwFieldType* pFieldType =
1577 if (!pFieldType)
1578 throw uno::RuntimeException();
1579 sal_uInt16 nUserSubType = (m_pImpl->m_pProps->bBool1)
1581 if (m_pImpl->m_pProps->bBool2)
1582 nUserSubType |= nsSwExtendedSubType::SUB_CMD;
1583 if (m_pImpl->m_pProps->bFormatIsDefault &&
1584 nsSwGetSetExpType::GSE_STRING == static_cast<SwUserFieldType*>(pFieldType)->GetType())
1585 {
1586 m_pImpl->m_pProps->nFormat = -1;
1587 }
1588 xField.reset(new SwUserField(static_cast<SwUserFieldType*>(pFieldType),
1589 nUserSubType,
1590 m_pImpl->m_pProps->nFormat));
1591 }
1592 break;
1594 {
1596 xField.reset(new SwRefPageSetField( static_cast<SwRefPageSetFieldType*>(pFieldType),
1597 m_pImpl->m_pProps->nUSHORT1,
1598 m_pImpl->m_pProps->bBool1 ));
1599 }
1600 break;
1602 {
1604 SwRefPageGetField *const pRGField = new SwRefPageGetField(
1605 static_cast<SwRefPageGetFieldType*>(pFieldType),
1606 m_pImpl->m_pProps->nUSHORT1 );
1607 xField.reset(pRGField);
1608 pRGField->SetText(m_pImpl->m_pProps->sPar1, nullptr);
1609 }
1610 break;
1612 {
1614 SwPageNumberField *const pPNField = new SwPageNumberField(
1615 static_cast<SwPageNumberFieldType*>(pFieldType), PG_RANDOM,
1616 m_pImpl->m_pProps->nFormat,
1617 m_pImpl->m_pProps->nUSHORT1);
1618 xField.reset(pPNField);
1619 pPNField->SetUserString(m_pImpl->m_pProps->sPar1);
1620 uno::Any aVal;
1621 aVal <<= m_pImpl->m_pProps->nSubType;
1622 xField->PutValue( aVal, FIELD_PROP_SUBTYPE );
1623 }
1624 break;
1626 {
1627 SwFieldType* pFieldType =
1628 pDoc->getIDocumentFieldsAccess().GetFieldType(SwFieldIds::Dde, m_pImpl->m_sTypeName, true);
1629 if (!pFieldType)
1630 throw uno::RuntimeException();
1631 xField.reset(new SwDDEField( static_cast<SwDDEFieldType*>(pFieldType) ));
1632 }
1633 break;
1635 {
1638 aData.sDataSource = m_pImpl->m_pProps->sPar1;
1639 aData.sCommand = m_pImpl->m_pProps->sPar2;
1640 aData.nCommandType = m_pImpl->m_pProps->nSHORT1;
1641 xField.reset(new SwDBNameField(static_cast<SwDBNameFieldType*>(pFieldType), aData));
1642 sal_uInt16 nSubType = xField->GetSubType();
1643 if (m_pImpl->m_pProps->bBool2)
1645 else
1647 xField->SetSubType(nSubType);
1648 }
1649 break;
1651 {
1653 aData.sDataSource = m_pImpl->m_pProps->sPar1;
1654 aData.sCommand = m_pImpl->m_pProps->sPar2;
1655 aData.nCommandType = m_pImpl->m_pProps->nSHORT1;
1657 xField.reset(new SwDBNextSetField(static_cast<SwDBNextSetFieldType*>(pFieldType),
1658 m_pImpl->m_pProps->sPar3, aData));
1659 }
1660 break;
1662 {
1664 aData.sDataSource = m_pImpl->m_pProps->sPar1;
1665 aData.sCommand = m_pImpl->m_pProps->sPar2;
1666 aData.nCommandType = m_pImpl->m_pProps->nSHORT1;
1667 xField.reset(new SwDBNumSetField( static_cast<SwDBNumSetFieldType*>(
1669 m_pImpl->m_pProps->sPar3,
1670 OUString::number(m_pImpl->m_pProps->nFormat),
1671 aData ));
1672 }
1673 break;
1675 {
1677 aData.sDataSource = m_pImpl->m_pProps->sPar1;
1678 aData.sCommand = m_pImpl->m_pProps->sPar2;
1679 aData.nCommandType = m_pImpl->m_pProps->nSHORT1;
1680 SwDBSetNumberField *const pDBSNField =
1683 m_pImpl->m_pProps->nUSHORT1);
1684 xField.reset(pDBSNField);
1685 pDBSNField->SetSetNumber(m_pImpl->m_pProps->nFormat);
1686 sal_uInt16 nSubType = xField->GetSubType();
1687 if (m_pImpl->m_pProps->bBool2)
1689 else
1691 xField->SetSubType(nSubType);
1692 }
1693 break;
1695 {
1696 SwFieldType* pFieldType =
1698 if (!pFieldType)
1699 throw uno::RuntimeException();
1700 xField.reset(new SwDBField(static_cast<SwDBFieldType*>(pFieldType),
1701 m_pImpl->m_pProps->nFormat));
1702 static_cast<SwDBField*>(xField.get())->InitContent(m_pImpl->m_pProps->sPar1);
1703 sal_uInt16 nSubType = xField->GetSubType();
1704 if (m_pImpl->m_pProps->bBool2)
1706 else
1708 xField->SetSubType(nSubType);
1709 }
1710 break;
1712 {
1713 SwFieldType* pFieldType =
1715 if (!pFieldType)
1716 throw uno::RuntimeException();
1717 // detect the field type's sub type and set an appropriate number format
1718 if (m_pImpl->m_pProps->bFormatIsDefault &&
1719 nsSwGetSetExpType::GSE_STRING == static_cast<SwSetExpFieldType*>(pFieldType)->GetType())
1720 {
1721 m_pImpl->m_pProps->nFormat = -1;
1722 }
1723 SwSetExpField *const pSEField = new SwSetExpField(
1724 static_cast<SwSetExpFieldType*>(pFieldType),
1725 m_pImpl->m_pProps->sPar2,
1726 m_pImpl->m_pProps->nUSHORT2 != USHRT_MAX ? //#i79471# the field can have a number format or a number_ing_ format
1727 m_pImpl->m_pProps->nUSHORT2 : m_pImpl->m_pProps->nFormat);
1728 xField.reset(pSEField);
1729
1730 sal_uInt16 nSubType = xField->GetSubType();
1731 if (m_pImpl->m_pProps->bBool2)
1733 else
1735 if (m_pImpl->m_pProps->bBool3)
1736 nSubType |= nsSwExtendedSubType::SUB_CMD;
1737 else
1739 xField->SetSubType(nSubType);
1740 pSEField->SetSeqNumber(m_pImpl->m_pProps->nUSHORT1);
1741 pSEField->SetInputFlag(m_pImpl->m_pProps->bBool1);
1742 pSEField->SetPromptText(m_pImpl->m_pProps->sPar3);
1743 if (!m_pImpl->m_pProps->sPar4.isEmpty())
1744 pSEField->ChgExpStr(m_pImpl->m_pProps->sPar4, nullptr);
1745
1746 }
1747 break;
1749 {
1750 sal_uInt16 nSubType;
1751 switch (m_pImpl->m_pProps->nSubType)
1752 {
1753 case text::SetVariableType::STRING: nSubType = nsSwGetSetExpType::GSE_STRING; break;
1754 case text::SetVariableType::VAR: nSubType = nsSwGetSetExpType::GSE_EXPR; break;
1755 //case text::SetVariableType::SEQUENCE: nSubType = nsSwGetSetExpType::GSE_SEQ; break;
1756 case text::SetVariableType::FORMULA: nSubType = nsSwGetSetExpType::GSE_FORMULA; break;
1757 default:
1758 OSL_FAIL("wrong value");
1759 nSubType = nsSwGetSetExpType::GSE_EXPR;
1760 }
1761 //make sure the SubType matches the field type
1762 SwFieldType* pSetExpField = pDoc->getIDocumentFieldsAccess().GetFieldType(
1763 SwFieldIds::SetExp, m_pImpl->m_pProps->sPar1, false);
1764 bool bSetGetExpFieldUninitialized = false;
1765 if (pSetExpField)
1766 {
1767 if (nSubType != nsSwGetSetExpType::GSE_STRING &&
1768 static_cast< SwSetExpFieldType* >(pSetExpField)->GetType() == nsSwGetSetExpType::GSE_STRING)
1770 }
1771 else
1772 bSetGetExpFieldUninitialized = true; // #i82544#
1773
1774 if (m_pImpl->m_pProps->bBool2)
1775 nSubType |= nsSwExtendedSubType::SUB_CMD;
1776 else
1778 SwGetExpField *const pGEField = new SwGetExpField(
1779 static_cast<SwGetExpFieldType*>(
1781 m_pImpl->m_pProps->sPar1, nSubType,
1782 m_pImpl->m_pProps->nFormat);
1783 xField.reset(pGEField);
1784 //TODO: evaluate SubType!
1785 if (!m_pImpl->m_pProps->sPar4.isEmpty())
1786 pGEField->ChgExpStr(m_pImpl->m_pProps->sPar4, nullptr);
1787 // #i82544#
1788 if (bSetGetExpFieldUninitialized)
1789 pGEField->SetLateInitialization();
1790 }
1791 break;
1794 {
1795 SwFieldType* pFieldType =
1797 if (!pFieldType)
1798 throw uno::RuntimeException();
1799 sal_uInt16 nInpSubType =
1800 sal::static_int_cast<sal_uInt16>(
1802 ? INP_USR : INP_TXT);
1803 SwInputField * pTextField =
1804 new SwInputField(static_cast<SwInputFieldType*>(pFieldType),
1805 m_pImpl->m_pProps->sPar1,
1806 m_pImpl->m_pProps->sPar2,
1807 nInpSubType);
1808 pTextField->SetHelp(m_pImpl->m_pProps->sPar3);
1809 pTextField->SetToolTip(m_pImpl->m_pProps->sPar4);
1810
1811 xField.reset(pTextField);
1812 }
1813 break;
1815 {
1817 OUString aName;
1818
1819 // support for Scripting Framework macros
1820 if (!m_pImpl->m_pProps->sPar4.isEmpty())
1821 {
1822 aName = m_pImpl->m_pProps->sPar4;
1823 }
1824 else
1825 {
1827 m_pImpl->m_pProps->sPar1, m_pImpl->m_pProps->sPar3);
1828 }
1829 xField.reset(new SwMacroField(static_cast<SwMacroFieldType*>(pFieldType), aName,
1830 m_pImpl->m_pProps->sPar2));
1831 }
1832 break;
1840 {
1841 sal_uInt16 nSubType = DS_PAGE;
1842 switch (m_pImpl->m_nServiceId)
1843 {
1844 case SwServiceType::FieldTypeParagraphCount : nSubType = DS_PARA; break;
1845 case SwServiceType::FieldTypeWordCount : nSubType = DS_WORD; break;
1846 case SwServiceType::FieldTypeCharacterCount : nSubType = DS_CHAR; break;
1847 case SwServiceType::FieldTypeTableCount : nSubType = DS_TBL; break;
1848 case SwServiceType::FieldTypeGraphicObjectCount : nSubType = DS_GRF; break;
1849 case SwServiceType::FieldTypeEmbeddedObjectCount : nSubType = DS_OLE; break;
1850 default: break;
1851 }
1853 xField.reset(new SwDocStatField(
1854 static_cast<SwDocStatFieldType*>(pFieldType),
1855 nSubType, m_pImpl->m_pProps->nUSHORT2));
1856 }
1857 break;
1859 {
1860 SwAuthorityFieldType const type(pDoc);
1861 xField.reset(new SwAuthorityField(static_cast<SwAuthorityFieldType*>(
1863 u""));
1864 if (m_pImpl->m_pProps->aPropSeq.hasElements())
1865 {
1866 uno::Any aVal;
1867 aVal <<= m_pImpl->m_pProps->aPropSeq;
1868 xField->PutValue( aVal, FIELD_PROP_PROP_SEQ );
1869 }
1870 }
1871 break;
1873 // create field
1874 xField.reset(new SwCombinedCharField( static_cast<SwCombinedCharFieldType*>(
1876 m_pImpl->m_pProps->sPar1));
1877 break;
1879 {
1880 SwDropDownField *const pDDField = new SwDropDownField(
1881 static_cast<SwDropDownFieldType *>(
1883 xField.reset(pDDField);
1884
1885 pDDField->SetItems(m_pImpl->m_pProps->aStrings);
1886 pDDField->SetSelectedItem(m_pImpl->m_pProps->sPar1);
1887 pDDField->SetName(m_pImpl->m_pProps->sPar2);
1888 pDDField->SetHelp(m_pImpl->m_pProps->sPar3);
1889 pDDField->SetToolTip(m_pImpl->m_pProps->sPar4);
1890 }
1891 break;
1892
1894 {
1895 // create field
1897 if (m_pImpl->m_pProps->bBool1)
1898 {
1900 if (m_pImpl->m_pProps->bFormatIsDefault)
1901 m_pImpl->m_pProps->nFormat = -1;
1902 }
1903 xField.reset(new SwTableField( static_cast<SwTableFieldType*>(
1905 m_pImpl->m_pProps->sPar2,
1906 nType,
1907 m_pImpl->m_pProps->nFormat));
1908 static_cast<SwTableField*>(xField.get())->ChgExpStr(m_pImpl->m_pProps->sPar1);
1909 }
1910 break;
1911 default: OSL_FAIL("What kind of type is that?");
1912 }
1913
1914 if (!xField)
1915 throw uno::RuntimeException("no SwField created?");
1916
1917 xField->SetAutomaticLanguage(!m_pImpl->m_pProps->bBool4);
1918 SwFormatField aFormat(*xField);
1919
1920 UnoActionContext aCont(pDoc);
1921 if (aPam.HasMark() &&
1923 {
1925 }
1926
1927 SwXTextCursor const*const pTextCursor(dynamic_cast<SwXTextCursor*>(pCursor));
1928 const bool bForceExpandHints(
1929 pTextCursor
1930 && pTextCursor->IsAtEndOfMeta() );
1931 const SetAttrMode nInsertFlags =
1932 bForceExpandHints
1935
1936 if (*aPam.GetPoint() != *aPam.GetMark() &&
1938 {
1939 // Make sure we always insert the field at the end
1940 SwPaM aEnd(*aPam.End(), *aPam.End());
1941 pDoc->getIDocumentContentOperations().InsertPoolItem(aEnd, aFormat, nInsertFlags);
1942 }
1943 else
1944 pDoc->getIDocumentContentOperations().InsertPoolItem(aPam, aFormat, nInsertFlags);
1945
1947
1948 // What about updating the fields? (see fldmgr.cxx)
1949 if (!pTextAttr)
1950 throw uno::RuntimeException("no SwTextAttr inserted?"); // could theoretically happen, if paragraph is full
1951
1952 m_pImpl->ClearFieldType();
1953 const SwFormatField& rField = pTextAttr->GetFormatField();
1954 m_pImpl->SetFormatField(const_cast<SwFormatField*>(&rField), pDoc);
1955
1956 if ( pTextAttr->Which() == RES_TXTATR_ANNOTATION
1957 && *aPam.GetPoint() != *aPam.GetMark() )
1958 {
1959 // create annotation mark
1960 const SwPostItField* pPostItField = dynamic_cast< const SwPostItField* >(pTextAttr->GetFormatField().GetField());
1961 OSL_ENSURE( pPostItField != nullptr, "<SwXTextField::attachToRange(..)> - annotation field missing!" );
1962 if ( pPostItField != nullptr )
1963 {
1964 IDocumentMarkAccess* pMarksAccess = pDoc->getIDocumentMarkAccess();
1965 pMarksAccess->makeAnnotationMark( aPam, pPostItField->GetName() );
1966 }
1967 }
1968
1969 xField.reset();
1970
1971 assert(m_pImpl->GetFormatField());
1972 m_pImpl->m_pDoc = pDoc;
1973 m_pImpl->GetFormatField()->SetXTextField(this);
1974 m_pImpl->m_wThis = this;
1975 m_pImpl->m_bIsDescriptor = false;
1976 m_pImpl->m_pProps.reset();
1977 if (m_pImpl->m_bCallUpdate)
1978 update();
1979 }
1980 else if ( !m_pImpl->IsDescriptor()
1981 && m_pImpl->m_pDoc != nullptr
1982 && m_pImpl->m_nServiceId == SwServiceType::FieldTypeAnnotation )
1983 {
1984 SwDoc* pDoc = m_pImpl->m_pDoc;
1985 SwUnoInternalPaM aIntPam( *pDoc );
1986 if ( !::sw::XTextRangeToSwPaM( aIntPam, xTextRange ) )
1987 throw lang::IllegalArgumentException();
1988
1989 // Nothing to do, if the text range has a separate start and end, but they have the same
1990 // value.
1991 if (!aIntPam.HasMark() || *aIntPam.Start() != *aIntPam.End())
1992 {
1993 UnoActionContext aCont( pDoc );
1994 // insert copy of annotation at new text range
1995 std::unique_ptr<SwPostItField> pPostItField(static_cast< SwPostItField* >(m_pImpl->GetFormatField()->GetField()->CopyField().release()));
1996 SwFormatField aFormatField( *pPostItField );
1997 pPostItField.reset();
1998 SwPaM aEnd( *aIntPam.End(), *aIntPam.End() );
1999 pDoc->getIDocumentContentOperations().InsertPoolItem( aEnd, aFormatField );
2000 // delete former annotation
2001 {
2002 const SwTextField* pTextField = m_pImpl->GetFormatField()->GetTextField();
2003 SwTextNode& rTextNode = *pTextField->GetpTextNode();
2004 SwPaM aPam( rTextNode, pTextField->GetStart() );
2005 aPam.SetMark();
2006 aPam.Move();
2008 }
2009 // keep inserted annotation
2010 {
2012 if ( pTextAttr != nullptr )
2013 {
2014 m_pImpl->SetFormatField(const_cast<SwFormatField*>(&pTextAttr->GetFormatField()), pDoc);
2015
2016 if ( *aIntPam.GetPoint() != *aIntPam.GetMark() )
2017 {
2018 // create annotation mark
2019 const SwPostItField* pField = dynamic_cast< const SwPostItField* >(pTextAttr->GetFormatField().GetField());
2020 OSL_ENSURE( pField != nullptr, "<SwXTextField::attach(..)> - annotation field missing!" );
2021 if ( pField != nullptr )
2022 {
2023 IDocumentMarkAccess* pMarksAccess = aIntPam.GetDoc().getIDocumentMarkAccess();
2024 pMarksAccess->makeAnnotationMark( aIntPam, pField->GetName() );
2025 }
2026 }
2027 }
2028 }
2029 }
2030
2031 }
2032 else
2033 throw lang::IllegalArgumentException();
2034}
2035
2036uno::Reference< text::XTextRange > SAL_CALL
2038{
2039 SolarMutexGuard aGuard;
2040
2041 SwField const*const pField = m_pImpl->GetField();
2042 if (!pField)
2043 return nullptr;
2044
2045 const SwTextField* pTextField = m_pImpl->GetFormatField()->GetTextField();
2046 if (!pTextField)
2047 throw uno::RuntimeException();
2048
2049 std::shared_ptr< SwPaM > pPamForTextField;
2050 SwTextField::GetPamForTextField(*pTextField, pPamForTextField);
2051 if (pPamForTextField == nullptr)
2052 return nullptr;
2053
2054 // If this is a postit field, then return the range of its annotation mark if it has one.
2055 if (pField->Which() == SwFieldIds::Postit)
2056 {
2057 const SwPostItField* pPostItField = static_cast<const SwPostItField*>(pField);
2058 IDocumentMarkAccess* pMarkAccess = m_pImpl->m_pDoc->getIDocumentMarkAccess();
2059 for (IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getAnnotationMarksBegin(); ppMark != pMarkAccess->getAnnotationMarksEnd(); ++ppMark)
2060 {
2061 if ((*ppMark)->GetName() == pPostItField->GetName())
2062 {
2063 pPamForTextField = std::make_shared<SwPaM>((*ppMark)->GetMarkStart(), (*ppMark)->GetMarkEnd());
2064 break;
2065 }
2066 }
2067 }
2068
2070 *m_pImpl->m_pDoc, *(pPamForTextField->GetPoint()), pPamForTextField->GetMark());
2071 return xRange;
2072}
2073
2075{
2076 SolarMutexGuard aGuard;
2077 SwField const*const pField = m_pImpl->GetField();
2078 if(pField && m_pImpl->m_pDoc)
2079 {
2080 UnoActionContext aContext(m_pImpl->m_pDoc);
2081 assert(m_pImpl->GetFormatField()->GetTextField() && "<SwXTextField::dispose()> - missing <SwTextField> --> crash");
2082 SwTextField::DeleteTextField(*(m_pImpl->GetFormatField()->GetTextField()));
2083 }
2084
2085 if (m_pImpl->m_xTextObject.is())
2086 {
2087 m_pImpl->m_xTextObject->DisposeEditSource();
2088 m_pImpl->m_xTextObject.clear();
2089 }
2090 m_pImpl->Invalidate();
2091}
2092
2094 const uno::Reference<lang::XEventListener> & xListener)
2095{
2096 std::unique_lock aGuard(m_pImpl->m_Mutex);
2097 m_pImpl->m_EventListeners.addInterface(aGuard, xListener);
2098}
2099
2101 const uno::Reference<lang::XEventListener> & xListener)
2102{
2103 std::unique_lock aGuard(m_pImpl->m_Mutex);
2104 m_pImpl->m_EventListeners.removeInterface(aGuard, xListener);
2105}
2106
2107uno::Reference< beans::XPropertySetInfo > SAL_CALL
2109{
2110 SolarMutexGuard aGuard;
2111 // no static
2112 uno::Reference< beans::XPropertySetInfo > aRef;
2113 if (m_pImpl->m_nServiceId == SwServiceType::Invalid)
2114 {
2115 throw uno::RuntimeException();
2116 }
2118 lcl_GetPropertyMapOfService(m_pImpl->m_nServiceId));
2119 const uno::Reference<beans::XPropertySetInfo>& xInfo = pPropSet->getPropertySetInfo();
2120 // extend PropertySetInfo!
2121 const uno::Sequence<beans::Property> aPropSeq = xInfo->getProperties();
2122 aRef = new SfxExtItemPropertySetInfo(
2124 aPropSeq );
2125 return aRef;
2126}
2127
2128void SAL_CALL
2130 const OUString& rPropertyName, const uno::Any& rValue)
2131{
2132 SolarMutexGuard aGuard;
2133 SwField const*const pField = m_pImpl->GetField();
2135 lcl_GetPropertyMapOfService(m_pImpl->m_nServiceId));
2136 const SfxItemPropertyMapEntry* pEntry = _pPropSet->getPropertyMap().getByName(rPropertyName);
2137
2138 if (!pEntry)
2139 throw beans::UnknownPropertyException( "Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
2140 if ( pEntry->nFlags & beans::PropertyAttribute::READONLY)
2141 throw beans::PropertyVetoException( "Property is read-only: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
2142
2143 if(pField)
2144 {
2145 // special treatment for mail merge fields
2146 const SwFieldIds nWhich = pField->Which();
2147 if( SwFieldIds::Database == nWhich &&
2148 (rPropertyName == UNO_NAME_DATA_BASE_NAME ||
2149 rPropertyName == UNO_NAME_DATA_BASE_URL||
2150 rPropertyName == UNO_NAME_DATA_TABLE_NAME||
2151 rPropertyName == UNO_NAME_DATA_COLUMN_NAME))
2152 {
2153 // here a new field type must be created and the field must
2154 // be registered at the new type
2155 OSL_FAIL("not implemented");
2156 }
2157 else
2158 {
2159 SwDoc * pDoc = m_pImpl->m_pDoc;
2160 assert(pDoc);
2161 const SwTextField* pTextField = m_pImpl->GetFormatField()->GetTextField();
2162 if(!pTextField)
2163 throw uno::RuntimeException();
2164 SwPosition aPosition( pTextField->GetTextNode(), pTextField->GetStart() );
2165 pDoc->getIDocumentFieldsAccess().PutValueToField( aPosition, rValue, pEntry->nWID);
2166 }
2167
2168 //#i100374# notify SwPostIt about new field content
2169 assert(m_pImpl->GetFormatField());
2170 if (SwFieldIds::Postit == nWhich)
2171 {
2172 m_pImpl->GetFormatField()->Broadcast(
2174 }
2175
2176 // fdo#42073 notify SwTextField about changes of the expanded string
2177 if (m_pImpl->GetFormatField()->GetTextField())
2178 {
2179 m_pImpl->GetFormatField()->GetTextField()->ExpandTextField();
2180 }
2181
2182 //#i100374# changing a document field should set the modify flag
2183 SwDoc* pDoc = m_pImpl->m_pDoc;
2184 if (pDoc)
2186
2187 }
2188 else if (m_pImpl->m_pProps)
2189 {
2190 bool* pBool = nullptr;
2191 switch(pEntry->nWID)
2192 {
2193 case FIELD_PROP_PAR1:
2194 rValue >>= m_pImpl->m_pProps->sPar1;
2195 break;
2196 case FIELD_PROP_PAR2:
2197 rValue >>= m_pImpl->m_pProps->sPar2;
2198 break;
2199 case FIELD_PROP_PAR3:
2200 rValue >>= m_pImpl->m_pProps->sPar3;
2201 break;
2202 case FIELD_PROP_PAR4:
2203 rValue >>= m_pImpl->m_pProps->sPar4;
2204 break;
2205 case FIELD_PROP_PAR5:
2206 rValue >>= m_pImpl->m_pProps->sPar5;
2207 break;
2208 case FIELD_PROP_PAR6:
2209 rValue >>= m_pImpl->m_pProps->sPar6;
2210 break;
2211 case FIELD_PROP_FORMAT:
2212 rValue >>= m_pImpl->m_pProps->nFormat;
2213 m_pImpl->m_pProps->bFormatIsDefault = false;
2214 break;
2215 case FIELD_PROP_SUBTYPE:
2216 m_pImpl->m_pProps->nSubType = SWUnoHelper::GetEnumAsInt32(rValue);
2217 break;
2218 case FIELD_PROP_BYTE1 :
2219 rValue >>= m_pImpl->m_pProps->nByte1;
2220 break;
2221 case FIELD_PROP_BOOL1 :
2222 pBool = &m_pImpl->m_pProps->bBool1;
2223 break;
2224 case FIELD_PROP_BOOL2 :
2225 pBool = &m_pImpl->m_pProps->bBool2;
2226 break;
2227 case FIELD_PROP_BOOL3 :
2228 pBool = &m_pImpl->m_pProps->bBool3;
2229 break;
2230 case FIELD_PROP_BOOL4:
2231 pBool = &m_pImpl->m_pProps->bBool4;
2232 break;
2233 case FIELD_PROP_DATE :
2234 {
2235 auto aTemp = o3tl::tryAccess<util::Date>(rValue);
2236 if(!aTemp)
2237 throw lang::IllegalArgumentException();
2238
2239 m_pImpl->m_pProps->aDate = Date(aTemp->Day, aTemp->Month, aTemp->Year);
2240 }
2241 break;
2242 case FIELD_PROP_USHORT1:
2243 case FIELD_PROP_USHORT2:
2244 {
2245 sal_Int16 nVal = 0;
2246 rValue >>= nVal;
2247 if( FIELD_PROP_USHORT1 == pEntry->nWID)
2248 m_pImpl->m_pProps->nUSHORT1 = nVal;
2249 else
2250 m_pImpl->m_pProps->nUSHORT2 = nVal;
2251 }
2252 break;
2253 case FIELD_PROP_SHORT1:
2254 rValue >>= m_pImpl->m_pProps->nSHORT1;
2255 break;
2256 case FIELD_PROP_DOUBLE:
2257 if(rValue.getValueType() != ::cppu::UnoType<double>::get())
2258 throw lang::IllegalArgumentException();
2259 rValue >>= m_pImpl->m_pProps->fDouble;
2260 break;
2261
2263 if (!m_pImpl->m_pProps->pDateTime)
2264 m_pImpl->m_pProps->pDateTime.reset( new util::DateTime );
2265 rValue >>= *m_pImpl->m_pProps->pDateTime;
2266 break;
2268 rValue >>= m_pImpl->m_pProps->aPropSeq;
2269 break;
2270 case FIELD_PROP_STRINGS:
2271 rValue >>= m_pImpl->m_pProps->aStrings;
2272 break;
2273 }
2274 if (pBool)
2275 {
2276 auto b = o3tl::tryAccess<bool>(rValue);
2277 if( !b )
2278 throw lang::IllegalArgumentException();
2279 *pBool = *b;
2280
2281 }
2282 }
2283 else
2284 throw uno::RuntimeException();
2285}
2286
2287uno::Any SAL_CALL SwXTextField::getPropertyValue(const OUString& rPropertyName)
2288{
2289 SolarMutexGuard aGuard;
2290 uno::Any aRet;
2291 SwField const*const pField = m_pImpl->GetField();
2293 lcl_GetPropertyMapOfService(m_pImpl->m_nServiceId));
2294 const SfxItemPropertyMapEntry* pEntry = _pPropSet->getPropertyMap().getByName(rPropertyName);
2295 if(!pEntry )
2296 {
2298 pEntry = _pParaPropSet->getPropertyMap().getByName(rPropertyName);
2299 }
2300 if (!pEntry)
2301 throw beans::UnknownPropertyException( "Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
2302
2303 switch( pEntry->nWID )
2304 {
2305 case FN_UNO_TEXT_WRAP:
2306 aRet <<= text::WrapTextMode_NONE;
2307 break;
2308 case FN_UNO_ANCHOR_TYPE:
2309 aRet <<= text::TextContentAnchorType_AS_CHARACTER;
2310 break;
2312 {
2313 uno::Sequence<text::TextContentAnchorType> aTypes { text::TextContentAnchorType_AS_CHARACTER };
2314 aRet <<= aTypes;
2315 }
2316 break;
2317
2318 default:
2319 if( pField )
2320 {
2321 if (FIELD_PROP_IS_FIELD_USED == pEntry->nWID ||
2323 {
2324 bool bIsFieldUsed = false;
2325 bool bIsFieldDisplayed = false;
2326
2327 // in order to have the information about fields
2328 // correctly evaluated the document needs a layout
2329 // (has to be already formatted)
2330 SwDoc *pDoc = m_pImpl->m_pDoc;
2331 SwViewShell *pViewShell = nullptr;
2332 SwEditShell *pEditShell = nullptr;
2333 if( pDoc )
2334 {
2335 pViewShell = pDoc->getIDocumentLayoutAccess().GetCurrentViewShell();
2336 pEditShell = pDoc->GetEditShell();
2337 }
2338
2339 if (pEditShell)
2340 pEditShell->CalcLayout();
2341 else if (pViewShell) // a page preview has no SwEditShell it should only have a view shell
2342 pViewShell->CalcLayout();
2343 else
2344 throw uno::RuntimeException();
2345
2346 // get text node for the text field
2347 const SwFormatField *pFieldFormat =
2348 (m_pImpl->GetField()) ? m_pImpl->GetFormatField() : nullptr;
2349 const SwTextField* pTextField = pFieldFormat
2350 ? m_pImpl->GetFormatField()->GetTextField() : nullptr;
2351 if(!pTextField)
2352 throw uno::RuntimeException();
2353 const SwTextNode& rTextNode = pTextField->GetTextNode();
2354
2355 // skip fields that are currently not in the document
2356 // e.g. fields in undo or redo array
2357 if (rTextNode.GetNodes().IsDocNodes())
2358 {
2359 bool bFrame = 0 != rTextNode.FindLayoutRect().Width(); // or so
2360 bool bHidden = rTextNode.IsHidden();
2361 if ( !bHidden )
2362 {
2363 sal_Int32 nHiddenStart;
2364 sal_Int32 nHiddenEnd;
2365 bHidden = SwScriptInfo::GetBoundsOfHiddenRange( pTextField->GetTextNode(),
2366 pTextField->GetStart(),
2367 nHiddenStart, nHiddenEnd );
2368 }
2369
2370 // !bFrame && !bHidden: most probably a field in an unused page style
2371
2372 // FME: Problem: hidden field in unused page template =>
2373 // bIsFieldUsed = true
2374 // bIsFieldDisplayed = false
2375 bIsFieldUsed = bFrame || bHidden;
2376 bIsFieldDisplayed = bIsFieldUsed && !bHidden;
2377 }
2378 aRet <<= (FIELD_PROP_IS_FIELD_USED == pEntry->nWID) ? bIsFieldUsed : bIsFieldDisplayed;
2379 }
2380 else
2381 pField->QueryValue( aRet, pEntry->nWID );
2382 }
2383 else if (m_pImpl->m_pProps) // currently just a descriptor...
2384 {
2385 switch(pEntry->nWID)
2386 {
2387 case FIELD_PROP_TEXT:
2388 {
2389 if (!m_pImpl->m_xTextObject.is())
2390 {
2391 m_pImpl->m_xTextObject
2392 = new SwTextAPIObject( std::make_unique<SwTextAPIEditSource>(m_pImpl->m_pDoc) );
2393 }
2394
2395 uno::Reference<text::XText> xText(m_pImpl->m_xTextObject);
2396 aRet <<= xText;
2397 break;
2398 }
2399 case FIELD_PROP_PAR1:
2400 aRet <<= m_pImpl->m_pProps->sPar1;
2401 break;
2402 case FIELD_PROP_PAR2:
2403 aRet <<= m_pImpl->m_pProps->sPar2;
2404 break;
2405 case FIELD_PROP_PAR3:
2406 aRet <<= m_pImpl->m_pProps->sPar3;
2407 break;
2408 case FIELD_PROP_PAR4:
2409 aRet <<= m_pImpl->m_pProps->sPar4;
2410 break;
2411 case FIELD_PROP_PAR5:
2412 aRet <<= m_pImpl->m_pProps->sPar5;
2413 break;
2414 case FIELD_PROP_PAR6:
2415 aRet <<= m_pImpl->m_pProps->sPar6;
2416 break;
2417 case FIELD_PROP_FORMAT:
2418 aRet <<= m_pImpl->m_pProps->nFormat;
2419 break;
2420 case FIELD_PROP_SUBTYPE:
2421 aRet <<= m_pImpl->m_pProps->nSubType;
2422 break;
2423 case FIELD_PROP_BYTE1 :
2424 aRet <<= m_pImpl->m_pProps->nByte1;
2425 break;
2426 case FIELD_PROP_BOOL1 :
2427 aRet <<= m_pImpl->m_pProps->bBool1;
2428 break;
2429 case FIELD_PROP_BOOL2 :
2430 aRet <<= m_pImpl->m_pProps->bBool2;
2431 break;
2432 case FIELD_PROP_BOOL3 :
2433 aRet <<= m_pImpl->m_pProps->bBool3;
2434 break;
2435 case FIELD_PROP_BOOL4 :
2436 aRet <<= m_pImpl->m_pProps->bBool4;
2437 break;
2438 case FIELD_PROP_DATE :
2439 aRet <<= m_pImpl->m_pProps->aDate.GetUNODate();
2440 break;
2441 case FIELD_PROP_USHORT1:
2442 aRet <<= static_cast<sal_Int16>(m_pImpl->m_pProps->nUSHORT1);
2443 break;
2444 case FIELD_PROP_USHORT2:
2445 aRet <<= static_cast<sal_Int16>(m_pImpl->m_pProps->nUSHORT2);
2446 break;
2447 case FIELD_PROP_SHORT1:
2448 aRet <<= m_pImpl->m_pProps->nSHORT1;
2449 break;
2450 case FIELD_PROP_DOUBLE:
2451 aRet <<= m_pImpl->m_pProps->fDouble;
2452 break;
2454 if (m_pImpl->m_pProps->pDateTime)
2455 aRet <<= *m_pImpl->m_pProps->pDateTime;
2456 break;
2458 aRet <<= m_pImpl->m_pProps->aPropSeq;
2459 break;
2460 case FIELD_PROP_STRINGS:
2461 aRet <<= m_pImpl->m_pProps->aStrings;
2462 break;
2465 aRet <<= false;
2466 break;
2467 }
2468 }
2469 else
2470 throw uno::RuntimeException();
2471 }
2472 return aRet;
2473}
2474
2475void SwXTextField::addPropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/)
2476{
2477 OSL_FAIL("not implemented");
2478}
2479
2480void SwXTextField::removePropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/)
2481{
2482 OSL_FAIL("not implemented");
2483}
2484
2485void SwXTextField::addVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/)
2486{
2487 OSL_FAIL("not implemented");
2488}
2489
2490void SwXTextField::removeVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/)
2491{
2492 OSL_FAIL("not implemented");
2493}
2494
2496{
2497 SolarMutexGuard aGuard;
2498 SwField * pField = const_cast<SwField*>(m_pImpl->GetField());
2499 if (pField)
2500 {
2501 switch(pField->Which())
2502 {
2504 static_cast<SwDateTimeField*>(pField)->SetDateTime( ::DateTime( ::DateTime::SYSTEM ) );
2505 break;
2506
2508 {
2509 SwExtUserField* pExtUserField = static_cast<SwExtUserField*>(pField);
2511 pExtUserField->GetSubType() ) );
2512 }
2513 break;
2514
2515 case SwFieldIds::Author:
2516 {
2517 SwAuthorField* pAuthorField = static_cast<SwAuthorField*>(pField);
2519 pAuthorField->GetFormat() ) );
2520 }
2521 break;
2522
2524 {
2525 SwFileNameField* pFileNameField = static_cast<SwFileNameField*>(pField);
2526 pFileNameField->SetExpansion( static_cast<SwFileNameFieldType*>(pField->GetTyp())->Expand(
2527 pFileNameField->GetFormat() ) );
2528 }
2529 break;
2530
2532 {
2533 SwDocInfoField* pDocInfField = static_cast<SwDocInfoField*>(pField);
2534 pDocInfField->SetExpansion( static_cast<SwDocInfoFieldType*>(pField->GetTyp())->Expand(
2535 pDocInfField->GetSubType(),
2536 pDocInfField->GetFormat(),
2537 pDocInfField->GetLanguage(),
2538 pDocInfField->GetName() ) );
2539 }
2540 break;
2541 default: break;
2542 }
2543 // Text formatting has to be triggered.
2544 m_pImpl->GetFormatField()->UpdateTextNode(nullptr, nullptr);
2545 }
2546 else
2547 m_pImpl->m_bCallUpdate = true;
2548}
2549
2551{
2552 return "SwXTextField";
2553}
2554
2555static OUString OldNameToNewName_Impl( const OUString &rOld )
2556{
2557 static const char aOldNamePart1[] = ".TextField.DocInfo.";
2558 static const char aOldNamePart2[] = ".TextField.";
2559 OUString sServiceNameCC( rOld );
2560 sal_Int32 nIdx = sServiceNameCC.indexOf( aOldNamePart1 );
2561 if (nIdx >= 0)
2562 sServiceNameCC = sServiceNameCC.replaceAt( nIdx, strlen(aOldNamePart1), u".textfield.docinfo." );
2563 nIdx = sServiceNameCC.indexOf( aOldNamePart2 );
2564 if (nIdx >= 0)
2565 sServiceNameCC = sServiceNameCC.replaceAt( nIdx, strlen(aOldNamePart2), u".textfield." );
2566 return sServiceNameCC;
2567}
2568
2569sal_Bool SAL_CALL SwXTextField::supportsService(const OUString& rServiceName)
2570{
2571 return cppu::supportsService(this, rServiceName);
2572}
2573
2574uno::Sequence< OUString > SAL_CALL SwXTextField::getSupportedServiceNames()
2575{
2576 const OUString sServiceName =
2578
2579 // case-corrected version of service-name (see #i67811)
2580 // (need to supply both because of compatibility to older versions)
2581 const OUString sServiceNameCC( OldNameToNewName_Impl( sServiceName ) );
2582 sal_Int32 nLen = sServiceName == sServiceNameCC ? 2 : 3;
2583
2584 uno::Sequence< OUString > aRet( nLen );
2585 OUString* pArray = aRet.getArray();
2586 *pArray++ = sServiceName;
2587 if (nLen == 3)
2588 *pArray++ = sServiceNameCC;
2589 *pArray++ = "com.sun.star.text.TextContent";
2590 return aRet;
2591}
2592
2594{
2596 m_pFormatField = nullptr;
2597 m_pDoc = nullptr;
2598 uno::Reference<uno::XInterface> const xThis(m_wThis);
2599 if (!xThis.is())
2600 { // fdo#72695: if UNO object is already dead, don't revive it with event
2601 return;
2602 }
2603 lang::EventObject const ev(xThis);
2604 std::unique_lock aGuard(m_Mutex);
2606}
2607
2609{
2610
2611 if(rHint.GetId() == SfxHintId::Dying)
2612 Invalidate();
2613 else if (rHint.GetId() == SfxHintId::SwLegacyModify)
2614 {
2615 auto pLegacyHint = static_cast<const sw::LegacyModifyHint*>(&rHint);
2616 switch(pLegacyHint->m_pOld ? pLegacyHint->m_pOld->Which() : 0)
2617 {
2619 case RES_OBJECTDYING:
2620 Invalidate();
2621 break;
2622 }
2623 }
2624}
2625
2627{
2628 return m_pFormatField ? m_pFormatField->GetField() : nullptr;
2629}
2630
2632{
2633 return "SwXTextFieldMasters";
2634}
2635
2637{
2638 return cppu::supportsService(this, rServiceName);
2639}
2640
2642{
2643 uno::Sequence<OUString> aRet { "com.sun.star.text.TextFieldMasters" };
2644 return aRet;
2645}
2646
2648 SwUnoCollection(_pDoc)
2649{
2650}
2651
2653{
2654
2655}
2656
2657/*
2658 Iteration over non-standard field types
2659 USER/SETEXP/DDE/DATABASE
2660 Thus the names are:
2661 "com.sun.star.text.fieldmaster.User" + <field type name>
2662 "com.sun.star.text.fieldmaster.DDE" + <field type name>
2663 "com.sun.star.text.fieldmaster.SetExpression" + <field type name>
2664 "com.sun.star.text.fieldmaster.DataBase" + <field type name>
2665
2666 If too much, maybe one could leave out the "com.sun.star.text".
2667 */
2668static SwFieldIds lcl_GetIdByName( OUString& rName, OUString& rTypeName )
2669{
2670 if (rName.startsWithIgnoreAsciiCase(COM_TEXT_FLDMASTER_CC))
2671 rName = rName.copy(COM_TEXT_FLDMASTER_CC.getLength());
2672
2674 sal_Int32 nIdx = 0;
2675 rTypeName = rName.getToken( 0, '.', nIdx );
2676 if (rTypeName == "User")
2677 nResId = SwFieldIds::User;
2678 else if (rTypeName == "DDE")
2679 nResId = SwFieldIds::Dde;
2680 else if (rTypeName == "SetExpression")
2681 {
2682 nResId = SwFieldIds::SetExp;
2683
2684 const OUString sFieldTypName( rName.getToken( 0, '.', nIdx ));
2685 const OUString sUIName( SwStyleNameMapper::GetSpecialExtraUIName( sFieldTypName ) );
2686
2687 if( sUIName != sFieldTypName )
2688 rName = comphelper::string::setToken(rName, 1, '.', sUIName);
2689 }
2690 else if (rTypeName.equalsIgnoreAsciiCase("DataBase"))
2691 {
2692 rName = rName.copy(RTL_CONSTASCII_LENGTH("DataBase."));
2693 if (!rName.isEmpty())
2694 {
2695 // #i51815#
2696 rName = "DataBase." + rName;
2697 nResId = SwFieldIds::Database;
2698 }
2699 }
2700 else if (rTypeName == "Bibliography")
2702 return nResId;
2703}
2704
2706{
2707 SolarMutexGuard aGuard;
2708 if(!GetDoc())
2709 throw uno::RuntimeException();
2710
2711 OUString sName(rName), sTypeName;
2712 const SwFieldIds nResId = lcl_GetIdByName( sName, sTypeName );
2713 if( SwFieldIds::Unknown == nResId )
2714 throw container::NoSuchElementException(
2715 "SwXTextFieldMasters::getByName(" + rName + ")",
2716 css::uno::Reference<css::uno::XInterface>());
2717
2718 sName = sName.copy(std::min(sTypeName.getLength()+1, sName.getLength()));
2719 SwFieldType* pType = GetDoc()->getIDocumentFieldsAccess().GetFieldType(nResId, sName, true);
2720 if(!pType)
2721 throw container::NoSuchElementException(
2722 "SwXTextFieldMasters::getByName(" + rName + ")",
2723 css::uno::Reference<css::uno::XInterface>());
2724
2725 uno::Reference<beans::XPropertySet> const xRet(
2727 return uno::Any(xRet);
2728}
2729
2731 const SwFieldType& rFieldType, OUString& rName)
2732{
2733 OUString sField;
2734
2735 switch( rFieldType.Which() )
2736 {
2737 case SwFieldIds::User:
2738 sField = "User." + rFieldType.GetName();
2739 break;
2740 case SwFieldIds::Dde:
2741 sField = "DDE." + rFieldType.GetName();
2742 break;
2743
2744 case SwFieldIds::SetExp:
2745 sField = "SetExpression." + SwStyleNameMapper::GetSpecialExtraProgName( rFieldType.GetName() );
2746 break;
2747
2749 sField = "DataBase." + rFieldType.GetName().replaceAll(OUStringChar(DB_DELIM), ".");
2750 break;
2751
2753 sField = "Bibliography";
2754 break;
2755
2756 default:
2757 return false;
2758 }
2759
2760 rName += COM_TEXT_FLDMASTER_CC + sField;
2761 return true;
2762}
2763
2764uno::Sequence< OUString > SwXTextFieldMasters::getElementNames()
2765{
2766 SolarMutexGuard aGuard;
2767 if(!GetDoc())
2768 throw uno::RuntimeException();
2769
2770 const SwFieldTypes* pFieldTypes = GetDoc()->getIDocumentFieldsAccess().GetFieldTypes();
2771 const size_t nCount = pFieldTypes->size();
2772
2773 std::vector<OUString> aFieldNames;
2774 for( size_t i = 0; i < nCount; ++i )
2775 {
2776 SwFieldType& rFieldType = *((*pFieldTypes)[i]);
2777
2778 OUString sFieldName;
2779 if (SwXTextFieldMasters::getInstanceName(rFieldType, sFieldName))
2780 {
2781 aFieldNames.push_back(sFieldName);
2782 }
2783 }
2784
2786}
2787
2789{
2790 SolarMutexGuard aGuard;
2791 if(!GetDoc())
2792 throw uno::RuntimeException();
2793
2794 OUString sName(rName), sTypeName;
2795 const SwFieldIds nResId = lcl_GetIdByName( sName, sTypeName );
2796 bool bRet = false;
2797 if( SwFieldIds::Unknown != nResId )
2798 {
2799 sName = sName.copy(std::min(sTypeName.getLength()+1, sName.getLength()));
2800 bRet = nullptr != GetDoc()->getIDocumentFieldsAccess().GetFieldType(nResId, sName, true);
2801 }
2802 return bRet;
2803}
2804
2806{
2808
2809}
2810
2812{
2813 SolarMutexGuard aGuard;
2814 if(!IsValid())
2815 throw uno::RuntimeException();
2816 return true;
2817}
2818
2820{
2821public:
2822 std::mutex m_Mutex; // just for OInterfaceContainerHelper3
2824};
2825
2827{
2828 return "SwXTextFieldTypes";
2829}
2830
2832{
2833 return cppu::supportsService(this, rServiceName);
2834}
2835
2837{
2838 uno::Sequence<OUString> aRet { "com.sun.star.text.TextFields" };
2839 return aRet;
2840}
2841
2843 : SwUnoCollection (_pDoc)
2844 , m_pImpl(new Impl)
2845{
2846}
2847
2849{
2850}
2851
2853{
2855 lang::EventObject const ev(static_cast< ::cppu::OWeakObject&>(*this));
2856 std::unique_lock aGuard(m_pImpl->m_Mutex);
2857 m_pImpl->m_RefreshListeners.disposeAndClear(aGuard, ev);
2858}
2859
2860uno::Reference< container::XEnumeration > SwXTextFieldTypes::createEnumeration()
2861{
2862 SolarMutexGuard aGuard;
2863 if(!IsValid())
2864 throw uno::RuntimeException();
2865 return new SwXFieldEnumeration(*GetDoc());
2866}
2867
2869{
2871}
2872
2874{
2875 SolarMutexGuard aGuard;
2876 if(!IsValid())
2877 throw uno::RuntimeException();
2878 return true; // they always exist
2879}
2880
2882{
2883 {
2884 SolarMutexGuard aGuard;
2885 if (!IsValid())
2886 throw uno::RuntimeException();
2887 UnoActionContext aContext(GetDoc());
2888 GetDoc()->getIDocumentStatistics().UpdateDocStat( false, true );
2890 }
2891 // call refresh listeners (without SolarMutex locked)
2892 lang::EventObject const event(static_cast< ::cppu::OWeakObject*>(this));
2893 std::unique_lock aGuard(m_pImpl->m_Mutex);
2894 m_pImpl->m_RefreshListeners.notifyEach(aGuard,
2895 & util::XRefreshListener::refreshed, event);
2896}
2897
2899 const uno::Reference<util::XRefreshListener> & xListener)
2900{
2901 std::unique_lock aGuard(m_pImpl->m_Mutex);
2902 m_pImpl->m_RefreshListeners.addInterface(aGuard, xListener);
2903}
2904
2906 const uno::Reference<util::XRefreshListener> & xListener)
2907{
2908 std::unique_lock aGuard(m_pImpl->m_Mutex);
2909 m_pImpl->m_RefreshListeners.removeInterface(aGuard, xListener);
2910}
2911
2913 : public SvtListener
2914{
2915public:
2917 std::vector<uno::Reference<text::XTextField>> m_Items;
2918 sal_Int32 m_nNextIndex;
2919
2920 explicit Impl(SwDoc& rDoc)
2921 : m_pDoc(&rDoc)
2922 , m_nNextIndex(0)
2923 {
2925 }
2926
2927 virtual void Notify(const SfxHint& rHint) override
2928 {
2929 if(rHint.GetId() == SfxHintId::Dying)
2930 m_pDoc = nullptr;
2931 }
2932};
2933
2934OUString SAL_CALL
2936{
2937 return "SwXFieldEnumeration";
2938}
2939
2940sal_Bool SAL_CALL SwXFieldEnumeration::supportsService(const OUString& rServiceName)
2941{
2942 return cppu::supportsService(this, rServiceName);
2943}
2944
2945uno::Sequence<OUString> SAL_CALL
2947{
2948 return { "com.sun.star.text.FieldEnumeration" };
2949}
2950
2952 : m_pImpl(new Impl(rDoc))
2953{
2954 // build sequence
2955 m_pImpl->m_Items.clear();
2956
2957 const SwFieldTypes* pFieldTypes = m_pImpl->m_pDoc->getIDocumentFieldsAccess().GetFieldTypes();
2958 const size_t nCount = pFieldTypes->size();
2959 for(size_t nType = 0; nType < nCount; ++nType)
2960 {
2961 const SwFieldType* pCurType = (*pFieldTypes)[nType].get();
2962 std::vector<SwFormatField*> vFormatFields;
2963 pCurType->GatherFields(vFormatFields);
2964 std::for_each(vFormatFields.begin(), vFormatFields.end(),
2965 [this](SwFormatField* pF) { m_pImpl->m_Items.push_back(SwXTextField::CreateXTextField(m_pImpl->m_pDoc, pF)); });
2966 }
2967 // now handle meta-fields, which are not SwFields
2968 const std::vector< uno::Reference<text::XTextField> > MetaFields(
2969 m_pImpl->m_pDoc->GetMetaFieldManager().getMetaFields() );
2970 for (const auto & rMetaField : MetaFields)
2971 {
2972 m_pImpl->m_Items.push_back( rMetaField );
2973 }
2974 // also add fieldmarks
2975 IDocumentMarkAccess& rMarksAccess(*rDoc.getIDocumentMarkAccess());
2976 for (auto iter = rMarksAccess.getFieldmarksBegin(); iter != rMarksAccess.getFieldmarksEnd(); ++iter)
2977 {
2978 m_pImpl->m_Items.emplace_back(static_cast<cppu::OWeakObject*>(SwXFieldmark::CreateXFieldmark(rDoc, *iter).get()), uno::UNO_QUERY);
2979 }
2980}
2981
2983{
2984}
2985
2987{
2988 SolarMutexGuard aGuard;
2989
2990 return m_pImpl->m_nNextIndex < static_cast<sal_Int32>(m_pImpl->m_Items.size());
2991}
2992
2994{
2995 SolarMutexGuard aGuard;
2996
2997 if (m_pImpl->m_nNextIndex >= static_cast<sal_Int32>(m_pImpl->m_Items.size()))
2998 throw container::NoSuchElementException(
2999 "SwXFieldEnumeration::nextElement",
3000 css::uno::Reference<css::uno::XInterface>());
3001
3002 uno::Reference< text::XTextField > &rxField =
3003 m_pImpl->m_Items[ m_pImpl->m_nNextIndex++ ];
3004 uno::Any aRet;
3005 aRet <<= rxField;
3006 rxField = nullptr; // free memory for item that is no longer used
3007 return aRet;
3008}
3009
3010/* 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:650
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
invariant for SwAuthorityField is that it is always registered at its SwAuthorityFieldType via AddFie...
Definition: authfld.hxx:155
void SetLevel(sal_uInt8)
Definition: chpfld.cxx:86
SwRect FindLayoutRect(const bool bPrtArea=false, const Point *pPoint=nullptr) const
Definition: node.cxx:1238
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:549
const OUString & GetName() const
Definition: docufld.hxx:547
virtual sal_uInt16 GetSubType() const override
Definition: docufld.cxx:1151
Definition: doc.hxx:195
IDocumentState const & getIDocumentState() const
Definition: doc.cxx:402
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:323
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
Definition: doc.cxx:365
SwEditShell const * GetEditShell() const
Definition: doccorr.cxx:330
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:413
IDocumentMarkAccess * getIDocumentMarkAccess()
Definition: docbm.cxx:1872
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:434
IDocumentStatistics const & getIDocumentStatistics() const
Definition: doc.cxx:381
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:2024
virtual sal_uInt16 GetSubType() const override
Definition: docufld.cxx:2081
void SetExpansion(const OUString &rStr)
Definition: docufld.hxx:578
Instances of SwFields and those derived from it occur 0 to n times.
Definition: fldbas.hxx:243
virtual void UpdateFields()
Definition: fldbas.cxx:213
SAL_DLLPRIVATE void SetXObject(css::uno::Reference< css::beans::XPropertySet > const &xFieldMaster)
Definition: fldbas.hxx:262
SAL_DLLPRIVATE css::uno::WeakReference< css::beans::XPropertySet > const & GetXObject() const
Definition: fldbas.hxx:259
virtual OUString GetName() const
Only in derived classes.
Definition: fldbas.cxx:137
virtual void QueryValue(css::uno::Any &rVal, sal_uInt16 nWhich) const
Definition: fldbas.cxx:142
virtual void PutValue(const css::uno::Any &rVal, sal_uInt16 nWhich)
Definition: fldbas.cxx:145
SwFieldIds Which() const
Definition: fldbas.hxx:274
void GatherFields(std::vector< SwFormatField * > &rvFormatFields, bool bCollectOnlyInDocNodes=true) const
Definition: fldbas.cxx:203
Base class of all fields.
Definition: fldbas.hxx:293
virtual sal_uInt16 GetSubType() const
Definition: fldbas.cxx:342
sal_uInt32 GetFormat() const
Query parameters for dialog and for BASIC.
Definition: fldbas.hxx:404
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhichId) const
Definition: fldbas.cxx:351
OUString ExpandField(bool bCached, SwRootFrame const *pLayout) const
expand the field.
Definition: fldbas.cxx:484
virtual OUString GetFieldName() const
get name or content
Definition: fldbas.cxx:305
SwFieldType * GetTyp() const
Definition: fldbas.hxx:399
SwFieldIds Which() const
ResId.
Definition: fldbas.cxx:250
LanguageType GetLanguage() const
Language at field position.
Definition: fldbas.hxx:409
void SetExpansion(const OUString &rStr)
Definition: docufld.hxx:224
const SwField * GetField() const
Definition: fmtfld.hxx:130
const SwTextField * GetTextField() const
Definition: fmtfld.hxx:148
SAL_DLLPRIVATE unotools::WeakReference< SwXTextField > const & GetXTextField() const
Definition: fmtfld.hxx:163
void ChgExpStr(const OUString &rExpand, SwRootFrame const *pLayout)
Definition: expfld.cxx:295
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:1423
void SetHelp(const OUString &rStr)
Definition: expfld.cxx:1413
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:897
SwNodes & GetNodes()
Node is in which nodes-array/doc?
Definition: node.hxx:744
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:2543
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:187
const SwPosition * GetMark() const
Definition: pam.hxx:263
SwNode & GetPointNode() const
Definition: pam.hxx:283
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
Definition: pam.cxx:642
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
Definition: pam.cxx:668
const SwPosition * End() const
Definition: pam.hxx:271
SwDoc & GetDoc() const
Definition: pam.hxx:299
const SwPosition * GetPoint() const
Definition: pam.hxx:261
const SwPosition * Start() const
Definition: pam.hxx:266
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
Definition: pam.hxx:259
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:1839
virtual void SetPar2(const OUString &rStr) override
set the PostIt's text
Definition: docufld.cxx:1821
void Width(tools::Long nNew)
Definition: swrect.hxx:189
void SetText(const OUString &rText, SwRootFrame const *pLayout)
Definition: docufld.cxx:2385
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:2052
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:540
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:628
static void GetPamForTextField(const SwTextField &rTextField, std::shared_ptr< SwPaM > &rPamForTextField)
Definition: atrfld.cxx:608
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:111
SwTextField * GetFieldTextAttrAt(const sal_Int32 nIndex, ::sw::GetTextAttrMode const eMode=::sw::GetTextAttrMode::Expand) const
Definition: ndtxt.cxx:1847
bool IsHidden() const
Definition: ndtxt.cxx:4727
SwDoc * GetDoc() const
Definition: unocoll.hxx:59
bool IsValid() const
Definition: unocoll.hxx:57
virtual void Invalidate()
Definition: unocoll.cxx:1941
o3tl::span< const SfxItemPropertyMapEntry > GetPropertyMapEntries(sal_uInt16 PropertyId)
Definition: unomap.cxx:71
const SfxItemPropertySet * GetPropertySet(sal_uInt16 PropertyId)
Definition: unomap1.cxx:1081
The shared part of a user field.
Definition: usrfld.hxx:35
sal_uInt16 GetType() const
Definition: usrfld.hxx:87
The non-shared part of a user field.
Definition: usrfld.hxx:103
virtual void SetValue(const double &rVal)
Definition: fldbas.cxx:781
virtual void CalcLayout()
Definition: viewsh.cxx:1070
std::vector< uno::Reference< text::XTextField > > m_Items
Definition: unofield.cxx:2917
sal_Int32 m_nNextIndex
index of next element to be returned
Definition: unofield.cxx:2918
virtual void Notify(const SfxHint &rHint) override
Definition: unofield.cxx:2927
virtual ~SwXFieldEnumeration() override
Definition: unofield.cxx:2982
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unofield.cxx:2946
virtual sal_Bool SAL_CALL hasMoreElements() override
Definition: unofield.cxx:2986
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
Definition: unofield.cxx:2940
virtual css::uno::Any SAL_CALL nextElement() override
Definition: unofield.cxx:2993
SwXFieldEnumeration(SwDoc &rDoc)
Definition: unofield.cxx:2951
virtual OUString SAL_CALL getImplementationName() override
Definition: unofield.cxx:2935
::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:916
SwXTextFieldMasters(SwDoc *pDoc)
Definition: unofield.cxx:2647
virtual OUString SAL_CALL getImplementationName() override
Definition: unofield.cxx:2631
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unofield.cxx:2641
virtual sal_Bool SAL_CALL hasByName(const OUString &rName) override
Definition: unofield.cxx:2788
virtual css::uno::Type SAL_CALL getElementType() override
Definition: unofield.cxx:2805
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
Definition: unofield.cxx:2636
virtual sal_Bool SAL_CALL hasElements() override
Definition: unofield.cxx:2811
virtual ~SwXTextFieldMasters() override
Definition: unofield.cxx:2652
virtual css::uno::Any SAL_CALL getByName(const OUString &rName) override
Definition: unofield.cxx:2705
static bool getInstanceName(const SwFieldType &rFieldType, OUString &rName)
Definition: unofield.cxx:2730
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
Definition: unofield.cxx:2764
::comphelper::OInterfaceContainerHelper4< util::XRefreshListener > m_RefreshListeners
Definition: unofield.cxx:2823
SwXTextFieldTypes(SwDoc *pDoc)
Definition: unofield.cxx:2842
virtual void SAL_CALL removeRefreshListener(const css::uno::Reference< css::util::XRefreshListener > &xListener) override
Definition: unofield.cxx:2905
virtual void SAL_CALL refresh() override
Definition: unofield.cxx:2881
virtual void SAL_CALL addRefreshListener(const css::uno::Reference< css::util::XRefreshListener > &xListener) override
Definition: unofield.cxx:2898
virtual OUString SAL_CALL getImplementationName() override
Definition: unofield.cxx:2826
virtual void Invalidate() override
Definition: unofield.cxx:2852
std::unique_ptr< Impl > m_pImpl
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
Definition: unofield.cxx:2860
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unofield.cxx:2836
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
Definition: unofield.cxx:2831
virtual sal_Bool SAL_CALL hasElements() override
Definition: unofield.cxx:2873
virtual ~SwXTextFieldTypes() override
Definition: unofield.cxx:2848
virtual css::uno::Type SAL_CALL getElementType() override
Definition: unofield.cxx:2868
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:2626
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:2608
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:2093
virtual OUString SAL_CALL getPresentation(sal_Bool bShowCommand) override
Definition: unofield.cxx:1305
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unofield.cxx:2108
virtual void SAL_CALL dispose() override
Definition: unofield.cxx:2074
virtual void SAL_CALL removePropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unofield.cxx:2480
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:2490
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:2569
virtual void SAL_CALL update() override
Definition: unofield.cxx:2495
virtual void SAL_CALL addPropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unofield.cxx:2475
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &rPropertyName) override
Definition: unofield.cxx:2287
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:2100
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unofield.cxx:2574
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:2485
virtual ~SwXTextField() override
Definition: unofield.cxx:1189
virtual void SAL_CALL attach(const css::uno::Reference< css::text::XTextRange > &xTextRange) override
Definition: unofield.cxx:1317
virtual void SAL_CALL setPropertyValue(const OUString &rPropertyName, const css::uno::Any &rValue) override
Definition: unofield.cxx:2129
virtual OUString SAL_CALL getImplementationName() override
Definition: unofield.cxx:2550
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() override
Definition: unofield.cxx:2037
const SwDoc & GetDoc() const
Definition: unoobj2.cxx:764
static rtl::Reference< SwXTextRange > CreateXTextRange(SwDoc &rDoc, const SwPosition &rPos, const SwPosition *const pMark)
Definition: unoobj2.cxx:1199
void disposeAndClear(::std::unique_lock<::std::mutex > &rGuard, const css::lang::EventObject &rEvt)
css::uno::Type const & get()
OUString getDataSource() const
#define FN_UNO_ANCHOR_TYPE
Definition: cmdid.h:597
#define FN_UNO_ANCHOR_TYPES
Definition: cmdid.h:590
#define FN_UNO_TEXT_WRAP
Definition: cmdid.h:596
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:94
@ FF_FIXED
Definition: fldbas.hxx:162
@ FIXEDFLD
Definition: fldbas.hxx:229
@ DATEFLD
Definition: fldbas.hxx:230
@ TIMEFLD
Definition: fldbas.hxx:231
@ INP_USR
Definition: fldbas.hxx:219
@ INP_TXT
Definition: fldbas.hxx:218
SwFieldIds
Definition: fldbas.hxx:45
@ Database
For old documents the Field-Which IDs must be preserved !!!
@ TableOfAuthorities
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:3249
constexpr TypedWhichId< SwPtrMsgPoolItem > RES_REMOVE_UNO_OBJECT(181)
constexpr TypedWhichId< SwPtrMsgPoolItem > RES_OBJECTDYING(RES_MSG_BEGIN)
constexpr TypedWhichId< SwFormatField > RES_TXTATR_ANNOTATION(60)
constexpr TypedWhichId< SwFormatField > RES_TXTATR_FIELD(RES_TXTATR_NOEND_BEGIN)
constexpr TypedWhichId< SwFormatField > RES_TXTATR_INPUTFIELD(55)
sal_Int32 nIndex
OUString aName
Sequence< sal_Int8 > aSeq
#define SAL_N_ELEMENTS(arr)
const char * sName
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:212
const SwExtendedSubType SUB_INVISIBLE
Invisible.
Definition: fldbas.hxx:213
const SwGetSetExpType GSE_EXPR
Expression.
Definition: fldbas.hxx:204
const SwGetSetExpType GSE_FORMULA
Formula.
Definition: fldbas.hxx:206
const SwGetSetExpType GSE_STRING
String.
Definition: fldbas.hxx:203
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:1090
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:37
sal_Int32 GetContentIndex() const
Definition: pam.hxx:84
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:2668
const sal_uInt16 aDocInfoSubTypeFromService[]
Definition: unofield.cxx:97
static OUString OldNameToNewName_Impl(const OUString &rOld)
Definition: unofield.cxx:2555
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:87
#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:167
constexpr OUStringLiteral UNO_NAME_DEPENDENT_TEXT_FIELDS
Definition: unoprnms.hxx:496
constexpr OUStringLiteral UNO_NAME_VALUE
Definition: unoprnms.hxx:344
constexpr OUStringLiteral UNO_NAME_DDE_COMMAND_ELEMENT
Definition: unoprnms.hxx:169
constexpr OUStringLiteral UNO_NAME_IS_AUTOMATIC_UPDATE
Definition: unoprnms.hxx:170
constexpr OUStringLiteral UNO_NAME_NAME
Definition: unoprnms.hxx:90
constexpr OUStringLiteral UNO_NAME_DATA_COLUMN_NAME
Definition: unoprnms.hxx:264
constexpr OUStringLiteral UNO_NAME_DATA_TABLE_NAME
Definition: unoprnms.hxx:262
constexpr OUStringLiteral UNO_NAME_DATA_BASE_NAME
Definition: unoprnms.hxx:261
constexpr OUStringLiteral UNO_NAME_CONTENT
Definition: unoprnms.hxx:255
constexpr OUStringLiteral UNO_NAME_DATA_BASE_URL
Definition: unoprnms.hxx:775
constexpr OUStringLiteral UNO_NAME_DDE_COMMAND_FILE
Definition: unoprnms.hxx:168
constexpr OUStringLiteral UNO_NAME_DATA_COMMAND_TYPE
Definition: unoprnms.hxx:263
constexpr OUStringLiteral UNO_NAME_INSTANCE_NAME
Definition: unoprnms.hxx:499
constexpr OUStringLiteral UNO_NAME_NUMBERING_SEPARATOR
Definition: unoprnms.hxx:491
constexpr OUStringLiteral UNO_NAME_IS_EXPRESSION
Definition: unoprnms.hxx:329
constexpr OUStringLiteral UNO_NAME_SUB_TYPE
Definition: unoprnms.hxx:327
constexpr OUStringLiteral UNO_NAME_CHAPTER_NUMBERING_LEVEL
Definition: unoprnms.hxx:490
const SvXMLTokenMapEntry aTypes[]