22#include <osl/diagnose.h>
133 {
return (
' ' == c ||
'\t' == c || 0x0a == c|| 0x3000 == c ); }
135 void SetColl( sal_uInt16 nId,
bool bHdLineOrText =
false );
143 return rFrame.
GetText().isEmpty()
162 OUString* pPrefix =
nullptr, OUString* pPostfix =
nullptr,
163 OUString* pNumTypes =
nullptr )
const;
171 void BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel );
192 return !
m_bEnd && pNextFrame
223 SwNode const * pSttNd =
nullptr,
SwNode const * pEndNd =
nullptr );
228 while( *pSrc && *pSrc != c )
230 return *pSrc ? pSrc :
nullptr;
237 assert(pFrame &&
"For Autoformat a Layout is needed");
264 sal_uInt16 nSeqNo = 0;
289#if OSL_DEBUG_LEVEL > 0
291 sText =
"Action text is missing";
390 const OUString& rText = rFrame.
GetText();
415 const sal_Int32 nLen = sTmp.getLength();
420 while (nIdx < nLen && !
IsSpace(sTmp[nIdx])) ++nIdx;
424 const sal_Int32 nFirst = nIdx;
425 while (nIdx < nLen &&
IsSpace(sTmp[nIdx])) ++nIdx;
434 sal_uInt16 *
const pDigitLvl)
const
436 sal_uInt16 nLvl = 0, nBlnk = 0;
437 const OUString& rText = rFrame.
GetText();
439 *pDigitLvl = USHRT_MAX;
461 nEnd(rText.getLength());
n < nEnd; ++
n)
463 switch (rText[sal_Int32(
n)])
465 case ' ':
if( 3 == ++nBlnk )
498 return aFInfo.
GetBigIndent( rCurrentSpacePos, pNextFrame );
503 const OUString& rStr = rFrame.
GetText();
507 sal_Int32 nANChar = 0, nBlnk = 0;
510 nEnd(rStr.getLength());
n < nEnd; ++
n)
522 sal_uLong nLen = rStr.getLength() - nBlnk;
523 nLen = ( nLen * 3 ) / 4;
524 return sal_Int32(nLen) < (rStr.getLength() - nANChar - nBlnk);
535 while (nCnt < rText.getLength())
540 case '-': eTmp = 1;
break;
541 case '_': eTmp = 2;
break;
542 case '=': eTmp = 3;
break;
543 case '*': eTmp = 4;
break;
544 case '~': eTmp = 5;
break;
545 case '#': eTmp = 6;
break;
551 else if( eState != eTmp )
596 aBox.
SetLine( &aLine, SvxBoxItemLine::BOTTOM );
619 || (
'+' != (cChar = rTmp[sal_Int32(nSttPlus)]) &&
'|' != cChar)
620 || (
'+' != (cChar = rTmp[sal_Int32(nEndPlus) - 1]) &&
'|' != cChar))
626 std::vector<sal_uInt16> aPosArr;
630 switch (rTmp[sal_Int32(
n)])
641 aPosArr.push_back( o3tl::narrowing<sal_uInt16>(aInfo.
GetCharPos(
n)) );
647 if( ++
n == nEndPlus )
651 if( 1 < aPosArr.size() )
654 sal_uInt16 nColCnt = aPosArr.size() - 1;
655 SwTwips nSttPos = aPosArr[ 0 ];
659 case SvxAdjust::Center: eHori = text::HoriOrientation::CENTER;
break;
660 case SvxAdjust::Right: eHori = text::HoriOrientation::RIGHT;
break;
670 eHori = text::HoriOrientation::LEFT;
684 return 1 < aPosArr.size();
690 for( nL = rStr.getLength(),
n = 0;
n < nL &&
IsSpace( rStr[
n] ); ++
n )
699 sal_Int32 nL = rStr.getLength(),
n = nL;
706 return rStr.copy( 0,
n+1 );
722 size_t nL =
aStr.size(),
n = nL;
733 const OUString& rText = rFrame.
GetText();
735 nEnd(rText.getLength());
n < nEnd; ++
n)
743 0 != ( i18n::KCharacterType::UPPER &
751 OUString* pPrefix, OUString* pPostfix, OUString* pNumTypes )
const
755 const OUString& rText = rFrame.
GetText();
756 sal_Int32
nPos(rPos);
759 sal_uInt16 nStart = 0;
762 sal_uInt16 nOpeningParentheses = 0;
763 sal_uInt16 nClosingParentheses = 0;
765 while (
nPos < rText.getLength() && nDigitLvl <
MAXLEVEL - 1)
770 if( (
'0' <= cCurrentChar &&
'9' >= cCurrentChar) ||
771 (0xff10 <= cCurrentChar && 0xff19 >= cCurrentChar) )
787 else if( pNumTypes && !(eScan &
DIGIT) )
791 if( 0 != (eScan & ~
CHG) &&
DIGIT != (eScan & ~
CHG))
795 if( 3 == ++nDigitCnt )
799 nStart += cCurrentChar <=
'9' ? cCurrentChar -
'0' : cCurrentChar - 0xff10;
804 0 != ( i18n::KCharacterType::UPPER &
811 if( 256 > cLow && strchr(
"mdclxvi", cLow ) )
837 ( 3 == nStart || 4 == nStart) && 256 > cLow &&
838 strchr(
"mdclxvi", cLow ) &&
843 nStart = 3 == nStart ? 100 : 500;
857 (*pNumTypes) = pNumTypes->replaceAt( pNumTypes->getLength() - 1, 1, rtl::OUStringChar(c) );
870 *pNumTypes += OUStringChar(cNumTyp);
873 else if( pNumTypes && !(eScan & eTmpScan) )
874 *pNumTypes += OUStringChar(cNumTyp);
879 if( 0 != ( eScan & ~
CHG ) && eTmpScan != ( eScan & ~
CHG ))
894 case 'm': nVal = 1000;
goto CHECK_ROMAN_1;
895 case 'd': nVal = 500;
goto CHECK_ROMAN_5;
896 case 'c': nVal = 100;
goto CHECK_ROMAN_1;
897 case 'l': nVal = 50;
goto CHECK_ROMAN_5;
898 case 'x': nVal = 10;
goto CHECK_ROMAN_1;
899 case 'v': nVal = 5;
goto CHECK_ROMAN_5;
903 int nMod5 = nStart % (nVal * 5);
904 int nLast = nStart % nVal;
907 if( nMod5 == ((3 * nVal) + n10 ) ||
908 nMod5 == ((4 * nVal) + n10 ) ||
910 nStart = o3tl::narrowing<sal_uInt16>(nStart + (n10 * 8));
911 else if( nMod5 == 0 ||
912 nMod5 == (1 * nVal) ||
913 nMod5 == (2 * nVal) )
914 nStart = nStart + nVal;
922 if( ( nStart / nVal ) & 1 )
926 int nMod = nStart % nVal;
929 nStart = o3tl::narrowing<sal_uInt16>(nStart + (3 * n10));
931 nStart = nStart + nVal;
939 if( nStart % 5 >= 3 )
955 else if( (256 > cCurrentChar &&
956 strchr(
".)(", cCurrentChar )) ||
957 0x3002 == cCurrentChar ||
958 0xff0e == cCurrentChar ||
959 0xFF08 == cCurrentChar ||
960 0xFF09 == cCurrentChar )
962 if(cCurrentChar ==
'(' || cCurrentChar == 0xFF09)
963 nOpeningParentheses++;
964 else if(cCurrentChar ==
')'|| cCurrentChar == 0xFF08)
965 nClosingParentheses++;
968 *pPrefix += OUStringChar(rText[
nPos]);
970 *pPostfix += OUStringChar(rText[
nPos]);
976 *pPrefix +=
"\x01" + OUString::number( nStart );
989 (nOpeningParentheses > nClosingParentheses))
993 *pPrefix +=
"\x01" + OUString::number( nStart );
1018 if( bHdLineOrText ? (SvxAdjust::Right != eAdj &&
1019 SvxAdjust::Center != eAdj)
1020 : SvxAdjust::Block != eAdj )
1034 &&
' ' == pEndFrame->
GetText()[sal_Int32(rEndIndex) - 1])
1040 &&
' ' == pStartFrame->
GetText()[sal_Int32(rStartIndex)])
1055 if( pBreakItem && SvxBreak::NONE != pBreakItem->
GetBreak() )
1068 const OUString& rStr = rTextFrame.
GetText();
1069 sal_Int32
n = rStr.getLength();
1075 return '.' == rStr[
n ];
1111bool GetRanges(std::vector<std::shared_ptr<SwUnoCursor>> & rRanges,
1114 bool isNoRedline(
true);
1126 if (*rDelPam.
End() <= *pRedline->
Start())
1130 if (*pRedline->
End() <= *rDelPam.
Start())
1134 if (pRedline->
GetType() == RedlineType::Delete)
1136 assert(*pRedline->
Start() != *pRedline->
End());
1137 isNoRedline =
false;
1138 if (*pCurrent < *pRedline->
Start())
1141 rRanges.back()->SetMark();
1142 *rRanges.back()->GetPoint() = *pRedline->
Start();
1144 pCurrent = pRedline->
End();
1147 if (!isNoRedline && *pCurrent < *rDelPam.
End())
1151 *rRanges.back()->GetPoint() = *rDelPam.
End();
1160 std::vector<std::shared_ptr<SwUnoCursor>> ranges;
1167 for (
auto const& pCursor : ranges)
1189 SwPaM* pNext = &rPamToCorrect;
1192 pNext =
p->GetNext();
1193 p->MoveTo( &rPamToCorrect );
1194 }
while(
p != pPrev );
1205 bool const bIgnoreLeadingBlanks)
1253 else if( bTstNextPara )
1301 std::vector<std::pair<TextFrameIndex, TextFrameIndex>> spaces;
1305 for (
auto iter = spaces.rbegin(); iter != spaces.rend(); ++iter)
1307 auto & rSpaceRange(*iter);
1308 assert(rSpaceRange.first != rSpaceRange.second);
1312 if (rSpaceRange.first != rSpaceRange.second)
1361 if (pNextFrame && !
m_bEnd)
1454 if (!pNextFrame || pCurrNode == pNextFrame)
1493 bool bChgBullet =
false, bChgEnum =
false;
1517 if (
nullptr != pFndBulletChr &&
IsSpace(rStr[sal_Int32(nTextStt) + 1]))
1552 ? nLeftTextPos / nLvl
1569 aRule.
Set(
n, aFormat );
1572 nFrameWidth < ( nSpaceSteps *
MAXLEVEL ) )
1573 nSpaceSteps = ( nFrameWidth - nLeftTextPos ) /
1592 OUString aPostfix, aPrefix, aNumTypes;
1594 &aPrefix, &aPostfix, &aNumTypes);
1595 if (USHRT_MAX != nDigitLevel)
1600 if( !nDigitLevel && nLeftTextPos )
1614 sal_Int32 nPrefixIdx{ 0 };
1618 const OUString
sPrefix = aPrefix.getToken(0,
u'\x0001', nPrefixIdx);
1626 if( !aNumTypes.isEmpty() )
1631 aRule.
Set( nLvl, aFormat );
1635 auto const nSpaceSteps = nLvl ? nLeftTextPos / nLvl : 0;
1637 sal_Int32 nPostfixIdx{ 0 };
1638 for(
n = 0;
n <= nLvl; ++
n )
1642 const OUString
sPrefix =
n ?
"" : aPrefix.getToken(0,
u'\x0001', nPrefixIdx);
1646 if(
n < aNumTypes.getLength() )
1657 aRule.
Set(
n, aFormat );
1661 bool bDefStep = nFrameWidth < (nSpaceSteps *
MAXLEVEL);
1672 aRule.
Set(
n, aFormat );
1683 if ( bChgEnum || bChgBullet )
1725 OUString sChgStr(
'\t');
1751 aSet.
Put( aTStops );
1779 if (!pNextFrame || pCurrNode == pNextFrame)
1802 SetColl( o3tl::narrowing<sal_uInt16>( nTextPos
1809 bool bInsTab =
true;
1811 if (
'\t' == rStr[sal_Int32(nSpacePos) + 1])
1818 while (nSpaceStt &&
IsSpace(rStr[sal_Int32(--nSpaceStt)]))
1822 if (bInsTab &&
'\t' == rStr[sal_Int32(nSpaceStt)])
1832 if( nSpaceStt < nSpacePos )
1876 sText = sText.replaceAll(
"$(ARG1)", OUString::number( nLvl + 1 ) );
1910 bool bReplaceQuote( aSvxFlags & ACFlags::ChgQuotes );
1911 bool bReplaceSglQuote( aSvxFlags & ACFlags::ChgSglQuotes );
1940 bool bNbspRunNext =
false;
1951 if( ( ( bReplaceQuote &&
'\"' == cChar ) ||
1952 ( bReplaceSglQuote &&
'\'' == cChar ) ) &&
1953 (!
nPos ||
' ' == (*pText)[sal_Int32(
nPos)-1]))
1963 bool bSetHardBlank =
false;
1965 OUString sReplace( pATst->
GetQuote( aACorrDoc,
1966 sal_Int32(
nPos), cChar,
true ));
1970 if( 2 == sReplace.getLength() &&
' ' == sReplace[ 1 ])
1972 sReplace = sReplace.copy( 0, 1 );
1973 bSetHardBlank =
true;
1997 bool bCallACorr =
false;
2003 cChar = (*pText)[sal_Int32(
nPos)];
2008 if( ( cChar ==
'\"' && bReplaceQuote ) || ( cChar ==
'\'' && bReplaceSglQuote ) )
2016 bool bSetHardBlank =
false;
2018 OUString sReplace( pATst->
GetQuote( aACorrDoc,
2019 sal_Int32(
nPos), cChar,
false) );
2021 if( 2 == sReplace.getLength() &&
' ' == sReplace[ 0 ])
2023 sReplace = sReplace.copy( 1 );
2024 bSetHardBlank =
true;
2068 sal_Unicode cBlank = nSttPos ? (*pText)[sal_Int32(nSttPos) - 1] : 0;
2087 if (cBlank && cBlank != (*pText)[sal_Int32(nSttPos) - 1])
2123 if(
nPos == nSttPos )
2160 aACorrDoc.
ChgAutoCorrWord(
reinterpret_cast<sal_Int32&
>(nSttPos), sal_Int32(
nPos), *pATst,
nullptr) )
2191 pATst->
FnSetINetAttr(aACorrDoc, *pText, sal_Int32(nLastBlank), sal_Int32(
nPos), eLang)) ||
2195 pATst->
FnSetDOIAttr(aACorrDoc, *pText, sal_Int32(nLastBlank), sal_Int32(
nPos), eLang)))
2214 bFirst = bFirstSent;
2235 : m_aFlags(
std::move( aFlags )),
2236 m_aDelPam( pEdShell->GetDoc()->GetNodes().GetEndOfExtras() ),
2237 m_aNdIdx( pEdShell->GetDoc()->GetNodes().GetEndOfExtras(),
SwNodeOffset(+1) ),
2238 m_aEndNdIdx( pEdShell->GetDoc()->GetNodes().GetEndOfContent() ),
2239 m_pEditShell( pEdShell ),
2240 m_pDoc( pEdShell->GetDoc() ),
2241 m_pCurTextNd( nullptr ), m_pCurTextFrame( nullptr ),
2242 m_nRedlAutoFormatSeqId( 0 )
2244 OSL_ENSURE( (pSttNd && pEndNd) || (!pSttNd && !pEndNd),
2253 bool bNxtEmpty =
false;
2254 bool bNxtAlpha =
false;
2255 sal_uInt16 nNxtLevel = 0;
2271 bEmptyLine = !pPrevFrame
2306 sal_uInt16 nLastCalcHeadLvl = 0;
2307 sal_uInt16 nLastHeadLvl = USHRT_MAX;
2308 sal_uInt16 nLevel = 0;
2309 sal_uInt16 nDigitLvl = 0;
2330 eStat = READ_NEXT_PARA;
2335 case READ_NEXT_PARA:
2338 eStat =
m_bEnd ? IS_END : TST_EMPTY_LINE;
2342 case TST_EMPTY_LINE:
2357 eStat = READ_NEXT_PARA;
2360 eStat = TST_ALPHA_LINE;
2363 case TST_ALPHA_LINE:
2385 eStat = READ_NEXT_PARA;
2388 eStat = GET_ALL_INFO;
2397 eStat = READ_NEXT_PARA;
2417 eStat = HAS_FMTCOLL;
2439 (pTextLeftMargin && 0 != pTextLeftMargin->
GetTextLeft()))
2448 eStat = READ_NEXT_PARA;
2455 if( bReplaceStyles )
2462 else if (pTextLeftMargin && pTextLeftMargin->
GetTextLeft() != 0)
2465 eStat = READ_NEXT_PARA;
2499 eStat = TST_ENUMERIC;
2500 if( !bReplaceStyles )
2505 if( sClrStr.isEmpty() )
2508 eStat = READ_NEXT_PARA;
2519 const sal_Unicode cLast = sEndClrStr[sEndClrStr.getLength() - 1];
2525 eStat = READ_NEXT_PARA;
2528 else if( 256 <= cLast || !strchr(
",.;", cLast ) )
2530 if( bNxtEmpty || bNxtAlpha
2538 if( USHRT_MAX == nLastHeadLvl )
2540 else if( nLastCalcHeadLvl < nLevel )
2546 else if( nLastCalcHeadLvl > nLevel )
2551 nLastCalcHeadLvl = nLevel;
2557 eStat = READ_NEXT_PARA;
2572 eStat = READ_NEXT_PARA;
2574 else if( bReplaceStyles )
2575 eStat = nLevel ? TST_IDENT : TST_NEG_IDENT;
2577 eStat = READ_NEXT_PARA;
2592 eStat = READ_NEXT_PARA;
2594 else if (nLevel && pNextFrame &&
2595 !bNxtEmpty && !bNxtAlpha && !nNxtLevel &&
2600 eStat = READ_NEXT_PARA;
2603 eStat = TST_TXT_BODY;
2618 eStat = READ_NEXT_PARA;
2620 else if (!nLevel && pNextFrame &&
2621 !bNxtEmpty && !bNxtAlpha && nNxtLevel &&
2626 eStat = READ_NEXT_PARA;
2629 eStat = TST_TXT_BODY;
2651 eStat = READ_NEXT_PARA;
2659 eStat = READ_NEXT_PARA;
2674 if( bReplaceStyles &&
2676 (pTextLeftMargin && 0 != pTextLeftMargin->
GetTextLeft())))
2685 else if (pTextLeftMargin && pTextLeftMargin->
GetTextLeft())
2716 std::optional<SwWait> oWait;
2725 aAFFlags = *pAFlags;
2727 oWait.emplace( *
GetDoc()->GetDocShell(),
true );
2736 if( rPaM.HasMark() )
2738 SwAutoFormat(
this, aAFFlags, &rPaM.Start()->GetNode(),
2739 &rPaM.End()->GetNode() );
2762 bool bRange =
false;
2776 if (pTextNd && !pTextNd->
GetText().isEmpty())
2792 if( pACorr && !pACorr->
IsAutoCorrFlag( ACFlags::CapitalStartSentence | ACFlags::CapitalStartWord |
2793 ACFlags::AddNonBrkSpace | ACFlags::ChgOrdinalNumber | ACFlags::TransliterateRTL |
2794 ACFlags::ChgToEnEmDash | ACFlags::SetINetAttr | ACFlags::Autocorrect |
2795 ACFlags::SetDOIAttr ))
@ ShowDelete
show all deletes
o3tl::strong_int< sal_Int32, struct Tag_TextFrameIndex > TextFrameIndex
Denotes a character index in a text frame at a layout level, after extent mapping from a text node at...
const sal_Unicode cStarSymbolEnDash
static const sal_Unicode * StrChr(const sal_Unicode *pSrc, sal_Unicode c)
const sal_Unicode pBulletChar[6]
const sal_Unicode cStarSymbolEmDash
static bool HasSelBlanks(SwTextFrame const *const pStartFrame, TextFrameIndex &rStartIndex, SwTextFrame const *const pEndFrame, TextFrameIndex &rEndIndex)
const sal_uInt16 cnNumBullColls
sal_Int32 getCharacterType(const OUString &rStr, sal_Int32 nPos) const
bool isAlpha(const OUString &rStr, sal_Int32 nPos) const
OUString lowercase(const OUString &rStr, sal_Int32 nPos, sal_Int32 nCount) const
static bool isLetterType(sal_Int32 nType)
bool isLetterNumeric(const OUString &rStr, sal_Int32 nPos) const
bool isBase(const OUString &rStr, sal_Int32 nPos) const
helper class to disable creation of an action by a callback event in particular, change event from a ...
virtual bool ReplaceRange(SwPaM &rPam, const OUString &rNewStr, const bool bRegExReplace)=0
Replace selected range in a TextNode with string.
virtual void InsertItemSet(const SwPaM &rRg, const SfxItemSet &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr)=0
virtual bool InsertString(const SwPaM &rRg, const OUString &, const SwInsertFlags nInsertMode=SwInsertFlags::EMPTYEXPAND)=0
Insert string into existing text node at position rRg.Point().
virtual const SwRedlineTable & GetRedlineTable() const =0
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 SwCharFormat * GetCharFormatFromPool(sal_uInt16 nId)=0
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SvxAdjust GetAdjust() const
SvxAutoCorrect * GetAutoCorrect()
static SvxAutoCorrCfg & Get()
sal_Unicode GetQuote(sal_Unicode cInsChar, bool bSttQuote, LanguageType eLang) const
void FnCapitalStartWord(SvxAutoCorrDoc &, const OUString &, sal_Int32 nSttPos, sal_Int32 nEndPos, LanguageType eLang)
void FnCapitalStartSentence(SvxAutoCorrDoc &, const OUString &, bool bNormalPos, sal_Int32 nSttPos, sal_Int32 nEndPos, LanguageType eLang)
bool FnChgToEnEmDash(SvxAutoCorrDoc &, const OUString &, sal_Int32 nSttPos, sal_Int32 nEndPos, LanguageType eLang)
bool IsAutoCorrFlag(ACFlags nFlag) const
bool FnSetINetAttr(SvxAutoCorrDoc &, const OUString &, sal_Int32 nSttPos, sal_Int32 nEndPos, LanguageType eLang)
bool FnChgOrdinalNumber(SvxAutoCorrDoc &, const OUString &, sal_Int32 nSttPos, sal_Int32 nEndPos, LanguageType eLang)
bool FnChgWeightUnderl(SvxAutoCorrDoc &, const OUString &, sal_Int32 nEndPos)
bool FnAddNonBrkSpace(SvxAutoCorrDoc &, std::u16string_view, sal_Int32 nEndPos, LanguageType eLang, bool &io_bNbspRunNext)
bool FnSetDOIAttr(SvxAutoCorrDoc &, const OUString &, sal_Int32 nSttPos, sal_Int32 nEndPos, LanguageType eLang)
static const sal_Int16 Thin
static const sal_Int16 Medium
static const sal_Int16 Hairline
static const sal_Int16 Thick
void SetLine(const editeng::SvxBorderLine *pNew, SvxBoxItemLine nLine)
void SetDistance(sal_Int16 nNew, SvxBoxItemLine nLine)
short GetTextFirstLineOffset() const
void SetNumberingType(SvxNumType nSet)
bool Insert(const SvxTabStop &rTab)
tools::Long GetLeft(SvxFirstLineIndentItem const &rFirstLine) const
tools::Long GetTextLeft() const
const SvxAdjustItem & GetAdjust(bool=true) const
const SvxFirstLineIndentItem & GetFirstLineIndent(bool=true) const
const SvxTextLeftMarginItem & GetTextLeftMargin(bool=true) const
virtual bool TransliterateRTLWord(sal_Int32 &rSttPos, sal_Int32 nEndPos, bool bApply=false) override
virtual bool ChgAutoCorrWord(sal_Int32 &rSttPos, sal_Int32 nEndPos, SvxAutoCorrect &rACorrect, OUString *pPara) override
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
bool HasSwAttrSet() const
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
const SwAttrSet * GetpSwAttrSet() const
bool Pop(PopMode, ::std::optional< SwCallLink > &roLink)
void Push()
store a copy of the current cursor on the cursor stack
SwShellCursor * GetCursor_()
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
bool IsInRightToLeftText() const
void SetTextFormatCollByAutoFormat(const SwPosition &rPos, sal_uInt16 nPoolId, const SfxItemSet *pSet)
OUString GetUniqueNumRuleName(const OUString *pChkStr=nullptr, bool bAutoNum=true) const
IDocumentContentOperations const & getIDocumentContentOperations() const
IDocumentUndoRedo & GetIDocumentUndoRedo()
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
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.
::sw::DocumentRedlineManager const & GetDocumentRedlineManager() const
void SetAutoFormatRedline(bool bFlag)
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
std::shared_ptr< SwUnoCursor > CreateUnoCursor(const SwPosition &rPos, bool bTableCursor=false)
const SwAttrPool & GetAttrPool() const
const SwTable * InsertTable(const SwInsertTableOptions &rInsTableOpts, const SwPosition &rPos, sal_uInt16 nRows, sal_uInt16 nCols, sal_Int16 eAdjust, const SwTableAutoFormat *pTAFormat=nullptr, const std::vector< sal_uInt16 > *pColArr=nullptr, bool bCalledFromShell=false, bool bNewModel=true, const OUString &rTableName={})
Insert new table at position.
bool SetTextFormatColl(const SwPaM &rRg, SwTextFormatColl *pFormat, const bool bReset=true, const bool bResetListAttrs=false, SwRootFrame const *pLayout=nullptr)
Add 4th optional parameter <bResetListAttrs>.
SwDocShell * GetDocShell()
void SetFormatItemByAutoFormat(const SwPaM &rPam, const SfxItemSet &)
void StartAllAction()
For all views of this document.
void AutoFormat(const SvxSwAutoFormatFlags *pAFlags)
Set our styles according to the respective rules.
SAL_DLLPRIVATE void DeleteSel(SwPaM &rPam, bool isArtificialSelection, bool *pUndo=nullptr)
static void SetAutoFormatFlags(SvxSwAutoFormatFlags const *)
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
void AutoFormatBySplitNode()
static SvxSwAutoFormatFlags * GetAutoFormatFlags()
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
static SvxSwAutoFormatFlags * s_pAutoFormatFlags
void AutoCorrect(SvxAutoCorrect &rACorr, bool bInsertMode, sal_Unicode cChar)
Call AutoCorrect.
friend class SwAutoFormat
For the private methods DelRange and those of AutoCorrect.
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
SwPageDesc * GetPageDesc()
const SwRect & getFrameArea() const
bool isFrameAreaDefinitionValid() const
const SwRect & getFramePrintArea() const
virtual void Calc(vcl::RenderContext *pRenderContext) const
bool IsRightToLeft() const
SwRootFrame * getRootFrame()
void SetCompletePaint() const
Marks a node in the document model.
SwNodeOffset GetIndex() const
Base class of the Writer document model elements.
sal_uInt8 GetAutoFormatLvl() const
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwSectionNode * GetSectionNode()
SwNodeOffset GetIndex() const
bool IsSectionNode() const
SwTableNode * FindTableNode()
Search table node, in which it is.
std::vector< SwFrameFormat * > const & GetAnchoredFlys() const
const SwEndNode * EndOfSectionNode() const
SwNodeOffset Count() const
const SwNumFormat * GetNumFormat(sal_uInt16 i) const
const SwNumFormat & Get(sal_uInt16 i) const
void Set(sal_uInt16 i, const SwNumFormat *)
static sal_uInt16 GetNumIndent(sal_uInt8 nLvl)
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.
UseOnPage GetUseOn() const
RedlineType GetType(sal_uInt16 nPos=0) const
Of course Writer needs its own rectangles.
void Width(tools::Long nNew)
vector_type::size_type size_type
SwViewShell * GetCurrShell() const
const SwSection & GetSection() const
bool IsProtectFlag() const
bool IsHiddenFlag() const
Represents the style of a paragraph.
SwTextFormatColl & GetNextTextFormatColl() const
const SwTextFrame * GetFrame() const
static SwTwips GetLineStart(const SwTextCursor &rLine)
bool IsFilled(const sal_uInt8 nPercent) const
SwTwips GetFirstIndent() const
void GetSpaces(std::vector< std::pair< TextFrameIndex, TextFrameIndex > > &, bool bWithLineBreak) const
SwTextFrameInfo & SetFrame(const SwTextFrame *pNew)
sal_Int32 GetBigIndent(TextFrameIndex &rFndPos, const SwTextFrame *pNextFrame) const
SwTwips GetCharPos(TextFrameIndex nChar, bool bCenter=true) const
bool IsBullet(TextFrameIndex nTextPos) const
Represents the visualization of a paragraph.
SwTextFrame * GetFormatted(bool bForceQuickFormat=false)
In case the SwLineLayout was cleared out of the s_pTextCache, recreate it.
SwPosition MapViewToModelPos(TextFrameIndex nIndex) const
LanguageType GetLangOfChar(TextFrameIndex nIndex, sal_uInt16 nScript, bool bNoChar=false) const
std::pair< SwTextNode *, sal_Int32 > MapViewToModel(TextFrameIndex nIndex) const
map position in potentially merged text frame to SwPosition
sw::MergedPara * GetMergedPara()
TextFrameIndex MapModelToViewPos(SwPosition const &rPos) const
SwTextNode * GetTextNodeFirst()
SwRect GetPaintSwRect()
Page number etc.
const OUString & GetText() const
Returns the text portion we want to edit (for inline see underneath)
SwTextNode const * GetTextNodeForParaProps() const
SwTextNode is a paragraph in the document model.
void SetAttrListLevel(int nLevel)
Sets the list level of this text node.
SwNumRule * GetNumRule(bool bInParent=true) const
Returns numbering rule of this text node.
const OUString & GetText() const
SwTextFormatColl * GetTextColl() const
vcl::RenderContext * GetOut() const
static ShellResource * GetShellRes()
SwRootFrame * GetLayout() const
void SetWidth(tools::Long nWidth)
void SetBorderLineStyle(SvxBorderLineStyle nNew)
void SetAutoFormatRedlineComment(const OUString *pText, sal_uInt16 nSeqNo=0)
Set comment-text for Redline.
void merge(RingContainer< value_type > aDestRing)
Merges two ring containers.
ring_container GetRingContainer()
FontFamily GetFamilyType()
const OUString & GetStyleName() const
const OUString & GetFamilyName() const
rtl_TextEncoding GetCharSet() const
#define STR_AUTOFMTREDL_CPTL_STT_SENT
#define STR_AUTOFMTREDL_BOLD
#define STR_AUTOFMTREDL_USE_REPLACE
#define STR_AUTOFMTREDL_DEL_MORELINES
#define STR_AUTOFMTREDL_TRANSLITERATE_RTL
#define STR_AUTOFMTREDL_ORDINAL
#define STR_AUTOFMTREDL_DASH
#define STR_AUTOFMTREDL_NON_BREAK_SPACE
#define STR_AUTOFMTREDL_DETECT_URL
#define STR_AUTOFMTREDL_SET_NUMBER_BULLET
#define STR_AUTOFMTREDL_CPTL_STT_WORD
#define STR_AUTOFMTREDL_UNDER
#define STR_AUTOFMTREDL_SET_TMPL_TEXT
#define STR_AUTOFMTREDL_SET_TMPL_HEADLINE
#define STR_AUTOFMTREDL_SET_TMPL_TEXT_INDENT
#define STR_AUTOFMTREDL_SET_TMPL_NEG_INDENT
#define STR_AUTOFMTREDL_END
#define STR_AUTOFMTREDL_SET_TMPL_INDENT
#define STR_AUTOFMTREDL_FRACTION
#define STR_AUTOFMTREDL_TYPO
#define STR_AUTOFMTREDL_DEL_EMPTY_PARA
#define STR_AUTOFMTREDL_DETECT_DOI
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
constexpr TypedWhichId< SvxFirstLineIndentItem > RES_MARGIN_FIRSTLINE(91)
constexpr TypedWhichId< SvxShadowItem > RES_SHADOW(113)
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(99)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(111)
constexpr TypedWhichId< SvxAdjustItem > RES_PARATR_ADJUST(64)
constexpr TypedWhichId< SvxTabStopItem > RES_PARATR_TABSTOP(68)
constexpr TypedWhichId< SvxBoxItem > RES_BOX(112)
constexpr TypedWhichId< SvxFormatBreakItem > RES_BREAK(100)
constexpr TypedWhichId< SwFormatDrop > RES_PARATR_DROP(70)
constexpr TypedWhichId< SvxTextLeftMarginItem > RES_MARGIN_TEXTLEFT(92)
constexpr TypedWhichId< SwParaConnectBorderItem > RES_PARATR_CONNECT_BORDER(78)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
CharClass & GetAppCharClass()
WhichRangesContainer const aTextNodeSetRange(svl::Items< RES_CHRATR_BEGIN, RES_CHRATR_END-1, RES_PARATR_BEGIN, RES_PARATR_END-1, RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END-1, RES_FRMATR_BEGIN, RES_FRMATR_END-1, RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1, XATTR_FILL_FIRST, XATTR_FILL_LAST >)
#define LANGUAGE_HUNGARIAN
void StartProgress(TranslateId pMessResId, tools::Long nStartValue, tools::Long nEndValue, SwDocShell *pDocShell)
void EndProgress(SwDocShell const *pDocShell)
void SetProgressState(tools::Long nPosition, SwDocShell const *pDocShell)
LanguageType GetLanguage(SfxItemSet const &aSet, sal_uInt16 nLangWhichId)
bool IsDefBulletFontUserDefined()
determine if default bullet font is user defined
SvxNumberFormat::SvxNumPositionAndSpaceMode GetDefaultPositionAndSpaceMode()
const vcl::Font & GetDefBulletFont()
retrieve font used for the default bullet list characters
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)
bool FrameContainsNode(SwContentFrame const &rFrame, SwNodeOffset nNodeIndex)
bool GetRanges(std::vector< std::shared_ptr< SwUnoCursor > > &rRanges, SwDoc &rDoc, SwPaM const &rDelPam)
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
SwNodeOffset abs(const SwNodeOffset &a)
@ NONE
For internal use only.
bool GoInNode(SwPaM &rPam, SwMoveFnCollection const &fnMove)
SwMoveFnCollection const & fnMoveBackward
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
void SetAllScriptItem(SfxItemSet &rSet, const SfxPoolItem &rItem)
@ RES_POOLCOLL_TEXT
Text body.
@ RES_POOLCOLL_STANDARD
Standard.
@ RES_POOLCOLL_BULLET_LEVEL1
1st level.
@ RES_POOLCOLL_TEXT_NEGIDENT
Text body hanging indent.
@ RES_POOLCOLL_CONFRONTATION
List indent.
@ RES_POOLCOLL_TEXT_MOVE
Text body indent.
@ RES_POOLCOLL_NUM_LEVEL1
1st level.
@ RES_POOLCOLL_HEADLINE1
Heading 1.
@ RES_POOLCOLL_TEXT_IDENT
Text body first line indent.
@ RES_POOLCHR_BULLET_LEVEL
Bullets.
@ RES_POOLCHR_NUM_LEVEL
Numbering symbols.
bool IsPoolUserFormat(sal_uInt16 nId)
const std::vector< OUString > & GetAutoFormatNameLst() const
Marks a position in the document model.
void Adjust(SwNodeOffset nDelta)
Adjust node position, and resets content position to zero.
void SetMark(const sw::mark::IMark *pMark)
void Assign(const SwNode &rNd, SwNodeOffset nDelta, sal_Int32 nContentOffset=0)
These all set both nNode and nContent.
void SetContent(sal_Int32 nContentIndex)
Set content index, only valid to call this if the position points to a SwContentNode subclass.
sal_Int32 GetContentIndex() const
SwTextNode const * pLastNode
mainly for sanity checks
SVX_NUM_CHARS_LOWER_LETTER
SVX_NUM_CHARS_UPPER_LETTER
constexpr sal_uInt16 lNumberIndent
constexpr short lBulletIndent
constexpr sal_Int32 COMPLETE_STRING
constexpr short lBulletFirstLineOffset
constexpr sal_uInt8 MAXLEVEL