28#include <osl/diagnose.h>
65 , m_bSaveDrawPt(bSvDrwPt)
71 if (rHint.
GetId() != SfxHintId::SwLegacyModify)
80 auto pOld = pLegacy->m_pOld;
87 auto& rChgSet = *
static_cast<const SwAttrSetChg*
>(pOld)->GetChgSet();
99 : doc(format.
GetName().isEmpty() ? nullptr : format.GetDoc())
120 , m_sFormatName ( rChgFormat.
GetName() )
122 , m_oOldSet(
std::move( rOldSet ) )
123 , m_nAnchorContentOffset( 0 )
125 , m_nFormatWhich( rChgFormat.Which() )
126 , m_bSaveDrawPt( bSaveDrawPt )
136 , m_sFormatName(rChgFormat.
GetName())
137 , m_oOldSet( rChgFormat.GetAttrSet().CloneAsValue( false ) )
138 , m_nAnchorContentOffset( 0 )
140 , m_nFormatWhich( rChgFormat.Which() )
141 , m_bSaveDrawPt( bSaveDrawPt )
158 auto pTableFormat =
dynamic_cast<const SwTableFormat*
>(&rFormat);
165 ->FindTableNode()->GetIndex();
170 }
else if(
auto pBoxFormat =
dynamic_cast<const SwTableBoxFormat*
>(&rFormat))
172 auto pTableBox = pBoxFormat->GetTableBox();
198 bool bAnchorAttrRestored(
false );
201 if ( bAnchorAttrRestored ) {
212 if ( bAnchorAttrRestored )
return;
232 nFamily = SfxStyleFamily::Para;
234 nFamily = SfxStyleFamily::Char;
261 return static_cast<SwTableNode*
>(pNd)->GetTable().GetFrameFormat();
265 return static_cast<SwSectionNode*
>(pNd)->GetSection().GetFormat();
268 static_cast<SwStartNode*
>(pNd)->GetStartNodeType()))
345 if (SfxItemState::SET ==
349 if( aTmpSet.
Count() ) {
350 rDoc.
SetAttr( aTmpSet, *pFly );
390 ->GetRelativePos() );
402 case RndStdIds::FLY_AS_CHAR:
403 case RndStdIds::FLY_AT_CHAR:
406 case RndStdIds::FLY_AT_PARA:
407 case RndStdIds::FLY_AT_FLY:
430 if (RndStdIds::FLY_AT_PAGE != rAnchor.
GetAnchorId()) {
433 if ( (RndStdIds::FLY_AT_FLY == rAnchor.
GetAnchorId())
443 if ((RndStdIds::FLY_AS_CHAR == rAnchor.
GetAnchorId()) ||
444 (RndStdIds::FLY_AT_CHAR == rAnchor.
GetAnchorId())) {
456 Point aDrawSavePt, aDrawOldPt;
475 if (RndStdIds::FLY_AS_CHAR == rOldAnch.
GetAnchorId()) {
481 OSL_ENSURE( pTextNode->
HasHints(),
"Missing FlyInCnt-Hint." );
485 assert(pHint &&
"Missing Hint.");
487 "Missing FlyInCnt-Hint." );
489 "Wrong TextFlyCnt-Hint." );
520 if (aDrawSavePt != aFormatPos)
531 if (RndStdIds::FLY_AS_CHAR == aNewAnchor.
GetAnchorId()) {
533 OSL_ENSURE( pTextNd,
"no Text Node at position." );
552 const std::vector<sal_uInt16>& rIds )
554 , m_pChangedFormat( &rChangedFormat )
555 ,
m_aSet(*rChangedFormat.GetAttrSet().GetPool())
557 for (
const auto& nWhichId : rIds)
560 if (rChangedFormat.
GetItemState(nWhichId,
false, &pItem ) == SfxItemState::SET && pItem)
589 nFamily = SfxStyleFamily::Para;
591 nFamily = SfxStyleFamily::Char;
593 if (nFamily != SfxStyleFamily::None)
600 , m_nFormatId( nFormatId )
607 , m_nFormatId( nFormatId )
693 const auto pFormatRefMark =
static_cast<const SwFormatRefMark*
>(pItem);
695 pFormatRefMark->GetRefName())
729 m_Ids = std::move(rAttrs);
735 , m_AttrSet( rRange.GetDoc().GetAttrPool(), rAttr.Which(), rAttr.Which() )
738 , m_nInsertFlags( nFlags )
755 , m_AttrSet(
std::move( aSet ))
758 , m_nInsertFlags( nFlags )
779 ? RedlineType::Insert
780 : RedlineType::Format,
906 sal_Int32 nContent = 0;
909 switch ( pHstHint->
Which() ) {
914 nNode = pHistoryHint->
GetNode();
925 SwTextNode* pTextNd = rNds[ nNode ]->GetTextNode();
989 const SwPaM& rPam,
bool bFlag,
bool bMod )
1030 const SwPaM& rRange, OUString aText,
1031 bool const bIsEndNote)
1034 , m_Text(
std::move( aText ))
1035 , m_bEndNote( bIsEndNote )
1123 , m_nNodeIndex( rPos.GetNodeIndex() )
1124 , m_nContentIndex( rPos.GetContentIndex() )
virtual void InsertItemSet(const SwPaM &rRg, const SfxItemSet &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr)=0
virtual const SwRootFrame * GetCurrentLayout() const =0
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
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 void SetRedlineFlags_intern(RedlineFlags eMode)=0
Set a new redline mode.
virtual AppendResult AppendRedline(SwRangeRedline *pNewRedl, bool bCallDelete)=0
Append a new redline.
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
virtual void SetModified()=0
Must be called manually at changes of format.
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
constexpr tools::Long X() const
virtual Point GetRelativePos() const
const SfxPoolItem * GetCurItem() const
const SfxPoolItem * NextItem()
Item2Range GetItemSurrogates(sal_uInt16 nWhich) const
const WhichRangesContainer & GetRanges() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
tools::Long GetHeight() const
tools::Long GetWidth() const
virtual SvxTabStopItem * Clone(SfxItemPool *pPool=nullptr) const override
SwFormatColl * GetFormatColl() const
SwDocModifyAndUndoGuard(SwFormat &format)
~SwDocModifyAndUndoGuard()
void RstTextAttrs(const SwPaM &rRg, bool bInclRefToxMark=false, bool bExactRange=false, SwRootFrame const *pLayout=nullptr)
const SwFootnoteInfo & GetFootnoteInfo() const
static sal_uInt16 GetCurTOXMark(const SwPosition &rPos, SwTOXMarks &)
Get current table of contents Mark.
void BroadcastStyleOperation(const OUString &rName, SfxStyleFamily eFamily, SfxHintId nOp)
IDocumentState const & getIDocumentState() const
const sw::TableFrameFormats * GetTableFrameFormats() const
void DeleteFormatRefMark(const SwFormatRefMark *pFormatRefMark)
void SetAttr(const SfxPoolItem &, SwFormat &)
Set attribute in given format.1y If Undo is enabled, the old values is added to the Undo history.
void SetDefault(const SfxPoolItem &)
Set attribute as new default attribute in current document.
const sw::FrameFormats< SwFrameFormat * > * GetFrameFormats() const
SwCharFormat * FindCharFormatByName(const OUString &rName) const
void SetFootnoteInfo(const SwFootnoteInfo &rInfo)
IDocumentContentOperations const & getIDocumentContentOperations() const
IDocumentUndoRedo & GetIDocumentUndoRedo()
bool SetCurFootnote(const SwPaM &rPam, const OUString &rNumStr, bool bIsEndNote)
change footnotes in range
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
SwEditShell const * GetEditShell() const
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
SwFootnoteIdxs & GetFootnoteIdxs()
const SfxPoolItem & GetDefault(sal_uInt16 nFormatHint) const
Get the default attribute in this document.
const SwEndNoteInfo & GetEndNoteInfo() 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.
const SwTextFormatColl * GetDfltTextFormatColl() const
void SetEndNoteInfo(const SwEndNoteInfo &rInfo)
bool DontExpandFormat(const SwPosition &rPos, bool bFlag=true)
SwTextFormatColl * FindTextFormatCollByName(const OUString &rName) const
void DeleteTOXMark(const SwTOXMark *pTOXMark)
Delete table of contents Mark.
const SwGrfFormatColls * GetGrfFormatColls() const
const SwAttrPool & GetAttrPool() const
const sw::FrameFormats< sw::SpzFrameFormat * > * GetSpzFrameFormats() const
void MoveLeftMargin(const SwPaM &rPam, bool bRight, bool bModulus, SwRootFrame const *pLayout=nullptr)
Adjust left margin via object bar (similar to adjustment of numerations).
const SwNodeIndex * GetContentIdx() const
HISTORY_HINT Which() const
sal_uInt16 GetWhich() const
sal_Int32 GetContent() const
SwNodeOffset GetNode() const
const OUString & GetRefName()
bool IsEqual(const SwTOXMark &rCmp) const
Layout frame for SwNoTextNode, i.e. graphics and OLE nodes (including charts).
Marks a node in the document model.
SwNodeOffset GetIndex() const
Base class of the Writer document model elements.
SwFrameFormat * GetFlyFormat() const
If node is in a fly return the respective format.
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwNodeOffset GetIndex() const
bool IsSectionNode() const
SwTableNode * FindTableNode()
Search table node, in which it is.
SwContentNode * GetContentNode()
SwNoTextNode * GetNoTextNode()
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
SwNodeOffset Count() const
PaM is Point and Mark: a selection of the document model.
SwNode & GetPointNode() const
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
const SwPosition * GetPoint() const
void AddRule(SwUndoArg eWhat, const OUString &rWith)
A section node represents the start of a section on the UI, i.e.
Starts a section of nodes in the document model.
SwStartNodeType GetStartNodeType() const
SwTableBox is one table cell in the document model.
SwFrameFormat * GetFrameFormat()
const SwTable & GetTable() const
SwTable is one table in the document model, containing rows (which contain cells).
const SwTableBox * GetTableBox(const OUString &rName, const bool bPerformValidCheck=false) const
SwTableSortBoxes & GetTabSortBoxes()
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
const SwFormatFlyCnt & GetFlyCnt() const
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)
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 OUString & GetText() const
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...
bool DontExpandFormat(sal_Int32 nContentIdx, bool bFlag=true, bool bFormatToTextAttributes=true)
When appropriate set DontExpand-flag at INet or character styles respectively.
SwPaM & AddUndoRedoPaM(::sw::UndoRedoContext &, bool const bCorrToContent=false) const
void SetPaM(SwPaM &, bool bCorrToContent=false) const
SwNodeOffset m_nNodeIndex
void RemoveIdx(SwDoc &rDoc)
void redoAttribute(SwPaM &rPam, sw::UndoRedoContext &rContext)
const std::unique_ptr< SwHistory > m_pHistory
virtual void RedoImpl(::sw::UndoRedoContext &) override
virtual void UndoImpl(::sw::UndoRedoContext &) override
SwUndoAttr(const SwPaM &, SfxItemSet, const SetAttrMode nFlags)
void SaveRedlineData(const SwPaM &rPam, bool bInsContent)
virtual void RepeatImpl(::sw::RepeatContext &) override
OUString m_aChrFormatName
std::unique_ptr< SwRedlineSaveDatas > m_pRedlineSaveData
virtual ~SwUndoAttr() override
std::unique_ptr< SwRedlineData > m_pRedlineData
const SetAttrMode m_nInsertFlags
std::optional< SfxItemSet > m_oOldSet
SwUndoDefaultAttr(const SfxItemSet &rOldSet, const SwDoc &rDoc)
virtual ~SwUndoDefaultAttr() override
virtual void RedoImpl(::sw::UndoRedoContext &) override
std::unique_ptr< SvxTabStopItem > m_pTabStop
virtual void UndoImpl(::sw::UndoRedoContext &) override
std::unique_ptr< SwEndNoteInfo > m_pEndNoteInfo
SwUndoEndNoteInfo(const SwEndNoteInfo &rInfo, const SwDoc &rDoc)
virtual ~SwUndoEndNoteInfo() override
virtual void UndoImpl(::sw::UndoRedoContext &) override
virtual void RedoImpl(::sw::UndoRedoContext &) override
virtual ~SwUndoMoveLeftMargin() override
virtual void UndoImpl(::sw::UndoRedoContext &) override
const std::unique_ptr< SwHistory > m_pHistory
SwUndoMoveLeftMargin(const SwPaM &, bool bRight, bool bModulus)
virtual void RepeatImpl(::sw::RepeatContext &) override
virtual void RedoImpl(::sw::UndoRedoContext &) override
void SetAttrs(o3tl::sorted_vector< sal_uInt16 > &&rAttrs)
virtual void UndoImpl(::sw::UndoRedoContext &) override
const std::unique_ptr< SwHistory > m_pHistory
SwUndoResetAttr(const SwPaM &, sal_uInt16 nFormatId)
virtual void RepeatImpl(::sw::RepeatContext &) override
virtual void RedoImpl(::sw::UndoRedoContext &) override
virtual ~SwUndoResetAttr() override
o3tl::sorted_vector< sal_uInt16 > m_Ids
const sal_uInt16 m_nFormatId
void SetRedlineFlags(RedlineFlags eMode)
RedlineFlags GetRedlineFlags() const
static void SetSaveData(SwDoc &rDoc, SwRedlineSaveDatas &rSData)
static bool FillSaveDataForFormat(const SwPaM &, SwRedlineSaveDatas &)
static void RemoveIdxFromSection(SwDoc &, SwNodeOffset nSttIdx, const SwNodeOffset *pEndIdx=nullptr)
virtual SwCursor & CreateNewShellCursor()=0
IShellCursorSupplier & GetCursorSupplier()
void SetSelections(SwFrameFormat *const pSelFormat, SdrMarkList *const pMarkList)
virtual OUString GetName() const override
@ Variable
Frame is variable in Var-direction.
constexpr TypedWhichId< SwGrfFormatColl > RES_GRFFMTCOLL(164)
constexpr TypedWhichId< SwFormatFootnote > RES_TXTATR_FTN(59)
constexpr TypedWhichId< SwConditionTextFormatColl > RES_CONDTXTFMTCOLL(166)
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
constexpr TypedWhichId< SvxTabStopItem > RES_PARATR_TABSTOP(68)
constexpr TypedWhichId< SwAttrSetChg > RES_ATTRSET_CHG(169)
constexpr TypedWhichId< SwFormatField > RES_TXTATR_ANNOTATION(60)
constexpr TypedWhichId< SwFlyFrameFormat > RES_FLYFRMFMT(162)
constexpr TypedWhichId< SwCharFormat > RES_CHRFMT(RES_FMT_BEGIN)
constexpr TypedWhichId< SwFormatField > RES_TXTATR_FIELD(RES_TXTATR_NOEND_BEGIN)
constexpr TypedWhichId< SwFormatCharFormat > RES_TXTATR_CHARFMT(52)
constexpr TypedWhichId< SwDrawFrameFormat > RES_DRAWFRMFMT(165)
constexpr TypedWhichId< SwFormatFlyCnt > RES_TXTATR_FLYCNT(58)
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(110)
constexpr TypedWhichId< SwTextFormatColl > RES_TXTFMTCOLL(163)
constexpr TypedWhichId< SwFormatRefMark > RES_TXTATR_REFMARK(RES_TXTATR_WITHEND_BEGIN)
constexpr TypedWhichId< SwTOXMark > RES_TXTATR_TOXMARK(47)
constexpr TypedWhichId< SwFormatContent > RES_CNTNT(101)
constexpr TypedWhichId< SwPtrMsgPoolItem > RES_OBJECTDYING(RES_FORMAT_MSG_BEGIN)
constexpr sal_uInt16 RES_FMT_BEGIN(RES_UNKNOWNATR_END)
constexpr sal_uInt16 POOLATTR_END(RES_UNKNOWNATR_END)
constexpr TypedWhichId< SwFrameFormat > RES_FRMFMT(161)
@ POST_RESTORE_FLY_ANCHOR
constexpr SwNodeOffset NODE_OFFSET_MAX(SAL_MAX_INT32)
SwMoveFnCollection const & fnMoveBackward
Marks a position in the document model.
void Assign(const SwNode &rNd, SwNodeOffset nDelta, sal_Int32 nContentOffset=0)
These all set both nNode and nContent.
void SetContent(sal_Int32 nContentIndex)
Set content index, only valid to call this if the position points to a SwContentNode subclass.
SwNodeOffset GetNodeIndex() const
sal_Int32 GetContentIndex() const
void AdjustContent(sal_Int32 nDelta)
Adjust content index, only valid to call this if the position points to a SwContentNode subclass.
@ NO_CURSOR_CHANGE
don't change the cursor position
std::vector< SwTOXMark * > SwTOXMarks