20#include <com/sun/star/text/ReferenceFieldPart.hpp>
21#include <com/sun/star/text/ReferenceFieldSource.hpp>
76 sal_uInt32 nRefNumFormat);
86 rArr.push_back( pFrame );
93 pFrame =
static_cast<const SwFlyFrame*
>(pFrame)->GetAnchorFrame();
101 const SwTextNode& rBehindNd, sal_Int32 nSttPos )
108 if( !pFrame || !pMyFrame)
113 while (pFrame && !pFrame->
IsInside(nSttPosIndex))
115 while (pMyFrame && !pMyFrame->
IsInside(nMySttPosIndex))
118 if( !pFrame || !pMyFrame || pFrame == pMyFrame )
121 std::vector<const SwFrame*> aRefArr,
aArr;
125 size_t nRefCnt = aRefArr.size() - 1, nCnt =
aArr.size() - 1;
130 while( nRefCnt && nCnt && aRefArr[ nRefCnt ] ==
aArr[ nCnt ] )
140 if( aRefArr[ nRefCnt ] ==
aArr[ nCnt ] )
148 const SwFrame* pRefFrame = aRefArr[ nRefCnt ];
152 bool bRefIsLower =
false;
181 pFieldFrame =
aArr[ nCnt - 1 ];
183 pRefFrame = aRefArr[ nRefCnt - 1 ];
218 std::u16string_view rReferenceLanguage)
220 if (eLang !=
LANGUAGE_HUNGARIAN || (rReferenceLanguage !=
u"hu" && rReferenceLanguage !=
u"Hu"))
241 sal_Int32 nLen = rRefText.getLength();
246 bool bArticleAz =
false;
251 for (
i=0;
i<nLen && (sNumbering.isEmpty() ||
252 ((bNum && aCharClass.
isDigit(rRefText,
i)) ||
253 (!bNum && aCharClass.
isLetter(rRefText,
i)))); ++
i)
257 sNumbering = rRefText.copy(
i);
258 bNum = aCharClass.
isDigit(rRefText,
i);
263 nLen =
i - (rRefText.getLength() - sNumbering.getLength());
269 if ((sNumbering.startsWith(
"1") && (nLen == 1 || nLen == 4 || nLen == 7 || nLen == 10)) ||
270 sNumbering.startsWith(
"5"))
273 else if (nLen == 1 && sNumbering[0] < 128)
278 static const std::u16string_view sLettersStartingWithVowels =
u"aefilmnorsuxyAEFILMNORSUXY";
279 if (sLettersStartingWithVowels.find(sNumbering[0]) != std::u16string_view::npos)
282 if (bClosingParenthesis ||
283 (sNumbering[0] !=
'x' && sNumbering[0] !=
'X'))
285 }
else if ((sNumbering[0] ==
'v' || sNumbering[0] ==
'V') && !bClosingParenthesis)
291 static const sal_Unicode sVowelsWithDiacritic[] = {
292 0x00E1, 0x00C1, 0x00E9, 0x00C9, 0x00ED, 0x00CD,
293 0x00F3, 0x00D3, 0x00F6, 0x00D6, 0x0151, 0x0150,
294 0x00FA, 0x00DA, 0x00FC, 0x00DC, 0x0171, 0x0170, 0 };
295 static const OUString sVowels = OUString::Concat(
u"aAeEiIoOuU") + sVowelsWithDiacritic;
300 bool bRomanNumber =
false;
301 if (nLen > 1 && (nLen + 1 >= sNumbering.getLength() || sNumbering[nLen] ==
'.'))
304 OUString sNumberingTrim;
306 sNumberingTrim = sNumbering.copy(0, nLen - 1);
308 sNumberingTrim = sNumbering.copy(0, nLen);
310 sNumberingTrim.replaceAll(
"i",
"").replaceAll(
"v",
"").replaceAll(
"x",
"").replaceAll(
"l",
"").replaceAll(
"c",
"").isEmpty() ||
311 sNumberingTrim.replaceAll(
"I",
"").replaceAll(
"V",
"").replaceAll(
"X",
"").replaceAll(
"L",
"").replaceAll(
"C",
"").isEmpty();
317 (sNumbering[0] ==
'i' && sNumbering[1] !=
'i' && sNumbering[1] !=
'v' && sNumbering[1] !=
'x') ||
318 (sNumbering[0] ==
'I' && sNumbering[1] !=
'I' && sNumbering[1] !=
'V' && sNumbering[1] !=
'X') ||
319 (sNumbering[0] ==
'v' && sNumbering[1] !=
'i') ||
320 (sNumbering[0] ==
'V' && sNumbering[1] !=
'I') ||
321 (sNumbering[0] ==
'l' && sNumbering[1] !=
'x') ||
322 (sNumbering[0] ==
'L' && sNumbering[1] !=
'X')) ) ||
324 ( !bRomanNumber && sVowels.indexOf(sNumbering[0]) != -1))
330 if ( sNumbering.startsWith(
"A ") || sNumbering.startsWith(
"Az ") ||
331 sNumbering.startsWith(
"a ") || sNumbering.startsWith(
"az ") )
337 if ( rReferenceLanguage ==
u"hu" )
345 rRefText = sArticle +
" " + rRefText;
350 OUString aSetRef, OUString aSetReferenceLanguage, sal_uInt16 nSubTyp,
351 sal_uInt16 nSequenceNo,
sal_uLong nFormat )
352 :
SwField( pFieldType, nFormat ),
353 m_sSetRefName(
std::move(aSetRef) ),
354 m_sSetReferenceLanguage(
std::move(aSetReferenceLanguage) ),
355 m_nSubType( nSubTyp ),
356 m_nSeqNo( nSequenceNo )
397 sal_Int32 nDummy = -1;
404 OUStringBuffer sRet(sText.size() * 2);
405 for (
size_t i = 0;
i < sText.size(); ++
i)
407 sRet.append(sText[
i]);
410 return sRet.makeStringAndClear();
418 if ( !pReferencedTextNode )
425 if ( sRet.isEmpty() )
457 std::u16string_view rSetReferenceLanguage)
463 rText = rText.replaceAll(
u"\u00ad",
"");
464 OUStringBuffer
aBuf(rText);
465 const sal_Int32 l =
aBuf.getLength();
466 for (sal_Int32
i = 0;
i < l; ++
i)
472 else if (
aBuf[
i] == 0x2011)
477 rText =
aBuf.makeStringAndClear();
478 if (!rSetReferenceLanguage.empty())
492 sal_Int32 nNumStart = -1;
493 sal_Int32 nNumEnd = -1;
509 if (pLay->IsHideRedlines())
511 pLayoutRLHidden = pLay;
520 const OUString aText = pTextNd->
GetText();
522 const bool bHasCat = nCatStart>=0;
523 const sal_Int32 nCatEnd = bHasCat ? nCatStart +
m_sSetRefName.getLength() : -1;
526 const sal_Int32 nLen = aText.getLength();
549 nStart =
std::min(nNumStart, nCatStart);
550 nEnd = std::max(nNumEnd, nCatEnd);
564 const sal_Int32 nFrom = bHasCat
565 ? std::max(nNumStart + 1, nCatEnd)
569 nStart = bHasCat ? std::max(nNumEnd, nCatEnd) : nNumEnd;
595 nEnd = nNumEnd<0 ? nLen : nNumEnd;
645 pLayoutRLHidden, *pTextNd,
false,
false,
ExpandMode(0));
662 [
this, pTextNd, nNumStart](OUString & rText,
SwRootFrame const*
const pLay)
669 while (pFrame && !pFrame->
IsInside(nNumStartIndex))
673 if( pFrame ||
nullptr != ( pFrame = pSave ))
685 rText = OUString::number(nPageNo);
702 [
this, pTextNd](OUString & rText,
SwRootFrame const*
const pLay)
727 if( !pFieldTextAttr || !pFieldTextAttr->
GetpTextNode() )
743 *pTextNd, nNumStart )
764 bool bClosingParenthesis =
result.second;
772 bClosingParenthesis =
result.second;
782 OSL_FAIL(
"<SwGetRefField::UpdateField(..)> - unknown format type");
790 const SwTextNode& i_rTextNodeOfReferencedItem,
791 const sal_uInt32 nRefNumFormat)
795 : i_rTextNodeOfField);
796 SwTextNode const& rTextNodeOfReferencedItem(pLayout
798 : i_rTextNodeOfReferencedItem);
799 if ( rTextNodeOfReferencedItem.
HasNumber(pLayout) &&
802 OSL_ENSURE( rTextNodeOfReferencedItem.
GetNum(pLayout),
803 "<SwGetRefField::MakeRefNumStr(..)> - referenced paragraph has number, but no <SwNodeNum> instance!" );
807 int nRestrictInclToThisLevel( 0 );
822 const SwNodeNum* pNodeNumForTextNodeOfField(
nullptr );
823 if ( rTextNodeOfField.
HasNumber(pLayout) &&
826 pNodeNumForTextNodeOfField = rTextNodeOfField.
GetNum(pLayout);
830 pNodeNumForTextNodeOfField =
833 if ( pNodeNumForTextNodeOfField )
839 std::size_t nLevel( 0 );
840 while ( nLevel < rFieldNumVec.size() && nLevel < rRefItemNumVec.size() )
842 if ( rRefItemNumVec[nLevel] == rFieldNumVec[nLevel] )
844 nRestrictInclToThisLevel = nLevel + 1;
856 const bool bInclSuperiorNumLabels(
860 OSL_ENSURE( rTextNodeOfReferencedItem.
GetNumRule(),
861 "<SwGetRefField::MakeRefNumStr(..)> - referenced numbered paragraph has no numbering rule set!" );
862 return std::make_pair(
864 *(rTextNodeOfReferencedItem.
GetNum(pLayout)),
865 bInclSuperiorNumLabels,
866 nRestrictInclToThisLevel ),
868 *(rTextNodeOfReferencedItem.
GetNum(pLayout)),
869 true).endsWith(
")") );
872 return std::make_pair(OUString(),
false);
882 return std::unique_ptr<SwField>(pField.release());
911 case REF_PAGE : nPart = ReferenceFieldPart::PAGE ;
break;
912 case REF_CHAPTER : nPart = ReferenceFieldPart::CHAPTER ;
break;
913 case REF_CONTENT : nPart = ReferenceFieldPart::TEXT ;
break;
914 case REF_UPDOWN : nPart = ReferenceFieldPart::UP_DOWN ;
break;
916 case REF_ONLYNUMBER : nPart = ReferenceFieldPart::CATEGORY_AND_NUMBER ;
break;
917 case REF_ONLYCAPTION: nPart = ReferenceFieldPart::ONLY_CAPTION ;
break;
918 case REF_ONLYSEQNO : nPart = ReferenceFieldPart::ONLY_SEQUENCE_NUMBER;
break;
920 case REF_NUMBER: nPart = ReferenceFieldPart::NUMBER;
break;
929 sal_Int16 nSource = 0;
932 case REF_SETREFATTR : nSource = ReferenceFieldSource::REFERENCE_MARK;
break;
933 case REF_SEQUENCEFLD: nSource = ReferenceFieldSource::SEQUENCE_FIELD;
break;
934 case REF_BOOKMARK : nSource = ReferenceFieldSource::BOOKMARK;
break;
935 case REF_OUTLINE : OSL_FAIL(
"not implemented");
break;
936 case REF_FOOTNOTE : nSource = ReferenceFieldSource::FOOTNOTE;
break;
969 rAny <<= static_cast<sal_Int16>(
m_nSeqNo);
987 case ReferenceFieldPart::PAGE: nPart =
REF_PAGE;
break;
988 case ReferenceFieldPart::CHAPTER: nPart =
REF_CHAPTER;
break;
989 case ReferenceFieldPart::TEXT: nPart =
REF_CONTENT;
break;
990 case ReferenceFieldPart::UP_DOWN: nPart =
REF_UPDOWN;
break;
992 case ReferenceFieldPart::CATEGORY_AND_NUMBER: nPart =
REF_ONLYNUMBER;
break;
994 case ReferenceFieldPart::ONLY_SEQUENCE_NUMBER : nPart =
REF_ONLYSEQNO;
break;
996 case ReferenceFieldPart::NUMBER: nPart =
REF_NUMBER;
break;
999 default:
return false;
1006 sal_Int16 nSource = 0;
1011 case ReferenceFieldSource::SEQUENCE_FIELD :
1045 sal_Int16 nSetSeq = 0;
1063 const OUString rPar1 =
GetPar1();
1073 pResId = STR_POOLCOLL_LABEL_ABB;
1076 pResId = STR_POOLCOLL_LABEL_TABLE;
1079 pResId = STR_POOLCOLL_LABEL_FRAME;
1082 pResId = STR_POOLCOLL_LABEL_DRAWING;
1085 pResId = STR_POOLCOLL_LABEL_FIGURE;
1098 return std::make_unique<SwGetRefFieldType>(
m_rDoc );
1103 std::vector<SwFormatField*> vFields;
1105 for(
auto pFormatField: vFields)
1112 nullptr != (pTField = pFormatField->GetTextField()) &&
1126 if (rHint.
GetId() != SfxHintId::SwLegacyModify)
1129 if(!pLegacy->m_pNew && !pLegacy->m_pOld)
1136 CallSwClientNotify(rHint);
1154 sal_Int32
const*
const pEnd(rHint.
GetEnd());
1171 sal_uInt16 nSubType, sal_uInt16 nSeqNo,
1172 sal_Int32* pStt, sal_Int32* pEnd,
1175 OSL_ENSURE( pStt,
"Why did no one check the StartPos?" );
1199 if( pFieldType && pFieldType->HasWriterListeners() &&
1202 std::vector<SwFormatField*> vFields;
1204 for(
auto pFormatField: vFields)
1206 SwTextField *
const pTextField(pFormatField->GetTextField());
1207 if (pTextField && nSeqNo ==
1215 *pEnd = (*pStt) + 1;
1230 const ::sw::mark::IMark* pBkmk = *ppMark;
1231 const SwPosition* pPos = &pBkmk->GetMarkStart();
1237 if(!pBkmk->IsExpanded())
1243 OSL_ENSURE( pTextNd,
1244 "<SwGetRefFieldType::FindAnchor(..)> - node marked by cross-reference bookmark isn't a text node --> crash" );
1245 *pEnd = pTextNd->
Len();
1248 else if(pBkmk->GetOtherMarkPos().GetNode() == pBkmk->GetMarkPos().GetNode())
1249 *pEnd = pBkmk->GetMarkEnd().GetContentIndex();
1264 if( nSeqNo == pFootnoteIdx->GetSeqRefNo() )
1273 const SwNodeIndex* pIdx = pFootnoteIdx->GetStartNode();
1278 if(
nullptr == pTextNd )
1299 std::set<sal_uInt16> aIds;
1300 std::set<sal_uInt16> aDstIds;
1301 std::map<sal_uInt16, sal_uInt16> sequencedIds;
1305 static void GetNoteIdsFromDoc(
SwDoc& rDoc, std::set<sal_uInt16> &rIds );
1306 void GetFieldIdsFromDoc(
SwDoc& rDoc, std::set<sal_uInt16> &rIds );
1307 void AddId( sal_uInt16
id, sal_uInt16 seqNum );
1308 static sal_uInt16 GetFirstUnusedId( std::set<sal_uInt16> &rIds );
1311 explicit RefIdsMap( OUString _aName ) :
aName(
std::move( _aName )), bInit( false ) {}
1323void RefIdsMap::GetFieldIdsFromDoc(
SwDoc& rDoc, std::set<sal_uInt16> &rIds)
1328 std::vector<SwFormatField*> vFields;
1330 for(
const auto pF: vFields)
1337void RefIdsMap::GetNoteIdsFromDoc(
SwDoc& rDoc, std::set<sal_uInt16> &rIds)
1347void RefIdsMap::Init(
SwDoc& rDoc,
SwDoc& rDestDoc,
bool bField )
1354 GetFieldIdsFromDoc( rDestDoc, aIds );
1355 GetFieldIdsFromDoc( rDoc, aDstIds );
1358 for (
const auto& rId : aDstIds)
1359 AddId( GetFirstUnusedId(aIds), rId );
1365 std::vector<SwFormatField*> vFields;
1367 for(
auto pF: vFields)
1369 if(!pF->GetTextField())
1372 sal_uInt16
const n = pSetExp->GetSeqNumber();
1373 pSetExp->SetSeqNumber(sequencedIds[n]);
1379 GetNoteIdsFromDoc( rDestDoc, aIds );
1380 GetNoteIdsFromDoc( rDoc, aDstIds );
1382 for (
const auto& rId : aDstIds)
1383 AddId( GetFirstUnusedId(aIds), rId );
1388 sal_uInt16
const n = pFootnoteIdx->GetSeqRefNo();
1389 pFootnoteIdx->SetSeqNo(sequencedIds[n]);
1398sal_uInt16 RefIdsMap::GetFirstUnusedId( std::set<sal_uInt16> &rIds )
1402 for(
const auto& rId : rIds )
1416void RefIdsMap::AddId( sal_uInt16
id, sal_uInt16 seqNum )
1419 sequencedIds[ seqNum ] = id;
1425 Init( rDoc, rDestDoc, bField);
1427 sal_uInt16
const nSeqNo = rField.
GetSeqNo();
1434 if (sequencedIds.count(nSeqNo))
1436 rField.
SetSeqNo( sequencedIds[nSeqNo] );
1449 if (&rDestDoc == &
m_rDoc)
1462 RefIdsMap aFntMap { OUString() };
1463 std::vector<std::unique_ptr<RefIdsMap>> aFieldMap;
1465 std::vector<SwFormatField*> vFields;
1467 for(
auto pField: vFields)
1474 RefIdsMap* pMap =
nullptr;
1475 for(
auto n = aFieldMap.size();
n; )
1479 pMap = aFieldMap[
n ].get();
1486 aFieldMap.push_back(std::unique_ptr<RefIdsMap>(pMap));
1489 pMap->Check(
m_rDoc, rDestDoc, rRefField,
true);
1495 aFntMap.Check(
m_rDoc, rDestDoc, rRefField,
false);
bool isLetter(const OUString &rStr, sal_Int32 nPos) const
bool isLetterNumeric(const OUString &rStr, sal_Int32 nPos) const
bool isDigit(const OUString &rStr, sal_Int32 nPos) const
virtual SwFieldType * GetSysFieldType(const SwFieldIds eWhich) const =0
virtual SwFieldType * GetFieldType(SwFieldIds nResId, const OUString &rName, bool bDbFieldMatching) const =0
virtual const SwRootFrame * GetCurrentLayout() const =0
wrapper iterator: wraps iterator of implementation while hiding MarkBase class; only IMark instances ...
virtual const_iterator_t getAllMarksEnd() const =0
returns a STL-like random access iterator to the end of the sequence of marks.
virtual const_iterator_t findMark(const OUString &rMark) const =0
Finds a mark by name.
const OUString & getBelowWord() const
const OUString & getAboveWord() const
OUString GetNumStr(sal_Int32 nNo) const
void ChangeExpansion(const SwFrame &, const SwContentNode *, bool bSrchNum=false)
const OUString & GetNumber(SwRootFrame const *pLayout=nullptr) const
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
o3tl::sorted_vector< SwRootFrame * > GetAllLayouts()
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
SwFootnoteIdxs & GetFootnoteIdxs()
IDocumentMarkAccess * getIDocumentMarkAccess()
const SwFormatRefMark * GetRefMark(std::u16string_view rName) const
Instances of SwFields and those derived from it occur 0 to n times.
virtual OUString GetName() const
Only in derived classes.
void GatherFields(std::vector< SwFormatField * > &rvFormatFields, bool bCollectOnlyInDocNodes=true) const
Base class of all fields.
virtual void SetLanguage(LanguageType nLng)
void SetFormat(sal_uInt32 const nSet)
sal_uInt32 GetFormat() const
Query parameters for dialog and for BASIC.
SwFieldType * GetTyp() const
LanguageType GetLanguage() const
Language at field position.
general base class for all free-flowing frames
const SwRect & getFrameArea() const
Base class of the Writer layout elements.
sal_uInt16 GetVirtPageNum() const
SwFrameType GetType() const
bool IsRightToLeft() const
SwLayoutFrame * GetUpper()
SwPageFrame * FindPageFrame()
static sal_Int32 GetReferenceTextPos(const SwFormatField &rFormat, SwDoc &rDoc, sal_Int32 nHint=0)
Find the index of the reference text following the current field.
static SwTextNode * FindAnchor(SwDoc *pDoc, const OUString &rRefMark, sal_uInt16 nSubType, sal_uInt16 nSeqNo, sal_Int32 *pStt, sal_Int32 *pEnd=nullptr, SwRootFrame const *pLayout=nullptr)
SwGetRefFieldType(SwDoc &rDoc)
virtual std::unique_ptr< SwFieldType > Copy() const override
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
Overlay in order to update all ref-fields.
void MergeWithOtherDoc(SwDoc &rDestDoc)
void UpdateGetReferences()
virtual OUString GetPar1() const override
get reference name
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt16 nWhichId) const override
virtual OUString GetPar2() const override
void SetExpand(const OUString &rStr)
virtual void SetPar1(const OUString &rStr) override
set reference name
bool IsRefToNumItemCrossRefBookmark() const
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
virtual void SetSubType(sal_uInt16 n) override
OUString m_sTextRLHidden
result for layout with redlines hidden
virtual OUString GetFieldName() const override
get name or content
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt16 nWhichId) override
virtual sal_uInt16 GetSubType() const override
Get/set sub type.
bool IsRefToHeadingCrossRefBookmark() const
const SwTextNode * GetReferencedTextNode() const
void ConvertProgrammaticToUIName()
sal_uInt16 m_nSeqNo
reference to either a SwTextFootnote::m_nSeqNo or a SwSetExpField::mnSeqNo
OUString GetExpandedTextOfReferencedTextNode(SwRootFrame const &rLayout) const
OUString m_sSetReferenceLanguage
const OUString & GetSetRefName() const
virtual std::unique_ptr< SwField > Copy() const override
virtual OUString GetDescription() const override
SwGetRefField(SwGetRefFieldType *, OUString aSetRef, OUString aReferenceLanguage, sal_uInt16 nSubType, sal_uInt16 nSeqNo, sal_uLong nFormat)
get references
void SetSeqNo(sal_uInt16 n)
virtual ~SwGetRefField() override
sal_uInt16 GetSeqNo() const
Get/set SequenceNo (of interest only for REF_SEQUENCEFLD).
void UpdateField(const SwTextField *pFieldTextAttr)
The <SwTextField> instance, which represents the text attribute for the <SwGetRefField> instance,...
Marks a node in the document model.
const SwNodeNum * GetPrecedingNodeNumOf(const SwTextNode &rTextNode) const
determines the <SwNodeNum> instance, which is preceding the given text node
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
const SwStartNode * FindFooterStartNode() const
const SwStartNode * FindHeaderStartNode() const
const SwStartNode * FindFlyStartNode() const
const SwStartNode * FindFootnoteStartNode() const
SwContentNode * GoNext(SwNodeIndex *) const
OUString MakeRefNumString(const SwNodeNum &rNodeNum, const bool bInclSuperiorNumLabels, const int nRestrictInclToThisLevel) const
OUString MakeNumString(const SwNodeNum &, bool bInclStrings=true) const
SwNumberTree::tNumberVector GetNumberVector() const
Returns level numbers of this node.
const SvxNumberType & GetNumType() const
A page of the document layout.
SwPageDesc * GetPageDesc()
void Top(const tools::Long nTop)
void Left(const tools::Long nLeft)
The root element of a Writer document layout.
bool HasMergedParas() const
bool IsHideRedlines() const
Replacement for sw::DocumentRedlineManager::GetRedlineFlags() (this is layout-level redline hiding).
sal_uInt16 GetSeqNumber() const
static SW_DLLPUBLIC sal_uInt16 GetPoolIdFromUIName(const OUString &rName, SwGetPoolIdFromName)
static sal_uInt16 GetPoolIdFromProgName(const OUString &rName, SwGetPoolIdFromName)
static void FillProgName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
virtual const sal_Int32 * GetEnd() const override
end position
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
sal_Int32 GetAnyEnd() const
end (if available), else start
const SwFormatFootnote & GetFootnote() const
sal_Int32 GetStart() const
bool HasDummyChar() const
SwTextNode & GetTextNode() const
SwTextNode * GetpTextNode() const
Represents the visualization of a paragraph.
SwTextFrame * GetFollow()
TextFrameIndex MapModelToView(SwTextNode const *pNode, sal_Int32 nIndex) const
bool IsInside(TextFrameIndex nPos) const
Respect the Follows.
SwTextNode is a paragraph in the document model.
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...
virtual sal_Int32 Len() const override
const SwNodeNum * GetNum(SwRootFrame const *pLayout=nullptr, SwListRedlineType eRedline=SwListRedlineType::SHOW) const
bool IsCountedInList() const
SwNumRule * GetNumRule(bool bInParent=true) const
Returns numbering rule of this text node.
bool HasNumber(SwRootFrame const *pLayout=nullptr) const
Returns if this text node has a number.
int GetActualListLevel(SwListRedlineType eRedline=SwListRedlineType::SHOW) const
Returns the actual list level of this text node, when it is a list item.
const OUString & GetText() const
LanguageType GetLang(const sal_Int32 nBegin, const sal_Int32 nLen=0, sal_uInt16 nScript=0) const
SwTextAttr * GetTextAttrForCharAt(const sal_Int32 nIndex, const sal_uInt16 nWhich=RES_TXTATR_END) const
get the text attribute at position nIndex which owns the dummy character CH_TXTATR_* at that position...
const SwTextNode & GetTextNode() const
static ShellResource * GetShellRes()
static bool IsLegalName(std::u16string_view rName)
static bool IsLegalName(std::u16string_view rName)
virtual OUString GetName() const override
constexpr TypedWhichId< SwFormatField > RES_TXTATR_FIELD(RES_TXTATR_NOEND_BEGIN)
#define LANGUAGE_HUNGARIAN
ExpandMode
Some helpers for converting model strings to view strings.
std::vector< tSwNumTreeNumber > tNumberVector
constexpr OUStringLiteral last
const SwGetSetExpType GSE_SEQ
Sequence.
Dialog to specify the properties of date form field.
bool IsFieldDeletedInModel(IDocumentRedlineAccess const &rIDRA, SwTextField const &rTextField)
bool IsFootnoteDeleted(IDocumentRedlineAccess const &rIDRA, SwTextFootnote const &rTextFootnote)
bool IsMarkHidden(SwRootFrame const &rLayout, ::sw::mark::IMark const &rMark)
OUString GetExpandTextMerged(SwRootFrame const *const pLayout, SwTextNode const &rNode, bool const bWithNumber, bool const bWithSpacesForLevel, ExpandMode const i_mode)
bool IsMarkHintHidden(SwRootFrame const &rLayout, SwTextNode const &rNode, SwTextAttrEnd const &rHint)
SwTextNode * GetParaPropsNode(SwRootFrame const &rLayout, SwNode const &rNode)
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
@ RES_POOLCOLL_LABEL_DRAWING
Label drawing objects.
@ RES_POOLCOLL_LABEL_FRAME
Label frame.
@ RES_POOLCOLL_LABEL_FIGURE
Label figure.
@ RES_POOLCOLL_LABEL_TABLE
Label table.
@ RES_POOLCOLL_LABEL_ABB
Label illustration.
static void lcl_GetLayTree(const SwFrame *pFrame, std::vector< const SwFrame * > &rArr)
static std::pair< OUString, bool > MakeRefNumStr(SwRootFrame const *pLayout, const SwTextNode &rTextNodeOfField, const SwTextNode &rTextNodeOfReferencedItem, sal_uInt32 nRefNumFormat)
bool IsFrameBehind(const SwTextNode &rMyNd, sal_Int32 nMySttPos, const SwTextNode &rBehindNd, sal_Int32 nSttPos)
static OUString lcl_formatStringByCombiningCharacter(std::u16string_view sText, const sal_Unicode cChar)
static void FilterText(OUString &rText, LanguageType const eLang, std::u16string_view rSetReferenceLanguage)
static void lcl_formatReferenceLanguage(OUString &rRefText, bool bClosingParenthesis, LanguageType eLang, std::u16string_view rReferenceLanguage)
@ REF_PAGE_PGDESC
"As Page Style"
@ REF_UPDOWN
"Above/Below"
@ REF_NUMBER
new reference format types for referencing bookmarks and set references
@ REF_ONLYSEQNO
"Numbering"
@ REF_ONLYNUMBER
"Category and Number"
@ REF_ONLYCAPTION
"Caption Text"
@ REF_NUMBER_NO_CONTEXT
"Number (no context)"
@ REF_NUMBER_FULL_CONTEXT
"Number (full context)"
OUString aGetRefField_RefItemNotFound
Marks a position in the document model.
sal_Int32 GetContentIndex() const
OUString SwResId(TranslateId aId)
constexpr sal_uInt8 MAXLEVEL
#define FIELD_PROP_USHORT1
#define FIELD_PROP_USHORT2
#define FIELD_PROP_SHORT1