20 #include <libxml/xmlwriter.h>
39 std::unique_ptr<std::vector<SwFrameFormat*>>
42 std::unique_ptr<std::vector<SwFrameFormat*>> pFrameFormats;
44 for (
size_t n = 0;
n < nArrLen; ++
n)
51 && ((pAnchor->
GetAnchorId() == RndStdIds::FLY_AT_PARA)
52 || (pAnchor->
GetAnchorId() == RndStdIds::FLY_AT_CHAR)))
55 pFrameFormats.reset(
new std::vector<SwFrameFormat*> );
56 pFrameFormats->push_back( pFormat );
66 :
SwUndo( nUndoId, &rPam.GetDoc() )
68 , m_pTextFormatColl(nullptr)
69 , m_pLastNodeColl(nullptr)
70 , m_nDeleteTextNodes(1)
83 0, pTextNd->
GetText().getLength(), false );
114 int const nDeleteTextNodes)
144 for(
size_t n = 0;
n < nArrLen; ++
n )
150 std::vector<SwFrameFormat*>::iterator it;
154 std::shared_ptr<SwUndoInsLayFormat>
const pFlyUndo =
155 std::make_shared<SwUndoInsLayFormat>(pFormat, 0, 0);
176 assert(nStartNode <= nEndNode);
181 return pAnchorPos !=
nullptr
182 && ( rAnchor.
GetAnchorId() == RndStdIds::FLY_AT_PARA
183 || rAnchor.
GetAnchorId() == RndStdIds::FLY_AT_CHAR)
190 xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwUndoInserts"));
191 xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"ptr"),
"%p",
this);
192 xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"symbol"),
"%s",
193 BAD_CAST(
typeid(*this).name()));
200 xmlTextWriterStartElement(pWriter, BAD_CAST(
"m_pFrameFormats"));
203 pFormat->dumpAsXml(pWriter);
205 xmlTextWriterEndElement(pWriter);
210 xmlTextWriterStartElement(pWriter, BAD_CAST(
"m_FlyUndos"));
213 pFly->dumpAsXml(pWriter);
215 xmlTextWriterEndElement(pWriter);
218 xmlTextWriterEndElement(pWriter);
376 SwDoc& rDoc = rPam.GetDoc();
384 pSavTextFormatColl = static_cast<SwTextNode*>(pCNd)->GetTextColl();
392 rPam.GetPoint()->nNode.GetIndex()));
413 if (pAnchor->
GetAnchorId() == RndStdIds::FLY_AT_CHAR)
417 pFly->SetFormatAttr(anchor);
432 && rPam.GetPoint()->nNode != rPam.GetMark()->nNode)
458 RedlineFlags eOld = rDoc.getIDocumentRedlineAccess().GetRedlineFlags();
461 rDoc.getIDocumentRedlineAccess().SetRedlineFlags_intern( eOld );
464 !rDoc.getIDocumentRedlineAccess().GetRedlineTable().empty() )
465 rDoc.getIDocumentRedlineAccess().SplitRedline(rPam);
std::vector< std::shared_ptr< SwUndoInsLayFormat > > m_FlyUndos
SwPaM & AddUndoRedoPaM(::sw::UndoRedoContext &, bool const bCorrToContent=false) const
sal_uLong GetIndex() 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 SwPaM & CreateNewShellCursor()=0
virtual sal_Int32 Len() const override
const SwPosition * GetMark() const
void SetRedlineFlags(RedlineFlags eMode)
Dialog to specify the properties of date form field.
std::unique_ptr< std::vector< SwFrameFormat * > > m_pFrameFormats
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
void Delete(const SwNodeIndex &rPos, sal_uLong nNodes=1)
delete nodes
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
check if target position is in fly anchored at source range
static bool IsRedlineOn(const RedlineFlags eM)
sal_uLong GetIndex() const
static void MoveToUndoNds(SwPaM &rPam, SwNodeIndex *pNodeIdx, sal_uLong *pEndNdIdx=nullptr)
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).
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.
struct _xmlTextWriter * xmlTextWriterPtr
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()
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
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
static void MoveFromUndoNds(SwDoc &rDoc, sal_uLong nNodeIdx, SwPosition &rInsPos, const sal_uLong *pEndNdIdx=nullptr, bool bForceCreateFrames=false)
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...
static void RemoveIdxRel(sal_uLong, const SwPosition &)
SwMoveFnCollection const & fnMoveBackward
std::unique_ptr< std::vector< SwFrameFormat * > > GetFlysAnchoredAt(SwDoc &rDoc, sal_uLong const nSttNode)
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
static bool IsCreateUndoForNewFly(SwFormatAnchor const &rAnchor, sal_uLong const nStartNode, sal_uLong const nEndNode)
This is not the same as IsDestroyFrameAnchoredAtChar() and intentionally so: because the SwUndoInsert...
SwNode & GetEndOfExtras() const
This is the last EndNode of a special section.
void SetInsertRange(const SwPaM &, bool bScanFlys=true, int nDeleteTextNodes=1)
virtual void RepeatImpl(::sw::RepeatContext &) override
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
std::unique_ptr< SwNodeIndex > m_pUndoNodeIndex
start of Content in UndoNodes for Redo
SwTextFormatColl * GetTextColl() const