20#include <com/sun/star/uri/UriReferenceFactory.hpp>
23#include <osl/diagnose.h>
26#include <officecfg/Office/Common.hxx>
59 OUString aSortAlgorithm ) :
61 m_sSortAlgorithm(
std::move(aSortAlgorithm)),
68 m_eLang( rIntl.m_eLang ),
69 m_sSortAlgorithm(rIntl.m_sSortAlgorithm),
70 m_nOptions( rIntl.m_nOptions )
85 if(
aSeq.hasElements())
115 const lang::Locale& rLocale1,
117 const lang::Locale& rLocale2 )
const
124 const lang::Locale& rLocale )
const
138 const lang::Locale* pLocale )
139 : pTOXNd( nullptr ), pTextMark( pMark ), pTOXIntl( pInter ),
141 , m_bValidText( false )
164 if( nPos < pNd->GetNodes().GetEndOfExtras().GetIndex() )
168 std::pair<Point, bool> tmp(aPt,
false);
177 OSL_ENSURE(bResult,
"where is the text node");
208 OUString
const decodedUrl(
213 return std::make_pair(decodedUrl,
true);
245 bRet = ( ( pEnd && pEndCmp ) || ( !pEnd && !pEndCmp ) ) &&
268 if( pFirst && pFirst == pNext )
282 if( ( pEnd && pEndCmp ) || ( !pEnd && !pEndCmp ) )
287 if( pEnd && !pEndCmp )
306 const lang::Locale& rLocale )
324 OSL_ENSURE(
pTextMark,
"pTextMark == 0, No keyword");
340 OSL_ENSURE(
pTextMark,
"pTextMark == 0, No keyword");
364 OSL_ENSURE(
pTextMark,
"pTextMark == 0, No keyword");
401 assert(!
"sw_redlinehide: this is dead code, Bibliography only has SwTOXAuthority");
430 OSL_ENSURE(
pTextMark,
"pTextMark == 0, No keyword");
448 const lang::Locale& rLocale )
450 m_aKey(
std::move(aKey)), nLev(nLevel)
511 assert(!
"sw_redlinehide: this is dead code, Bibliography only has SwTOXAuthority");
540 m_sSequenceName(
std::move( sSeqName ))
582 pLayout, *
static_cast<const SwTextNode*
>(pNd),
597 OSL_ENSURE(
false,
"Graphic/object without name" );
601 ? STR_GRAPHIC_DEFNAME
614 assert(!
"sw_redlinehide: this is dead code, Bibliography only has SwTOXAuthority");
623 pLayout,
false,
false,
true );
631 pLayout,
false,
false,
true );
639 assert(pSrc == pMerged->pParaPropsNode);
641 i <= pMerged->pLastNode->GetIndex(); ++
i)
648 rNd, &rInsPos, 0, -1,
649 pLayout,
false,
false,
false );
670 const int nTmp =
static_cast<const SwTextNode*
>(pNd)->GetAttrOutlineLevel();
672 nRet = o3tl::narrowing<sal_uInt16>(nTmp);
694 aText =
"#" + pMark->
GetName();
713 default: pStr =
nullptr;
716 aText += OUString::createFromAscii( pStr );
728 return std::make_pair(aText,
false);
764 OSL_ENSURE(
false,
"Where's my table?" );
777 return std::make_pair(OUString(),
false);
781 return std::make_pair(OUString(),
false);
783 const OUString
sName =
static_cast<const SwTableNode*
>(pNd)->GetTable().GetFrameFormat()->GetName();
784 if (
sName.isEmpty() )
785 return std::make_pair(OUString(),
false);
806 nRet = sText.toUInt32();
834 if(cChar && cChar !=
' ')
835 sText = sText.copy(1);
837 if(cChar && cChar !=
' ')
838 sText = sText.copy(0, sText.getLength() - 1);
853 OUString aText = rText;
855 uno::Reference<uri::XUriReferenceFactory> xUriReferenceFactory
857 uno::Reference<uri::XUriReference> xUriRef;
860 xUriRef = xUriReferenceFactory->parse(aText);
862 catch (
const uno::Exception& rException)
865 "SwTOXAuthority::GetSourceURL: failed to parse url: " << rException.Message);
867 if (xUriRef.is() && xUriRef->getFragment().startsWith(
"page="))
869 xUriRef->clearFragment();
870 aText = xUriRef->getUriReference();
879 OUString aText =
GetText(nAuthField, pLayout);
888 std::u16string_view aBaseURIScheme;
889 sal_Int32 nSep = aBaseURL.indexOf(
':');
892 aBaseURIScheme = aBaseURL.subView(0, nSep);
895 uno::Reference<uri::XUriReferenceFactory> xUriReferenceFactory
897 uno::Reference<uri::XUriReference> xUriRef;
900 xUriRef = xUriReferenceFactory->parse(aText);
902 catch (
const uno::Exception& rException)
905 "SwTOXAuthority::FillText: failed to parse url: " << rException.Message);
909 if (xUriRef.is() && bSaveRelFSys && xUriRef->getScheme() == aBaseURIScheme)
virtual const SwRootFrame * GetCurrentLayout() const =0
@ CROSSREF_HEADING_BOOKMARK
virtual ::sw::mark::IMark * getMarkForTextNode(const SwTextNode &rTextNode, MarkType eMark)=0
Returns a mark in the document for a paragraph.
static OUString GetRelURL(std::u16string_view rTheBaseURIRef, OUString const &rTheAbsURIRef, EncodeMechanism eEncodeMechanism=EncodeMechanism::WasEncoded, DecodeMechanism eDecodeMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)
static css::lang::Locale convertToLocale(LanguageType nLangID, bool bResolveSystem=true)
virtual OUString getDocumentBaseURL() const override
OUString const & GetAuthorField(ToxAuthorityField ePos) const
const SwTOXSortKey * GetSortKey(sal_uInt16 nIdx) const
sal_Unicode GetPrefix() const
static OUString const & GetAuthTypeName(ToxAuthorityType eType)
sal_Unicode GetSuffix() const
bool IsSortByDocument() const
sal_uInt16 GetSortKeyCount() const
Represents an inserted bibliography entry, created using Insert -> Table of Contents and Index -> Bib...
const OUString & GetFieldText(ToxAuthorityField eField) const
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
Marks a character position inside a document model content node (SwContentNode)
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
IDocumentMarkAccess * getIDocumentMarkAccess()
SwDocShell * GetDocShell()
OUString ExpandField(bool bCached, SwRootFrame const *pLayout) const
expand the field.
SwFieldType * GetTyp() const
Base class of the Writer document model elements.
SwFrameFormat * GetFlyFormat() const
If node is in a fly return the respective format.
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwNodeOffset GetIndex() const
SwNodes & GetNodes()
Node is in which nodes-array/doc?
SwTableNode * FindTableNode()
Search table node, in which it is.
Merge GetRedlineMergeFlag() const
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).
OUString ToUpper(const OUString &rStr, sal_Int32 nPos) const
bool IsNumeric(const OUString &rStr) const
OUString GetIndexKey(const TextAndReading &rTaR, const css::lang::Locale &rLcl) const
std::optional< CharClass > m_oCharClass
std::unique_ptr< IndexEntrySupplierWrapper > m_pIndexWrapper
bool IsLess(const TextAndReading &rTaR1, const css::lang::Locale &rLocale1, const TextAndReading &rTaR2, const css::lang::Locale &rLocale2) const
sal_Int32 Compare(const TextAndReading &rTaR1, const css::lang::Locale &rLocale1, const TextAndReading &rTaR2, const css::lang::Locale &rLocale2) const
OUString GetFollowingText(bool bMorePages) const
SwTOXInternational(LanguageType nLang, SwTOIOptions nOptions, OUString aSortAlgorithm)
bool IsEqual(const TextAndReading &rTaR1, const css::lang::Locale &rLocale1, const TextAndReading &rTaR2, const css::lang::Locale &rLocale2) const
OUString m_sSortAlgorithm
const SwTOXType * GetTOXType() const
sal_uInt16 GetLevel() const
OUString const & GetSecondaryKeyReading() const
const OUString & GetAlternativeText() const
bool IsAlternativeText() const
OUString const & GetSecondaryKey() const
OUString GetText(SwRootFrame const *pLayout) const
OUString const & GetPrimaryKey() const
OUString const & GetTextReading() const
OUString const & GetPrimaryKeyReading() const
const OUString & GetTypeName() const
const SwTable & GetTable() const
SwTableFormat * GetFrameFormat()
const sal_Int32 * End() const
sal_Int32 GetStart() const
const SwTOXMark & GetTOXMark() const
Represents the visualization of a paragraph.
SwTextNode is a paragraph in the document model.
OUString InsertText(const OUString &rStr, const SwContentIndex &rIdx, const SwInsertFlags nMode=SwInsertFlags::DEFAULT)
insert text content
bool CopyExpandText(SwTextNode &rDestNd, const SwContentIndex *pDestIdx, sal_Int32 nIdx, sal_Int32 nLen, SwRootFrame const *pLayout, bool bWithNum=false, bool bWithFootnote=true, bool bReplaceTabsWithSpaces=false) const
virtual const OUString & GetName() const =0
const SwTextNode * GetBodyTextNode(const SwDoc &rDoc, SwPosition &rPos, const SwFrame &rFrame)
Forward declaration: get "BodyTextNode" for exp.fld in Fly's headers/footers/footnotes.
Sequence< sal_Int8 > aSeq
#define SAL_WARN(area, stream)
ExpandMode
Some helpers for converting model strings to view strings.
Reference< XComponentContext > getProcessComponentContext()
constexpr T1 narrowing(T2 value)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
OUString GetExpandTextMerged(SwRootFrame const *const pLayout, SwTextNode const &rNode, bool const bWithNumber, bool const bWithSpacesForLevel, ExpandMode const i_mode)
bool IsFrameBehind(const SwTextNode &rMyNd, sal_Int32 nMySttPos, const SwTextNode &rBehindNd, sal_Int32 nSttPos)
static LanguageType nLang
Marks a position in the document model.
SwNodeOffset GetNodeIndex() const
sal_Int32 GetContentIndex() const
Represents one row in the bibliography table.
virtual bool equivalent(const SwTOXSortTabBase &) override
virtual void FillText(SwTextNode &rNd, const SwContentIndex &rInsPos, sal_uInt16 nAuthField, SwRootFrame const *pLayout) const override
virtual TextAndReading GetText_Impl(SwRootFrame const *pLayout) const override
virtual bool sort_lt(const SwTOXSortTabBase &) override
SwTOXAuthority(const SwContentNode &rNd, SwFormatField &rField, const SwTOXInternational &rIntl)
virtual sal_uInt16 GetLevel() const override
static OUString GetSourceURL(const OUString &rText)
Gets the URL of the underlying SwAuthEntry, ignoring its page number.
virtual void FillText(SwTextNode &rNd, const SwContentIndex &rInsPos, sal_uInt16 nAuthField, SwRootFrame const *pLayout) const override
SwTOXContent(const SwTextNode &, const SwTextTOXMark *, const SwTOXInternational &rIntl)
virtual sal_uInt16 GetLevel() const override
virtual TextAndReading GetText_Impl(SwRootFrame const *pLayout) const override
virtual TextAndReading GetText_Impl(SwRootFrame const *pLayout) const override
SwTOXCustom(TextAndReading aKey, sal_uInt16 nLevel, const SwTOXInternational &rIntl, const css::lang::Locale &rLocale)
virtual bool equivalent(const SwTOXSortTabBase &) override
virtual sal_uInt16 GetLevel() const override
virtual bool sort_lt(const SwTOXSortTabBase &) override
virtual bool equivalent(const SwTOXSortTabBase &) override
SwTOXIndex(const SwTextNode &, const SwTextTOXMark *, SwTOIOptions nOptions, sal_uInt8 nKeyLevel, const SwTOXInternational &rIntl, const css::lang::Locale &rLocale)
virtual TextAndReading GetText_Impl(SwRootFrame const *pLayout) const override
virtual sal_uInt16 GetLevel() const override
virtual bool sort_lt(const SwTOXSortTabBase &) override
virtual void FillText(SwTextNode &rNd, const SwContentIndex &rInsPos, sal_uInt16 nAuthField, SwRootFrame const *pLayout) const override
SwTOXPara(SwContentNode &, SwTOXElement, sal_uInt16 nLevel=FORM_ALPHA_DELIMITER, OUString sSeqName=OUString())
virtual std::pair< OUString, bool > GetURL(SwRootFrame const *const pLayout) const override
virtual TextAndReading GetText_Impl(SwRootFrame const *pLayout) const override
virtual void FillText(SwTextNode &rNd, const SwContentIndex &rInsPos, sal_uInt16 nAuthField, SwRootFrame const *pLayout) const override
virtual bool IsFullPara() const override
virtual sal_uInt16 GetLevel() const override
Class for sorting directories.
virtual sal_uInt16 GetLevel() const =0
SwTOXSortTabBase(TOXSortType nType, const SwContentNode *pTOXSrc, const SwTextTOXMark *pTextMark, const SwTOXInternational *pIntl, const css::lang::Locale *pLocale=nullptr)
std::vector< SwTOXSource > aTOXSources
static SwTOIOptions GetOptions()
const css::lang::Locale & GetLocale() const
virtual std::pair< OUString, bool > GetURL(SwRootFrame const *const pLayout) const
virtual void FillText(SwTextNode &rNd, const SwContentIndex &rInsPos, sal_uInt16 nAuthField, SwRootFrame const *pLayout) const
virtual bool sort_lt(const SwTOXSortTabBase &)
css::lang::Locale aLocale
TextAndReading const & GetText() const
virtual bool IsFullPara() const
const SwTextTOXMark * pTextMark
virtual bool equivalent(const SwTOXSortTabBase &)
const SwTOXInternational * pTOXIntl
virtual TextAndReading GetText_Impl(SwRootFrame const *pLayout) const override
virtual std::pair< OUString, bool > GetURL(SwRootFrame const *const pLayout) const override
virtual sal_uInt16 GetLevel() const override
SwTOXTable(const SwContentNode &rNd)
Describes parts of multiple text nodes, which will form a text frame, even when redlines are hidden a...
OUString SwResId(TranslateId aId)
#define SW_COLLATOR_IGNORES
sal_Unicode const toxMarkSeparator
separator for toxmarks: #<no>%19<text>%19<type><typename>|toxmark
const sal_Unicode cMarkSeparator
#define FORM_SECONDARY_KEY
#define FORM_ALPHA_DELIMITER
@ AUTH_FIELD_AUTHORITY_TYPE
static OUString lcl_GetText(SwFormatField const &rField, SwRootFrame const *const pLayout)