20 #include <libxml/xmlwriter.h>
40 std::optional<std::vector<SwFrameFormat*>>
43 std::optional<std::vector<SwFrameFormat*>> pFrameFormats;
45 for (
size_t n = 0;
n < nArrLen; ++
n)
52 && ((pAnchor->
GetAnchorId() == RndStdIds::FLY_AT_PARA)
53 || (pAnchor->
GetAnchorId() == RndStdIds::FLY_AT_CHAR)))
56 pFrameFormats.emplace();
57 pFrameFormats->push_back( pFormat );
67 :
SwUndo( nUndoId, &rPam.GetDoc() )
69 , m_pTextFormatColl(nullptr)
70 , m_pLastNodeColl(nullptr)
71 , m_nDeleteTextNodes(1)
145 for(
size_t n = 0;
n < nArrLen; ++
n )
151 std::vector<SwFrameFormat*>::iterator it;
155 std::shared_ptr<SwUndoInsLayFormat>
const pFlyUndo =
156 std::make_shared<SwUndoInsLayFormat>(pFormat,
SwNodeOffset(0), 0);
177 assert(nStartNode <= nEndNode);
182 return pAnchorPos !=
nullptr
183 && ( rAnchor.
GetAnchorId() == RndStdIds::FLY_AT_PARA
184 || rAnchor.
GetAnchorId() == RndStdIds::FLY_AT_CHAR)
191 (
void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwUndoInserts"));
192 (
void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"ptr"),
"%p",
this);
193 (
void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"symbol"),
"%s",
194 BAD_CAST(
typeid(*this).name()));
201 (
void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"m_pFrameFormats"));
204 pFormat->dumpAsXml(pWriter);
206 (
void)xmlTextWriterEndElement(pWriter);
211 (
void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"m_FlyUndos"));
214 pFly->dumpAsXml(pWriter);
216 (
void)xmlTextWriterEndElement(pWriter);
219 (
void)xmlTextWriterEndElement(pWriter);
377 SwDoc& rDoc = rPam.GetDoc();
385 pSavTextFormatColl = static_cast<SwTextNode*>(pCNd)->GetTextColl();
393 rPam.GetPoint()->nNode.GetIndex()));
414 if (pAnchor->
GetAnchorId() == RndStdIds::FLY_AT_CHAR)
418 pFly->SetFormatAttr(anchor);
433 && rPam.GetPoint()->nNode != rPam.GetMark()->nNode)
459 RedlineFlags eOld = rDoc.getIDocumentRedlineAccess().GetRedlineFlags();
462 rDoc.getIDocumentRedlineAccess().SetRedlineFlags_intern( eOld );
465 !rDoc.getIDocumentRedlineAccess().GetRedlineTable().empty() )
466 rDoc.getIDocumentRedlineAccess().SplitRedline(rPam);
std::vector< std::shared_ptr< SwUndoInsLayFormat > > m_FlyUndos
virtual SwCursor & CreateNewShellCursor()=0
SwPaM & AddUndoRedoPaM(::sw::UndoRedoContext &, bool const bCorrToContent=false) const
bool GoInContent(SwPaM &rPam, SwMoveFnCollection const &fnMove)
Represents the style of a paragraph.
Marks a position in the document model.
std::unique_ptr< SwHistory > m_pHistory
std::unique_ptr< SwRedlineData > m_pRedlineData
virtual ~SwUndoInserts() override
const OUString & GetText() const
virtual sal_uInt16 ResetAllAttr() override
SwpHints * GetpSwpHints()
virtual sal_Int32 Len() const override
const SwPosition * GetMark() const
void SetRedlineFlags(RedlineFlags eMode)
Dialog to specify the properties of date form field.
IDocumentContentOperations const & getIDocumentContentOperations() const
bool CanJoinNext(SwNodeIndex *pIdx=nullptr) const
Is it possible to join two nodes? In pIdx the second position can be returned.
virtual SwContentNode * JoinNext() override
const SwFrameFormats * GetSpzFrameFormats() const
IShellCursorSupplier & GetCursorSupplier()
SwUndoInserts(SwUndoId nUndoId, const SwPaM &)
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
SwNodeOffset m_nDeleteTextNodes
check if target position is in fly anchored at source range
static bool IsRedlineOn(const RedlineFlags eM)
SwNodeOffset GetIndex() const
std::optional< std::vector< SwFrameFormat * > > m_pFrameFormats
void dumpAsXml(xmlTextWriterPtr pWriter) const override
virtual void UndoImpl(::sw::UndoRedoContext &) override
RedlineFlags GetRedlineFlags() const
SwUndoCpyDoc(const SwPaM &)
bool IsAlive(typename std::remove_pointer< Value >::type const *const p) const
check that given format is still alive (i.e. contained here)
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
std::optional< std::vector< SwFrameFormat * > > GetFlysAnchoredAt(SwDoc &rDoc, SwNodeOffset const nSttNode)
virtual std::size_t GetRedlineAuthor()=0
SwUndoInsDoc(const SwPaM &)
static void MovePtForward(SwPaM &rPam, bool bMvBkwrd)
PaM is Point and Mark: a selection of the document model.
const SwAttrSet * GetpSwAttrSet() const
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
void RstTextAttr(const SwIndex &rIdx, const sal_Int32 nLen, const sal_uInt16 nWhich=0, const SfxItemSet *pSet=nullptr, const bool bInclRefToxMark=false, const bool bExactRange=false)
delete all attributes.
bool GoInNode(SwPaM &rPam, SwMoveFnCollection const &fnMove)
const SwPosition * GetPoint() const
virtual bool CopyRange(SwPaM &rPam, SwPosition &rPos, SwCopyFlags flags) const =0
Copy a selected content range to a position.
void DelContentIndex(const SwPosition &pMark, const SwPosition &pPoint, DelContentType nDelContentType=DelContentType::AllMask)
virtual bool DeleteRedline(const SwPaM &rPam, bool bSaveInUndo, RedlineType nDelType)=0
SwContentNode * GetContentNode()
SwNodeOffset GetIndex() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
Marks a character position inside a document model node.
virtual SwFormatColl * ChgFormatColl(SwFormatColl *) override
void SetInsertRange(const SwPaM &, bool bScanFlys=true, SwNodeOffset nDeleteTextNodes=SwNodeOffset(1))
Marks a node in the document model.
static bool MovePtBackward(SwPaM &rPam)
bool HasSwAttrSet() const
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
SwTextFormatColl * m_pLastNodeColl
SwTextNode is a paragraph in the document model.
virtual void RedoImpl(::sw::UndoRedoContext &) override
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
void SetPaM(SwPaM &, bool bCorrToContent=false) const
const SwTextFormatColls * GetTextFormatColls() const
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
sal_Int32 GetIndex() const
SwTextFormatColl * m_pTextFormatColl
virtual bool IsRedlineOn() const =0
Query if redlining is on.
const SwPosition * End() const
void PaMCorrAbs(const SwPaM &rRange, const SwPosition &rNewPos)
Function declarations so that everything below the CursorShell can move the Cursor once in a while...
void Delete(const SwNodeIndex &rPos, SwNodeOffset nNodes=SwNodeOffset(1))
delete nodes
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
static void RemoveIdxRel(SwNodeOffset, const SwPosition &)
SwMoveFnCollection const & fnMoveBackward
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
struct _xmlTextWriter * xmlTextWriterPtr
SwNode & GetEndOfExtras() const
This is the last EndNode of a special section.
static void MoveToUndoNds(SwPaM &rPam, SwNodeIndex *pNodeIdx, SwNodeOffset *pEndNdIdx=nullptr)
static bool IsCreateUndoForNewFly(SwFormatAnchor const &rAnchor, SwNodeOffset const nStartNode, SwNodeOffset const nEndNode)
This is not the same as IsDestroyFrameAnchoredAtChar() and intentionally so: because the SwUndoInsert...
virtual void RepeatImpl(::sw::RepeatContext &) override
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
bool m_bDetectedRangeSegmentation false
std::unique_ptr< SwNodeIndex > m_pUndoNodeIndex
start of Content in UndoNodes for Redo
SwTextFormatColl * GetTextColl() const
static void MoveFromUndoNds(SwDoc &rDoc, SwNodeOffset nNodeIdx, SwPosition &rInsPos, const SwNodeOffset *pEndNdIdx=nullptr, bool bForceCreateFrames=false)