24#include <com/sun/star/text/ChapterFormat.hpp>
25#include <osl/diagnose.h>
42OUString removeControlChars(std::u16string_view sIn)
44 OUStringBuffer
aBuf(sIn);
45 aBuf =
aBuf.replace(
'\n',
' ').replace(
'\t',
' ');
46 sal_Int32 nLen =
aBuf.getLength();
47 for (sal_Int32 i = 0;
i < nLen; ++
i)
52 while (j<nLen && aBuf[j]<
' ') ++j;
54 nLen =
aBuf.getLength();
57 return aBuf.makeStringAndClear();
69 return std::make_unique<SwChapterFieldType>();
124 std::unique_ptr<SwChapterField> pTmp(
129 return std::unique_ptr<SwField>(pTmp.release());
159 rState.
sPost.clear();
176 "<SwChapterField::ChangeExpansion(..)> - outline node with inconsistent outline level. Serious defect." );
179 if (nPrevLvl < rState.
nLevel)
243 case CF_NUMBER: nRet = text::ChapterFormat::NUMBER;
break;
246 nRet = text::ChapterFormat::DIGIT;
249 nRet = text::ChapterFormat::NO_PREFIX_SUFFIX;
252 default: nRet = text::ChapterFormat::NAME_NUMBER;
291 case text::ChapterFormat::NO_PREFIX_SUFFIX:
294 case text::ChapterFormat::DIGIT:
@ CF_NUM_TITLE
number and title
@ CF_NUMBER
only the chapter number
@ CF_NUMBER_NOPREPST
only chapter number without post-/prefix
@ CF_NUM_NOPREPST_TITLE
chapter number without post-/prefix and title
SvxNumType GetNumberingType() const
virtual std::unique_ptr< SwFieldType > Copy() const override
virtual std::unique_ptr< SwField > Copy() const override
void ChangeExpansion(const SwFrame &, const SwContentNode *, bool bSrchNum=false)
SwChapterField(SwChapterFieldType *, sal_uInt32 nFormat=0)
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhich) const override
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
sal_uInt8 GetLevel(SwRootFrame const *pLayout=nullptr) const
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhich) override
const OUString & GetNumber(SwRootFrame const *pLayout=nullptr) const
SwNumRule * GetOutlineNumRule() const
Instances of SwFields and those derived from it occur 0 to n times.
Base class of all fields.
void SetFormat(sal_uInt32 const nSet)
sal_uInt32 GetFormat() const
Query parameters for dialog and for BASIC.
SwFieldType * GetTyp() const
const OUString & GetTitle() const
Base class of the Writer layout elements.
SwRootFrame * getRootFrame()
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
const SwTextNode * FindOutlineNodeOfLevel(sal_uInt8 nLvl, SwRootFrame const *pLayout=nullptr) const
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
const SwNumFormat & Get(sal_uInt16 i) const
The root element of a Writer document layout.
bool IsHideRedlines() const
Replacement for sw::DocumentRedlineManager::GetRedlineFlags() (this is layout-level redline hiding).
SwTextNode is a paragraph in the document model.
bool IsOutline() const
Returns if this text node is an outline.
bool IsCountedInList() const
SwNumRule * GetNumRule(bool bInParent=true) const
Returns numbering rule of this text node.
int GetActualListLevel(SwListRedlineType eRedline=SwListRedlineType::SHOW) const
Returns the actual list level of this text node, when it is a list item.
int GetAttrOutlineLevel() const
Returns outline level of this text node.
OUString GetNumString(const bool _bInclPrefixAndSuffixStrings=true, const unsigned int _nRestrictToThisLevel=MAXLEVEL, SwRootFrame const *pLayout=nullptr, SwListRedlineType eRedline=SwListRedlineType::SHOW) const
Returns outline of numbering string.
SwTextFormatColl * GetTextColl() const
const SwTextNode * GetBodyTextNode(const SwDoc &rDoc, SwPosition &rPos, const SwFrame &rFrame)
Forward declaration: get "BodyTextNode" for exp.fld in Fly's headers/footers/footnotes.
ExpandMode
Some helpers for converting model strings to view strings.
OUString GetExpandTextMerged(SwRootFrame const *const pLayout, SwTextNode const &rNode, bool const bWithNumber, bool const bWithSpacesForLevel, ExpandMode const i_mode)
OUString sLabelFollowedBy
Marks a position in the document model.
constexpr sal_uInt8 MAXLEVEL
#define FIELD_PROP_USHORT1