23 #include <osl/diagnose.h>
39 #include <section.hxx>
55 std::unique_ptr<SfxItemSet> pAttr;
79 std::tuple<SwTOXBase const*, sw::RedlineMode, sw::FieldmarkMode>
const*
const pTOXBase)
82 , m_pTOXBase( pTOXBase
86 , m_pAttrSet( (pSet && pSet->
Count()) ? new
SfxItemSet( *pSet ) : nullptr )
87 , m_nSectionNodePos(0)
88 , m_bSplitAtStart(false)
89 , m_bSplitAtEnd(false)
90 , m_bUpdateFootnote(false)
113 if( aBrkSet.Count() )
133 OSL_ENSURE( pNd,
"where is my SectionNode?" );
198 && std::get<2>(*m_pTOXBase) ==
p->GetFieldmarkMode())
207 pLayoutToReset = *layouts.begin();
210 pLayoutToReset->SetFieldmarkMode(std::get<2>(*
m_pTOXBase));
211 pLayout = pLayoutToReset;
215 *std::get<0>(*m_pTOXBase),
m_pAttrSet.get(),
false, pLayout);
264 *std::get<0>(*m_pTOXBase),
m_pAttrSet.get(),
true,
278 OSL_ENSURE( pTextNd,
"Where is my TextNode?" );
290 pTextNd->RstTextAttr( aCntIdx, pTextNd->Len(), 0,
nullptr, true );
304 pTextNd->
GetText().getLength(), false );
338 return std::make_unique<SwUndoDelSection>(rFormat, *rFormat.
GetSection(),
339 rFormat.GetContent().GetContentIdx());
351 , m_pMetadataUndo( rSectionFormat.CreateUndo() )
352 , m_nStartNode( pIndex->GetIndex() )
353 , m_nEndNode( pIndex->
GetNode().EndOfSectionIndex() )
402 bool bRecalcCondHidden =
417 OSL_ENSURE( pNd,
"Where is my SectionNode?" );
424 class SwUndoUpdateSection
428 std::unique_ptr<SwSectionData> m_pSectionData;
429 std::unique_ptr<SfxItemSet> m_pAttrSet;
431 bool const m_bOnlyAttrChanged;
443 std::unique_ptr<SwUndo>
446 return std::make_unique<SwUndoUpdateSection>(*rFormat.
GetSection(),
450 SwUndoUpdateSection::SwUndoUpdateSection(
452 bool const bOnlyAttr)
456 , m_nStartNode( pIndex->GetIndex() )
457 , m_bOnlyAttrChanged( bOnlyAttr )
465 rDoc.
GetNodes()[ m_nStartNode ]->GetSectionNode();
466 OSL_ENSURE( pSectNd,
"Where is my SectionNode?" );
479 m_pAttrSet->Put( *pItem );
492 m_pAttrSet = std::move(pCur);
494 if (m_bOnlyAttrChanged)
498 (!rNdSect.
IsLinkType() && m_pSectionData->IsLinkType())
499 || ( !m_pSectionData->GetLinkFileName().isEmpty()
500 && (m_pSectionData->GetLinkFileName() !=
506 m_pSectionData.reset(pOld);
527 , m_nStartIndex(rTOX.GetFormat()->GetSectionNode()->GetIndex() + 1)
536 if (
first.GetNode().IsSectionNode())
553 assert(tmp.GetNode().IsSectionNode());
554 assert(tmp.GetNode().GetSectionNode()->GetSection().GetFormat() == &rFormat);
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
const SwEndNode * EndOfSectionNode() const
constexpr TypedWhichId< SvxProtectItem > RES_PROTECT(100)
SwPaM & AddUndoRedoPaM(::sw::UndoRedoContext &, bool const bCorrToContent=false) const
virtual sal_Int32 Len() const
constexpr TypedWhichId< SwFormatEndAtTextEnd > RES_END_AT_TXTEND(118)
constexpr TypedWhichId< SwFormatSurround > RES_SURROUND(101)
sal_uLong GetIndex() const
virtual void RedoImpl(::sw::UndoRedoContext &) override
Marks a position in the document model.
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.
const OUString & GetText() const
virtual const SwRootFrame * GetCurrentLayout() const =0
constexpr TypedWhichId< SwFormatHeader > RES_HEADER(96)
SwUndoDelSection(SwSectionFormat const &, SwSection const &, SwNodeIndex const *const)
SwpHints * GetpSwpHints()
virtual AppendResult AppendRedline(SwRangeRedline *pNewRedl, bool bCallDelete)=0
Append a new redline.
virtual void RepeatImpl(::sw::RepeatContext &) override
void DelSectionFormat(SwSectionFormat *pFormat, bool bDelNodes=false)
virtual void SetRedlineFlags_intern(RedlineFlags eMode)=0
Set a new redline mode.
virtual void FieldsToCalc(SwCalc &rCalc, sal_uLong nLastNd, sal_Int32 nLastCnt)=0
sal_uLong m_nSectionNodePos
std::shared_ptr< ::sfx2::MetadatableUndo > const m_pMetadataUndo
constexpr OUStringLiteral last
void CreateLink(LinkCreateType eType)
virtual void RedoImpl(::sw::UndoRedoContext &) override
constexpr sal_uInt16 RES_FRMATR_END(133)
void TitleSectionInserted(SwSectionFormat &rSectionFormat)
IDocumentLinksAdministration const & getIDocumentLinksAdministration() const
void SetRedlineFlags(RedlineFlags eMode)
constexpr TypedWhichId< SvxFormatBreakItem > RES_BREAK(94)
virtual ~SwUndoInsSection() override
constexpr TypedWhichId< SvxOpaqueItem > RES_OPAQUE(99)
SwSectionFormat * GetFormat()
sal_uLong const m_nStartNode
Dialog to specify the properties of date form field.
static void RemoveIdxFromSection(SwDoc &, sal_uLong nSttIdx, const sal_uLong *pEndIdx=nullptr)
OUString const & GetLinkFileName() const
The root element of a Writer document layout.
OUString const & GetCondition() const
void SaveSplitNode(SwTextNode *const pTextNd, bool const bAtStart)
const SwSection & GetSection() const
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
void Delete(const SwNodeIndex &rPos, sal_uLong nNodes=1)
delete nodes
const ::sfx2::SvBaseLink & GetBaseLink() const
SwTOXBaseSection * InsertTableOf(const SwPosition &rPos, const SwTOXBase &rTOX, const SfxItemSet *pSet=nullptr, bool bExpand=false, SwRootFrame const *pLayout=nullptr)
virtual void UndoImpl(::sw::UndoRedoContext &) override
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
std::unique_ptr< SwUndo > MakeUndoUpdateSection(SwSectionFormat const &rFormat, bool const bOnlyAttr)
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
static bool IsRedlineOn(const RedlineFlags eM)
sal_uLong GetIndex() const
const std::unique_ptr< SfxItemSet > m_pAttrSet
set iff section is TOX
o3tl::sorted_vector< SwRootFrame * > GetAllLayouts()
const std::unique_ptr< std::tuple< SwTOXBase *, sw::RedlineMode, sw::FieldmarkMode > > m_pTOXBase
SwSectionFormat * MakeSectionFormat()
RedlineFlags GetRedlineFlags() const
std::unique_ptr< SfxItemSet > const m_pAttrSet
set iff section is TOX
void SetHideRedlines(bool)
virtual std::size_t GetRedlineAuthor()=0
std::unique_ptr< SwRedlineSaveDatas > m_pRedlineSaveData
PaM is Point and Mark: a selection of the document model.
virtual void UndoImpl(::sw::UndoRedoContext &)=0
const SwAttrSet * GetpSwAttrSet() const
std::unique_ptr< SwHistory > m_pHistory
const SwPosition * GetPoint() const
void SetCondHidden(bool const bFlag)
void Remove(SvBaseLink const *pLink)
SwEditShell const * GetEditShell() const
sw::FieldmarkMode GetFieldmarkMode() const
static void SetSaveData(SwDoc &rDoc, SwRedlineSaveDatas &rSData)
virtual bool DeleteRedline(const SwPaM &rPam, bool bSaveInUndo, RedlineType nDelType)=0
SwContentNode * GetContentNode()
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
Marks a character position inside a document model node.
static std::unique_ptr< SfxItemSet > lcl_GetAttrSet(const SwSection &rSect)
OD 04.10.2002 #102894# class Calc needed for calculation of the hidden condition of a section...
std::unique_ptr< SwTOXBase > const m_pTOXBase
section not TOX
Marks a node in the document model.
bool HasSwAttrSet() const
std::unique_ptr< SwUndoSaveSection, o3tl::default_delete< SwUndoSaveSection > > const m_pSaveSectionOriginal
SwSectionNode * InsertTextSection(SwNodeIndex const &rNdIdx, SwSectionFormat &rSectionFormat, SwSectionData const &, SwTOXBase const *const pTOXBase, SwNodeIndex const *const pEnd, bool const bInsAtStart=true, bool const bCreateFrames=true)
Insert a new SwSection.
std::unique_ptr< SwRedlineData > m_pRedlData
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
constexpr TypedWhichId< SwFormatContent > RES_CNTNT(95)
const SwNodeIndex * GetContentIdx() const
SwUndoUpdateIndex(SwTOXBaseSection &)
SwSbxValue Calculate(const OUString &rStr)
sal_uLong EndOfSectionIndex() const
SwTextNode is a paragraph in the document model.
virtual bool SplitRedline(const SwPaM &rPam)=0
void SetFieldmarkMode(sw::FieldmarkMode)
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
sal_uLong const m_nEndNode
void CorrAbs(const SwNodeIndex &rOldNode, const SwPosition &rNewPos, const sal_Int32 nOffset=0, bool bMoveCursor=false)
virtual void UndoImpl(::sw::UndoRedoContext &) override
SwUndoInsSection(SwPaM const &, SwSectionData const &, SfxItemSet const *pSet, std::tuple< SwTOXBase const *, sw::RedlineMode, sw::FieldmarkMode > const *pTOXBase)
sal_Int32 GetIndex() const
virtual bool IsRedlineOn() const =0
Query if redlining is on.
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
void Join(SwDoc &rDoc, sal_uLong nNode)
virtual ~SwUndoUpdateIndex() override
virtual void RedoImpl(::sw::UndoRedoContext &) override
std::unique_ptr< SwSectionData > const m_pSectionData
static void RemoveIdxRel(sal_uLong, const SwPosition &)
virtual void CalcLayout() override
To enable set up of StartActions and EndActions.
virtual sfx2::LinkManager & GetLinkManager()=0
sal_uLong const m_nStartIndex
virtual void RedoImpl(::sw::UndoRedoContext &)=0
virtual void UndoImpl(::sw::UndoRedoContext &) override
std::unique_ptr< SwUndoSaveSection, o3tl::default_delete< SwUndoSaveSection > > const m_pSaveSectionUpdated
SwFootnoteIdxs & GetFootnoteIdxs()
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
void SetSectionData(SwSectionData const &rData)
static bool FillSaveData(const SwPaM &rRange, SwRedlineSaveDatas &rSData, bool bDelRange=true, bool bCopyNext=true)
const std::unique_ptr< SwSectionData > m_pSectionData
SectionType GetType() const
std::unique_ptr< SwUndoDelSection > m_pTitleSectionUpdated
virtual const SwRedlineTable & GetRedlineTable() const =0
constexpr OUStringLiteral first
sal_uInt16 const aBreakSetRange[]
SwSection * InsertSwSection(SwPaM const &rRange, SwSectionData &, std::tuple< SwTOXBase const *, sw::RedlineMode, sw::FieldmarkMode > const *pTOXBase, SfxItemSet const *const pAttr, bool const bUpdate=true)
std::unique_ptr< SwUndo > MakeUndoDelSection(SwSectionFormat const &rFormat)
constexpr sal_uInt16 RES_FRMATR_BEGIN(RES_PARATR_LIST_END)
constexpr TypedWhichId< SwFormatFootnoteAtTextEnd > RES_FTN_AT_TXTEND(117)
const sal_Int32 COMPLETE_STRING
const SwAttrPool & GetAttrPool() const
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwTextNode * MakeTextNode(const SwNodeIndex &rWhere, SwTextFormatColl *pColl, bool bNewFrames=true)
Implementations of "Make...Node" are in the given .cxx-files.