23#include <rtl/ustring.hxx>
24#include <rtl/ustrbuf.hxx>
25#include <com/sun/star/beans/XPropertySet.hpp>
26#include <com/sun/star/beans/XPropertySetInfo.hpp>
35using ::com::sun::star::beans::XPropertySet;
36using ::com::sun::star::beans::XPropertySetInfo;
37using ::com::sun::star::uno::Reference;
38using ::com::sun::star::uno::Any;
58 const Reference<XPropertySet> & rPropSet,
70 Reference<XPropertySet> xIndexMarkPropSet;
71 aAny >>= xIndexMarkPropSet;
78 if (*o3tl::doAccess<bool>(aAny))
87 "collapsed index mark without alternative text");
93 aAny = rPropSet->getPropertyValue(
gsIsStart);
94 nElementNo = *o3tl::doAccess<bool>(aAny) ? 1 : 2;
98 GetID(sBuf, xIndexMarkPropSet);
100 sBuf.makeStringAndClear());
107 Reference<XPropertySetInfo> xPropertySetInfo =
108 xIndexMarkPropSet->getPropertySetInfo();
118 else if (xPropertySetInfo->hasPropertyByName(
gsPrimaryKey))
138 DBG_ASSERT(pElements !=
nullptr,
"illegal element array");
139 DBG_ASSERT(nElementNo >= 0,
"illegal name array index");
140 DBG_ASSERT(nElementNo <= 2,
"illegal name array index");
142 if ((pElements !=
nullptr) && (nElementNo != -1))
146 pElements[nElementNo],
153 const Reference<XPropertySet> & rPropSet)
156 sal_Int16 nLevel = 0;
157 Any aAny = rPropSet->getPropertyValue(
gsLevel);
160 OUString::number(nLevel + 1));
164 const Reference<XPropertySet> & rPropSet,
165 const OUString & sProperty,
169 rAny = rPropSet->getPropertyValue( sProperty );
172 if( (rAny >>= sValue) && !sValue.isEmpty() )
179 const Reference<XPropertySet> & rPropSet,
180 const OUString & sProperty,
184 rAny = rPropSet->getPropertyValue( sProperty );
187 if( (rAny >>= bValue) && bValue )
194 const Reference<XPropertySet> & rPropSet)
206 const Reference<XPropertySet> & rPropSet)
219 OUStringBuffer& sBuf,
220 const Reference<XPropertySet> & rPropSet)
223 sal_Int64
nId = sal::static_int_cast<sal_Int64>(
reinterpret_cast<sal_uIntPtr
>(rPropSet.get()));
224 sBuf.append(
"IMark");
enum XMLTokenEnum lcl_pTocMarkNames[]
enum XMLTokenEnum lcl_pAlphaIndexMarkName[]
static void lcl_ExportPropertyString(SvXMLExport &rExport, const Reference< XPropertySet > &rPropSet, const OUString &sProperty, XMLTokenEnum eToken, Any &rAny)
static void lcl_ExportPropertyBool(SvXMLExport &rExport, const Reference< XPropertySet > &rPropSet, const OUString &sProperty, XMLTokenEnum eToken, Any &rAny)
enum XMLTokenEnum lcl_pUserIndexMarkName[]
void AddAttribute(sal_uInt16 nPrefix, const OUString &rName, const OUString &rValue)
static constexpr OUStringLiteral gsAlternativeText
static void GetID(OUStringBuffer &sBuffer, const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
create a numerical ID for this index mark (represented by its properties)
static constexpr OUStringLiteral gsDocumentIndexMark
static constexpr OUStringLiteral gsPrimaryKeyReading
static constexpr OUStringLiteral gsSecondaryKey
static constexpr OUStringLiteral gsUserIndexName
XMLIndexMarkExport(SvXMLExport &rExp)
static constexpr OUStringLiteral gsTextReading
static constexpr OUStringLiteral gsSecondaryKeyReading
static constexpr OUStringLiteral gsIsStart
void ExportTOCMarkAttributes(const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
export attributes of table-of-content index marks
void ExportIndexMark(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, bool bAutoStyles)
export by the property set of its text portion.
static constexpr OUStringLiteral gsIsCollapsed
static constexpr OUStringLiteral gsPrimaryKey
static constexpr OUStringLiteral gsLevel
void ExportUserIndexMarkAttributes(const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
export attributes of user index marks
static constexpr OUStringLiteral gsMainEntry
void ExportAlphabeticalIndexMarkAttributes(const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
export attributes of alphabetical index marks
#define DBG_ASSERT(sCon, aError)
Handling of tokens in XML:
XMLTokenEnum
The enumeration of all XML tokens.
@ XML_ALPHABETICAL_INDEX_MARK
@ XML_USER_INDEX_MARK_END
@ XML_ALPHABETICAL_INDEX_MARK_START
@ XML_USER_INDEX_MARK_START
@ XML_ALPHABETICAL_INDEX_MARK_END
@ XML_STRING_VALUE_PHONETIC
constexpr sal_uInt16 XML_NAMESPACE_TEXT