22#include <com/sun/star/beans/XPropertySet.hpp>
23#include <com/sun/star/frame/XModel.hpp>
24#include <com/sun/star/text/XLineNumberingProperties.hpp>
25#include <com/sun/star/style/LineNumberPosition.hpp>
26#include <com/sun/star/style/NumberingType.hpp>
41using ::com::sun::star::beans::XPropertySet;
42using ::com::sun::star::xml::sax::XFastAttributeList;
43using ::com::sun::star::text::XLineNumberingProperties;
54constexpr OUStringLiteral
gsIsOn(u
"IsOn");
66, nSeparatorIncrement(-1)
68, bCountEmptyLines(true)
69, bCountInFloatingFrames(false)
70, bRestartNumbering(false)
79 const OUString& rValue )
120 convertMeasureToCore(nTmp, rValue))
138 {
XML_LEFT, style::LineNumberPosition::LEFT },
139 {
XML_RIGHT, style::LineNumberPosition::RIGHT },
140 {
XML_INSIDE, style::LineNumberPosition::INSIDE },
141 {
XML_OUTSIDE, style::LineNumberPosition::OUTSIDE },
164 Reference<XLineNumberingProperties> xSupplier(
GetImport().GetModel(),
169 Reference<XPropertySet> xLineNumbering =
170 xSupplier->getLineNumberingProperties();
172 if (!xLineNumbering.is())
178 if (
GetImport().GetStyles()->FindStyleChildContext(
181 aAny <<=
GetImport().GetStyleDisplayName(
205 sal_Int16
nNumType = NumberingType::ARABIC;
214 const css::uno::Reference< css::xml::sax::XFastAttributeList >& )
222 const OUString& sText)
SvXMLEnumMapEntry< sal_uInt16 > const aLineNumberPositionMap[]
constexpr OUStringLiteral gsDistance(u"Distance")
constexpr OUStringLiteral gsCountLinesInFrames(u"CountLinesInFrames")
constexpr OUStringLiteral gsNumberingType(u"NumberingType")
constexpr OUStringLiteral gsCharStyleName(u"CharStyleName")
constexpr OUStringLiteral gsNumberPosition(u"NumberPosition")
constexpr OUStringLiteral gsRestartAtEachPage(u"RestartAtEachPage")
constexpr OUStringLiteral gsInterval(u"Interval")
constexpr OUStringLiteral gsIsOn(u"IsOn")
constexpr OUStringLiteral gsSeparatorText(u"SeparatorText")
constexpr OUStringLiteral gsSeparatorInterval(u"SeparatorInterval")
constexpr OUStringLiteral gsCountEmptyLines(u"CountEmptyLines")
SvXMLImport & GetImport()
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...
virtual ~XMLLineNumberingImportContext() override
virtual void SetAttribute(sal_Int32 nElement, const OUString &rValue) override
sal_Int16 nSeparatorIncrement
void SetSeparatorText(const OUString &sText)
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
void SetSeparatorIncrement(sal_Int16 nIncr)
sal_Int16 nNumberPosition
bool bCountInFloatingFrames
virtual void CreateAndInsert(bool bOverwrite) override
XMLLineNumberingImportContext(SvXMLImport &rImport)
import <text:linenumbering-separator> elements
static bool convertNumber(sal_Int32 &rValue, std::u16string_view aString, sal_Int32 nMin=SAL_MIN_INT32, sal_Int32 nMax=SAL_MAX_INT32)
static bool convertBool(bool &rBool, std::u16string_view rString)
@ TEXT_LINENUMBERINGCONFIG
Handling of tokens in XML:
@ XML_COUNT_IN_TEXT_BOXES
@ XML_LINENUMBERING_SEPARATOR
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
return the OUString representation for eToken
#define XML_ELEMENT(prefix, name)