22#include <rtl/ustring.hxx>
23#include <rtl/ustrbuf.hxx>
24#include <osl/diagnose.h>
25#include <com/sun/star/frame/XModel.hpp>
26#include <com/sun/star/lang/Locale.hpp>
27#include <com/sun/star/container/XIndexReplace.hpp>
28#include <com/sun/star/beans/XPropertySet.hpp>
29#include <com/sun/star/beans/PropertyValue.hpp>
30#include <com/sun/star/beans/PropertyValues.hpp>
31#include <com/sun/star/text/XTextSection.hpp>
32#include <com/sun/star/text/SectionFileLink.hpp>
33#include <com/sun/star/container/XNamed.hpp>
34#include <com/sun/star/container/XNameAccess.hpp>
35#include <com/sun/star/text/XDocumentIndex.hpp>
36#include <com/sun/star/text/BibliographyDataField.hpp>
37#include <com/sun/star/text/XTextFieldsSupplier.hpp>
38#include <com/sun/star/text/XChapterNumberingSupplier.hpp>
39#include <com/sun/star/text/ChapterFormat.hpp>
58using ::com::sun::star::beans::XPropertySet;
59using ::com::sun::star::beans::PropertyValue;
60using ::com::sun::star::beans::PropertyValues;
61using ::com::sun::star::container::XIndexReplace;
62using ::com::sun::star::container::XNameAccess;
63using ::com::sun::star::container::XNamed;
64using ::com::sun::star::lang::Locale;
71, rParaExport(rParaExp)
72, bHeadingDummiesExported( false )
78 const Reference<XTextSection> & rSection,
81 Reference<XPropertySet> xPropertySet(rSection, UNO_QUERY);
101 Reference<XDocumentIndex> xIndex;
124 const Reference<XTextSection> & rSection,
125 Reference<XDocumentIndex> & rIndex)
132 Reference<XPropertySet> xSectionPropSet(rSection, UNO_QUERY);
135 if (xSectionPropSet->getPropertySetInfo()->
136 hasPropertyByName(
"DocumentIndex"))
138 Any aAny = xSectionPropSet->getPropertyValue(
"DocumentIndex");
139 Reference<XDocumentIndex> xDocumentIndex;
140 aAny >>= xDocumentIndex;
143 if (xDocumentIndex.is())
146 Reference<XPropertySet> xIndexPropSet(xDocumentIndex, UNO_QUERY);
147 aAny = xIndexPropSet->getPropertyValue(
"ContentSection");
148 Reference<XTextSection> xEnclosingSection;
149 aAny >>= xEnclosingSection;
152 if (rSection == xEnclosingSection)
154 rIndex = xDocumentIndex;
160 aAny = xIndexPropSet->getPropertyValue(
"HeaderSection");
162 aAny >>= xEnclosingSection;
165 if (rSection == xEnclosingSection)
180 const Reference<XTextSection> & rSection,
190 Reference<XDocumentIndex> xIndex;
231 OSL_FAIL(
"unknown index type");
257 OSL_FAIL(
"Need element name!");
263 const Reference<XDocumentIndex> & rIndex)
266 Reference<XPropertySet> xPropertySet(rIndex, UNO_QUERY);
300 OSL_FAIL(
"unknown index type");
306 const Reference<XTextSection> & rSection)
309 Reference<XNamed> xName(rSection, UNO_QUERY);
331 std::u16string_view rServiceName)
343 const Reference<XTextSection> & rSection)
347 Reference<XNamed> xName(rSection, UNO_QUERY);
351 Reference<XPropertySet> xPropSet(rSection, UNO_QUERY);
354 Any aAny = xPropSet->getPropertyValue(
"Condition");
358 if (!sCond.isEmpty())
367 aAny = xPropSet->getPropertyValue(
"IsCurrentlyVisible");
368 if (! *o3tl::doAccess<bool>(aAny))
378 aAny = xPropSet->getPropertyValue(
"IsVisible");
379 if (! *o3tl::doAccess<bool>(aAny))
385 aAny = xPropSet->getPropertyValue(
"IsProtected");
386 if (*o3tl::doAccess<bool>(aAny))
390 Sequence<sal_Int8> aPassword;
391 xPropSet->getPropertyValue(
"ProtectionKey") >>= aPassword;
392 if (aPassword.hasElements())
404 "http://www.w3.org/2000/09/xmldsig#sha256");
414 aAny = xPropSet->getPropertyValue(
"FileLink");
415 SectionFileLink aFileLink;
418 aAny = xPropSet->getPropertyValue(
"LinkRegion");
419 OUString sRegionName;
420 aAny >>= sRegionName;
422 if ( !aFileLink.FileURL.isEmpty() ||
423 !aFileLink.FilterName.isEmpty() ||
424 !sRegionName.isEmpty())
426 if (!aFileLink.FileURL.isEmpty())
429 GetExport().GetRelativeReference( aFileLink.FileURL) );
432 if (!aFileLink.FilterName.isEmpty())
435 aFileLink.FilterName);
438 if (!sRegionName.isEmpty())
451 if (xPropSet->getPropertySetInfo()->hasPropertyByName(
"DDECommandFile"))
456 aAny = xPropSet->getPropertyValue(
"DDECommandFile");
457 OUString sApplication;
458 aAny >>= sApplication;
459 aAny = xPropSet->getPropertyValue(
"DDECommandType");
462 aAny = xPropSet->getPropertyValue(
"DDECommandElement");
466 if ( !sApplication.isEmpty() ||
477 aAny = xPropSet->getPropertyValue(
"IsAutomaticUpdate");
478 if (*o3tl::doAccess<bool>(aAny))
495 const Reference<XPropertySet> & rPropertySet)
505 sal_Int16 nLevel = sal_Int16();
506 if( rPropertySet->getPropertyValue(
"Level") >>= nLevel )
510 OUString::number(nLevel));
522 ExportBoolean(rPropertySet,
"CreateFromLevelParagraphStyles",
532 const Reference<XPropertySet> & rPropertySet)
539 ExportBoolean(rPropertySet,
"CreateFromOtherEmbeddedObjects",
557 const Reference<XPropertySet> & rPropertySet)
574 const Reference<XPropertySet> & rPropertySet)
591 const Reference<XPropertySet> & rPropertySet)
600 Any aAny = rPropertySet->getPropertyValue(
"MainEntryCharacterStyleName");
603 if (!sStyleName.isEmpty())
607 GetExport().EncodeStyleName( sStyleName ));
629 aAny = rPropertySet->getPropertyValue(
"SortAlgorithm");
632 if (!sAlgorithm.isEmpty())
639 aAny = rPropertySet->getPropertyValue(
"Locale");
651 const Reference<XPropertySet> & rPropertySet)
671 ExportBoolean(rPropertySet,
"CreateFromLevelParagraphStyles",
674 Any aAny = rPropertySet->getPropertyValue(
"UserIndexName" );
687 const Reference<XPropertySet> & rPropertySet)
705 const Reference<XPropertySet> & rPropertySet)
708 Any aAny = rPropertySet->getPropertyValue(
"IsProtected");
709 if (*o3tl::doAccess<bool>(aAny))
716 rPropertySet->getPropertyValue(
"Name") >>= sIndexName;
717 if ( !sIndexName.isEmpty() )
740 const Reference<XPropertySet> & rPropertySet)
752 aAny = rPropertySet->getPropertyValue(
"CreateFromChapter");
753 if (*o3tl::doAccess<bool>(aAny))
760 aAny = rPropertySet->getPropertyValue(
"IsRelativeTabstops");
761 if (! *o3tl::doAccess<bool>(aAny))
780 aAny = rPropertySet->getPropertyValue(
"ParaStyleHeading");
785 GetExport().EncodeStyleName( sStyleName ));
794 aAny = rPropertySet->getPropertyValue(
"Title");
795 OUString sTitleString;
796 aAny >>= sTitleString;
801 aAny = rPropertySet->getPropertyValue(
"LevelFormat");
802 Reference<XIndexReplace> xLevelTemplates;
803 aAny >>= xLevelTemplates;
807 sal_Int32 nLevelCount = xLevelTemplates->getCount();
808 for(sal_Int32
i = 1;
i<nLevelCount;
i++)
811 Sequence<PropertyValues> aTemplateSequence;
812 aAny = xLevelTemplates->getByIndex(
i);
813 aAny >>= aTemplateSequence;
827 aAny = rPropertySet->getPropertyValue(
"LevelParagraphStyles");
828 Reference<XIndexReplace> xLevelParagraphStyles;
829 aAny >>= xLevelParagraphStyles;
836 Any const any(rPropertySet->getPropertyValue(
"CreateFromParagraphStyle"));
837 if (
any.hasValue() &&
840 OUString
const styleName(
any.get<OUString>());
853 const Reference<XPropertySet> &)
870 const Reference<XPropertySet> & rPropertySet)
873 Any aAny = rPropertySet->getPropertyValue(
"CreateFromLabels");
874 if (! *o3tl::doAccess<bool>(aAny))
881 aAny = rPropertySet->getPropertyValue(
"LabelCategory");
882 OUString sSequenceName;
883 aAny >>= sSequenceName;
889 aAny = rPropertySet->getPropertyValue(
"LabelDisplayType");
928 {
nullptr,
"ParaStyleLevel1",
"ParaStyleLevel2",
"ParaStyleLevel3",
929 "ParaStyleLevel4",
"ParaStyleLevel5",
"ParaStyleLevel6",
930 "ParaStyleLevel7",
"ParaStyleLevel8",
"ParaStyleLevel9",
931 "ParaStyleLevel10",
nullptr };
933 {
nullptr,
"ParaStyleLevel1",
nullptr };
935 {
nullptr,
"ParaStyleSeparator",
"ParaStyleLevel1",
"ParaStyleLevel2",
936 "ParaStyleLevel3",
nullptr };
939 {
nullptr,
"ParaStyleLevel1",
"ParaStyleLevel1",
"ParaStyleLevel1",
940 "ParaStyleLevel1",
"ParaStyleLevel1",
"ParaStyleLevel1",
941 "ParaStyleLevel1",
"ParaStyleLevel1",
"ParaStyleLevel1",
942 "ParaStyleLevel1",
"ParaStyleLevel1",
"ParaStyleLevel1",
943 "ParaStyleLevel1",
"ParaStyleLevel1",
"ParaStyleLevel1",
944 "ParaStyleLevel1",
"ParaStyleLevel1",
"ParaStyleLevel1",
945 "ParaStyleLevel1",
"ParaStyleLevel1",
"ParaStyleLevel1",
985 sal_Int32 nOutlineLevel,
986 const Reference<XPropertySet> & rPropertySet,
987 const Sequence<Sequence<PropertyValue> > & rValues)
991 OSL_ENSURE(nOutlineLevel >= 0,
"illegal outline level");
995 (nOutlineLevel >= 0) )
1024 const char* pPropName(
1026 OSL_ENSURE(
nullptr != pPropName,
"can't find property name");
1027 if (
nullptr != pPropName)
1029 Any aAny = rPropertySet->getPropertyValue(
1030 OUString::createFromAscii(pPropName));
1031 OUString sParaStyleName;
1032 aAny >>= sParaStyleName;
1035 GetExport().EncodeStyleName( sParaStyleName ));
1047 for(
auto& rValue : rValues)
1060enum TemplateTypeEnum
1062 TOK_TTYPE_ENTRY_NUMBER,
1063 TOK_TTYPE_ENTRY_TEXT,
1066 TOK_TTYPE_PAGE_NUMBER,
1067 TOK_TTYPE_CHAPTER_INFO,
1068 TOK_TTYPE_HYPERLINK_START,
1069 TOK_TTYPE_HYPERLINK_END,
1070 TOK_TTYPE_BIBLIOGRAPHY,
1074enum TemplateParamEnum
1076 TOK_TPARAM_TOKEN_TYPE,
1077 TOK_TPARAM_CHAR_STYLE,
1078 TOK_TPARAM_TAB_RIGHT_ALIGNED,
1079 TOK_TPARAM_TAB_POSITION,
1080 TOK_TPARAM_TAB_WITH_TAB,
1081 TOK_TPARAM_TAB_FILL_CHAR,
1083 TOK_TPARAM_CHAPTER_FORMAT,
1084 TOK_TPARAM_CHAPTER_LEVEL,
1085 TOK_TPARAM_BIBLIOGRAPHY_DATA
1101 {
nullptr, 0, TemplateTypeEnum(0)}
1117 {
nullptr, 0, TemplateParamEnum(0)}
1123 {
XML_ANNOTE, BibliographyDataField::ANNOTE },
1124 {
XML_AUTHOR, BibliographyDataField::AUTHOR },
1134 {
XML_EDITOR, BibliographyDataField::EDITOR },
1138 {
XML_ISBN, BibliographyDataField::ISBN },
1140 {
XML_MONTH, BibliographyDataField::MONTH },
1141 {
XML_NOTE, BibliographyDataField::NOTE },
1142 {
XML_NUMBER, BibliographyDataField::NUMBER },
1144 {
XML_PAGES, BibliographyDataField::PAGES },
1147 {
XML_SCHOOL, BibliographyDataField::SCHOOL },
1148 {
XML_SERIES, BibliographyDataField::SERIES },
1149 {
XML_TITLE, BibliographyDataField::TITLE },
1150 {
XML_URL, BibliographyDataField::URL },
1151 {
XML_VOLUME, BibliographyDataField::VOLUME },
1152 {
XML_YEAR, BibliographyDataField::YEAR },
1158 const Sequence<PropertyValue> & rValues)
1163 OUString sCharStyle;
1164 bool bCharStyleOK =
false;
1168 bool bTextOK =
false;
1171 bool bRightAligned =
false;
1174 sal_Int32 nTabPosition = 0;
1175 bool bTabPositionOK =
false;
1179 bool bFillCharOK =
false;
1182 sal_Int16 nChapterFormat = 0;
1183 bool bChapterFormatOK =
false;
1186 sal_Int16 nLevel = 0;
1187 bool bLevelOK =
false;
1190 sal_Int16 nBibliographyData = 0;
1191 bool bBibliographyDataOK =
false;
1194 bool bWithTabStop =
false;
1195 bool bWithTabStopOK =
false;
1202 enum TemplateTypeEnum nTokenType = TOK_TTYPE_INVALID;
1204 for(
const auto& rValue : rValues)
1206 TemplateParamEnum
nToken;
1217 case TOK_TPARAM_TOKEN_TYPE:
1220 rValue.Value >>= sVal;
1225 case TOK_TPARAM_CHAR_STYLE:
1227 rValue.Value >>= sCharStyle;
1228 bCharStyleOK = !sCharStyle.isEmpty();
1231 case TOK_TPARAM_TEXT:
1232 rValue.Value >>= sText;
1236 case TOK_TPARAM_TAB_RIGHT_ALIGNED:
1238 *o3tl::doAccess<bool>(rValue.Value);
1241 case TOK_TPARAM_TAB_POSITION:
1242 rValue.Value >>= nTabPosition;
1243 bTabPositionOK =
true;
1247 case TOK_TPARAM_TAB_WITH_TAB:
1248 bWithTabStop = *o3tl::doAccess<bool>(rValue.Value);
1249 bWithTabStopOK =
true;
1252 case TOK_TPARAM_TAB_FILL_CHAR:
1253 rValue.Value >>= sFillChar;
1257 case TOK_TPARAM_CHAPTER_FORMAT:
1258 rValue.Value >>= nChapterFormat;
1259 bChapterFormatOK =
true;
1262 case TOK_TPARAM_CHAPTER_LEVEL:
1263 rValue.Value >>= nLevel;
1266 case TOK_TPARAM_BIBLIOGRAPHY_DATA:
1267 rValue.Value >>= nBibliographyData;
1268 bBibliographyDataOK =
true;
1279 case TOK_TTYPE_ENTRY_TEXT:
1282 case TOK_TTYPE_TAB_STOP:
1284 if ( bRightAligned || bTabPositionOK || bFillCharOK )
1289 case TOK_TTYPE_TEXT:
1296 case TOK_TTYPE_PAGE_NUMBER:
1299 case TOK_TTYPE_CHAPTER_INFO:
1302 case TOK_TTYPE_ENTRY_NUMBER:
1305 case TOK_TTYPE_HYPERLINK_START:
1308 case TOK_TTYPE_HYPERLINK_END:
1311 case TOK_TTYPE_BIBLIOGRAPHY:
1312 if (bBibliographyDataOK)
1326 case TOK_TTYPE_HYPERLINK_START:
1327 case TOK_TTYPE_HYPERLINK_END:
1355 if (TOK_TTYPE_CHAPTER_INFO == nTokenType)
1379 switch( nChapterFormat )
1381 case ChapterFormat::DIGIT:
1382 nChapterFormat = ChapterFormat::NUMBER;
1384 case ChapterFormat::NO_PREFIX_SUFFIX:
1385 nChapterFormat = ChapterFormat::NAME_NUMBER;
1390 else if (TOK_TTYPE_ENTRY_NUMBER == nTokenType)
1398 bChapterFormatOK =
false;
1411 case TOK_TTYPE_ENTRY_TEXT:
1412 case TOK_TTYPE_TEXT:
1413 case TOK_TTYPE_PAGE_NUMBER:
1414 case TOK_TTYPE_ENTRY_NUMBER:
1415 case TOK_TTYPE_HYPERLINK_START:
1416 case TOK_TTYPE_HYPERLINK_END:
1417 case TOK_TTYPE_BIBLIOGRAPHY:
1418 case TOK_TTYPE_CHAPTER_INFO:
1419 case TOK_TTYPE_TAB_STOP:
1422 GetExport().EncodeStyleName( sCharStyle) );
1431 if (TOK_TTYPE_TAB_STOP == nTokenType)
1437 if (bTabPositionOK && (! bRightAligned))
1440 OUStringBuffer sBuf;
1445 sBuf.makeStringAndClear());
1449 if (bFillCharOK && !sFillChar.isEmpty())
1456 if (bWithTabStopOK && ! bWithTabStop)
1465 if (TOK_TTYPE_BIBLIOGRAPHY == nTokenType)
1467 OSL_ENSURE(bBibliographyDataOK,
"need bibl data");
1468 OUStringBuffer sBuf;
1474 sBuf.makeStringAndClear());
1479 if (TOK_TTYPE_CHAPTER_INFO == nTokenType)
1481 OSL_ENSURE(bChapterFormatOK,
"need chapter info");
1488 OUString::number(nLevel));
1492 if (TOK_TTYPE_ENTRY_NUMBER == nTokenType)
1494 if (bChapterFormatOK)
1501 OUString::number(nLevel));
1510 if (TOK_TTYPE_TEXT == nTokenType)
1517 Reference<XIndexReplace>
const & xLevelParagraphStyles)
1520 sal_Int32 nPLevelCount = xLevelParagraphStyles->getCount();
1521 for(sal_Int32 nLevel = 0; nLevel < nPLevelCount; nLevel++)
1523 Any aAny = xLevelParagraphStyles->getByIndex(nLevel);
1524 Sequence<OUString> aStyleNames;
1525 aAny >>= aStyleNames;
1528 if (aStyleNames.hasElements())
1531 sal_Int32 nLevelPlusOne = nLevel + 1;
1534 OUString::number(nLevelPlusOne));
1543 for(
const auto& rStyleName : std::as_const(aStyleNames))
1548 GetExport().EncodeStyleName(rStyleName) );
1561 const Reference<XPropertySet> & rPropSet,
1562 const OUString& sPropertyName,
1569 Any aAny = rPropSet->getPropertyValue(sPropertyName);
1570 bool bTmp = *o3tl::doAccess<bool>(aAny);
1574 if ( (bTmp != bInvert) != bDefault )
1588 if ( !xTextFieldsSupp.is() )
1591 static constexpr OUStringLiteral sFieldMaster_Bibliography(
u"com.sun.star.text.FieldMaster.Bibliography");
1594 Reference<XNameAccess> xMasters =
1595 xTextFieldsSupp->getTextFieldMasters();
1596 if ( !xMasters->hasByName(sFieldMaster_Bibliography) )
1600 xMasters->getByName(sFieldMaster_Bibliography);
1601 Reference<XPropertySet> xPropSet;
1604 OSL_ENSURE( xPropSet.is(),
"field master must have XPropSet" );
1608 aAny = xPropSet->getPropertyValue(
"BracketBefore");
1612 aAny = xPropSet->getPropertyValue(
"BracketAfter");
1616 aAny = xPropSet->getPropertyValue(
"IsNumberEntries");
1617 if (*o3tl::doAccess<bool>(aAny))
1623 aAny = xPropSet->getPropertyValue(
"IsSortByPosition");
1624 if (! *o3tl::doAccess<bool>(aAny))
1631 aAny = xPropSet->getPropertyValue(
"SortAlgorithm");
1632 OUString sAlgorithm;
1633 aAny >>= sAlgorithm;
1634 if( !sAlgorithm.isEmpty() )
1641 aAny = xPropSet->getPropertyValue(
"Locale");
1652 aAny = xPropSet->getPropertyValue(
"SortKeys");
1653 Sequence<Sequence<PropertyValue> > aKeys;
1655 for(
const Sequence<PropertyValue> & rKey : std::as_const(aKeys))
1657 for(
const PropertyValue& rValue : rKey)
1659 if (rValue.Name ==
"SortKey")
1662 rValue.Value >>= nKey;
1663 OUStringBuffer sBuf;
1668 sBuf.makeStringAndClear());
1671 else if (rValue.Name ==
"IsSortAscending")
1673 bool bTmp = *o3tl::doAccess<bool>(rValue.Value);
1688 const Reference<XTextSection> & rSection)
const
1701 for(Reference<XTextSection> aSection(rSection);
1703 aSection = aSection->getParentSection())
1706 Reference<XPropertySet> xPropSet(aSection, UNO_QUERY);
1709 Any aAny = xPropSet->getPropertyValue(
"IsGlobalDocumentSection");
1711 if ( *o3tl::doAccess<bool>(aAny) )
1713 Reference<XDocumentIndex> xIndex;
1732 const Reference<XTextContent> & rSection,
1733 bool bDefault)
const
1736 bool bRet = bDefault;
1738 Reference<XPropertySet> xPropSet(rSection->getAnchor(), UNO_QUERY);
1741 if (xPropSet->getPropertySetInfo()->hasPropertyByName(
"TextSection"))
1743 Any aAny = xPropSet->getPropertyValue(
"TextSection");
1744 Reference<XTextSection> xSection;
1757 const Reference<XTextSection> & rEnclosingSection,
1758 const Reference<XTextContent> & rContent,
1762 bool bRet = bDefault;
1763 OSL_ENSURE(rEnclosingSection.is(),
"enclosing section expected");
1765 Reference<XPropertySet> xPropSet(rContent, UNO_QUERY);
1768 if (xPropSet->getPropertySetInfo()->hasPropertyByName(
"TextSection"))
1770 Any aAny = xPropSet->getPropertyValue(
"TextSection");
1771 Reference<XTextSection> xSection;
1779 bRet = (rEnclosingSection == xSection);
1780 xSection = xSection->getParentSection();
1782 while (!bRet && xSection.is());
1800 Reference< XChapterNumberingSupplier > xCNSupplier(
rExport.
GetModel(),
1803 Reference< XIndexReplace > xChapterNumbering;
1804 if( xCNSupplier.is() )
1805 xChapterNumbering = xCNSupplier->getChapterNumberingRules();
1807 if( !xChapterNumbering.is() )
1810 sal_Int32
nCount = xChapterNumbering->getCount();
1811 for( sal_Int32 nLevel = 0; nLevel <
nCount; nLevel++ )
1815 xChapterNumbering->getByIndex( nLevel ) >>=
aProperties;
1817 [](
const PropertyValue& rProp) {
return rProp.Name ==
"HeadingStyleName"; });
1819 pProp->Value >>= sStyle;
1821 if( !sStyle.isEmpty() )
1824 GetExport().EncodeStyleName( sStyle ) );
1827 OUString::number( nLevel + 1 ) );
PropertiesInfo aProperties
const XMLTokenEnum aLevelNameAlphaMap[]
static const char * aLevelStylePropNameTOCMap[]
SvXMLEnumStringMapEntry< TemplateParamEnum > const aTemplateParamMap[]
const XMLTokenEnum aLevelNameBibliographyMap[]
static const char * aLevelStylePropNameTableMap[]
SvXMLEnumStringMapEntry< TemplateTypeEnum > const aTemplateTypeMap[]
const XMLTokenEnum aTypeSourceElementNameMap[]
SvXMLEnumStringMapEntry< SectionTypeEnum > const aIndexTypeMap[]
static const char ** aTypeLevelStylePropNameMap[]
static const char * aLevelStylePropNameBibliographyMap[]
const XMLTokenEnum aTypeLevelAttrMap[]
const XMLTokenEnum aLevelNameTableMap[]
SvXMLEnumMapEntry< sal_Int16 > const aBibliographyDataFieldMap[]
const XMLTokenEnum aLevelNameTOCMap[]
const XMLTokenEnum aTypeElementNameMap[]
static const XMLTokenEnum * aTypeLevelNameMap[]
static const char * aLevelStylePropNameAlphaMap[]
@ TEXT_SECTION_TYPE_ALPHABETICAL
@ TEXT_SECTION_TYPE_BIBLIOGRAPHY
@ TEXT_SECTION_TYPE_OBJECT
@ TEXT_SECTION_TYPE_ILLUSTRATION
@ TEXT_SECTION_TYPE_TABLE
@ TEXT_SECTION_TYPE_UNKNOWN
const SvXMLNamespaceMap & GetNamespaceMap() const
void AddAttributeXmlId(css::uno::Reference< css::uno::XInterface > const &i_xIfc)
add xml:id attribute (for RDF metadata)
void StartElement(sal_uInt16 nPrefix, enum ::xmloff::token::XMLTokenEnum eName, bool bIgnWSOutside)
void AddAttribute(sal_uInt16 nPrefix, const OUString &rName, const OUString &rValue)
void Characters(const OUString &rChars)
const css::uno::Reference< css::frame::XModel > & GetModel() const
SvtSaveOptions::ODFSaneDefaultVersion getSaneDefaultVersion() const
returns the deterministic version for odf export
void IgnorableWhitespace()
void AddLanguageTagAttributes(sal_uInt16 nPrefix, sal_uInt16 nPrefixRfc, const css::lang::Locale &rLocale, bool bWriteEmpty)
Add language tag attributes, deciding which are necessary.
const SvXMLUnitConverter & GetMM100UnitConverter() const
void EndElement(sal_uInt16 nPrefix, enum ::xmloff::token::XMLTokenEnum eName, bool bIgnWSInside)
bool IsSaveLinkedSections() const
OUString GetQNameByKey(sal_uInt16 nKey, const OUString &rLocalName, bool bCache=true) const
static bool convertEnum(EnumT &rEnum, std::u16string_view rValue, const SvXMLEnumMapEntry< EnumT > *pMap)
convert string to enum using given enum map, if the enum is not found in the map, this method will re...
void convertMeasureToXML(OUStringBuffer &rBuffer, sal_Int32 nMeasure) const
convert measure to string: from meCoreMeasureUnit to meXMLMeasureUnit
XMLTextParagraphExport & GetParaExport()
void ExportLevelParagraphStyles(css::uno::Reference< css::container::XIndexReplace > const &xStyles)
export level paragraph styles
void ExportSectionStart(const css::uno::Reference< css::text::XTextSection > &rSection, bool bAutoStyles)
export section or index start and source elements.
void ExportUserIndexStart(const css::uno::Reference< css::beans::XPropertySet > &rSection)
export a user index (and source element)
bool bHeadingDummiesExported
static enum SectionTypeEnum MapSectionType(std::u16string_view rSectionName)
map service name to section type
static bool IsInSection(const css::uno::Reference< css::text::XTextSection > &rEnclosingSection, const css::uno::Reference< css::text::XTextContent > &rContent, bool bDefault)
Determine whether rContent is contained in rEnclosingSection.
void ExportSectionEnd(const css::uno::Reference< css::text::XTextSection > &rSection, bool bAutoStyles)
export section or index end elements
void ExportBibliographyStart(const css::uno::Reference< css::beans::XPropertySet > &rIndex)
export the bibliography (and source element)
void ExportBaseIndexStart(::xmloff::token::XMLTokenEnum eElement, const css::uno::Reference< css::beans::XPropertySet > &rSection)
Export the index element start (for all index types).
void ExportObjectIndexStart(const css::uno::Reference< css::beans::XPropertySet > &rSection)
export an object index (and source element)
XMLSectionExport(SvXMLExport &rExp, XMLTextParagraphExport &rParaExp)
void ExportTableOfContentStart(const css::uno::Reference< css::beans::XPropertySet > &rSection)
export a table of content (and source element)
void ExportTableIndexStart(const css::uno::Reference< css::beans::XPropertySet > &rSection)
export a table index (and source element)
void ExportBoolean(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, const OUString &sPropertyName, enum ::xmloff::token::XMLTokenEnum eAttributeName, bool bDefault, bool bInvert=false)
helper to export boolean properties
void ExportBaseIndexBody(SectionTypeEnum eType, const css::uno::Reference< css::beans::XPropertySet > &rSection)
Export the index body (common for all index types).
void ExportIndexTemplateElement(SectionTypeEnum eType, const css::uno::Sequence< css::beans::PropertyValue > &rValues)
export a single template element (e.g. span or tab-stop)
void ExportMasterDocHeadingDummies()
export a heading for every level.
void ExportRegularSectionStart(const css::uno::Reference< css::text::XTextSection > &rSection)
export a proper section (and source elements)
void ExportAlphabeticalIndexStart(const css::uno::Reference< css::beans::XPropertySet > &rSection)
export an alphabetical/keyword index (and source element)
void ExportTableAndIllustrationIndexSourceAttributes(const css::uno::Reference< css::beans::XPropertySet > &rSection)
Helper method to export common attributes for table and illustration indices.
static bool GetIndex(const css::uno::Reference< css::text::XTextSection > &rSection, css::uno::Reference< css::text::XDocumentIndex > &rIndex)
If this section is an index, the index is written in the rIndex parameter.
void ExportIndexHeaderStart(const css::uno::Reference< css::text::XTextSection > &rSection)
export an index header start element.
static void ExportBibliographyConfiguration(SvXMLExport &rExport)
Export the configuration element for bibliography indices.
SvXMLExport & GetExport()
void ExportBaseIndexSource(SectionTypeEnum eType, const css::uno::Reference< css::beans::XPropertySet > &rSection)
Export the index source element (common for all index types).
void ExportIndexStart(const css::uno::Reference< css::text::XDocumentIndex > &rSection)
export an index start element.
bool ExportIndexTemplate(SectionTypeEnum eType, sal_Int32 nLevel, const css::uno::Reference< css::beans::XPropertySet > &rPropSet, const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > &rValues)
export one template for the specific index type
bool IsMuteSection(const css::uno::Reference< css::text::XTextSection > &rSection) const
Should the content of this section be exported? (E.g.
void ExportIllustrationIndexStart(const css::uno::Reference< css::beans::XPropertySet > &rSection)
export an illustration index (and source element)
static enum::xmloff::token::XMLTokenEnum MapChapterDisplayFormat(sal_Int16 nType)
map ChapterDisplayFormat to XML string
static enum::xmloff::token::XMLTokenEnum MapReferenceType(sal_Int16 nType)
map ReferenceFieldPart to XML string
void Add(XmlStyleFamily nFamily, MultiPropertySetHelper &rPropSetHelper, const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
add autostyle for specified family
static void encode(OUStringBuffer &aStrBuffer, const css::uno::Sequence< sal_Int8 > &aPass)
Handling of tokens in XML:
XMLTokenEnum
The enumeration of all XML tokens.
@ XML_BIBLIOGRAPHY_DATA_FIELD
@ XML_MAIN_ENTRY_STYLE_NAME
@ XML_INDEX_ENTRY_TAB_STOP
@ XML_USE_FLOATING_FRAMES
@ XML_COMBINE_ENTRIES_WITH_PP
@ XML_COPY_OUTLINE_LEVELS
@ XML_RELATIVE_TAB_STOP_POSITION
@ XML_BIBLIOGRAPHY_CONFIGURATION
@ XML_CAPTION_SEQUENCE_FORMAT
@ XML_INDEX_ENTRY_BIBLIOGRAPHY
@ XML_USE_KEYS_AS_ENTRIES
@ XML_ILLUSTRATION_INDEX_SOURCE
@ XML_INDEX_ENTRY_LINK_START
@ XML_ALPHABETICAL_INDEX_ENTRY_TEMPLATE
@ XML_INDEX_SOURCE_STYLES
@ XML_BIBLIOGRAPHY_ENTRY_TEMPLATE
@ XML_ILLUSTRATION_INDEX_ENTRY_TEMPLATE
@ XML_INDEX_TITLE_TEMPLATE
@ XML_TABLE_OF_CONTENT_ENTRY_TEMPLATE
@ XML_INDEX_ENTRY_PAGE_NUMBER
@ XML_OBJECT_INDEX_ENTRY_TEMPLATE
@ XML_PROTECTION_KEY_DIGEST_ALGORITHM
@ XML_BIBLIOGRAPHY_SOURCE
@ XML_OBJECT_INDEX_SOURCE
@ XML_INDEX_ENTRY_CHAPTER
@ XML_USE_INDEX_SOURCE_STYLES
@ XML_TABLE_OF_CONTENT_SOURCE
@ XML_CAPTION_SEQUENCE_NAME
@ XML_ALPHABETICAL_INDEX_SOURCE
@ XML_INDEX_ENTRY_LINK_END
@ XML_USER_INDEX_ENTRY_TEMPLATE
@ XML_COMBINE_ENTRIES_WITH_DASH
@ XML_ALPHABETICAL_SEPARATORS
@ XML_TABLE_INDEX_ENTRY_TEMPLATE
@ XML_USE_SPREADSHEET_OBJECTS
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
return the OUString representation for eToken
OReadStatusBarDocumentHandler::StatusBar_XML_Namespace nNamespace
Map a const char* (with length) to a sal_uInt16 value.
std::unique_ptr< char[]> aBuffer
#define ENUM_STRING_MAP_ENTRY(name, tok)
constexpr sal_uInt16 XML_NAMESPACE_XLINK
constexpr sal_uInt16 XML_NAMESPACE_TEXT
constexpr sal_uInt16 XML_NAMESPACE_OOOW
constexpr sal_uInt16 XML_NAMESPACE_LO_EXT
constexpr sal_uInt16 XML_NAMESPACE_OFFICE
constexpr sal_uInt16 XML_NAMESPACE_STYLE
constexpr sal_uInt16 XML_NAMESPACE_FO