28 #include <osl/diagnose.h>
54 #include <section.hxx>
62 , m_bSaveDrawPt(bSvDrwPt)
68 if (rHint.
GetId() != SfxHintId::SwLegacyModify)
77 auto pOld = pLegacy->m_pOld;
84 auto& rChgSet = *
static_cast<const SwAttrSetChg*
>(pOld)->GetChgSet();
99 , m_sFormatName ( rChgFormat.
GetName() )
101 , m_oOldSet(
std::move( rOldSet ) )
103 , m_nFormatWhich( rChgFormat.Which() )
104 , m_bSaveDrawPt( bSaveDrawPt )
114 , m_sFormatName(rChgFormat.
GetName())
115 , m_oOldSet( rChgFormat.GetAttrSet().CloneAsValue(
false ) )
117 , m_nFormatWhich( rChgFormat.Which() )
118 , m_bSaveDrawPt( bSaveDrawPt )
141 ->FindTableNode()->GetIndex();
143 }
else if (dynamic_cast<const SwSectionFormat*>(&rFormat)) {
145 }
else if(
auto pBoxFormat = dynamic_cast<const SwTableBoxFormat*>(&rFormat))
147 auto pTableBox = pBoxFormat->GetTableBox();
173 bool bAnchorAttrRestored(
false );
176 if ( bAnchorAttrRestored ) {
187 if ( bAnchorAttrRestored )
return;
202 rContext.
SetSelections(static_cast<SwFrameFormat*>(pFormat),
nullptr);
227 return static_cast<SwTableNode*
>(pNd)->GetTable().GetFrameFormat();
231 return static_cast<SwSectionNode*
>(pNd)->GetSection().GetFormat();
234 static_cast<SwStartNode*
>(pNd)->GetStartNodeType()))
311 if (SfxItemState::SET ==
312 pFormat->GetAttrSet().GetItemState(
RES_CNTNT )) {
315 if( aTmpSet.Count() ) {
316 rDoc.SetAttr( aTmpSet, *pFly );
319 rDoc.SetAttr( pFormat->GetAttrSet(), *pFly );
355 Point aPt( static_cast<const SwFrameFormat*>(pFormat)->FindSdrObject()
356 ->GetRelativePos() );
367 sal_Int32 nContent = 0;
369 case RndStdIds::FLY_AS_CHAR:
370 case RndStdIds::FLY_AT_CHAR:
373 case RndStdIds::FLY_AT_PARA:
374 case RndStdIds::FLY_AT_FLY:
397 if (RndStdIds::FLY_AT_PAGE != rAnchor.
GetAnchorId()) {
400 if ( (RndStdIds::FLY_AT_FLY == rAnchor.
GetAnchorId())
402 static_cast<SwStartNode*
>(pNd)->GetStartNodeType()) )
410 if ((RndStdIds::FLY_AS_CHAR == rAnchor.
GetAnchorId()) ||
411 (RndStdIds::FLY_AT_CHAR == rAnchor.
GetAnchorId())) {
419 aNewAnchor.SetAnchor( &aPos );
421 aNewAnchor.SetPageNum( rAnchor.
GetPageNum() );
423 Point aDrawSavePt, aDrawOldPt;
428 aDrawSavePt.setX( rOldSize.
GetWidth() );
429 aDrawSavePt.setY( rOldSize.
GetHeight() );
442 if (RndStdIds::FLY_AS_CHAR == rOldAnch.
GetAnchorId()) {
449 OSL_ENSURE( pTextNode->
HasHints(),
"Missing FlyInCnt-Hint." );
453 assert(pHint &&
"Missing Hint.");
455 "Missing FlyInCnt-Hint." );
457 "Wrong TextFlyCnt-Hint." );
490 if (RndStdIds::FLY_AS_CHAR == aNewAnchor.GetAnchorId()) {
491 const SwPosition* pPos = aNewAnchor.GetContentAnchor();
493 OSL_ENSURE( pTextNd,
"no Text Node at position." );
512 const sal_uInt16 nWhichId )
514 , m_pChangedFormat( &rChangedFormat )
515 , m_nWhichId( nWhichId )
518 if (rChangedFormat.
GetItemState(nWhichId,
false, &pItem ) == SfxItemState::SET && pItem) {
546 , m_nFormatId( nFormatId )
553 , m_nFormatId( nFormatId )
613 if ( static_cast<SwHistorySetTOXMark*>(pHHint)
614 ->IsEqual( *aArr[ --nCnt ] ) ) {
653 m_Ids = std::move(rAttrs);
659 , m_AttrSet( rRange.GetDoc().GetAttrPool(), rAttr.Which(), rAttr.Which() )
662 , m_nInsertFlags( nFlags )
682 , m_nInsertFlags( nFlags )
703 ? RedlineType::Insert
704 : RedlineType::Format,
729 aPam.GetPoint()->nContent.Assign( aPam.GetContentNode(),
m_nSttContent );
731 ++aPam.GetPoint()->nContent;
816 sal_Int32 nContent = 0;
819 switch ( pHstHint->
Which() ) {
824 nNode = pHistoryHint->
GetNode();
835 SwTextNode* pTextNd = rNds[ nNode ]->GetTextNode();
858 if ( 1 != rSet.
Count() ) {
879 if ( aTmp.GetUndo() ) {
881 if (aTmp.GetUndo()->m_oOldSet)
882 m_oOldSet.emplace(std::move(*aTmp.GetUndo()->m_oOldSet));
899 const SwPaM& rPam,
bool bFlag,
bool bMod )
940 const SwPaM& rRange,
const OUString& rText,
941 bool const bIsEndNote)
945 , m_bEndNote( bIsEndNote )
1033 , m_nNodeIndex( rPos.nNode.GetIndex() )
1034 , m_nContentIndex( rPos.nContent.GetIndex() )
1046 pDoc->DontExpandFormat( rPos,
false );
1057 pDoc->DontExpandFormat( rPos );
Starts a section of nodes in the document model.
virtual SwCursor & CreateNewShellCursor()=0
SwPaM & AddUndoRedoPaM(::sw::UndoRedoContext &, bool const bCorrToContent=false) const
const SwGrfFormatColls * GetGrfFormatColls() const
SwUndoResetAttr(const SwPaM &, sal_uInt16 nFormatId)
tools::Long GetWidth() const
SwNode & GetNode(bool bPoint=true) const
void SetSelections(SwFrameFormat *const pSelFormat, SdrMarkList *const pMarkList)
SwNodeOffset GetNode() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
sal_uInt16 GetWhich() const
Marks a position in the document model.
constexpr TypedWhichId< SvxTabStopItem > RES_PARATR_TABSTOP(68)
virtual void RedoImpl(::sw::UndoRedoContext &) override
virtual void RedoImpl(::sw::UndoRedoContext &) override
std::optional< SfxItemSet > m_oOldSet
bool IsSectionNode() const
const SwTableBox * GetTableBox(const OUString &rName, const bool bPerformValidCheck=false) const
void SetFootnoteInfo(const SwFootnoteInfo &rInfo)
const OUString & GetText() const
virtual const SwRootFrame * GetCurrentLayout() const =0
constexpr SwNodeOffset NODE_OFFSET_MAX(SAL_MAX_INT32)
virtual bool SetAttr(const SfxPoolItem &) override
overriding to handle change of certain paragraph attributes
virtual AppendResult AppendRedline(SwRangeRedline *pNewRedl, bool bCallDelete)=0
Append a new redline.
const SwFrameFormats * GetTableFrameFormats() const
virtual void SetRedlineFlags_intern(RedlineFlags eMode)=0
Set a new redline mode.
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
static bool FillSaveDataForFormat(const SwPaM &, SwRedlineSaveDatas &)
static void RemoveIdxFromSection(SwDoc &, SwNodeOffset nSttIdx, const SwNodeOffset *pEndIdx=nullptr)
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
virtual void InsertItemSet(const SwPaM &rRg, const SfxItemSet &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr)=0
SwTextFormatColl * FindTextFormatCollByName(const OUString &rName) const
o3tl::sorted_vector< sal_uInt16 > m_Ids
const std::unique_ptr< SwHistory > m_pHistory
std::vector< SwTOXMark * > SwTOXMarks
virtual Point GetRelativePos() const
bool DontExpandFormat(const SwIndex &rIdx, bool bFlag=true, bool bFormatToTextAttributes=true)
When appropriate set DontExpand-flag at INet or character styles respectively.
const WhichRangesContainer & GetRanges() const
const std::unique_ptr< SwHistory > m_pHistory
const sal_uInt16 m_nFormatId
void SetRedlineFlags(RedlineFlags eMode)
std::unique_ptr< SwRedlineSaveDatas > m_pRedlineSaveData
constexpr TypedWhichId< SwConditionTextFormatColl > RES_CONDTXTFMTCOLL(160)
IDocumentContentOperations const & getIDocumentContentOperations() const
std::unique_ptr< SvxTabStopItem > m_pTabStop
const SwFrameFormats * GetSpzFrameFormats() const
IShellCursorSupplier & GetCursorSupplier()
constexpr TypedWhichId< SwFlyFrameFormat > RES_FLYFRMFMT(156)
void SetAttrs(o3tl::sorted_vector< sal_uInt16 > &&rAttrs)
SwTextAttr * GetTextAttrForCharAt(const sal_Int32 nIndex, const sal_uInt16 nWhich=RES_TXTATR_END) const
get the text attribute at position nIndex which owns the dummy character CH_TXTATR_* at that position...
const SfxPoolItem * NextItem()
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(159)
const SetAttrMode m_nInsertFlags
constexpr TypedWhichId< SwFormatFootnote > RES_TXTATR_FTN(59)
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
void ResetAttrs(const SwPaM &rRg, bool bTextAttr=true, const o3tl::sorted_vector< sal_uInt16 > &rAttrs=o3tl::sorted_vector< sal_uInt16 >(), const bool bSendDataChangedEvents=true, SwRootFrame const *pLayout=nullptr)
Reset attributes.
A wrapper around SfxPoolItem to store the start position of (usually) a text portion, with an optional end.
const SwTextFormatColl * GetDfltTextFormatColl() const
static bool IsRedlineOn(const RedlineFlags eM)
const SfxPoolItem & GetDefault(sal_uInt16 nFormatHint) const
Get the default attribute in this document.
virtual void RedoImpl(::sw::UndoRedoContext &) override
SwTextAttr * InsertItem(SfxPoolItem &rAttr, const sal_Int32 nStart, const sal_Int32 nEnd, const SetAttrMode nMode=SetAttrMode::DEFAULT)
create new text attribute from rAttr and insert it
const SwTable & GetTable() const
constexpr TypedWhichId< SwFormatCharFormat > RES_TXTATR_CHARFMT(52)
constexpr TypedWhichId< SwFrameFormat > RES_FRMFMT(155)
SwUndoMoveLeftMargin(const SwPaM &, bool bRight, bool bModulus)
SwNodeOffset GetIndex() const
virtual OUString GetName() const override
SwUndoEndNoteInfo(const SwEndNoteInfo &rInfo, const SwDoc &rDoc)
RedlineFlags GetRedlineFlags() const
virtual ~SwUndoEndNoteInfo() override
virtual void UndoImpl(::sw::UndoRedoContext &) override
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
SwTableSortBoxes & GetTabSortBoxes()
virtual std::size_t GetRedlineAuthor()=0
bool SetCurFootnote(const SwPaM &rPam, const OUString &rNumStr, bool bIsEndNote)
change footnotes in range
PaM is Point and Mark: a selection of the document model.
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
constexpr TypedWhichId< SwFormatField > RES_TXTATR_FIELD(RES_TXTATR_NOEND_BEGIN)
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
virtual SvxTabStopItem * Clone(SfxItemPool *pPool=nullptr) const override
SwUndoDefaultAttr(const SfxItemSet &rOldSet, const SwDoc &rDoc)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
virtual void RepeatImpl(::sw::RepeatContext &) override
OUString m_aChrFormatName
const SwPosition * GetPoint() const
void SaveRedlineData(const SwPaM &rPam, bool bInsContent)
SwIndex & Assign(SwIndexReg *, sal_Int32)
constexpr TypedWhichId< SwFormatFlyCnt > RES_TXTATR_FLYCNT(58)
constexpr TypedWhichId< SwGrfFormatColl > RES_GRFFMTCOLL(158)
virtual ~SwUndoMoveLeftMargin() override
static void SetSaveData(SwDoc &rDoc, SwRedlineSaveDatas &rSData)
virtual bool DeleteRedline(const SwPaM &rPam, bool bSaveInUndo, RedlineType nDelType)=0
SwContentNode * GetContentNode()
SwNoTextNode * GetNoTextNode()
constexpr TypedWhichId< SwAttrSetChg > RES_ATTRSET_CHG(163)
Marks a character position inside a document model node.
void AddRule(SwUndoArg eWhat, const OUString &rWith)
SwUndoAttr(const SwPaM &, const SfxItemSet &, const SetAttrMode nFlags)
const std::unique_ptr< SwHistory > m_pHistory
Layout frame for SwNoTextNode, i.e. graphics and OLE nodes (including charts).
constexpr TypedWhichId< SwTextFormatColl > RES_TXTFMTCOLL(157)
Marks a node in the document model.
SwFrameFormat * GetFrameFormat()
SwNodeOffset m_nNodeIndex
std::unique_ptr< SwRedlineData > m_pRedlineData
tools::Long GetHeight() const
virtual void RepeatImpl(::sw::RepeatContext &) override
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
SwTable is one table in the document model, containing rows (which contain cells).
constexpr TypedWhichId< SwFormatContent > RES_CNTNT(95)
void RstTextAttrs(const SwPaM &rRg, bool bInclRefToxMark=false, bool bExactRange=false, SwRootFrame const *pLayout=nullptr)
constexpr sal_uInt16 POOLATTR_END(RES_UNKNOWNATR_END)
const SwNodeIndex * GetContentIdx() const
constexpr TypedWhichId< SwFormatField > RES_TXTATR_ANNOTATION(60)
virtual ~SwUndoResetAttr() override
SwCharFormat * FindCharFormatByName(const OUString &rName) const
void SetEndNoteInfo(const SwEndNoteInfo &rInfo)
void SetDefault(const SfxPoolItem &)
Set attribute as new default attribute in current document.
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SwTextNode is a paragraph in the document model.
void DeleteAttributes(const sal_uInt16 nWhich, const sal_Int32 nStart, const sal_Int32 nEnd=0)
delete all attributes of type nWhich at nStart (opt. end nEnd)
void DeleteTOXMark(const SwTOXMark *pTOXMark)
Delete table of contents Mark.
void MoveLeftMargin(const SwPaM &rPam, bool bRight, bool bModulus, SwRootFrame const *pLayout=nullptr)
Adjust left margin via object bar (similar to adjustment of numerations).
void RemoveIdx(SwDoc &rDoc)
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
constexpr sal_uInt16 RES_FMT_BEGIN(RES_UNKNOWNATR_END)
virtual void UndoImpl(::sw::UndoRedoContext &) override
virtual bool SetAttr(const SfxPoolItem &)
made virtual
void SetPaM(SwPaM &, bool bCorrToContent=false) const
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
virtual void RedoImpl(::sw::UndoRedoContext &) override
static sal_uInt16 GetCurTOXMark(const SwPosition &rPos, SwTOXMarks &)
Get current table of contents Mark.
std::unique_ptr< SwEndNoteInfo > m_pEndNoteInfo
bool DontExpandFormat(const SwPosition &rPos, bool bFlag=true)
constexpr TypedWhichId< SwCharFormat > RES_CHRFMT(RES_FMT_BEGIN)
sal_Int32 GetIndex() const
virtual bool IsRedlineOn() const =0
Query if redlining is on.
virtual ~SwUndoAttr() override
SwTableBox is one table cell in the document model.
sal_Int32 GetContent() const
virtual void RedoImpl(::sw::UndoRedoContext &) override
HISTORY_HINT Which() const
constexpr TypedWhichId< SwTOXMark > RES_TXTATR_TOXMARK(47)
virtual void UndoImpl(::sw::UndoRedoContext &) override
virtual void CallSwClientNotify(const SfxHint &rHint) const override
SwMoveFnCollection const & fnMoveBackward
SwTableNode * FindTableNode()
Search table node, in which it is.
SwNodeOffset Count() const
SwFootnoteIdxs & GetFootnoteIdxs()
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
virtual void UndoImpl(::sw::UndoRedoContext &) override
SwFormatColl * GetFormatColl() const
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
constexpr TypedWhichId< SwFormatRefMark > RES_TXTATR_REFMARK(RES_TXTATR_WITHEND_BEGIN)
Frame is variable in Var-direction.
const SwFrameFormats * GetFrameFormats() const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
SwFrameFormat * GetFlyFormat() const
If node is in a fly return the respective format.
virtual void UndoImpl(::sw::UndoRedoContext &) override
const SwFootnoteInfo & GetFootnoteInfo() const
const SwEndNoteInfo & GetEndNoteInfo() const
constexpr TypedWhichId< SwPtrMsgPoolItem > RES_OBJECTDYING(RES_MSG_BEGIN)
const SfxPoolItem * GetCurItem() const
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(104)
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
virtual ~SwUndoDefaultAttr() override
bool m_bDetectedRangeSegmentation false
virtual void RepeatImpl(::sw::RepeatContext &) override
const SwFormatFlyCnt & GetFlyCnt() const
Base class of the Writer document model elements.