45 #include <strings.hrc>
53 #include <osl/diagnose.h>
62 void lcl_ResetIndentAttrs(
SwDoc *pDoc,
const SwPaM &rPam, sal_uInt16 marker,
76 pDoc->
ResetAttrs( aPam,
false, aResetAttrsArray,
true, pLayout );
80 pDoc->
ResetAttrs( rPam,
false, aResetAttrsArray,
true, pLayout );
84 void ExpandPamForParaPropsNodes(
SwPaM& rPam,
SwRootFrame const*
const pLayout)
108 if( nCurLvl + 1 >= nLevel )
109 nCurLvl -= nLevel - 1;
113 return static_cast<sal_uInt8>((nMask - 1) & ~(( 1 << nCurLvl ) - 1));
124 std::make_unique<SwUndoOutlineEdit>(*
mpOutlineRule, rRule, *
this));
129 (*mpOutlineRule) = rRule;
152 pTextNd->NumRuleChgd();
155 if ( pTextNd->GetTextColl()->IsAssignedToListLevelOfOutlineStyle() &&
156 pTextNd->GetAttrListLevel() != pTextNd->GetTextColl()->GetAssignedOutlineStyleLevel() )
158 pTextNd->SetAttrListLevel( pTextNd->GetTextColl()->GetAssignedOutlineStyleLevel() );
188 if(pColl->IsAssignedToListLevelOfOutlineStyle())
191 const SwNumRuleItem & rCollRuleItem = pColl->GetNumRule(
false );
193 if ( rCollRuleItem.
GetValue().isEmpty() )
196 pColl->SetFormatAttr(aNumItem);
206 if(
GetNodes().GetOutLineNds().empty() || !nOffset )
210 SwPaM aPam(rPam,
nullptr);
211 ExpandPamForParaPropsNodes(aPam, pLayout);
217 if( !rOutlNds.
Seek_Entry( pSttNd, &nSttPos ) &&
236 if (pTextFormatColl->IsAssignedToListLevelOfOutlineStyle())
238 const int nLevel = pTextFormatColl->GetAssignedOutlineStyleLevel();
239 aCollArr[ nLevel ] = pTextFormatColl;
248 if (aCollArr[n] !=
nullptr)
256 if (aCollArr[n] !=
nullptr)
268 aCollArr[n] = aTmpColl;
277 if (aCollArr[n] !=
nullptr)
285 if (aCollArr[n] !=
nullptr)
297 aCollArr[n] = aTmpColl;
340 if (aCollArr[n] !=
nullptr)
345 while (nCount > 0 && m + nStep >= 0 && m + nStep < MAXLEVEL)
349 if (aCollArr[m] !=
nullptr)
365 bool bMoveApplicable =
true;
366 for (
auto i = nSttPos;
i < nEndPos; ++
i)
368 SwTextNode* pTextNd = rOutlNds[
i ]->GetTextNode();
378 if (aMoveArr[nLevel] == -1)
379 bMoveApplicable =
false;
387 if ( nNewOutlineLevel < 1 || nNewOutlineLevel > MAXLEVEL )
389 bMoveApplicable =
false;
394 if (! bMoveApplicable )
401 std::make_unique<SwUndoOutlineLeftRight>(aPam, nOffset) );
405 for (
auto i = nSttPos;
i < nEndPos; ++
i)
407 SwTextNode* pTextNd = rOutlNds[
i ]->GetTextNode();
418 OSL_ENSURE(aMoveArr[nLevel] >= 0,
419 "move table: current TextColl not found when building table!");
421 if (nLevel < MAXLEVEL && aMoveArr[nLevel] >= 0)
423 pColl = aCollArr[ aMoveArr[nLevel] ];
425 if (pColl !=
nullptr)
433 if( 0 <= nLevel && nLevel <= MAXLEVEL)
455 & rEnd = *rPam.
End();
456 if(
GetNodes().GetOutLineNds().empty() || !nOffset ||
467 SwNode* pSrch = &aSttRg.GetNode();
472 if( !
GetNodes().GetOutLineNds().Seek_Entry( pSrch, &nCurrentPos ) )
478 else if( 0 > nOffset )
489 if(
GetNodes().GetOutLineNds().Seek_Entry( pEndSrch, &nTmpPos ) )
491 if( !pEndSrch->
IsTextNode() || pEndSrch == pSrch ||
500 nCurrentPos = nTmpPos;
501 if( aEndRg == aSttRg )
503 OSL_FAIL(
"Moving outlines: Surprising selection" );
514 while( aSttRg.GetNode().IsStartNode() )
530 if( pNd->
GetIndex() >= aSttRg.GetIndex() )
539 else if( nCurrentPos + nOffset >=
GetNodes().GetOutLineNds().
size() )
573 if( pNd->
GetIndex() >= aSttRg.GetIndex() )
587 OSL_ENSURE( aSttRg.GetIndex() > nNewPos || nNewPos >= aEndRg.
GetIndex(),
588 "Position lies within Move range" );
601 SwRootFrame const*
const pLayout,
const OUString& rName,
bool const bExact)
605 for(
auto pOutlNd : rOutlNds )
609 if (sText.startsWith(rName))
611 if (sText.getLength() == rName.getLength())
615 pExactButDeleted = pTextNd;
623 if (!bExact && !pSavedNode
627 pSavedNode = pTextNd;
632 return bExact ? pExactButDeleted : pSavedNode;
648 memset( nLevelVal, 0,
MAXLEVEL *
sizeof( nLevelVal[0] ));
650 std::u16string_view
sName( rName );
655 for(
size_t n = 0;
n < sNum.size(); ++
n )
658 if(
'0' <= c && c <=
'9' )
670 nLevelVal[ nLevel++ ] = nVal;
672 sName = sName.substr( nPos );
685 if( rOutlNds.
empty() )
689 for(
auto pOutlNd : rOutlNds )
703 nLevel = std::min<int>(nLevel,
MAXLEVEL);
704 for(
int n = 0;
n < nLevel; ++
n )
706 if ( aLevelVal[
n] != nLevelVal[
n] )
722 "<lcl_FindOutlineNum(..)> - text node with outline level and numbering rule, but without numbering tree node. This is a serious defect" );
739 if( !rName.isEmpty() )
744 OUString
sName( rName );
752 while(!sExpandedText.isEmpty())
755 std::u16string_view sTempNum =
o3tl::getToken(sExpandedText, 0,
'.', nPos);
756 if( sTempNum.empty() || -1 == nPos ||
759 sExpandedText = sExpandedText.copy(nPos);
762 if( sExpandedText != sName )
788 if ( sName != rName )
808 sal_uInt16 nChgFormatLevel = 0;
809 sal_uInt16 nMask = 1;
815 if ( rOldFormat != rNewFormat )
817 nChgFormatLevel |= nMask;
820 && 1 < rNewFormat.GetIncludeUpperLevels()
821 && 0 != ( nChgFormatLevel &
GetUpperLvlChg(
n, rNewFormat.GetIncludeUpperLevels(), nMask ) ) )
823 nChgFormatLevel |= nMask;
827 if( !nChgFormatLevel )
833 if ( bInvalidateNumRule )
846 nLvl =
static_cast<sal_uInt8>(pTextNd->GetActualListLevel());
848 if( nLvl < MAXLEVEL )
850 if( nChgFormatLevel & ( 1 << nLvl ))
852 pTextNd->NumRuleChgd();
858 if ( nChgFormatLevel & ( 1 <<
n ) )
870 const bool bCreateNewList,
872 const OUString& sContinuedListId,
874 const bool bResetIndentAttrs )
878 SwPaM aPam(rPam,
nullptr);
879 ExpandPamForParaPropsNodes(aPam, pLayout);
891 bool bNewNumRuleCreated =
false;
892 if ( pNewOrChangedNumRule ==
nullptr )
896 bNewNumRuleCreated =
true;
898 else if ( rRule != *pNewOrChangedNumRule )
914 if ( bCreateNewList )
916 if ( bNewNumRuleCreated )
925 OSL_ENSURE( pNewList,
926 "<SwDoc::SetNumRule(..)> - could not create new list. Serious defect." );
930 else if ( !sContinuedListId.isEmpty() )
933 sListId = sContinuedListId;
935 if (!sListId.isEmpty())
947 if ( pTextNd !=
nullptr )
968 if ( pCollRule && pCollRule->
GetName() == pNewOrChangedNumRule->
GetName() )
985 if ( bResetIndentAttrs
988 ::lcl_ResetIndentAttrs(
this, aPam,
RES_LR_SPACE, pLayout);
1029 std::make_unique<SwUndoNumRuleStart>(rPos, bFlag) );
1051 std::make_unique<SwUndoNumRuleStart>(rPos, nStt) );
1064 if (nPos == USHRT_MAX)
1069 OSL_FAIL(
"<SwDoc::DelNumRule(..)> - No deletion of outline list style. This is serious defect" );
1078 std::make_unique<SwUndoNumruleDelete>(*(*
mpNumRuleTable)[nPos], *
this));
1083 SfxHintId::StyleSheetErased);
1089 const OUString aTmpName( rName );
1090 delete (*mpNumRuleTable)[ nPos ];
1127 bool bResult =
false;
1135 std::make_unique<SwUndoNumruleRename>(rOldName, rNewName, *
this));
1147 pTextNd->SetAttr(aItem);
1154 SfxHintId::StyleSheetModified);
1170 if (pFrame->HasAnimation() &&
1171 (!pFrame->GetMergedPara() || pFrame->GetMergedPara()->pParaPropsNode == pTNd))
1173 pFrame->StopAnimation( pOut );
1180 const OUString& rOldRule,
const OUString& rNewRule )
1184 if( !pOldRule || !pNewRule || pOldRule == pNewRule )
1198 if ( !aTextNodeList.empty() )
1206 if ( pGivenTextNode &&
1207 pGivenTextNode->GetListId() == pTextNd->GetListId() )
1209 aRegH.RegisterInModify( pTextNd, *pTextNd );
1211 pTextNd->SetAttr( aRule );
1212 pTextNd->NumRuleChgd();
1222 struct ListStyleData
1225 bool bCreateNewList;
1229 : pReplaceNumRule( nullptr ),
1230 bCreateNewList(
false )
1237 OSL_ENSURE( &rPaM.
GetDoc() ==
this,
"need same doc" );
1239 std::map<SwNumRule *, ListStyleData> aMyNumRuleMap;
1255 ListStyleData aListStyleData = aMyNumRuleMap[pRule];
1257 if ( aListStyleData.pReplaceNumRule ==
nullptr )
1262 aListStyleData.pReplaceNumRule =
1266 aListStyleData.sListId,
nullptr, true ));
1269 if ( aListStyleData.pReplaceNumRule ==
nullptr )
1271 aListStyleData.pReplaceNumRule =
new SwNumRule(*pRule);
1273 aListStyleData.bCreateNewList =
true;
1276 aMyNumRuleMap[pRule] = aListStyleData;
1282 *aListStyleData.pReplaceNumRule,
1283 aListStyleData.bCreateNewList,
1285 aListStyleData.sListId );
1286 if ( aListStyleData.bCreateNewList )
1288 aListStyleData.bCreateNewList =
false;
1289 aListStyleData.sListId = pCNd->
GetListId();
1290 aMyNumRuleMap[pRule] = aListStyleData;
1324 SwPaM aPam(rPam,
nullptr);
1325 ExpandPamForParaPropsNodes(aPam, pLayout);
1341 const SwNode* pOutlNd =
nullptr;
1342 for( ; nStt <= nEnd; ++nStt )
1345 if (pLayout && pTNd)
1350 if ( pTNd && pNumRuleOfTextNode )
1353 aRegH.RegisterInModify( pTNd, *pTNd );
1377 else if( !pOutlNd &&
1378 static_cast<SwTextFormatColl*>(pTNd->
GetFormatColl())->IsAssignedToListLevelOfOutlineStyle() )
1403 "<lcl_IsNumOk(..)> - misusage of method" );
1407 if( bOverUpper ? nSrchNum == nNumber : nSrchNum >= nNumber )
1409 else if( nNumber > rLower )
1411 else if( nNumber < rUpper )
1519 bool bError =
false;
1544 sal_uInt8 nLower = nSrchNum, nUpper = nSrchNum;
1568 if( ::
lcl_IsNumOk( nSrchNum, nLower, nUpper, bOverUpper,
1591 if( !bRet && !bOverUpper && pLast )
1624 const bool bForward,
1626 const bool bOutline,
1627 int nNonEmptyAllowed,
1630 const bool bInvestigateStartNode)
1638 SwNode * pStartFromNode = pTextNd;
1645 const SwNode * pNode =
nullptr;
1648 if ( !bInvestigateStartNode )
1674 else if (pTextNd->
Len() > 0 ||
nullptr != pTextNd->
GetNumRule())
1676 if (nNonEmptyAllowed == 0)
1681 if (nNonEmptyAllowed < 0)
1682 nNonEmptyAllowed = -1;
1686 if ( bInvestigateStartNode )
1696 while (pNode !=
GetNodes().DocumentSectionStartNode(pStartFromNode) &&
1697 pNode !=
GetNodes().DocumentSectionEndNode(pStartFromNode));
1711 SwPaM aPam(rPam,
nullptr);
1712 ExpandPamForParaPropsNodes(aPam, pLayout);
1717 bool bOnlyOutline =
true;
1718 bool bOnlyNonOutline =
true;
1734 bOnlyNonOutline =
false;
1736 bOnlyOutline =
false;
1746 else if (bOnlyNonOutline)
1770 if( (-1 == nDiff && 0 >= nLevel) ||
1771 (1 == nDiff &&
MAXLEVEL - 1 <= nLevel))
1782 std::make_unique<SwUndoNumUpDown>(aPam, nDiff) );
1807 nLevel = nLevel + nDiff;
1834 if (pLay->HasMergedParas())
1841 std::pair<SwTextNode *, SwTextNode *> nodes(
1845 assert(nodes.second);
1865 assert(nodes.first);
1894 for ( ; ; ++nOffset)
1897 if (pNode->IsTextNode())
1900 assert(nodes.first && nodes.second);
1901 nOffset += nodes.second->GetIndex() - pNode->GetIndex();
1918 for ( ; ; --nOffset)
1921 if (pNode->IsTextNode())
1924 assert(nodes.first && nodes.second);
1925 nOffset -= pNode->GetIndex() - nodes.first->GetIndex();
1937 bool const bIsOutlMv,
SwRootFrame const*
const pLayout)
1984 nInEndIdx = nEndIdx;
1991 if(
abs( nOffset ) > nStIdx)
1994 nInEndIdx = nStIdx - 1;
1997 nInStIdx = nInEndIdx + 1;
2010 pTmp1 =
GetNodes()[ nStIdx ]->StartOfSectionNode();
2011 pTmp2 =
GetNodes()[ nInStIdx ]->StartOfSectionNode();
2012 if( pTmp1 != pTmp2 )
2032 if( pTmp1 != pTmp2 )
2042 SwPosition aStPos( *pStt ), aEndPos( *pEnd );
2043 aStPos.nContent = 0;
2046 bool bCheckDel =
true;
2052 if( !bCheckDel || RedlineType::Delete == pTmp->
GetType() )
2107 (pEnd->nNode < pREnd->nNode ||
2108 (pEnd->nNode == pREnd->nNode &&
2109 pCEndNd ? pREnd->nContent.
GetIndex() == pCEndNd->
Len()
2110 : !pREnd->nContent.GetIndex() )) )
2116 if( *pTmp->
Start() == *pREnd )
2122 ( pRStt->
nNode > aIdx || aIdx > pREnd->nNode ||
2143 SwPaM& rOrigPam(rPam);
2161 SwPaM aInsPam(aInsPos);
2163 OSL_ENSURE(bMoved,
"No content node found!");
2182 bool bIsEmptyNode = pIsEmptyNode && pIsEmptyNode->
Len() == 0;
2199 if (*pRedline->
End() < *aPam.
Start())
2203 if (pRedline->
GetType() == RedlineType::Delete &&
2210 SwPaM pam(*pRedline,
nullptr);
2229 aIdx = aInsPos.
nNode;
2238 if( pPos->
nNode == aIdx )
2243 pPos = &pTmp->GetBound(
false);
2244 if( pPos->
nNode == aIdx )
2272 "sw.core",
"redlines will be moved in DeleteAndJoin");
2302 pOwnRedl = rTable[nRedlPosWithEmpty];
2311 if ( pEmptyNode && pEmptyNode->Len() == 0 )
2317 else if ( pEmptyNode0 && pEmptyNode0->Len() == 0 )
2330 if ( nRedlPosWithEmpty + 1 < rTable.
size() &&
2331 *rTable[nRedlPosWithEmpty + 1] < *rTable[nRedlPosWithEmpty] )
2333 rTable.
Remove(nRedlPosWithEmpty);
2358 nRedlEndNd = pREnd->nNode.GetIndex();
2361 std::unique_ptr<SwUndoMoveNum> pUndo;
2382 pUndo->SetStartNode( aIdx.
GetIndex() - nMoved );
2391 pRStt->
nNode = nRedlSttNd;
2394 if( pREnd->nNode.GetIndex() != nRedlEndNd )
2396 pREnd->nNode = nRedlEndNd;
2398 pREnd->nContent.Assign( pCNd, pCNd ? pCNd->
Len() : 0 );
2408 bool bResult =
false;
2411 if (pTextNd && pTextNd->
GetNumRule() !=
nullptr &&
2416 bool bOldNum = bDel;
2417 bool bNewNum = !bDel;
2427 std::make_unique<SwUndoNumOrNoNum>(rIdx, bOldNum, bNewNum));
2430 else if (bDel && pTextNd->
GetNumRule(
false) &&
2434 SwPaM aPam(*pTextNd);
2450 if ( pTNd !=
nullptr )
2483 pResult = (*mpNumRuleTable)[
n];
2497 OSL_ENSURE(
false,
"SwDoc::AddNumRule: table full.");
2519 if( pNew->
GetName() != rName )
2531 eDefaultNumberFormatPositionAndSpaceMode );
2541 std::make_unique<SwUndoNumruleCreate>(pNew, *
this));
2546 SfxHintId::StyleSheetCreated);
2557 OUString
newName =
"MailMergeNumRule"
2566 static bool bHack = (getenv(
"LIBO_ONEWAY_STABLE_ODF_EXPORT") !=
nullptr);
2570 static sal_Int64 nIdCounter = SAL_CONST_INT64(8000000000);
2571 aName = OUString::number(nIdCounter++);
2576 std::numeric_limits<unsigned int>::max()));
2577 aName = OUString::number(n);
2579 if( pChkStr && pChkStr->isEmpty() )
2582 else if( pChkStr && !pChkStr->isEmpty() )
2587 aName =
SwResId( STR_NUMRULE_DEFNAME );
2590 sal_uInt16 nNum(0), nTmp, nFlagSize = (
mpNumRuleTable->size() / 8 ) +2;
2591 std::unique_ptr<sal_uInt8[]> pSetFlags(
new sal_uInt8[ nFlagSize ]);
2592 memset( pSetFlags.get(), 0, nFlagSize );
2594 sal_Int32 nNmLen = aName.getLength();
2595 if( !bAutoNum && pChkStr )
2597 while( nNmLen-- &&
'0' <= aName[nNmLen] && aName[nNmLen] <=
'9' )
2600 if( ++nNmLen < aName.getLength() )
2602 aName = aName.copy(0, nNmLen );
2608 if(
nullptr != pNumRule )
2610 const OUString sNm = pNumRule->GetName();
2611 if( sNm.startsWith( aName ) )
2614 nNum = o3tl::narrowing<sal_uInt16>(
o3tl::toInt32(sNm.subView( nNmLen )));
2615 if( nNum-- && nNum < mpNumRuleTable->
size() )
2616 pSetFlags[ nNum / 8 ] |= (0x01 << ( nNum & 0x07 ));
2618 if( pChkStr && *pChkStr==sNm )
2625 nNum = mpNumRuleTable->size();
2626 for( sal_uInt16
n = 0;
n < nFlagSize; ++
n )
2628 nTmp = pSetFlags[
n ];
2642 if( pChkStr && !pChkStr->isEmpty() )
2644 return aName + OUString::number( ++nNum );
2650 for(
size_t n = 0;
n < rNmTable.
size(); ++
n )
2651 if( rNmTable[
n ]->IsInvalidRule() )
2652 rNmTable[
n ]->Validate(*
this);
2656 const int nListLevel,
2671 bool bResult =
false;
2674 if ( pTextNode !=
nullptr )
const SwEndNode * EndOfSectionNode() const
Starts a section of nodes in the document model.
Represents the visualization of a paragraph.
virtual sal_Int32 Len() const
void SetListRestart(bool bRestart)
bool IsInMailMerge() const
bool IsUsed(const sw::BroadcastingModify &) const
int GetAssignedOutlineStyleLevel() const
bool HasBullet() const
Returns if this text node has a bullet.
Represents the style of a paragraph.
void SaveOldNumRule(const SwNumRule &rOld)
Marks a position in the document model.
void UpdateFramesForAddDeleteRedline(SwDoc &rDoc, SwPaM const &rPam)
bool IsSectionNode() const
const SwNodeNum * GetNum(SwRootFrame const *pLayout=nullptr) const
SwComparePosition ComparePosition(const T &rStt1, const T &rEnd1, const T &rStt2, const T &rEnd2)
virtual void deleteListsByDefaultListStyle(const OUString &rListStyleName)=0
void SetAutoRule(bool bFlag)
virtual bool SetAttr(const SfxPoolItem &) override
overriding to handle change of certain paragraph attributes
virtual void createListForListStyle(const OUString &rListStyleName)=0
virtual AppendResult AppendRedline(SwRangeRedline *pNewRedl, bool bCallDelete)=0
Append a new redline.
const SwNumFormat * GetNumFormat(sal_uInt16 i) const
static bool lcl_IsValidPrevNextNumNode(const SwNodeIndex &rIdx)
bool isdigitAsciiString(std::string_view rString)
std::vector< SwNode * >::difference_type difference_type
void SetPoolHlpFileId(sal_uInt8 nId)
virtual sal_Int32 Len() const override
virtual void SetModified()=0
Must be called manually at changes of format.
virtual SwList * createList(const OUString &rListId, const OUString &rDefaultListStyleName)=0
constexpr TypedWhichId< SwNumRuleItem > RES_PARATR_NUMRULE(72)
Pos1 is as large as Pos2.
const SwPosition * GetMark() const
const OUString & GetDefaultListId() const
constexpr TypedWhichId< SfxInt16Item > RES_PARATR_LIST_RESTARTVALUE(85)
bool NumOrNoNum(const SwNodeIndex &rIdx, bool bDel=false)
Pos1 completely contained in Pos2.
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
bool MoveOutlinePara(const SwPaM &rPam, SwOutlineNodes::difference_type nOffset)
Outline - move up / move down.
void Remove(size_type nPos)
virtual SwUndoId EndUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Closes undo block.
OUString GetListId() const
constexpr sal_uInt8 MAXLEVEL
void SetContinusNum(bool bFlag)
SwSectionNode is derived from SwStartNode.
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
static SwContentNode * GoPrevious(SwNodeIndex *)
static SwTextNode * lcl_FindOutlineName(const SwOutlineNodes &rOutlNds, SwRootFrame const *const pLayout, const OUString &rName, bool const bExact)
void SetNumRuleStart(const SwPosition &rPos, bool bFlag=true)
OUString newName(std::u16string_view aNewPrefix, const OUString &aOldPrefix, std::u16string_view old_Name)
const OUString & GetName() const
OUString GetUniqueNumRuleName(const OUString *pChkStr=nullptr, bool bAutoNum=true) const
SwNumberTree::tNumberVector GetNumberVector() const
Returns level numbers of this node.
constexpr TypedWhichId< SwConditionTextFormatColl > RES_CONDTXTFMTCOLL(160)
SwPosition & GetBound(bool bOne=true)
Dialog to specify the properties of date form field.
IDocumentUndoRedo & GetIDocumentUndoRedo()
virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr, SwTextAttr **ppNewTextAttr=nullptr)=0
Insert an attribute.
bool NumUpDown(const SwPaM &, bool bDown, SwRootFrame const *pLayout=nullptr)
std::unordered_map< OUString, SwNumRule * > maNumRuleMap
SwNodeOffset abs(const SwNodeOffset &a)
void UpdateOutlineIdx(const SwNode &)
Update all OutlineNodes starting from Node.
IDocumentContentOperations const & getIDocumentContentOperations() const
bool HasNumber(SwRootFrame const *pLayout=nullptr) const
Returns if this text node has a number.
bool IsListRestart() const
The root element of a Writer document layout.
int GetActualListLevel() const
Returns the actual list level of this text node, when it is a list item.
int GetAttrOutlineLevel() const
Returns outline level of this text node.
constexpr TypedWhichId< SfxBoolItem > RES_PARATR_LIST_ISRESTART(84)
unsigned int uniform_uint_distribution(unsigned int a, unsigned int b)
const OUString & GetListId() const
SwContentNode * GetContentNode(bool bPoint=true) const
virtual void UpdateExpFields(SwTextField *pField, bool bUpdateRefFields)=0
OUString SwResId(TranslateId aId)
Pos1 end touches at Pos2 start.
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
bool IsOwnRedline(const SwRangeRedline &rRedl) const
bool IsAssignedToListLevelOfOutlineStyle() const
SwNodeType GetNodeType() const
constexpr TypedWhichId< SfxInt16Item > RES_PARATR_LIST_LEVEL(83)
static SwNumRule * GetNumRuleAtPos(SwPosition &rPos, SwRootFrame const *pLayout=nullptr)
void ResetAttrs(const SwPaM &rRg, bool bTextAttr=true, const o3tl::sorted_vector< sal_uInt16 > &rAttrs=o3tl::sorted_vector< sal_uInt16 >(), const bool bSendDataChangedEvents=true, SwRootFrame const *pLayout=nullptr)
Reset attributes.
bool NoNum(const SwPaM &)
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
check if target position is in fly anchored at source range
std::unique_ptr< SwNumRuleTable > mpNumRuleTable
static sal_uInt8 GetUpperLvlChg(sal_uInt8 nCurLvl, sal_uInt8 nLevel, sal_uInt16 nMask)
void PropagateOutlineRule()
Pos2 completely contained in Pos1.
void MarkListLevel(const int nListLevel, const bool bValue)
o3tl::sorted_vector< SwRootFrame * > GetAllLayouts()
SwNodeOffset GetIndex() const
void SetCountedInList(bool bCounted)
void GotoNextLayoutTextFrame(SwNodeIndex &rIndex, SwRootFrame const *const pLayout)
void ChkCondColl(const SwTextFormatColl *pColl=nullptr)
bool RenameNumRule(const OUString &aOldName, const OUString &aNewName, bool bBroadcast=false)
void SetNumRuleMap(std::unordered_map< OUString, SwNumRule * > *pNumRuleMap)
Register this rule in a "name->numrule" map.
bool MoveParagraph(SwPaM &, SwNodeOffset nOffset, bool bIsOutlMv=false)
Move selected paragraphs (not only numberings) according to offsets.
virtual bool DoesUndo() const =0
Is Undo enabled?
void SetPoolFormatId(sal_uInt16 nId)
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
bool IsContinusNum() const
static SwTextNode * lcl_FindOutlineNum(const SwOutlineNodes &rOutlNds, OUString &rName, SwRootFrame const *const pLayout)
void SetCounted(const SwPaM &, bool bCounted, SwRootFrame const *pLayout)
void DelNumRules(const SwPaM &, SwRootFrame const *pLayout=nullptr)
void SetNodeNumStart(const SwPosition &rPos, sal_uInt16 nStt)
bool IsContentNode() const
PaM is Point and Mark: a selection of the document model.
const SwAttrSet * GetpSwAttrSet() const
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
virtual SwRedlineTable::size_type GetRedlinePos(const SwNode &rNode, RedlineType nType) const =0
sal_uInt16 FindNumRule(std::u16string_view rName) const
std::unique_ptr< SwTextFormatColls > mpTextFormatCollTable
SwNumRule * FindNumRulePtr(const OUString &rName) const
virtual SwList * getListByName(const OUString &rListId) const =0
virtual void AppendUndo(std::unique_ptr< SwUndo > pUndo)=0
Add new Undo action.
void AddNumRule(SwNumRule *pRule)
Add numbering rule to document.
SwNodeIndex & Assign(SwNodes const &rNds, SwNodeOffset)
virtual SwUndoId StartUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Opens undo block.
void MakeUniqueNumRules(const SwPaM &rPaM)
void CheckCharFormats(SwDoc &rDoc)
Tests whether the CharFormats are from the given doc and copies them if appropriate.
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
static bool lcl_IsNumOk(sal_uInt8 nSrchNum, sal_uInt8 &rLower, sal_uInt8 &rUpper, bool bOverUpper, sal_uInt8 nNumber)
const SwStartNode * StartOfSectionNode() const
const SwPosition * GetPoint() const
virtual bool CopyRange(SwPaM &rPam, SwPosition &rPos, SwCopyFlags flags) const =0
Copy a selected content range to a position.
Pos1 start touches at Pos2 end.
SwIndex & Assign(SwIndexReg *, sal_Int32)
void SetAttrOutlineLevel(int nLevel)
Sets the out line level at a text node.
SwContentNode * GetContentNode()
SwNodeOffset GetIndex() const
vector_type::size_type size_type
const OUString & GetValue() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
static bool lcl_GotoNextPrevNum(SwPosition &rPos, bool bNext, bool bOverUpper, sal_uInt8 *pUpper, sal_uInt8 *pLower, SwRootFrame const *const pLayout)
virtual SwFormatColl * ChgFormatColl(SwFormatColl *) override
static OUString GetOutlineRuleName()
void SetRuleType(SwNumRuleType eNew)
SwNumRule * GetNumRule(bool bInParent=true) const
Returns numbering rule of this text node.
IDocumentState const & getIDocumentState() const
virtual void deleteListForListStyle(const OUString &rListStyleName)=0
SwNumRule * mpOutlineRule
void SetPoolHelpId(sal_uInt16 nId)
Marks a node in the document model.
const SwOutlineNodes & GetOutLineNds() const
Array of all OutlineNodes.
void GetTextNodeList(SwNumRule::tTextNodeList &rTextNodeList) const
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
SwStartNodeType GetStartNodeType() const
virtual bool MoveNodeRange(SwNodeRange &, SwNodeIndex &, SwMoveFlags)=0
const SwPosition * Start() const
void SetOutlineNumRule(const SwNumRule &rRule)
SwTextNode * GetParaPropsNode(SwRootFrame const &rLayout, SwNodeIndex const &rNode)
virtual const SwRangeRedline * GetRedline(const SwPosition &rPos, SwRedlineTable::size_type *pFndPos) const =0
std::vector< tSwNumTreeNumber > tNumberVector
void CorrRel(const SwNodeIndex &rOldNode, const SwPosition &rNewPos, const sal_Int32 nOffset=0, bool bMoveCursor=false)
const SwNumFormat & Get(sal_uInt16 i) const
SwTextNode is a paragraph in the document model.
virtual bool SplitRedline(const SwPaM &rPam)=0
void SetAttrListLevel(int nLevel)
Sets the list level of this text node.
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
void Set(sal_uInt16 i, const SwNumFormat *)
void SetInvalidRule(bool bFlag)
OUString GetExpandText(SwRootFrame const *pLayout, const sal_Int32 nIdx=0, const sal_Int32 nLen=-1, const bool bWithNum=false, const bool bAddSpaceAfterListLabelStr=false, const bool bWithSpacesForLevel=false, const ExpandMode eAdditionalMode=ExpandMode::ExpandFootnote) const
add 4th optional parameter indicating, when that a spa...
bool GotoOutline(SwPosition &rPos, const OUString &rName, SwRootFrame const *=nullptr) const
void StopNumRuleAnimations(const OutputDevice *)
#define SAL_WARN_IF(condition, area, stream)
static void lcl_ChgNumRule(SwDoc &rDoc, const SwNumRule &rRule)
SwNumberTree::tSwNumTreeNumber GetAttrListRestartValue() const
void SetDefaultListId(const OUString &sDefaultListId)
Pos1 overlaps Pos2 at the end.
const SwNodes & GetNodes() const
void MarkListLevel(const OUString &sListId, const int nListLevel, const bool bValue)
Marks/Unmarks a list level of a certain list.
void ReplaceNumRule(const SwPosition &rPos, const OUString &rOldRule, const OUString &rNewRule)
const SwNumRuleTable & GetNumRuleTable() const
virtual void SetRedlineFlags(RedlineFlags eMode)=0
Set a new redline mode.
sal_Int32 GetIndex() const
OString DateTimeToOString(const DateTime &rDateTime)
bool IsCountedInList() const
constexpr TypedWhichId< SfxBoolItem > RES_PARATR_LIST_ISCOUNTED(86)
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
const SwPosition * End() const
RedlineType GetType(sal_uInt16 nPos=0) const
static bool GotoNextNum(SwPosition &, SwRootFrame const *pLayout, bool bOverUpper=true, sal_uInt8 *pUpper=nullptr, sal_uInt8 *pLower=nullptr)
sal_uInt16 MakeNumRule(const OUString &rName, const SwNumRule *pCpy=nullptr, bool bBroadcast=false, const SvxNumberFormat::SvxNumPositionAndSpaceMode eDefaultNumberFormatPositionAndSpaceMode=SvxNumberFormat::LABEL_WIDTH_AND_POSITION)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
bool IsFirstOfNumRule(SwRootFrame const &rLayout) const
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
bool IsParaPropsNode(SwRootFrame const &rLayout, SwTextNode const &rNode)
virtual SwContentNode * JoinNext()
static bool IsFirstOfNumRuleAtPos(const SwPosition &rPos, SwRootFrame const &rLayout)
static bool GotoPrevNum(SwPosition &, SwRootFrame const *pLayout, bool bOverUpper=true)
std::vector< SwTextNode * > tTextNodeList
virtual bool AppendTextNode(SwPosition &rPos)=0
SwMoveFnCollection const & fnMoveBackward
SwTableNode * FindTableNode()
Search table node, in which it is.
SwNodeOffset Count() const
void GotoPrevLayoutTextFrame(SwNodeIndex &rIndex, SwRootFrame const *const pLayout)
virtual bool SplitNode(const SwPosition &rPos, bool bChkTableStart)=0
Split a node at rPos (implemented only for TextNode).
SwFootnoteIdxs & GetFootnoteIdxs()
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
SwFormatColl * GetFormatColl() const
bool HasMergedParas() const
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
bool DelNumRule(const OUString &rName, bool bBroadCast=false)
bool Seek_Entry(SwNode *rP, size_type *pnPos) const
void InvalidateNumRules()
void SetName(const OUString &rNm, IDocumentListsAccess &rDocListAccess)
virtual const SwRedlineTable & GetRedlineTable() const =0
bool Insert(SwRangeRedline *&p)
virtual bool ResetAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0) override
std::vector< SwNode * >::size_type size_type
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.
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 AddNode(const SwTextNode &rNd)
SwNode & GetEndOfExtras() const
This is the last EndNode of a special section.
bool HasAttrListRestartValue() const
IDocumentListsAccess const & getIDocumentListsAccess() const
static constexpr size_type npos
bool MoveParagraphImpl(SwPaM &, SwNodeOffset nOffset, bool bIsOutlMv, SwRootFrame const *)
Merge GetRedlineMergeFlag() const
bool OutlineUpDown(const SwPaM &rPam, short nOffset, SwRootFrame const *pLayout=nullptr)
const SwFootnoteInfo & GetFootnoteInfo() const
void SetAttrListRestartValue(SwNumberTree::tSwNumTreeNumber nNum)
Pos1 overlaps Pos2 at the beginning.
bool IsOutlineRule() const
void BroadcastStyleOperation(const OUString &rName, SfxStyleFamily eFamily, SfxHintId nOp)
constexpr TypedWhichId< SfxStringItem > RES_PARATR_LIST_ID(RES_PARATR_LIST_BEGIN)
std::pair< SwTextNode *, SwTextNode * > GetFirstAndLastNode(SwRootFrame const &rLayout, SwNodeIndex const &rPos)
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwNumRule * GetOutlineNumRule() const
void ChgNumRuleFormats(const SwNumRule &rRule)
bool m_bDetectedRangeSegmentation false
Base class of the Writer document model elements.
SwTextFormatColl * GetTextColl() const