24 #include <com/sun/star/beans/PropertyAttribute.hpp>
25 #include <com/sun/star/container/XIndexReplace.hpp>
26 #include <com/sun/star/frame/XModel.hpp>
27 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
28 #include <com/sun/star/text/ChapterFormat.hpp>
29 #include <com/sun/star/text/ReferenceFieldPart.hpp>
30 #include <com/sun/star/text/BibliographyDataField.hpp>
31 #include <com/sun/star/text/XTextDocument.hpp>
33 #include <osl/mutex.hxx>
59 #include <strings.hrc>
77 throw lang::IllegalArgumentException();
85 T & rBitMask,
const T nBit)
87 rBitMask = lcl_AnyToType<bool>(rValue)
94 const T nBitMask,
const T nBit)
96 const bool bRet(nBitMask & nBit);
105 for(sal_uInt16 nUser = 0; nUser < nUserCount; nUser++)
126 #define USER_AND_SUFFIXLEN 19
164 typedef ::cppu::WeakImplHelper
166 , container::XIndexReplace
186 virtual uno::Sequence< OUString > SAL_CALL
194 virtual sal_Int32 SAL_CALL
getCount()
override;
198 virtual void SAL_CALL
203 typedef ::cppu::WeakImplHelper
205 , container::XIndexReplace
226 virtual uno::Sequence< OUString > SAL_CALL
234 virtual sal_Int32 SAL_CALL
getCount()
override;
238 virtual void SAL_CALL
245 class SwDocIndexDescriptorProperties_Impl
248 std::unique_ptr<SwTOXBase> m_pTOXBase;
249 OUString m_sUserTOXTypeName;
252 explicit SwDocIndexDescriptorProperties_Impl(
SwTOXType const*
const pType);
254 SwTOXBase & GetTOXBase() {
return *m_pTOXBase; }
255 const OUString& GetTypeName()
const {
return m_sUserTOXTypeName; }
256 void SetTypeName(
const OUString& rSet) { m_sUserTOXTypeName = rSet; }
261 SwDocIndexDescriptorProperties_Impl::SwDocIndexDescriptorProperties_Impl(
265 m_pTOXBase.reset(
new SwTOXBase(pType, aForm,
304 std::unique_ptr<SwDocIndexDescriptorProperties_Impl>
m_pProps;
309 : m_pFormat(pBaseSection ? pBaseSection->
GetFormat() : nullptr)
310 , m_Listeners(m_Mutex)
313 , m_bIsDescriptor(nullptr == pBaseSection)
315 , m_pProps(m_bIsDescriptor
316 ? new SwDocIndexDescriptorProperties_Impl(rDoc.GetTOXType(eType, 0))
326 m_pFormat = &rFormat;
337 SwTOXBase *
const pTOXSection( m_bIsDescriptor
338 ? &m_pProps->GetTOXBase()
344 throw uno::RuntimeException(
345 "SwXDocumentIndex: disposed or invalid",
nullptr);
353 return m_bIsDescriptor
363 if (rHint.
GetId() == SfxHintId::SwLegacyModify)
369 else if(rHint.
GetId() == SfxHintId::Dying)
374 uno::Reference<uno::XInterface>
const xThis(
m_wThis);
379 lang::EventObject
const ev(xThis);
387 rDoc, rBaseSection.
SwTOXBase::GetType(), & rBaseSection) )
400 uno::Reference<text::XDocumentIndex>
406 uno::Reference<text::XDocumentIndex> xIndex;
410 xIndex.set(pFormat->
GetXObject(), uno::UNO_QUERY);
423 pIndex->
m_pImpl->m_wThis = xIndex;
431 return theSwXDocumentIndexUnoTunnelId.
getSeq();
437 return comphelper::getSomethingImpl<SwXDocumentIndex>(rId,
this);
443 return "SwXDocumentIndex";
452 uno::Sequence< OUString > SAL_CALL
457 uno::Sequence< OUString > aRet(2);
458 OUString* pArray = aRet.getArray();
459 pArray[0] =
"com.sun.star.text.BaseIndex";
463 pArray[1] =
"com.sun.star.text.DocumentIndex";
466 pArray[1] =
"com.sun.star.text.ContentIndex";
469 pArray[1] =
"com.sun.star.text.TableIndex";
472 pArray[1] =
"com.sun.star.text.IllustrationsIndex";
475 pArray[1] =
"com.sun.star.text.ObjectIndex";
478 pArray[1] =
"com.sun.star.text.Bibliography";
482 pArray[1] =
"com.sun.star.text.UserDefinedIndex";
517 uno::Reference< beans::XPropertySetInfo > SAL_CALL
522 const uno::Reference< beans::XPropertySetInfo > xRef =
523 m_pImpl->m_rPropSet.getPropertySetInfo();
529 const OUString& rPropertyName,
const uno::Any& rValue)
534 m_pImpl->m_rPropSet.getPropertyMap().getByName(rPropertyName);
537 throw beans::UnknownPropertyException(
538 "Unknown property: " + rPropertyName,
539 static_cast<cppu::OWeakObject *>(
this));
541 if (pEntry->
nFlags & beans::PropertyAttribute::READONLY)
543 throw beans::PropertyVetoException(
544 "Property is read-only: " + rPropertyName,
545 static_cast<cppu::OWeakObject *>(
this));
553 const TOXTypes eTxBaseType = rTOXBase.GetTOXType()->GetType();
556 SwForm aForm(rTOXBase.GetTOXForm());
558 switch (pEntry->
nWID)
563 if (!(rValue >>= sNewName))
565 throw lang::IllegalArgumentException();
567 rTOXBase.SetTitle(sNewName);
573 if (!(rValue >>= sNewName))
575 throw lang::IllegalArgumentException();
577 rTOXBase.SetTOXName(sNewName);
583 if (!(rValue >>= sNewName))
585 throw lang::IllegalArgumentException();
589 "tox type name can only be changed for user indexes");
592 if (rTOXBase.GetTOXType()->GetTypeName() != sNewName)
600 m_pImpl->m_pProps->SetTypeName(sNewName);
606 lang::Locale aLocale;
607 if (!(rValue>>= aLocale))
609 throw lang::IllegalArgumentException();
617 if (!(rValue >>= sTmp))
619 throw lang::IllegalArgumentException();
621 rTOXBase.SetSortAlgorithm(sTmp);
626 rTOXBase.SetLevel(lcl_AnyToType<sal_Int16>(rValue));
631 rTOXBase.SetBookmarkName(lcl_AnyToType<OUString>(rValue));
633 rTOXBase.SetCreate(nCreate);
657 rTOXBase.SetFromChapter(lcl_AnyToType<bool>(rValue));
660 rTOXBase.SetFromObjectNames(! lcl_AnyToType<bool>(rValue));
664 bool bSet = lcl_AnyToType<bool>(rValue);
665 rTOXBase.SetProtected(bSet);
700 aForm.SetCommaSeparated(lcl_AnyToType<bool>(rValue));
707 lcl_AnyToType<OUString>(rValue) ) );
712 const sal_Int16 nVal = lcl_AnyToType<sal_Int16>(rValue);
716 case text::ReferenceFieldPart::TEXT:
719 case text::ReferenceFieldPart::CATEGORY_AND_NUMBER:
722 case text::ReferenceFieldPart::ONLY_CAPTION:
726 throw lang::IllegalArgumentException();
728 rTOXBase.SetCaptionDisplay(static_cast<SwCaptionDisplay>(nSet));
732 rTOXBase.SetLevelFromChapter(lcl_AnyToType<bool>(rValue));
739 rTOXBase.SetMainEntryCharStyle( aString );
777 aForm.SetTemplate( 0, aString );
782 aForm.SetRelTabPos(lcl_AnyToType<bool>(rValue));
790 aForm.SetTemplate( 1, aString );
810 const sal_uInt16 nLPos = rTOXBase.GetType() ==
TOX_INDEX ? 2 : 1;
824 m_pImpl->m_rPropSet.setPropertyValue(
825 rPropertyName, rValue, aAttrSet);
828 for (
size_t i = 0;
i < rSects.
size(); ++
i)
831 if (pTmpFormat == pSectionFormat)
834 static_cast<SwTOXBaseSection&>(rTOXBase));
835 m_pImpl->m_pDoc->UpdateSection(
i, tmpData, & aAttrSet);
841 rTOXBase.SetCreate(nCreate);
842 rTOXBase.SetOLEOptions(nOLEOptions);
843 if (rTOXBase.GetTOXType()->GetType() ==
TOX_INDEX)
845 rTOXBase.SetOptions(nTOIOptions);
849 rTOXBase.SetTOXForm(aForm);
860 m_pImpl->m_rPropSet.getPropertyMap().getByName(rPropertyName);
863 throw beans::UnknownPropertyException(
864 "Unknown property: " + rPropertyName,
865 static_cast< cppu::OWeakObject * >(
this));
870 throw uno::RuntimeException(
"Getting GraphicURL property is not supported");
879 else if (
m_pImpl->m_bIsDescriptor)
881 pTOXBase = &
m_pImpl->m_pProps->GetTOXBase();
888 (pTOXBase->GetTOXType()->GetType() ==
TOX_INDEX)
889 ? pTOXBase->GetOptions()
891 const SwForm& rForm = pTOXBase->GetTOXForm();
898 const uno::Reference <text::XTextSection> xContentSect =
900 aRet <<= xContentSect;
902 else if (pSectionFormat)
905 pSectionFormat->GetChildSections(aSectArr,
911 const uno::Reference <text::XTextSection> xHeader =
913 pSect->GetFormat() );
922 aRet <<= pTOXBase->GetTitle();
926 aRet <<= pTOXBase->GetTOXName();
930 OUString sTmp((!
m_pImpl->m_bIsDescriptor)
931 ? pTOXBase->GetTOXType()->GetTypeName()
932 :
m_pImpl->m_pProps->GetTypeName());
942 aRet <<= pTOXBase->GetSortAlgorithm();
945 aRet <<= static_cast<sal_Int16>(pTOXBase->GetLevel());
948 aRet <<= pTOXBase->GetBookmarkName();
959 const bool bRet = pTOXBase->IsFromChapter();
965 const bool bRet = ! pTOXBase->IsFromObjectNames();
971 const bool bRet = pTOXBase->IsProtected();
1013 pTOXBase->GetSequenceName() );
1018 sal_Int16 nSet = text::ReferenceFieldPart::TEXT;
1019 switch (pTOXBase->GetCaptionDisplay())
1022 nSet = text::ReferenceFieldPart::TEXT;
1025 nSet = text::ReferenceFieldPart::CATEGORY_AND_NUMBER;
1028 nSet = text::ReferenceFieldPart::ONLY_CAPTION;
1036 const bool bRet = pTOXBase->IsLevelFromChapter();
1042 uno::Reference< container::XIndexReplace > xTokenAccess(
1044 if (!xTokenAccess.is())
1047 m_pImpl->m_wTokenAccess = xTokenAccess;
1049 aRet <<= xTokenAccess;
1054 uno::Reference< container::XIndexReplace > xStyleAccess(
1056 if (!xStyleAccess.is())
1059 m_pImpl->m_wStyleAccess = xStyleAccess;
1061 aRet <<= xStyleAccess;
1068 pTOXBase->GetMainEntryCharStyle(),
1136 const sal_uInt16 nLPos = pTOXBase->GetType() ==
TOX_INDEX ? 2 : 1;
1154 const SwTOXType* pType = pTOXBase->GetTOXType();
1156 uno::Sequence< uno::Reference<text::XDocumentIndexMark> > aXMarks(aMarks.size());
1157 uno::Reference<text::XDocumentIndexMark>* pxMarks = aXMarks.getArray();
1158 for(
size_t i = 0;
i < aMarks.size(); ++
i)
1173 aRet =
m_pImpl->m_rPropSet.getPropertyValue(
1174 rPropertyName, rSet);
1184 const uno::Reference< beans::XPropertyChangeListener >& )
1186 OSL_FAIL(
"SwXDocumentIndex::addPropertyChangeListener(): not implemented");
1192 const uno::Reference< beans::XPropertyChangeListener >& )
1194 OSL_FAIL(
"SwXDocumentIndex::removePropertyChangeListener(): not implemented");
1200 const uno::Reference< beans::XVetoableChangeListener >& )
1202 OSL_FAIL(
"SwXDocumentIndex::addVetoableChangeListener(): not implemented");
1208 const uno::Reference< beans::XVetoableChangeListener >& )
1210 OSL_FAIL(
"SwXDocumentIndex::removeVetoableChangeListener(): not implemented");
1227 else if (pViewShell)
1244 throw uno::RuntimeException(
1245 "SwXDocumentIndex::refresh: must be in attached state",
1246 static_cast< ::cppu::OWeakObject*>(
this));
1248 pTOXBase->
Update(
nullptr,
m_pImpl->m_pDoc->getIDocumentLayoutAccess().GetCurrentLayout());
1258 m_pImpl->m_Listeners.getContainer(
1262 lang::EventObject
const event(static_cast< ::cppu::OWeakObject*>(
this));
1263 pContainer->notifyEach(& util::XRefreshListener::refreshed, event);
1268 const uno::Reference<util::XRefreshListener>& xListener)
1271 m_pImpl->m_Listeners.addInterface(
1276 const uno::Reference<util::XRefreshListener>& xListener)
1279 m_pImpl->m_Listeners.removeInterface(
1288 if (!
m_pImpl->m_bIsDescriptor)
1290 throw uno::RuntimeException();
1292 const uno::Reference<XUnoTunnel> xRangeTunnel( xTextRange, uno::UNO_QUERY);
1294 comphelper::getFromUnoTunnel<SwXTextRange>(xRangeTunnel);
1296 comphelper::getFromUnoTunnel<OTextCursorHelper>(xRangeTunnel);
1299 pRange ? &pRange->
GetDoc() : (pCursor ? pCursor->GetDoc() :
nullptr);
1302 throw lang::IllegalArgumentException();
1312 throw lang::IllegalArgumentException();
1326 pDoc->InsertTableOf( aPam, rTOXBase,
nullptr,
false,
1327 m_pImpl->m_pDoc->getIDocumentLayoutAccess().GetCurrentLayout());
1329 pDoc->SetTOXBaseName(*pTOX,
m_pImpl->m_pProps->GetTOXBase().GetTOXName());
1338 m_pImpl->m_bIsDescriptor =
false;
1341 uno::Reference< text::XTextRange > SAL_CALL
1347 if (!pSectionFormat)
1349 throw uno::RuntimeException();
1352 uno::Reference< text::XTextRange > xRet;
1353 SwNodeIndex const*
const pIdx( pSectionFormat->GetContent().GetContentIdx() );
1354 if (pIdx && pIdx->GetNode().GetNodes().IsDocNodes())
1375 *static_cast<SwTOXBaseSection*>(pSectionFormat->GetSection()),
1382 const uno::Reference< lang::XEventListener > & xListener)
1385 m_pImpl->m_Listeners.addInterface(
1391 const uno::Reference< lang::XEventListener > & xListener)
1394 m_pImpl->m_Listeners.removeInterface(
1405 return m_pImpl->m_pProps->GetTOXBase().GetTOXName();
1410 throw uno::RuntimeException();
1413 return pSectionFormat->GetSection()->GetSectionName();
1421 if (rName.isEmpty())
1423 throw uno::RuntimeException();
1429 m_pImpl->m_pProps->GetTOXBase().SetTOXName(rName);
1431 else if (pSectionFormat)
1433 const bool bSuccess = pSectionFormat->GetDoc()->SetTOXBaseName(
1434 *static_cast<SwTOXBaseSection*>(pSectionFormat->GetSection()), rName);
1437 throw uno::RuntimeException();
1442 throw uno::RuntimeException();
1450 return pSectionFormat;
1458 SwDocShell const*
const pShell( pSectionFormat->GetDoc()->GetDocShell() );
1459 return pShell ? pShell->
GetModel() :
nullptr;
1513 , m_bInReplaceMark(
false)
1517 , m_bIsDescriptor(nullptr == pMark)
1521 , m_bMainEntry(
false)
1548 m_bInReplaceMark =
true;
1550 m_bInReplaceMark =
false;
1554 OSL_FAIL(
"ReplaceTOXMark() failed!");
1555 lang::EventObject
const ev(
1556 static_cast< ::cppu::OWeakObject&>(m_rThis));
1557 std::unique_lock aGuard(m_Mutex);
1571 uno::Reference<uno::XInterface>
const xThis(
m_wThis);
1575 lang::EventObject
const ev(xThis);
1576 std::unique_lock aGuard(
m_Mutex);
1588 if(
auto pModifyChangedHint = dynamic_cast<const sw::ModifyChangedHint*>(&rHint))
1590 if(
auto pNewType = dynamic_cast<const SwTOXType*>(pModifyChangedHint->m_pNew))
1591 m_pTOXType = pNewType;
1614 uno::Reference<text::XDocumentIndexMark>
1621 uno::Reference<text::XDocumentIndexMark> xTOXMark;
1630 *const_cast<SwTOXType*>(pMark->
GetTOXType()), *pMark)
1638 pNew->
m_pImpl->m_wThis = xTOXMark;
1650 return theSwXDocumentIndexMarkUnoTunnelId.
getSeq();
1656 return comphelper::getSomethingImpl<SwXDocumentIndexMark>(rId,
this);
1662 return "SwXDocumentIndexMark";
1670 uno::Sequence< OUString > SAL_CALL
1676 uno::Sequence< OUString > aRet(nCnt);
1677 OUString* pArray = aRet.getArray();
1678 pArray[0] =
"com.sun.star.text.BaseIndexMark";
1679 pArray[1] =
"com.sun.star.text.TextContent";
1683 pArray[2] =
"com.sun.star.text.UserIndexMark";
1686 pArray[2] =
"com.sun.star.text.ContentIndexMark";
1689 pArray[2] =
"com.sun.star.text.DocumentIndexMark";
1690 pArray[3] =
"com.sun.star.text.DocumentIndexMarkAsian";
1705 if (pType &&
m_pImpl->m_pTOXMark)
1707 return m_pImpl->m_pTOXMark->GetAlternativeText();
1710 if (!
m_pImpl->m_bIsDescriptor)
1712 throw uno::RuntimeException();
1724 if (pType &&
m_pImpl->m_pTOXMark)
1729 m_pImpl->m_pTOXMark->GetTextTOXMark();
1732 if(pTextMark->
End())
1734 aPam.GetPoint()->nContent = *pTextMark->
End();
1737 ++aPam.GetPoint()->nContent;
1739 m_pImpl->ReplaceTOXMark(*pType, aMark, aPam);
1741 else if (
m_pImpl->m_bIsDescriptor)
1743 m_pImpl->m_sAltText = rIndexEntry;
1747 throw uno::RuntimeException();
1753 const uno::Reference< text::XTextRange > & xTextRange)
1757 if (!
m_pImpl->m_bIsDescriptor)
1759 throw uno::RuntimeException();
1762 const uno::Reference<XUnoTunnel> xRangeTunnel(xTextRange, uno::UNO_QUERY);
1764 comphelper::getFromUnoTunnel<SwXTextRange>(xRangeTunnel);
1766 comphelper::getFromUnoTunnel<OTextCursorHelper>(xRangeTunnel);
1768 pRange ? &pRange->
GetDoc() : (pCursor ? pCursor->GetDoc() :
nullptr);
1771 throw lang::IllegalArgumentException();
1780 pTOXType = pDoc->GetTOXType(
m_pImpl->m_eTOXType, 0 );
1784 if (
m_pImpl->m_sUserIndexName.isEmpty())
1786 pTOXType = pDoc->GetTOXType(
m_pImpl->m_eTOXType, 0 );
1790 const sal_uInt16
nCount =
1791 pDoc->GetTOXTypeCount(
m_pImpl->m_eTOXType);
1792 for (sal_uInt16
i = 0;
i < nCount;
i++)
1795 pDoc->GetTOXType(
m_pImpl->m_eTOXType,
i );
1805 pTOXType = pDoc->InsertTOXType(aUserType);
1816 throw lang::IllegalArgumentException();
1823 if (!
m_pImpl->m_sAltText.isEmpty())
1830 if (!
m_pImpl->m_sPrimaryKey.isEmpty())
1834 if (!
m_pImpl->m_sSecondaryKey.isEmpty())
1838 if (!
m_pImpl->m_sTextReading.isEmpty())
1842 if (!
m_pImpl->m_sPrimaryKeyReading.isEmpty())
1846 if (!
m_pImpl->m_sSecondaryKeyReading.isEmpty())
1857 if (USHRT_MAX !=
m_pImpl->m_nLevel)
1867 m_pImpl->InsertTOXMark(*const_cast<SwTOXType *>(pTOXType), aMark, aPam,
1868 dynamic_cast<SwXTextCursor const*>(pCursor));
1870 m_pImpl->m_bIsDescriptor =
false;
1875 template<
typename T>
struct NotContainedIn
1877 std::vector<T>
const& m_rVector;
1878 explicit NotContainedIn(std::vector<T>
const& rVector)
1879 : m_rVector(rVector) { }
1880 bool operator() (T
const& rT) {
1881 return std::find(m_rVector.begin(), m_rVector.end(), rT)
1909 const bool bForceExpandHints( !bMark && pTextCursor && pTextCursor->
IsAtEndOfMeta() );
1910 const SetAttrMode nInsertFlags = bForceExpandHints
1918 rDoc.getIDocumentContentOperations().InsertPoolItem(rPam, rMark, nInsertFlags,
1919 nullptr, &pNewTextAttr);
1927 throw uno::RuntimeException(
1928 "SwXDocumentIndexMark::InsertTOXMark(): cannot insert attribute",
1940 uno::Reference< text::XTextRange > SAL_CALL
1946 if (!pType || !
m_pImpl->m_pTOXMark)
1948 throw uno::RuntimeException();
1950 if (!
m_pImpl->m_pTOXMark->GetTextTOXMark())
1952 throw uno::RuntimeException();
1957 if(pTextMark->
End())
1959 aPam.GetPoint()->nContent = *pTextMark->
End();
1963 ++aPam.GetPoint()->nContent;
1965 const uno::Reference< frame::XModel >
xModel =
1966 m_pImpl->m_pDoc->GetDocShell()->GetBaseModel();
1967 const uno::Reference< text::XTextDocument > xTDoc(xModel, uno::UNO_QUERY);
1968 const uno::Reference< text::XTextRange > xRet =
1980 if (pType &&
m_pImpl->m_pTOXMark)
1988 const uno::Reference< lang::XEventListener > & xListener)
1991 std::unique_lock aGuard(
m_pImpl->m_Mutex);
1992 m_pImpl->m_EventListeners.addInterface(aGuard, xListener);
1997 const uno::Reference< lang::XEventListener > & xListener)
2000 std::unique_lock aGuard(
m_pImpl->m_Mutex);
2001 m_pImpl->m_EventListeners.removeInterface(aGuard, xListener);
2004 uno::Reference< beans::XPropertySetInfo > SAL_CALL
2009 static uno::Reference< beans::XPropertySetInfo > xInfos[3];
2019 if(!xInfos[nPos].is())
2021 const uno::Reference< beans::XPropertySetInfo > xInfo =
2022 m_pImpl->m_rPropSet.getPropertySetInfo();
2024 const uno::Sequence<beans::Property> aPropSeq = xInfo->getProperties();
2030 return xInfos[nPos];
2035 const OUString& rPropertyName,
const uno::Any& rValue)
2040 m_pImpl->m_rPropSet.getPropertyMap().getByName(rPropertyName);
2043 throw beans::UnknownPropertyException(
2044 "Unknown property: " + rPropertyName,
2045 static_cast<cppu::OWeakObject *>(
this));
2047 if (pEntry->
nFlags & beans::PropertyAttribute::READONLY)
2049 throw beans::PropertyVetoException(
2050 "Property is read-only: " + rPropertyName,
2051 static_cast<cppu::OWeakObject *>(
this));
2055 if (pType &&
m_pImpl->m_pTOXMark)
2058 switch(pEntry->
nWID)
2065 static_cast<sal_Int8>(lcl_AnyToType<sal_Int16>(rValue)+1)));
2090 m_pImpl->m_pTOXMark->GetTextTOXMark();
2093 if(pTextMark->
End())
2095 aPam.GetPoint()->nContent = *pTextMark->
End();
2099 ++aPam.GetPoint()->nContent;
2102 m_pImpl->ReplaceTOXMark(*pType, aMark, aPam);
2104 else if (
m_pImpl->m_bIsDescriptor)
2106 switch(pEntry->
nWID)
2109 m_pImpl->m_sAltText = lcl_AnyToType<OUString>(rValue);
2113 const sal_Int16 nVal = lcl_AnyToType<sal_Int16>(rValue);
2116 throw lang::IllegalArgumentException();
2123 m_pImpl->m_aBookmarkName = lcl_AnyToType<OUString>(rValue);
2127 m_pImpl->m_sPrimaryKey = lcl_AnyToType<OUString>(rValue);
2130 m_pImpl->m_sSecondaryKey = lcl_AnyToType<OUString>(rValue);
2133 m_pImpl->m_sTextReading = lcl_AnyToType<OUString>(rValue);
2136 m_pImpl->m_sPrimaryKeyReading = lcl_AnyToType<OUString>(rValue);
2139 m_pImpl->m_sSecondaryKeyReading = lcl_AnyToType<OUString>(rValue);
2143 OUString sTmp(lcl_AnyToType<OUString>(rValue));
2145 m_pImpl->m_sUserIndexName = sTmp;
2149 m_pImpl->m_bMainEntry = lcl_AnyToType<bool>(rValue);
2158 throw uno::RuntimeException();
2169 m_pImpl->m_rPropSet.getPropertyMap().getByName(rPropertyName);
2172 throw beans::UnknownPropertyException(
2173 "Unknown property: " + rPropertyName,
2174 static_cast<cppu::OWeakObject *>(
this));
2182 if (pType &&
m_pImpl->m_pTOXMark)
2184 switch(pEntry->
nWID)
2187 aRet <<=
m_pImpl->m_pTOXMark->GetAlternativeText();
2190 aRet <<= static_cast<sal_Int16>(
2191 m_pImpl->m_pTOXMark->GetLevel() - 1);
2194 aRet <<=
m_pImpl->m_pTOXMark->GetBookmarkName();
2197 aRet <<=
m_pImpl->m_pTOXMark->GetPrimaryKey();
2200 aRet <<=
m_pImpl->m_pTOXMark->GetSecondaryKey();
2203 aRet <<=
m_pImpl->m_pTOXMark->GetTextReading();
2206 aRet <<=
m_pImpl->m_pTOXMark->GetPrimaryKeyReading();
2209 aRet <<=
m_pImpl->m_pTOXMark->GetSecondaryKeyReading();
2220 const bool bTemp =
m_pImpl->m_pTOXMark->IsMainEntry();
2226 else if (
m_pImpl->m_bIsDescriptor)
2228 switch(pEntry->
nWID)
2234 aRet <<= static_cast<sal_Int16>(
m_pImpl->m_nLevel);
2237 aRet <<=
m_pImpl->m_aBookmarkName;
2240 aRet <<=
m_pImpl->m_sPrimaryKey;
2243 aRet <<=
m_pImpl->m_sSecondaryKey;
2246 aRet <<=
m_pImpl->m_sTextReading;
2249 aRet <<=
m_pImpl->m_sPrimaryKeyReading;
2252 aRet <<=
m_pImpl->m_sSecondaryKeyReading;
2255 aRet <<=
m_pImpl->m_sUserIndexName;
2258 aRet <<=
m_pImpl->m_bMainEntry;
2264 throw uno::RuntimeException();
2272 const uno::Reference< beans::XPropertyChangeListener >& )
2274 OSL_FAIL(
"SwXDocumentIndexMark::addPropertyChangeListener(): not implemented");
2280 const uno::Reference< beans::XPropertyChangeListener >& )
2282 OSL_FAIL(
"SwXDocumentIndexMark::removePropertyChangeListener(): not implemented");
2288 const uno::Reference< beans::XVetoableChangeListener >& )
2290 OSL_FAIL(
"SwXDocumentIndexMark::addVetoableChangeListener(): not implemented");
2296 const uno::Reference< beans::XVetoableChangeListener >& )
2298 OSL_FAIL(
"SwXDocumentIndexMark::removeVetoableChangeListener(): not implemented");
2313 return "SwXDocumentIndexes";
2321 uno::Sequence< OUString > SAL_CALL
2324 return {
"com.sun.star.text.DocumentIndexes" };
2333 throw uno::RuntimeException();
2335 sal_uInt32 nRet = 0;
2337 for(
size_t n = 0;
n < rFormats.
size(); ++
n )
2339 const SwSection* pSect = rFormats[
n ]->GetSection();
2355 throw uno::RuntimeException();
2360 for(
size_t n = 0;
n < rFormats.
size(); ++
n )
2362 SwSection* pSect = rFormats[
n ]->GetSection();
2367 const uno::Reference< text::XDocumentIndex > xTmp =
2369 *
GetDoc(), static_cast<SwTOXBaseSection *>(pSect));
2376 throw lang::IndexOutOfBoundsException();
2385 throw uno::RuntimeException();
2388 for(
size_t n = 0;
n < rFormats.
size(); ++
n )
2390 SwSection* pSect = rFormats[
n ]->GetSection();
2396 const uno::Reference< text::XDocumentIndex > xTmp =
2398 *
GetDoc(), static_cast<SwTOXBaseSection *>(pSect));
2404 throw container::NoSuchElementException();
2407 uno::Sequence< OUString > SAL_CALL
2413 throw uno::RuntimeException();
2417 for(
size_t n = 0;
n < rFormats.
size(); ++
n )
2419 SwSection const*
const pSect = rFormats[
n ]->GetSection();
2427 uno::Sequence< OUString > aRet(nCount);
2428 OUString* pArray = aRet.getArray();
2430 for(
size_t n = 0;
n < rFormats.
size(); ++
n )
2432 SwSection const*
const pSect = rFormats[
n ]->GetSection();
2436 pArray[nCnt++] =
static_cast<SwTOXBaseSection const*
>(pSect)->GetTOXName();
2448 throw uno::RuntimeException();
2451 for(
size_t n = 0;
n < rFormats.
size(); ++
n )
2453 SwSection const*
const pSect = rFormats[
n ]->GetSection();
2457 if (static_cast<SwTOXBaseSection const*>(pSect)->GetTOXName()
2481 : m_xParent(&rParentIdx)
2492 return "SwXDocumentIndex::StyleAccess_Impl";
2501 uno::Sequence< OUString > SAL_CALL
2504 return {
"com.sun.star.text.DocumentIndexParagraphStyles" };
2509 sal_Int32 nIndex,
const uno::Any& rElement)
2513 if(nIndex < 0 || nIndex >=
MAXLEVEL)
2515 throw lang::IndexOutOfBoundsException();
2518 SwTOXBase & rTOXBase( m_xParent->m_pImpl->GetTOXSectionOrThrow() );
2520 uno::Sequence<OUString>
aSeq;
2521 if(!(rElement >>= aSeq))
2523 throw lang::IllegalArgumentException();
2526 const sal_Int32 nStyles = aSeq.getLength();
2527 const OUString* pStyles = aSeq.getConstArray();
2528 OUStringBuffer sSetStyles;
2530 for(sal_Int32
i = 0;
i < nStyles;
i++)
2538 sSetStyles.append(aString);
2540 rTOXBase.SetStyleNames(sSetStyles.makeStringAndClear(), o3tl::narrowing<sal_uInt16>(nIndex));
2554 if(nIndex < 0 || nIndex >=
MAXLEVEL)
2556 throw lang::IndexOutOfBoundsException();
2559 SwTOXBase & rTOXBase( m_xParent->m_pImpl->GetTOXSectionOrThrow() );
2561 const OUString& rStyles =
2562 rTOXBase.
GetStyleNames(o3tl::narrowing<sal_uInt16>(nIndex));
2564 uno::Sequence<OUString> aStyles(nStyles);
2565 OUString* pStyles = aStyles.getArray();
2568 for(sal_Int32
i = 0;
i < nStyles; ++
i)
2574 pStyles[
i] = aString;
2594 : m_xParent(&rParentIdx)
2605 return "SwXDocumentIndex::TokenAccess_Impl";
2609 const OUString& rServiceName)
2614 uno::Sequence< OUString > SAL_CALL
2617 return {
"com.sun.star.text.DocumentIndexLevelFormat" };
2645 sal_Int32 nIndex,
const uno::Any& rElement)
2649 SwTOXBase & rTOXBase( m_xParent->m_pImpl->GetTOXSectionOrThrow() );
2651 if ((nIndex < 0) || (nIndex > rTOXBase.GetTOXForm().GetFormMax()))
2653 throw lang::IndexOutOfBoundsException();
2656 uno::Sequence<beans::PropertyValues>
aSeq;
2657 if(!(rElement >>= aSeq))
2659 throw lang::IllegalArgumentException();
2662 OUStringBuffer sPattern;
2663 for(
const beans::PropertyValues& rToken : std::as_const(aSeq))
2665 const beans::PropertyValue* pProperties = rToken.getConstArray();
2669 for(sal_Int32 j = 0; j < nProperties; j++)
2671 if ( pProperties[j].
Name ==
"TokenType" )
2673 const OUString sTokenType =
2674 lcl_AnyToType<OUString>(pProperties[j].Value);
2675 for (TokenType_
const* pTokenType = g_TokenTypes;
2676 pTokenType->pName; ++pTokenType)
2678 if (sTokenType.equalsAscii(pTokenType->pName))
2685 else if ( pProperties[j].
Name ==
"CharacterStyleName" )
2689 lcl_AnyToType<OUString>(pProperties[j].
Value),
2696 else if ( pProperties[j].
Name ==
"TabStopRightAligned" )
2698 const bool bRight = lcl_AnyToType<bool>(pProperties[j].Value);
2700 SvxTabAdjust::End : SvxTabAdjust::Left;
2702 else if ( pProperties[j].
Name ==
"TabStopPosition" )
2704 sal_Int32 nPosition = 0;
2705 if (!(pProperties[j].
Value >>= nPosition))
2707 throw lang::IllegalArgumentException();
2712 throw lang::IllegalArgumentException();
2716 else if ( pProperties[j].
Name ==
"TabStopFillCharacter" )
2718 const OUString sFillChar =
2719 lcl_AnyToType<OUString>(pProperties[j].Value);
2720 if (sFillChar.getLength() > 1)
2722 throw lang::IllegalArgumentException();
2725 sFillChar.isEmpty() ?
' ' : sFillChar[0];
2727 else if ( pProperties[j].
Name ==
"Text" )
2729 aToken.
sText = lcl_AnyToType<OUString>(pProperties[j].Value);
2731 else if ( pProperties[j].
Name ==
"ChapterFormat" )
2733 sal_Int16 nFormat = lcl_AnyToType<sal_Int16>(pProperties[j].Value);
2736 case text::ChapterFormat::NUMBER:
2742 case text::ChapterFormat::NAME_NUMBER:
2745 case text::ChapterFormat::NO_PREFIX_SUFFIX:
2748 case text::ChapterFormat::DIGIT:
2752 throw lang::IllegalArgumentException();
2757 else if ( pProperties[j].
Name ==
"ChapterLevel" )
2759 const sal_Int16 nLevel = lcl_AnyToType<sal_Int16>(pProperties[j].Value);
2760 if( nLevel < 1 || nLevel >
MAXLEVEL )
2762 throw lang::IllegalArgumentException();
2766 else if ( pProperties[j].
Name ==
"BibliographyDataField" )
2768 sal_Int16
nType = 0;
2769 pProperties[j].Value >>= nType;
2770 if(nType < 0 || nType > text::BibliographyDataField::LOCAL_URL)
2772 lang::IllegalArgumentException aExcept;
2773 aExcept.Message =
"BibliographyDataField - wrong value";
2774 aExcept.ArgumentPosition =
static_cast< sal_Int16
>(j);
2780 else if ( pProperties[j].
Name ==
"WithTab" )
2782 aToken.
bWithTab = lcl_AnyToType<bool>(pProperties[j].Value);
2789 throw lang::IllegalArgumentException();
2810 throw lang::IllegalArgumentException();
2824 SwForm aForm(rTOXBase.GetTOXForm());
2825 aForm.
SetPattern(o3tl::narrowing<sal_uInt16>(nIndex), sPattern.makeStringAndClear());
2826 rTOXBase.SetTOXForm(aForm);
2834 const sal_Int32 nRet = m_xParent->m_pImpl->GetFormMax();
2843 SwTOXBase & rTOXBase( m_xParent->m_pImpl->GetTOXSectionOrThrow() );
2845 if ((nIndex < 0) || (nIndex > rTOXBase.GetTOXForm().GetFormMax()))
2847 throw lang::IndexOutOfBoundsException();
2852 GetPattern(o3tl::narrowing<sal_uInt16>(nIndex));
2854 sal_Int32 nTokenCount = 0;
2855 uno::Sequence< beans::PropertyValues > aRetSeq;
2856 OUString aProgCharStyle;
2860 aRetSeq.realloc(nTokenCount);
2861 beans::PropertyValues* pTokenProps = aRetSeq.getArray();
2863 uno::Sequence< beans::PropertyValue >& rCurTokenSeq =
2864 pTokenProps[nTokenCount-1];
2866 aToken.sCharStyleName,
2869 switch(aToken.eTokenType)
2876 sal_Int32 nCurrentElement = 0;
2883 if( aToken.nOutlineLevel !=
MAXLEVEL )
2888 rCurTokenSeq.realloc( nElements );
2890 beans::PropertyValue* pArr = rCurTokenSeq.getArray();
2892 pArr[nCurrentElement].Name =
"TokenType";
2893 pArr[nCurrentElement++].Value <<=
2894 OUString(
"TokenEntryNumber");
2896 pArr[nCurrentElement].Name =
"CharacterStyleName";
2897 pArr[nCurrentElement++].Value <<= aProgCharStyle;
2898 if( aToken.nChapterFormat !=
CF_NUMBER )
2900 pArr[nCurrentElement].Name =
"ChapterFormat";
2905 switch(aToken.nChapterFormat)
2909 nVal = text::ChapterFormat::NUMBER;
2912 nVal = text::ChapterFormat::DIGIT;
2915 pArr[nCurrentElement++].Value <<= nVal;
2919 if (aToken.nOutlineLevel !=
MAXLEVEL)
2921 pArr[nCurrentElement].Name =
"ChapterLevel";
2922 pArr[nCurrentElement].Value <<= aToken.nOutlineLevel;
2929 rCurTokenSeq.realloc( 2 );
2930 beans::PropertyValue* pArr = rCurTokenSeq.getArray();
2932 pArr[0].Name =
"TokenType";
2933 pArr[0].Value <<= OUString(
"TokenEntryText");
2935 pArr[1].Name =
"CharacterStyleName";
2936 pArr[1].Value <<= aProgCharStyle;
2941 rCurTokenSeq.realloc(5);
2942 beans::PropertyValue* pArr = rCurTokenSeq.getArray();
2944 pArr[0].Name =
"TokenType";
2945 pArr[0].Value <<= OUString(
"TokenTabStop");
2947 if(SvxTabAdjust::End == aToken.eTabAlign)
2949 pArr[1].Name =
"TabStopRightAligned";
2950 pArr[1].Value <<=
true;
2954 pArr[1].Name =
"TabStopPosition";
2958 pArr[1].Value <<= nPos;
2960 pArr[2].Name =
"TabStopFillCharacter";
2961 pArr[2].Value <<= OUString(aToken.cTabFillChar);
2962 pArr[3].Name =
"CharacterStyleName";
2963 pArr[3].Value <<= aProgCharStyle;
2965 pArr[4].Name =
"WithTab";
2966 pArr[4].Value <<= aToken.bWithTab;
2971 rCurTokenSeq.realloc( 3 );
2972 beans::PropertyValue* pArr = rCurTokenSeq.getArray();
2974 pArr[0].Name =
"TokenType";
2975 pArr[0].Value <<= OUString(
"TokenText");
2977 pArr[1].Name =
"CharacterStyleName";
2978 pArr[1].Value <<= aProgCharStyle;
2980 pArr[2].Name =
"Text";
2981 pArr[2].Value <<= aToken.sText;
2986 rCurTokenSeq.realloc( 2 );
2987 beans::PropertyValue* pArr = rCurTokenSeq.getArray();
2989 pArr[0].Name =
"TokenType";
2990 pArr[0].Value <<= OUString(
"TokenPageNumber");
2992 pArr[1].Name =
"CharacterStyleName";
2993 pArr[1].Value <<= aProgCharStyle;
2998 rCurTokenSeq.realloc( 4 );
2999 beans::PropertyValue* pArr = rCurTokenSeq.getArray();
3001 pArr[0].Name =
"TokenType";
3002 pArr[0].Value <<= OUString(
"TokenChapterInfo");
3004 pArr[1].Name =
"CharacterStyleName";
3005 pArr[1].Value <<= aProgCharStyle;
3007 pArr[2].Name =
"ChapterFormat";
3008 sal_Int16 nVal = text::ChapterFormat::NUMBER;
3009 switch(aToken.nChapterFormat)
3012 nVal = text::ChapterFormat::NUMBER;
3018 nVal = text::ChapterFormat::NAME_NUMBER;
3021 nVal = text::ChapterFormat::NO_PREFIX_SUFFIX;
3024 nVal = text::ChapterFormat::DIGIT;
3027 pArr[2].Value <<= nVal;
3029 pArr[3].Name =
"ChapterLevel";
3030 pArr[3].Value <<= aToken.nOutlineLevel;
3035 rCurTokenSeq.realloc( 2 );
3036 beans::PropertyValue* pArr = rCurTokenSeq.getArray();
3038 pArr[0].Name =
"TokenType";
3040 OUString(
"TokenHyperlinkStart");
3041 pArr[1].Name =
"CharacterStyleName";
3042 pArr[1].Value <<= aProgCharStyle;
3047 rCurTokenSeq.realloc( 1 );
3048 beans::PropertyValue* pArr = rCurTokenSeq.getArray();
3050 pArr[0].Name =
"TokenType";
3052 OUString(
"TokenHyperlinkEnd");
3057 rCurTokenSeq.realloc( 3 );
3058 beans::PropertyValue* pArr = rCurTokenSeq.getArray();
3060 pArr[0].Name =
"TokenType";
3062 OUString(
"TokenBibliographyDataField");
3064 pArr[1].Name =
"CharacterStyleName";
3065 pArr[1].Value <<= aProgCharStyle;
3067 pArr[2].Name =
"BibliographyDataField";
3068 pArr[2].Value <<= sal_Int16(aToken.nAuthorityField);
void disposeAndClear(::std::unique_lock<::std::mutex > &rGuard, const css::lang::EventObject &rEvt)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
virtual void SAL_CALL attach(const css::uno::Reference< css::text::XTextRange > &xTextRange) override
virtual void SAL_CALL removePropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
const SwEndNode * EndOfSectionNode() const
std::vector< SwFormToken > SwFormTokens
Vector of tokens.
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
static void lcl_CalcLayout(SwDoc *pDoc)
virtual uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override
static sal_uInt16 lcl_TypeToPropertyMap_Mark(const TOXTypes eType)
#define WID_USE_LEVEL_FROM_SOURCE
#define WID_TOC_PARAGRAPH_OUTLINE_LEVEL
std::vector< SwSection * > SwSections
SAL_DLLPRIVATE css::uno::WeakReference< css::text::XDocumentIndexMark > const & GetXTOXMark() const
#define WID_IS_COMMA_SEPARATED
bool GoInContent(SwPaM &rPam, SwMoveFnCollection const &fnMove)
::rtl::Reference< SwXDocumentIndex > m_xParent
can be destroyed threadsafely, so no UnoImplPtr here
void SetSectionFormat(SwSectionFormat &rFormat)
virtual uno::Type SAL_CALL getElementType() override
TokenAccess_Impl(SwXDocumentIndex &rParentIdx)
SwTOXElement GetCreateType() const
virtual sal_Bool SAL_CALL hasElements() override
virtual void SAL_CALL setMarkEntry(const OUString &rIndexEntry) override
SwSectionFormat * m_pFormat
virtual css::uno::Any SAL_CALL getByName(const OUString &rName) override
constexpr auto toTwips(N number, Length from)
#define WID_CREATE_FROM_STAR_DRAW
virtual void SAL_CALL removeVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
static ShellResource * GetShellRes()
virtual void Notify(const SfxHint &) override
::comphelper::OMultiTypeInterfaceContainerHelper2 m_Listeners
virtual void CalcLayout()
#define WID_USE_COMBINED_ENTRIES
static void lcl_AnyToBitMask(uno::Any const &rValue, T &rBitMask, const T nBit)
virtual sal_Int32 SAL_CALL getCount() override
constexpr TypedWhichId< SwPtrMsgPoolItem > RES_REMOVE_UNO_OBJECT(181)
static void FillUIName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
void SetLevel(sal_uInt16 nLevel)
void InsertTOXMark(const SwTOXType &rTOXType, SwTOXMark &rMark, SwPaM &rPam, SwXTextCursor const *const pTextCursor)
virtual void SAL_CALL removeRefreshListener(const css::uno::Reference< css::util::XRefreshListener > &xListener) override
static SwTOXBase * GetCurTOX(const SwPosition &rPos)
Get current table of contents.
const SwTOXType * InsertTOXType(const SwTOXType &rTyp)
#define WID_CREATE_FROM_STAR_CALC
::rtl::Reference< SwXDocumentIndex > m_xParent
can be destroyed threadsafely, so no UnoImplPtr here
uno::WeakReference< uno::XInterface > m_wThis
void ReplaceTOXMark(const SwTOXType &rTOXType, SwTOXMark &rMark, SwPaM &rPam)
static LanguageType convertToLanguageType(const css::lang::Locale &rLocale, bool bResolveSystem=true)
virtual css::uno::Reference< css::frame::XModel > GetModel() override
#define WID_LEVEL_PARAGRAPH_STYLES
#define PROPERTY_MAP_INDEX_CNTNT
SAL_DLLPRIVATE void SetXTOXMark(css::uno::Reference< css::text::XDocumentIndexMark > const &xMark)
std::vector< SwTOXMark * > SwTOXMarks
#define WID_IS_RELATIVE_TABSTOPS
virtual void SAL_CALL addVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
const SwPosition * GetMark() const
void CollectTextMarks(SwTOXMarks &rMarks) const
#define PROPERTY_MAP_INDEX_IDX
#define TOX_STYLE_DELIMITER
css::uno::Reference< css::frame::XModel3 > GetModel() const
only chapter number without post-/prefix
#define WID_USER_IDX_NAME
virtual void SAL_CALL update() override
constexpr sal_uInt8 MAXLEVEL
SwSectionFormat * GetSectionFormat() const
bool IsAtEndOfMeta() const
#define WID_CREATE_FROM_TABLES
virtual void SAL_CALL removeVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
SwSectionFormat * GetFormat()
const TOXTypes m_eTOXType
const SwTOXType * GetTOXType() const
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override
static const SwAttrSet & GetTOXBaseAttrSet(const SwTOXBase &rTOX)
#define USER_AND_SUFFIXLEN
virtual uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override
virtual uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
static void lcl_ConvertTOUNameToUserName(OUString &rTmp)
const SwTOXType * m_pTOXType
virtual void SAL_CALL refresh() override
SwXDocumentIndexes(SwDoc *const pDoc)
constexpr OUStringLiteral cUserDefined
virtual OUString SAL_CALL getImplementationName() override
chapter number without post-/prefix and title
virtual OUString SAL_CALL getMarkEntry() override
static css::uno::Reference< css::text::XTextSection > CreateXTextSection(SwSectionFormat *const pFormat, const bool bIndexHeader=false)
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() override
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
constexpr auto convertTwipToMm100(N n)
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
OUString SwResId(TranslateId aId)
SwXDocumentIndexMark & m_rThis
const SwTOXType * GetTOXType() const
virtual void SAL_CALL attach(const css::uno::Reference< css::text::XTextRange > &xTextRange) override
OUString m_sPrimaryKeyReading
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
void RegisterToTOXType(SwTOXType &rMark)
static void lcl_ReAssignTOXType(SwDoc &rDoc, SwTOXBase &rTOXBase, const OUString &rNewName)
virtual void SAL_CALL setName(const OUString &rName) override
A wrapper around SfxPoolItem to store the start position of (usually) a text portion, with an optional end.
virtual ::sfx2::Metadatable * GetCoreObject() override
virtual sal_Int32 SAL_CALL getCount() override
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
sal_Int32 GetStart() const
static SW_DLLPUBLIC sal_uInt16 GetPoolIdFromUIName(const OUString &rName, SwGetPoolIdFromName)
virtual void Notify(const SfxHint &) override
virtual OUString SAL_CALL getImplementationName() override
#define WID_IDX_SORT_ALGORITHM
bool DeleteTOX(const SwTOXBase &rTOXBase, bool bDelNodes)
Delete table of contents.
sal_uInt16 GetTOXTypeCount(TOXTypes eTyp) const
Manage table of content types.
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
void SetAlternativeText(const OUString &rAlt)
void Normalize(bool bPointFirst=true)
Normalizes PaM, i.e.
sal_Int32 getTokenCount(std::string_view rIn, char cTok)
const css::uno::Sequence< sal_Int8 > & getSeq() const
static SW_DLLPUBLIC const OUString & GetSpecialExtraProgName(const OUString &rExtraUIName)
void UpdatePageNum()
Calculate PageNumber and insert after formatting.
const OUString & GetAlternativeText() const
PaM is Point and Mark: a selection of the document model.
static OUString GetProviderName(SwServiceType nObjectType)
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
virtual OUString SAL_CALL getImplementationName() override
OUString m_sSecondaryKeyReading
#define WID_CREATE_FROM_STAR_MATH
bool GetDefaultTextContentValue(css::uno::Any &rAny, std::u16string_view rPropertyName, sal_uInt16 nWID=0)
virtual void SAL_CALL dispose() override
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &rPropertyName) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &rIdentifier) override
#define PROPERTY_MAP_INDEX_MARK
void SetPrimaryKey(const OUString &rStr)
virtual OUString SAL_CALL getServiceName() override
#define PROPERTY_MAP_INDEX_USER
const SwPosition * GetPoint() const
void SetTextReading(const OUString &rStr)
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
SwEditShell const * GetEditShell() const
#define WID_IDX_CONTENT_SECTION
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
#define WID_CREATE_FROM_LABELS
#define WID_USE_UPPER_CASE
uno::WeakReference< container::XIndexReplace > m_wStyleAccess
#define WID_CREATE_FROM_MARKS
::cppu::WeakImplHelper< lang::XServiceInfo, container::XIndexReplace > SwXDocumentIndexStyleAccess_Base
virtual uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
uno::WeakReference< container::XIndexReplace > m_wTokenAccess
void disposeAndClear(const css::lang::EventObject &rEvt)
#define PROPERTY_MAP_INDEX_OBJECTS
void SetPrimaryKeyReading(const OUString &rStr)
Force hint expand (only matters for hints with CH_TXTATR).
virtual void SAL_CALL addPropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
virtual uno::Type SAL_CALL getElementType() override
static css::uno::Reference< css::text::XDocumentIndexMark > CreateXDocumentIndexMark(SwDoc &rDoc, SwTOXMark *pMark, TOXTypes eType=TOX_INDEX)
virtual OUString SAL_CALL getImplementationName() override
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
virtual void SAL_CALL addRefreshListener(const css::uno::Reference< css::util::XRefreshListener > &xListener) override
const OUString & GetTypeName() const
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
#define WID_USE_KEY_AS_ENTRY
static css::uno::Reference< css::text::XDocumentIndex > CreateXDocumentIndex(SwDoc &rDoc, SwTOXBaseSection *pSection, TOXTypes eTypes=TOX_INDEX)
sal_Int32 GetFormMax() const
Marks a node in the document model.
css::uno::Type const & get()
virtual void SAL_CALL setPropertyValue(const OUString &rPropertyName, const css::uno::Any &rValue) override
#define WID_SECONDARY_KEY
#define PROPERTY_MAP_USER_MARK
bool StartListening(SvtBroadcaster &rBroadcaster)
#define WID_CREATE_FROM_STAR_CHART
virtual void SAL_CALL setPropertyValue(const OUString &rPropertyName, const css::uno::Any &rValue) override
#define WID_CREATE_FROM_CHAPTER
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &rIdentifier) override
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
OUString m_sUserIndexName
virtual SotClipboardFormatId GetFormat(const TransferableDataHelper &aHelper) override
const SwPosition * Start() const
#define WID_CREATE_FROM_OTHER_EMBEDDED_OBJECTS
bool XTextRangeToSwPaM(SwUnoInternalPaM &rToFill, const uno::Reference< text::XTextRange > &xTextRange,::sw::TextRangeMode const eMode)
#define WID_CREATE_FROM_OUTLINE
virtual void SAL_CALL removePropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
#define WID_SECONDARY_KEY_READING
#define WID_PRIMARY_KEY_READING
::sw::UnoImplPtr< Impl > m_pImpl
#define PROPERTY_MAP_CNTIDX_MARK
const LanguageTag & getLocale()
SvtBroadcaster & GetNotifier()
uno::WeakReference< uno::XInterface > m_wThis
const SwTextNode & GetTextNode() const
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() override
#define WID_HIDE_TABLEADER_PAGENUMBERS
Impl(SwDoc &rDoc, const TOXTypes eType, SwTOXBaseSection *const pBaseSection)
void DeleteTOXMark(const SwTOXMark *pTOXMark)
Delete table of contents Mark.
std::unique_ptr< SwDocIndexDescriptorProperties_Impl > m_pProps
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
const SwTOXMark * m_pTOXMark
virtual OUString SAL_CALL getName() override
#define PROPERTY_MAP_BIBLIOGRAPHY
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(105)
#define WID_CREATE_FROM_PARAGRAPH_STYLES
void Update(const SfxItemSet *pAttr=nullptr, SwRootFrame const *pLayout=nullptr, const bool _bNewTOX=false)
Collect table of contents content.
virtual css::uno::Type SAL_CALL getElementType() override
virtual void SAL_CALL replaceByIndex(sal_Int32 Index, const uno::Any &rElement) override
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
virtual sal_Bool SAL_CALL hasElements() override
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
virtual void SAL_CALL addVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
static void lcl_ConvertTOUNameToProgrammaticName(OUString &rTmp)
OUString const & GetStyleNames(sal_uInt16 nLevel) const
#define WID_CREATE_FROM_TEXT_FRAMES
static void FillProgName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
virtual ~TokenAccess_Impl() override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &rPropertyName) override
static sal_uInt16 lcl_TypeToPropertyMap_Index(const TOXTypes eType)
void SetBookmarkName(const OUString &bName)
const sal_Int32 * End() const
Impl(SwXDocumentIndexMark &rThis, SwDoc *const pDoc, const enum TOXTypes eType, const SwTOXType *pType, SwTOXMark const *pMark)
SwUnoPropertyMapProvider aSwMapProvider
virtual void SAL_CALL dispose() override
#define PROPERTY_MAP_FLDTYP_BIBLIOGRAPHY
Sequence< sal_Int8 > aSeq
void SetSecondaryKey(const OUString &rStr)
virtual void CalcLayout() override
To enable set up of StartActions and EndActions.
SwMoveFnCollection const & fnMoveBackward
const TOXTypes m_eTOXType
#define WID_CREATE_FROM_EMBEDDED_OBJECTS
#define PROPERTY_MAP_PARAGRAPH_EXTENSIONS
virtual ~StyleAccess_Impl() override
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Reference< XModel > xModel
static void lcl_BitMaskToAny(uno::Any &o_rValue, const T nBitMask, const T nBit)
#define WID_CREATE_FROM_GRAPHIC_OBJECTS
SwXDocumentIndex(SwTOXBaseSection &, SwDoc &)
virtual ~SwXDocumentIndexMark() override
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
SectionType GetType() const
const SwTOXType * GetTOXType(TOXTypes eTyp, sal_uInt16 nId) const
#define WID_LABEL_DISPLAY_TYPE
#define WID_USE_ALPHABETICAL_SEPARATORS
virtual void SAL_CALL replaceByIndex(sal_Int32 Index, const uno::Any &rElement) override
const SwForm & GetTOXForm() const
::sw::UnoImplPtr< Impl > m_pImpl
#define WID_MAIN_ENTRY_CHARACTER_STYLE_NAME
SfxItemPropertySet const & m_rPropSet
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
static T lcl_AnyToType(uno::Any const &rVal)
void SetSecondaryKeyReading(const OUString &rStr)
#define WID_LABEL_CATEGORY
SwSectionFormats & GetSections()
virtual sal_Int32 SAL_CALL getCount() override
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
#define WID_IDX_HEADER_SECTION
::comphelper::OInterfaceContainerHelper4< css::lang::XEventListener > m_EventListeners
SfxItemPropertySet const & m_rPropSet
void SetMainEntry(bool bSet)
SwXDocumentIndexMark(SwDoc &rDoc, const SwTOXType &rType, const SwTOXMark &rMark)
virtual ~SwXDocumentIndex() override
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
SwTOXBase & GetTOXSectionOrThrow() const
SwServiceType
entries in this enum are mapped in an array in unocoll.cxx
#define PROPERTY_MAP_INDEX_ILLUSTRATIONS
StyleAccess_Impl(SwXDocumentIndex &rParentIdx)
virtual OUString SAL_CALL getImplementationName() override
virtual void SAL_CALL addPropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
const SfxItemPropertyMapEntry * GetPropertyMapEntries(sal_uInt16 PropertyId)
SwTOXType * GetTOXType() const
::cppu::WeakImplHelper< lang::XServiceInfo, container::XIndexReplace > SwXDocumentIndexTokenAccess_Base
virtual sal_Bool SAL_CALL hasByName(const OUString &rName) override
const struct TokenType_ g_TokenTypes[]
virtual sal_Bool SAL_CALL hasElements() override
static const OUString & GetSpecialExtraUIName(const OUString &rExtraProgName)
bool m_bDetectedRangeSegmentation false
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
#define WID_IS_CASE_SENSITIVE
#define PROPERTY_MAP_INDEX_TABLES
virtual ~SwXDocumentIndexes() override