LibreOffice Module sw (master)  1
ndsect.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 <hintids.hxx>
21 #include <sfx2/linkmgr.hxx>
22 #include <svl/itemiter.hxx>
23 #include <sal/log.hxx>
24 #include <fmtcntnt.hxx>
25 #include <txtftn.hxx>
26 #include <doc.hxx>
27 #include <IDocumentUndoRedo.hxx>
31 #include <IDocumentState.hxx>
32 #include <rootfrm.hxx>
33 #include <pam.hxx>
34 #include <ndtxt.hxx>
35 #include <section.hxx>
36 #include <UndoSection.hxx>
37 #include <UndoDelete.hxx>
38 #include <swundo.hxx>
39 #include <calc.hxx>
40 #include <swtable.hxx>
41 #include <swserv.hxx>
42 #include <frmfmt.hxx>
43 #include <frmtool.hxx>
44 #include <ftnidx.hxx>
45 #include <docary.hxx>
46 #include <redline.hxx>
47 #include <sectfrm.hxx>
48 #include <cntfrm.hxx>
49 #include <node2lay.hxx>
50 #include <doctxm.hxx>
51 #include <fmtftntx.hxx>
52 #include <strings.hrc>
53 #include <viewsh.hxx>
54 #include <txtfrm.hxx>
55 #include <hints.hxx>
56 #include <memory>
57 #include "ndsect.hxx"
58 #include <tools/datetimeutils.hxx>
59 
60 // #i21457# - new implementation of local method <lcl_IsInSameTableBox(..)>.
61 // Method now determines the previous/next on its own. Thus, it can be controlled,
62 // for which previous/next is checked, if it's visible.
63 static bool lcl_IsInSameTableBox( SwNodes const & _rNds,
64  const SwNode& _rNd,
65  const bool _bPrev )
66 {
67  const SwTableNode* pTableNd = _rNd.FindTableNode();
68  if ( !pTableNd )
69  {
70  return true;
71  }
72 
73  // determine index to be checked. Its assumed that a previous/next exist.
74  SwNodeIndex aChkIdx( _rNd );
75  {
76  // determine index of previous/next - skip hidden ones, which are
77  // inside the table.
78  // If found one is before/after table, this one isn't in the same
79  // table box as <_rNd>.
80  bool bFound = false;
81  do
82  {
83  if ( _bPrev
84  ? !SwNodes::GoPrevSection( &aChkIdx, false, false )
85  : !_rNds.GoNextSection( &aChkIdx, false, false ) )
86  {
87  OSL_FAIL( "<lcl_IsInSameTableBox(..)> - no previous/next!" );
88  return false;
89  }
90  else
91  {
92  if ( aChkIdx < pTableNd->GetIndex() ||
93  aChkIdx > pTableNd->EndOfSectionNode()->GetIndex() )
94  {
95  return false;
96  }
97  else
98  {
99  // check, if found one isn't inside a hidden section, which
100  // is also inside the table.
101  SwSectionNode* pSectNd = aChkIdx.GetNode().FindSectionNode();
102  if ( !pSectNd ||
103  pSectNd->GetIndex() < pTableNd->GetIndex() ||
104  !pSectNd->GetSection().IsHiddenFlag() )
105  {
106  bFound = true;
107  }
108  }
109  }
110  } while ( !bFound );
111  }
112 
113  // Find the Box's StartNode
114  const SwTableSortBoxes& rSortBoxes = pTableNd->GetTable().GetTabSortBoxes();
115  sal_uLong nIdx = _rNd.GetIndex();
116  for (size_t n = 0; n < rSortBoxes.size(); ++n)
117  {
118  const SwStartNode* pNd = rSortBoxes[ n ]->GetSttNd();
119  if ( pNd->GetIndex() < nIdx && nIdx < pNd->EndOfSectionIndex() )
120  {
121  // The other index needs to be within the same Section
122  nIdx = aChkIdx.GetIndex();
123  return pNd->GetIndex() < nIdx && nIdx < pNd->EndOfSectionIndex();
124  }
125  }
126 
127  return true;
128 }
129 
130 static void lcl_CheckEmptyLayFrame( SwNodes const & rNds, SwSectionData& rSectionData,
131  const SwNode& rStt, const SwNode& rEnd )
132 {
133  SwNodeIndex aIdx( rStt );
134  if( !SwNodes::GoPrevSection( &aIdx, true, false ) ||
135  !CheckNodesRange( rStt, aIdx, true ) ||
136  // #i21457#
137  !lcl_IsInSameTableBox( rNds, rStt, true ))
138  {
139  aIdx = rEnd;
140  if( !rNds.GoNextSection( &aIdx, true, false ) ||
141  !CheckNodesRange( rEnd, aIdx, true ) ||
142  // #i21457#
143  !lcl_IsInSameTableBox( rNds, rEnd, false ))
144  {
145  rSectionData.SetHidden( false );
146  }
147  }
148 }
149 
150 SwSection *
151 SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData,
152  std::pair<SwTOXBase const*, sw::RedlineMode> const*const pTOXBaseAndMode,
153  SfxItemSet const*const pAttr, bool const bUpdate)
154 {
155  const SwNode* pPrvNd = nullptr;
156  sal_uInt16 nRegionRet = 0;
157  if( rRange.HasMark() &&
158  0 == ( nRegionRet = IsInsRegionAvailable( rRange, &pPrvNd ) ))
159  {
160  // demoted to info because this is called from SwXTextSection::attach,
161  // so it could be invalid input
162  SAL_INFO("sw.core" , "InsertSwSection: rRange overlaps other sections");
163  return nullptr;
164  }
165 
166  // See if the whole Document should be hidden, which we currently are not able to do.
167  if (rNewData.IsHidden() && rRange.HasMark())
168  {
169  const SwPosition *pStt = rRange.Start(), *pEnd = rRange.End();
170  if( !pStt->nContent.GetIndex() &&
171  pEnd->nNode.GetNode().GetContentNode()->Len() ==
172  pEnd->nContent.GetIndex() )
173  {
175  rNewData,
176  pStt->nNode.GetNode(),
177  pEnd->nNode.GetNode() );
178  }
179  }
180 
181  SwUndoInsSection* pUndoInsSect = nullptr;
182  bool const bUndo(GetIDocumentUndoRedo().DoesUndo());
183  if (bUndo)
184  {
185  pUndoInsSect = new SwUndoInsSection(rRange, rNewData, pAttr, pTOXBaseAndMode);
186  GetIDocumentUndoRedo().AppendUndo( std::unique_ptr<SwUndo>(pUndoInsSect) );
187  GetIDocumentUndoRedo().DoUndo(false);
188  }
189 
190  SwSectionFormat* const pFormat = MakeSectionFormat();
191  if ( pAttr )
192  {
193  pFormat->SetFormatAttr( *pAttr );
194  }
195 
196  SwTOXBase const*const pTOXBase(pTOXBaseAndMode ? pTOXBaseAndMode->first : nullptr);
197  SwSectionNode* pNewSectNode = nullptr;
198 
201 
202  if( rRange.HasMark() )
203  {
204  SwPosition *pSttPos = const_cast<SwPosition*>(rRange.Start()),
205  *pEndPos = const_cast<SwPosition*>(rRange.End());
206  if( pPrvNd && 3 == nRegionRet )
207  {
208  OSL_ENSURE( pPrvNd, "The SectionNode is missing" );
209  SwNodeIndex aStt( pSttPos->nNode ), aEnd( pEndPos->nNode, +1 );
210  while( pPrvNd != aStt.GetNode().StartOfSectionNode() )
211  --aStt;
212  while( pPrvNd != aEnd.GetNode().StartOfSectionNode() )
213  ++aEnd;
214 
215  --aEnd; // End is inclusive in the InsertSection
216  pNewSectNode = GetNodes().InsertTextSection(
217  aStt, *pFormat, rNewData, pTOXBase, & aEnd);
218  }
219  else
220  {
221  if( pUndoInsSect )
222  {
223  if( !( pPrvNd && 1 == nRegionRet ) &&
224  pSttPos->nContent.GetIndex() )
225  {
226  SwTextNode* const pTNd =
227  pSttPos->nNode.GetNode().GetTextNode();
228  if (pTNd)
229  {
230  pUndoInsSect->SaveSplitNode( pTNd, true );
231  }
232  }
233 
234  if ( !( pPrvNd && 2 == nRegionRet ) )
235  {
236  SwTextNode *const pTNd =
237  pEndPos->nNode.GetNode().GetTextNode();
238  if (pTNd && (pTNd->GetText().getLength()
239  != pEndPos->nContent.GetIndex()))
240  {
241  pUndoInsSect->SaveSplitNode( pTNd, false );
242  }
243  }
244  }
245 
246  if( pPrvNd && 1 == nRegionRet )
247  {
248  pSttPos->nNode.Assign( *pPrvNd );
249  pSttPos->nContent.Assign( pSttPos->nNode.GetNode().GetContentNode(), 0 );
250  }
251  else if( pSttPos->nContent.GetIndex() )
252  {
253  getIDocumentContentOperations().SplitNode( *pSttPos, false );
254  }
255 
256  if( pPrvNd && 2 == nRegionRet )
257  {
258  pEndPos->nNode.Assign( *pPrvNd );
259  pEndPos->nContent.Assign( pEndPos->nNode.GetNode().GetContentNode(), 0 );
260  }
261  else
262  {
263  const SwContentNode* pCNd = pEndPos->nNode.GetNode().GetContentNode();
264  if( pCNd && pCNd->Len() != pEndPos->nContent.GetIndex() )
265  {
266  sal_Int32 nContent = pSttPos->nContent.GetIndex();
267  getIDocumentContentOperations().SplitNode( *pEndPos, false );
268 
269  SwTextNode* pTNd;
270  if( pEndPos->nNode.GetIndex() == pSttPos->nNode.GetIndex() )
271  {
272  --pSttPos->nNode;
273  --pEndPos->nNode;
274  pTNd = pSttPos->nNode.GetNode().GetTextNode();
275  pSttPos->nContent.Assign( pTNd, nContent );
276  }
277  else
278  {
279  // Set to the end of the previous
280  --pEndPos->nNode;
281  pTNd = pEndPos->nNode.GetNode().GetTextNode();
282  }
283  nContent = pTNd ? pTNd->GetText().getLength() : 0;
284  pEndPos->nContent.Assign( pTNd, nContent );
285  }
286  }
287  pNewSectNode = GetNodes().InsertTextSection(
288  pSttPos->nNode, *pFormat, rNewData, pTOXBase, &pEndPos->nNode);
289  }
290  }
291  else
292  {
293  const SwPosition* pPos = rRange.GetPoint();
294  const SwContentNode* pCNd = pPos->nNode.GetNode().GetContentNode();
295  if( !pPos->nContent.GetIndex() )
296  {
297  pNewSectNode = GetNodes().InsertTextSection(
298  pPos->nNode, *pFormat, rNewData, pTOXBase, nullptr);
299  }
300  else if( pPos->nContent.GetIndex() == pCNd->Len() )
301  {
302  pNewSectNode = GetNodes().InsertTextSection(
303  pPos->nNode, *pFormat, rNewData, pTOXBase, nullptr, false);
304  }
305  else
306  {
307  if( pUndoInsSect && pCNd->IsTextNode() )
308  {
309  pUndoInsSect->SaveSplitNode( const_cast<SwTextNode*>(static_cast<const SwTextNode*>(pCNd)), true );
310  }
311  getIDocumentContentOperations().SplitNode( *pPos, false );
312  pNewSectNode = GetNodes().InsertTextSection(
313  pPos->nNode, *pFormat, rNewData, pTOXBase, nullptr);
314  }
315  }
316 
317 //FEATURE::CONDCOLL
318  pNewSectNode->CheckSectionCondColl();
319 //FEATURE::CONDCOLL
320 
322 
323  // To-Do - add 'SwExtraRedlineTable' also ?
324  if( getIDocumentRedlineAccess().IsRedlineOn() || (!getIDocumentRedlineAccess().IsIgnoreRedline() && !getIDocumentRedlineAccess().GetRedlineTable().empty() ))
325  {
326  SwPaM aPam( *pNewSectNode->EndOfSectionNode(), *pNewSectNode, 1 );
328  {
330  }
331  else
332  {
334  }
335  }
336 
337  // Is a Condition set?
338  if (rNewData.IsHidden() && !rNewData.GetCondition().isEmpty())
339  {
340  // The calculate up to that position
341  SwCalc aCalc( *this );
342  if( ! IsInReading() )
343  {
344  getIDocumentFieldsAccess().FieldsToCalc( aCalc, pNewSectNode->GetIndex(), USHRT_MAX );
345  }
346  SwSection& rNewSect = pNewSectNode->GetSection();
347  rNewSect.SetCondHidden( aCalc.Calculate( rNewSect.GetCondition() ).GetBool() );
348  }
349 
350  bool bUpdateFootnote = false;
351  if( !GetFootnoteIdxs().empty() && pAttr )
352  {
353  sal_uInt16 nVal = pAttr->Get( RES_FTN_AT_TXTEND ).GetValue();
354  if( ( FTNEND_ATTXTEND_OWNNUMSEQ == nVal ||
355  FTNEND_ATTXTEND_OWNNUMANDFMT == nVal ) ||
356  ( FTNEND_ATTXTEND_OWNNUMSEQ == ( nVal = pAttr->Get( RES_END_AT_TXTEND ).GetValue() ) ||
358  {
359  bUpdateFootnote = true;
360  }
361  }
362 
363  if( pUndoInsSect )
364  {
365  pUndoInsSect->SetSectNdPos( pNewSectNode->GetIndex() );
366  pUndoInsSect->SetUpdateFootnoteFlag( bUpdateFootnote );
367  GetIDocumentUndoRedo().DoUndo(bUndo);
368  }
369 
370  if (rNewData.IsLinkType())
371  {
372  pNewSectNode->GetSection().CreateLink( bUpdate ? CREATE_UPDATE : CREATE_CONNECT );
373  }
374 
375  if( bUpdateFootnote )
376  {
377  GetFootnoteIdxs().UpdateFootnote( SwNodeIndex( *pNewSectNode ));
378  }
379 
381  return &pNewSectNode->GetSection();
382 }
383 
384 sal_uInt16 SwDoc::IsInsRegionAvailable( const SwPaM& rRange,
385  const SwNode** ppSttNd )
386 {
387  sal_uInt16 nRet = 1;
388  if( rRange.HasMark() )
389  {
390  // See if we have a valid Section
391  const SwPosition* pStt = rRange.Start();
392  const SwPosition* pEnd = rRange.End();
393 
394  const SwContentNode* pCNd = pEnd->nNode.GetNode().GetContentNode();
395  const SwNode* pNd = &pStt->nNode.GetNode();
396  const SwSectionNode* pSectNd = pNd->FindSectionNode();
397  const SwSectionNode* pEndSectNd = pCNd ? pCNd->FindSectionNode() : nullptr;
398  if( pSectNd && pEndSectNd && pSectNd != pEndSectNd )
399  {
400  // Try to create an enclosing Section, but only if Start is
401  // located at the Section's beginning and End at it's end
402  nRet = 0;
403  if( !pStt->nContent.GetIndex()
404  && pSectNd->GetIndex() == pStt->nNode.GetIndex() - 1
405  && pEnd->nContent.GetIndex() == pCNd->Len() )
406  {
407  SwNodeIndex aIdx( pStt->nNode, -1 );
408  sal_uLong nCmp = pEnd->nNode.GetIndex();
409  const SwStartNode* pPrvNd;
410  const SwEndNode* pNxtNd;
411  while( nullptr != ( pPrvNd = (pNd = &aIdx.GetNode())->GetSectionNode() ) &&
412  !( aIdx.GetIndex() < nCmp &&
413  nCmp < pPrvNd->EndOfSectionIndex() ) )
414  {
415  --aIdx;
416  }
417  if( !pPrvNd )
418  pPrvNd = pNd->IsStartNode() ? static_cast<const SwStartNode*>(pNd)
419  : pNd->StartOfSectionNode();
420 
421  aIdx = pEnd->nNode.GetIndex() + 1;
422  nCmp = pStt->nNode.GetIndex();
423  while( nullptr != ( pNxtNd = (pNd = &aIdx.GetNode())->GetEndNode() ) &&
424  pNxtNd->StartOfSectionNode()->IsSectionNode() &&
425  !( pNxtNd->StartOfSectionIndex() < nCmp &&
426  nCmp < aIdx.GetIndex() ) )
427  {
428  ++aIdx;
429  }
430  if( !pNxtNd )
431  pNxtNd = pNd->EndOfSectionNode();
432 
433  if( pPrvNd && pNxtNd && pPrvNd == pNxtNd->StartOfSectionNode() )
434  {
435  nRet = 3;
436 
437  if( ppSttNd )
438  *ppSttNd = pPrvNd;
439  }
440  }
441  }
442  else if( !pSectNd && pEndSectNd )
443  {
444  // Try to create an enclosing Section, but only if the End
445  // is at the Section's end.
446  nRet = 0;
447  if( pEnd->nContent.GetIndex() == pCNd->Len() )
448  {
449  SwNodeIndex aIdx( pEnd->nNode, 1 );
450  if( aIdx.GetNode().IsEndNode() &&
451  nullptr != aIdx.GetNode().FindSectionNode() )
452  {
453  do {
454  ++aIdx;
455  } while( aIdx.GetNode().IsEndNode() &&
456  nullptr != aIdx.GetNode().FindSectionNode() );
457  {
458  nRet = 2;
459  if( ppSttNd )
460  {
461  --aIdx;
462  *ppSttNd = &aIdx.GetNode();
463  }
464  }
465  }
466  }
467  }
468  else if( pSectNd && !pEndSectNd )
469  {
470  // Try to create an enclosing Section, but only if Start
471  // is at the Section's start.
472  nRet = 0;
473  if( !pStt->nContent.GetIndex() )
474  {
475  SwNodeIndex aIdx( pStt->nNode, -1 );
476  if( aIdx.GetNode().IsSectionNode() )
477  {
478  do {
479  --aIdx;
480  } while( aIdx.GetNode().IsSectionNode() );
481  if( !aIdx.GetNode().IsSectionNode() )
482  {
483  nRet = 1;
484  if( ppSttNd )
485  {
486  ++aIdx;
487  *ppSttNd = &aIdx.GetNode();
488  }
489  }
490  }
491  }
492  }
493  }
494  return nRet;
495 }
496 
498 {
499  const SwSectionNode* pSectNd = rPos.nNode.GetNode().FindSectionNode();
500  if( pSectNd )
501  return const_cast<SwSection*>(&pSectNd->GetSection());
502  return nullptr;
503 }
504 
506 {
507  SwSectionFormat* pNew = new SwSectionFormat( mpDfltFrameFormat.get(), this );
508  mpSectionFormatTable->push_back( pNew );
509  return pNew;
510 }
511 
512 void SwDoc::DelSectionFormat( SwSectionFormat *pFormat, bool bDelNodes )
513 {
514  SwSectionFormats::iterator itFormatPos = std::find( mpSectionFormatTable->begin(), mpSectionFormatTable->end(), pFormat );
515 
517 
518  if( mpSectionFormatTable->end() != itFormatPos )
519  {
520  const SwNodeIndex* pIdx = pFormat->GetContent( false ).GetContentIdx();
521  const SfxPoolItem* pFootnoteEndAtTextEnd;
522  if( SfxItemState::SET != pFormat->GetItemState(
523  RES_FTN_AT_TXTEND, true, &pFootnoteEndAtTextEnd ) ||
524  SfxItemState::SET != pFormat->GetItemState(
525  RES_END_AT_TXTEND, true, &pFootnoteEndAtTextEnd ))
526  pFootnoteEndAtTextEnd = nullptr;
527 
528  const SwSectionNode* pSectNd;
529 
531  {
532  if( bDelNodes && pIdx && &GetNodes() == &pIdx->GetNodes() &&
533  nullptr != (pSectNd = pIdx->GetNode().GetSectionNode() ))
534  {
535  SwNodeIndex aUpdIdx( *pIdx );
536  SwPaM aPaM( *pSectNd->EndOfSectionNode(), *pSectNd );
537  GetIDocumentUndoRedo().AppendUndo( std::make_unique<SwUndoDelete>( aPaM ));
538  if( pFootnoteEndAtTextEnd )
539  GetFootnoteIdxs().UpdateFootnote( aUpdIdx );
541  //#126178# start/end undo have to be pairs!
543  return ;
544  }
546  }
547  else if( bDelNodes && pIdx && &GetNodes() == &pIdx->GetNodes() &&
548  nullptr != (pSectNd = pIdx->GetNode().GetSectionNode() ))
549  {
550  SwNodeIndex aUpdIdx( *pIdx );
551  getIDocumentContentOperations().DeleteSection( const_cast<SwNode*>(static_cast<SwNode const *>(pSectNd)) );
552  if( pFootnoteEndAtTextEnd )
553  GetFootnoteIdxs().UpdateFootnote( aUpdIdx );
555  //#126178# start/end undo have to be pairs!
557  return ;
558  }
559 
560  {
561  SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, pFormat );
562  pFormat->ModifyNotification( &aMsgHint, &aMsgHint );
563  }
564 
565  // A ClearRedo could result in a recursive call of this function and delete some section
566  // formats, thus the position inside the SectionFormatTable could have changed
567  itFormatPos = std::find( mpSectionFormatTable->begin(), mpSectionFormatTable->end(), pFormat );
568 
569  // WARNING: First remove from the array and then delete,
570  // as the Section DTOR tries to delete it's format itself.
571  mpSectionFormatTable->erase( itFormatPos );
572 //FEATURE::CONDCOLL
573  sal_uLong nCnt = 0, nSttNd = 0;
574  if( pIdx && &GetNodes() == &pIdx->GetNodes() &&
575  nullptr != (pSectNd = pIdx->GetNode().GetSectionNode() ))
576  {
577  nSttNd = pSectNd->GetIndex();
578  nCnt = pSectNd->EndOfSectionIndex() - nSttNd - 1;
579  }
580 //FEATURE::CONDCOLL
581 
582  delete pFormat;
583 
584  if( nSttNd && pFootnoteEndAtTextEnd )
585  {
586  SwNodeIndex aUpdIdx( GetNodes(), nSttNd );
587  GetFootnoteIdxs().UpdateFootnote( aUpdIdx );
588  }
589 
590 //FEATURE::CONDCOLL
591  SwContentNode* pCNd;
592  for( ; nCnt--; ++nSttNd )
593  if( nullptr != (pCNd = GetNodes()[ nSttNd ]->GetContentNode() ) &&
594  RES_CONDTXTFMTCOLL == pCNd->GetFormatColl()->Which() )
595  pCNd->ChkCondColl();
596 //FEATURE::CONDCOLL
597  }
598 
600 
602 }
603 
604 void SwDoc::UpdateSection( size_t const nPos, SwSectionData & rNewData,
605  SfxItemSet const*const pAttr, bool const bPreventLinkUpdate )
606 {
607  SwSectionFormat* pFormat = (*mpSectionFormatTable)[ nPos ];
608  SwSection* pSection = pFormat->GetSection();
609 
611  bool bOldCondHidden = pSection->IsCondHidden();
612 
613  if (pSection->DataEquals(rNewData))
614  {
615  // Check Attributes
616  bool bOnlyAttrChg = false;
617  if( pAttr && pAttr->Count() )
618  {
619  SfxItemIter aIter( *pAttr );
620  const SfxPoolItem* pItem = aIter.GetCurItem();
621  do
622  {
623  if (pFormat->GetFormatAttr(pItem->Which()) != *pItem)
624  {
625  bOnlyAttrChg = true;
626  break;
627  }
628 
629  pItem = aIter.NextItem();
630  } while (pItem);
631  }
632 
633  if( bOnlyAttrChg )
634  {
635  if (GetIDocumentUndoRedo().DoesUndo())
636  {
638  MakeUndoUpdateSection( *pFormat, true ) );
639  }
640  // #i32968# Inserting columns in the section causes MakeFrameFormat
641  // to put two objects of type SwUndoFrameFormat on the undo stack.
642  // We don't want them.
643  ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
644  pFormat->SetFormatAttr( *pAttr );
646  }
647  return;
648  }
649 
650  // Test if the whole Content Section (Document/TableBox/Fly) should be hidden,
651  // which we're currently not able to do.
652  const SwNodeIndex* pIdx = nullptr;
653  {
654  if (rNewData.IsHidden())
655  {
656  pIdx = pFormat->GetContent().GetContentIdx();
657  if (pIdx)
658  {
659  const SwSectionNode* pSectNd =
660  pIdx->GetNode().GetSectionNode();
661  if (pSectNd)
662  {
663  ::lcl_CheckEmptyLayFrame( GetNodes(), rNewData,
664  *pSectNd, *pSectNd->EndOfSectionNode() );
665  }
666  }
667  }
668  }
669 
671  {
673  }
674  // #i32968# Inserting columns in the section causes MakeFrameFormat to put two
675  // objects of type SwUndoFrameFormat on the undo stack. We don't want them.
676  ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
677 
678  // The LinkFileName could only consist of separators
679  OUString sCompareString = OUStringChar(sfx2::cTokenSeparator) + OUStringChar(sfx2::cTokenSeparator);
680  const bool bUpdate =
681  (!pSection->IsLinkType() && rNewData.IsLinkType())
682  || (!rNewData.GetLinkFileName().isEmpty()
683  && (rNewData.GetLinkFileName() != sCompareString)
684  && (rNewData.GetLinkFileName() != pSection->GetLinkFileName()));
685 
686  OUString sSectName( rNewData.GetSectionName() );
687  if (sSectName != pSection->GetSectionName())
688  sSectName = GetUniqueSectionName( &sSectName );
689  else
690  sSectName.clear();
691 
698  pSection->SetSectionData(rNewData);
699 
700  if( pAttr )
701  pSection->GetFormat()->SetFormatAttr( *pAttr );
702 
703  if( !sSectName.isEmpty() )
704  {
705  pSection->SetSectionName( sSectName );
706  }
707 
708  // Is a Condition set
709  if( pSection->IsHidden() && !pSection->GetCondition().isEmpty() )
710  {
711  // Then calculate up to that position
712  SwCalc aCalc( *this );
713  if( !pIdx )
714  pIdx = pFormat->GetContent().GetContentIdx();
716 
724  bool bCalculatedCondHidden =
725  aCalc.Calculate( pSection->GetCondition() ).GetBool();
726  if ( bCalculatedCondHidden && !bOldCondHidden )
727  {
728  pSection->SetCondHidden( false );
729  }
730  pSection->SetCondHidden( bCalculatedCondHidden );
731  }
732 
733  if( bUpdate )
734  pSection->CreateLink( bPreventLinkUpdate ? CREATE_CONNECT : CREATE_UPDATE );
735  else if( !pSection->IsLinkType() && pSection->IsConnected() )
736  {
737  pSection->Disconnect();
739  }
740 
742 }
743 
745 {
746  SwFootnoteIdxs& rFootnoteArr = pNd->GetDoc()->GetFootnoteIdxs();
747  if( !rFootnoteArr.empty() )
748  {
749  size_t nPos = 0;
750  rFootnoteArr.SeekEntry( SwNodeIndex( *pNd ), &nPos );
751  SwTextFootnote* pSrch;
752 
753  // Delete all succeeding Footnotes
754  while( nPos < rFootnoteArr.size() &&
755  SwTextFootnote_GetIndex( (pSrch = rFootnoteArr[ nPos ]) ) <= nEnd )
756  {
757  // If the Nodes are not deleted, they need to deregister at the Pages
758  // (delete Frames) or else they will remain there (Undo does not delete them!)
759  pSrch->DelFrames(nullptr);
760  ++nPos;
761  }
762 
763  while( nPos-- &&
764  SwTextFootnote_GetIndex( (pSrch = rFootnoteArr[ nPos ]) ) >= nStt )
765  {
766  // If the Nodes are not deleted, they need to deregister at the Pages
767  // (delete Frames) or else they will remain there (Undo does not delete them!)
768  pSrch->DelFrames(nullptr);
769  }
770  }
771 }
772 
773 static bool lcl_IsTOXSection(SwSectionData const& rSectionData)
774 {
775  return (TOX_CONTENT_SECTION == rSectionData.GetType())
776  || (TOX_HEADER_SECTION == rSectionData.GetType());
777 }
778 
780  SwSectionFormat& rSectionFormat,
781  SwSectionData const& rSectionData,
782  SwTOXBase const*const pTOXBase,
783  SwNodeIndex const*const pEnde,
784  bool const bInsAtStart, bool const bCreateFrames)
785 {
786  SwNodeIndex aInsPos( rNdIdx );
787  if( !pEnde ) // No Area, thus create a new Section before/after it
788  {
789  // #i26762#
790  OSL_ENSURE(!pEnde || rNdIdx <= *pEnde,
791  "Section start and end in wrong order!");
792 
793  if( bInsAtStart )
794  {
795  if (!lcl_IsTOXSection(rSectionData))
796  {
797  do {
798  --aInsPos;
799  } while( aInsPos.GetNode().IsSectionNode() );
800  ++aInsPos;
801  }
802  }
803  else
804  {
805  ++aInsPos;
806  if (!lcl_IsTOXSection(rSectionData))
807  {
808  SwNode* pNd;
809  while( aInsPos.GetIndex() < Count() - 1 &&
810  ( pNd = &aInsPos.GetNode())->IsEndNode() &&
812  {
813  ++aInsPos;
814  }
815  }
816  }
817  }
818 
819  SwSectionNode *const pSectNd =
820  new SwSectionNode(aInsPos, rSectionFormat, pTOXBase);
821  if( pEnde )
822  {
823  // Special case for the Reader/Writer
824  if( &pEnde->GetNode() != &GetEndOfContent() )
825  aInsPos = pEnde->GetIndex()+1;
826  // #i58710: We created a RTF document with a section break inside a table cell
827  // We are not able to handle a section start inside a table and the section end outside.
828  const SwNode* pLastNode = pSectNd->StartOfSectionNode()->EndOfSectionNode();
829  if( aInsPos > pLastNode->GetIndex() )
830  aInsPos = pLastNode->GetIndex();
831  // Another way round: if the section starts outside a table but the end is inside...
832  // aInsPos is at the moment the Position where my EndNode will be inserted
833  const SwStartNode* pStartNode = aInsPos.GetNode().StartOfSectionNode();
834  // This StartNode should be in front of me, but if not, I want to survive
835  sal_uLong nMyIndex = pSectNd->GetIndex();
836  if( pStartNode->GetIndex() > nMyIndex ) // Suspicious!
837  {
838  const SwNode* pTemp;
839  do
840  {
841  pTemp = pStartNode; // pTemp is a suspicious one
842  pStartNode = pStartNode->StartOfSectionNode();
843  }
844  while( pStartNode->GetIndex() > nMyIndex );
845  pTemp = pTemp->EndOfSectionNode();
846  // If it starts behind me but ends behind my end...
847  if( pTemp->GetIndex() >= aInsPos.GetIndex() )
848  aInsPos = pTemp->GetIndex()+1; // ...I have to correct my end position
849  }
850  }
851  else
852  {
853  SwTextNode* pCpyTNd = rNdIdx.GetNode().GetTextNode();
854  if( pCpyTNd )
855  {
856  SwTextNode* pTNd = new SwTextNode( aInsPos, pCpyTNd->GetTextColl() );
857  if( pCpyTNd->HasSwAttrSet() )
858  {
859  // Move PageDesc/Break to the first Node of the section
860  const SfxItemSet& rSet = *pCpyTNd->GetpSwAttrSet();
861  if( SfxItemState::SET == rSet.GetItemState( RES_BREAK ) ||
862  SfxItemState::SET == rSet.GetItemState( RES_PAGEDESC ))
863  {
864  SfxItemSet aSet( rSet );
865  if( bInsAtStart )
866  pCpyTNd->ResetAttr( RES_PAGEDESC, RES_BREAK );
867  else
868  {
869  aSet.ClearItem( RES_PAGEDESC );
870  aSet.ClearItem( RES_BREAK );
871  }
872  pTNd->SetAttr( aSet );
873  }
874  else
875  pTNd->SetAttr( rSet );
876  }
877  // Do not forget to create the Frame!
878  pCpyTNd->MakeFramesForAdjacentContentNode(*pTNd);
879  }
880  else
881  new SwTextNode( aInsPos, GetDoc()->GetDfltTextFormatColl() );
882  }
883  new SwEndNode( aInsPos, *pSectNd );
884 
885  pSectNd->GetSection().SetSectionData(rSectionData);
886  SwSectionFormat* pSectFormat = pSectNd->GetSection().GetFormat();
887 
888  // We could optimize this, by not removing already contained Frames and recreating them,
889  // but by simply rewiring them
890  bool bInsFrame = bCreateFrames && !pSectNd->GetSection().IsHidden() &&
892  SwNode2LayoutSaveUpperFrames *pNode2Layout = nullptr;
893  if( bInsFrame )
894  {
895  SwNodeIndex aTmp( *pSectNd );
896  if( !pSectNd->GetNodes().FindPrvNxtFrameNode( aTmp, pSectNd->EndOfSectionNode() ) )
897  // Collect all Uppers
898  pNode2Layout = new SwNode2LayoutSaveUpperFrames(*pSectNd);
899  }
900 
901  // Set the right StartNode for all in this Area
902  sal_uLong nEnde = pSectNd->EndOfSectionIndex();
903  sal_uLong nStart = pSectNd->GetIndex()+1;
904  sal_uLong nSkipIdx = ULONG_MAX;
905  for( sal_uLong n = nStart; n < nEnde; ++n )
906  {
907  SwNode* pNd = (*this)[n];
908 
909  // Attach all Sections in the NodeSection underneath the new one
910  if( ULONG_MAX == nSkipIdx )
911  pNd->m_pStartOfSection = pSectNd;
912  else if( n >= nSkipIdx )
913  nSkipIdx = ULONG_MAX;
914 
915  if( pNd->IsStartNode() )
916  {
917  // Make up the Format's nesting
918  if( pNd->IsSectionNode() )
919  {
920  static_cast<SwSectionNode*>(pNd)->GetSection().GetFormat()->
921  SetDerivedFrom( pSectFormat );
922  static_cast<SwSectionNode*>(pNd)->DelFrames();
923  n = pNd->EndOfSectionIndex();
924  }
925  else
926  {
927  if( pNd->IsTableNode() )
928  static_cast<SwTableNode*>(pNd)->DelFrames();
929 
930  if( ULONG_MAX == nSkipIdx )
931  nSkipIdx = pNd->EndOfSectionIndex();
932  }
933  }
934  else if( pNd->IsContentNode() )
935  static_cast<SwContentNode*>(pNd)->DelFrames(nullptr);
936  }
937 
938  sw_DeleteFootnote( pSectNd, nStart, nEnde );
939 
940  if( bInsFrame )
941  {
942  if( pNode2Layout )
943  {
944  sal_uLong nIdx = pSectNd->GetIndex();
945  pNode2Layout->RestoreUpperFrames( pSectNd->GetNodes(), nIdx, nIdx + 1 );
946  delete pNode2Layout;
947  }
948  else
949  pSectNd->MakeOwnFrames(&aInsPos);
950  }
951 
952  return pSectNd;
953 }
954 
956 {
957  if( IsSectionNode() )
958  return GetSectionNode();
960  while( !pTmp->IsSectionNode() && pTmp->GetIndex() )
961  pTmp = pTmp->m_pStartOfSection;
962  return pTmp->GetSectionNode();
963 }
964 
965 // SwSectionNode
966 
967 // ugly hack to make m_pSection const
968 static SwSectionFormat &
970 {
971  SwSectionNode *const pParent =
973  if( pParent )
974  {
975  // Register the Format at the right Parent
976  rFormat.SetDerivedFrom( pParent->GetSection().GetFormat() );
977  }
978  return rFormat;
979 }
980 
982  SwSectionFormat & rFormat, SwTOXBase const*const pTOXBase)
983  : SwStartNode( rIdx, SwNodeType::Section )
984  , m_pSection( pTOXBase
985  ? new SwTOXBaseSection(*pTOXBase, lcl_initParent(*this, rFormat))
986  : new SwSection( CONTENT_SECTION, rFormat.GetName(),
987  lcl_initParent(*this, rFormat) ) )
988 {
989  // Set the connection from Format to Node
990  // Suppress Modify; no one's interested anyway
991  rFormat.LockModify();
992  rFormat.SetFormatAttr( SwFormatContent( this ) );
993  rFormat.UnlockModify();
994 }
995 
997 {
998  // mba: test if iteration works as clients will be removed in callback
999  // use hint which allows to specify, if the content shall be saved or not
1000  m_pSection->GetFormat()->CallSwClientNotify( SwSectionFrameMoveAndDeleteHint( true ) );
1001  SwSectionFormat* pFormat = m_pSection->GetFormat();
1002  if( pFormat )
1003  {
1004  // Remove the Attribute, because the Section deletes it's Format
1005  // and it will neutralize the Section, if the Content Attribute is set
1006  pFormat->LockModify();
1007  pFormat->ResetFormatAttr( RES_CNTNT );
1008  pFormat->UnlockModify();
1009  }
1010 }
1011 
1013 {
1014  m_pSection->m_Data.SetHiddenFlag(false);
1015  return new SwSectionFrame( *m_pSection, pSib );
1016 }
1017 
1018 // Creates all Document Views for the preceding Node.
1019 // The created ContentFrames are attached to the corresponding Layout
1021 {
1022  // Take my successive or preceding ContentFrame
1023  SwNodes& rNds = GetNodes();
1025  {
1026  if( GetSection().IsHidden() || IsContentHidden() )
1027  {
1028  SwNodeIndex aIdx( *EndOfSectionNode() );
1029  SwContentNode* pCNd = rNds.GoNextSection( &aIdx, true, false );
1030  if( !pCNd )
1031  {
1032  aIdx = *this;
1033  pCNd = SwNodes::GoPrevSection(&aIdx, true, false);
1034  if (!pCNd)
1035  return;
1036  }
1037  pCNd = aIdx.GetNode().GetContentNode();
1038  pCNd->MakeFramesForAdjacentContentNode(static_cast<SwContentNode&>(rIdx.GetNode()));
1039  }
1040  else
1041  {
1042  SwNode2Layout aNode2Layout( *this, rIdx.GetIndex() );
1043  SwFrame *pFrame;
1044  while( nullptr != (pFrame = aNode2Layout.NextFrame()) )
1045  {
1046  OSL_ENSURE( pFrame->IsSctFrame(), "Depend of Section not a Section." );
1047  if (pFrame->getRootFrame()->IsHideRedlines()
1049  {
1050  continue;
1051  }
1052  SwFrame *pNew = rIdx.GetNode().GetContentNode()->MakeFrame( pFrame );
1053 
1054  SwSectionNode* pS = rIdx.GetNode().FindSectionNode();
1055 
1056  // Assure that node is not inside a table, which is inside the
1057  // found section.
1058  if ( pS )
1059  {
1060  SwTableNode* pTableNode = rIdx.GetNode().FindTableNode();
1061  if ( pTableNode &&
1062  pTableNode->GetIndex() > pS->GetIndex() )
1063  {
1064  pS = nullptr;
1065  }
1066  }
1067 
1068  // if the node is in a section, the sectionframe now
1069  // has to be created...
1070  // boolean to control <Init()> of a new section frame.
1071  bool bInitNewSect = false;
1072  if( pS )
1073  {
1074  SwSectionFrame *pSct = new SwSectionFrame( pS->GetSection(), pFrame );
1075  // prepare <Init()> of new section frame.
1076  bInitNewSect = true;
1077  SwLayoutFrame* pUp = pSct;
1078  while( pUp->Lower() ) // for columned sections
1079  {
1080  OSL_ENSURE( pUp->Lower()->IsLayoutFrame(),"Who's in there?" );
1081  pUp = static_cast<SwLayoutFrame*>(pUp->Lower());
1082  }
1083  pNew->Paste( pUp );
1084  // #i27138#
1085  // notify accessibility paragraphs objects about changed
1086  // CONTENT_FLOWS_FROM/_TO relation.
1087  // Relation CONTENT_FLOWS_FROM for next paragraph will change
1088  // and relation CONTENT_FLOWS_TO for previous paragraph will change.
1089  if ( pNew->IsTextFrame() )
1090  {
1091  SwViewShell* pViewShell( pNew->getRootFrame()->GetCurrShell() );
1092  if ( pViewShell && pViewShell->GetLayout() &&
1093  pViewShell->GetLayout()->IsAnyShellAccessible() )
1094  {
1096  dynamic_cast<SwTextFrame*>(pNew->FindNextCnt( true )),
1097  dynamic_cast<SwTextFrame*>(pNew->FindPrevCnt()) );
1098  }
1099  }
1100  pNew = pSct;
1101  }
1102 
1103  // If a Node got Frames attached before or after
1104  if ( rIdx < GetIndex() )
1105  // the new one precedes me
1106  pNew->Paste( pFrame->GetUpper(), pFrame );
1107  else
1108  // the new one succeeds me
1109  pNew->Paste( pFrame->GetUpper(), pFrame->GetNext() );
1110  // #i27138#
1111  // notify accessibility paragraphs objects about changed
1112  // CONTENT_FLOWS_FROM/_TO relation.
1113  // Relation CONTENT_FLOWS_FROM for next paragraph will change
1114  // and relation CONTENT_FLOWS_TO for previous paragraph will change.
1115  if ( pNew->IsTextFrame() )
1116  {
1117  SwViewShell* pViewShell( pNew->getRootFrame()->GetCurrShell() );
1118  if ( pViewShell && pViewShell->GetLayout() &&
1119  pViewShell->GetLayout()->IsAnyShellAccessible() )
1120  {
1122  dynamic_cast<SwTextFrame*>(pNew->FindNextCnt( true )),
1123  dynamic_cast<SwTextFrame*>(pNew->FindPrevCnt()) );
1124  }
1125  }
1126  if ( bInitNewSect )
1127  static_cast<SwSectionFrame*>(pNew)->Init();
1128  }
1129  }
1130  }
1131 }
1132 
1133 // Create a new SectionFrame for every occurrence in the Layout and insert before
1134 // the corresponding ContentFrame
1136 {
1137  OSL_ENSURE( pIdxBehind, "no Index" );
1138  SwNodes& rNds = GetNodes();
1139  SwDoc* pDoc = rNds.GetDoc();
1140 
1141  *pIdxBehind = *this;
1142 
1143  m_pSection->m_Data.SetHiddenFlag(true);
1144 
1145  if( rNds.IsDocNodes() )
1146  {
1147  SwNodeIndex *pEnd = pEndIdx ? pEndIdx :
1148  new SwNodeIndex( *EndOfSectionNode(), 1 );
1149  ::MakeFrames( pDoc, *pIdxBehind, *pEnd );
1150  if( !pEndIdx )
1151  delete pEnd;
1152  }
1153 }
1154 
1155 void SwSectionNode::DelFrames(SwRootFrame const*const /*FIXME TODO*/)
1156 {
1157  sal_uLong nStt = GetIndex()+1, nEnd = EndOfSectionIndex();
1158  if( nStt >= nEnd )
1159  {
1160  return ;
1161  }
1162 
1163  SwNodes& rNds = GetNodes();
1164  m_pSection->GetFormat()->DelFrames();
1165 
1166  // Update our Flag
1167  m_pSection->m_Data.SetHiddenFlag(true);
1168 
1169  // If the Area is within a Fly or TableBox, we can only hide it if
1170  // there is more Content which has Frames.
1171  // Or else the Fly/TableBox Frame does not have a Lower!
1172  {
1173  SwNodeIndex aIdx( *this );
1174  if( !SwNodes::GoPrevSection( &aIdx, true, false ) ||
1175  !CheckNodesRange( *this, aIdx, true ) ||
1176  // #i21457#
1177  !lcl_IsInSameTableBox( rNds, *this, true ))
1178  {
1179  aIdx = *EndOfSectionNode();
1180  if( !rNds.GoNextSection( &aIdx, true, false ) ||
1181  !CheckNodesRange( *EndOfSectionNode(), aIdx, true ) ||
1182  // #i21457#
1183  !lcl_IsInSameTableBox( rNds, *EndOfSectionNode(), false ))
1184  {
1185  m_pSection->m_Data.SetHiddenFlag(false);
1186  }
1187  }
1188  }
1189 }
1190 
1192 {
1193  // In which array am I: Nodes, UndoNodes?
1194  const SwNodes& rNds = GetNodes();
1195 
1196  // Copy the SectionFrameFormat
1197  SwSectionFormat* pSectFormat = pDoc->MakeSectionFormat();
1198  pSectFormat->CopyAttrs( *GetSection().GetFormat() );
1199 
1200  std::unique_ptr<SwTOXBase> pTOXBase;
1201  if (TOX_CONTENT_SECTION == GetSection().GetType())
1202  {
1203  OSL_ENSURE( dynamic_cast< const SwTOXBaseSection* >( &GetSection() ) != nullptr , "no TOXBaseSection!" );
1204  SwTOXBaseSection const& rTBS(
1205  dynamic_cast<SwTOXBaseSection const&>(GetSection()));
1206  pTOXBase.reset( new SwTOXBase(rTBS, pDoc) );
1207  }
1208 
1209  SwSectionNode *const pSectNd =
1210  new SwSectionNode(rIdx, *pSectFormat, pTOXBase.get());
1211  SwEndNode* pEndNd = new SwEndNode( rIdx, *pSectNd );
1212  SwNodeIndex aInsPos( *pEndNd );
1213 
1214  // Take over values
1215  SwSection *const pNewSect = pSectNd->m_pSection.get();
1216 
1217  if (TOX_CONTENT_SECTION != GetSection().GetType())
1218  {
1219  // Keep the Name for Move
1220  if( rNds.GetDoc() == pDoc && pDoc->IsCopyIsMove() )
1221  {
1222  pNewSect->SetSectionName( GetSection().GetSectionName() );
1223  }
1224  else
1225  {
1226  const OUString sSectionName(GetSection().GetSectionName());
1227  pNewSect->SetSectionName(pDoc->GetUniqueSectionName( &sSectionName ));
1228  }
1229  }
1230 
1231  pNewSect->SetType( GetSection().GetType() );
1232  pNewSect->SetCondition( GetSection().GetCondition() );
1233  pNewSect->SetLinkFileName( GetSection().GetLinkFileName() );
1234  if( !pNewSect->IsHiddenFlag() && GetSection().IsHidden() )
1235  pNewSect->SetHidden();
1236  if( !pNewSect->IsProtectFlag() && GetSection().IsProtect() )
1237  pNewSect->SetProtect();
1238  // edit in readonly sections
1239  if( !pNewSect->IsEditInReadonlyFlag() && GetSection().IsEditInReadonly() )
1240  pNewSect->SetEditInReadonly();
1241 
1242  SwNodeRange aRg( *this, +1, *EndOfSectionNode() ); // Where am I?
1243  rNds.Copy_( aRg, aInsPos, false );
1244 
1245  // Delete all Frames from the copied Area. They are created when creating
1246  // the SectionFrames.
1247  pSectNd->DelFrames();
1248 
1249  // Copy the Links/Server
1250  if( pNewSect->IsLinkType() ) // Add the Link
1252 
1253  // If we copy from the Undo as Server, enter it again
1254  if (m_pSection->IsServer()
1255  && pDoc->GetIDocumentUndoRedo().IsUndoNodes(rNds))
1256  {
1257  pNewSect->SetRefObject( m_pSection->GetObject() );
1259  }
1260 
1261  // METADATA: copy xml:id; must be done after insertion of node
1262  pSectFormat->RegisterAsCopyOf(*GetSection().GetFormat());
1263 
1264  return pSectNd;
1265 }
1266 
1268 {
1269  OSL_ENSURE( !m_pSection->IsHidden(),
1270  "That's simple: Hidden Section => Hidden Content" );
1271  SwNodeIndex aTmp( *this, 1 );
1272  sal_uLong nEnd = EndOfSectionIndex();
1273  while( aTmp < nEnd )
1274  {
1275  if( aTmp.GetNode().IsSectionNode() )
1276  {
1277  const SwSection& rSect = static_cast<SwSectionNode&>(aTmp.GetNode()).GetSection();
1278  if( rSect.IsHiddenFlag() )
1279  // Skip this Section
1280  aTmp = *aTmp.GetNode().EndOfSectionNode();
1281  }
1282  else
1283  {
1284  if( aTmp.GetNode().IsContentNode() || aTmp.GetNode().IsTableNode() )
1285  return false; // We found non-hidden content
1286  OSL_ENSURE( aTmp.GetNode().IsEndNode(), "EndNode expected" );
1287  }
1288  ++aTmp;
1289  }
1290  return true; // Hide everything
1291 }
1292 
1294 {
1295  SwSectionFormat *const pFormat = m_pSection->GetFormat();
1296  if( !pFormat )
1297  return;
1298 
1299  SwNodes& rNds = GetNodes();
1300  SwDoc* pDoc = pFormat->GetDoc();
1301 
1302  if( !rNds.IsDocNodes() )
1303  {
1304  SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, pFormat );
1305  pFormat->ModifyNotification( &aMsgHint, &aMsgHint );
1306  }
1307 
1308  pFormat->LockModify();
1309  pFormat->SetFormatAttr( SwFormatContent( this ));
1310  pFormat->UnlockModify();
1311 
1313  // set the correct parent from the new section
1314  pFormat->SetDerivedFrom( pSectNd ? pSectNd->GetSection().GetFormat()
1315  : pDoc->GetDfltFrameFormat() );
1316 
1317  // Set the right StartNode for all in this Area
1318  sal_uLong nStart = GetIndex()+1, nEnde = EndOfSectionIndex();
1319  for( sal_uLong n = nStart; n < nEnde; ++n )
1320  // Make up the Format's nesting
1321  if( nullptr != ( pSectNd = rNds[ n ]->GetSectionNode() ) )
1322  {
1323  pSectNd->GetSection().GetFormat()->SetDerivedFrom( pFormat );
1324  n = pSectNd->EndOfSectionIndex();
1325  }
1326 
1327  // Moving Nodes to the UndoNodes array?
1328  if( rNds.IsDocNodes() )
1329  {
1330  OSL_ENSURE( pDoc == GetDoc(),
1331  "Moving to different Documents?" );
1332  if( m_pSection->IsLinkType() ) // Remove the Link
1334 
1335  if (m_pSection->IsServer())
1337  }
1338  else
1339  {
1340  if (CONTENT_SECTION != m_pSection->GetType()
1341  && m_pSection->IsConnected())
1342  {
1343  pDoc->getIDocumentLinksAdministration().GetLinkManager().Remove( &m_pSection->GetBaseLink() );
1344  }
1345  if (m_pSection->IsServer())
1347  }
1348 
1349 }
1350 
1351 OUString SwDoc::GetUniqueSectionName( const OUString* pChkStr ) const
1352 {
1353  if( IsInMailMerge())
1354  {
1355  OUString newName = "MailMergeSection"
1356  + OStringToOUString( DateTimeToOString( DateTime( DateTime::SYSTEM )), RTL_TEXTENCODING_ASCII_US )
1357  + OUString::number( mpSectionFormatTable->size() + 1 );
1358  if( pChkStr )
1359  newName += *pChkStr;
1360  return newName;
1361  }
1362 
1363  const OUString aName(SwResId(STR_REGION_DEFNAME));
1364 
1365  SwSectionFormats::size_type nNum = 0;
1366  const SwSectionFormats::size_type nFlagSize = ( mpSectionFormatTable->size() / 8 ) + 2;
1367  std::unique_ptr<sal_uInt8[]> pSetFlags(new sal_uInt8[ nFlagSize ]);
1368  memset( pSetFlags.get(), 0, nFlagSize );
1369 
1370  for( auto pFormat : *mpSectionFormatTable )
1371  {
1372  const SwSectionNode *const pSectNd = pFormat->GetSectionNode();
1373  if( pSectNd != nullptr )
1374  {
1375  const OUString& rNm = pSectNd->GetSection().GetSectionName();
1376  if (rNm.startsWith( aName ))
1377  {
1378  // Calculate the Number and reset the Flag
1379  nNum = rNm.copy( aName.getLength() ).toInt32();
1380  if( nNum-- && nNum < mpSectionFormatTable->size() )
1381  pSetFlags[ nNum / 8 ] |= (0x01 << ( nNum & 0x07 ));
1382  }
1383  if( pChkStr && *pChkStr==rNm )
1384  pChkStr = nullptr;
1385  }
1386  }
1387 
1388  if( !pChkStr )
1389  {
1390  // Flagged all Numbers accordingly, so get the right Number
1391  nNum = mpSectionFormatTable->size();
1392  for( SwSectionFormats::size_type n = 0; n < nFlagSize; ++n )
1393  {
1394  auto nTmp = pSetFlags[ n ];
1395  if( nTmp != 0xFF )
1396  {
1397  // Calculate the Number
1398  nNum = n * 8;
1399  while( nTmp & 1 )
1400  {
1401  ++nNum;
1402  nTmp >>= 1;
1403  }
1404  break;
1405  }
1406  }
1407  }
1408  pSetFlags.reset();
1409  if( pChkStr )
1410  return *pChkStr;
1411  return aName + OUString::number( ++nNum );
1412 }
1413 
1414 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwSectionNode * FindSectionNode()
Search section node, in which it is.
Definition: ndsect.cxx:955
const SwEndNode * EndOfSectionNode() const
Definition: node.hxx:682
Starts a section of nodes in the document model.
Definition: node.hxx:303
SwSectionNode * InsertTextSection(SwNodeIndex const &rNdIdx, SwSectionFormat &rSectionFormat, SwSectionData const &, SwTOXBase const *const pTOXBase, SwNodeIndex const *const pEnde, bool const bInsAtStart=true, bool const bCreateFrames=true)
Insert a new SwSection.
Definition: ndsect.cxx:779
Base class of the Writer layout elements.
Definition: frame.hxx:295
virtual sal_Int32 Len() const
Definition: node.cxx:1180
#define RES_FTN_AT_TXTEND
Definition: hintids.hxx:224
Definition: calc.hxx:184
bool IsInMailMerge() const
Definition: doc.hxx:953
sal_uLong GetIndex() const
Definition: node.hxx:282
SwStartNode * m_pStartOfSection
Definition: node.hxx:112
sal_uLong Count() const
Definition: ndarr.hxx:143
Marks a position in the document model.
Definition: pam.hxx:35
#define RES_END_AT_TXTEND
Definition: hintids.hxx:225
void SetType(SectionType const eType)
Definition: section.hxx:172
void RegisterAsCopyOf(Metadatable const &i_rSource, const bool i_bCopyPrecedesSource=false)
bool IsSectionNode() const
Definition: node.hxx:644
#define RES_CONDTXTFMTCOLL
Definition: hintids.hxx:280
void Init()
sal_uLong StartOfSectionIndex() const
Definition: node.hxx:673
void SetHidden(bool const bFlag)
Definition: section.hxx:99
const OUString & GetText() const
Definition: ndtxt.hxx:210
static SwSectionFormat & lcl_initParent(SwSectionNode &rThis, SwSectionFormat &rFormat)
Definition: ndsect.cxx:969
virtual bool SetAttr(const SfxPoolItem &) override
overriding to handle change of certain paragraph attributes
Definition: ndtxt.cxx:4892
virtual AppendResult AppendRedline(SwRangeRedline *pNewRedl, bool bCallDelete)=0
Append a new redline.
void DelSectionFormat(SwSectionFormat *pFormat, bool bDelNodes=false)
Definition: ndsect.cxx:512
virtual void SetRedlineFlags_intern(RedlineFlags eMode)=0
Set a new redline mode.
SwNodeIndex nNode
Definition: pam.hxx:37
const OUString & GetCondition() const
Definition: section.hxx:114
static bool lcl_IsTOXSection(SwSectionData const &rSectionData)
Definition: ndsect.cxx:773
void SetSectionName(OUString const &rName)
Definition: section.hxx:170
virtual void SetModified()=0
Must be called manually at changes of format.
sal_uIntPtr sal_uLong
-""- and with own numberformat
Definition: fmtftntx.hxx:33
void CreateLink(LinkCreateType eType)
Definition: section.cxx:1481
bool IsEditInReadonlyFlag() const
Definition: section.hxx:190
const sal_Unicode cTokenSeparator
sal_Int32 toInt32(OUString const &rStr)
bool IsContentHidden() const
Check for not hidden areas whether there is content that is not in a hidden sub-area.
Definition: ndsect.cxx:1267
virtual SwContentFrame * MakeFrame(SwFrame *pSib)=0
MakeFrame will be called for a certain layout pSib is another SwFrame of the same layout (e...
virtual SwUndoId EndUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Closes undo block.
Definition: doc.hxx:185
static SwContentNode * GoPrevSection(SwNodeIndex *, bool bSkipHidden=true, bool bSkipProtect=true)
Definition: nodes.cxx:1973
void SetEditInReadonly(bool const bFlag=true)
Definition: section.cxx:393
OUString GetUniqueSectionName(const OUString *pChkStr=nullptr) const
Definition: ndsect.cxx:1351
IDocumentLinksAdministration const & getIDocumentLinksAdministration() const
Definition: doc.cxx:259
bool IsConnected() const
Definition: section.hxx:225
static SwContentNode * GetContentNode(SwDoc *pDoc, SwNodeIndex &rIdx, bool bNext)
Definition: fltshell.cxx:80
const SwServerObject * GetObject() const
Definition: section.hxx:216
SwNode & GetNode() const
Definition: ndindex.hxx:119
void NodesArrChgd()
Set pointer in format of section on itself.
Definition: ndsect.cxx:1293
bool InsertServer(SvLinkSource *rObj)
Content, content of frame (header, footer, fly).
Definition: fmtcntnt.hxx:31
SwSectionFormat * GetFormat()
Definition: section.hxx:336
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:143
void CheckSectionCondColl() const
Call ChkCondcoll to all ContentNodes of section.
Definition: node.cxx:927
OUString const & GetLinkFileName() const
Definition: section.cxx:541
#define RES_REMOVE_UNO_OBJECT
Definition: hintids.hxx:305
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:314
#define RES_CNTNT
Definition: hintids.hxx:202
The root element of a Writer document layout.
Definition: rootfrm.hxx:79
void Copy_(const SwNodeRange &rRg, const SwNodeIndex &rInsPos, bool bNewFrames=true) const
Definition: ndarr.hxx:177
static SwSection * GetCurrSection(const SwPosition &rPos)
Definition: ndsect.cxx:497
bool IsCondHidden() const
Definition: section.hxx:193
OUString const & GetCondition() const
Definition: section.hxx:199
void SaveSplitNode(SwTextNode *const pTextNd, bool const bAtStart)
Definition: unsect.cxx:290
const SwSection & GetSection() const
Definition: node.hxx:541
bool IsLinkType() const
Definition: section.hxx:130
void MakeFramesForAdjacentContentNode(SwContentNode &rNode)
Method creates all views of document for given node.
Definition: node.cxx:1298
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
Definition: doc.cxx:356
const SfxPoolItem * NextItem()
const ::sfx2::SvBaseLink & GetBaseLink() const
Definition: section.hxx:229
std::unique_ptr< SwUndo > MakeUndoDelSection(SwSectionFormat const &)
Definition: unsect.cxx:331
SwIndex nContent
Definition: pam.hxx:38
void MakeOwnFrames(SwNodeIndex *pIdxBehind, SwNodeIndex *pEnd=nullptr)
Creates the frms for the SectionNode (i.e.
Definition: ndsect.cxx:1135
static bool IsRedlineOn(const RedlineFlags eM)
void RemoveServer(SvLinkSource *rObj)
sal_uLong GetIndex() const
Definition: ndindex.hxx:152
SwFrame * MakeFrame(SwFrame *)
Definition: ndsect.cxx:1012
bool IsTextFrame() const
Definition: frame.hxx:1210
virtual bool IsUndoNodes(SwNodes const &rNodes) const =0
virtual void DoUndo(bool const bDoUndo)=0
Enable/Disable Undo.
bool IsStartNode() const
Definition: node.hxx:624
bool CheckNodesRange(const SwNodeIndex &rStt, const SwNodeIndex &rEnd, bool bChkSection)
Definition: pam.cxx:240
SwSection * InsertSwSection(SwPaM const &rRange, SwSectionData &, std::pair< SwTOXBase const *, sw::RedlineMode > const *pTOXBase, SfxItemSet const *const pAttr, bool const bUpdate=true)
Definition: ndsect.cxx:151
const SwTable & GetTable() const
Definition: node.hxx:497
virtual void DeleteSection(SwNode *pNode)=0
Delete section containing the node.
bool IsProtectFlag() const
Definition: section.hxx:189
const OUString & GetSectionName() const
Definition: section.hxx:93
SwSectionFormat * MakeSectionFormat()
Definition: ndsect.cxx:505
size_type size() const
virtual bool DoesUndo() const =0
Is Undo enabled?
bool SetDerivedFrom(SwFormat *pDerivedFrom=nullptr)
0 is Default.
Definition: format.cxx:326
void MakeFrames(SwDoc *pDoc, const SwNodeIndex &rSttIdx, const SwNodeIndex &rEndIdx)
Definition: frmtool.cxx:1830
virtual void ModifyNotification(const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue)
Definition: calbck.hxx:154
virtual void Paste(SwFrame *pParent, SwFrame *pSibling=nullptr)=0
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
Definition: ndarr.hxx:164
SwTableSortBoxes & GetTabSortBoxes()
Definition: swtable.hxx:259
bool IsContentNode() const
Definition: node.hxx:628
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
const SwAttrSet * GetpSwAttrSet() const
Definition: node.hxx:443
virtual void AppendUndo(std::unique_ptr< SwUndo > pUndo)=0
Add new Undo action.
SwTextFootnote * SeekEntry(const SwNodeIndex &rIdx, size_t *pPos=nullptr) const
Definition: ftnidx.cxx:409
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
virtual ~SwSectionNode() override
Definition: ndsect.cxx:996
void Disconnect()
Definition: section.hxx:227
virtual SwUndoId StartUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Opens undo block.
SwNodeType
Definition: ndtyp.hxx:28
void sw_DeleteFootnote(SwSectionNode *pNd, sal_uLong nStt, sal_uLong nEnd)
Definition: ndsect.cxx:744
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
bool IsHidden() const
Definition: section.hxx:98
const SwStartNode * StartOfSectionNode() const
Definition: node.hxx:131
const OUString & GetSectionName() const
Definition: section.hxx:169
const SwPosition * GetPoint() const
Definition: pam.hxx:207
std::vector< SwSectionFormat * >::size_type size_type
Definition: docary.hxx:70
void SetCondHidden(bool const bFlag)
Definition: section.cxx:531
void Remove(SvBaseLink const *pLink)
bool IsProtect() const
Definition: section.cxx:347
SwIndex & Assign(SwIndexReg *, sal_Int32)
Definition: index.cxx:198
void SetProtect(bool const bFlag=true)
Definition: section.cxx:375
bool IsHidden() const
Definition: section.hxx:179
void SetSectNdPos(sal_uLong const nPos)
Definition: UndoSection.hxx:64
const SwFrame * Lower() const
Definition: layfrm.hxx:101
SwContentFrame * FindNextCnt(const bool _bInSameFootnote=false)
Definition: findfrm.cxx:190
bool IsHiddenFlag() const
Definition: section.hxx:188
SwContentNode * GetContentNode()
Definition: node.hxx:615
sal_uInt16 Count() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
Definition: pam.hxx:205
SwDoc * GetDoc()
Definition: node.hxx:702
void UnlockModify()
Definition: calbck.hxx:214
IDocumentState const & getIDocumentState() const
Definition: doc.cxx:393
void LockModify()
Definition: calbck.hxx:213
void SetHidden(bool const bFlag=true)
Definition: section.cxx:366
std::vector< SwSectionFormat * >::iterator iterator
Definition: docary.hxx:68
size
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
Definition: format.cxx:396
Marks a node in the document model.
Definition: ndindex.hxx:31
bool IsEndNode() const
Definition: node.hxx:632
SwNodes & GetNodes()
Node is in which nodes-array/doc?
Definition: node.hxx:693
#define SwTextFootnote_GetIndex(pFIdx)
Definition: ftnidx.hxx:34
OUString newName(const OUString &aNewPrefix, const OUString &aOldPrefix, const OUString &old_Name)
bool HasSwAttrSet() const
Definition: node.hxx:444
OUString SwResId(const char *pId)
Definition: swmodule.cxx:190
bool empty() const
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:119
bool IsEditInReadonly() const
Definition: section.cxx:357
std::unique_ptr< SwSection > const m_pSection
Definition: node.hxx:532
bool IsInReading() const
Definition: doc.hxx:950
bool IsLinkType() const
Definition: section.hxx:236
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:404
void SetLinkFileName(OUString const &rNew)
Definition: section.cxx:579
const SwPosition * Start() const
Definition: pam.hxx:212
const SwNodeIndex * GetContentIdx() const
Definition: fmtcntnt.hxx:46
SwDoc * GetDoc()
Which Doc contains the nodes-array?
Definition: ndarr.hxx:305
const SwFrameFormat * GetDfltFrameFormat() const
Definition: doc.hxx:740
static bool lcl_IsInSameTableBox(SwNodes const &_rNds, const SwNode &_rNd, const bool _bPrev)
Definition: ndsect.cxx:63
SwSectionNode * MakeCopy(SwDoc *, const SwNodeIndex &) const
Definition: ndsect.cxx:1191
virtual void FieldsToCalc(SwCalc &rCalc, sal_uLong nLastNd, sal_uInt16 nLastCnt)=0
void InvalidateAccessibleParaFlowRelation(const SwTextFrame *_pFromTextFrame, const SwTextFrame *_pToTextFrame)
invalidate CONTENT_FLOWS_FROM/_TO relation for paragraphs
Definition: viewsh.cxx:2430
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:458
void SetRefObject(SwServerObject *pObj)
Definition: section.cxx:526
std::unique_ptr< SwSectionFormats > mpSectionFormatTable
Definition: doc.hxx:240
void RestoreUpperFrames(SwNodes &rNds, sal_uLong nStt, sal_uLong nEnd)
Definition: node2lay.cxx:438
ignore Redlines
sal_uInt16 Which() const
for Querying of Writer-functions.
Definition: format.hxx:78
void UpdateFootnote(const SwNodeIndex &rStt)
Definition: ftnidx.cxx:60
SwSbxValue Calculate(const OUString &rStr)
Definition: calc.cxx:347
bool IsLayoutFrame() const
Definition: frame.hxx:1146
sal_uLong EndOfSectionIndex() const
Definition: node.hxx:677
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
virtual bool SplitRedline(const SwPaM &rPam)=0
const OUString & GetLinkFileName() const
Definition: section.hxx:117
virtual bool ResetFormatAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0)
Definition: format.cxx:650
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:334
void SetUpdateFootnoteFlag(bool const bFlag)
Definition: UndoSection.hxx:66
void UpdateSection(size_t const nSect, SwSectionData &, SfxItemSet const *const =nullptr, bool const bPreventLinkUpdate=false)
Definition: ndsect.cxx:604
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void CopyAttrs(const SwFormat &)
Copy attributes even among documents.
Definition: format.cxx:178
void ChkCondColl()
Definition: node.cxx:1946
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
unsigned char sal_uInt8
const SwNodes & GetNodes() const
Definition: ndindex.hxx:156
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:261
bool IsCopyIsMove() const
Definition: doc.hxx:1362
#define SAL_INFO(area, stream)
sal_Int32 GetIndex() const
Definition: index.hxx:95
OString DateTimeToOString(const DateTime &rDateTime)
bool DataEquals(SwSectionData const &rCmp) const
Definition: section.cxx:281
friend class SwEndNode
to set the theEndOfSection !!
Definition: node.hxx:307
SwNodes & GetNodes()
Definition: doc.hxx:402
static sal_uInt16 IsInsRegionAvailable(const SwPaM &rRange, const SwNode **ppSttNd=nullptr)
Definition: ndsect.cxx:384
const SwPosition * End() const
Definition: pam.hxx:217
void DelFrames(SwRootFrame const *pLayout=nullptr)
Method deletes all views of document for the node.
Definition: ndsect.cxx:1155
SwSectionNode(const SwSectionNode &)=delete
const SfxPoolItem & GetFormatAttr(sal_uInt16 nWhich, bool bInParents=true) const
If bInParents is FALSE, search only in this format for attribute.
Definition: format.cxx:377
SectionType GetType() const
Definition: section.hxx:95
void DelFrames(const SwRootFrame *)
Definition: atrftn.cxx:464
const SwFormatContent & GetContent(bool=true) const
Definition: fmtcntnt.hxx:55
SwTableNode * FindTableNode()
Search table node, in which it is.
Definition: node.cxx:349
-""- and with own number sequence
Definition: fmtftntx.hxx:32
virtual sfx2::LinkManager & GetLinkManager()=0
virtual bool SplitNode(const SwPosition &rPos, bool bChkTableStart)=0
Split a node at rPos (implemented only for TextNode).
OString const aName
static SwNodePtr GetEndNode(SwOutlineNodes const *pOutlNds, int nOutlineLevel, SwOutlineNodes::size_type *nOutl)
Definition: docglbl.cxx:100
std::unique_ptr< SwUndo > MakeUndoUpdateSection(SwSectionFormat const &, bool const)
Definition: unsect.cxx:435
SwFootnoteIdxs & GetFootnoteIdxs()
Definition: doc.hxx:627
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
SwContentNode * GoNextSection(SwNodeIndex *, bool bSkipHidden=true, bool bSkipProtect=true) const
Go to next content-node that is not protected or hidden (Both set FALSE ==> GoNext/GoPrevious!!!).
Definition: nodes.cxx:1921
bool IsDocNodes() const
Is the NodesArray the regular one of Doc? (and not the UndoNds, ...) Implementation in doc...
Definition: nodes.cxx:2334
bool IsTableNode() const
Definition: node.hxx:640
std::unique_ptr< SwFrameFormat > mpDfltFrameFormat
Definition: doc.hxx:230
SwFormatColl * GetFormatColl() const
Definition: node.hxx:447
SwContentFrame * FindPrevCnt()
Definition: findfrm.cxx:174
void SetSectionData(SwSectionData const &rData)
Definition: section.cxx:267
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame...
Definition: layfrm.hxx:35
SwSectionNode * GetSectionNode()
Definition: node.hxx:607
Ends a section of nodes in the document model.
Definition: node.hxx:333
SwSection * GetSection() const
Definition: section.cxx:668
void MakeFramesForAdjacentContentNode(const SwNodeIndex &rIdx)
Method creates all views of document for the previous node.
Definition: ndsect.cxx:1020
virtual bool ResetAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0) override
Definition: ndtxt.cxx:5122
static void lcl_CheckEmptyLayFrame(SwNodes const &rNds, SwSectionData &rSectionData, const SwNode &rStt, const SwNode &rEnd)
Definition: ndsect.cxx:130
#define RES_PAGEDESC
Definition: hintids.hxx:200
#define RES_BREAK
Definition: hintids.hxx:201
SwViewShell * GetCurrShell() const
Definition: rootfrm.hxx:204
sal_Int32 nPos
bool IsTextNode() const
Definition: node.hxx:636
SwNode * FindPrvNxtFrameNode(SwNodeIndex &rFrameIdx, const SwNode *pEnd) const
Search previous / next content node or table node with frames.
Definition: nodes.cxx:2040
sal_uInt16 Which() const
SwRootFrame * getRootFrame()
Definition: frame.hxx:657
const SfxPoolItem * GetCurItem() const
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:842
void SetCondition(OUString const &rNew)
Definition: section.hxx:200
friend class SwNodeIndex
Definition: ndarr.hxx:93
bool IsCreateFrameWhenHidingRedlines() const
Definition: node.hxx:93
SwNodeIndex & Assign(SwNodes const &rNds, sal_uLong)
Definition: ndindex.hxx:272
Base class of the Writer document model elements.
Definition: node.hxx:79
SwTextFormatColl * GetTextColl() const
Definition: ndtxt.hxx:836