24 #include <unofield.hxx>
39 #include <unoprnms.hxx>
49 #include <com/sun/star/util/DateTime.hpp>
50 #include <com/sun/star/util/Date.hpp>
51 #include <com/sun/star/beans/PropertyAttribute.hpp>
55 #include <com/sun/star/text/SetVariableType.hpp>
56 #include <com/sun/star/text/WrapTextMode.hpp>
57 #include <com/sun/star/text/TextContentAnchorType.hpp>
67 #include <strings.hrc>
76 #include <tools/datetime.hxx>
83 #include <osl/mutex.hxx>
85 #include <textapi.hxx>
93 #define COM_TEXT_FLDMASTER_CC "com.sun.star.text.fieldmaster."
119 struct ServiceIdResId
186 if (aServiceToRes[
i].nServiceId == nServiceId)
187 return aServiceToRes[
i].nResId;
188 #if OSL_DEBUG_LEVEL > 0
189 OSL_FAIL(
"service id not found");
208 const sal_uInt16 nSubType = rField.
GetSubType();
209 switch( nSubType & 0xff )
261 for(
const ServiceIdResId* pMap = aServiceToRes;
263 if( nWhich == pMap->nResId )
265 nSrvId = pMap->nServiceId;
269 #if OSL_DEBUG_LEVEL > 0
271 OSL_FAIL(
"resid not found");
428 : m_EventListeners(m_Mutex)
431 , m_nResTypeId(nResId)
441 : m_EventListeners(m_Mutex)
444 , m_nResTypeId(nResId)
464 class theSwXFieldMasterUnoTunnelId :
public rtl::Static< UnoTunnelIdInit, theSwXFieldMasterUnoTunnelId > {};
475 return ::sw::UnoTunnelImpl<SwXFieldMaster>(rId,
this);
481 return "SwXFieldMaster";
499 pEntry =
"SetExpression";
505 pEntry =
"Bibliography";
511 return "com.sun.star.text.fieldmaster." + OUString::createFromAscii(pEntry);
521 uno::Sequence< OUString > SAL_CALL
524 return {
"com.sun.star.text.TextFieldMaster", getServiceName(
m_pImpl->m_nResTypeId) };
541 uno::Reference<beans::XPropertySet>
546 uno::Reference<beans::XPropertySet> xFM;
567 uno::Reference<beans::XPropertySetInfo> SAL_CALL
571 uno::Reference< beans::XPropertySetInfo > aRef =
578 const OUString& rPropertyName,
const uno::Any& rValue)
584 bool bSetValue =
true;
587 const std::vector<OUString>& rExtraArr(
589 const OUString sTypeName = pType->
GetName();
590 static sal_uInt16 nIds[] =
599 for(
const sal_uInt16 * pIds = nIds; *pIds; ++pIds)
601 if(sTypeName == rExtraArr[ *pIds ] )
615 const sal_uInt16 nMemberValueId =
GetFieldTypeMId( rPropertyName, *pType );
618 throw beans::UnknownPropertyException(
619 "Unknown property: " + rPropertyName,
620 static_cast< cppu::OWeakObject * >(
this ) );
623 pType->
PutValue( rValue, nMemberValueId );
635 rValue >>= sTypeName;
637 m_pImpl->m_nResTypeId, sTypeName,
false);
641 ( sTypeName ==
SwResId(STR_POOLCOLL_LABEL_TABLE) ||
642 sTypeName ==
SwResId(STR_POOLCOLL_LABEL_DRAWING) ||
643 sTypeName ==
SwResId(STR_POOLCOLL_LABEL_FRAME) ||
644 sTypeName ==
SwResId(STR_POOLCOLL_LABEL_ABB) ||
645 sTypeName ==
SwResId(STR_POOLCOLL_LABEL_FIGURE) )))
647 throw lang::IllegalArgumentException();
655 pType2 =
m_pImpl->m_pDoc->getIDocumentFieldsAccess().InsertFieldType(aType);
665 m_pImpl->m_bParam1 ? SfxLinkUpdateMode::ALWAYS : SfxLinkUpdateMode::ONCALL);
666 pType2 =
m_pImpl->m_pDoc->getIDocumentFieldsAccess().InsertFieldType(aType);
672 if (!
m_pImpl->m_sParam1.isEmpty())
676 pType2 =
m_pImpl->m_pDoc->getIDocumentFieldsAccess().InsertFieldType(aType);
689 throw uno::RuntimeException(
"no field type found!", *
this);
703 throw lang::IllegalArgumentException();
709 throw lang::IllegalArgumentException();
726 if ( ( !
m_pImpl->m_sParam1.isEmpty()
727 || !
m_pImpl->m_sParam5.isEmpty())
728 && !
m_pImpl->m_sParam2.isEmpty()
729 && !
m_pImpl->m_sParam3.isEmpty())
745 if (
m_pImpl->m_sParam1.isEmpty())
755 while (nIndex < m_pImpl->m_sParam1.getLength())
768 nStart, nIndex - nStart, sTmp);
777 throw beans::UnknownPropertyException(
"Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > (
this ) );
791 if (!
m_pImpl->m_sParam1.isEmpty())
801 SwFieldType *
const pType =
m_pImpl->m_pDoc->getIDocumentFieldsAccess().InsertFieldType(aType);
829 std::vector<SwFormatField*> vpFields;
831 uno::Sequence<uno::Reference <text::XDependentTextField> >
aSeq(vpFields.size());
832 std::transform(vpFields.begin(), vpFields.end(),
aSeq.begin(),
842 throw beans::UnknownPropertyException(
843 "Unknown property: " + rPropertyName,
844 static_cast<cppu::OWeakObject *>(
this));
851 OUString aDataSource;
852 aRet >>= aDataSource;
855 OUString *pStr =
nullptr;
858 aObj.
SetURL( aDataSource );
859 bool bIsURL = aObj.
GetProtocol() != INetProtocol::NotValid;
876 uno::Sequence<uno::Reference <text::XDependentTextField> > aRetSeq(0);
898 bool bIsURL = aObj.
GetProtocol() != INetProtocol::NotValid;
925 throw beans::UnknownPropertyException(
"Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > (
this ) );
934 OSL_FAIL(
"not implemented");
939 OSL_FAIL(
"not implemented");
944 OSL_FAIL(
"not implemented");
949 OSL_FAIL(
"not implemented");
957 throw uno::RuntimeException();
958 size_t nTypeIdx = SIZE_MAX;
960 for(
size_t i = 0;
i < pTypes->size();
i++ )
962 if((*pTypes)[
i].get()== pFieldType)
967 std::vector<SwFormatField*> vpFields;
969 for(
auto pField : vpFields)
972 m_pImpl->m_pDoc->getIDocumentFieldsAccess().RemoveFieldType(nTypeIdx);
976 const uno::Reference<lang::XEventListener> & xListener)
979 m_pImpl->m_EventListeners.addInterface(xListener);
983 const uno::Reference<lang::XEventListener> & xListener)
986 m_pImpl->m_EventListeners.removeInterface(xListener);
991 if(rHint.
GetId() == SfxHintId::Dying)
995 uno::Reference<uno::XInterface>
const xThis(
m_wThis);
1000 lang::EventObject
const ev(xThis);
1013 if((*pTypes)[
i].get() == &rType)
1024 const OUString& rFormula,
1028 const OUString sProgName(
1030 if(sProgName != sTypeName)
1032 const OUString sSource = bQuery ? sTypeName : sProgName;
1033 const OUString sDest = bQuery ? sProgName : sTypeName;
1034 if(rFormula.startsWith(sSource))
1036 return sDest + rFormula.subView(sSource.getLength());
1044 struct SwFieldProperties_Impl
1052 uno::Sequence<beans::PropertyValue> aPropSeq;
1053 uno::Sequence<OUString> aStrings;
1054 std::unique_ptr<util::DateTime> pDateTime;
1058 sal_uInt16 nUSHORT1;
1059 sal_uInt16 nUSHORT2;
1062 bool bFormatIsDefault;
1068 SwFieldProperties_Impl():
1077 bFormatIsDefault(true),
1108 : m_pFieldType(nullptr)
1109 , m_pFormatField(pFormat)
1110 , m_EventListeners(m_Mutex)
1112 , m_bIsDescriptor(pFormat == nullptr)
1113 , m_bCallUpdate(false)
1114 , m_nServiceId(pFormat
1117 , m_pProps(pFormat ? nullptr : new SwFieldProperties_Impl)
1125 if (m_xTextObject.is())
1127 m_xTextObject->DisposeEditSource();
1133 m_pFormatField = pFormatField;
1143 return m_pFormatField;
1149 return m_bIsDescriptor;
1153 const SwField* GetField()
const;
1157 if(!m_pDoc && !IsDescriptor())
1158 throw uno::RuntimeException();
1159 else if (IsDescriptor())
1160 return m_pFieldType;
1167 m_pFieldType = &rType;
1173 m_pFieldType =
nullptr;
1180 class theSwXTextFieldUnoTunnelId :
public rtl::Static< UnoTunnelIdInit, theSwXTextFieldUnoTunnelId > {};
1191 return ::sw::UnoTunnelImpl<SwXTextField>(rId,
this);
1205 m_pImpl->m_pProps->bBool2 =
true;
1209 m_pImpl->m_pProps->bBool1 =
true;
1226 uno::Reference<text::XTextField>
1230 assert(!pFormat || pDoc);
1233 uno::Reference<text::XTextField> xField;
1241 ?
new SwXTextField(const_cast<SwFormatField&>(*pFormat), *pDoc)
1246 const_cast<SwFormatField *
>(pFormat)->SetXTextField(xField);
1249 pField->
m_pImpl->m_wThis = xField;
1274 uno::Reference<text::XTextField>
const xField(
1278 sal::static_int_cast<sal_IntPtr>(
1279 uno::Reference<lang::XUnoTunnel>(xField, uno::UNO_QUERY_THROW)
1283 pXField->
m_pImpl->SetFormatField(
nullptr,
nullptr);
1292 std::shared_ptr<SwPaM> pPamForTextField;
1295 assert(pPamForTextField);
1296 sal_Int32
const nStart(pPamForTextField->Start()->nContent.GetIndex());
1297 rIDCO.DeleteAndJoin(*pPamForTextField);
1299 bool bSuccess = rIDCO.InsertPoolItem(*pPamForTextField, tempFormat);
1302 SwTextField const* pNewAttr(rNode.GetFieldTextAttrAt(nStart,
true));
1304 SwFormatField const& rNewFormat(pNewAttr->GetFormatField());
1306 assert(static_cast<SwSetExpField const*>(rNewFormat.GetField())->GetInputFlag() == (
dynamic_cast<SwTextInputField const*
>(pNewAttr) !=
nullptr));
1309 pXField->m_pImpl->SetFormatField(const_cast<SwFormatField*>(&rNewFormat), &rNode.GetDoc());
1310 const_cast<SwFormatField&
>(rNewFormat).SetXTextField(xField);
1315 const uno::Reference< beans::XPropertySet > & xFieldMaster)
1320 throw uno::RuntimeException();
1321 uno::Reference< lang::XUnoTunnel > xMasterTunnel(xFieldMaster, uno::UNO_QUERY);
1322 if (!xMasterTunnel.is())
1323 throw lang::IllegalArgumentException();
1331 throw lang::IllegalArgumentException();
1334 m_pImpl->SetFieldType(*pFieldType);
1337 uno::Reference< beans::XPropertySet > SAL_CALL
1343 uno::Reference<beans::XPropertySet>
const xRet(
1355 throw uno::RuntimeException();
1361 const uno::Reference< text::XTextRange > & xTextRange)
1366 uno::Reference<lang::XUnoTunnel> xRangeTunnel( xTextRange, uno::UNO_QUERY);
1369 if(xRangeTunnel.is())
1377 SwDoc* pDoc = pRange ? &pRange->
GetDoc() : pCursor ? pCursor->
GetDoc() :
nullptr;
1381 throw lang::IllegalArgumentException();
1386 std::unique_ptr<SwField> xField;
1387 switch (
m_pImpl->m_nServiceId)
1394 if (
m_pImpl->m_pProps->pDateTime)
1396 aDateTime = *(
m_pImpl->m_pProps->pDateTime);
1399 static_cast<SwPostItFieldType*>(pFieldType),
1407 if (
m_pImpl->m_xTextObject.is() )
1412 xField.reset(pPostItField);
1418 xField.reset(
new SwScriptField(static_cast<SwScriptFieldType*>(pFieldType),
1425 sal_uInt16 nSub = 0;
1426 if (
m_pImpl->m_pProps->bBool1)
1428 if (
m_pImpl->m_pProps->bBool2)
1434 static_cast<SwDateTimeFieldType*>(pFieldType),
1435 nSub,
m_pImpl->m_pProps->nFormat);
1436 xField.reset(pDTField);
1437 if (
m_pImpl->m_pProps->fDouble > 0.)
1441 if (
m_pImpl->m_pProps->pDateTime)
1452 sal_Int32 nFormat =
m_pImpl->m_pProps->nFormat;
1453 if (
m_pImpl->m_pProps->bBool2)
1456 static_cast<SwFileNameFieldType*>(pFieldType), nFormat);
1457 xField.reset(pFNField);
1458 if (!
m_pImpl->m_pProps->sPar3.isEmpty())
1461 aFormat <<=
m_pImpl->m_pProps->nFormat;
1468 xField.reset(
new SwTemplNameField(static_cast<SwTemplNameFieldType*>(pFieldType),
1471 aFormat <<=
m_pImpl->m_pProps->nFormat;
1479 static_cast<SwChapterFieldType*>(pFieldType),
1481 xField.reset(pChapterField);
1484 aVal <<= static_cast<sal_Int16>(
m_pImpl->m_pProps->nUSHORT1);
1491 if (
m_pImpl->m_pProps->bBool2)
1496 static_cast<SwAuthorFieldType*>(pFieldType), nFormat);
1497 xField.reset(pAuthorField);
1506 static_cast<SwHiddenTextFieldType*>(pFieldType),
1511 xField.reset(pHTField);
1514 aVal <<=
m_pImpl->m_pProps->sPar4;
1522 static_cast<SwHiddenParaFieldType*>(pFieldType),
1524 xField.reset(pHPField);
1531 xField.reset(
new SwGetRefField(static_cast<SwGetRefFieldType*>(pFieldType),
1537 if (!
m_pImpl->m_pProps->sPar3.isEmpty())
1538 static_cast<SwGetRefField*>(xField.get())->SetExpand(
m_pImpl->m_pProps->sPar3);
1540 aVal <<= static_cast<sal_Int16>(
m_pImpl->m_pProps->nUSHORT1);
1542 aVal <<= static_cast<sal_Int16>(
m_pImpl->m_pProps->nUSHORT2);
1544 aVal <<=
m_pImpl->m_pProps->nSHORT1;
1551 xField.reset(
new SwJumpEditField(static_cast<SwJumpEditFieldType*>(pFieldType),
1579 if (
m_pImpl->m_pProps->bBool2)
1590 if (
m_pImpl->m_pProps->bBool1)
1593 static_cast<SwDocInfoFieldType*>(pFieldType), nSubType,
1595 if (!
m_pImpl->m_pProps->sPar3.isEmpty())
1596 static_cast<SwDocInfoField*>(xField.get())->SetExpansion(
m_pImpl->m_pProps->sPar3);
1601 sal_Int32 nFormat = 0;
1602 if (
m_pImpl->m_pProps->bBool1)
1607 static_cast<SwExtUserFieldType*>(pFieldType),
1608 m_pImpl->m_pProps->nUSHORT1, nFormat);
1609 xField.reset(pEUField);
1618 throw uno::RuntimeException();
1619 sal_uInt16 nUserSubType = (
m_pImpl->m_pProps->bBool1)
1621 if (
m_pImpl->m_pProps->bBool2)
1623 if (
m_pImpl->m_pProps->bFormatIsDefault &&
1626 m_pImpl->m_pProps->nFormat = -1;
1628 xField.reset(
new SwUserField(static_cast<SwUserFieldType*>(pFieldType),
1636 xField.reset(
new SwRefPageSetField( static_cast<SwRefPageSetFieldType*>(pFieldType),
1645 static_cast<SwRefPageGetFieldType*>(pFieldType),
1646 m_pImpl->m_pProps->nUSHORT1 );
1647 xField.reset(pRGField);
1655 static_cast<SwPageNumberFieldType*>(pFieldType),
PG_RANDOM,
1658 xField.reset(pPNField);
1661 aVal <<=
m_pImpl->m_pProps->nSubType;
1670 throw uno::RuntimeException();
1671 xField.reset(
new SwDDEField( static_cast<SwDDEFieldType*>(pFieldType) ));
1681 xField.reset(
new SwDBNameField(static_cast<SwDBNameFieldType*>(pFieldType), aData));
1682 sal_uInt16 nSubType = xField->GetSubType();
1683 if (
m_pImpl->m_pProps->bBool2)
1687 xField->SetSubType(nSubType);
1697 xField.reset(
new SwDBNextSetField(static_cast<SwDBNextSetFieldType*>(pFieldType),
1698 m_pImpl->m_pProps->sPar3, aData));
1710 OUString::number(
m_pImpl->m_pProps->nFormat),
1724 xField.reset(pDBSNField);
1726 sal_uInt16 nSubType = xField->GetSubType();
1727 if (
m_pImpl->m_pProps->bBool2)
1731 xField->SetSubType(nSubType);
1739 throw uno::RuntimeException();
1740 xField.reset(
new SwDBField(static_cast<SwDBFieldType*>(pFieldType),
1742 static_cast<SwDBField*
>(xField.get())->InitContent(
m_pImpl->m_pProps->sPar1);
1744 if (
m_pImpl->m_pProps->bBool2)
1748 xField->SetSubType(nSubType);
1756 throw uno::RuntimeException();
1758 if (
m_pImpl->m_pProps->bFormatIsDefault &&
1761 m_pImpl->m_pProps->nFormat = -1;
1764 static_cast<SwSetExpFieldType*>(pFieldType),
1768 xField.reset(pSEField);
1770 sal_uInt16 nSubType = xField->GetSubType();
1771 if (
m_pImpl->m_pProps->bBool2)
1775 if (
m_pImpl->m_pProps->bBool3)
1779 xField->SetSubType(nSubType);
1783 if (!
m_pImpl->m_pProps->sPar4.isEmpty())
1790 sal_uInt16 nSubType;
1791 switch (
m_pImpl->m_pProps->nSubType)
1798 OSL_FAIL(
"wrong value");
1804 bool bSetGetExpFieldUninitialized =
false;
1812 bSetGetExpFieldUninitialized =
true;
1814 if (
m_pImpl->m_pProps->bBool2)
1819 static_cast<SwGetExpFieldType*>(
1821 m_pImpl->m_pProps->sPar1, nSubType,
1823 xField.reset(pGEField);
1825 if (!
m_pImpl->m_pProps->sPar4.isEmpty())
1828 if (bSetGetExpFieldUninitialized)
1838 throw uno::RuntimeException();
1839 sal_uInt16 nInpSubType =
1840 sal::static_int_cast<sal_uInt16>(
1844 new SwInputField(static_cast<SwInputFieldType*>(pFieldType),
1848 pTextField->SetHelp(
m_pImpl->m_pProps->sPar3);
1849 pTextField->SetToolTip(
m_pImpl->m_pProps->sPar4);
1851 xField.reset(pTextField);
1860 if (!
m_pImpl->m_pProps->sPar4.isEmpty())
1862 aName =
m_pImpl->m_pProps->sPar4;
1869 xField.reset(
new SwMacroField(static_cast<SwMacroFieldType*>(pFieldType), aName,
1881 sal_uInt16 nSubType =
DS_PAGE;
1882 switch (
m_pImpl->m_nServiceId)
1894 static_cast<SwDocStatFieldType*>(pFieldType),
1895 nSubType,
m_pImpl->m_pProps->nUSHORT2));
1904 if (
m_pImpl->m_pProps->aPropSeq.hasElements())
1907 aVal <<=
m_pImpl->m_pProps->aPropSeq;
1921 static_cast<SwDropDownFieldType *>(
1923 xField.reset(pDDField);
1937 if (
m_pImpl->m_pProps->bBool1)
1940 if (
m_pImpl->m_pProps->bFormatIsDefault)
1941 m_pImpl->m_pProps->nFormat = -1;
1943 xField.reset(
new SwTableField( static_cast<SwTableFieldType*>(
1951 default: OSL_FAIL(
"What kind of type is that?");
1955 throw uno::RuntimeException(
"no SwField created?");
1957 xField->SetAutomaticLanguage(!
m_pImpl->m_pProps->bBool4);
1967 SwXTextCursor const*
const pTextCursor(dynamic_cast<SwXTextCursor*>(pCursor));
1968 const bool bForceExpandHints(
1990 throw uno::RuntimeException(
"no SwTextAttr inserted?");
1993 m_pImpl->SetFormatField(const_cast<SwFormatField*>(&rField), pDoc);
2000 OSL_ENSURE( pPostItField !=
nullptr,
"<SwXTextField::attachToRange(..)> - annotation field missing!" );
2001 if ( pPostItField !=
nullptr )
2012 m_pImpl->GetFormatField()->SetXTextField(
this);
2014 m_pImpl->m_bIsDescriptor =
false;
2020 else if ( !
m_pImpl->IsDescriptor()
2026 throw lang::IllegalArgumentException();
2034 std::unique_ptr<SwPostItField> pPostItField(static_cast< SwPostItField* >(
m_pImpl->GetFormatField()->GetField()->CopyField().release()));
2036 pPostItField.reset();
2038 m_pImpl->m_pDoc->getIDocumentContentOperations().InsertPoolItem( aEnd, aFormatField );
2046 m_pImpl->m_pDoc->getIDocumentContentOperations().DeleteAndJoin(aPam);
2051 if ( pTextAttr !=
nullptr )
2059 OSL_ENSURE( pField !=
nullptr,
"<SwXTextField::attach(..)> - annotation field missing!" );
2060 if ( pField !=
nullptr )
2072 throw lang::IllegalArgumentException();
2075 uno::Reference< text::XTextRange > SAL_CALL
2086 throw uno::RuntimeException();
2088 std::shared_ptr< SwPaM > pPamForTextField;
2090 if (pPamForTextField ==
nullptr)
2100 if ((*ppMark)->GetName() == pPostItField->
GetName())
2102 pPamForTextField = std::make_shared<SwPaM>((*ppMark)->GetMarkStart(), (*ppMark)->GetMarkEnd());
2109 *
m_pImpl->m_pDoc, *(pPamForTextField->GetPoint()), pPamForTextField->GetMark());
2120 assert(
m_pImpl->GetFormatField()->GetTextField() &&
"<SwXTextField::dispose()> - missing <SwTextField> --> crash");
2124 if (
m_pImpl->m_xTextObject.is())
2126 m_pImpl->m_xTextObject->DisposeEditSource();
2127 m_pImpl->m_xTextObject.clear();
2133 const uno::Reference<lang::XEventListener> & xListener)
2136 m_pImpl->m_EventListeners.addInterface(xListener);
2140 const uno::Reference<lang::XEventListener> & xListener)
2143 m_pImpl->m_EventListeners.removeInterface(xListener);
2146 uno::Reference< beans::XPropertySetInfo > SAL_CALL
2151 uno::Reference< beans::XPropertySetInfo > aRef;
2154 throw uno::RuntimeException();
2158 const uno::Reference<beans::XPropertySetInfo>& xInfo = pPropSet->
getPropertySetInfo();
2160 const uno::Sequence<beans::Property> aPropSeq = xInfo->getProperties();
2169 const OUString& rPropertyName,
const uno::Any& rValue)
2178 throw beans::UnknownPropertyException(
"Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > (
this ) );
2179 if ( pEntry->
nFlags & beans::PropertyAttribute::READONLY)
2180 throw beans::PropertyVetoException(
"Property is read-only: " + rPropertyName, static_cast < cppu::OWeakObject * > (
this ) );
2194 OSL_FAIL(
"not implemented");
2202 throw uno::RuntimeException();
2212 m_pImpl->GetFormatField()->Broadcast(
2217 if (
m_pImpl->GetFormatField()->GetTextField())
2219 m_pImpl->GetFormatField()->GetTextField()->ExpandTextField();
2230 bool* pBool =
nullptr;
2231 switch(pEntry->
nWID)
2234 rValue >>=
m_pImpl->m_pProps->sPar1;
2237 rValue >>=
m_pImpl->m_pProps->sPar2;
2240 rValue >>=
m_pImpl->m_pProps->sPar3;
2243 rValue >>=
m_pImpl->m_pProps->sPar4;
2246 rValue >>=
m_pImpl->m_pProps->nFormat;
2247 m_pImpl->m_pProps->bFormatIsDefault =
false;
2253 rValue >>=
m_pImpl->m_pProps->nByte1;
2256 pBool = &
m_pImpl->m_pProps->bBool1;
2259 pBool = &
m_pImpl->m_pProps->bBool2;
2262 pBool = &
m_pImpl->m_pProps->bBool3;
2265 pBool = &
m_pImpl->m_pProps->bBool4;
2269 auto aTemp = o3tl::tryAccess<util::Date>(rValue);
2271 throw lang::IllegalArgumentException();
2273 m_pImpl->m_pProps->aDate =
Date(aTemp->Day, aTemp->Month, aTemp->Year);
2282 m_pImpl->m_pProps->nUSHORT1 = nVal;
2284 m_pImpl->m_pProps->nUSHORT2 = nVal;
2288 rValue >>=
m_pImpl->m_pProps->nSHORT1;
2292 throw lang::IllegalArgumentException();
2293 rValue >>=
m_pImpl->m_pProps->fDouble;
2297 if (!
m_pImpl->m_pProps->pDateTime)
2298 m_pImpl->m_pProps->pDateTime.reset(
new util::DateTime );
2299 rValue >>= *
m_pImpl->m_pProps->pDateTime;
2302 rValue >>=
m_pImpl->m_pProps->aPropSeq;
2305 rValue >>=
m_pImpl->m_pProps->aStrings;
2312 throw lang::IllegalArgumentException();
2318 throw uno::RuntimeException();
2335 throw beans::UnknownPropertyException(
"Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > (
this ) );
2337 switch( pEntry->
nWID )
2340 aRet <<= text::WrapTextMode_NONE;
2343 aRet <<= text::TextContentAnchorType_AS_CHARACTER;
2347 uno::Sequence<text::TextContentAnchorType>
aTypes(1);
2348 text::TextContentAnchorType* pArray = aTypes.getArray();
2349 pArray[0] = text::TextContentAnchorType_AS_CHARACTER;
2360 bool bIsFieldUsed =
false;
2361 bool bIsFieldDisplayed =
false;
2377 else if (pViewShell)
2380 throw uno::RuntimeException();
2386 ?
m_pImpl->GetFormatField()->GetTextField() :
nullptr;
2388 throw uno::RuntimeException();
2396 bool bHidden = rTextNode.
IsHidden();
2399 sal_Int32 nHiddenStart;
2400 sal_Int32 nHiddenEnd;
2403 nHiddenStart, nHiddenEnd );
2411 bIsFieldUsed = bFrame || bHidden;
2412 bIsFieldDisplayed = bIsFieldUsed && !bHidden;
2421 switch(pEntry->
nWID)
2425 if (!
m_pImpl->m_xTextObject.is())
2431 uno::Reference<text::XText> xText(
m_pImpl->m_xTextObject.get());
2436 aRet <<=
m_pImpl->m_pProps->sPar1;
2439 aRet <<=
m_pImpl->m_pProps->sPar2;
2442 aRet <<=
m_pImpl->m_pProps->sPar3;
2445 aRet <<=
m_pImpl->m_pProps->sPar4;
2448 aRet <<=
m_pImpl->m_pProps->nFormat;
2451 aRet <<=
m_pImpl->m_pProps->nSubType;
2454 aRet <<=
m_pImpl->m_pProps->nByte1;
2457 aRet <<=
m_pImpl->m_pProps->bBool1;
2460 aRet <<=
m_pImpl->m_pProps->bBool2;
2463 aRet <<=
m_pImpl->m_pProps->bBool3;
2466 aRet <<=
m_pImpl->m_pProps->bBool4;
2469 aRet <<=
m_pImpl->m_pProps->aDate.GetUNODate();
2472 aRet <<= static_cast<sal_Int16>(
m_pImpl->m_pProps->nUSHORT1);
2475 aRet <<= static_cast<sal_Int16>(
m_pImpl->m_pProps->nUSHORT2);
2478 aRet <<=
m_pImpl->m_pProps->nSHORT1;
2481 aRet <<=
m_pImpl->m_pProps->fDouble;
2484 if (
m_pImpl->m_pProps->pDateTime)
2485 aRet <<= *
m_pImpl->m_pProps->pDateTime;
2488 aRet <<=
m_pImpl->m_pProps->aPropSeq;
2491 aRet <<=
m_pImpl->m_pProps->aStrings;
2500 throw uno::RuntimeException();
2507 OSL_FAIL(
"not implemented");
2512 OSL_FAIL(
"not implemented");
2517 OSL_FAIL(
"not implemented");
2522 OSL_FAIL(
"not implemented");
2531 switch(pField->
Which())
2574 m_pImpl->GetFormatField()->UpdateTextNode(
nullptr,
nullptr);
2577 m_pImpl->m_bCallUpdate =
true;
2582 return "SwXTextField";
2587 static const char aOldNamePart1[] =
".TextField.DocInfo.";
2588 static const char aOldNamePart2[] =
".TextField.";
2589 OUString sServiceNameCC( rOld );
2590 sal_Int32 nIdx = sServiceNameCC.indexOf( aOldNamePart1 );
2592 sServiceNameCC = sServiceNameCC.replaceAt( nIdx, strlen(aOldNamePart1),
".textfield.docinfo." );
2593 nIdx = sServiceNameCC.indexOf( aOldNamePart2 );
2595 sServiceNameCC = sServiceNameCC.replaceAt( nIdx, strlen(aOldNamePart2),
".textfield." );
2596 return sServiceNameCC;
2612 sal_Int32 nLen = sServiceName == sServiceNameCC ? 2 : 3;
2614 uno::Sequence< OUString > aRet( nLen );
2615 OUString* pArray = aRet.getArray();
2618 *pArray++ = sServiceNameCC;
2619 *pArray++ =
"com.sun.star.text.TextContent";
2628 uno::Reference<uno::XInterface>
const xThis(
m_wThis);
2633 lang::EventObject
const ev(xThis);
2640 if(rHint.
GetId() == SfxHintId::Dying)
2642 else if (
auto pLegacyHint = dynamic_cast<const sw::LegacyModifyHint*>(&rHint))
2644 switch(pLegacyHint->m_pOld ? pLegacyHint->m_pOld->Which() : 0)
2656 return m_pFormatField ? m_pFormatField->GetField() :
nullptr;
2661 return "SwXTextFieldMasters";
2671 uno::Sequence<OUString> aRet {
"com.sun.star.text.TextFieldMasters" };
2703 rTypeName = rName.getToken( 0,
'.', nIdx );
2704 if (rTypeName ==
"User")
2706 else if (rTypeName ==
"DDE")
2708 else if (rTypeName ==
"SetExpression")
2712 const OUString sFieldTypName( rName.getToken( 0,
'.', nIdx ));
2715 if( sUIName != sFieldTypName )
2718 else if (rTypeName.equalsIgnoreAsciiCase(
"DataBase"))
2720 rName = rName.copy(RTL_CONSTASCII_LENGTH(
"DataBase."));
2721 if (!rName.isEmpty())
2724 rName =
"DataBase." + rName;
2728 else if (rTypeName ==
"Bibliography")
2737 throw uno::RuntimeException();
2739 OUString
sName(rName), sTypeName;
2742 throw container::NoSuchElementException(
2743 "SwXTextFieldMasters::getByName(" + rName +
")",
2744 css::uno::Reference<css::uno::XInterface>());
2746 sName =
sName.copy(std::min(sTypeName.getLength()+1,
sName.getLength()));
2749 throw container::NoSuchElementException(
2750 "SwXTextFieldMasters::getByName(" + rName +
")",
2751 css::uno::Reference<css::uno::XInterface>());
2753 uno::Reference<beans::XPropertySet>
const xRet(
2755 return uno::makeAny(xRet);
2763 switch( rFieldType.
Which() )
2766 sField =
"User." + rFieldType.
GetName();
2769 sField =
"DDE." + rFieldType.
GetName();
2777 sField =
"DataBase." + rFieldType.
GetName().replaceAll(OUStringChar(
DB_DELIM),
".");
2781 sField =
"Bibliography";
2796 throw uno::RuntimeException();
2799 const size_t nCount = pFieldTypes->size();
2802 for(
size_t i = 0;
i < nCount; ++
i )
2806 OUString sFieldName;
2809 aFieldNames.push_back(sFieldName);
2820 throw uno::RuntimeException();
2822 OUString
sName(rName), sTypeName;
2827 sName =
sName.copy(std::min(sTypeName.getLength()+1,
sName.getLength()));
2843 throw uno::RuntimeException();
2855 Impl() : m_RefreshListeners(m_Mutex) { }
2860 return "SwXTextFieldTypes";
2870 uno::Sequence<OUString> aRet {
"com.sun.star.text.TextFields" };
2887 lang::EventObject
const ev(static_cast< ::cppu::OWeakObject&>(*
this));
2888 m_pImpl->m_RefreshListeners.disposeAndClear(ev);
2895 throw uno::RuntimeException();
2908 throw uno::RuntimeException();
2917 throw uno::RuntimeException();
2923 lang::EventObject
const event(static_cast< ::cppu::OWeakObject*>(
this));
2924 m_pImpl->m_RefreshListeners.notifyEach(
2925 & util::XRefreshListener::refreshed, event);
2929 const uno::Reference<util::XRefreshListener> & xListener)
2932 m_pImpl->m_RefreshListeners.addInterface(xListener);
2936 const uno::Reference<util::XRefreshListener> & xListener)
2939 m_pImpl->m_RefreshListeners.removeInterface(xListener);
2947 std::vector<uno::Reference<text::XTextField>>
m_Items;
2959 if(rHint.
GetId() == SfxHintId::Dying)
2967 return "SwXFieldEnumeration";
2975 uno::Sequence<OUString> SAL_CALL
2978 return {
"com.sun.star.text.FieldEnumeration" };
2987 const SwFieldTypes* pFieldTypes =
m_pImpl->m_pDoc->getIDocumentFieldsAccess().GetFieldTypes();
2988 const size_t nCount = pFieldTypes->size();
2992 std::vector<SwFormatField*> vFormatFields;
2994 std::for_each(vFormatFields.begin(), vFormatFields.end(),
2998 const std::vector< uno::Reference<text::XTextField> > MetaFields(
2999 m_pImpl->m_pDoc->GetMetaFieldManager().getMetaFields() );
3000 for (
const auto & rMetaField : MetaFields)
3002 m_pImpl->m_Items.push_back( rMetaField );
3006 for (
auto iter = rMarksAccess.getFieldmarksBegin(); iter != rMarksAccess.getFieldmarksEnd(); ++iter)
3020 return m_pImpl->m_nNextIndex <
static_cast<sal_Int32
>(
m_pImpl->m_Items.size());
3027 if (
m_pImpl->m_nNextIndex >= static_cast<sal_Int32>(
m_pImpl->m_Items.size()))
3028 throw container::NoSuchElementException(
3029 "SwXFieldEnumeration::nextElement",
3030 css::uno::Reference<css::uno::XInterface>());
3032 uno::Reference< text::XTextField > &rxField =
void SetToolTip(const OUString &rToolTip)
Sets the tool tip of the field.
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
#define PROPERTY_MAP_FLDTYP_CHAPTER
Instances of SwFields and those derived from it occur 0 to n times.
const SwDocInfoSubType DI_SUB_TIME
void SetValue(bool bHidden)
const SfxItemPropertySimpleEntry * getByName(std::u16string_view rName) const
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
void SetDelimiter(const OUString &s)
IDocumentStatistics const & getIDocumentStatistics() const
SwNode & GetNode(bool bPoint=true) const
#define PROPERTY_MAP_FLDTYP_DATABASE_SET_NUM
virtual const SwDoc * GetDoc() const =0
The shared part of a user field.
#define FIELD_PROP_DATE_TIME
Marks a position in the document model.
SwServiceType m_nServiceId
#define UNO_NAME_DDE_COMMAND_FILE
LanguageType GetLanguage() const
Language at field position.
virtual void SAL_CALL addVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
SwXTextFieldMasters(SwDoc *pDoc)
virtual const_iterator_t getAnnotationMarksEnd() const =0
#define UNO_NAME_IS_AUTOMATIC_UPDATE
std::unique_ptr< SwFieldProperties_Impl > m_pProps
virtual void SAL_CALL setPropertyValue(const OUString &rPropertyName, const css::uno::Any &rValue) override
static SwServiceType lcl_GetServiceForField(const SwField &rField)
::sw::UnoImplPtr< Impl > m_pImpl
#define PROPERTY_MAP_FLDTYP_HIDDEN_TEXT
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
sal_uInt32 GetFormat() const
Query parameters for dialog and for BASIC.
virtual void CalcLayout()
virtual sal_uInt16 GetSubType() const override
#define PROPERTY_MAP_FLDTYP_COMBINED_CHARACTERS
SwRect FindLayoutRect(const bool bPrtArea=false, const Point *pPoint=nullptr) const
SwFormatField * m_pFormatField
const SwExtendedSubType SUB_INVISIBLE
Invisible.
#define PROPERTY_MAP_FLDTYP_DDE
virtual ~SwXTextFieldTypes() override
#define FIELD_PROP_STRINGS
#define PROPERTY_MAP_FLDTYP_DATABASE_NEXT_SET
virtual css::uno::Any SAL_CALL getByName(const OUString &rName) override
virtual SwFieldType * GetFieldType(SwFieldIds nResId, const OUString &rName, bool bDbFieldMatching) const =0
void ChgExpStr(const OUString &rExpand, SwRootFrame const *pLayout)
void SetPromptText(const OUString &rStr)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
::comphelper::OInterfaceContainerHelper2 m_EventListeners
SwServiceType GetServiceId() const
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &rPropertyName) override
#define PROPERTY_MAP_FLDTYP_GET_REFERENCE
wrapper iterator: wraps iterator of implementation while hiding MarkBase class; only IMark instances ...
void SetOutlineLvl(sal_uInt8 n)
virtual void SetModified()=0
Must be called manually at changes of format.
static OUString LocalizeFormula(const SwSetExpField &rField, const OUString &rFormula, bool bQuery)
virtual void SAL_CALL dispose() override
const SwPosition * GetMark() const
const sal_Unicode cTokenSeparator
Base class of all fields.
virtual void SetPar2(const OUString &rStr) override
set the PostIt's text
#define FIELD_PROP_USHORT1
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &rIdentifier) override
Provides access to the marks of a document.
#define PROPERTY_MAP_FLDTYP_GET_EXP
const SfxItemPropertySet * GetPropertySet(sal_uInt16 PropertyId)
Impl(SwFieldType *const pType, SwDoc *pDoc, SwFieldIds nResId)
#define PROPERTY_MAP_FLDMSTR_USER
virtual void Invalidate() override
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
virtual void Notify(const SfxHint &rHint) override
void disposeAndClear(const css::lang::EventObject &rEvt)
bool IsAtEndOfMeta() const
const SwDocInfoSubType DI_COMMENT
virtual OUString SAL_CALL getPresentation(sal_Bool bShowCommand) override
SwFieldType * GetFieldType() const
SwTextNode * GetpTextNode() const
void SetTextObject(std::unique_ptr< OutlinerParaObject > pText)
const sal_uInt16 aDocInfoSubTypeFromService[]
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
IDocumentMarkAccess * getIDocumentMarkAccess()
const OUString & GetName() const
#define PROPERTY_MAP_FLDTYP_DOCINFO_REVISION
static css::uno::Reference< css::text::XTextField > CreateXTextField(SwDoc *pDoc, SwFormatField const *pFormat, SwServiceType nServiceId=SwServiceType::Invalid)
virtual bool DeleteAndJoin(SwPaM &, const bool bForceJoinNext=false)=0
complete delete of a given PaM
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
IDocumentContentOperations const & getIDocumentContentOperations() const
#define PROPERTY_MAP_FLDMSTR_DUMMY0
SAL_DLLPRIVATE css::uno::WeakReference< css::beans::XPropertySet > const & GetXObject() const
#define UNO_NAME_DDE_COMMAND_ELEMENT
constexpr TypedWhichId< SwFormatField > RES_TXTATR_ANNOTATION(59)
std::unique_ptr< Impl > m_pImpl
For old documents the Field-Which IDs must be preserved !!!
const SwDocInfoSubType DI_EDIT
css::uno::Reference< css::beans::XPropertySetInfo > const & getPropertySetInfo() const
#define FIELD_PROP_SUBTYPE
#define UNO_NAME_SUB_TYPE
#define PROPERTY_MAP_FLDTYP_DOCINFO_DATE_TIME
virtual sal_Bool SAL_CALL hasElements() override
virtual void SAL_CALL removeVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
void GatherFields(std::vector< SwFormatField * > &rvFormatFields, bool bCollectOnlyInDocNodes=true) const
uno::WeakReference< uno::XInterface > m_wThis
#define FIELD_PROP_FORMAT
static sal_uInt16 lcl_GetPropMapIdForFieldType(SwFieldIds nWhich)
void UpdateFields() const
virtual ~SwXFieldEnumeration() override
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
static void TransmuteLeadToInputField(SwSetExpField &rField)
Convert between SwSetExpField with InputFlag false and InputFlag true.
virtual void SAL_CALL addPropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
void SetFormatField(SwFormatField *pFormatField, SwDoc *pDoc)
uno::WeakReference< uno::XInterface > m_wThis
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &rPropertyName) override
virtual void SAL_CALL removeVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
invariant for SwAuthorityField is that it is always registered at its SwAuthorityFieldType via AddFie...
SwXFieldEnumeration(SwDoc &rDoc)
SwXTextFieldTypes(SwDoc *pDoc)
::sw::UnoImplPtr< Impl > m_pImpl
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
void ChgExpStr(const OUString &rExpand, SwRootFrame const *pLayout)
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
virtual sw::mark::IMark * makeAnnotationMark(const SwPaM &rPaM, const OUString &rName)=0
constexpr OUStringLiteral sServiceName
virtual sal_uInt16 GetSubType() const override
SwFieldType * m_pFieldType
virtual void SAL_CALL dispose() override
#define PROPERTY_MAP_FLDMSTR_BIBLIOGRAPHY
static SwFieldIds lcl_GetIdByName(OUString &rName, OUString &rTypeName)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
virtual void SAL_CALL removePropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
static bool getInstanceName(const SwFieldType &rFieldType, OUString &rName)
const SwDocInfoSubType DI_SUBJECT
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
sal_Int32 GetStart() const
virtual OUString SAL_CALL getImplementationName() override
#define PROPERTY_MAP_FLDTYP_REF_PAGE_SET
bool IsDescriptor() const
static css::uno::Reference< css::text::XTextContent > CreateXFieldmark(SwDoc &rDoc,::sw::mark::IMark *pMark, bool isReplacementObject=false)
void Width(tools::Long nNew)
#define PROPERTY_MAP_FLDTYP_DOCINFO_CUSTOM
void SetExpansion(const OUString &rStr)
#define UNO_NAME_CHAPTER_NUMBERING_LEVEL
const SwFormatField & GetFormatField() const
virtual void Notify(const SfxHint &) override
void SetSelectedItem(const OUString &rItem)
Sets the selected item.
#define PROPERTY_MAP_FLDTYP_DOCINFO_AUTHOR
const ServiceIdResId aServiceToRes[]
void SetExpansion(const OUString &rStr)
#define FIELD_PROP_DOUBLE
const SwGetSetExpType GSE_EXPR
Expression.
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhichId) const
#define UNO_NAME_DATA_COMMAND_TYPE
sal_Int32 m_nNextIndex
index of next element to be returned
::sw::UnoImplPtr< Impl > m_pImpl
#define PROPERTY_MAP_FLDTYP_DUMMY_0
virtual SwPageDesc * GetPageDescFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return required automatic page style.
#define PROPERTY_MAP_FLDTYP_DOCINFO_MISC
virtual OUString SAL_CALL getImplementationName() override
constexpr OUStringLiteral aData
#define SAL_N_ELEMENTS(arr)
const SwDocInfoSubType DI_CUSTOM
Impl(SwPageDesc *const pPageDesc, SwDoc *pDoc, SwFieldIds nResId)
#define UNO_NAME_DDE_COMMAND_TYPE
static SW_DLLPUBLIC const OUString & GetSpecialExtraProgName(const OUString &rExtraUIName)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void SAL_CALL addVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
static sal_Int32 lcl_PropName2TokenPos(std::u16string_view rPropertyName)
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &rIdentifier) override
PaM is Point and Mark: a selection of the document model.
static OUString GetProviderName(SwServiceType nObjectType)
const SwDocInfoSubType DI_PRINT
SwFormatField * GetFormatField()
virtual void SAL_CALL setPropertyValue(const OUString &rPropertyName, const css::uno::Any &rValue) override
constexpr TypedWhichId< SwFormatField > RES_TXTATR_FIELD(RES_TXTATR_NOEND_BEGIN)
#define PROPERTY_MAP_FLDTYP_REF_PAGE_GET
void SetExpansion(const OUString &rStr)
Impl(SwDoc *const pDoc, SwFormatField *const pFormat, SwServiceType nServiceId)
#define UNO_NAME_DEPENDENT_TEXT_FIELDS
void SetSetNumber(tools::Long nNum)
The non-shared part of a user field.
rtl::Reference< SwTextAPIObject > m_xTextObject
const SwPosition * GetPoint() const
const SwExtendedSubType SUB_CMD
Show command.
static sal_uInt16 GetFieldTypeMId(std::u16string_view rProperty, const SwFieldType &rTyp)
SwEditShell const * GetEditShell() const
const SwDocInfoSubType DI_KEYS
virtual OUString SAL_CALL getImplementationName() override
SAL_DLLPRIVATE void SetXObject(css::uno::Reference< css::beans::XPropertySet > const &xFieldMaster)
#define COM_TEXT_FLDMASTER_CC
#define FIELD_PROP_USHORT2
static sal_uInt16 lcl_GetPropertyMapOfService(SwServiceType nServiceId)
const SwDocInfoSubType DI_CREATE
SwFieldTypesEnum
List of FieldTypes at UI.
#define PROPERTY_MAP_FLDTYP_DATABASE
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
virtual sal_Bool SAL_CALL hasMoreElements() override
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
#define PROPERTY_MAP_FLDTYP_SCRIPT
Force hint expand (only matters for hints with CH_TXTATR).
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
const SfxItemPropertyMap & getPropertyMap() const
virtual OUString SAL_CALL getImplementationName() override
std::vector< uno::Reference< text::XTextField > > m_Items
IDocumentState const & getIDocumentState() const
virtual const_iterator_t getAnnotationMarksBegin() const =0
const SwDocInfoSubType DI_SUB_DATE
virtual void SAL_CALL addPropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
virtual void SAL_CALL addRefreshListener(const css::uno::Reference< css::util::XRefreshListener > &xListener) override
css::uno::Type const & get()
SwNodes & GetNodes()
Node is in which nodes-array/doc?
virtual const SwFieldTypes * GetFieldTypes() const =0
virtual sal_Bool SAL_CALL hasElements() override
virtual sal_Bool SAL_CALL hasByName(const OUString &rName) override
OUString SwResId(const char *pId)
SwTextField * GetFieldTextAttrAt(const sal_Int32 nIndex, const bool bIncludeInputFieldAtStart=false) const
Text operation/manipulation interface.
bool StartListening(SvtBroadcaster &rBroadcaster)
SwXFieldMaster(SwFieldType &rType, SwDoc *pDoc)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
#define PROPERTY_MAP_FLDTYP_USER
virtual ~SwXFieldMaster() override
virtual sal_uInt16 GetSubType() const
#define UNO_NAME_NUMBERING_SEPARATOR
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
#define PROPERTY_MAP_FLDTYP_DATETIME
virtual void QueryValue(css::uno::Any &rVal, sal_uInt16 nWhich) const
const SwPosition * Start() const
constexpr TypedWhichId< SwPtrMsgPoolItem > RES_REMOVE_UNO_OBJECT(179)
const OUString & GetName() const
bool XTextRangeToSwPaM(SwUnoInternalPaM &rToFill, const uno::Reference< text::XTextRange > &xTextRange,::sw::TextRangeMode const eMode)
#define PROPERTY_MAP_FLDTYP_JUMP_EDIT
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() override
#define PROPERTY_MAP_FLDTYP_DOC_INFO
SwFieldType * GetTyp() const
#define PROPERTY_MAP_FLDTYP_DOCINFO_EDIT_TIME
void SetText(const OUString &rText, SwRootFrame const *pLayout)
#define PROPERTY_MAP_FLDTYP_DOCSTAT
bool GetInputFlag() const
void SetName(const OUString &rName)
Sets the name of the field.
#define PROPERTY_MAP_FLDTYP_PAGE_NUM
void SetSeqNumber(sal_uInt16 n)
Logical number, sequence fields.
OUString getDataSource() const
const SwDocInfoSubType DI_SUB_AUTHOR
SwFieldType * GetFieldType(bool bDontCreate=false) const
SvtBroadcaster & GetNotifier()
void SetFieldType(SwFieldType *pType)
virtual void SAL_CALL removeRefreshListener(const css::uno::Reference< css::util::XRefreshListener > &xListener) override
#define PROPERTY_MAP_FLDTYP_INPUT
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.
SwTextNode is a paragraph in the document model.
virtual void SAL_CALL attach(const css::uno::Reference< css::text::XTextRange > &xTextRange) override
OUString ExpandField(bool bCached, SwRootFrame const *pLayout) const
expand the field.
#define PROPERTY_MAP_FLDTYP_HIDDEN_PARA
SwFormatField * GetFormatField()
static const std::vector< OUString > & GetExtraUINameArray()
SwFieldIds Which() const
ResId.
#define PROPERTY_MAP_FLDTYP_MACRO
#define UNO_NAME_INSTANCE_NAME
#define PROPERTY_MAP_FLDTYP_TEMPLATE_NAME
virtual OUString GetName() const
Only in derived classes.
virtual void UpdateDocStat(bool bCompleteAsync, bool bFields)=0
Updates the internal document's statistics.
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
const SwDocInfoSubType DI_DOCNO
static OUString Expand(sal_uInt16 nSubType)
virtual SwFieldType * InsertFieldType(const SwFieldType &)=0
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
SwXTextField(SwFormatField &rFormat, SwDoc &rDoc)
#define FIELD_PROP_PROP_SEQ
#define PROPERTY_MAP_FLDMSTR_SET_EXP
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr, bool bExpandCharToPara=false, SwTextAttr **ppNewTextAttr=nullptr)=0
Insert an attribute.
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
#define FN_UNO_ANCHOR_TYPE
#define PROPERTY_MAP_FLDMSTR_DATABASE
static OUString Expand(sal_uLong)
sal_Int32 GetIndex() const
INetProtocol GetProtocol() const
#define PROPERTY_MAP_FLDTYP_DATABASE_NAME
static OUString OldNameToNewName_Impl(const OUString &rOld)
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
virtual void Invalidate()
::comphelper::OInterfaceContainerHelper2 m_EventListeners
void SetInputFlag(bool bInp)
const SwPosition * End() const
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
virtual void SAL_CALL removePropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
#define PROPERTY_MAP_FLDTYP_DATABASE_NUM_SET
virtual void PutValue(const css::uno::Any &rVal, sal_uInt16 nWhich)
#define PROPERTY_MAP_FLDTYP_ANNOTATION
SwUnoPropertyMapProvider aSwMapProvider
virtual OUString GetFieldName() const
get name or content
#define PROPERTY_MAP_FLDTYP_BIBLIOGRAPHY
const SwField * GetField() const
Sequence< sal_Int8 > aSeq
const SwGetSetExpType GSE_FORMULA
Formula.
static SwFieldIds lcl_ServiceIdToResId(SwServiceType nServiceId)
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
#define UNO_NAME_DATA_BASE_URL
#define FN_UNO_ANCHOR_TYPES
constexpr TypedWhichId< SwFormatField > RES_TXTATR_INPUTFIELD(55)
void SetExpansion(const OUString &rStr)
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
#define UNO_NAME_DATA_TABLE_NAME
virtual void CalcLayout() override
To enable set up of StartActions and EndActions.
virtual OUString SAL_CALL getImplementationName() override
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
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.
#define UNO_NAME_DATA_COLUMN_NAME
#define UNO_NAME_DATA_BASE_NAME
#define PROPERTY_MAP_FLDTYP_AUTHOR
virtual void SAL_CALL refresh() override
#define PROPERTY_MAP_PARAGRAPH_EXTENSIONS
#define FIELD_PROP_IS_FIELD_DISPLAYED
#define PROPERTY_MAP_FLDTYP_USER_EXT
virtual ~SwXTextField() override
void SetFieldType(SwFieldType &rType)
::comphelper::OInterfaceContainerHelper2 m_RefreshListeners
void SetHelp(const OUString &rHelp)
Sets the help text of the field.
bool SetURL(OUString const &rTheAbsURIRef, EncodeMechanism eMechanism=EncodeMechanism::WasEncoded, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
bool IsDocNodes() const
Is the NodesArray the regular one of Doc? (and not the UndoNds, ...) Implementation in doc...
const SwGetSetExpType GSE_STRING
String.
virtual void SetValue(const double &rVal)
detail::Optional< bool >::type tryAccess< bool >(css::uno::Any const &any)
virtual SwFieldType * GetSysFieldType(const SwFieldIds eWhich) const =0
const SwDocInfoSubType DI_SUB_FIXED
if(!pCandidateA->getEnd().equal(pCandidateB->getStart()))
const SwDocInfoSubType DI_CHANGE
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
#define PROPERTY_MAP_FLDTYP_DROPDOWN
virtual css::uno::Type SAL_CALL getElementType() override
const char *const aFieldNames[]
virtual void SAL_CALL attachTextFieldMaster(const css::uno::Reference< css::beans::XPropertySet > &xFieldMaster) override
#define PROPERTY_MAP_FLDTYP_CONDITIONED_TEXT
virtual css::uno::Any SAL_CALL nextElement() override
virtual void UpdateFields(bool bCloseDB)=0
SwTextNode & GetTextNode() const
#define UNO_NAME_IS_EXPRESSION
static OUString GetProgrammaticName(const SwFieldType &rType, SwDoc &rDoc)
virtual ~SwXTextFieldMasters() override
virtual css::uno::Type SAL_CALL getElementType() override
OUString setToken(const OUString &rIn, sal_Int32 nToken, sal_Unicode cTok, const OUString &rNewToken)
const SwDocInfoSubType DI_TITLE
#define FIELD_PROP_IS_FIELD_USED
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getTextFieldMaster() override
#define PROPERTY_MAP_FLDMSTR_DDE
void SetHidden(bool bHidden)
static void GetPamForTextField(const SwTextField &rTextField, std::shared_ptr< SwPaM > &rPamForTextField)
#define PROPERTY_MAP_FLDTYP_FILE_NAME
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
#define PROPERTY_MAP_FLDTYP_TABLE_FORMULA
SwServiceType
entries in this enum are mapped in an array in unocoll.cxx
sal_Int32 GetEnumAsInt32(const css::uno::Any &rVal)
constexpr TypedWhichId< SwPtrMsgPoolItem > RES_OBJECTDYING(RES_MSG_BEGIN)
const SfxItemPropertyMapEntry * GetPropertyMapEntries(sal_uInt16 PropertyId)
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
#define PROPERTY_MAP_FLDTYP_SET_EXP
void SetItems(const std::vector< OUString > &rItems)
Sets the items of the dropdown box.
static void DeleteTextField(const SwTextField &rTextField)
static const OUString & GetSpecialExtraUIName(const OUString &rExtraProgName)
virtual void SAL_CALL update() override
void SetLateInitialization()
static css::uno::Reference< css::beans::XPropertySet > CreateXFieldMaster(SwDoc *pDoc, SwFieldType *pType, SwFieldIds nResId=SwFieldIds::Unknown)
void SetUserString(const OUString &rS)
virtual sal_uInt16 GetSubType() const override
virtual void Notify(const SfxHint &rHint) override
#define FIELD_PROP_SHORT1
void SetOffset(tools::Long nMinutes)
static const OUString & GetProgName(const OUString &rName, SwGetPoolIdFromName)