LibreOffice Module sw (master)  1
txmsrt.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <com/sun/star/uri/UriReferenceFactory.hpp>
21 
22 #include <unotools/charclass.hxx>
23 #include <osl/diagnose.h>
24 #include <tools/urlobj.hxx>
26 #include <officecfg/Office/Common.hxx>
27 #include <txtfld.hxx>
28 #include <doc.hxx>
30 #include <IDocumentMarkAccess.hxx>
31 #include <cntfrm.hxx>
32 #include <txtfrm.hxx>
33 #include <rootfrm.hxx>
34 #include <modeltoviewhelper.hxx>
35 #include <node.hxx>
36 #include <pam.hxx>
37 #include <txttxmrk.hxx>
38 #include <frmfmt.hxx>
39 #include <fmtfld.hxx>
40 #include <txmsrt.hxx>
41 #include <ndtxt.hxx>
42 #include <swtable.hxx>
43 #include <expfld.hxx>
44 #include <authfld.hxx>
45 #include <toxwrap.hxx>
46 
47 #include <strings.hrc>
48 #include <reffld.hxx>
49 #include <docsh.hxx>
50 
51 using namespace ::com::sun::star;
52 using namespace ::com::sun::star::uno;
53 
54 // Initialize strings
56 
58  const OUString& rSortAlgorithm ) :
59  m_eLang( nLang ),
60  m_sSortAlgorithm(rSortAlgorithm),
61  m_nOptions( nOpt )
62 {
63  Init();
64 }
65 
67  m_eLang( rIntl.m_eLang ),
68  m_sSortAlgorithm(rIntl.m_sSortAlgorithm),
69  m_nOptions( rIntl.m_nOptions )
70 {
71  Init();
72 }
73 
75 {
77 
78  const lang::Locale aLcl( LanguageTag::convertToLocale( m_eLang ) );
79  m_pIndexWrapper->SetLocale( aLcl );
80 
81  if(m_sSortAlgorithm.isEmpty())
82  {
83  Sequence < OUString > aSeq( m_pIndexWrapper->GetAlgorithmList( aLcl ));
84  if(aSeq.hasElements())
85  m_sSortAlgorithm = aSeq.getConstArray()[0];
86  }
87 
89  m_pIndexWrapper->LoadAlgorithm( aLcl, m_sSortAlgorithm, 0 );
90  else
91  m_pIndexWrapper->LoadAlgorithm( aLcl, m_sSortAlgorithm, SW_COLLATOR_IGNORES );
92 
93  m_pCharClass.reset( new CharClass( LanguageTag( aLcl )) );
94 
95 }
96 
98 {
99  m_pCharClass.reset();
100  m_pIndexWrapper.reset();
101 }
102 
103 OUString SwTOXInternational::ToUpper( const OUString& rStr, sal_Int32 nPos ) const
104 {
105  return m_pCharClass->uppercase( rStr, nPos, 1 );
106 }
107 
108 inline bool SwTOXInternational::IsNumeric( const OUString& rStr ) const
109 {
110  return m_pCharClass->isNumeric( rStr );
111 }
112 
114  const lang::Locale& rLocale1,
115  const TextAndReading& rTaR2,
116  const lang::Locale& rLocale2 ) const
117 {
118  return m_pIndexWrapper->CompareIndexEntry( rTaR1.sText, rTaR1.sReading, rLocale1,
119  rTaR2.sText, rTaR2.sReading, rLocale2 );
120 }
121 
123  const lang::Locale& rLocale ) const
124 {
125  return m_pIndexWrapper->GetIndexKey( rTaR.sText, rTaR.sReading, rLocale );
126 }
127 
128 OUString SwTOXInternational::GetFollowingText( bool bMorePages ) const
129 {
130  return m_pIndexWrapper->GetFollowingText( bMorePages );
131 }
132 
133 // SortElement for TOX entries
135  const SwTextTOXMark* pMark,
136  const SwTOXInternational* pInter,
137  const lang::Locale* pLocale )
138  : pTOXNd( nullptr ), pTextMark( pMark ), pTOXIntl( pInter ),
139  nPos( 0 ), nCntPos( 0 ), nType( o3tl::narrowing<sal_uInt16>(nTyp) )
140  , m_bValidText( false )
141 {
142  if ( pLocale )
143  aLocale = *pLocale;
144 
145  if( !pNd )
146  return;
147 
148  sal_Int32 n = 0;
149  if( pTextMark )
150  n = pTextMark->GetStart();
151  SwTOXSource aTmp( pNd, n, pTextMark && pTextMark->GetTOXMark().IsMainEntry() );
152  aTOXSources.push_back(aTmp);
153 
154  nPos = pNd->GetIndex();
155 
156  switch( nTyp )
157  {
158  case TOX_SORT_CONTENT:
159  case TOX_SORT_PARA:
160  case TOX_SORT_TABLE:
161  // If they are in a special areas, we should get the position at the
162  // body
163  if( nPos < pNd->GetNodes().GetEndOfExtras().GetIndex() )
164  {
165  // Then get the 'anchor' (body) position
166  Point aPt;
167  std::pair<Point, bool> tmp(aPt, false);
168  const SwContentFrame *const pFrame = pNd->getLayoutFrame(
170  nullptr, &tmp);
171  if( pFrame )
172  {
173  SwPosition aPos( *pNd );
174  const SwDoc& rDoc = pNd->GetDoc();
175  bool const bResult = GetBodyTextNode( rDoc, aPos, *pFrame );
176  OSL_ENSURE(bResult, "where is the text node");
177  nPos = aPos.nNode.GetIndex();
178  nCntPos = aPos.nContent.GetIndex();
179  }
180  }
181  else
182  nCntPos = n;
183  break;
184  default: break;
185  }
186 }
187 
188 std::pair<OUString, bool> SwTOXSortTabBase::GetURL(SwRootFrame const*const pLayout) const
189 {
190  OUString typeName;
191  SwTOXType const& rType(*pTextMark->GetTOXMark().GetTOXType());
192  switch (rType.GetType())
193  {
194  case TOX_INDEX:
195  typeName = "A";
196  break;
197  case TOX_CONTENT:
198  typeName = "C";
199  break;
200  case TOX_USER:
201  typeName = "U" + rType.GetTypeName();
202  break;
203  default:
204  assert(false); // other tox can't have toxmarks as source
205  break;
206  }
207  OUString const decodedUrl( // counter will be added by caller!
208  OUStringChar(toxMarkSeparator) + pTextMark->GetTOXMark().GetText(pLayout)
209  + OUStringChar(toxMarkSeparator) + typeName
210  + OUStringChar(cMarkSeparator) + "toxmark" );
211 
212  return std::make_pair(decodedUrl, true);
213 }
214 
216 {
217  return false;
218 }
219 
220 void SwTOXSortTabBase::FillText( SwTextNode& rNd, const SwIndex& rInsPos,
221  sal_uInt16, SwRootFrame const*const) const
222 {
223  rNd.InsertText( GetText().sText, rInsPos );
224 }
225 
227 {
228  bool bRet = nPos == rCmp.nPos && nCntPos == rCmp.nCntPos &&
229  (!aTOXSources[0].pNd || !rCmp.aTOXSources[0].pNd ||
230  aTOXSources[0].pNd == rCmp.aTOXSources[0].pNd );
231 
232  if( TOX_SORT_CONTENT == nType )
233  {
234  bRet = bRet && pTextMark && rCmp.pTextMark &&
235  pTextMark->GetStart() == rCmp.pTextMark->GetStart();
236 
237  if( bRet )
238  {
239  // Both pointers exist -> compare text
240  // else -> compare AlternativeText
241  const sal_Int32 *pEnd = pTextMark->End();
242  const sal_Int32 *pEndCmp = rCmp.pTextMark->End();
243 
244  bRet = ( ( pEnd && pEndCmp ) || ( !pEnd && !pEndCmp ) ) &&
246  rCmp.GetText(), rCmp.GetLocale() );
247  }
248  }
249  return bRet;
250 }
251 
253 {
254  if( nPos < rCmp.nPos )
255  return true;
256 
257  if( nPos == rCmp.nPos )
258  {
259  if( nCntPos < rCmp.nCntPos )
260  return true;
261 
262  if( nCntPos == rCmp.nCntPos )
263  {
264  const SwNode* pFirst = aTOXSources[0].pNd;
265  const SwNode* pNext = rCmp.aTOXSources[0].pNd;
266 
267  if( pFirst && pFirst == pNext )
268  {
269  if( TOX_SORT_CONTENT == nType && pTextMark && rCmp.pTextMark )
270  {
271  if( pTextMark->GetStart() < rCmp.pTextMark->GetStart() )
272  return true;
273 
274  if( pTextMark->GetStart() == rCmp.pTextMark->GetStart() )
275  {
276  const sal_Int32 *pEnd = pTextMark->End();
277  const sal_Int32 *pEndCmp = rCmp.pTextMark->End();
278 
279  // Both pointers exist -> compare text
280  // else -> compare AlternativeText
281  if( ( pEnd && pEndCmp ) || ( !pEnd && !pEndCmp ) )
282  {
283  return pTOXIntl->IsLess( GetText(), GetLocale(),
284  rCmp.GetText(), rCmp.GetLocale() );
285  }
286  if( pEnd && !pEndCmp )
287  return true;
288  }
289  }
290  }
291  else if( pFirst && pFirst->IsTextNode() &&
292  pNext && pNext->IsTextNode() )
293  return ::IsFrameBehind( *static_cast<const SwTextNode*>(pNext), nCntPos,
294  *static_cast<const SwTextNode*>(pFirst), nCntPos );
295  }
296  }
297  return false;
298 }
299 
300 // Sorted keyword entry
302  const SwTextTOXMark* pMark, SwTOIOptions nOptions,
303  sal_uInt8 nKyLevel,
304  const SwTOXInternational& rIntl,
305  const lang::Locale& rLocale )
306  : SwTOXSortTabBase( TOX_SORT_INDEX, &rNd, pMark, &rIntl, &rLocale ),
307  nKeyLevel(nKyLevel)
308 {
309  nPos = rNd.GetIndex();
310  nOpt = nOptions;
311 }
312 
313 // Compare keywords. Only relates to the text.
314 
316 {
317  const SwTOXIndex& rCmp = static_cast<const SwTOXIndex&>(rCmpBase);
318 
319  // Respect case taking dependencies into account
320  if(GetLevel() != rCmp.GetLevel() || nKeyLevel != rCmp.nKeyLevel)
321  return false;
322 
323  OSL_ENSURE(pTextMark, "pTextMark == 0, No keyword");
324 
325  bool bRet = pTOXIntl->IsEqual( GetText(), GetLocale(),
326  rCmp.GetText(), rCmp.GetLocale() );
327 
328  // If we don't summarize we need to evaluate the Pos
329  if(bRet && !(GetOptions() & SwTOIOptions::SameEntry))
330  bRet = nPos == rCmp.nPos;
331 
332  return bRet;
333 }
334 
335 // operator, only depends on the text
336 
338 {
339  OSL_ENSURE(pTextMark, "pTextMark == 0, No keyword");
340 
341  const TextAndReading aMyTaR(GetText());
342  const TextAndReading aOtherTaR(rCmpBase.GetText());
343 
344  bool bRet = GetLevel() == rCmpBase.GetLevel() &&
345  pTOXIntl->IsLess( aMyTaR, GetLocale(),
346  aOtherTaR, rCmpBase.GetLocale() );
347 
348  // If we don't summarize we need to evaluate the Pos
349  if( !bRet && !(GetOptions() & SwTOIOptions::SameEntry) )
350  {
351  bRet = pTOXIntl->IsEqual( aMyTaR, GetLocale(),
352  aOtherTaR, rCmpBase.GetLocale() ) &&
353  nPos < rCmpBase.nPos;
354  }
355 
356  return bRet;
357 }
358 
359 // The keyword itself
360 
362 {
363  OSL_ENSURE(pTextMark, "pTextMark == 0, No keyword");
364  const SwTOXMark& rTOXMark = pTextMark->GetTOXMark();
365 
366  TextAndReading aRet;
367  switch(nKeyLevel)
368  {
369  case FORM_PRIMARY_KEY :
370  {
371  aRet.sText = rTOXMark.GetPrimaryKey();
372  aRet.sReading = rTOXMark.GetPrimaryKeyReading();
373  }
374  break;
375  case FORM_SECONDARY_KEY :
376  {
377  aRet.sText = rTOXMark.GetSecondaryKey();
378  aRet.sReading = rTOXMark.GetSecondaryKeyReading();
379  }
380  break;
381  case FORM_ENTRY :
382  {
383  aRet.sText = rTOXMark.GetText(pLayout);
384  aRet.sReading = rTOXMark.GetTextReading();
385  }
386  break;
387  }
388  // if SwTOIOptions::InitialCaps is set, first character is to be capitalized
389  if( SwTOIOptions::InitialCaps & nOpt && pTOXIntl && !aRet.sText.isEmpty())
390  {
391  aRet.sText = pTOXIntl->ToUpper( aRet.sText, 0 ) + aRet.sText.subView(1);
392  }
393 
394  return aRet;
395 }
396 
397 void SwTOXIndex::FillText( SwTextNode& rNd, const SwIndex& rInsPos, sal_uInt16,
398  SwRootFrame const*const pLayout) const
399 {
400  assert(!"sw_redlinehide: this is dead code, Bibliography only has SwTOXAuthority");
401  const sal_Int32* pEnd = pTextMark->End();
402 
403  TextAndReading aRet;
404  if( pEnd && !pTextMark->GetTOXMark().IsAlternativeText() &&
406  {
407  aRet.sText = static_cast<const SwTextNode*>(aTOXSources[0].pNd)->GetExpandText(
408  pLayout,
409  pTextMark->GetStart(),
410  *pEnd - pTextMark->GetStart(),
411  false, false, false,
413  | (pLayout && pLayout->IsHideRedlines()
415  : ExpandMode(0)));
416  if(SwTOIOptions::InitialCaps & nOpt && pTOXIntl && !aRet.sText.isEmpty())
417  {
418  aRet.sText = pTOXIntl->ToUpper( aRet.sText, 0 ) + aRet.sText.subView(1);
419  }
420  }
421  else
422  aRet = GetText();
423 
424  rNd.InsertText( aRet.sText, rInsPos );
425 }
426 
427 sal_uInt16 SwTOXIndex::GetLevel() const
428 {
429  OSL_ENSURE(pTextMark, "pTextMark == 0, No keyword");
430 
431  sal_uInt16 nForm = FORM_PRIMARY_KEY;
432 
434  !pTextMark->GetTOXMark().GetPrimaryKey().isEmpty() )
435  {
436  nForm = FORM_SECONDARY_KEY;
437  if( !pTextMark->GetTOXMark().GetSecondaryKey().isEmpty() )
438  nForm = FORM_ENTRY;
439  }
440  return nForm;
441 }
442 
443 // Key and separator
445  sal_uInt16 nLevel,
446  const SwTOXInternational& rIntl,
447  const lang::Locale& rLocale )
448  : SwTOXSortTabBase( TOX_SORT_CUSTOM, nullptr, nullptr, &rIntl, &rLocale ),
449  m_aKey(rKey), nLev(nLevel)
450 {
451 }
452 
454 {
455  return GetLevel() == rCmpBase.GetLevel() &&
457  rCmpBase.GetText(), rCmpBase.GetLocale() );
458 }
459 
461 {
462  return GetLevel() <= rCmpBase.GetLevel() &&
464  rCmpBase.GetText(), rCmpBase.GetLocale() );
465 }
466 
467 sal_uInt16 SwTOXCustom::GetLevel() const
468 {
469  return nLev;
470 }
471 
473 {
474  return m_aKey;
475 }
476 
477 // Sorts the TOX entries
479  const SwTOXInternational& rIntl)
480  : SwTOXSortTabBase( TOX_SORT_CONTENT, &rNd, pMark, &rIntl )
481 {
482 }
483 
484 // The content's text
485 
487 {
488  const sal_Int32* pEnd = pTextMark->End();
489  if( pEnd && !pTextMark->GetTOXMark().IsAlternativeText() )
490  {
491  return TextAndReading(
492  static_cast<const SwTextNode*>(aTOXSources[0].pNd)->GetExpandText(
493  pLayout,
494  pTextMark->GetStart(),
495  *pEnd - pTextMark->GetStart(),
496  false, false, false,
498  | (pLayout && pLayout->IsHideRedlines()
500  : ExpandMode(0))),
502  }
503 
504  return TextAndReading(pTextMark->GetTOXMark().GetAlternativeText(), OUString());
505 }
506 
507 void SwTOXContent::FillText(SwTextNode& rNd, const SwIndex& rInsPos, sal_uInt16,
508  SwRootFrame const*const pLayout) const
509 {
510  assert(!"sw_redlinehide: this is dead code, Bibliography only has SwTOXAuthority");
511  const sal_Int32* pEnd = pTextMark->End();
512  if( pEnd && !pTextMark->GetTOXMark().IsAlternativeText() )
513  // sw_redlinehide: this probably won't HideDeletions
514  static_cast<const SwTextNode*>(aTOXSources[0].pNd)->CopyExpandText(
515  rNd, &rInsPos, pTextMark->GetStart(),
516  *pEnd - pTextMark->GetStart(), pLayout);
517  else
518  {
519  rNd.InsertText( GetText().sText, rInsPos );
520  }
521 }
522 
523 // The level for displaying it
524 
525 sal_uInt16 SwTOXContent::GetLevel() const
526 {
527  return pTextMark->GetTOXMark().GetLevel();
528 }
529 
530 // TOX assembled from paragraphs
531 // Watch out for OLE/graphics when sorting!
532 // The position must not come from the document, but from the "anchor"!
533 SwTOXPara::SwTOXPara(SwContentNode& rNd, SwTOXElement eT, sal_uInt16 nLevel, const OUString& sSeqName)
534  : SwTOXSortTabBase( TOX_SORT_PARA, &rNd, nullptr, nullptr ),
535  eType( eT ),
536  m_nLevel(nLevel),
537  nStartIndex(0),
538  nEndIndex(-1),
539  m_sSequenceName( sSeqName )
540 {
541  // tdf#123313 create any missing bookmarks *before* generating ToX nodes!
542  switch (eType)
543  {
546  assert(rNd.IsTextNode());
549  break;
550  default:
551  break;
552  }
553 }
554 
556 {
557  const SwContentNode* pNd = aTOXSources[0].pNd;
558  switch( eType )
559  {
561  if (nStartIndex != 0 || nEndIndex != -1)
562  {
563  // sw_redlinehide: "captions" are a rather fuzzily defined concept anyway
564  return TextAndReading(static_cast<const SwTextNode*>(pNd)->GetExpandText(
565  pLayout,
566  nStartIndex,
567  nEndIndex == -1 ? -1 : nEndIndex - nStartIndex,
568  false, false, false,
569  pLayout && pLayout->IsHideRedlines()
571  : ExpandMode(0)),
572  OUString());
573  }
574  [[fallthrough]];
577  {
578  assert(nStartIndex == 0);
579  assert(nEndIndex == -1);
581  pLayout, *static_cast<const SwTextNode*>(pNd),
583  OUString());
584  }
585  break;
586 
587  case SwTOXElement::Ole:
589  case SwTOXElement::Frame:
590  {
591  // Find the FlyFormat; the object/graphic name is there
592  SwFrameFormat* pFly = pNd->GetFlyFormat();
593  if( pFly )
594  return TextAndReading(pFly->GetName(), OUString());
595 
596  OSL_ENSURE( false, "Graphic/object without name" );
598  ? STR_OBJECT_DEFNAME
600  ? STR_GRAPHIC_DEFNAME
601  : STR_FRAME_DEFNAME;
602  return TextAndReading(SwResId(pId), OUString());
603  }
604  break;
605  default: break;
606  }
607  return TextAndReading();
608 }
609 
610 void SwTOXPara::FillText( SwTextNode& rNd, const SwIndex& rInsPos, sal_uInt16,
611  SwRootFrame const*const pLayout) const
612 {
613  assert(!"sw_redlinehide: this is dead code, Bibliography only has SwTOXAuthority");
615  {
616  const SwTextNode* pSrc = static_cast<const SwTextNode*>(aTOXSources[0].pNd);
618  && (nStartIndex != 0 || nEndIndex != -1))
619  {
620  pSrc->CopyExpandText( rNd, &rInsPos, nStartIndex,
621  nEndIndex == -1 ? -1 : nEndIndex - nStartIndex,
622  pLayout, false, false, true );
623  }
624  else
625  {
626  assert(nStartIndex == 0);
627  assert(nEndIndex == -1);
628  // sw_redlinehide: this probably won't HideDeletions
629  pSrc->CopyExpandText( rNd, &rInsPos, 0, -1,
630  pLayout, false, false, true );
631  if (pLayout && pLayout->HasMergedParas())
632  {
633  if (SwTextFrame const*const pFrame = static_cast<SwTextFrame*>(pSrc->getLayoutFrame(pLayout)))
634  {
635  if (sw::MergedPara const*const pMerged = pFrame->GetMergedPara())
636  {
637  // pSrc already copied above
638  assert(pSrc == pMerged->pParaPropsNode);
639  for (sal_uLong i = pSrc->GetIndex() + 1;
640  i <= pMerged->pLastNode->GetIndex(); ++i)
641  {
642  SwNode *const pTmp(pSrc->GetNodes()[i]);
643  if (pTmp->GetRedlineMergeFlag() == SwNode::Merge::NonFirst)
644  {
645 
646  pTmp->GetTextNode()->CopyExpandText(
647  rNd, &rInsPos, 0, -1,
648  pLayout, false, false, false );
649  }
650  }
651  }
652  }
653  }
654  }
655  }
656  else
657  {
658  rNd.InsertText( GetText().sText.replace('\t', ' '), rInsPos );
659  }
660 }
661 
662 sal_uInt16 SwTOXPara::GetLevel() const
663 {
664  sal_uInt16 nRet = m_nLevel;
665  const SwContentNode* pNd = aTOXSources[0].pNd;
666 
667  if( SwTOXElement::OutlineLevel == eType && pNd->GetTextNode() )
668  {
669  const int nTmp = static_cast<const SwTextNode*>(pNd)->GetAttrOutlineLevel();
670  if(nTmp != 0 )
671  nRet = o3tl::narrowing<sal_uInt16>(nTmp);
672  }
673  return nRet;
674 }
675 
676 std::pair<OUString, bool> SwTOXPara::GetURL(SwRootFrame const*const) const
677 {
678  OUString aText;
679  const SwContentNode* pNd = aTOXSources[0].pNd;
680  switch( eType )
681  {
684  {
685  const SwTextNode * pTextNd = pNd->GetTextNode();
686 
687  SwDoc& rDoc = const_cast<SwDoc&>( pTextNd->GetDoc() );
688  // tdf#123313: this *must not* create a bookmark, its Undo would
689  // be screwed! create it as preparatory step, in ctor!
690  ::sw::mark::IMark const * const pMark = rDoc.getIDocumentMarkAccess()->getMarkForTextNode(
691  *pTextNd,
693  aText = "#" + pMark->GetName();
694  }
695  break;
696 
697  case SwTOXElement::Ole:
699  case SwTOXElement::Frame:
700  {
701  // Find the FlyFormat; the object/graphic name is there
702  SwFrameFormat* pFly = pNd->GetFlyFormat();
703  if( pFly )
704  {
705  aText = "#" + pFly->GetName() + OUStringChar(cMarkSeparator);
706  const char* pStr;
707  switch( eType )
708  {
709  case SwTOXElement::Ole: pStr = "ole"; break;
710  case SwTOXElement::Graphic: pStr = "graphic"; break;
711  case SwTOXElement::Frame: pStr = "frame"; break;
712  default: pStr = nullptr;
713  }
714  if( pStr )
715  aText += OUString::createFromAscii( pStr );
716  }
717  }
718  break;
720  {
721  aText = "#" + m_sSequenceName + OUStringChar(cMarkSeparator)
722  + "sequence";
723  }
724  break;
725  default: break;
726  }
727  return std::make_pair(aText, false);
728 }
729 
731 {
732  switch (eType)
733  {
737  return nStartIndex == 0 && nEndIndex == -1;
738  default:
739  return false;
740  }
741 }
742 
743 // Table
745  : SwTOXSortTabBase( TOX_SORT_TABLE, &rNd, nullptr, nullptr ),
746  nLevel(FORM_ALPHA_DELIMITER)
747 {
748 }
749 
751 {
752  const SwNode* pNd = aTOXSources[0].pNd;
753  if( pNd )
754  {
755  const SwTableNode* pTableNd =
756  reinterpret_cast<const SwTableNode*>(pNd->FindTableNode());
757  if (pTableNd)
758  {
759  return TextAndReading(pTableNd->GetTable().GetFrameFormat()->GetName(), OUString());
760  }
761  }
762 
763  OSL_ENSURE( false, "Where's my table?" );
764  return TextAndReading(SwResId( STR_TABLE_DEFNAME ), OUString());
765 }
766 
767 sal_uInt16 SwTOXTable::GetLevel() const
768 {
769  return nLevel;
770 }
771 
772 std::pair<OUString, bool> SwTOXTable::GetURL(SwRootFrame const*const) const
773 {
774  const SwNode* pNd = aTOXSources[0].pNd;
775  if (!pNd)
776  return std::make_pair(OUString(), false);
777 
778  pNd = pNd->FindTableNode();
779  if (!pNd)
780  return std::make_pair(OUString(), false);
781 
782  const OUString sName = static_cast<const SwTableNode*>(pNd)->GetTable().GetFrameFormat()->GetName();
783  if ( sName.isEmpty() )
784  return std::make_pair(OUString(), false);
785 
786  return std::make_pair("#" + sName + OUStringChar(cMarkSeparator) + "table", false);
787 }
788 
790  SwFormatField& rField, const SwTOXInternational& rIntl ) :
791  SwTOXSortTabBase( TOX_SORT_AUTHORITY, &rNd, nullptr, &rIntl ),
792  m_rField(rField)
793 {
794  if(rField.GetTextField())
795  nCntPos = rField.GetTextField()->GetStart();
796 }
797 
798 sal_uInt16 SwTOXAuthority::GetLevel() const
799 {
800  OUString sText(static_cast<SwAuthorityField*>(m_rField.GetField())->GetFieldText(AUTH_FIELD_AUTHORITY_TYPE));
801  //#i18655# the level '0' is the heading level therefore the values are incremented here
802  sal_uInt16 nRet = 1;
803  if( pTOXIntl->IsNumeric( sText ) )
804  {
805  nRet = sText.toUInt32();
806  nRet++;
807  }
808  //illegal values are also set to 'ARTICLE' as non-numeric values are
809  if(nRet > AUTH_TYPE_END)
810  nRet = 1;
811  return nRet;
812 }
813 
814 static OUString lcl_GetText(SwFormatField const& rField, SwRootFrame const*const pLayout)
815 {
816  return rField.GetField()->ExpandField(true, pLayout);
817 }
818 
820 {
821  return TextAndReading(lcl_GetText(m_rField, pLayout), OUString());
822 }
823 
824 OUString SwTOXAuthority::GetText(sal_uInt16 nAuthField, const SwRootFrame* pLayout) const
825 {
826  SwAuthorityField* pField = static_cast<SwAuthorityField*>(m_rField.GetField());
827  OUString sText;
828  if(AUTH_FIELD_IDENTIFIER == nAuthField)
829  {
830  sText = lcl_GetText(m_rField, pLayout);
831  const SwAuthorityFieldType* pType = static_cast<const SwAuthorityFieldType*>(pField->GetTyp());
832  sal_Unicode cChar = pType->GetPrefix();
833  if(cChar && cChar != ' ')
834  sText = sText.copy(1);
835  cChar = pType->GetSuffix();
836  if(cChar && cChar != ' ')
837  sText = sText.copy(0, sText.getLength() - 1);
838  }
839  else if(AUTH_FIELD_AUTHORITY_TYPE == nAuthField)
840  {
841  sal_uInt16 nLevel = GetLevel();
842  if(nLevel)
843  sText = SwAuthorityFieldType::GetAuthTypeName(static_cast<ToxAuthorityType>(--nLevel));
844  }
845  else
846  sText = pField->GetFieldText(static_cast<ToxAuthorityField>(nAuthField));
847  return sText;
848 }
849 
850 OUString SwTOXAuthority::GetSourceURL(const OUString& rText)
851 {
852  OUString aText = rText;
853 
854  uno::Reference<uri::XUriReferenceFactory> xUriReferenceFactory
855  = uri::UriReferenceFactory::create(comphelper::getProcessComponentContext());
856  uno::Reference<uri::XUriReference> xUriRef;
857  try
858  {
859  xUriRef = xUriReferenceFactory->parse(aText);
860  }
861  catch (const uno::Exception& rException)
862  {
863  SAL_WARN("sw.core",
864  "SwTOXAuthority::GetSourceURL: failed to parse url: " << rException.Message);
865  }
866  if (xUriRef.is() && xUriRef->getFragment().startsWith("page="))
867  {
868  xUriRef->clearFragment();
869  aText = xUriRef->getUriReference();
870  }
871 
872  return aText;
873 }
874 
875 void SwTOXAuthority::FillText(SwTextNode& rNd, const SwIndex& rInsPos, sal_uInt16 nAuthField,
876  SwRootFrame const* const pLayout) const
877 {
878  OUString aText = GetText(nAuthField, pLayout);
879  if (nAuthField == AUTH_FIELD_URL)
880  {
881  aText = GetSourceURL(aText);
882 
883  // Convert URL to a relative one if requested.
884  SwDoc* pDoc = static_cast<SwAuthorityFieldType*>(m_rField.GetField()->GetTyp())->GetDoc();
885  SwDocShell* pDocShell = pDoc->GetDocShell();
886  OUString aBaseURL = pDocShell->getDocumentBaseURL();
887  OUString aBaseURIScheme;
888  sal_Int32 nSep = aBaseURL.indexOf(':');
889  if (nSep != -1)
890  {
891  aBaseURIScheme = aBaseURL.copy(0, nSep);
892  }
893 
894  uno::Reference<uri::XUriReferenceFactory> xUriReferenceFactory
895  = uri::UriReferenceFactory::create(comphelper::getProcessComponentContext());
896  uno::Reference<uri::XUriReference> xUriRef;
897  try
898  {
899  xUriRef = xUriReferenceFactory->parse(aText);
900  }
901  catch (const uno::Exception& rException)
902  {
903  SAL_WARN("sw.core",
904  "SwTOXAuthority::FillText: failed to parse url: " << rException.Message);
905  }
906 
908  if (xUriRef.is() && bSaveRelFSys && xUriRef->getScheme() == aBaseURIScheme)
909  {
910  aText = INetURLObject::GetRelURL(aBaseURL, aText);
911  }
912  }
913 
914  rNd.InsertText(aText, rInsPos);
915 }
916 
918 {
919  if (nType != rCmp.nType)
920  {
921  return false;
922  }
923 
924  // Compare our SwAuthEntry and rCmp's SwAuthEntry, but the URL is considered equivalent, as long
925  // as it only differs in a page number, as that's still the same source.
926  const SwAuthEntry* pThis = static_cast<SwAuthorityField*>(m_rField.GetField())->GetAuthEntry();
927  const SwAuthEntry* pOther = static_cast<SwAuthorityField*>(
928  static_cast<const SwTOXAuthority&>(rCmp).m_rField.GetField())
929  ->GetAuthEntry();
930  if (pThis == pOther)
931  {
932  return true;
933  }
934 
935  for (int i = 0; i < AUTH_FIELD_END; ++i)
936  {
937  auto eField = static_cast<ToxAuthorityField>(i);
938  if (eField == AUTH_FIELD_URL)
939  {
942  {
943  return false;
944  }
945  continue;
946  }
947 
948  if (pThis->GetAuthorField(eField) != pOther->GetAuthorField(eField))
949  {
950  return false;
951  }
952  }
953 
954  return true;
955 }
956 
958 {
959  bool bRet = false;
960  SwAuthorityField* pField = static_cast<SwAuthorityField*>(m_rField.GetField());
961  SwAuthorityFieldType* pType = static_cast<SwAuthorityFieldType*>(
962  pField->GetTyp());
963  if(pType->IsSortByDocument())
964  bRet = SwTOXSortTabBase::sort_lt(rBase);
965  else
966  {
967  SwAuthorityField* pCmpField =
968  static_cast<SwAuthorityField*>(static_cast<const SwTOXAuthority&>(rBase).m_rField.GetField());
969 
970  for(sal_uInt16 i = 0; i < pType->GetSortKeyCount(); i++)
971  {
972  const SwTOXSortKey* pKey = pType->GetSortKey(i);
973  const TextAndReading aMy(pField->GetFieldText(pKey->eField), OUString());
974  const TextAndReading aOther(pCmpField->GetFieldText(pKey->eField), OUString());
975 
976  sal_Int32 nComp = pTOXIntl->Compare( aMy, GetLocale(),
977  aOther, rBase.GetLocale() );
978 
979  if( nComp )
980  {
981  bRet = (-1 == nComp) == pKey->bSortAscending;
982  break;
983  }
984  }
985  }
986  return bRet;
987 }
988 
989 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
virtual sal_uInt16 GetLevel() const override
Definition: txmsrt.cxx:467
OUString const & GetAuthorField(ToxAuthorityField ePos) const
Definition: authfld.hxx:195
static SwTOIOptions nOpt
Definition: txmsrt.hxx:133
sal_uInt16 m_nLevel
Definition: txmsrt.hxx:260
const css::lang::Locale & GetLocale() const
Definition: txmsrt.hxx:182
OUString GetIndexKey(const TextAndReading &rTaR, const css::lang::Locale &rLcl) const
Definition: txmsrt.cxx:122
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:158
SwTOXElement eType
Definition: txmsrt.hxx:259
virtual sal_uInt16 GetLevel() const override
Definition: txmsrt.cxx:427
sal_uLong GetIndex() const
Definition: node.hxx:291
virtual TextAndReading GetText_Impl(SwRootFrame const *pLayout) const override
Definition: txmsrt.cxx:486
bool IsAlternativeText() const
Definition: tox.hxx:591
OUString const & GetSecondaryKeyReading() const
Definition: tox.hxx:674
SwTOIOptions
Definition: tox.hxx:390
OUString sReading
Definition: txmsrt.hxx:61
virtual const OUString & GetName() const =0
Marks a position in the document model.
Definition: pam.hxx:35
const SwField * GetField() const
Definition: fmtfld.hxx:110
virtual const SwRootFrame * GetCurrentLayout() const =0
OUString const & GetPrimaryKey() const
Definition: tox.hxx:650
virtual std::pair< OUString, bool > GetURL(SwRootFrame const *const pLayout) const override
Definition: txmsrt.cxx:676
SwDocShell * GetDocShell()
Definition: doc.hxx:1352
SwNodeIndex nNode
Definition: pam.hxx:37
const SwTextNode * GetBodyTextNode(const SwDoc &rDoc, SwPosition &rPos, const SwFrame &rFrame)
Forward declaration: get "BodyTextNode" for exp.fld in Fly's headers/footers/footnotes.
Definition: expfld.cxx:163
sal_uIntPtr sal_uLong
virtual sal_uInt16 GetLevel() const =0
std::unique_ptr< IndexEntrySupplierWrapper > m_pIndexWrapper
Definition: txmsrt.hxx:73
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
Definition: node.cxx:1213
sal_Int64 n
Definition: doc.hxx:188
sal_Int32 nStartIndex
Definition: txmsrt.hxx:261
virtual bool sort_lt(const SwTOXSortTabBase &) override
Definition: txmsrt.cxx:337
SwTOXIndex(const SwTextNode &, const SwTextTOXMark *, SwTOIOptions nOptions, sal_uInt8 nKeyLevel, const SwTOXInternational &rIntl, const css::lang::Locale &rLocale)
Definition: txmsrt.cxx:301
LanguageType m_eLang
Definition: txmsrt.hxx:75
static OUString GetRelURL(OUString const &rTheBaseURIRef, OUString const &rTheAbsURIRef, EncodeMechanism eEncodeMechanism=EncodeMechanism::WasEncoded, DecodeMechanism eDecodeMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)
IDocumentMarkAccess * getIDocumentMarkAccess()
Definition: docbm.cxx:1790
virtual bool equivalent(const SwTOXSortTabBase &) override
Definition: txmsrt.cxx:315
virtual void FillText(SwTextNode &rNd, const SwIndex &rInsPos, sal_uInt16 nAuthField, SwRootFrame const *pLayout) const override
Definition: txmsrt.cxx:875
const SwTOXType * GetTOXType() const
Definition: tox.hxx:588
static OUString GetSourceURL(const OUString &rText)
Gets the URL of the underlying SwAuthEntry, ignoring its page number.
Definition: txmsrt.cxx:850
#define FORM_SECONDARY_KEY
Definition: tox.hxx:212
virtual TextAndReading GetText_Impl(SwRootFrame const *pLayout) const override
Definition: txmsrt.cxx:472
virtual OUString getDocumentBaseURL() const override
The root element of a Writer document layout.
Definition: rootfrm.hxx:82
OUString GetFollowingText(bool bMorePages) const
Definition: txmsrt.cxx:128
static OUString const & GetAuthTypeName(ToxAuthorityType eType)
Definition: initui.cxx:280
SwTableFormat * GetFrameFormat()
Definition: swtable.hxx:204
sal_uInt16 nLevel
Definition: txmsrt.hxx:279
virtual sal_uInt16 GetLevel() const override
Definition: txmsrt.cxx:525
static LanguageType nLang
Definition: srtdlg.cxx:51
SwTOXAuthority(const SwContentNode &rNd, SwFormatField &rField, const SwTOXInternational &rIntl)
Definition: txmsrt.cxx:789
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:165
virtual bool IsFullPara() const
Definition: txmsrt.cxx:215
sal_uInt16 sal_Unicode
OUString const & GetPrimaryKeyReading() const
Definition: tox.hxx:668
const SwTOXSortKey * GetSortKey(sal_uInt16 nIdx) const
Definition: authfld.cxx:435
virtual sal_uInt16 GetLevel() const override
Definition: txmsrt.cxx:767
OUString typeName
sal_Unicode GetPrefix() const
Definition: authfld.hxx:119
const SwTOXMark & GetTOXMark() const
Definition: txatbase.hxx:216
sal_uInt8 nKeyLevel
Definition: txmsrt.hxx:205
invariant for SwAuthorityField is that it is always registered at its SwAuthorityFieldType via AddFie...
Definition: authfld.hxx:154
SwIndex nContent
Definition: pam.hxx:38
const SwTextField * GetTextField() const
Definition: fmtfld.hxx:128
sal_Int32 nEndIndex
Definition: txmsrt.hxx:262
virtual void FillText(SwTextNode &rNd, const SwIndex &rInsPos, sal_uInt16 nAuthField, SwRootFrame const *pLayout) const override
Definition: txmsrt.cxx:507
TOXSortType
Definition: txmsrt.hxx:36
virtual bool equivalent(const SwTOXSortTabBase &)
Definition: txmsrt.cxx:226
bool IsNumeric(const OUString &rStr) const
Definition: txmsrt.cxx:108
const OUString & GetName() const
Definition: format.hxx:115
bool IsEqual(const TextAndReading &rTaR1, const css::lang::Locale &rLocale1, const TextAndReading &rTaR2, const css::lang::Locale &rLocale2) const
Definition: txmsrt.hxx:92
sal_uLong GetIndex() const
Definition: ndindex.hxx:152
virtual bool equivalent(const SwTOXSortTabBase &) override
Definition: txmsrt.cxx:453
eField
virtual bool equivalent(const SwTOXSortTabBase &) override
Definition: txmsrt.cxx:917
sal_Int32 GetStart() const
Definition: txatbase.hxx:86
const SwTable & GetTable() const
Definition: node.hxx:499
Describes parts of multiple text nodes, which will form a text frame, even when redlines are hidden a...
Definition: txtfrm.hxx:956
virtual TextAndReading GetText_Impl(SwRootFrame const *pLayout) const override
Definition: txmsrt.cxx:819
OUString ToUpper(const OUString &rStr, sal_Int32 nPos) const
Definition: txmsrt.cxx:103
const char * sName
For sorting by text.
Definition: txmsrt.hxx:190
virtual TextAndReading GetText_Impl(SwRootFrame const *pLayout) const override
Definition: txmsrt.cxx:555
DocumentType eType
sal_Int32 m_nLevel
const OUString & GetAlternativeText() const
Definition: tox.hxx:579
sal_Int32 nCntPos
Definition: txmsrt.hxx:131
constexpr T1 narrowing(T2 value)
OUString m_sSortAlgorithm
Definition: txmsrt.hxx:76
Style of a layout element.
Definition: frmfmt.hxx:59
OUString GetExpandTextMerged(SwRootFrame const *const pLayout, SwTextNode const &rNode, bool const bWithNumber, bool const bWithSpacesForLevel, ExpandMode const i_mode)
SwTOXInternational(LanguageType nLang, SwTOIOptions nOptions, const OUString &rSortAlgorithm)
Definition: txmsrt.cxx:57
int i
SwTOXElement
Definition: tox.hxx:368
SwDoc & GetDoc()
Definition: node.hxx:212
sal_Unicode const toxMarkSeparator
separator for toxmarks: #%19%19|toxmark
Definition: swtypes.hxx:129
sal_uInt16 GetLevel() const
Definition: tox.hxx:644
virtual TextAndReading GetText_Impl(SwRootFrame const *pLayout) const override
Definition: txmsrt.cxx:750
sal_Unicode GetSuffix() const
Definition: authfld.hxx:120
OUString GetText(SwRootFrame const *pLayout) const
Definition: tox.cxx:193
Marks a character position inside a document model node.
Definition: index.hxx:33
SwTOXTable(const SwContentNode &rNd)
Definition: txmsrt.cxx:744
const SwTOXInternational * pTOXIntl
Definition: txmsrt.hxx:129
virtual void FillText(SwTextNode &rNd, const SwIndex &rInsPos, sal_uInt16 nAuthField, SwRootFrame const *pLayout) const override
Definition: txmsrt.cxx:610
SwNodes & GetNodes()
Node is in which nodes-array/doc?
Definition: node.hxx:694
virtual std::pair< OUString, bool > GetURL(SwRootFrame const *const pLayout) const
Definition: txmsrt.cxx:188
const SwTextTOXMark * pTextMark
Definition: txmsrt.hxx:128
sal_uInt16 nLev
Definition: txmsrt.hxx:222
const sal_Unicode cMarkSeparator
Definition: swtypes.hxx:125
OUString const & GetTextReading() const
Definition: tox.hxx:662
bool bSortAscending
Definition: authfld.hxx:53
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:405
virtual bool sort_lt(const SwTOXSortTabBase &) override
Definition: txmsrt.cxx:460
virtual TextAndReading GetText_Impl(SwRootFrame const *pLayout) const override
Definition: txmsrt.cxx:361
SwFieldType * GetTyp() const
Definition: fldbas.hxx:392
ToxAuthorityField
Definition: toxe.hxx:82
sal_uLong nPos
Definition: txmsrt.hxx:130
virtual sal_uInt16 GetLevel() const override
Definition: txmsrt.cxx:798
OUString InsertText(const OUString &rStr, const SwIndex &rIdx, const SwInsertFlags nMode=SwInsertFlags::DEFAULT)
insert text content
Definition: ndtxt.cxx:2269
SwTOIOptions m_nOptions
Definition: txmsrt.hxx:77
SwTOXPara(SwContentNode &, SwTOXElement, sal_uInt16 nLevel=FORM_ALPHA_DELIMITER, const OUString &sSeqName=OUString())
Definition: txmsrt.cxx:533
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
ExpandMode
Some helpers for converting model strings to view strings.
OUString sText
Definition: txmsrt.hxx:60
OUString ExpandField(bool bCached, SwRootFrame const *pLayout) const
expand the field.
Definition: fldbas.cxx:465
SwTOXCustom(const TextAndReading &rKey, sal_uInt16 nLevel, const SwTOXInternational &rIntl, const css::lang::Locale &rLocale)
Definition: txmsrt.cxx:444
TextAndReading m_aKey
Definition: txmsrt.hxx:221
ToxAuthorityField eField
Definition: authfld.hxx:52
OUString const & GetSecondaryKey() const
Definition: tox.hxx:656
virtual ::sw::mark::IMark * getMarkForTextNode(const SwTextNode &rTextNode, MarkType eMark)=0
Returns a mark in the document for a paragraph.
bool IsLess(const TextAndReading &rTaR1, const css::lang::Locale &rLocale1, const TextAndReading &rTaR2, const css::lang::Locale &rLocale2) const
Definition: txmsrt.hxx:100
unsigned char sal_uInt8
css::lang::Locale aLocale
Definition: txmsrt.hxx:126
virtual std::pair< OUString, bool > GetURL(SwRootFrame const *const pLayout) const override
Definition: txmsrt.cxx:772
sal_Int32 GetIndex() const
Definition: index.hxx:91
const sal_Int32 * End() const
Definition: txatbase.hxx:152
#define FORM_ALPHA_DELIMITER
Definition: tox.hxx:210
Reference< XComponentContext > getProcessComponentContext()
QPRO_FUNC_TYPE nType
Sequence< sal_Int8 > aSeq
#define FORM_ENTRY
Definition: tox.hxx:213
virtual bool IsFullPara() const override
Definition: txmsrt.cxx:730
bool IsHideRedlines() const
Replacement for sw::DocumentRedlineManager::GetRedlineFlags() (this is layout-level redline hiding)...
Definition: rootfrm.hxx:422
OUString m_sSequenceName
Definition: txmsrt.hxx:263
SwTableNode * FindTableNode()
Search table node, in which it is.
Definition: node.cxx:357
bool CopyExpandText(SwTextNode &rDestNd, const SwIndex *pDestIdx, sal_Int32 nIdx, sal_Int32 nLen, SwRootFrame const *pLayout, bool bWithNum=false, bool bWithFootnote=true, bool bReplaceTabsWithSpaces=false) const
Definition: ndtxt.cxx:3420
virtual sal_uInt16 GetLevel() const override
Definition: txmsrt.cxx:662
bool IsMainEntry() const
Definition: tox.hxx:158
#define SAL_WARN(area, stream)
static SwTOIOptions GetOptions()
Definition: txmsrt.hxx:143
#define FORM_PRIMARY_KEY
Definition: tox.hxx:211
bool IsSortByDocument() const
Definition: authfld.hxx:122
bool IsFrameBehind(const SwTextNode &rMyNd, sal_Int32 nMySttPos, const SwTextNode &rBehindNd, sal_Int32 nSttPos)
Definition: reffld.cxx:99
bool HasMergedParas() const
Definition: rootfrm.hxx:426
SwFormatField & m_rField
Definition: txmsrt.hxx:286
virtual void FillText(SwTextNode &rNd, const SwIndex &rInsPos, sal_uInt16 nAuthField, SwRootFrame const *pLayout) const
Definition: txmsrt.cxx:220
sal_uInt16 nType
Definition: txmsrt.hxx:132
std::unique_ptr< CharClass > m_pCharClass
Definition: txmsrt.hxx:74
static OUString lcl_GetText(SwFormatField const &rField, SwRootFrame const *const pLayout)
Definition: txmsrt.cxx:814
TextAndReading const & GetText() const
Definition: txmsrt.hxx:176
virtual bool sort_lt(const SwTOXSortTabBase &)
Definition: txmsrt.cxx:252
bool IsTextNode() const
Definition: node.hxx:637
Class for sorting directories.
Definition: txmsrt.hxx:120
const OUString & GetFieldText(ToxAuthorityField eField) const
Definition: authfld.cxx:544
SwFrameFormat * GetFlyFormat() const
If node is in a fly return the respective format.
Definition: node.cxx:719
SwTOXContent(const SwTextNode &, const SwTextTOXMark *, const SwTOXInternational &rIntl)
Definition: txmsrt.cxx:478
std::vector< SwTOXSource > aTOXSources
Definition: txmsrt.hxx:125
sal_uInt16 GetSortKeyCount() const
Definition: authfld.cxx:430
sal_Int32 Compare(const TextAndReading &rTaR1, const css::lang::Locale &rLocale1, const TextAndReading &rTaR2, const css::lang::Locale &rLocale2) const
Definition: txmsrt.cxx:113
#define SW_COLLATOR_IGNORES
Definition: swtypes.hxx:183
virtual bool sort_lt(const SwTOXSortTabBase &) override
Definition: txmsrt.cxx:957
sal_uInt16 nPos
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:850
virtual void FillText(SwTextNode &rNd, const SwIndex &rInsPos, sal_uInt16 nAuthField, SwRootFrame const *pLayout) const override
Definition: txmsrt.cxx:397
Represents one row in the bibliography table.
Definition: txmsrt.hxx:283
static css::lang::Locale convertToLocale(LanguageType nLangID, bool bResolveSystem=true)
SwTOXSortTabBase(TOXSortType nType, const SwContentNode *pTOXSrc, const SwTextTOXMark *pTextMark, const SwTOXInternational *pIntl, const css::lang::Locale *pLocale=nullptr)
Definition: txmsrt.cxx:134
Base class of the Writer document model elements.
Definition: node.hxx:80