34#include <rtl/ustrbuf.hxx>
35#include <com/sun/star/lang/XServiceInfo.hpp>
36#include <com/sun/star/beans/XPropertySet.hpp>
37#include <com/sun/star/beans/XPropertyState.hpp>
38#include <com/sun/star/text/XTextDocument.hpp>
39#include <com/sun/star/text/XText.hpp>
40#include <com/sun/star/text/XFootnote.hpp>
41#include <com/sun/star/text/XFootnotesSupplier.hpp>
42#include <com/sun/star/text/XEndnotesSupplier.hpp>
43#include <com/sun/star/text/FootnoteNumbering.hpp>
44#include <com/sun/star/container/XNameReplace.hpp>
65 const Reference<XPropertySet> & rPropSet,
66 const OUString& rText,
67 bool bAutoStyles,
bool bIsProgress )
71 Reference<XFootnote> xFootnote;
73 Reference<XText> xText(xFootnote, UNO_QUERY);
76 Reference<XServiceInfo> xServiceInfo( xFootnote, UNO_QUERY );
86 bAutoStyles, bIsEndnote, bIsProgress );
92 bool bIsUICharStyle =
false;
93 bool bHasAutoStyle =
false;
95 OUString sStyle =
FindTextStyle( rPropSet, bIsUICharStyle, bHasAutoStyle );
101 rPropSet ), bHasAutoStyle,
103 if( !sStyle.isEmpty() )
110 bAutoStyles, bIsEndnote, bIsProgress );
115 bAutoStyles, bIsEndnote, bIsProgress );
123 const Reference<XFootnote> & rFootnote,
124 const Reference<XText> & rText,
125 const OUString& rTextString,
132 exportText(rText, bAutoStyles, bIsProgress,
true );
137 Reference<XPropertySet> xPropSet(rFootnote, UNO_QUERY);
139 sal_Int32 nNumber = 0;
142 "ftn" + OUString::number(nNumber));
151 OUString sLabel = rFootnote->getLabel();
152 if (!sLabel.isEmpty())
167 exportText(rText, bAutoStyles, bIsProgress,
true );
176 Reference<XFootnotesSupplier> aFootnotesSupplier(
GetExport().GetModel(),
178 Reference<XPropertySet> aFootnoteConfiguration(
179 aFootnotesSupplier->getFootnoteSettings());
183 Reference<XEndnotesSupplier> aEndnotesSupplier(
GetExport().GetModel(),
185 Reference<XPropertySet> aEndnoteConfiguration(
186 aEndnotesSupplier->getEndnoteSettings());
193 const Reference<XPropertySet> & rPropSet,
194 const OUString& sProperty,
201 Any aAny = rPropSet->getPropertyValue(sProperty);
213 const Reference<XPropertySet> & rFootnoteConfig,
255 OUStringBuffer sBuffer;
257 sal_Int16 nNumbering = 0;
261 sBuffer.makeStringAndClear() );
263 if (!sBuffer.isEmpty() )
266 sBuffer.makeStringAndClear());
270 aAny = rFootnoteConfig->getPropertyValue(
gsStartAt);
271 sal_Int16 nOffset = 0;
274 OUString::number(nOffset));
280 aAny = rFootnoteConfig->getPropertyValue(
283 ( (*o3tl::doAccess<bool>(aAny)) ?
292 case FootnoteNumbering::PER_PAGE:
295 case FootnoteNumbering::PER_CHAPTER:
298 case FootnoteNumbering::PER_DOCUMENT:
320 aAny = rFootnoteConfig->getPropertyValue(
gsEndNotice);
bool hasProperty(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, css::uno::Reference< css::beans::XPropertySetInfo > &rPropSetInfo)
void AddAttribute(sal_uInt16 nPrefix, const OUString &rName, const OUString &rValue)
void Characters(const OUString &rChars)
OUString EncodeStyleName(const OUString &rName, bool *pEncoded=nullptr) const
const SvXMLUnitConverter & GetMM100UnitConverter() const
bool convertNumFormat(sal_Int16 &rType, const OUString &rNumFormat, std::u16string_view rNumLetterSync, bool bNumberNone=false) const
convert num-format and num-letter-sync values to NumberingType
static void convertNumLetterSync(OUStringBuffer &rBuffer, sal_Int16 nType)
SvXMLExport & GetExport()
static constexpr OUStringLiteral gsParaStyleName
static constexpr OUStringLiteral gsCharStyleNames
static constexpr OUStringLiteral gsPrefix
void exportTextFootnoteConfiguration()
export footnote and endnote configuration elements
static constexpr OUStringLiteral gsReferenceId
static constexpr OUStringLiteral gsSuffix
static constexpr OUStringLiteral gsStartAt
static constexpr OUStringLiteral gsBeginNotice
static constexpr OUStringLiteral gsNumberingType
static constexpr OUStringLiteral gsPageStyleName
static constexpr OUStringLiteral gsFootnote
static constexpr OUStringLiteral gsPositionEndOfDoc
static constexpr OUStringLiteral gsFootnoteCounting
OUString FindTextStyle(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, bool &rbHasCharStyle, bool &rbHasAutoStyle, const XMLPropertyState **pAddState=nullptr) const
static constexpr OUStringLiteral gsCharStyleName
void exportTextFootnoteConfigurationHelper(const css::uno::Reference< css::beans::XPropertySet > &rFootnoteSupplier, bool bIsEndnote)
void exportTextFootnote(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, const OUString &sString, bool bAutoStyles, bool bProgress)
export a footnote and styles
static constexpr OUStringLiteral gsEndNotice
static constexpr OUStringLiteral gsTextEndnoteService
static constexpr OUStringLiteral gsAnchorCharStyleName
SinglePropertySetInfoCache m_aCharStyleNamesPropInfoCache
void Add(XmlStyleFamily nFamily, MultiPropertySetHelper &rPropSetHelper, const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
add autostyle for specified family
void exportTextFootnoteHelper(const css::uno::Reference< css::text::XFootnote > &rPropSet, const css::uno::Reference< css::text::XText > &rText, const OUString &sString, bool bAutoStyles, bool bIsEndnote, bool bProgress)
helper for exportTextFootnote
void exportText(const css::uno::Reference< css::text::XText > &rText, bool bAutoStyles, bool bProgress, bool bExportParagraph, TextPNS eExtensionNS=TextPNS::ODF)
#define SAL_WARN_IF(condition, area, stream)
Handling of tokens in XML:
XMLTokenEnum
The enumeration of all XML tokens.
@ XML_CITATION_BODY_STYLE_NAME
@ XML_NOTES_CONFIGURATION
@ XML_FOOTNOTE_CONTINUATION_NOTICE_FORWARD
@ XML_FOOTNOTE_CONTINUATION_NOTICE_BACKWARD
@ XML_CITATION_STYLE_NAME
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
return the OUString representation for eToken
static void lcl_exportString(SvXMLExport &rExport, const Reference< XPropertySet > &rPropSet, const OUString &sProperty, sal_uInt16 nPrefix, enum XMLTokenEnum eElement, bool bEncodeName)
constexpr sal_uInt16 XML_NAMESPACE_TEXT
constexpr sal_uInt16 XML_NAMESPACE_STYLE