53#include <osl/diagnose.h>
62 void lcl_ResetIndentAttrs(
SwDoc *pDoc,
const SwPaM &rPam,
74 pDoc->
ResetAttrs( aPam,
false, aResetAttrsArray,
true, pLayout );
78 pDoc->
ResetAttrs( rPam,
false, aResetAttrsArray,
true, pLayout );
82 void ExpandPamForParaPropsNodes(
SwPaM& rPam,
SwRootFrame const*
const pLayout)
104 if( nCurLvl + 1 >= nLevel )
105 nCurLvl -= nLevel - 1;
109 return static_cast<sal_uInt8>((nMask - 1) & ~(( 1 << nCurLvl ) - 1));
120 std::make_unique<SwUndoOutlineEdit>(*
mpOutlineRule, rRule, *
this));
125 (*mpOutlineRule) = rRule;
148 pTextNd->NumRuleChgd();
151 if ( pTextNd->GetTextColl()->IsAssignedToListLevelOfOutlineStyle() &&
152 pTextNd->GetAttrListLevel() != pTextNd->GetTextColl()->GetAssignedOutlineStyleLevel() )
154 pTextNd->SetAttrListLevel( pTextNd->GetTextColl()->GetAssignedOutlineStyleLevel() );
184 if(pColl->IsAssignedToListLevelOfOutlineStyle())
187 const SwNumRuleItem & rCollRuleItem = pColl->GetNumRule(
false );
189 if ( rCollRuleItem.
GetValue().isEmpty() )
192 pColl->SetFormatAttr(aNumItem);
202 if(
GetNodes().GetOutLineNds().empty() || !nOffset )
206 SwPaM aPam(rPam,
nullptr);
207 ExpandPamForParaPropsNodes(aPam, pLayout);
213 if( !rOutlNds.
Seek_Entry( pSttNd, &nSttPos ) &&
232 if (pTextFormatColl->IsAssignedToListLevelOfOutlineStyle())
234 const int nLevel = pTextFormatColl->GetAssignedOutlineStyleLevel();
235 aCollArr[ nLevel ] = pTextFormatColl;
244 if (aCollArr[
n] !=
nullptr)
252 if (aCollArr[
n] !=
nullptr)
264 aCollArr[
n] = aTmpColl;
273 if (aCollArr[
n] !=
nullptr)
281 if (aCollArr[
n] !=
nullptr)
293 aCollArr[
n] = aTmpColl;
336 if (aCollArr[
n] !=
nullptr)
345 if (aCollArr[
m] !=
nullptr)
361 bool bMoveApplicable =
true;
362 for (
auto i = nSttPos;
i < nEndPos; ++
i)
364 SwTextNode* pTextNd = rOutlNds[
i ]->GetTextNode();
374 if (aMoveArr[nLevel] == -1)
375 bMoveApplicable =
false;
383 if ( nNewOutlineLevel < 1 || nNewOutlineLevel >
MAXLEVEL )
385 bMoveApplicable =
false;
390 if (! bMoveApplicable )
397 std::make_unique<SwUndoOutlineLeftRight>(aPam, nOffset) );
401 for (
auto i = nSttPos;
i < nEndPos; ++
i)
403 SwTextNode* pTextNd = rOutlNds[
i ]->GetTextNode();
414 OSL_ENSURE(aMoveArr[nLevel] >= 0,
415 "move table: current TextColl not found when building table!");
417 if (nLevel <
MAXLEVEL && aMoveArr[nLevel] >= 0)
419 pColl = aCollArr[ aMoveArr[nLevel] ];
421 if (pColl !=
nullptr)
429 if( 0 <= nLevel && nLevel <=
MAXLEVEL)
451 & rEnd = *rPam.
End();
452 if(
GetNodes().GetOutLineNds().empty() || !nOffset ||
454 (rEnd.GetNodeIndex() <
GetNodes().GetEndOfExtras().GetIndex()))
463 SwNode* pSrch = &aSttRg.GetNode();
474 else if( 0 > nOffset )
485 if(
GetNodes().GetOutLineNds().Seek_Entry( pEndSrch, &nTmpPos ) )
487 if( !pEndSrch->
IsTextNode() || pEndSrch == pSrch ||
488 nOutLineLevel < pEndSrch->GetTextNode()->GetAttrOutlineLevel()-1 )
496 nCurrentPos = nTmpPos;
497 if( aEndRg == aSttRg )
499 OSL_FAIL(
"Moving outlines: Surprising selection" );
510 while( aSttRg.GetNode().IsStartNode() )
526 if( pNd->
GetIndex() >= aSttRg.GetIndex() )
535 else if( nCurrentPos + nOffset >=
GetNodes().GetOutLineNds().
size() )
569 if( pNd->
GetIndex() >= aSttRg.GetIndex() )
583 OSL_ENSURE( aSttRg.GetIndex() > nNewPos || nNewPos >= aEndRg.
GetIndex(),
584 "Position lies within Move range" );
597 SwRootFrame const*
const pLayout, std::u16string_view aName,
bool const bExact)
601 for(
auto pOutlNd : rOutlNds )
605 if (sText.startsWith(
aName))
607 if (sText.getLength() == sal_Int32(
aName.size()))
611 pExactButDeleted = pTextNd;
619 if (!bExact && !pSavedNode
623 pSavedNode = pTextNd;
628 return bExact ? pExactButDeleted : pSavedNode;
644 memset( nLevelVal, 0,
MAXLEVEL *
sizeof( nLevelVal[0] ));
646 std::u16string_view
sName( rName );
651 for(
size_t n = 0;
n < sNum.size(); ++
n )
654 if(
'0' <= c && c <=
'9' )
666 nLevelVal[ nLevel++ ] = nVal;
681 if( rOutlNds.
empty() )
685 for(
auto pOutlNd : rOutlNds )
699 nLevel = std::min<int>(nLevel,
MAXLEVEL);
700 for(
int n = 0;
n < nLevel; ++
n )
702 if ( aLevelVal[
n] != nLevelVal[
n] )
718 "<lcl_FindOutlineNum(..)> - text node with outline level and numbering rule, but without numbering tree node. This is a serious defect" );
735 if( !rName.isEmpty() )
740 OUString
sName( rName );
748 while(!sExpandedText.isEmpty())
752 if( sTempNum.empty() || -1 ==
nPos ||
755 sExpandedText = sExpandedText.copy(
nPos);
758 if( sExpandedText !=
sName )
782 if (
sName != rName )
801 sal_uInt16 nChgFormatLevel = 0;
802 sal_uInt16 nMask = 1;
808 if ( rOldFormat != rNewFormat )
810 nChgFormatLevel |= nMask;
813 && 1 < rNewFormat.GetIncludeUpperLevels()
814 && 0 != ( nChgFormatLevel &
GetUpperLvlChg(
n, rNewFormat.GetIncludeUpperLevels(), nMask ) ) )
816 nChgFormatLevel |= nMask;
820 if( !nChgFormatLevel )
826 if ( bInvalidateNumRule )
839 nLvl =
static_cast<sal_uInt8>(pTextNd->GetActualListLevel());
843 if( nChgFormatLevel & ( 1 << nLvl ))
845 pTextNd->NumRuleChgd();
851 if ( nChgFormatLevel & ( 1 <<
n ) )
863 const bool bCreateNewList,
865 const OUString& sContinuedListId,
867 const bool bResetIndentAttrs )
871 SwPaM aPam(rPam,
nullptr);
872 ExpandPamForParaPropsNodes(aPam, pLayout);
884 bool bNewNumRuleCreated =
false;
885 if ( pNewOrChangedNumRule ==
nullptr )
889 bNewNumRuleCreated =
true;
891 else if ( rRule != *pNewOrChangedNumRule )
907 if ( bCreateNewList )
909 if ( bNewNumRuleCreated )
918 OSL_ENSURE( pNewList,
919 "<SwDoc::SetNumRule(..)> - could not create new list. Serious defect." );
923 else if ( !sContinuedListId.isEmpty() )
926 sListId = sContinuedListId;
928 if (!sListId.isEmpty())
940 if ( pTextNd !=
nullptr )
961 if ( pCollRule && pCollRule->
GetName() == pNewOrChangedNumRule->
GetName() )
978 if ( bResetIndentAttrs
982 ::lcl_ResetIndentAttrs(
this, aPam, attrs, pLayout);
1001 ::lcl_ResetIndentAttrs(
this, rPam, attrs, pLayout);
1024 std::make_unique<SwUndoNumRuleStart>(rPos, bFlag) );
1046 std::make_unique<SwUndoNumRuleStart>(rPos, nStt) );
1059 if (
nPos == USHRT_MAX)
1064 OSL_FAIL(
"<SwDoc::DelNumRule(..)> - No deletion of outline list style. This is serious defect" );
1078 SfxHintId::StyleSheetErased);
1084 const OUString aTmpName( rName );
1085 delete (*mpNumRuleTable)[
nPos ];
1122 bool bResult =
false;
1130 std::make_unique<SwUndoNumruleRename>(rOldName, rNewName, *
this));
1142 pTextNd->SetAttr(aItem);
1149 SfxHintId::StyleSheetModified);
1165 if (pFrame->HasAnimation() &&
1166 (!pFrame->GetMergedPara() || pFrame->GetMergedPara()->pParaPropsNode == pTNd))
1168 pFrame->StopAnimation(
pOut );
1175 const OUString& rOldRule,
const OUString& rNewRule )
1179 if( !pOldRule || !pNewRule || pOldRule == pNewRule )
1193 if ( !aTextNodeList.empty() )
1201 if ( pGivenTextNode &&
1202 pGivenTextNode->
GetListId() == pTextNd->GetListId() )
1206 pTextNd->SetAttr( aRule );
1207 pTextNd->NumRuleChgd();
1217 struct ListStyleData
1220 bool bCreateNewList;
1224 : pReplaceNumRule( nullptr ),
1225 bCreateNewList( false )
1232 OSL_ENSURE( &rPaM.
GetDoc() ==
this,
"need same doc" );
1234 std::map<SwNumRule *, ListStyleData> aMyNumRuleMap;
1250 ListStyleData aListStyleData = aMyNumRuleMap[pRule];
1252 if ( aListStyleData.pReplaceNumRule ==
nullptr )
1257 aListStyleData.pReplaceNumRule =
1261 aListStyleData.sListId,
nullptr,
true ));
1264 if ( aListStyleData.pReplaceNumRule ==
nullptr )
1266 aListStyleData.pReplaceNumRule =
new SwNumRule(*pRule);
1268 aListStyleData.bCreateNewList =
true;
1271 aMyNumRuleMap[pRule] = aListStyleData;
1277 *aListStyleData.pReplaceNumRule,
1278 aListStyleData.bCreateNewList,
1280 aListStyleData.sListId );
1281 if ( aListStyleData.bCreateNewList )
1283 aListStyleData.bCreateNewList =
false;
1284 aListStyleData.sListId = pCNd->
GetListId();
1285 aMyNumRuleMap[pRule] = aListStyleData;
1318 SwPaM aPam(rPam,
nullptr);
1319 ExpandPamForParaPropsNodes(aPam, pLayout);
1335 const SwNode* pOutlNd =
nullptr;
1336 for( ; nStt <= nEnd; ++nStt )
1339 if (pLayout && pTNd)
1344 if ( pTNd && pNumRuleOfTextNode )
1371 else if( !pOutlNd &&
1397 "<lcl_IsNumOk(..)> - misusage of method" );
1401 if( bOverUpper ? nSrchNum == nNumber : nSrchNum >= nNumber )
1403 else if( nNumber > rLower )
1405 else if( nNumber < rUpper )
1451 rIndex = pMerged->pFirstNode->
GetIndex();
1485 rIndex = pMerged->pLastNode->
GetIndex();
1524 bool bError =
false;
1549 sal_uInt8 nLower = nSrchNum, nUpper = nSrchNum;
1595 if( !bRet && !bOverUpper && pLast )
1621 const bool bForward,
1623 const bool bOutline,
1624 int nNonEmptyAllowed,
1627 const bool bInvestigateStartNode)
1635 SwNode * pStartFromNode = pTextNd;
1642 const SwNode * pNode =
nullptr;
1645 if ( !bInvestigateStartNode )
1671 else if (pTextNd->
Len() > 0 ||
nullptr != pTextNd->
GetNumRule())
1673 if (nNonEmptyAllowed == 0)
1678 if (nNonEmptyAllowed < 0)
1679 nNonEmptyAllowed = -1;
1683 if ( bInvestigateStartNode )
1693 while (pNode !=
GetNodes().DocumentSectionStartNode(pStartFromNode) &&
1694 pNode !=
GetNodes().DocumentSectionEndNode(pStartFromNode));
1708 SwPaM aPam(rPam,
nullptr);
1709 ExpandPamForParaPropsNodes(aPam, pLayout);
1714 bool bOnlyOutline =
true;
1715 bool bOnlyNonOutline =
true;
1731 bOnlyNonOutline =
false;
1733 bOnlyOutline =
false;
1743 else if (bOnlyNonOutline)
1767 if( (-1 == nDiff && 0 >= nLevel) ||
1768 (1 == nDiff &&
MAXLEVEL - 1 <= nLevel))
1779 std::make_unique<SwUndoNumUpDown>(aPam, nDiff) );
1804 nLevel = nLevel + nDiff;
1831 if (pLay->HasMergedParas())
1838 std::pair<SwTextNode *, SwTextNode *> nodes(
1840 if (nodes.first && nodes.first != &rPam.
Start()->
GetNode())
1842 assert(nodes.second);
1859 if (nodes.second && nodes.second != &rPam.
End()->
GetNode())
1861 assert(nodes.first);
1876 rPam.
End()->
Assign(*nodes.second, nodes.second->GetTextNode()->Len());
1889 for ( ; ; ++nOffset)
1895 assert(nodes.first && nodes.second);
1896 nOffset += nodes.second->GetIndex() - pNode->
GetIndex();
1913 for ( ; ; --nOffset)
1919 assert(nodes.first && nodes.second);
1920 nOffset -= pNode->
GetIndex() - nodes.first->GetIndex();
1932 bool const bIsOutlMv,
SwRootFrame const*
const pLayout)
1934 auto [pStt, pEnd] = rPam.
StartEnd();
1979 nInEndIdx = nEndIdx;
1986 if(
abs( nOffset ) > nStIdx)
1989 nInEndIdx = nStIdx - 1;
1992 nInStIdx = nInEndIdx + 1;
1996 if( nEndIdx >=
GetNodes().GetEndOfContent().GetIndex() )
2005 pTmp1 =
GetNodes()[ nStIdx ]->StartOfSectionNode();
2006 pTmp2 =
GetNodes()[ nInStIdx ]->StartOfSectionNode();
2007 if( pTmp1 != pTmp2 )
2027 if( pTmp1 != pTmp2 )
2039 SwPosition aEndPos( pEnd->GetNode(), pCNd, pCNd ? pCNd->
Len() : 1 );
2040 bool bCheckDel =
true;
2046 if( !bCheckDel || RedlineType::Delete == pTmp->
GetType() )
2048 auto [pRStt, pREnd] = pTmp->
StartEnd();
2094 auto [pRStt, pREnd] = pTmp->
StartEnd();
2099 (pRStt->GetNode() < pStt->GetNode() ||
2100 (pRStt->GetNode() == pStt->GetNode() && !pRStt->GetContentIndex()) ) &&
2101 (pEnd->GetNode() < pREnd->GetNode() ||
2102 (pEnd->GetNode() == pREnd->GetNode() &&
2103 pCEndNd ? pREnd->GetContentIndex() == pCEndNd->
Len()
2104 : !pREnd->GetContentIndex() )) )
2110 if( *pTmp->
Start() == *pREnd )
2116 ( pRStt->GetNode() > aIdx.
GetNode() || aIdx > pREnd->
GetNode() ||
2119 ( pRStt->GetNode() == aIdx.
GetNode() && pRStt->GetContentIndex() > 0 ) ) )
2134 std::optional<SwPaM> oPam( std::in_place, pStt->GetNode(), 0, aMvRg.
aEnd.
GetNode(), 0 );
2136 SwPaM& rOrigPam(rPam);
2153 SwPaM aInsPam(aInsPos);
2155 OSL_ENSURE(bMoved,
"No content node found!");
2174 bool bIsEmptyNode = pIsEmptyNode && pIsEmptyNode->
Len() == 0;
2183 assert(oPam->End()->GetNodeIndex() - oPam->Start()->GetNodeIndex() + nOffset == aInsPos.
GetNodeIndex() - oPam->End()->GetNodeIndex());
2185 assert(oPam->Start()->GetNodeIndex() - oPam->End()->GetNodeIndex() + nOffset == aInsPos.
GetNodeIndex() - oPam->End()->GetNodeIndex());
2191 if (*pRedline->
End() < *oPam->Start())
2195 if (pRedline->
GetType() == RedlineType::Delete &&
2198 *oPam->Start() <= *pRedline->
Start())
2202 SwPaM pam(*pRedline,
nullptr);
2204 nOrigIdx - oPam->Start()->GetNodeIndex());
2235 pPos = &pTmp->GetBound(
false);
2248 assert(*oPam->GetMark() < *oPam->GetPoint());
2249 if (oPam->GetPoint()->GetNode().IsEndNode())
2252 assert(oPam->GetPoint()->GetNode().IsTextNode());
2253 SwTextNode *
const pNode(oPam->GetPoint()->GetNode().GetTextNode());
2254 oPam->GetPoint()->SetContent(pNode->
Len());
2262 "sw.core",
"redlines will be moved in DeleteAndJoin");
2274 SwNodeIndex bound2(oPam->GetBound(
false).GetNode());
2279 oPam.emplace(bound1, bound2);
2290 pOwnRedl = rTable[nRedlPosWithEmpty];
2299 if ( pEmptyNode && pEmptyNode->
Len() == 0 )
2302 else if ( pEmptyNode0 && pEmptyNode0->
Len() == 0 )
2312 if ( nRedlPosWithEmpty + 1 < rTable.
size() &&
2313 *rTable[nRedlPosWithEmpty + 1] < *rTable[nRedlPosWithEmpty] )
2315 rTable.
Remove(nRedlPosWithEmpty);
2340 nRedlEndNd = pREnd->GetNodeIndex();
2343 std::unique_ptr<SwUndoMoveNum> pUndo;
2364 pUndo->SetStartNode( aIdx.
GetIndex() - nMoved );
2370 auto [pRStt, pREnd] = pOwnRedl->
StartEnd();
2371 if( pRStt->GetNodeIndex() != nRedlSttNd )
2373 pRStt->Assign(nRedlSttNd);
2375 if( pREnd->GetNodeIndex() != nRedlEndNd )
2377 pREnd->Assign(nRedlEndNd);
2380 pREnd->SetContent( pCNd->
Len() );
2390 bool bResult =
false;
2393 if (pTextNd && pTextNd->
GetNumRule() !=
nullptr &&
2398 bool bOldNum = bDel;
2399 bool bNewNum = !bDel;
2409 std::make_unique<SwUndoNumOrNoNum>(rIdx, bOldNum, bNewNum));
2412 else if (bDel && pTextNd->
GetNumRule(
false) &&
2416 SwPaM aPam(*pTextNd);
2432 if ( pTNd !=
nullptr )
2464 pResult = (*mpNumRuleTable)[
n];
2478 OSL_ENSURE(
false,
"SwDoc::AddNumRule: table full.");
2500 if( pNew->
GetName() != rName )
2512 eDefaultNumberFormatPositionAndSpaceMode );
2522 std::make_unique<SwUndoNumruleCreate>(pNew, *
this));
2527 SfxHintId::StyleSheetCreated);
2538 OUString
newName =
"MailMergeNumRule"
2547 static bool bHack = (getenv(
"LIBO_ONEWAY_STABLE_ODF_EXPORT") !=
nullptr);
2551 static sal_Int64 nIdCounter = SAL_CONST_INT64(8000000000);
2552 aName = OUString::number(nIdCounter++);
2557 std::numeric_limits<unsigned int>::max()));
2558 aName = OUString::number(
n);
2560 if( pChkStr && pChkStr->isEmpty() )
2563 else if( pChkStr && !pChkStr->isEmpty() )
2571 sal_uInt16 nNum(0), nTmp, nFlagSize = (
mpNumRuleTable->size() / 8 ) +2;
2572 std::unique_ptr<sal_uInt8[]> pSetFlags(
new sal_uInt8[ nFlagSize ]);
2573 memset( pSetFlags.get(), 0, nFlagSize );
2575 sal_Int32 nNmLen =
aName.getLength();
2576 if( !bAutoNum && pChkStr )
2578 while( nNmLen-- &&
'0' <=
aName[nNmLen] &&
aName[nNmLen] <=
'9' )
2581 if( ++nNmLen <
aName.getLength() )
2589 if(
nullptr != pNumRule )
2591 const OUString sNm = pNumRule->GetName();
2592 if( sNm.startsWith(
aName ) )
2595 nNum = o3tl::narrowing<sal_uInt16>(
o3tl::toInt32(sNm.subView( nNmLen )));
2596 if( nNum-- && nNum < mpNumRuleTable->
size() )
2597 pSetFlags[ nNum / 8 ] |= (0x01 << ( nNum & 0x07 ));
2599 if( pChkStr && *pChkStr==sNm )
2607 for( sal_uInt16
n = 0;
n < nFlagSize; ++
n )
2609 nTmp = pSetFlags[
n ];
2623 if( pChkStr && !pChkStr->isEmpty() )
2625 return aName + OUString::number( ++nNum );
2631 for(
size_t n = 0;
n < rNmTable.
size(); ++
n )
2632 if( rNmTable[
n ]->IsInvalidRule() )
2633 rNmTable[
n ]->Validate(*
this);
2637 const int nListLevel,
2652 bool bResult =
false;
2655 if ( pTextNode !=
nullptr )
@ CheckPosInFly
check if target position is in fly anchored at source range
@ ShowDelete
show all deletes
@ ShowInsert
show all inserts
const OUString & GetValue() const
virtual bool AppendTextNode(SwPosition &rPos)=0
virtual bool SplitNode(const SwPosition &rPos, bool bChkTableStart)=0
Split a node at rPos (implemented only for TextNode).
virtual bool CopyRange(SwPaM &rPam, SwPosition &rPos, SwCopyFlags flags) const =0
Copy a selected content range to a position.
virtual bool MoveNodeRange(SwNodeRange &, SwNode &, SwMoveFlags)=0
virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr, SwTextAttr **ppNewTextAttr=nullptr)=0
Insert an attribute.
virtual void UpdateExpFields(SwTextField *pField, bool bUpdateRefFields)=0
virtual void deleteListForListStyle(const OUString &rListStyleName)=0
virtual void deleteListsByDefaultListStyle(const OUString &rListStyleName)=0
virtual SwList * getListByName(const OUString &rListId) const =0
virtual void createListForListStyle(const OUString &rListStyleName)=0
virtual SwList * createList(const OUString &rListId, const OUString &rDefaultListStyleName)=0
virtual bool SplitRedline(const SwPaM &rPam)=0
virtual SwRedlineTable::size_type GetRedlinePos(const SwNode &rNode, RedlineType nType) const =0
virtual const SwRedlineTable & GetRedlineTable() const =0
virtual AppendResult AppendRedline(SwRangeRedline *pNewRedl, bool bCallDelete)=0
Append a new redline.
virtual void SetRedlineFlags(RedlineFlags eMode)=0
Set a new redline mode.
virtual const SwRangeRedline * GetRedline(const SwPosition &rPos, SwRedlineTable::size_type *pFndPos) const =0
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
virtual void SetModified()=0
Must be called manually at changes of format.
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
SwFormatColl * GetFormatColl() const
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
virtual SwContentNode * JoinNext()
void ChkCondColl(const SwTextFormatColl *pColl=nullptr)
virtual sal_Int32 Len() const
const SwAttrSet * GetpSwAttrSet() const
void MarkListLevel(const OUString &sListId, const int nListLevel, const bool bValue)
Marks/Unmarks a list level of a certain list.
bool MoveOutlinePara(const SwPaM &rPam, SwOutlineNodes::difference_type nOffset)
Outline - move up / move down.
void CorrRel(const SwNode &rOldNode, const SwPosition &rNewPos, const sal_Int32 nOffset=0, bool bMoveCursor=false)
void AddNumRule(SwNumRule *pRule)
Add numbering rule to document.
std::unordered_map< OUString, SwNumRule * > maNumRuleMap
const SwFootnoteInfo & GetFootnoteInfo() const
void SetNodeNumStart(const SwPosition &rPos, sal_uInt16 nStt)
void BroadcastStyleOperation(const OUString &rName, SfxStyleFamily eFamily, SfxHintId nOp)
static bool GotoPrevNum(SwPosition &, SwRootFrame const *pLayout, bool bOverUpper=true)
IDocumentState const & getIDocumentState() const
bool GotoOutline(SwPosition &rPos, const OUString &rName, SwRootFrame const *=nullptr) const
bool NumOrNoNum(SwNode &rIdx, bool bDel=false)
OUString GetUniqueNumRuleName(const OUString *pChkStr=nullptr, bool bAutoNum=true) const
std::unique_ptr< SwTextFormatColls > mpTextFormatCollTable
sal_uInt16 FindNumRule(std::u16string_view rName) const
o3tl::sorted_vector< SwRootFrame * > GetAllLayouts()
bool IsUsed(const sw::BroadcastingModify &) const
void ReplaceNumRule(const SwPosition &rPos, const OUString &rOldRule, const OUString &rNewRule)
bool NoNum(const SwPaM &)
SwNumRule * FindNumRulePtr(const OUString &rName) const
void PropagateOutlineRule()
void StopNumRuleAnimations(const OutputDevice *)
const SwNumRuleTable & GetNumRuleTable() const
SwNumRule * GetOutlineNumRule() const
SwNumRule * mpOutlineRule
bool MoveParagraph(SwPaM &, SwNodeOffset nOffset, bool bIsOutlMv=false)
Move selected paragraphs (not only numberings) according to offsets.
IDocumentContentOperations const & getIDocumentContentOperations() const
IDocumentUndoRedo & GetIDocumentUndoRedo()
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
void InvalidateNumRules()
void DelNumRules(const SwPaM &, SwRootFrame const *pLayout=nullptr)
void SetNumRuleStart(const SwPosition &rPos, bool bFlag=true)
SwFootnoteIdxs & GetFootnoteIdxs()
bool RenameNumRule(const OUString &aOldName, const OUString &aNewName, bool bBroadcast=false)
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)
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
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.
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.
std::unique_ptr< SwNumRuleTable > mpNumRuleTable
static bool IsFirstOfNumRuleAtPos(const SwPosition &rPos, SwRootFrame const &rLayout)
void SetCounted(const SwPaM &, bool bCounted, SwRootFrame const *pLayout)
bool DelNumRule(const OUString &rName, bool bBroadCast=false)
bool IsInMailMerge() const
bool NumUpDown(const SwPaM &, bool bDown, SwRootFrame const *pLayout=nullptr)
void MakeUniqueNumRules(const SwPaM &rPaM)
bool OutlineUpDown(const SwPaM &rPam, short nOffset, SwRootFrame const *pLayout=nullptr)
bool MoveParagraphImpl(SwPaM &, SwNodeOffset nOffset, bool bIsOutlMv, SwRootFrame const *)
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)
IDocumentListsAccess const & getIDocumentListsAccess() const
sal_uInt16 MakeNumRule(const OUString &rName, const SwNumRule *pCpy=nullptr, bool bBroadcast=false, const SvxNumberFormat::SvxNumPositionAndSpaceMode eDefaultNumberFormatPositionAndSpaceMode=SvxNumberFormat::LABEL_WIDTH_AND_POSITION)
void SetOutlineNumRule(const SwNumRule &rRule)
void MarkListLevel(const int nListLevel, const bool bValue)
const OUString & GetListId() const
Marks a node in the document model.
const SwNodes & GetNodes() const
SwNodeOffset GetIndex() const
Base class of the Writer document model elements.
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwNodeOffset GetIndex() const
bool IsContentNode() const
bool IsSectionNode() const
SwTableNode * FindTableNode()
Search table node, in which it is.
const SwStartNode * StartOfSectionNode() const
Merge GetRedlineMergeFlag() const
SwContentNode * GetContentNode()
SwNodeType GetNodeType() const
const SwEndNode * EndOfSectionNode() const
const SwOutlineNodes & GetOutLineNds() const
Array of all OutlineNodes.
void UpdateOutlineIdx(const SwNode &)
Update all OutlineNodes starting from Node.
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
static SwContentNode * GoPrevious(SwNodeIndex *)
SwNodeOffset Count() const
void SetAutoRule(bool bFlag)
void SetRuleType(SwNumRuleType eNew)
void SetNumRuleMap(std::unordered_map< OUString, SwNumRule * > *pNumRuleMap)
Register this rule in a "name->numrule" map.
bool IsOutlineRule() const
void SetPoolHelpId(sal_uInt16 nId)
const SwNumFormat * GetNumFormat(sal_uInt16 i) const
void SetName(const OUString &rNm, IDocumentListsAccess &rDocListAccess)
bool IsContinusNum() const
const OUString & GetDefaultListId() const
const SwNumFormat & Get(sal_uInt16 i) const
void Set(sal_uInt16 i, const SwNumFormat *)
void SetInvalidRule(bool bFlag)
void SetDefaultListId(const OUString &sDefaultListId)
const OUString & GetName() const
static OUString GetOutlineRuleName()
void SetPoolHlpFileId(sal_uInt8 nId)
std::vector< SwTextNode * > tTextNodeList
void SetPoolFormatId(sal_uInt16 nId)
void SetContinusNum(bool bFlag)
void CheckCharFormats(SwDoc &rDoc)
Tests whether the CharFormats are from the given doc and copies them if appropriate.
void GetTextNodeList(SwNumRule::tTextNodeList &rTextNodeList) const
SwNumberTree::tNumberVector GetNumberVector() const
Returns level numbers of this node.
bool Seek_Entry(SwNode *rP, size_type *pnPos) const
PaM is Point and Mark: a selection of the document model.
const SwPosition * GetMark() const
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
std::pair< const SwPosition *, const SwPosition * > StartEnd() const
Because sometimes the cost of the operator<= can add up.
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
const SwPosition * End() const
const SwPosition * GetPoint() const
const SwPosition * Start() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
bool IsOwnRedline(const SwRangeRedline &rRedl) const
RedlineType GetType(sal_uInt16 nPos=0) const
bool Insert(SwRangeRedline *&p)
static constexpr size_type npos
void Remove(size_type nPos)
vector_type::size_type size_type
void RegisterInModify(sw::BroadcastingModify *pRegIn, const SwNode &rNd)
The root element of a Writer document layout.
bool HasMergedParas() const
Starts a section of nodes in the document model.
SwStartNodeType GetStartNodeType() const
Represents the style of a paragraph.
bool IsAssignedToListLevelOfOutlineStyle() const
int GetAssignedOutlineStyleLevel() const
Represents the visualization of a paragraph.
SwTextNode is a paragraph in the document model.
bool HasBullet() const
Returns if this text node has a bullet.
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|ExpandMode::HideFieldmarkCommands) const
add 4th optional parameter <bAddSpaceAfterListLabelStr> indicating, when <bWithNum = true> that a spa...
void SetAttrListLevel(int nLevel)
Sets the list level of this text node.
SwNumberTree::tSwNumTreeNumber GetAttrListRestartValue() const
virtual sal_Int32 Len() const override
void SetAttrOutlineLevel(int nLevel)
Sets the out line level at a text node.
bool IsFirstOfNumRule(SwRootFrame const &rLayout) const
OUString GetListId() const
void SetListRestart(bool bRestart)
virtual bool SetAttr(const SfxPoolItem &) override
overriding to handle change of certain paragraph attributes
const SwNodeNum * GetNum(SwRootFrame const *pLayout=nullptr, SwListRedlineType eRedline=SwListRedlineType::SHOW) const
virtual SwFormatColl * ChgFormatColl(SwFormatColl *) override
bool IsCountedInList() const
void SetCountedInList(bool bCounted)
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.
void SetAttrListRestartValue(SwNumberTree::tSwNumTreeNumber nNum)
SwTextFormatColl * GetTextColl() const
virtual bool ResetAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0) override
void AddNode(const SwTextNode &rNd)
void SaveOldNumRule(const SwNumRule &rOld)
std::vector< Value >::difference_type difference_type
std::vector< Value >::size_type size_type
TOOLS_DLLPUBLIC OString DateTimeToOString(const DateTime &rDateTime)
virtual OUString GetName() const override
static bool lcl_GotoNextPrevNum(SwPosition &rPos, bool bNext, bool bOverUpper, sal_uInt8 *pUpper, sal_uInt8 *pLower, SwRootFrame const *const pLayout)
static bool lcl_IsNumOk(sal_uInt8 nSrchNum, sal_uInt8 &rLower, sal_uInt8 &rUpper, bool bOverUpper, sal_uInt8 nNumber)
static sal_uInt8 GetUpperLvlChg(sal_uInt8 nCurLvl, sal_uInt8 nLevel, sal_uInt16 nMask)
static SwTextNode * lcl_FindOutlineName(const SwOutlineNodes &rOutlNds, SwRootFrame const *const pLayout, std::u16string_view aName, bool const bExact)
static SwTextNode * lcl_FindOutlineNum(const SwOutlineNodes &rOutlNds, OUString &rName, SwRootFrame const *const pLayout)
static bool lcl_IsValidPrevNextNumNode(const SwNodeIndex &rIdx)
static void lcl_ChgNumRule(SwDoc &rDoc, const SwNumRule &rRule)
constexpr TypedWhichId< SfxStringItem > RES_PARATR_LIST_ID(RES_PARATR_LIST_BEGIN)
constexpr TypedWhichId< SvxFirstLineIndentItem > RES_MARGIN_FIRSTLINE(91)
constexpr TypedWhichId< SwConditionTextFormatColl > RES_CONDTXTFMTCOLL(166)
constexpr TypedWhichId< SfxInt16Item > RES_PARATR_LIST_LEVEL(83)
constexpr TypedWhichId< SfxInt16Item > RES_PARATR_LIST_RESTARTVALUE(85)
constexpr TypedWhichId< SwNumRuleItem > RES_PARATR_NUMRULE(72)
constexpr TypedWhichId< SvxRightMarginItem > RES_MARGIN_RIGHT(93)
constexpr TypedWhichId< SvxTextLeftMarginItem > RES_MARGIN_TEXTLEFT(92)
constexpr TypedWhichId< SfxBoolItem > RES_PARATR_LIST_ISCOUNTED(86)
constexpr TypedWhichId< SfxBoolItem > RES_PARATR_LIST_ISRESTART(84)
#define SAL_WARN_IF(condition, area, stream)
std::vector< tSwNumTreeNumber > tNumberVector
unsigned int uniform_uint_distribution(unsigned int a, unsigned int b)
bool isdigitAsciiString(std::string_view rString)
OUString newName(std::u16string_view aNewPrefix, std::u16string_view aOldPrefix, std::u16string_view old_Name)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
Dialog to specify the properties of date form field.
void GotoNextLayoutTextFrame(SwNodeIndex &rIndex, SwRootFrame const *const pLayout)
void GotoPrevLayoutTextFrame(SwNodeIndex &rIndex, SwRootFrame const *const pLayout)
std::pair< SwTextNode *, SwTextNode * > GetFirstAndLastNode(SwRootFrame const &rLayout, SwNode const &rPos)
bool IsParaPropsNode(SwRootFrame const &rLayout, SwTextNode const &rNode)
void UpdateFramesForAddDeleteRedline(SwDoc &rDoc, SwPaM const &rPam)
SwTextNode * GetParaPropsNode(SwRootFrame const &rLayout, SwNode const &rNode)
@ Section
SwSectionNode is derived from SwStartNode.
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
SwNodeOffset abs(const SwNodeOffset &a)
SwComparePosition ComparePosition(const T &rStt1, const T &rEnd1, const T &rStt2, const T &rEnd2)
@ OverlapBehind
Pos1 overlaps Pos2 at the end.
@ CollideEnd
Pos1 end touches at Pos2 start.
@ Behind
Pos1 behind Pos2.
@ OverlapBefore
Pos1 overlaps Pos2 at the beginning.
@ Outside
Pos2 completely contained in Pos1.
@ Before
Pos1 before Pos2.
@ Inside
Pos1 completely contained in Pos2.
@ CollideStart
Pos1 start touches at Pos2 end.
@ Equal
Pos1 is as large as Pos2.
SwMoveFnCollection const & fnMoveBackward
@ RES_POOLCOLL_HEADLINE1
Heading 1.
Marks a position in the document model.
void Adjust(SwNodeOffset nDelta)
Adjust node position, and resets content position to zero.
void Assign(const SwNode &rNd, SwNodeOffset nDelta, sal_Int32 nContentOffset=0)
These all set both nNode and nContent.
void AssignEndIndex(const SwContentNode &rNd)
Set nNode to rNd, and nContent to the end of rNd.
SwNodeOffset GetNodeIndex() const
sal_Int32 GetContentIndex() const
Describes parts of multiple text nodes, which will form a text frame, even when redlines are hidden a...
OUString SwResId(TranslateId aId)
constexpr sal_uInt8 MAXLEVEL