24#include <osl/diagnose.h>
56 std::optional<SfxItemSet> oAttr;
80 std::tuple<SwTOXBase const*, sw::RedlineMode, sw::FieldmarkMode, sw::ParagraphBreakMode>
const*
const pTOXBase)
83 , m_pAttrSet( (pSet && pSet->
Count()) ? new
SfxItemSet( *pSet ) : nullptr )
84 , m_nSectionNodePos(0)
85 , m_bSplitAtStart(false)
86 , m_bSplitAtEnd(false)
87 , m_bUpdateFootnote(false)
91 std::make_unique<SwTOXBase>(*std::get<0>(*pTOXBase)),
92 std::get<1>(*pTOXBase),
93 std::get<2>(*pTOXBase),
94 std::get<3>(*pTOXBase));
117 if( aBrkSet.
Count() )
137 OSL_ENSURE( pNd,
"where is my SectionNode?" );
203 && std::get<2>(*
m_xTOXBase) ==
p->GetFieldmarkMode()
204 && std::get<3>(*
m_xTOXBase) ==
p->GetParagraphBreakMode())
212 assert(!layouts.empty());
213 pLayoutToReset = *layouts.begin();
218 pLayout = pLayoutToReset;
284 OSL_ENSURE( pTextNd,
"Where is my TextNode?" );
307 pTextNd->
GetText().getLength(),
false );
341 return std::make_unique<SwUndoDelSection>(rFormat, *rFormat.
GetSection(),
354 , m_pMetadataUndo( rSectionFormat.CreateUndo() )
355 , m_nStartNode( pIndex->GetIndex() )
356 , m_nEndNode( pIndex->
GetNode().EndOfSectionIndex() )
405 bool bRecalcCondHidden =
420 OSL_ENSURE( pNd,
"Where is my SectionNode?" );
427class SwUndoUpdateSection
431 std::unique_ptr<SwSectionData> m_pSectionData;
432 std::optional<SfxItemSet> m_oAttrSet;
434 bool const m_bOnlyAttrChanged;
446std::unique_ptr<SwUndo>
449 return std::make_unique<SwUndoUpdateSection>(*rFormat.
GetSection(),
453SwUndoUpdateSection::SwUndoUpdateSection(
455 bool const bOnlyAttr)
459 , m_nStartNode( pIndex->GetIndex() )
460 , m_bOnlyAttrChanged( bOnlyAttr )
468 rDoc.
GetNodes()[ m_nStartNode ]->GetSectionNode();
469 OSL_ENSURE( pSectNd,
"Where is my SectionNode?" );
481 m_oAttrSet->Put( *pItem );
495 m_oAttrSet.emplace(std::move(*oCur));
499 if (m_bOnlyAttrChanged)
503 (!rNdSect.
IsLinkType() && m_pSectionData->IsLinkType())
504 || ( !m_pSectionData->GetLinkFileName().isEmpty()
505 && (m_pSectionData->GetLinkFileName() !=
511 m_pSectionData.reset(pOld);
532 , m_nStartIndex(rTOX.
GetFormat()->GetSectionNode()->GetIndex() + 1)
541 if (
first.GetNode().IsSectionNode())
547 assert(
first.GetNode().IsTextNode());
549 assert(
last.GetNode().IsTextNode());
573 assert(
first.GetNode().IsTextNode());
575 assert(
last.GetNode().IsTextNode());
594 assert(
first.GetNode().IsTextNode());
596 assert(
last.GetNode().IsTextNode());
virtual void FieldsToCalc(SwCalc &rCalc, SwNodeOffset nLastNd, sal_Int32 nLastCnt)=0
virtual const SwRootFrame * GetCurrentLayout() const =0
virtual sfx2::LinkManager & GetLinkManager()=0
virtual bool IsRedlineOn() const =0
Query if redlining is on.
virtual bool DeleteRedline(const SwPaM &rPam, bool bSaveInUndo, RedlineType nDelType)=0
static bool IsRedlineOn(const RedlineFlags eM)
virtual std::size_t GetRedlineAuthor()=0
virtual bool SplitRedline(const SwPaM &rPam)=0
virtual void SetRedlineFlags_intern(RedlineFlags eMode)=0
Set a new redline mode.
virtual const SwRedlineTable & GetRedlineTable() const =0
virtual AppendResult AppendRedline(SwRangeRedline *pNewRedl, bool bCallDelete)=0
Append a new redline.
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SwSbxValue Calculate(const OUString &rStr)
bool HasSwAttrSet() const
virtual sal_Int32 Len() const
const SwAttrSet * GetpSwAttrSet() const
SwTOXBaseSection * InsertTableOf(const SwPosition &rPos, const SwTOXBase &rTOX, const SfxItemSet *pSet=nullptr, bool bExpand=false, SwRootFrame const *pLayout=nullptr)
void CorrAbs(const SwNode &rOldNode, const SwPosition &rNewPos, const sal_Int32 nOffset=0, bool bMoveCursor=false)
o3tl::sorted_vector< SwRootFrame * > GetAllLayouts()
SwSection * InsertSwSection(SwPaM const &rRange, SwSectionData &, std::tuple< SwTOXBase const *, sw::RedlineMode, sw::FieldmarkMode, sw::ParagraphBreakMode > const *pTOXBase, SfxItemSet const *const pAttr, bool const bUpdate=true)
IDocumentLinksAdministration const & getIDocumentLinksAdministration() const
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
SwEditShell const * GetEditShell() const
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
SwFootnoteIdxs & GetFootnoteIdxs()
void DelSectionFormat(SwSectionFormat *pFormat, bool bDelNodes=false)
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
const SwAttrPool & GetAttrPool() const
SwSectionFormat * MakeSectionFormat()
const SwNodeIndex * GetContentIdx() const
Marks a node in the document model.
SwNodeOffset GetIndex() const
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwSectionNode * GetSectionNode()
SwNodeOffset GetIndex() const
bool IsSectionNode() const
SwNodeOffset EndOfSectionIndex() const
SwContentNode * GetContentNode()
const SwEndNode * EndOfSectionNode() const
SwTextNode * MakeTextNode(SwNode &rWhere, SwTextFormatColl *pColl, bool bNewFrames=true)
Implementations of "Make...Node" are in the given .cxx-files.
void Delete(const SwNodeIndex &rPos, SwNodeOffset nNodes=SwNodeOffset(1))
SwSectionNode * InsertTextSection(SwNode &rNd, SwSectionFormat &rSectionFormat, SwSectionData const &, SwTOXBase const *const pTOXBase, SwNode const *pEndNd, bool const bInsAtStart=true, bool const bCreateFrames=true)
Insert a new SwSection.
PaM is Point and Mark: a selection of the document model.
const SwPosition * GetPoint() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
The root element of a Writer document layout.
void SetHideRedlines(bool)
sw::FieldmarkMode GetFieldmarkMode() const
void SetFieldmarkMode(sw::FieldmarkMode, sw::ParagraphBreakMode)
sw::ParagraphBreakMode GetParagraphBreakMode() const
A section node represents the start of a section on the UI, i.e.
const SwSection & GetSection() const
OUString const & GetCondition() const
OUString const & GetLinkFileName() const
void SetSectionData(SwSectionData const &rData)
void SetCondHidden(bool const bFlag)
SwSectionFormat * GetFormat()
const ::sfx2::SvBaseLink & GetBaseLink() const
SectionType GetType() const
void CreateLink(LinkCreateType eType)
SwTextNode is a paragraph in the document model.
virtual sal_Int32 Len() const override
void RstTextAttr(const sal_Int32 nContentStart, const sal_Int32 nLen, const sal_uInt16 nWhich=0, const SfxItemSet *pSet=nullptr, const bool bInclRefToxMark=false, const bool bExactRange=false)
delete all attributes.
virtual SwContentNode * JoinNext() override
SwpHints * GetpSwpHints()
const OUString & GetText() const
SwPaM & AddUndoRedoPaM(::sw::UndoRedoContext &, bool const bCorrToContent=false) const
std::unique_ptr< SwSectionData > const m_pSectionData
virtual void UndoImpl(::sw::UndoRedoContext &) override
std::optional< SfxItemSet > const m_oAttrSet
set iff section is TOX
SwUndoDelSection(SwSectionFormat const &, SwSection const &, SwNodeIndex const *const)
SwNodeOffset const m_nStartNode
std::shared_ptr< ::sfx2::MetadatableUndo > const m_pMetadataUndo
virtual void RedoImpl(::sw::UndoRedoContext &) override
SwNodeOffset const m_nEndNode
std::unique_ptr< SwTOXBase > const m_pTOXBase
section not TOX
std::unique_ptr< SwHistory > m_pHistory
const std::unique_ptr< SfxItemSet > m_pAttrSet
set iff section is TOX
virtual ~SwUndoInsSection() override
std::unique_ptr< SwRedlineSaveDatas > m_pRedlineSaveData
void Join(SwDoc &rDoc, SwNodeOffset nNode)
std::optional< std::tuple< std::unique_ptr< SwTOXBase >, sw::RedlineMode, sw::FieldmarkMode, sw::ParagraphBreakMode > > m_xTOXBase
std::unique_ptr< SwRedlineData > m_pRedlData
SwUndoInsSection(SwPaM const &, SwSectionData const &, SfxItemSet const *pSet, std::tuple< SwTOXBase const *, sw::RedlineMode, sw::FieldmarkMode, sw::ParagraphBreakMode > const *pTOXBase)
void SaveSplitNode(SwTextNode *const pTextNd, bool const bAtStart)
const std::unique_ptr< SwSectionData > m_pSectionData
virtual void RedoImpl(::sw::UndoRedoContext &) override
SwNodeOffset m_nSectionNodePos
virtual void RepeatImpl(::sw::RepeatContext &) override
virtual void UndoImpl(::sw::UndoRedoContext &) override
virtual ~SwUndoUpdateIndex() override
std::unique_ptr< SwUndoSaveSection, o3tl::default_delete< SwUndoSaveSection > > const m_pSaveSectionUpdated
virtual void RedoImpl(::sw::UndoRedoContext &) override
SwUndoUpdateIndex(SwTOXBaseSection &)
std::unique_ptr< SwUndoSaveSection, o3tl::default_delete< SwUndoSaveSection > > const m_pSaveSectionOriginal
void TitleSectionInserted(SwSectionFormat &rSectionFormat)
std::unique_ptr< SwUndoDelSection > m_pTitleSectionUpdated
SwNodeOffset const m_nStartIndex
virtual void UndoImpl(::sw::UndoRedoContext &) override
virtual void UndoImpl(::sw::UndoRedoContext &)=0
void SetRedlineFlags(RedlineFlags eMode)
RedlineFlags GetRedlineFlags() const
static bool FillSaveData(const SwPaM &rRange, SwRedlineSaveDatas &rSData, bool bDelRange=true, bool bCopyNext=true)
static void RemoveIdxRel(SwNodeOffset, const SwPosition &)
static void SetSaveData(SwDoc &rDoc, SwRedlineSaveDatas &rSData)
virtual void RedoImpl(::sw::UndoRedoContext &)=0
static void RemoveIdxFromSection(SwDoc &, SwNodeOffset nSttIdx, const SwNodeOffset *pEndIdx=nullptr)
void Remove(SvBaseLink const *pLink)
virtual SotClipboardFormatId GetFormat(const TransferableDataHelper &aHelper) override
constexpr TypedWhichId< SwFormatEndAtTextEnd > RES_END_AT_TXTEND(124)
constexpr sal_uInt16 RES_FRMATR_BEGIN(RES_PARATR_LIST_END)
constexpr TypedWhichId< SwFormatFootnoteAtTextEnd > RES_FTN_AT_TXTEND(123)
constexpr TypedWhichId< SwFormatHeader > RES_HEADER(102)
constexpr sal_uInt16 RES_FRMATR_END(141)
constexpr TypedWhichId< SvxOpaqueItem > RES_OPAQUE(105)
constexpr TypedWhichId< SvxProtectItem > RES_PROTECT(106)
constexpr TypedWhichId< SvxFormatBreakItem > RES_BREAK(100)
constexpr TypedWhichId< SwFormatSurround > RES_SURROUND(107)
constexpr TypedWhichId< SwFormatContent > RES_CNTNT(101)
WhichRangesContainer const aBreakSetRange(svl::Items< RES_PAGEDESC, RES_BREAK >)
constexpr OUStringLiteral first
constexpr OUStringLiteral last
SwContentNode * GetNode(SwPaM &rPam, bool &rbFirst, SwMoveFnCollection const &fnMove, bool const bInReadOnly, SwRootFrame const *const i_pLayout)
This function returns the next node in direction of search.
@ RES_POOLCOLL_TEXT
Text body.
Marks a position in the document model.
sal_Int32 GetContentIndex() const
constexpr sal_Int32 COMPLETE_STRING
std::unique_ptr< SwUndo > MakeUndoDelSection(SwSectionFormat const &rFormat)
std::unique_ptr< SwUndo > MakeUndoUpdateSection(SwSectionFormat const &rFormat, bool const bOnlyAttr)
static std::optional< SfxItemSet > lcl_GetAttrSet(const SwSection &rSect)
OD 04.10.2002 #102894# class Calc needed for calculation of the hidden condition of a section.