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>
59using ::com::sun::star::beans::XPropertySet;
60using ::com::sun::star::beans::PropertyValue;
61using ::com::sun::star::beans::PropertyValues;
62using ::com::sun::star::container::XIndexReplace;
63using ::com::sun::star::container::XNameAccess;
64using ::com::sun::star::container::XNamed;
65using ::com::sun::star::lang::Locale;
72, rParaExport(rParaExp)
73, bHeadingDummiesExported( false )
79 const Reference<XTextSection> & rSection,
82 Reference<XPropertySet> xPropertySet(rSection, UNO_QUERY);
102 Reference<XDocumentIndex> xIndex;
125 const Reference<XTextSection> & rSection,
126 Reference<XDocumentIndex> & rIndex)
133 Reference<XPropertySet> xSectionPropSet(rSection, UNO_QUERY);
136 if (xSectionPropSet->getPropertySetInfo()->
137 hasPropertyByName(
"DocumentIndex"))
139 Any aAny = xSectionPropSet->getPropertyValue(
"DocumentIndex");
140 Reference<XDocumentIndex> xDocumentIndex;
141 aAny >>= xDocumentIndex;
144 if (xDocumentIndex.is())
147 Reference<XPropertySet> xIndexPropSet(xDocumentIndex, UNO_QUERY);
148 aAny = xIndexPropSet->getPropertyValue(
"ContentSection");
149 Reference<XTextSection> xEnclosingSection;
150 aAny >>= xEnclosingSection;
153 if (rSection == xEnclosingSection)
155 rIndex = xDocumentIndex;
161 aAny = xIndexPropSet->getPropertyValue(
"HeaderSection");
163 aAny >>= xEnclosingSection;
166 if (rSection == xEnclosingSection)
181 const Reference<XTextSection> & rSection,
191 Reference<XDocumentIndex> xIndex;
232 OSL_FAIL(
"unknown index type");
258 OSL_FAIL(
"Need element name!");
264 const Reference<XDocumentIndex> & rIndex)
267 Reference<XPropertySet> xPropertySet(rIndex, UNO_QUERY);
301 OSL_FAIL(
"unknown index type");
307 const Reference<XTextSection> & rSection)
310 Reference<XNamed> xName(rSection, UNO_QUERY);
332 std::u16string_view rServiceName)
344 const Reference<XTextSection> & rSection)
348 Reference<XNamed> xName(rSection, UNO_QUERY);
352 Reference<XPropertySet> xPropSet(rSection, UNO_QUERY);
355 Any aAny = xPropSet->getPropertyValue(
"Condition");
359 if (!sCond.isEmpty())
368 aAny = xPropSet->getPropertyValue(
"IsCurrentlyVisible");
369 if (! *o3tl::doAccess<bool>(aAny))
379 aAny = xPropSet->getPropertyValue(
"IsVisible");
380 if (! *o3tl::doAccess<bool>(aAny))
386 aAny = xPropSet->getPropertyValue(
"IsProtected");
387 if (*o3tl::doAccess<bool>(aAny))
391 Sequence<sal_Int8> aPassword;
392 xPropSet->getPropertyValue(
"ProtectionKey") >>= aPassword;
393 if (aPassword.hasElements())
405 "http://www.w3.org/2000/09/xmldsig#sha256");
415 aAny = xPropSet->getPropertyValue(
"FileLink");
416 SectionFileLink aFileLink;
419 aAny = xPropSet->getPropertyValue(
"LinkRegion");
420 OUString sRegionName;
421 aAny >>= sRegionName;
423 if ( !aFileLink.FileURL.isEmpty() ||
424 !aFileLink.FilterName.isEmpty() ||
425 !sRegionName.isEmpty())
427 if (!aFileLink.FileURL.isEmpty())
430 GetExport().GetRelativeReference( aFileLink.FileURL) );
433 if (!aFileLink.FilterName.isEmpty())
436 aFileLink.FilterName);
439 if (!sRegionName.isEmpty())
452 if (xPropSet->getPropertySetInfo()->hasPropertyByName(
"DDECommandFile"))
457 aAny = xPropSet->getPropertyValue(
"DDECommandFile");
458 OUString sApplication;
459 aAny >>= sApplication;
460 aAny = xPropSet->getPropertyValue(
"DDECommandType");
463 aAny = xPropSet->getPropertyValue(
"DDECommandElement");
467 if ( !sApplication.isEmpty() ||
478 aAny = xPropSet->getPropertyValue(
"IsAutomaticUpdate");
479 if (*o3tl::doAccess<bool>(aAny))
496 const Reference<XPropertySet> & rPropertySet)
506 sal_Int16 nLevel = sal_Int16();
507 if( rPropertySet->getPropertyValue(
"Level") >>= nLevel )
511 OUString::number(nLevel));
523 ExportBoolean(rPropertySet,
"CreateFromLevelParagraphStyles",
533 const Reference<XPropertySet> & rPropertySet)
540 ExportBoolean(rPropertySet,
"CreateFromOtherEmbeddedObjects",
558 const Reference<XPropertySet> & rPropertySet)
575 const Reference<XPropertySet> & rPropertySet)
592 const Reference<XPropertySet> & rPropertySet)
601 Any aAny = rPropertySet->getPropertyValue(
"MainEntryCharacterStyleName");
604 if (!sStyleName.isEmpty())
608 GetExport().EncodeStyleName( sStyleName ));
630 aAny = rPropertySet->getPropertyValue(
"SortAlgorithm");
633 if (!sAlgorithm.isEmpty())
640 aAny = rPropertySet->getPropertyValue(
"Locale");
652 const Reference<XPropertySet> & rPropertySet)
672 ExportBoolean(rPropertySet,
"CreateFromLevelParagraphStyles",
675 Any aAny = rPropertySet->getPropertyValue(
"UserIndexName" );
688 const Reference<XPropertySet> & rPropertySet)
706 const Reference<XPropertySet> & rPropertySet)
709 Any aAny = rPropertySet->getPropertyValue(
"IsProtected");
710 if (*o3tl::doAccess<bool>(aAny))
717 rPropertySet->getPropertyValue(
"Name") >>= sIndexName;
718 if ( !sIndexName.isEmpty() )
741 const Reference<XPropertySet> & rPropertySet)
753 aAny = rPropertySet->getPropertyValue(
"CreateFromChapter");
754 if (*o3tl::doAccess<bool>(aAny))
761 aAny = rPropertySet->getPropertyValue(
"IsRelativeTabstops");
762 if (! *o3tl::doAccess<bool>(aAny))
781 aAny = rPropertySet->getPropertyValue(
"ParaStyleHeading");
786 GetExport().EncodeStyleName( sStyleName ));
795 aAny = rPropertySet->getPropertyValue(
"Title");
796 OUString sTitleString;
797 aAny >>= sTitleString;
802 aAny = rPropertySet->getPropertyValue(
"LevelFormat");
803 Reference<XIndexReplace> xLevelTemplates;
804 aAny >>= xLevelTemplates;
808 sal_Int32 nLevelCount = xLevelTemplates->getCount();
809 for(sal_Int32
i = 1;
i<nLevelCount;
i++)
812 Sequence<PropertyValues> aTemplateSequence;
813 aAny = xLevelTemplates->getByIndex(
i);
814 aAny >>= aTemplateSequence;
828 aAny = rPropertySet->getPropertyValue(
"LevelParagraphStyles");
829 Reference<XIndexReplace> xLevelParagraphStyles;
830 aAny >>= xLevelParagraphStyles;
838 const Reference<XPropertySet> &)
855 const Reference<XPropertySet> & rPropertySet)
858 Any aAny = rPropertySet->getPropertyValue(
"CreateFromLabels");
859 if (! *o3tl::doAccess<bool>(aAny))
866 aAny = rPropertySet->getPropertyValue(
"LabelCategory");
867 OUString sSequenceName;
868 aAny >>= sSequenceName;
874 aAny = rPropertySet->getPropertyValue(
"LabelDisplayType");
913 {
nullptr,
"ParaStyleLevel1",
"ParaStyleLevel2",
"ParaStyleLevel3",
914 "ParaStyleLevel4",
"ParaStyleLevel5",
"ParaStyleLevel6",
915 "ParaStyleLevel7",
"ParaStyleLevel8",
"ParaStyleLevel9",
916 "ParaStyleLevel10",
nullptr };
918 {
nullptr,
"ParaStyleLevel1",
nullptr };
920 {
nullptr,
"ParaStyleSeparator",
"ParaStyleLevel1",
"ParaStyleLevel2",
921 "ParaStyleLevel3",
nullptr };
924 {
nullptr,
"ParaStyleLevel1",
"ParaStyleLevel1",
"ParaStyleLevel1",
925 "ParaStyleLevel1",
"ParaStyleLevel1",
"ParaStyleLevel1",
926 "ParaStyleLevel1",
"ParaStyleLevel1",
"ParaStyleLevel1",
927 "ParaStyleLevel1",
"ParaStyleLevel1",
"ParaStyleLevel1",
928 "ParaStyleLevel1",
"ParaStyleLevel1",
"ParaStyleLevel1",
929 "ParaStyleLevel1",
"ParaStyleLevel1",
"ParaStyleLevel1",
930 "ParaStyleLevel1",
"ParaStyleLevel1",
"ParaStyleLevel1",
970 sal_Int32 nOutlineLevel,
971 const Reference<XPropertySet> & rPropertySet,
972 const Sequence<Sequence<PropertyValue> > & rValues)
976 OSL_ENSURE(nOutlineLevel >= 0,
"illegal outline level");
980 (nOutlineLevel >= 0) )
1009 const char* pPropName(
1011 OSL_ENSURE(
nullptr != pPropName,
"can't find property name");
1012 if (
nullptr != pPropName)
1014 Any aAny = rPropertySet->getPropertyValue(
1015 OUString::createFromAscii(pPropName));
1016 OUString sParaStyleName;
1017 aAny >>= sParaStyleName;
1020 GetExport().EncodeStyleName( sParaStyleName ));
1032 for(
auto& rValue : rValues)
1045enum TemplateTypeEnum
1047 TOK_TTYPE_ENTRY_NUMBER,
1048 TOK_TTYPE_ENTRY_TEXT,
1051 TOK_TTYPE_PAGE_NUMBER,
1052 TOK_TTYPE_CHAPTER_INFO,
1053 TOK_TTYPE_HYPERLINK_START,
1054 TOK_TTYPE_HYPERLINK_END,
1055 TOK_TTYPE_BIBLIOGRAPHY,
1059enum TemplateParamEnum
1061 TOK_TPARAM_TOKEN_TYPE,
1062 TOK_TPARAM_CHAR_STYLE,
1063 TOK_TPARAM_TAB_RIGHT_ALIGNED,
1064 TOK_TPARAM_TAB_POSITION,
1065 TOK_TPARAM_TAB_WITH_TAB,
1066 TOK_TPARAM_TAB_FILL_CHAR,
1068 TOK_TPARAM_CHAPTER_FORMAT,
1069 TOK_TPARAM_CHAPTER_LEVEL,
1070 TOK_TPARAM_BIBLIOGRAPHY_DATA
1086 {
nullptr, 0, TemplateTypeEnum(0)}
1102 {
nullptr, 0, TemplateParamEnum(0)}
1108 {
XML_ANNOTE, BibliographyDataField::ANNOTE },
1109 {
XML_AUTHOR, BibliographyDataField::AUTHOR },
1119 {
XML_EDITOR, BibliographyDataField::EDITOR },
1123 {
XML_ISBN, BibliographyDataField::ISBN },
1125 {
XML_MONTH, BibliographyDataField::MONTH },
1126 {
XML_NOTE, BibliographyDataField::NOTE },
1127 {
XML_NUMBER, BibliographyDataField::NUMBER },
1129 {
XML_PAGES, BibliographyDataField::PAGES },
1132 {
XML_SCHOOL, BibliographyDataField::SCHOOL },
1133 {
XML_SERIES, BibliographyDataField::SERIES },
1134 {
XML_TITLE, BibliographyDataField::TITLE },
1135 {
XML_URL, BibliographyDataField::URL },
1136 {
XML_VOLUME, BibliographyDataField::VOLUME },
1137 {
XML_YEAR, BibliographyDataField::YEAR },
1143 const Sequence<PropertyValue> & rValues)
1148 OUString sCharStyle;
1149 bool bCharStyleOK =
false;
1153 bool bTextOK =
false;
1156 bool bRightAligned =
false;
1159 sal_Int32 nTabPosition = 0;
1160 bool bTabPositionOK =
false;
1164 bool bFillCharOK =
false;
1167 sal_Int16 nChapterFormat = 0;
1168 bool bChapterFormatOK =
false;
1171 sal_Int16 nLevel = 0;
1172 bool bLevelOK =
false;
1175 sal_Int16 nBibliographyData = 0;
1176 bool bBibliographyDataOK =
false;
1179 bool bWithTabStop =
false;
1180 bool bWithTabStopOK =
false;
1187 enum TemplateTypeEnum nTokenType = TOK_TTYPE_INVALID;
1189 for(
const auto& rValue : rValues)
1191 TemplateParamEnum
nToken;
1202 case TOK_TPARAM_TOKEN_TYPE:
1205 rValue.Value >>= sVal;
1210 case TOK_TPARAM_CHAR_STYLE:
1212 rValue.Value >>= sCharStyle;
1213 bCharStyleOK = !sCharStyle.isEmpty();
1216 case TOK_TPARAM_TEXT:
1217 rValue.Value >>= sText;
1221 case TOK_TPARAM_TAB_RIGHT_ALIGNED:
1223 *o3tl::doAccess<bool>(rValue.Value);
1226 case TOK_TPARAM_TAB_POSITION:
1227 rValue.Value >>= nTabPosition;
1228 bTabPositionOK =
true;
1232 case TOK_TPARAM_TAB_WITH_TAB:
1233 bWithTabStop = *o3tl::doAccess<bool>(rValue.Value);
1234 bWithTabStopOK =
true;
1237 case TOK_TPARAM_TAB_FILL_CHAR:
1238 rValue.Value >>= sFillChar;
1242 case TOK_TPARAM_CHAPTER_FORMAT:
1243 rValue.Value >>= nChapterFormat;
1244 bChapterFormatOK =
true;
1247 case TOK_TPARAM_CHAPTER_LEVEL:
1248 rValue.Value >>= nLevel;
1251 case TOK_TPARAM_BIBLIOGRAPHY_DATA:
1252 rValue.Value >>= nBibliographyData;
1253 bBibliographyDataOK =
true;
1264 case TOK_TTYPE_ENTRY_TEXT:
1267 case TOK_TTYPE_TAB_STOP:
1269 if ( bRightAligned || bTabPositionOK || bFillCharOK )
1274 case TOK_TTYPE_TEXT:
1281 case TOK_TTYPE_PAGE_NUMBER:
1284 case TOK_TTYPE_CHAPTER_INFO:
1287 case TOK_TTYPE_ENTRY_NUMBER:
1290 case TOK_TTYPE_HYPERLINK_START:
1293 case TOK_TTYPE_HYPERLINK_END:
1296 case TOK_TTYPE_BIBLIOGRAPHY:
1297 if (bBibliographyDataOK)
1311 case TOK_TTYPE_HYPERLINK_START:
1312 case TOK_TTYPE_HYPERLINK_END:
1340 if (TOK_TTYPE_CHAPTER_INFO == nTokenType)
1364 switch( nChapterFormat )
1366 case ChapterFormat::DIGIT:
1367 nChapterFormat = ChapterFormat::NUMBER;
1369 case ChapterFormat::NO_PREFIX_SUFFIX:
1370 nChapterFormat = ChapterFormat::NAME_NUMBER;
1375 else if (TOK_TTYPE_ENTRY_NUMBER == nTokenType)
1383 bChapterFormatOK =
false;
1396 case TOK_TTYPE_ENTRY_TEXT:
1397 case TOK_TTYPE_TEXT:
1398 case TOK_TTYPE_PAGE_NUMBER:
1399 case TOK_TTYPE_ENTRY_NUMBER:
1400 case TOK_TTYPE_HYPERLINK_START:
1401 case TOK_TTYPE_HYPERLINK_END:
1402 case TOK_TTYPE_BIBLIOGRAPHY:
1403 case TOK_TTYPE_CHAPTER_INFO:
1404 case TOK_TTYPE_TAB_STOP:
1407 GetExport().EncodeStyleName( sCharStyle) );
1416 if (TOK_TTYPE_TAB_STOP == nTokenType)
1422 if (bTabPositionOK && (! bRightAligned))
1425 OUStringBuffer sBuf;
1430 sBuf.makeStringAndClear());
1434 if (bFillCharOK && !sFillChar.isEmpty())
1441 if (bWithTabStopOK && ! bWithTabStop)
1450 if (TOK_TTYPE_BIBLIOGRAPHY == nTokenType)
1452 OSL_ENSURE(bBibliographyDataOK,
"need bibl data");
1453 OUStringBuffer sBuf;
1459 sBuf.makeStringAndClear());
1464 if (TOK_TTYPE_CHAPTER_INFO == nTokenType)
1466 OSL_ENSURE(bChapterFormatOK,
"need chapter info");
1473 OUString::number(nLevel));
1477 if (TOK_TTYPE_ENTRY_NUMBER == nTokenType)
1479 if (bChapterFormatOK)
1486 OUString::number(nLevel));
1495 if (TOK_TTYPE_TEXT == nTokenType)
1502 Reference<XIndexReplace>
const & xLevelParagraphStyles)
1505 sal_Int32 nPLevelCount = xLevelParagraphStyles->getCount();
1506 for(sal_Int32 nLevel = 0; nLevel < nPLevelCount; nLevel++)
1508 Any aAny = xLevelParagraphStyles->getByIndex(nLevel);
1509 Sequence<OUString> aStyleNames;
1510 aAny >>= aStyleNames;
1513 if (aStyleNames.hasElements())
1516 sal_Int32 nLevelPlusOne = nLevel + 1;
1519 OUString::number(nLevelPlusOne));
1528 for(
const auto& rStyleName : std::as_const(aStyleNames))
1533 GetExport().EncodeStyleName(rStyleName) );
1546 const Reference<XPropertySet> & rPropSet,
1547 const OUString& sPropertyName,
1554 Any aAny = rPropSet->getPropertyValue(sPropertyName);
1555 bool bTmp = *o3tl::doAccess<bool>(aAny);
1559 if ( (bTmp != bInvert) != bDefault )
1573 if ( !xTextFieldsSupp.is() )
1576 static const OUStringLiteral sFieldMaster_Bibliography(
u"com.sun.star.text.FieldMaster.Bibliography");
1579 Reference<XNameAccess> xMasters =
1580 xTextFieldsSupp->getTextFieldMasters();
1581 if ( !xMasters->hasByName(sFieldMaster_Bibliography) )
1585 xMasters->getByName(sFieldMaster_Bibliography);
1586 Reference<XPropertySet> xPropSet;
1589 OSL_ENSURE( xPropSet.is(),
"field master must have XPropSet" );
1593 aAny = xPropSet->getPropertyValue(
"BracketBefore");
1597 aAny = xPropSet->getPropertyValue(
"BracketAfter");
1601 aAny = xPropSet->getPropertyValue(
"IsNumberEntries");
1602 if (*o3tl::doAccess<bool>(aAny))
1608 aAny = xPropSet->getPropertyValue(
"IsSortByPosition");
1609 if (! *o3tl::doAccess<bool>(aAny))
1616 aAny = xPropSet->getPropertyValue(
"SortAlgorithm");
1617 OUString sAlgorithm;
1618 aAny >>= sAlgorithm;
1619 if( !sAlgorithm.isEmpty() )
1626 aAny = xPropSet->getPropertyValue(
"Locale");
1637 aAny = xPropSet->getPropertyValue(
"SortKeys");
1638 Sequence<Sequence<PropertyValue> > aKeys;
1640 for(
const Sequence<PropertyValue> & rKey : std::as_const(aKeys))
1642 for(
const PropertyValue& rValue : rKey)
1644 if (rValue.Name ==
"SortKey")
1647 rValue.Value >>= nKey;
1648 OUStringBuffer sBuf;
1653 sBuf.makeStringAndClear());
1656 else if (rValue.Name ==
"IsSortAscending")
1658 bool bTmp = *o3tl::doAccess<bool>(rValue.Value);
1673 const Reference<XTextSection> & rSection)
const
1686 for(Reference<XTextSection> aSection(rSection);
1688 aSection = aSection->getParentSection())
1691 Reference<XPropertySet> xPropSet(aSection, UNO_QUERY);
1694 Any aAny = xPropSet->getPropertyValue(
"IsGlobalDocumentSection");
1696 if ( *o3tl::doAccess<bool>(aAny) )
1698 Reference<XDocumentIndex> xIndex;
1717 const Reference<XTextContent> & rSection,
1718 bool bDefault)
const
1721 bool bRet = bDefault;
1723 Reference<XPropertySet> xPropSet(rSection->getAnchor(), UNO_QUERY);
1726 if (xPropSet->getPropertySetInfo()->hasPropertyByName(
"TextSection"))
1728 Any aAny = xPropSet->getPropertyValue(
"TextSection");
1729 Reference<XTextSection> xSection;
1742 const Reference<XTextSection> & rEnclosingSection,
1743 const Reference<XTextContent> & rContent,
1747 bool bRet = bDefault;
1748 OSL_ENSURE(rEnclosingSection.is(),
"enclosing section expected");
1750 Reference<XPropertySet> xPropSet(rContent, UNO_QUERY);
1753 if (xPropSet->getPropertySetInfo()->hasPropertyByName(
"TextSection"))
1755 Any aAny = xPropSet->getPropertyValue(
"TextSection");
1756 Reference<XTextSection> xSection;
1764 bRet = (rEnclosingSection == xSection);
1765 xSection = xSection->getParentSection();
1767 while (!bRet && xSection.is());
1785 Reference< XChapterNumberingSupplier > xCNSupplier(
rExport.
GetModel(),
1788 Reference< XIndexReplace > xChapterNumbering;
1789 if( xCNSupplier.is() )
1790 xChapterNumbering = xCNSupplier->getChapterNumberingRules();
1792 if( !xChapterNumbering.is() )
1795 sal_Int32
nCount = xChapterNumbering->getCount();
1796 for( sal_Int32 nLevel = 0; nLevel <
nCount; nLevel++ )
1800 xChapterNumbering->getByIndex( nLevel ) >>=
aProperties;
1802 [](
const PropertyValue& rProp) {
return rProp.Name ==
"HeadingStyleName"; });
1804 pProp->Value >>= sStyle;
1806 if( !sStyle.isEmpty() )
1809 GetExport().EncodeStyleName( sStyle ) );
1812 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