20 #include <com/sun/star/text/ChapterFormat.hpp>
21 #include <osl/diagnose.h>
38 OUString removeControlChars(
const OUString& sIn)
40 OUStringBuffer
aBuf(sIn.replace(
'\n',
' '));
41 sal_Int32 nLen =
aBuf.getLength();
42 for (sal_Int32 i = 0;
i < nLen; ++
i)
47 while (j<nLen && aBuf[j]<
' ') ++j;
49 nLen =
aBuf.getLength();
52 return aBuf.makeStringAndClear();
64 return std::make_unique<SwChapterFieldType>();
105 return rState.sTitle;
107 return rState.sPre + rState.sNumber + rState.sPost;
109 return rState.sPre + rState.sNumber + rState.sPost + rState.sTitle;
111 return rState.sNumber + rState.sTitle;
114 return rState.sNumber;
119 std::unique_ptr<SwChapterField> pTmp(
124 return std::unique_ptr<SwField>(pTmp.release());
152 rState.sTitle.clear();
153 rState.sPost.clear();
170 "<SwChapterField::ChangeExpansion(..)> - outline node with inconsistent outline level. Serious defect." );
173 if (nPrevLvl < rState.nLevel)
174 rState.nLevel = nPrevLvl;
182 if (!rState.nLevel--)
209 const SwNumFormat& rNFormat = pRule->Get(nListLevel);
216 rState.sNumber =
"??";
236 case CF_NUMBER: nRet = text::ChapterFormat::NUMBER;
break;
239 nRet = text::ChapterFormat::DIGIT;
242 nRet = text::ChapterFormat::NO_PREFIX_SUFFIX;
245 default: nRet = text::ChapterFormat::NAME_NUMBER;
284 case text::ChapterFormat::NO_PREFIX_SUFFIX:
287 case text::ChapterFormat::DIGIT:
SvxNumType GetNumberingType() const
Instances of SwFields and those derived from it occur 0 to n times.
Base class of the Writer layout elements.
Marks a position in the document model.
bool IsOutline() const
Returns if this text node is an outline.
sal_uInt32 GetFormat() const
Query parameters for dialog and for BASIC.
const SwTextNode * GetBodyTextNode(const SwDoc &rDoc, SwPosition &rPos, const SwFrame &rFrame)
Forward declaration: get "BodyTextNode" for exp.fld in Fly's headers/footers/footnotes.
Base class of all fields.
#define FIELD_PROP_USHORT1
only chapter number without post-/prefix
The root element of a Writer document layout.
int GetActualListLevel() 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.
chapter number without post-/prefix and title
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhich) override
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
const OUString & GetTitle(SwRootFrame const *pLayout=nullptr) const
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
OUString GetExpandTextMerged(SwRootFrame const *const pLayout, SwTextNode const &rNode, bool const bWithNumber, bool const bWithSpacesForLevel, ExpandMode const i_mode)
sal_uInt8 GetLevel(SwRootFrame const *pLayout=nullptr) const
SwNumRule * GetNumRule(bool bInParent=true) const
Returns numbering rule of this text node.
void SetFormat(sal_uInt32 const nSet)
SwFieldType * GetTyp() const
const SwNumFormat & Get(sal_uInt16 i) const
SwTextNode is a paragraph in the document model.
virtual std::unique_ptr< SwFieldType > Copy() const override
ExpandMode
Some helpers for converting model strings to view strings.
const SwTextNode * FindOutlineNodeOfLevel(sal_uInt8 nLvl, SwRootFrame const *pLayout=nullptr) const
void ChangeExpansion(const SwFrame &, const SwContentNode *, bool bSrchNum=false)
bool IsCountedInList() const
virtual std::unique_ptr< SwField > Copy() const override
bool IsHideRedlines() const
Replacement for sw::DocumentRedlineManager::GetRedlineFlags() (this is layout-level redline hiding)...
const OUString & GetNumber(SwRootFrame const *pLayout=nullptr) const
OUString GetNumString(const bool _bInclPrefixAndSuffixStrings=true, const unsigned int _nRestrictToThisLevel=MAXLEVEL, SwRootFrame const *pLayout=nullptr) const
Returns outline of numbering string.
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhich) const override
SwChapterField(SwChapterFieldType *, sal_uInt32 nFormat=0)
SwRootFrame * getRootFrame()
SwNumRule * GetOutlineNumRule() const
SwTextFormatColl * GetTextColl() const