27 #include <section.hxx>
32 #include <osl/diagnose.h>
63 if( pCursor->
GetNext() != pCursor )
92 std::pair<Point, bool>
const tmp(*pPt,
true);
98 if( bOutOfTab && pFrame )
100 if( pFrame && pFrame->
IsInSct() )
103 OSL_ENSURE( pSect,
"GetAnySection: Where's my Sect?" );
107 OSL_ENSURE( pSect,
"GetAnySection: Where's my SectFrame?" );
126 if( pFormat->IsInNodesArr() &&
188 if( pSttSectNd || pEndSectNd )
193 if( pEndSectNd && pSttSectNd != pEndSectNd )
197 if( pSttSectNd && pEndSectNd )
202 pEndSectNd->GetIndex() )
208 while( aSIdx < aEIdx )
212 nullptr != ( pSttSectNd = aSIdx.
GetNode().
258 (
nullptr == ( pCNd = pEnd->nNode.GetNode().
GetContentNode() )) ||
259 pCNd->
Len() != pEnd->nContent.GetIndex() )
272 if( !aSIdx.GetNode().IsSectionNode() ||
303 const SwNode* pReturn =
nullptr;
306 OSL_ENSURE( pCurrentPos !=
nullptr,
"Strange, we have no position!" );
312 const SwNode* pInnermostNode =
nullptr;
318 if( pTableNode ==
nullptr )
319 pInnermostNode = pSectionNode;
320 else if ( pSectionNode ==
nullptr )
321 pInnermostNode = pTableNode;
327 ? pSectionNode : pTableNode;
336 if( (pInnermostNode !=
nullptr) && !pInnermostNode->
IsProtect() )
342 rCurrentNode.
GetIndex() ),
"wrong node found" );
353 while( (aBegin != pInnermostNode->
GetIndex()) &&
356 bool bStart = ( aBegin == pInnermostNode->
GetIndex() );
376 pReturn = pInnermostNode;
379 OSL_ENSURE( ( pReturn ==
nullptr ) || pReturn->
IsStartNode() ||
381 "SpecialInsertNode failed" );
401 if( pInsertNode ==
nullptr )
414 *pCursorPos = aInsertPos;
SwSectionNode * FindSectionNode()
Search section node, in which it is.
const SwEndNode * EndOfSectionNode() const
Base class of the Writer layout elements.
virtual sal_Int32 Len() const
size_t GetSectionFormatPos(const SwSectionFormat &) const
SwNodeOffset EndOfSectionIndex() const
Marks a position in the document model.
bool IsSectionNode() const
void DelSectionFormat(SwSectionFormat *pFormat, bool bDelNodes=false)
bool IsInFootnote() const
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
virtual SwUndoId EndUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Closes undo block.
SwSection const * InsertSection(SwSectionData &rNewData, SfxItemSet const *const =nullptr)
OUString GetUniqueSectionName(const OUString *pChkStr=nullptr) const
SwSectionFormat * GetFormat()
IDocumentUndoRedo & GetIDocumentUndoRedo()
IDocumentContentOperations const & getIDocumentContentOperations() const
static SwSection * GetCurrSection(const SwPosition &rPos)
const SwSection * GetCurrSection() const
void UpdateSection(size_t const nSect, SwSectionData &, SfxItemSet const *const =nullptr)
const SwSection & GetSection() const
virtual bool GetModelPositionForViewPoint(SwPosition *, Point &, SwCursorMoveState *=nullptr, bool bTestBackground=false) const override
Primary passes the call to the first page.
bool CanSpecialInsert() const
a node can be special-inserted (alt-Enter) whenever lcl_SpecialInsertNode finds a suitable position ...
void SetAttr(const SfxPoolItem &, SwFormat &)
Set attribute in given format.1y If Undo is enabled, the old values is added to the Undo history...
const SwSectionFormat & GetSectionFormat(size_t nFormat) const
SwSection * GetAnySection(bool bOutOfTab=false, const Point *pPt=nullptr)
Deliver the responsible area of the columns.
bool IsContentNode() const
PaM is Point and Mark: a selection of the document model.
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
virtual SwUndoId StartUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Opens undo block.
bool IsInsRegionAvailable() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SwStartNode * StartOfSectionNode() const
const SwPosition * GetPoint() const
bool IsAnySectionInDoc() const
sal_uInt16 GetFullSelectedSectionCount() const
Search inside the cursor selection for full selected sections.
SwContentNode * GetContentNode()
SwNodeOffset GetIndex() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
SwLayoutFrame * GetUpper()
void DoSpecialInsert()
Special insert: Insert a new text node just before or after a section or table, if the cursor is posi...
Marks a node in the document model.
ring_container GetRingContainer()
bool IsProtect() const
Is node in something that is protected (range, frame, table cells ...
constexpr TypedWhichId< SwFormatContent > RES_CNTNT(95)
SwSectionFrame * FindSctFrame()
size_t GetSectionFormatCount() const
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
void UpdateSection(size_t const nSect, SwSectionData &, SfxItemSet const *const =nullptr, bool const bPreventLinkUpdate=false)
SwContentFrame * GetCurrFrame(const bool bCalcFrame=true) const
Get current frame in which the cursor is positioned.
OUString GetUniqueSectionName(const OUString *pChkStr=nullptr) const
sal_Int32 GetIndex() const
static sal_uInt16 IsInsRegionAvailable(const SwPaM &rRange, const SwNode **ppSttNd=nullptr)
SAL_DLLPRIVATE void SetSectionAttr_(SwSectionFormat &rSectFormat, const SfxItemSet &rSet)
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
virtual bool AppendTextNode(SwPosition &rPos)=0
SwTableNode * FindTableNode()
Search table node, in which it is.
SwSectionNode * GetSectionNode()
void SetSectionAttr(const SfxItemSet &rSet, SwSectionFormat *pSectFormat=nullptr)
Set attributes.
void StartAllAction()
For all views of this document.
SwSection * InsertSwSection(SwPaM const &rRange, SwSectionData &, std::tuple< SwTOXBase const *, sw::RedlineMode, sw::FieldmarkMode > const *pTOXBase, SfxItemSet const *const pAttr, bool const bUpdate=true)
SwRootFrame * GetLayout() const
SwSectionFormats & GetSections()
void DelSectionFormat(size_t nFormat)
static const SwNode * lcl_SpecialInsertNode(const SwPosition *pCurrentPos)
Find the suitable node for a special insert (alt-enter).
SwTabFrame * FindTabFrame()
Base class of the Writer document model elements.