29#include <osl/diagnose.h>
31#include <officecfg/Office/Writer.hxx>
40 : ::std::optional<::std::pair<
SwNode const*, ::std::vector<SwTableNode *>>>{});
59 if( pUndo && !*pUndo )
94 }
while( pEndSelPos );
98 std::optional<SwPaM> pNewPam;
102 if (!oSelectAll->second.empty())
109 for (
SwTableNode *
const pTable : oSelectAll->second)
117 pNewPam->Start()->Assign(*oSelectAll->first);
124 if (oSelectAll && !oSelectAll->second.empty())
162 DeleteSel(rPaM, isArtificialSelection, &bUndo);
190 std::vector< std::shared_ptr<SwPosition> > aInsertList;
195 std::shared_ptr<SwPosition> pInsertPos;
196 sal_uInt16 nMove = 0;
201 if( &rDestShell ==
this )
205 pPos = rPaM.GetPoint();
217 if (aCursor.UpDown(
false, nMove,
nullptr, 0, *
GetLayout()))
219 pInsertPos = std::make_shared<SwPosition>( *aCursor.GetPoint() );
220 aInsertList.push_back( pInsertPos );
224 pInsertPos = std::make_shared<SwPosition>( *pPos );
230 *rPaM.Start() <= *pTmp && *pTmp < *rPaM.End() )
238 bool bFirstMove =
true;
240 sal_Int32 nSttCntIdx = 0;
242 auto pNextInsert = aInsertList.begin();
249 if( &rDestShell ==
this )
253 pPos = rPaM.GetPoint();
261 if( pNextInsert != aInsertList.end() )
263 pPos = pNextInsert->get();
271 if( !rPaM.HasMark() || *rPaM.GetPoint() == *rPaM.GetMark() )
297 pCursor->
GetPoint()->
Assign( aSttNdIdx.GetIndex()+1, nSttCntIdx );
306#if OSL_DEBUG_LEVEL > 0
311 OSL_ENSURE( rCmp.GetPoint()->GetContentNode()
312 == rCmp.GetPointContentNode(),
"Point in wrong Node" );
313 OSL_ENSURE( rCmp.GetMark()->GetContentNode()
314 == rCmp.GetMarkContentNode(),
"Mark in wrong Node" );
347 if( rPaM.HasMark() && *rPaM.GetMark() != *rPaM.GetPoint() )
@ CheckPosInFly
check if target position is in fly anchored at source range
@ ArtificialSelection
keyboard delete, artificial selection, avoid deleting flys
virtual bool DeleteAndJoin(SwPaM &, SwDeleteFlags flags=SwDeleteFlags::Default)=0
complete delete of a given PaM
virtual bool SplitNode(const SwPosition &rPos, bool bChkTableStart)=0
Split a node at rPos (implemented only for TextNode).
virtual bool DelFullPara(SwPaM &)=0
Delete full paragraphs.
StartsWith StartsWith_()
If document body starts with a table or starts/ends with hidden paragraph.
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
bool CursorInsideInputField() const
bool HasReadonlySel(bool isReplace=false) const
void SaveTableBoxContent(const SwPosition *pPos=nullptr)
bool HasHiddenSections() const
::std::optional<::std::pair< SwNode const *, ::std::vector< SwTableNode * > > > ExtendedSelectedAll() const
If ExtendedSelectAll() was called and selection didn't change since then.
IDocumentContentOperations const & getIDocumentContentOperations() const
IDocumentUndoRedo & GetIDocumentUndoRedo()
void DelTable(SwTableNode *pTable)
void MakeUniqueNumRules(const SwPaM &rPaM)
void StartAllAction()
For all views of this document.
bool RemoveParagraphMetadataFieldAtCursor()
Removes the paragraph metadata field at the current cursor, if any.
SAL_DLLPRIVATE void DeleteSel(SwPaM &rPam, bool isArtificialSelection, bool *pUndo=nullptr)
bool Delete(bool isArtificialSelection=false)
Delete content of all ranges.
bool DelFullPara()
Remove a complete paragraph.
bool Replace(const OUString &rNewStr, bool bRegExpRplc)
Replace a selected range in a TextNode by given string.
virtual bool WarnHiddenSectionDialog() const
Selected area has hidden content.
bool Copy(SwEditShell &rDestShell)
Copy content of all ranges at current position of cursor to given Shell.
virtual void InfoReadOnlyDialog(bool) const
Selected area has readonly content.
Marks a node in the document model.
Base class of the Writer document model elements.
SwNodeOffset GetIndex() const
bool IsInProtectSect() const
Is node in a protected area?
bool IsContentNode() const
SwTableNode * FindTableNode()
Search table node, in which it is.
const SwStartNode * StartOfSectionNode() const
const SwEndNode * EndOfSectionNode() const
PaM is Point and Mark: a selection of the document model.
const SwPosition * GetMark() const
SwNode & GetPointNode() const
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
bool IsMultiSelection() const
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
const SwPosition * End() const
SwNode & GetMarkNode() const
const SwPosition * GetPoint() const
const SwPosition * Start() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
void AddRule(SwUndoArg eWhat, const OUString &rWith)
Represents the current text cursor of one opened edit window.
IDocumentContentOperations & getIDocumentContentOperations()
Provides access to the content operations interface.
SwRootFrame * GetLayout() const
ring_container GetRingContainer()
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
bool ReplaceImpl(SwPaM &rCursor, OUString const &rReplacement, bool const bRegExp, SwDoc &rDoc, SwRootFrame const *const pLayout)
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
OUString SwResId(TranslateId aId)
bool IsFlySelectedByCursor(SwDoc const &rDoc, SwPosition const &rStart, SwPosition const &rEnd)
check at-char and at-para flys in rDoc