29#include <osl/diagnose.h>
33 for(
SwPaM& rTmp :
const_cast<SwPaM*
>(&rRing)->GetRingContainer())
34 Insert( rTmp.GetMark()->GetNode(), rTmp.GetPoint()->GetNode() );
100 assert( nArrPos <
Count() );
131 if( pCursor->
GetNext() != pCursor )
136 for(
size_t n = 0;
n < aRangeArr.
Count(); ++
n )
150 bool bResult =
false;
162 if (pTextNd && (!bResult || pTextNd->
Len()!=0))
173 if (!bResult && pTextNd->
Len())
185 bool bResult =
false;
197 if (pTextNd && (!bResult || pTextNd->
Len()!=0))
201 if (!bResult && pTextNd->
Len())
213 bool bResult =
false;
235 bool bResult =
false;
289 for(
size_t n = 0;
n < aRangeArr.
Count(); ++
n )
315 if ( pCurNumRule !=
nullptr )
319 if( nDiff > 0 || aRootNumFormat.
GetIndentAt() + nDiff > 0)
349 if ( pTextNode !=
nullptr
413 &nUpperLevel, &nLowerLevel ))
433 std::pair<SwTextNode *, SwTextNode *> nodes(
435 nIdx = nodes.first->GetIndex() - 1;
442 nOffset = nIdx - nStt;
456 std::pair<SwTextNode *, SwTextNode *> nodes(
458 nIdx = nodes.second->GetIndex() + 1;
477 std::pair<SwTextNode *, SwTextNode *> nodes(
479 nIdx = nodes.second->GetIndex() + 1;
496 nOffset = nIdx - nStt;
508 else if( (bUpperLeft ? nUpperLevel : nLowerLevel+1) <
MAXLEVEL )
533 for(
size_t n = 0;
n < aRangeArr.
Count(); ++
n )
577 OSL_ENSURE( nTmpLvl >= 0 && nTmpLvl <=
MAXLEVEL,
578 "<SwEditShell::IsProtectedOutlinePara()>" );
585 else if( nLvl >= nTmpLvl )
595#if OSL_DEBUG_LEVEL > 0
598 OSL_FAIL(
"Cursor not on an outline node");
653 bool bResult =
false;
660 if ( pTextNd !=
nullptr )
677 OSL_ENSURE( pTextNd,
"GetNumLevel() without text node" );
678 if ( pTextNd ==
nullptr )
682 if ( pRule !=
nullptr )
685 if ( nListLevelOfTextNode >= 0 )
687 nLevel =
static_cast<sal_uInt8>( nListLevelOfTextNode );
702 const SwNumRule* pNumRuleAtCurrentSelection =
nullptr;
704 bool bDifferentNumRuleFound =
false;
707 const SwNode& rEndNode(rCurrentCursor.End()->GetNode());
709 for (
SwNodeIndex aNode(rCurrentCursor.Start()->GetNode()); aNode <= rEndNode; ++aNode )
713 if ( pNumRule ==
nullptr )
717 else if ( pNumRule != pNumRuleAtCurrentSelection )
719 if ( pNumRuleAtCurrentSelection ==
nullptr )
721 pNumRuleAtCurrentSelection = pNumRule;
725 pNumRuleAtCurrentSelection =
nullptr;
726 bDifferentNumRuleFound =
true;
731 if(bDifferentNumRuleFound)
735 return pNumRuleAtCurrentSelection;
740 const OUString& rContinuedListId,
741 const bool bResetIndentAttrs )
750 OUString sContinuedListId(rContinuedListId);
754 bCreateNewList,
GetLayout(), sContinuedListId,
755 true, bResetIndentAttrs );
761 sContinuedListId = sListId;
762 bCreateNewList =
false;
771 bCreateNewList,
GetLayout(), rContinuedListId,
772 true, bResetIndentAttrs );
809 for(
size_t n = 0;
n < aRangeArr.
Count(); ++
n )
842 for(
size_t n = 0;
n < aRangeArr.
Count(); ++
n )
876 false, bNum,
false, -1,
virtual void SetModified()=0
Must be called manually at changes of format.
bool HasSelection() const
Does the current cursor create a selection?
bool IsMultiSelection() const
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
bool SetInFrontOfLabel(bool bNew)
SAL_DLLPRIVATE void UpdateMarkedListLevel()
Updates the marked list level according to the cursor.
bool IsInFrontOfLabel() const
bool MoveOutlinePara(const SwPaM &rPam, SwOutlineNodes::difference_type nOffset)
Outline - move up / move down.
void SetNodeNumStart(const SwPosition &rPos, sal_uInt16 nStt)
static bool GotoPrevNum(SwPosition &, SwRootFrame const *pLayout, bool bOverUpper=true)
IDocumentState const & getIDocumentState() const
bool NumOrNoNum(SwNode &rIdx, bool bDel=false)
OUString GetUniqueNumRuleName(const OUString *pChkStr=nullptr, bool bAutoNum=true) const
void ReplaceNumRule(const SwPosition &rPos, const OUString &rOldRule, const OUString &rNewRule)
bool NoNum(const SwPaM &)
SwNumRule * GetOutlineNumRule() const
bool MoveParagraph(SwPaM &, SwNodeOffset nOffset, bool bIsOutlMv=false)
Move selected paragraphs (not only numberings) according to offsets.
IDocumentUndoRedo & GetIDocumentUndoRedo()
void DelNumRules(const SwPaM &, SwRootFrame const *pLayout=nullptr)
void SetNumRuleStart(const SwPosition &rPos, bool bFlag=true)
OUString SetNumRule(const SwPaM &, const SwNumRule &, bool bCreateNewList, SwRootFrame const *pLayout=nullptr, const OUString &sContinuedListId=OUString(), bool bSetItem=true, const bool bResetIndentAttrs=false)
Accept changes of outline styles for OutlineRule.
void ChgNumRuleFormats(const SwNumRule &rRule)
const SwNumRule * SearchNumRule(const SwPosition &rPos, const bool bForward, const bool bNum, const bool bOutline, int nNonEmptyAllowed, OUString &sListId, SwRootFrame const *pLayout, const bool bInvestigateStartNode=false)
Searches for a text node with a numbering rule.
static bool IsFirstOfNumRuleAtPos(const SwPosition &rPos, SwRootFrame const &rLayout)
void SetCounted(const SwPaM &, bool bCounted, SwRootFrame const *pLayout)
bool NumUpDown(const SwPaM &, bool bDown, SwRootFrame const *pLayout=nullptr)
bool OutlineUpDown(const SwPaM &rPam, short nOffset, SwRootFrame const *pLayout=nullptr)
static bool GotoNextNum(SwPosition &, SwRootFrame const *pLayout, bool bOverUpper=true, sal_uInt8 *pUpper=nullptr, sal_uInt8 *pLower=nullptr)
static SwNumRule * GetNumRuleAtPos(SwPosition &rPos, SwRootFrame const *pLayout=nullptr)
void SetOutlineNumRule(const SwNumRule &rRule)
void StartAllAction()
For all views of this document.
void SetOutlineNumRule(const SwNumRule &)
bool IsNoNum(bool bChkStart=true) const
void ReplaceNumRule(const OUString &rOldRule, const OUString &rNewRule)
sal_uInt16 GetNodeNumStart(SwPaM *pPaM) const
void SetNumRuleStart(bool bFlag, SwPaM *pCursor)
Set (and query if) a numbering with StartFlag starts at current PointPos.
bool IsOutlineCopyable(SwOutlineNodes::size_type nIdx) const
void SetNodeNumStart(sal_uInt16 nStt)
void NoNum()
Paragraphs without enumeration but with indents.
bool SelectionHasNumber() const
void SetCurNumRule(const SwNumRule &, const bool bCreateNewList, const OUString &sContinuedListId=OUString(), const bool bResetIndentAttrs=false)
Optional parameter <bResetIndentAttrs> (default value false).
bool NumOrNoNum(bool bDelete=false, bool bChkStart=true)
Switch on/off of numbering via Delete/Backspace.
void ChangeIndentOfAllListLevels(sal_Int32 nDiff)
Remove unused default parameter <nLevel> and <bRelative>.
bool IsNumRuleStart(SwPaM *pPaM=nullptr) const
bool SelectionHasBullet() const
bool MoveParagraph(SwNodeOffset nOffset=SwNodeOffset(1))
sal_uInt8 GetNumLevel() const
const SwNumRule * GetOutlineNumRule() const
void SetIndent(short nIndent, const SwPosition &rPos)
bool IsProtectedOutlinePara() const
const SwNumRule * GetNumRuleAtCurrentSelection() const
Returns the numbering rule found at the paragraphs of the current selection, if all paragraphs of the...
int GetCurrentParaOutlineLevel() const
Get Outline level of current paragraph.
const SwNumRule * GetNumRuleAtCurrCursorPos() const
void DelNumRules()
Delete, split enumeration list.
bool OutlineUpDown(short nOffset=1)
void ChgNumRuleFormats(const SwNumRule &rRule)
void NumUpDown(bool bDown=true)
bool IsOutlineMovable(SwOutlineNodes::size_type nIdx) const
May an outline be moved or copied? Check whether it's in text body, not in table, and not read-only (...
bool MoveOutlinePara(SwOutlineNodes::difference_type nOffset)
OUString GetUniqueNumRuleName() const
void GetCurrentOutlineLevels(sal_uInt8 &rUpper, sal_uInt8 &rLower)
Detect highest and lowest level to check moving of outline levels.
bool MoveNumParas(bool bUpperLower, bool bUpperLeft)
const SwNumRule * SearchNumRule(const bool bNum, OUString &sListId)
Searches for a text node with a numbering rule.
bool IsFirstOfNumRuleAtCursorPos() const
Marks a node in the document model.
Base class of the Writer document model elements.
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwNodeOffset GetIndex() const
bool IsProtect() const
Is node in something that is protected (range, frame, table cells ... including anchor in case of fra...
bool IsSectionNode() const
SwTableNode * FindTableNode()
Search table node, in which it is.
const SwStartNode * StartOfSectionNode() const
const SwOutlineNodes & GetOutLineNds() const
Array of all OutlineNodes.
SwNode & GetEndOfExtras() const
This is the last EndNode of a special section.
void ChangeIndent(const sal_Int32 nDiff)
change indent of all list levels by given difference
void SetIndentOfFirstListLevelAndChangeOthers(const short nNewIndent)
set indent of first list level to given value and change other list level's indents accordingly
const SwNumFormat & Get(sal_uInt16 i) const
void SetIndent(const short nNewIndent, const sal_uInt16 nListLevel)
set indent of certain list level to given value
bool Seek_Entry(SwNode *rP, size_type *pnPos) 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.
SwPaM & SetPam(size_t nArrPos, SwPaM &rPam)
o3tl::sorted_vector< SwPamRange > maVector
void Insert(const SwNode &rIdx1, const SwNode &rIdx2)
SwPamRanges(const SwPaM &rRing)
SwTextNode is a paragraph in the document model.
bool HasBullet() const
Returns if this text node has a bullet.
SwNumberTree::tSwNumTreeNumber GetAttrListRestartValue() const
virtual sal_Int32 Len() const override
bool IsCountedInList() const
SwNumRule * GetNumRule(bool bInParent=true) const
Returns numbering rule of this text node.
bool HasNumber(SwRootFrame const *pLayout=nullptr) const
Returns if this text node has a number.
int GetActualListLevel(SwListRedlineType eRedline=SwListRedlineType::SHOW) const
Returns the actual list level of this text node, when it is a list item.
bool HasAttrListRestartValue() const
bool IsListRestart() const
int GetAttrOutlineLevel() const
Returns outline level of this text node.
const SwNodes & GetNodes() const
rtl::Reference< SwDoc > mxDoc
The document; never 0.
SwRootFrame * GetLayout() const
std::vector< Value >::difference_type difference_type
const_iterator begin() const
std::vector< Value >::const_iterator const_iterator
size_type erase(const Value &x)
const_iterator end() const
std::vector< Value >::size_type size_type
std::pair< const_iterator, bool > insert(Value &&x)
const_iterator lower_bound(const Value &x) const
ring_container GetRingContainer()
static bool lcl_IsOutlineMoveAndCopyable(SwEditShell const &rShell, SwOutlineNodes::size_type const nIdx, bool const bCopy)
Test whether outline may be moved (bCopy == false) or copied (bCopy == true) Verify these conditions:...
SwPosition GetParaPropsPos(SwRootFrame const &rLayout, SwPosition const &rPos)
std::pair< SwTextNode *, SwTextNode * > GetFirstAndLastNode(SwRootFrame const &rLayout, SwNode const &rPos)
bool IsParaPropsNode(SwRootFrame const &rLayout, SwTextNode const &rNode)
SwTextNode * GetParaPropsNode(SwRootFrame const &rLayout, SwNode const &rNode)
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
bool GoInNode(SwPaM &rPam, SwMoveFnCollection const &fnMove)
SwContentNode * GetNode(SwPaM &rPam, bool &rbFirst, SwMoveFnCollection const &fnMove, bool const bInReadOnly, SwRootFrame const *const i_pLayout)
This function returns the next node in direction of search.
SwMoveFnCollection const & fnMoveBackward
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
constexpr sal_uInt8 MAXLEVEL