45 #include <strings.hrc>
52 #include <osl/diagnose.h>
60 void lcl_ResetIndentAttrs(
SwDoc *pDoc,
const SwPaM &rPam, sal_uInt16 marker,
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)
106 if( nCurLvl + 1 >= nLevel )
107 nCurLvl -= nLevel - 1;
111 return static_cast<sal_uInt8>((nMask - 1) & ~(( 1 << nCurLvl ) - 1));
117 (*mpOutlineRule) = rRule;
140 pTextNd->NumRuleChgd();
143 if ( pTextNd->GetTextColl()->IsAssignedToListLevelOfOutlineStyle() &&
144 pTextNd->GetAttrListLevel() != pTextNd->GetTextColl()->GetAssignedOutlineStyleLevel() )
146 pTextNd->SetAttrListLevel( pTextNd->GetTextColl()->GetAssignedOutlineStyleLevel() );
167 if(pColl->IsAssignedToListLevelOfOutlineStyle())
170 const SwNumRuleItem & rCollRuleItem = pColl->GetNumRule(
false );
172 if ( rCollRuleItem.
GetValue().isEmpty() )
180 pColl->SetFormatAttr(aNumItem);
191 if(
GetNodes().GetOutLineNds().empty() || !nOffset )
195 SwPaM aPam(rPam,
nullptr);
196 ExpandPamForParaPropsNodes(aPam, pLayout);
202 if( !rOutlNds.
Seek_Entry( pSttNd, &nSttPos ) &&
221 if (pTextFormatColl->IsAssignedToListLevelOfOutlineStyle())
223 const int nLevel = pTextFormatColl->GetAssignedOutlineStyleLevel();
224 aCollArr[ nLevel ] = pTextFormatColl;
233 if (aCollArr[n] !=
nullptr)
241 if (aCollArr[n] !=
nullptr)
253 aCollArr[n] = aTmpColl;
262 if (aCollArr[n] !=
nullptr)
270 if (aCollArr[n] !=
nullptr)
282 aCollArr[n] = aTmpColl;
325 if (aCollArr[n] !=
nullptr)
330 while (nCount > 0 && m + nStep >= 0 && m + nStep < MAXLEVEL)
334 if (aCollArr[m] !=
nullptr)
350 bool bMoveApplicable =
true;
351 for (
auto i = nSttPos;
i < nEndPos; ++
i)
353 SwTextNode* pTextNd = rOutlNds[
i ]->GetTextNode();
363 if (aMoveArr[nLevel] == -1)
364 bMoveApplicable =
false;
372 if ( nNewOutlineLevel < 1 || nNewOutlineLevel > MAXLEVEL )
374 bMoveApplicable =
false;
379 if (! bMoveApplicable )
386 std::make_unique<SwUndoOutlineLeftRight>(aPam, nOffset) );
390 for (
auto i = nSttPos;
i < nEndPos; ++
i)
392 SwTextNode* pTextNd = rOutlNds[
i ]->GetTextNode();
403 OSL_ENSURE(aMoveArr[nLevel] >= 0,
404 "move table: current TextColl not found when building table!");
406 if (nLevel < MAXLEVEL && aMoveArr[nLevel] >= 0)
408 pColl = aCollArr[ aMoveArr[nLevel] ];
410 if (pColl !=
nullptr)
418 if( 0 <= nLevel && nLevel <= MAXLEVEL)
442 if(
GetNodes().GetOutLineNds().empty() || !nOffset ||
453 SwNode* pSrch = &aSttRg.GetNode();
458 if( !
GetNodes().GetOutLineNds().Seek_Entry( pSrch, &nCurrentPos ) )
464 else if( 0 > nOffset )
475 if(
GetNodes().GetOutLineNds().Seek_Entry( pEndSrch, &nTmpPos ) )
477 if( !pEndSrch->
IsTextNode() || pEndSrch == pSrch ||
486 nCurrentPos = nTmpPos;
487 if( aEndRg == aSttRg )
489 OSL_FAIL(
"Moving outlines: Surprising selection" );
500 while( aSttRg.GetNode().IsStartNode() )
516 if( pNd->
GetIndex() >= aSttRg.GetIndex() )
525 else if( nCurrentPos + nOffset >=
GetNodes().GetOutLineNds().
size() )
559 if( pNd->
GetIndex() >= aSttRg.GetIndex() )
573 OSL_ENSURE( aSttRg.GetIndex() > nNewPos || nNewPos >= aEndRg.
GetIndex(),
574 "Position lies within Move range" );
579 nNewPos = std::max( nNewPos,
GetNodes().GetEndOfExtras().GetIndex() + 2 );
582 SwPaM aPam( aSttRg, aEndRg, 0, -1 );
587 SwRootFrame const*
const pLayout,
const OUString& rName,
bool const bExact)
591 for(
auto pOutlNd : rOutlNds )
595 if (sText.startsWith(rName))
597 if (sText.getLength() == rName.getLength())
601 pExactButDeleted = pTextNd;
609 if (!bExact && !pSavedNode
613 pSavedNode = pTextNd;
618 return bExact ? pExactButDeleted : pSavedNode;
629 OUString sNum = rName.getToken( 0,
'.', nPos );
634 memset( nLevelVal, 0,
MAXLEVEL *
sizeof( nLevelVal[0] ));
636 OUString
sName( rName );
641 for( sal_Int32
n = 0;
n < sNum.getLength(); ++
n )
644 if(
'0' <= c && c <=
'9' )
656 nLevelVal[ nLevel++ ] = nVal;
658 sName = sName.copy( nPos );
660 sNum = sName.getToken( 0,
'.', nPos );
671 if( rOutlNds.
empty() )
675 for(
auto pOutlNd : rOutlNds )
689 nLevel = std::min<int>(nLevel,
MAXLEVEL);
690 for(
int n = 0;
n < nLevel; ++
n )
692 if ( aLevelVal[
n] != nLevelVal[
n] )
708 "<lcl_FindOutlineNum(..)> - text node with outline level and numbering rule, but without numbering tree node. This is a serious defect" );
725 if( !rName.isEmpty() )
730 OUString
sName( rName );
738 while(!sExpandedText.isEmpty())
741 OUString sTempNum = sExpandedText.getToken(0,
'.', nPos);
742 if( sTempNum.isEmpty() || -1 == nPos ||
745 sExpandedText = sExpandedText.copy(nPos);
748 if( sExpandedText != sName )
774 if ( sName != rName )
794 sal_uInt16 nChgFormatLevel = 0;
795 sal_uInt16 nMask = 1;
801 if ( rOldFormat != rNewFormat )
803 nChgFormatLevel |= nMask;
806 && 1 < rNewFormat.GetIncludeUpperLevels()
807 && 0 != ( nChgFormatLevel &
GetUpperLvlChg(
n, rNewFormat.GetIncludeUpperLevels(), nMask ) ) )
809 nChgFormatLevel |= nMask;
813 if( !nChgFormatLevel )
819 if ( bInvalidateNumRule )
832 nLvl =
static_cast<sal_uInt8>(pTextNd->GetActualListLevel());
834 if( nLvl < MAXLEVEL )
836 if( nChgFormatLevel & ( 1 << nLvl ))
838 pTextNd->NumRuleChgd();
844 if ( nChgFormatLevel & ( 1 <<
n ) )
856 const bool bCreateNewList,
858 const OUString& sContinuedListId,
860 const bool bResetIndentAttrs )
864 SwPaM aPam(rPam,
nullptr);
865 ExpandPamForParaPropsNodes(aPam, pLayout);
877 bool bNewNumRuleCreated =
false;
878 if ( pNewOrChangedNumRule ==
nullptr )
882 bNewNumRuleCreated =
true;
884 else if ( rRule != *pNewOrChangedNumRule )
900 if ( bCreateNewList )
902 if ( bNewNumRuleCreated )
911 OSL_ENSURE( pNewList,
912 "<SwDoc::SetNumRule(..)> - could not create new list. Serious defect." );
916 else if ( !sContinuedListId.isEmpty() )
919 sListId = sContinuedListId;
921 if (!sListId.isEmpty())
933 if ( pTextNd !=
nullptr )
954 if ( pCollRule && pCollRule->
GetName() == pNewOrChangedNumRule->
GetName() )
971 if ( bResetIndentAttrs
974 ::lcl_ResetIndentAttrs(
this, aPam,
RES_LR_SPACE, pLayout);
1015 std::make_unique<SwUndoNumRuleStart>(rPos, bFlag) );
1037 std::make_unique<SwUndoNumRuleStart>(rPos, nStt) );
1055 OSL_FAIL(
"<SwDoc::DelNumRule(..)> - No deletion of outline list style. This is serious defect" );
1064 std::make_unique<SwUndoNumruleDelete>(*(*
mpNumRuleTable)[nPos], *
this));
1069 SfxHintId::StyleSheetErased);
1075 const OUString aTmpName( rName );
1076 delete (*mpNumRuleTable)[ nPos ];
1113 bool bResult =
false;
1121 std::make_unique<SwUndoNumruleRename>(rOldName, rNewName, *
this));
1133 pTextNd->SetAttr(aItem);
1140 SfxHintId::StyleSheetModified);
1156 if (pFrame->HasAnimation() &&
1157 (!pFrame->GetMergedPara() || pFrame->GetMergedPara()->pParaPropsNode == pTNd))
1159 pFrame->StopAnimation( pOut );
1166 const OUString& rOldRule,
const OUString& rNewRule )
1171 if( pOldRule && pNewRule && pOldRule != pNewRule )
1184 if ( !aTextNodeList.empty() )
1187 sal_uInt16 nChgFormatLevel = 0;
1191 & rNewFormat = pNewRule->Get(
n );
1193 if( rOldFormat.
GetAbsLSpace() != rNewFormat.GetAbsLSpace() ||
1195 nChgFormatLevel |= ( 1 <<
n );
1202 if ( pGivenTextNode &&
1203 pGivenTextNode->
GetListId() == pTextNd->GetListId() )
1205 aRegH.RegisterInModify( pTextNd, *pTextNd );
1207 pTextNd->SetAttr( aRule );
1208 pTextNd->NumRuleChgd();
1223 struct ListStyleData
1226 bool bCreateNewList;
1230 : pReplaceNumRule( nullptr ),
1231 bCreateNewList( false ),
1239 OSL_ENSURE( &rPaM.
GetDoc() ==
this,
"need same doc" );
1241 std::map<SwNumRule *, ListStyleData> aMyNumRuleMap;
1257 ListStyleData aListStyleData = aMyNumRuleMap[pRule];
1259 if ( aListStyleData.pReplaceNumRule ==
nullptr )
1264 aListStyleData.pReplaceNumRule =
1268 aListStyleData.sListId,
nullptr, true ));
1271 if ( aListStyleData.pReplaceNumRule ==
nullptr )
1273 aListStyleData.pReplaceNumRule =
new SwNumRule(*pRule);
1275 aListStyleData.bCreateNewList =
true;
1278 aMyNumRuleMap[pRule] = aListStyleData;
1284 *aListStyleData.pReplaceNumRule,
1285 aListStyleData.bCreateNewList,
1287 aListStyleData.sListId );
1288 if ( aListStyleData.bCreateNewList )
1290 aListStyleData.bCreateNewList =
false;
1291 aListStyleData.sListId = pCNd->
GetListId();
1292 aMyNumRuleMap[pRule] = aListStyleData;
1326 SwPaM aPam(rPam,
nullptr);
1327 ExpandPamForParaPropsNodes(aPam, pLayout);
1343 const SwNode* pOutlNd =
nullptr;
1344 for( ; nStt <= nEnd; ++nStt )
1347 if (pLayout && pTNd)
1352 if ( pTNd && pNumRuleOfTextNode )
1355 aRegH.RegisterInModify( pTNd, *pTNd );
1379 else if( !pOutlNd &&
1380 static_cast<SwTextFormatColl*>(pTNd->
GetFormatColl())->IsAssignedToListLevelOfOutlineStyle() )
1405 "<lcl_IsNumOk(..)> - misusage of method" );
1409 if( bOverUpper ? nSrchNum == nNumber : nSrchNum >= nNumber )
1411 else if( nNumber > rLower )
1413 else if( nNumber < rUpper )
1520 bool bError =
false;
1545 sal_uInt8 nLower = nSrchNum, nUpper = nSrchNum;
1569 if( ::
lcl_IsNumOk( nSrchNum, nLower, nUpper, bOverUpper,
1592 if( !bRet && !bOverUpper && pLast )
1625 const bool bForward,
1627 const bool bOutline,
1628 int nNonEmptyAllowed,
1631 const bool bInvestigateStartNode)
1639 SwNode * pStartFromNode = pTextNd;
1646 const SwNode * pNode =
nullptr;
1649 if ( !bInvestigateStartNode )
1675 else if (pTextNd->
Len() > 0 ||
nullptr != pTextNd->
GetNumRule())
1677 if (nNonEmptyAllowed == 0)
1682 if (nNonEmptyAllowed < 0)
1683 nNonEmptyAllowed = -1;
1687 if ( bInvestigateStartNode )
1697 while (pNode !=
GetNodes().DocumentSectionStartNode(pStartFromNode) &&
1698 pNode !=
GetNodes().DocumentSectionEndNode(pStartFromNode));
1712 SwPaM aPam(rPam,
nullptr);
1713 ExpandPamForParaPropsNodes(aPam, pLayout);
1718 bool bOnlyOutline =
true;
1719 bool bOnlyNonOutline =
true;
1735 bOnlyNonOutline =
false;
1737 bOnlyOutline =
false;
1747 else if (bOnlyNonOutline)
1753 for (
sal_uLong nTmp = nStt; nTmp <= nEnd; ++nTmp)
1771 if( (-1 == nDiff && 0 >= nLevel) ||
1772 (1 == nDiff &&
MAXLEVEL - 1 <= nLevel))
1783 std::make_unique<SwUndoNumUpDown>(aPam, nDiff) );
1787 for(
sal_uLong nTmp = nStt; nTmp <= nEnd; ++nTmp )
1808 nLevel = nLevel + nDiff;
1833 if (pLay->HasMergedParas())
1840 std::pair<SwTextNode *, SwTextNode *> nodes(
1893 for ( ; ; ++nOffset)
1896 if (pNode->IsTextNode())
1899 assert(nodes.first && nodes.second);
1900 nOffset += nodes.second->GetIndex() - pNode->GetIndex();
1917 for ( ; ; --nOffset)
1920 if (pNode->IsTextNode())
1923 assert(nodes.first && nodes.second);
1924 nOffset -= pNode->GetIndex() - nodes.first->GetIndex();
1936 bool const bIsOutlMv,
SwRootFrame const*
const pLayout)
1941 sal_uLong nEndIdx = pEnd->nNode.GetIndex();
1982 nInEndIdx = nEndIdx;
1992 nInEndIdx = nStIdx - 1;
1995 nInStIdx = nInEndIdx + 1;
2008 pTmp1 =
GetNodes()[ nStIdx ]->StartOfSectionNode();
2009 pTmp2 =
GetNodes()[ nInStIdx ]->StartOfSectionNode();
2010 if( pTmp1 != pTmp2 )
2030 if( pTmp1 != pTmp2 )
2040 SwPosition aStPos( *pStt ), aEndPos( *pEnd );
2041 aStPos.nContent = 0;
2044 bool bCheckDel =
true;
2050 if( !bCheckDel || RedlineType::Delete == pTmp->
GetType() )
2105 (pEnd->nNode < pREnd->nNode ||
2106 (pEnd->nNode == pREnd->nNode &&
2107 pCEndNd ? pREnd->nContent.
GetIndex() == pCEndNd->
Len()
2108 : !pREnd->nContent.GetIndex() )) )
2114 if( *pTmp->
Start() == *pREnd )
2120 ( pRStt->
nNode > aIdx || aIdx > pREnd->nNode ))
2138 SwPaM& rOrigPam(rPam);
2156 SwPaM aInsPam(aInsPos);
2158 OSL_ENSURE(bMoved,
"No content node found!");
2188 if (*pRedline->
End() < *aPam.
Start())
2192 if (pRedline->
GetType() == RedlineType::Delete)
2197 SwPaM pam(*pRedline,
nullptr);
2216 aIdx = aInsPos.
nNode;
2225 if( pPos->
nNode == aIdx )
2230 pPos = &pTmp->GetBound(
false);
2231 if( pPos->
nNode == aIdx )
2259 "sw.core",
"redlines will be moved in DeleteAndJoin");
2300 nRedlEndNd = pREnd->nNode.GetIndex();
2303 std::unique_ptr<SwUndoMoveNum> pUndo;
2324 pUndo->SetStartNode( aIdx.
GetIndex() - nMoved );
2333 pRStt->
nNode = nRedlSttNd;
2336 if( pREnd->nNode.GetIndex() != nRedlEndNd )
2338 pREnd->nNode = nRedlEndNd;
2340 pREnd->nContent.Assign( pCNd, pCNd ? pCNd->
Len() : 0 );
2350 bool bResult =
false;
2353 if (pTextNd && pTextNd->
GetNumRule() !=
nullptr &&
2358 bool bOldNum = bDel;
2359 bool bNewNum = !bDel;
2369 std::make_unique<SwUndoNumOrNoNum>(rIdx, bOldNum, bNewNum));
2372 else if (bDel && pTextNd->
GetNumRule(
false) &&
2376 SwPaM aPam(*pTextNd);
2392 if ( pTNd !=
nullptr )
2425 pResult = (*mpNumRuleTable)[
n];
2439 OSL_ENSURE(
false,
"SwDoc::AddNumRule: table full.");
2461 if( pNew->
GetName() != rName )
2473 eDefaultNumberFormatPositionAndSpaceMode );
2483 std::make_unique<SwUndoNumruleCreate>(pNew, *
this));
2488 SfxHintId::StyleSheetCreated);
2499 OUString
newName =
"MailMergeNumRule"
2508 static bool bHack = (getenv(
"LIBO_ONEWAY_STABLE_ODF_EXPORT") !=
nullptr);
2512 static sal_Int64 nIdCounter = SAL_CONST_INT64(8000000000);
2513 aName = OUString::number(nIdCounter++);
2518 std::numeric_limits<unsigned int>::max()));
2519 aName = OUString::number(n);
2521 if( pChkStr && pChkStr->isEmpty() )
2524 else if( pChkStr && !pChkStr->isEmpty() )
2529 aName =
SwResId( STR_NUMRULE_DEFNAME );
2532 sal_uInt16 nNum(0), nTmp, nFlagSize = (
mpNumRuleTable->size() / 8 ) +2;
2533 std::unique_ptr<sal_uInt8[]> pSetFlags(
new sal_uInt8[ nFlagSize ]);
2534 memset( pSetFlags.get(), 0, nFlagSize );
2536 sal_Int32 nNmLen = aName.getLength();
2537 if( !bAutoNum && pChkStr )
2539 while( nNmLen-- &&
'0' <= aName[nNmLen] && aName[nNmLen] <=
'9' )
2542 if( ++nNmLen < aName.getLength() )
2544 aName = aName.copy(0, nNmLen );
2550 if(
nullptr != pNumRule )
2552 const OUString sNm = pNumRule->GetName();
2553 if( sNm.startsWith( aName ) )
2556 nNum =
static_cast<sal_uInt16
>(sNm.copy( nNmLen ).toInt32());
2557 if( nNum-- && nNum < mpNumRuleTable->
size() )
2558 pSetFlags[ nNum / 8 ] |= (0x01 << ( nNum & 0x07 ));
2560 if( pChkStr && *pChkStr==sNm )
2567 nNum = mpNumRuleTable->size();
2568 for( sal_uInt16
n = 0;
n < nFlagSize; ++
n )
2570 nTmp = pSetFlags[
n ];
2584 if( pChkStr && !pChkStr->isEmpty() )
2586 return aName + OUString::number( ++nNum );
2592 for(
size_t n = 0;
n < rNmTable.
size(); ++
n )
2593 if( rNmTable[
n ]->IsInvalidRule() )
2594 rNmTable[
n ]->Validate();
2598 const int nListLevel,
2613 bool bResult =
false;
2616 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
sal_uLong GetIndex() 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
const OUString & GetListId() const
static bool lcl_IsValidPrevNextNumNode(const SwNodeIndex &rIdx)
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.
virtual SwUndoId EndUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Closes undo block.
OUString GetListId() const
void SetContinusNum(bool bFlag)
SwSectionNode is derived from SwStartNode.
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.
SwPosition & GetBound(bool bOne=true)
Dialog to specify the properties of date form field.
IDocumentUndoRedo & GetIDocumentUndoRedo()
bool NumUpDown(const SwPaM &, bool bDown, SwRootFrame const *pLayout=nullptr)
std::unordered_map< OUString, SwNumRule * > maNumRuleMap
void UpdateOutlineIdx(const SwNode &)
Update all OutlineNodes starting from Node.
IDocumentContentOperations const & getIDocumentContentOperations() const
bool HasNumber() 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)
SwContentNode * GetContentNode(bool bPoint=true) const
virtual void UpdateExpFields(SwTextField *pField, bool bUpdateRefFields)=0
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)
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
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
sal_uLong GetIndex() const
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()
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 isdigitAsciiString(const OString &rString)
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.
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()
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
bool MoveParagraph(SwPaM &, tools::Long nOffset, bool bIsOutlMv=false)
Move selected paragraphs (not only numberings) according to offsets.
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
OUString SwResId(const char *pId)
SwStartNodeType GetStartNodeType() const
virtual bool MoveNodeRange(SwNodeRange &, SwNodeIndex &, SwMoveFlags)=0
const SwPosition * Start() const
void SetOutlineNumRule(const SwNumRule &rRule)
bool ReplaceNumRule(const SwPosition &rPos, const OUString &rOldRule, const OUString &rNewRule)
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.
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr, bool bExpandCharToPara=false, SwTextAttr **ppNewTextAttr=nullptr)=0
Insert an attribute.
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< SwConditionTextFormatColl > RES_CONDTXTFMTCOLL(158)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
bool IsFirstOfNumRule(SwRootFrame const &rLayout) const
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.
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 MoveParagraphImpl(SwPaM &, tools::Long nOffset, bool bIsOutlMv, SwRootFrame const *)
bool Seek_Entry(SwNode *rP, size_type *pnPos) const
void InvalidateNumRules()
void SetName(const OUString &rNm, IDocumentListsAccess &rDocListAccess)
virtual const SwRedlineTable & GetRedlineTable() const =0
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
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)
SwNodeIndex & Assign(SwNodes const &rNds, sal_uLong)
Base class of the Writer document model elements.
SwTextFormatColl * GetTextColl() const