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() &&
182 auto [pStt, pEnd] = rPaM.StartEnd();
187 if( pSttSectNd || pEndSectNd )
192 if( pEndSectNd && pSttSectNd != pEndSectNd )
196 if( pSttSectNd && pEndSectNd )
201 pEndSectNd->GetIndex() )
207 while( aSIdx < aEIdx )
211 nullptr != ( pSttSectNd = aSIdx.
GetNode().
212 StartOfSectionNode()->GetSectionNode())) )
252 auto [pStt, pEnd] = rPaM.StartEnd();
255 if( pStt->GetContentIndex() ||
257 pCNd->
Len() != pEnd->GetContentIndex() )
269 SwNodeIndex aSIdx( pStt->GetNode(), -1 ), aEIdx( pEnd->GetNode(), +1 );
270 if( !aSIdx.GetNode().IsSectionNode() ||
301 const SwNode* pReturn =
nullptr;
304 OSL_ENSURE( pCurrentPos !=
nullptr,
"Strange, we have no position!" );
310 const SwNode* pInnermostNode =
nullptr;
316 if( pTableNode ==
nullptr )
317 pInnermostNode = pSectionNode;
318 else if ( pSectionNode ==
nullptr )
319 pInnermostNode = pTableNode;
325 ? pSectionNode : pTableNode;
334 if( (pInnermostNode !=
nullptr) && !pInnermostNode->
IsProtect() )
340 rCurrentNode.
GetIndex() ),
"wrong node found" );
351 while( (aBegin != pInnermostNode->
GetIndex()) &&
354 bool bStart = ( aBegin == pInnermostNode->
GetIndex() );
374 pReturn = pInnermostNode;
377 OSL_ENSURE( ( pReturn ==
nullptr ) || pReturn->
IsStartNode() ||
379 "SpecialInsertNode failed" );
399 if( pInsertNode ==
nullptr )
412 *pCursorPos = aInsertPos;
virtual bool AppendTextNode(SwPosition &rPos)=0
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
virtual sal_Int32 Len() const
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
SwContentFrame * GetCurrFrame(const bool bCalcFrame=true) const
Get current frame in which the cursor is positioned.
SwSectionFormats & GetSections()
static SwSection * GetCurrSection(const SwPosition &rPos)
static sal_uInt16 IsInsRegionAvailable(const SwPaM &rRange, const SwNode **ppSttNd=nullptr)
SwSection * InsertSwSection(SwPaM const &rRange, SwSectionData &, std::tuple< SwTOXBase const *, sw::RedlineMode, sw::FieldmarkMode, sw::ParagraphBreakMode > const *pTOXBase, SfxItemSet const *const pAttr, bool const bUpdate=true)
void SetAttr(const SfxPoolItem &, SwFormat &)
Set attribute in given format.1y If Undo is enabled, the old values is added to the Undo history.
IDocumentContentOperations const & getIDocumentContentOperations() const
IDocumentUndoRedo & GetIDocumentUndoRedo()
void DelSectionFormat(SwSectionFormat *pFormat, bool bDelNodes=false)
OUString GetUniqueSectionName(const OUString *pChkStr=nullptr) const
void UpdateSection(size_t const nSect, SwSectionData &, SfxItemSet const *const =nullptr, bool const bPreventLinkUpdate=false)
void StartAllAction()
For all views of this document.
size_t GetSectionFormatCount() const
void DoSpecialInsert()
Special insert: Insert a new text node just before or after a section or table, if the cursor is posi...
SwSection const * InsertSection(SwSectionData &rNewData, SfxItemSet const *const =nullptr)
sal_uInt16 GetFullSelectedSectionCount() const
Search inside the cursor selection for full selected sections.
const SwSection * GetCurrSection() const
void UpdateSection(size_t const nSect, SwSectionData &, SfxItemSet const *const =nullptr)
void SetSectionAttr(const SfxItemSet &rSet, SwSectionFormat *pSectFormat=nullptr)
Set attributes.
bool CanSpecialInsert() const
a node can be special-inserted (alt-Enter) whenever lcl_SpecialInsertNode finds a suitable position
OUString GetUniqueSectionName(const OUString *pChkStr=nullptr) const
bool IsAnySectionInDoc() const
bool IsInsRegionAvailable() const
SwSection * GetAnySection(bool bOutOfTab=false, const Point *pPt=nullptr)
Deliver the responsible area of the columns.
const SwSectionFormat & GetSectionFormat(size_t nFormat) const
size_t GetSectionFormatPos(const SwSectionFormat &) const
void DelSectionFormat(size_t nFormat)
SAL_DLLPRIVATE void SetSectionAttr_(SwSectionFormat &rSectFormat, const SfxItemSet &rSet)
Base class of the Writer layout elements.
SwSectionFrame * FindSctFrame()
SwTabFrame * FindTabFrame()
bool IsInFootnote() const
SwLayoutFrame * GetUpper()
Marks a node in the document model.
Base class of the Writer document model elements.
SwSectionNode * GetSectionNode()
SwNodeOffset GetIndex() const
bool IsProtect() const
Is node in something that is protected (range, frame, table cells ... including anchor in case of fra...
bool IsContentNode() const
bool IsSectionNode() const
SwTableNode * FindTableNode()
Search table node, in which it is.
SwSectionNode * FindSectionNode()
Search section node, in which it is.
const SwStartNode * StartOfSectionNode() const
SwNodeOffset EndOfSectionIndex() const
SwContentNode * GetContentNode()
const SwEndNode * EndOfSectionNode() const
PaM is Point and Mark: a selection of the document model.
const SwPosition * GetPoint() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
virtual bool GetModelPositionForViewPoint(SwPosition *, Point &, SwCursorMoveState *=nullptr, bool bTestBackground=false) const override
Primary passes the call to the first page.
A section node represents the start of a section on the UI, i.e.
const SwSection & GetSection() const
SwSectionFormat * GetFormat()
SwRootFrame * GetLayout() const
ring_container GetRingContainer()
static const SwNode * lcl_SpecialInsertNode(const SwPosition *pCurrentPos)
Find the suitable node for a special insert (alt-enter).
constexpr TypedWhichId< SwFormatContent > RES_CNTNT(101)
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
Marks a position in the document model.
sal_Int32 GetContentIndex() const