20#include <libxml/xmlwriter.h>
40std::optional<std::vector<SwFrameFormat*>>
43 std::optional<std::vector<SwFrameFormat*>> pFrameFormats;
45 for (
size_t n = 0;
n < nArrLen; ++
n)
51 && nSttNode == pAnchorNode->
GetIndex()
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)
84 0, pTextNd->
GetText().getLength(),
false );
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 pAnchorNode !=
nullptr
183 && ( rAnchor.
GetAnchorId() == RndStdIds::FLY_AT_PARA
184 || rAnchor.
GetAnchorId() == RndStdIds::FLY_AT_CHAR)
185 && ( nStartNode == pAnchorNode->
GetIndex()
186 || nEndNode == pAnchorNode->
GetIndex());
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);
382 pSavTextFormatColl =
static_cast<SwTextNode*
>(pCNd)->GetTextColl();
411 if (pAnchor->
GetAnchorId() == RndStdIds::FLY_AT_CHAR)
415 pFly->SetFormatAttr(
anchor);
@ CheckPosInFly
check if target position is in fly anchored at source range
virtual bool CopyRange(SwPaM &rPam, SwPosition &rPos, SwCopyFlags flags) const =0
Copy a selected content range to a position.
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 void dumpAsXml(xmlTextWriterPtr pWriter) const
bool HasSwAttrSet() const
bool CanJoinNext(SwNodeIndex *pIdx=nullptr) const
Is it possible to join two nodes? In pIdx the second position can be returned.
const SwAttrSet * GetpSwAttrSet() const
IDocumentContentOperations const & getIDocumentContentOperations() const
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
const SwTextFormatColls * GetTextFormatColls() const
const sw::FrameFormats< sw::SpzFrameFormat * > * GetSpzFrameFormats() const
Marks a node in the document model.
SwNodeOffset GetIndex() const
Base class of the Writer document model elements.
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwNodeOffset GetIndex() const
SwNode & GetEndOfExtras() const
This is the last EndNode of a special section.
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
void Delete(const SwNodeIndex &rPos, SwNodeOffset nNodes=SwNodeOffset(1))
PaM is Point and Mark: a selection of the document model.
const SwPosition * GetMark() const
SwContentNode * GetPointContentNode() const
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
const SwPosition * End() const
const SwPosition * GetPoint() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
Represents the style of a paragraph.
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
virtual SwFormatColl * ChgFormatColl(SwFormatColl *) override
SwpHints * GetpSwpHints()
const OUString & GetText() const
SwTextFormatColl * GetTextColl() const
virtual sal_uInt16 ResetAllAttr() override
SwPaM & AddUndoRedoPaM(::sw::UndoRedoContext &, bool const bCorrToContent=false) const
void SetPaM(SwPaM &, bool bCorrToContent=false) const
SwUndoCpyDoc(const SwPaM &)
SwUndoInsDoc(const SwPaM &)
SwTextFormatColl * m_pTextFormatColl
std::vector< std::shared_ptr< SwUndoInsLayFormat > > m_FlyUndos
virtual void UndoImpl(::sw::UndoRedoContext &) override
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...
void SetInsertRange(const SwPaM &, bool bScanFlys=true, SwNodeOffset nDeleteTextNodes=SwNodeOffset(1))
SwUndoInserts(SwUndoId nUndoId, const SwPaM &)
SwNodeOffset m_nDeleteTextNodes
void dumpAsXml(xmlTextWriterPtr pWriter) const override
std::optional< SwNodeIndex > m_oUndoNodeIndex
start of Content in UndoNodes for Redo
virtual ~SwUndoInserts() override
virtual void RepeatImpl(::sw::RepeatContext &) override
SwTextFormatColl * m_pLastNodeColl
std::unique_ptr< SwRedlineData > m_pRedlineData
std::optional< std::vector< SwFrameFormat * > > m_pFrameFormats
virtual void RedoImpl(::sw::UndoRedoContext &) override
static void MoveFromUndoNds(SwDoc &rDoc, SwNodeOffset nNodeIdx, SwPosition &rInsPos, const SwNodeOffset *pEndNdIdx=nullptr, bool bForceCreateFrames=false)
void DelContentIndex(const SwPosition &pMark, const SwPosition &pPoint, DelContentType nDelContentType=DelContentType::AllMask)
static void MoveToUndoNds(SwPaM &rPam, SwNodeIndex *pNodeIdx, SwNodeOffset *pEndNdIdx=nullptr)
std::unique_ptr< SwHistory > m_pHistory
static bool MovePtBackward(SwPaM &rPam)
static void MovePtForward(SwPaM &rPam, bool bMvBkwrd)
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
void SetRedlineFlags(RedlineFlags eMode)
RedlineFlags GetRedlineFlags() const
static void RemoveIdxRel(SwNodeOffset, const SwPosition &)
bool IsAlive(typename std::remove_pointer< Value >::type const *const p) const
check that given format is still alive (i.e. contained here)
virtual SwCursor & CreateNewShellCursor()=0
IShellCursorSupplier & GetCursorSupplier()
struct _xmlTextWriter * xmlTextWriterPtr
void PaMCorrAbs(const SwPaM &rRange, const SwPosition &rNewPos)
Function declarations so that everything below the CursorShell can move the Cursor once in a while.
Dialog to specify the properties of date form field.
std::optional< std::vector< SwFrameFormat * > > GetFlysAnchoredAt(SwDoc &rDoc, SwNodeOffset const nSttNode)
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
bool GoInNode(SwPaM &rPam, SwMoveFnCollection const &fnMove)
bool GoInContent(SwPaM &rPam, SwMoveFnCollection const &fnMove)
SwMoveFnCollection const & fnMoveBackward
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
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.
SwNodeOffset GetNodeIndex() const
sal_Int32 GetContentIndex() const