LibreOffice Module sw (master)  1
docnew.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 <config_features.h>
21 
22 #include <o3tl/sorted_vector.hxx>
23 
24 #include <doc.hxx>
25 #include <proofreadingiterator.hxx>
26 #include <com/sun/star/text/XFlatParagraphIteratorProvider.hpp>
27 #include <com/sun/star/linguistic2/XProofreadingIterator.hpp>
28 #include <com/sun/star/frame/XModel.hpp>
29 
31 #include <comphelper/random.hxx>
32 #include <sfx2/viewfrm.hxx>
33 #include <sfx2/XmlIdRegistry.hxx>
34 #include <sal/log.hxx>
35 
36 #include <sfx2/linkmgr.hxx>
37 #include <editeng/ulspitem.hxx>
38 #include <editeng/lrspitem.hxx>
39 #include <svl/zforlist.hxx>
40 #include <unotools/lingucfg.hxx>
41 #include <svx/svdpage.hxx>
42 #include <fmtcntnt.hxx>
43 #include <fmtanchr.hxx>
44 #include <fmtfsize.hxx>
45 #include <fmtfordr.hxx>
46 #include <fmtpdsc.hxx>
47 #include <pvprtdat.hxx>
48 #include <rootfrm.hxx>
49 #include <pagedesc.hxx>
50 #include <ndtxt.hxx>
51 #include <ftninfo.hxx>
52 #include <ftnidx.hxx>
53 #include <charfmt.hxx>
54 #include <frmfmt.hxx>
55 #include <poolfmt.hxx>
56 #include <dbmgr.hxx>
57 #include <docsh.hxx>
58 #include <acorrect.hxx>
59 #include <visiturl.hxx>
60 #include <docary.hxx>
61 #include <lineinfo.hxx>
62 #include <drawdoc.hxx>
63 #include <extinput.hxx>
64 #include <viewsh.hxx>
65 #include <doctxm.hxx>
66 #include <shellres.hxx>
67 #include <laycache.hxx>
68 #include <mvsave.hxx>
69 #include <istyleaccess.hxx>
70 #include "swstylemanager.hxx"
71 #include <IGrammarContact.hxx>
72 #include <tblafmt.hxx>
73 #include <MarkManager.hxx>
74 #include <UndoManager.hxx>
79 #include <DocumentTimerManager.hxx>
82 #include <DocumentListsManager.hxx>
88 #include <DocumentStateManager.hxx>
92 #include <wrtsh.hxx>
93 #include <unocrsr.hxx>
94 #include <fmthdft.hxx>
95 #include <frameformats.hxx>
96 
97 #include <numrule.hxx>
98 
99 #include <sfx2/Metadatable.hxx>
100 #include <fmtmeta.hxx>
101 
102 #include <svx/xfillit0.hxx>
103 
104 using namespace ::com::sun::star;
105 using namespace ::com::sun::star::document;
106 
107 /*
108  * global functions...
109  */
110  uno::Reference< linguistic2::XProofreadingIterator > const & SwDoc::GetGCIterator() const
111 {
113  {
114  uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
115  try
116  {
118  }
119  catch (const uno::Exception &)
120  {
121  OSL_FAIL( "No GCIterator" );
122  }
123  }
124 
125  return m_xGCIterator;
126 }
127 
128 bool SwDoc::StartGrammarChecking( bool bSkipStart )
129 {
130  // check for a visible view
131  bool bVisible = false;
132  bool bStarted = false;
133  const SwDocShell *pDocShell = GetDocShell();
134  SfxViewFrame *pFrame = SfxViewFrame::GetFirst( pDocShell, false );
135  while (pFrame && !bVisible)
136  {
137  if (pFrame->IsVisible())
138  bVisible = true;
139  pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell, false );
140  }
141 
146  if (bVisible)
147  {
148  uno::Reference< linguistic2::XProofreadingIterator > xGCIterator( GetGCIterator() );
149  if ( xGCIterator.is() )
150  {
151  uno::Reference< lang::XComponent > xDoc = GetDocShell()->GetBaseModel();
152  uno::Reference< text::XFlatParagraphIteratorProvider > xFPIP( xDoc, uno::UNO_QUERY );
153 
154  // start automatic background checking if not active already
155  if ( xFPIP.is() && !xGCIterator->isProofreading( xDoc ) )
156  {
157  bStarted = true;
158  if ( !bSkipStart )
159  {
160  for (auto pLayout : GetAllLayouts())
161  { // we're starting it now, don't start grammar checker
162  // again until the user modifies the document
163  pLayout->SetNeedGrammarCheck(false);
164  }
165  xGCIterator->startProofreading( xDoc, xFPIP );
166  }
167  }
168  }
169  }
170 
171  return bStarted;
172 }
173 
174 /*
175  * internal functions
176  */
177 static void lcl_DelFormatIndices( SwFormat const * pFormat )
178 {
179  SwFormatContent &rFormatContent = const_cast<SwFormatContent&>(pFormat->GetContent());
180  if ( rFormatContent.GetContentIdx() )
181  rFormatContent.SetNewContentIdx( nullptr );
182  SwFormatAnchor &rFormatAnchor = const_cast<SwFormatAnchor&>(pFormat->GetAnchor());
183  if ( rFormatAnchor.GetContentAnchor() )
184  rFormatAnchor.SetAnchor( nullptr );
185 }
186 
187 /*
188  * exported methods
189  */
191  : m_pNodes( new SwNodes(this) ),
192  mpAttrPool(new SwAttrPool(this)),
193  mpMarkManager(new ::sw::mark::MarkManager(*this)),
194  m_pMetaFieldManager(new ::sw::MetaFieldManager()),
195  m_pDocumentDrawModelManager( new ::sw::DocumentDrawModelManager( *this ) ),
196  m_pDocumentRedlineManager( new ::sw::DocumentRedlineManager( *this ) ),
197  m_pDocumentStateManager( new ::sw::DocumentStateManager( *this ) ),
198  m_pUndoManager(new ::sw::UndoManager(
199  std::shared_ptr<SwNodes>(new SwNodes(this)), *m_pDocumentDrawModelManager, *m_pDocumentRedlineManager, *m_pDocumentStateManager)),
200  m_pDocumentSettingManager(new ::sw::DocumentSettingManager(*this)),
201  m_pDocumentChartDataProviderManager( new sw::DocumentChartDataProviderManager( *this ) ),
202  m_pDeviceAccess( new ::sw::DocumentDeviceManager( *this ) ),
203  m_pDocumentTimerManager( new ::sw::DocumentTimerManager( *this ) ),
204  m_pDocumentLinksAdministrationManager( new ::sw::DocumentLinksAdministrationManager( *this ) ),
205  m_pDocumentListItemsManager( new ::sw::DocumentListItemsManager() ),
206  m_pDocumentListsManager( new ::sw::DocumentListsManager( *this ) ),
207  m_pDocumentOutlineNodesManager( new ::sw::DocumentOutlineNodesManager( *this ) ),
208  m_pDocumentContentOperationsManager( new ::sw::DocumentContentOperationsManager( *this ) ),
209  m_pDocumentFieldsManager( new ::sw::DocumentFieldsManager( *this ) ),
210  m_pDocumentStatisticsManager( new ::sw::DocumentStatisticsManager( *this ) ),
211  m_pDocumentLayoutManager( new ::sw::DocumentLayoutManager( *this ) ),
212  m_pDocumentStylePoolManager( new ::sw::DocumentStylePoolManager( *this ) ),
213  m_pDocumentExternalDataManager( new ::sw::DocumentExternalDataManager ),
214  mpDfltFrameFormat( new SwFrameFormat( GetAttrPool(), "Frameformat", nullptr ) ),
215  mpEmptyPageFormat( new SwFrameFormat( GetAttrPool(), "Empty Page", mpDfltFrameFormat.get() ) ),
216  mpColumnContFormat( new SwFrameFormat( GetAttrPool(), "Columncontainer", mpDfltFrameFormat.get() ) ),
217  mpDfltCharFormat( new SwCharFormat( GetAttrPool(), "Character style", nullptr ) ),
218  mpDfltTextFormatColl( new SwTextFormatColl( GetAttrPool(), "Paragraph style" ) ),
219  mpDfltGrfFormatColl( new SwGrfFormatColl( GetAttrPool(), "Graphikformatvorlage" ) ),
220  mpFrameFormatTable( new SwFrameFormats() ),
221  mpCharFormatTable( new SwCharFormats ),
222  mpSpzFrameFormatTable( new SwFrameFormats() ),
223  mpSectionFormatTable( new SwSectionFormats ),
224  mpTableFrameFormatTable( new SwFrameFormats() ),
225  mpTextFormatCollTable( new SwTextFormatColls() ),
226  mpGrfFormatCollTable( new SwGrfFormatColls() ),
227  mpTOXTypes( new SwTOXTypes ),
228  mpDefTOXBases( new SwDefTOXBase_Impl() ),
229  mpOutlineRule( nullptr ),
230  mpFootnoteInfo( new SwFootnoteInfo ),
231  mpEndNoteInfo( new SwEndNoteInfo ),
232  mpLineNumberInfo( new SwLineNumberInfo ),
233  mpFootnoteIdxs( new SwFootnoteIdxs ),
234  mpDocShell( nullptr ),
235  mpNumberFormatter( nullptr ),
236  mpNumRuleTable( new SwNumRuleTable ),
237  mpExtInputRing( nullptr ),
238  mpGrammarContact(createGrammarContact()),
239  mpCellStyles(new SwCellStyleTable),
240  m_pXmlIdRegistry(),
241  mReferenceCount(0),
242  mbDtor(false),
243  mbCopyIsMove(false),
244  mbInReading(false),
245  mbInWriting(false),
246  mbInMailMerge(false),
247  mbInXMLImport(false),
248  mbInWriterfilterImport(false),
249  mbUpdateTOX(false),
250  mbInLoadAsynchron(false),
251  mbIsAutoFormatRedline(false),
252  mbOLEPrtNotifyPending(false),
253  mbAllOLENotify(false),
254  mbInsOnlyTextGlssry(false),
255  mbContains_MSVBasic(false),
256  mbClipBoard( false ),
257  mbColumnSelection( false ),
258  mbIsPrepareSelAll(false),
259  meDictionaryMissing( MissingDictionary::Undefined ),
260  mbContainsAtPageObjWithContentAnchor(false), //#i119292#, fdo#37024
261 
262  meDocType(DOCTYPE_NATIVE)
263 {
264  // The DrawingLayer ItemPool which is used as 2nd pool for Writer documents' pool
265  // has a default for the XFillStyleItem of XFILL_SOLID and the color for it is the default
266  // fill color (blue7 or similar). This is a problem, in Writer we want the default fill
267  // style to be drawing::FillStyle_NONE. This cannot simply be done by changing it in the 2nd pool at the
268  // pool defaults when the DrawingLayer ItemPool is used for Writer, that would lead to
269  // countless problems like DrawObjects initial fill and others.
270  // It is also hard to find all places where the initial ItemSets for Writer (including
271  // style hierarchies) are created and to always set (but only at the root) the FillStyle
272  // to NONE fixed; that will add that attribute to the file format. It will be hard to reset
273  // attribute sets (which is done at import and using UI). Also not a good solution.
274  // Luckily Writer uses pDfltTextFormatColl as default parent for all paragraphs and similar, thus
275  // it is possible to set this attribute here. It will be not reset when importing.
276  mpDfltTextFormatColl->SetFormatAttr(XFillStyleItem(drawing::FillStyle_NONE));
277  mpDfltFrameFormat->SetFormatAttr(XFillStyleItem(drawing::FillStyle_NONE));
278  // prevent paragraph default margins being applied to everything
281 
282  /*
283  * DefaultFormats and DefaultFormatCollections (FormatColl)
284  * are inserted at position 0 at the respective array.
285  * The formats in the FormatColls are derived from the
286  * DefaultFormats and are also in the list.
287  */
288  /* Formats */
289  mpFrameFormatTable->push_back(mpDfltFrameFormat.get());
290  mpCharFormatTable->push_back(mpDfltCharFormat.get());
291 
292  /* FormatColls */
293  // TXT
295  // GRF
296  mpGrfFormatCollTable->push_back(mpDfltGrfFormatColl.get());
297 
298  // Create PageDesc, EmptyPageFormat and ColumnFormat
299  if (m_PageDescs.empty())
301 
302  // Set to "Empty Page"
304  // Set BodyFormat for columns
306 
308 
309  // Create a default OutlineNumRule (for Filters)
311  // #i89178#
313  OUTLINE_RULE );
315  // Counting of phantoms depends on <IsOldNumbering()>
317 
318  new SwTextNode(
319  SwNodeIndex(GetUndoManager().GetUndoNodes().GetEndOfContent()),
320  mpDfltTextFormatColl.get() );
321  new SwTextNode( SwNodeIndex( GetNodes().GetEndOfContent() ),
322  getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_STANDARD ));
323 
324  maOLEModifiedIdle.SetPriority( TaskPriority::LOWEST );
325  maOLEModifiedIdle.SetInvokeHandler( LINK( this, SwDoc, DoUpdateModifiedOLE ));
326  maOLEModifiedIdle.SetDebugName( "sw::SwDoc maOLEModifiedIdle" );
327 
328 #if HAVE_FEATURE_DBCONNECTIVITY
329  // Create DBManager
330  m_pOwnDBManager.reset(new SwDBManager(this));
332 #else
333  m_pDBManager = nullptr;
334 #endif
335 
336  // create TOXTypes
337  InitTOXTypes();
338 
339  // pass empty item set containing the paragraph's list attributes
340  // as ignorable items to the stype manager.
341  {
343  mpStyleAccess = createStyleManager( &aIgnorableParagraphItems );
344  }
345 
346  static bool bHack = (getenv("LIBO_ONEWAY_STABLE_ODF_EXPORT") != nullptr);
347 
348  if (bHack)
349  {
350  mnRsid = 0;
351  }
352  else
353  {
354  // Initialize the session id of the current document to a random number
355  // smaller than 2^21.
357  }
358  mnRsidRoot = mnRsid;
359 
361 }
362 
369 {
370  // nothing here should create Undo actions!
371  GetIDocumentUndoRedo().DoUndo(false);
372 
373  if (mpDocShell)
374  {
375  mpDocShell->SetUndoManager(nullptr);
376  }
377 
378  mpGrammarContact.reset();
379 
380  getIDocumentTimerAccess().StopIdling(); // stop idle timer
381 
382  mpURLStateChgd.reset();
383 
384  // Deactivate Undo notification from Draw
385  if( GetDocumentDrawModelManager().GetDrawModel() )
386  {
388  ClrContourCache();
389  }
390 
391  m_pPgPViewPrtData.reset();
392 
393  mbDtor = true;
394 
395  //Clear the redline table before the nodes array is destroyed
398 
399  const sw::UnoCursorHint aHint;
401  for(const auto& pWeakCursor : mvUnoCursorTable)
402  {
403  auto pCursor(pWeakCursor.lock());
404  if(pCursor)
405  pCursor->m_aNotifier.Broadcast(aHint);
406  }
407  mpACEWord.reset();
408 
409  // Release the BaseLinks
410  {
411  ::sfx2::SvLinkSources aTemp(getIDocumentLinksAdministration().GetLinkManager().GetServers());
412  for( const auto& rpLinkSrc : aTemp )
413  rpLinkSrc->Closed();
414 
415  if( !getIDocumentLinksAdministration().GetLinkManager().GetLinks().empty() )
417  }
418 
419  // The ChapterNumbers/Numbers need to be deleted before the styles
420  // or we update all the time!
421  m_pNodes->m_pOutlineNodes->clear();
422  SwNodes & rUndoNodes( GetUndoManager().GetUndoNodes() );
423  rUndoNodes.m_pOutlineNodes->clear();
424 
425  mpFootnoteIdxs->clear();
426 
427  // indices could be registered in attributes
428  m_pUndoManager->DelAllUndoObj();
429 
430  // The BookMarks contain indices to the Content. These must be deleted
431  // before deleting the Nodes.
432  mpMarkManager->clearAllMarks();
433 
434  if( mpExtInputRing )
435  {
436  SwPaM* pTmp = mpExtInputRing;
437  mpExtInputRing = nullptr;
438  while( pTmp->GetNext() != pTmp )
439  delete pTmp->GetNext();
440  delete pTmp;
441  }
442 
443  // Old - deletion without a Flag is expensive, because we send a Modify
444  // aTOXTypes.DeleteAndDestroy( 0, aTOXTypes.Count() );
445  {
446  for( auto n = mpTOXTypes->size(); n; )
447  {
448  (*mpTOXTypes)[ --n ]->SetInDocDTOR();
449  (*mpTOXTypes)[ n ].reset();
450  }
451  mpTOXTypes->clear();
452  }
453  mpDefTOXBases.reset();
454 
455  // Any of the FrameFormats can still have indices registered.
456  // These need to be destroyed now at the latest.
457  for( SwFrameFormat* pFormat : *mpFrameFormatTable )
458  lcl_DelFormatIndices( pFormat );
459  for( SwFrameFormat* pFormat : *mpSpzFrameFormatTable )
460  lcl_DelFormatIndices( pFormat );
461  for( SwSectionFormat* pFormat : *mpSectionFormatTable )
462  lcl_DelFormatIndices( pFormat );
463 
464  // The formats/styles that follow depend on the default formats.
465  // Destroy these only after destroying the FormatIndices, because the content
466  // of headers/footers has to be deleted as well. If in the headers/footers
467  // there are still Flys registered at that point, we have a problem.
468  for( SwPageDesc *pPageDesc : m_PageDescs )
469  delete pPageDesc;
470  m_PageDescs.clear();
471 
472  // Delete content selections.
473  // Don't wait for the SwNodes dtor to destroy them; so that Formats
474  // do not have any dependencies anymore.
475  m_pNodes->DelNodes( SwNodeIndex(*m_pNodes), m_pNodes->Count() );
476  rUndoNodes.DelNodes( SwNodeIndex( rUndoNodes ), rUndoNodes.Count() );
477 
478  // Delete Formats, make it permanent some time in the future
479 
480  // Delete for Collections
481  // So that we get rid of the dependencies
482  mpFootnoteInfo->EndListeningAll();
483  mpEndNoteInfo->EndListeningAll();
484 
485  assert(mpDfltTextFormatColl.get() == (*mpTextFormatCollTable)[0]
486  && "Default-Text-Collection must always be at the start");
487 
488  // Optimization: Based on the fact that Standard is always 2nd in the
489  // array, we should delete it as the last. With this we avoid
490  // reparenting the Formats all the time!
491  if( 2 < mpTextFormatCollTable->size() )
492  mpTextFormatCollTable->DeleteAndDestroy(2, mpTextFormatCollTable->size());
493  mpTextFormatCollTable->DeleteAndDestroy(1, mpTextFormatCollTable->size());
494  mpTextFormatCollTable.reset();
495 
496  assert(mpDfltGrfFormatColl.get() == (*mpGrfFormatCollTable)[0]
497  && "DefaultGrfCollection must always be at the start");
498 
499  mpGrfFormatCollTable->DeleteAndDestroy(1, mpGrfFormatCollTable->size());
500  mpGrfFormatCollTable.reset();
501 
502  // Without explicitly freeing the DocumentDeviceManager
503  // and relying on the implicit freeing there would be a crash
504  // due to it happening after SwAttrPool is freed.
505  m_pDeviceAccess.reset();
506 
507  /*
508  * DefaultFormats and DefaultFormatCollections (FormatColl)
509  * are at position 0 of their respective arrays.
510  * In order to not be deleted by the array's dtor, we remove them
511  * now.
512  */
513  mpFrameFormatTable->erase( mpFrameFormatTable->begin() );
514  mpCharFormatTable->erase( mpCharFormatTable->begin() );
515 
516 #if HAVE_FEATURE_DBCONNECTIVITY
517  // On load, SwDBManager::setEmbeddedName() may register a data source.
518  // If we have an embedded one, then sDataSource points to the registered name, so revoke it here.
519  if (!m_pOwnDBManager->getEmbeddedName().isEmpty() && !maDBData.sDataSource.isEmpty())
520  {
521  // Remove the revoke listener here first, so that we don't remove the data source from the document.
522  m_pOwnDBManager->releaseRevokeListener();
525  }
526  else if (!m_pOwnDBManager->getEmbeddedName().isEmpty())
527  {
528  // Remove the revoke listener here first, so that we don't remove the data source from the document.
529  m_pOwnDBManager->releaseRevokeListener();
530  // Remove connections which was committed but not used.
531  m_pOwnDBManager->RevokeNotUsedConnections();
532  }
533 
534  m_pOwnDBManager.reset();
535 #endif
536 
537  // All Flys need to be destroyed before the Drawing Model,
538  // because Flys can still contain DrawContacts, when no
539  // Layout could be constructed due to a read error.
540  mpSpzFrameFormatTable->DeleteAndDestroyAll();
541 
542  // Only now destroy the Model, the drawing objects - which are also
543  // contained in the Undo - need to remove their attributes from the
544  // Model. Also, DrawContacts could exist before this.
546  // Destroy DrawModel before the LinkManager, because it's always set
547  // in the DrawModel.
548  //The LinkManager gets destroyed automatically with m_pLinksAdministrationManager
549 
550  // Clear the Tables before deleting the defaults, or we crash due to
551  // dependencies on defaults.
552  mpFrameFormatTable.reset();
553  mpSpzFrameFormatTable.reset();
554 
555  mpStyleAccess.reset();
556 
557  mpCharFormatTable.reset();
558  mpSectionFormatTable.reset();
559  mpTableFrameFormatTable.reset();
560  mpDfltTextFormatColl.reset();
561  mpDfltGrfFormatColl.reset();
562  mpNumRuleTable.reset();
563 
564  disposeXForms(); // #i113606#, dispose the XForms objects
565 
566  delete mpNumberFormatter.load(); mpNumberFormatter= nullptr;
567  mpFootnoteInfo.reset();
568  mpEndNoteInfo.reset();
569  mpLineNumberInfo.reset();
570  mpFootnoteIdxs.reset();
571  mpTOXTypes.reset();
572  mpEmptyPageFormat.reset();
573  mpColumnContFormat.reset();
574  mpDfltCharFormat.reset();
575  mpDfltFrameFormat.reset();
576  mpLayoutCache.reset();
577 
579 }
580 
582 {
583  if( mpDocShell != pDSh )
584  {
585  if (mpDocShell)
586  {
587  mpDocShell->SetUndoManager(nullptr);
588  }
589  mpDocShell = pDSh;
590  if (mpDocShell)
591  {
594  }
595 
597 
598  // set DocShell pointer also on DrawModel
600  assert(!GetDocumentDrawModelManager().GetDrawModel() ||
601  GetDocumentDrawModelManager().GetDrawModel()->GetPersist() == GetPersist());
602  }
603 }
604 
605 // Convenience method; to avoid excessive includes from docsh.hxx
606 uno::Reference < embed::XStorage > SwDoc::GetDocStorage()
607 {
608  if( mpDocShell )
609  return mpDocShell->GetStorage();
610  if( getIDocumentLinksAdministration().GetLinkManager().GetPersist() )
612  return nullptr;
613 }
614 
616 {
618 }
619 
621 {
623  ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
624 
625  // Deactivate Undo notification from Draw
626  if( GetDocumentDrawModelManager().GetDrawModel() )
627  {
629  ClrContourCache();
630  }
631 
632  // if there are still FlyFrames dangling around, delete them too
633  while ( !mpSpzFrameFormatTable->empty() )
635  assert(!GetDocumentDrawModelManager().GetDrawModel()
636  || !GetDocumentDrawModelManager().GetDrawModel()->GetPage(0)->GetObjCount());
637 
640 
641  mpACEWord.reset();
642 
643  // The BookMarks contain indices to the Content. These must be deleted
644  // before deleting the Nodes.
645  mpMarkManager->clearAllMarks();
646  InitTOXTypes();
647 
648  // create a dummy pagedesc for the layout
649  SwPageDesc* pDummyPgDsc = MakePageDesc("?DUMMY?");
650 
651  SwNodeIndex aSttIdx( *GetNodes().GetEndOfContent().StartOfSectionNode(), 1 );
652  // create the first one over and over again (without attributes/style etc.
653  SwTextNode* pFirstNd = GetNodes().MakeTextNode( aSttIdx, mpDfltTextFormatColl.get() );
654 
656  {
657  // set the layout to the dummy pagedesc
658  pFirstNd->SetAttr( SwFormatPageDesc( pDummyPgDsc ));
659 
660  SwPosition aPos( *pFirstNd, SwIndex( pFirstNd ));
661  SwPaM const tmpPaM(aSttIdx, SwNodeIndex(GetNodes().GetEndOfContent()));
662  ::PaMCorrAbs(tmpPaM, aPos);
663  }
664 
665  GetNodes().Delete( aSttIdx,
666  GetNodes().GetEndOfContent().GetIndex() - aSttIdx.GetIndex() );
667 
668  // #i62440#
669  // destruction of numbering rules and creation of new outline rule
670  // *after* the document nodes are deleted.
671  mpOutlineRule = nullptr;
672  for( SwNumRule* pNumRule : *mpNumRuleTable )
673  {
674  getIDocumentListsAccess().deleteListForListStyle(pNumRule->GetName());
675  delete pNumRule;
676  }
677  mpNumRuleTable->clear();
678  maNumRuleMap.clear();
679 
680  // creation of new outline numbering rule
682  // #i89178#
684  OUTLINE_RULE );
686  // Counting of phantoms depends on <IsOldNumbering()>
688 
689  // remove the dummy pagedesc from the array and delete all the old ones
690  size_t nDummyPgDsc = 0;
691  if (FindPageDesc(pDummyPgDsc->GetName(), &nDummyPgDsc))
692  m_PageDescs.erase( nDummyPgDsc );
693  for( SwPageDesc *pPageDesc : m_PageDescs )
694  delete pPageDesc;
695  m_PageDescs.clear();
696 
697  // Delete for Collections
698  // So that we get rid of the dependencies
699  mpFootnoteInfo->EndListeningAll();
700  mpEndNoteInfo->EndListeningAll();
701 
702  // Optimization: Based on the fact that Standard is always 2nd in the
703  // array, we should delete it as the last. With this we avoid
704  // reparenting the Formats all the time!
705  if( 2 < mpTextFormatCollTable->size() )
706  mpTextFormatCollTable->DeleteAndDestroy(2, mpTextFormatCollTable->size());
707  mpTextFormatCollTable->DeleteAndDestroy(1, mpTextFormatCollTable->size());
708  mpGrfFormatCollTable->DeleteAndDestroy(1, mpGrfFormatCollTable->size());
709  mpCharFormatTable->DeleteAndDestroy(1, mpCharFormatTable->size());
710 
712  {
713  // search the FrameFormat of the root frm. This is not allowed to delete
714  mpFrameFormatTable->erase( getIDocumentLayoutAccess().GetCurrentViewShell()->GetLayout()->GetFormat() );
715  mpFrameFormatTable->DeleteAndDestroyAll( true );
716  mpFrameFormatTable->push_back( getIDocumentLayoutAccess().GetCurrentViewShell()->GetLayout()->GetFormat() );
717  }
718  else
719  mpFrameFormatTable->DeleteAndDestroyAll( true );
720 
722 
723  delete mpNumberFormatter.load(); mpNumberFormatter= nullptr;
724 
726  pFirstNd->ChgFormatColl( getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_STANDARD ));
727  nDummyPgDsc = m_PageDescs.size();
728  m_PageDescs.push_back( pDummyPgDsc );
729  // set the layout back to the new standard pagedesc
730  pFirstNd->ResetAllAttr();
731  // delete now the dummy pagedesc
732  DelPageDesc( nDummyPgDsc );
733 }
734 
736 {
737  if( pNew )
738  {
739  if (m_pPgPViewPrtData)
740  {
741  *m_pPgPViewPrtData = *pNew;
742  }
743  else
744  {
745  m_pPgPViewPrtData.reset(new SwPagePreviewPrtData(*pNew));
746  }
747  }
748  else if (m_pPgPViewPrtData)
749  {
750  m_pPgPViewPrtData.reset();
751  }
753 }
754 
756 {
757  if( getIDocumentLayoutAccess().GetCurrentViewShell() ) maOLEModifiedIdle.Start();
758 }
759 
762 {
763  if( !mpLayoutCache )
764  mpLayoutCache.reset( new SwLayoutCache() );
765  if( !mpLayoutCache->IsLocked() )
766  {
767  mpLayoutCache->GetLockCount() |= 0x8000;
768  mpLayoutCache->Read( rStream );
769  mpLayoutCache->GetLockCount() &= 0x7fff;
770  }
771 }
772 
774 {
775  SwLayoutCache::Write( rStream, *this );
776 }
777 
779 {
780  const SwDoc* pDoc = rTextNode.GetDoc();
781  if( !pDoc || pDoc->IsInDtor() )
782  return nullptr;
783  return pDoc->getGrammarContact();
784 }
785 
788 {
789  // UGLY: this relies on SetClipBoard being called before GetXmlIdRegistry!
790  if (!m_pXmlIdRegistry)
791  {
793  }
794  return *m_pXmlIdRegistry;
795 }
796 
798 {
800  SwTOXType * pNew = new SwTOXType(TOX_CONTENT, pShellRes->aTOXContentName );
801  mpTOXTypes->emplace_back( pNew );
802  pNew = new SwTOXType(TOX_INDEX, pShellRes->aTOXIndexName );
803  mpTOXTypes->emplace_back( pNew );
804  pNew = new SwTOXType(TOX_USER, pShellRes->aTOXUserName );
805  mpTOXTypes->emplace_back( pNew );
806  pNew = new SwTOXType(TOX_ILLUSTRATIONS, pShellRes->aTOXIllustrationsName );
807  mpTOXTypes->emplace_back( pNew );
808  pNew = new SwTOXType(TOX_OBJECTS, pShellRes->aTOXObjectsName );
809  mpTOXTypes->emplace_back( pNew );
810  pNew = new SwTOXType(TOX_TABLES, pShellRes->aTOXTablesName );
811  mpTOXTypes->emplace_back( pNew );
812  pNew = new SwTOXType(TOX_AUTHORITIES, pShellRes->aTOXAuthoritiesName );
813  mpTOXTypes->emplace_back( pNew );
814  pNew = new SwTOXType(TOX_CITATION, pShellRes->aTOXCitationName );
815  mpTOXTypes->emplace_back( pNew );
816 }
817 
818 void SwDoc::ReplaceDefaults(const SwDoc& rSource)
819 {
820  // copy property defaults
821  const sal_uInt16 aRangeOfDefaults[] =
822  {
829  0
830  };
831 
832  SfxItemSet aNewDefaults(GetAttrPool(), aRangeOfDefaults);
833 
834  for (auto nRange = 0; aRangeOfDefaults[nRange] != 0; nRange += 2)
835  {
836  for (sal_uInt16 nWhich = aRangeOfDefaults[nRange];
837  nWhich <= aRangeOfDefaults[nRange + 1]; ++nWhich)
838  {
839  const SfxPoolItem& rSourceAttr =
840  rSource.mpAttrPool->GetDefaultItem(nWhich);
841  if (rSourceAttr != mpAttrPool->GetDefaultItem(nWhich))
842  aNewDefaults.Put(rSourceAttr);
843  }
844  }
845 
846  if (aNewDefaults.Count())
847  SetDefault(aNewDefaults);
848 }
849 
851 {
852  m_pDocumentSettingManager->ReplaceCompatibilityOptions(rSource.GetDocumentSettingManager());
853 }
854 
855 #ifdef DBG_UTIL
856 #define CNTNT_DOC( doc ) \
857  ((doc)->GetNodes().GetEndOfContent().GetIndex() - (doc)->GetNodes().GetEndOfExtras().GetIndex() - 2)
858 #define CNTNT_IDX( idx ) \
859  ((idx).GetNode().GetIndex() - GetNodes().GetEndOfExtras().GetIndex() - 1)
860 #endif
861 
862 SfxObjectShell* SwDoc::CreateCopy( bool bCallInitNew, bool bEmpty ) const
863 {
864  SAL_INFO( "sw.pageframe", "(SwDoc::CreateCopy in" );
865  rtl::Reference<SwDoc> xRet( new SwDoc );
866 
867  // we have to use pointer here, since the callee has to decide whether
868  // SfxObjectShellLock or SfxObjectShellRef should be used sometimes the
869  // object will be returned with refcount set to 0 ( if no DoInitNew is done )
870  SfxObjectShell* pRetShell = new SwDocShell( xRet.get(), SfxObjectCreateMode::STANDARD );
871  if( bCallInitNew )
872  {
873  // it could happen that DoInitNew creates model,
874  // that increases the refcount of the object
875  pRetShell->DoInitNew();
876  }
877 
878  xRet->ReplaceDefaults(*this);
879 
880  xRet->ReplaceCompatibilityOptions(*this);
881 
882  xRet->ReplaceStyles(*this);
883 
884  if( !bEmpty )
885  {
886 #ifdef DBG_UTIL
887  SAL_INFO( "sw.createcopy", "CC-Nd-Src: " << CNTNT_DOC( this ) );
888  SAL_INFO( "sw.createcopy", "CC-Nd: " << CNTNT_DOC( xRet ) );
889 #endif
890  xRet->AppendDoc(*this, 0, bCallInitNew, 0, 0);
891 #ifdef DBG_UTIL
892  SAL_INFO( "sw.createcopy", "CC-Nd: " << CNTNT_DOC( xRet ) );
893 #endif
894  }
895 
896  // remove the temporary shell if it is there as it was done before
897  xRet->SetTmpDocShell( nullptr );
898 
899  SAL_INFO( "sw.pageframe", "SwDoc::CreateCopy out)" );
900  return pRetShell;
901 }
902 
903 // save bulk letters as single documents
904 static OUString lcl_FindUniqueName(SwWrtShell* pTargetShell, const OUString& rStartingPageDesc, sal_uLong nDocNo )
905 {
906  do
907  {
908  OUString sTest = rStartingPageDesc + OUString::number( nDocNo );
909  if( !pTargetShell->FindPageDescByName( sTest ) )
910  return sTest;
911  ++nDocNo;
912  }
913  while( true );
914 }
915 
919 {
920  // remember already checked page descs to avoid cycle
921  o3tl::sorted_vector<const SwPageDesc*> aCheckedPageDescs;
922  const SwPageDesc* pCurPageDesc = &rPageDesc;
923  while (aCheckedPageDescs.count(pCurPageDesc) == 0)
924  {
925  const SwFrameFormat& rMaster = pCurPageDesc->GetMaster();
926  if (rMaster.GetHeader().IsActive() || rMaster.GetFooter().IsActive())
927  return true;
928 
929  aCheckedPageDescs.insert(pCurPageDesc);
930  pCurPageDesc = pCurPageDesc->GetFollow();
931  }
932  return false;
933 }
934 
936  SwWrtShell& rTargetShell,
937  const SwPageDesc& rSourcePageDesc,
938  const SwPageDesc& rTargetPageDesc,
939  const sal_uLong nDocNo )
940 {
941  //now copy the follow page desc, too
942  // note: these may at any point form a cycle, so a loop is needed and it
943  // must be detected that the last iteration closes the cycle and doesn't
944  // copy the first page desc of the cycle again.
945  std::map<OUString, OUString> followMap{ { rSourcePageDesc.GetName(), rTargetPageDesc.GetName() } };
946  SwPageDesc const* pCurSourcePageDesc(&rSourcePageDesc);
947  SwPageDesc const* pCurTargetPageDesc(&rTargetPageDesc);
948  do
949  {
950  const SwPageDesc* pFollowPageDesc = pCurSourcePageDesc->GetFollow();
951  OUString sFollowPageDesc = pFollowPageDesc->GetName();
952  if (sFollowPageDesc == pCurSourcePageDesc->GetName())
953  {
954  break;
955  }
956  SwDoc* pTargetDoc = rTargetShell.GetDoc();
957  SwPageDesc* pTargetFollowPageDesc(nullptr);
958  auto const itMapped(followMap.find(sFollowPageDesc));
959  if (itMapped == followMap.end())
960  {
961  OUString sNewFollowPageDesc = lcl_FindUniqueName(&rTargetShell, sFollowPageDesc, nDocNo);
962  pTargetFollowPageDesc = pTargetDoc->MakePageDesc(sNewFollowPageDesc);
963  pTargetDoc->CopyPageDesc(*pFollowPageDesc, *pTargetFollowPageDesc, false);
964  }
965  else
966  {
967  pTargetFollowPageDesc = pTargetDoc->FindPageDesc(itMapped->second);
968  }
969  SwPageDesc aDesc(*pCurTargetPageDesc);
970  aDesc.SetFollow(pTargetFollowPageDesc);
971  pTargetDoc->ChgPageDesc(pCurTargetPageDesc->GetName(), aDesc);
972  if (itMapped != followMap.end())
973  {
974  break; // was already copied
975  }
976  pCurSourcePageDesc = pCurSourcePageDesc->GetFollow();
977  pCurTargetPageDesc = pTargetFollowPageDesc;
978  followMap[pCurSourcePageDesc->GetName()] = pCurTargetPageDesc->GetName();
979  }
980  while (true);
981 }
982 
983 // appends all pages of source SwDoc - based on SwFEShell::Paste( SwDoc* )
984 SwNodeIndex SwDoc::AppendDoc(const SwDoc& rSource, sal_uInt16 const nStartPageNumber,
985  bool const bDeletePrevious, int pageOffset, const sal_uLong nDocNo)
986 {
987  SAL_INFO( "sw.pageframe", "(SwDoc::AppendDoc in " << bDeletePrevious );
988 
989  // GetEndOfExtras + 1 = StartOfContent == no content node!
990  // This ensures it won't be merged in the SwTextNode at the position.
991  SwNodeIndex aSourceIdx( rSource.GetNodes().GetEndOfExtras(), 1 );
992  // CopyRange works on the range a [mark, point[ and considers an
993  // index < point outside the selection.
994  // @see IDocumentContentOperations::CopyRange
995  SwNodeIndex aSourceEndIdx( rSource.GetNodes().GetEndOfContent(), 0 );
996  SwPaM aCpyPam( aSourceIdx, aSourceEndIdx );
997 
998 #ifdef DBG_UTIL
999  SAL_INFO( "sw.docappend", "NodeType 0x" << std::hex << static_cast<int>(aSourceIdx.GetNode().GetNodeType())
1000  << std::dec << " " << aSourceIdx.GetNode().GetIndex() );
1001  aSourceIdx++;
1002  SAL_INFO( "sw.docappend", "NodeType 0x" << std::hex << static_cast<int>(aSourceIdx.GetNode().GetNodeType())
1003  << std::dec << " " << aSourceIdx.GetNode().GetIndex() );
1004  if ( aSourceIdx.GetNode().GetNodeType() != SwNodeType::End ) {
1005  aSourceIdx++;
1006  SAL_INFO( "sw.docappend", "NodeType 0x" << std::hex << static_cast<int>(aSourceIdx.GetNode().GetNodeType()) << std::dec );
1007  aSourceIdx--;
1008  }
1009  aSourceIdx--;
1010  SAL_INFO( "sw.docappend", ".." );
1011  SAL_INFO( "sw.docappend", "NodeType 0x" << std::hex << static_cast<int>(aSourceEndIdx.GetNode().GetNodeType())
1012  << std::dec << " " << aSourceEndIdx.GetNode().GetIndex() );
1013  SAL_INFO( "sw.docappend", "NodeType 0x" << std::hex << static_cast<int>(aSourceEndIdx.GetNode().GetNodeType())
1014  << std::dec << " " << aSourceEndIdx.GetNode().GetIndex() );
1015  SAL_INFO( "sw.docappend", "Src-Nd: " << CNTNT_DOC( &rSource ) );
1016  SAL_INFO( "sw.docappend", "Nd: " << CNTNT_DOC( this ) );
1017 #endif
1018 
1019  SwWrtShell* pTargetShell = GetDocShell()->GetWrtShell();
1020  SwPageDesc* pTargetPageDesc = nullptr;
1021 
1022  if ( pTargetShell ) {
1023 #ifdef DBG_UTIL
1024  SAL_INFO( "sw.docappend", "Has target write shell" );
1025 #endif
1026  pTargetShell->StartAllAction();
1027 
1028  if( nDocNo > 0 )
1029  {
1030  // #i72517# put the styles to the target document
1031  // if the source uses headers or footers the target document
1032  // needs inidividual page styles
1033  const SwWrtShell *pSourceShell = rSource.GetDocShell()->GetWrtShell();
1034  const SwPageDesc& rSourcePageDesc = pSourceShell->GetPageDesc(
1035  pSourceShell->GetCurPageDesc());
1036  const OUString sStartingPageDesc = rSourcePageDesc.GetName();
1037  const bool bPageStylesWithHeaderFooter = lcl_PageDescOrFollowContainsHeaderFooter(rSourcePageDesc);
1038  if( bPageStylesWithHeaderFooter )
1039  {
1040  // create a new pagestyle
1041  // copy the pagedesc from the current document to the new
1042  // document and change the name of the to-be-applied style
1043  OUString sNewPageDescName = lcl_FindUniqueName(pTargetShell, sStartingPageDesc, nDocNo );
1044  pTargetPageDesc = MakePageDesc( sNewPageDescName );
1045  if( pTargetPageDesc )
1046  {
1047  CopyPageDesc( rSourcePageDesc, *pTargetPageDesc, false );
1048  lcl_CopyFollowPageDesc( *pTargetShell, rSourcePageDesc, *pTargetPageDesc, nDocNo );
1049  }
1050  }
1051  else
1052  pTargetPageDesc = pTargetShell->FindPageDescByName( sStartingPageDesc );
1053  }
1054 
1055  // Otherwise we have to handle SwPlaceholderNodes as first node
1056  if ( pTargetPageDesc )
1057  {
1058  SwNodeIndex aBreakIdx( GetNodes().GetEndOfContent(), -1 );
1059  SwPosition aBreakPos( aBreakIdx );
1060  // InsertPageBreak just works on SwTextNode nodes, so make
1061  // sure the last node is one!
1062  bool bIsTextNode = aBreakIdx.GetNode().IsTextNode();
1063  if ( !bIsTextNode )
1065  const OUString name = pTargetPageDesc->GetName();
1066  pTargetShell->InsertPageBreak( &name, nStartPageNumber );
1067  if ( !bIsTextNode )
1068  {
1069  pTargetShell->SttEndDoc( false );
1070  --aBreakIdx;
1071  GetNodes().Delete( aBreakIdx );
1072  }
1073 
1074  // There is now a new empty text node on the new page. If it has
1075  // any marks, those are from the previous page: move them back
1076  // there, otherwise later we can't delete that empty text node.
1077  SwNodeIndex aNodeIndex(GetNodes().GetEndOfContent(), -1);
1078  if (SwTextNode* pTextNode = aNodeIndex.GetNode().GetTextNode())
1079  {
1080  // Position of the last paragraph on the previous page.
1081  --aNodeIndex;
1082  SwPaM aPaM(aNodeIndex);
1083  // Collect the marks starting or ending at this text node.
1086  for (const SwIndex* pIndex = pTextNode->GetFirstIndex(); pIndex; pIndex = pIndex->GetNext())
1087  {
1088  sw::mark::IMark* pMark = const_cast<sw::mark::IMark*>(pIndex->GetMark());
1089  if (!pMark)
1090  continue;
1091  if (!aSeenMarks.insert(pMark).second)
1092  continue;
1093  }
1094  // And move them back.
1095  for (sw::mark::IMark* pMark : aSeenMarks)
1096  pMarkAccess->repositionMark(pMark, aPaM);
1097  }
1098 
1099  // Flush the page break, if we want to keep it
1100  if ( !bDeletePrevious )
1101  {
1102  SAL_INFO( "sw.pageframe", "(Flush pagebreak AKA EndAllAction" );
1103  pTargetShell->EndAllAction();
1104  SAL_INFO( "sw.pageframe", "Flush changes AKA EndAllAction)" );
1105  pTargetShell->StartAllAction();
1106  }
1107  }
1108  }
1109 #ifdef DBG_UTIL
1110  SAL_INFO( "sw.docappend", "Nd: " << CNTNT_DOC( this ) );
1111 #endif
1112 
1113  // -1, otherwise aFixupIdx would move to new EOC
1114  SwNodeIndex aFixupIdx( GetNodes().GetEndOfContent(), -1 );
1115 
1116  // append at the end of document / content
1117  SwNodeIndex aTargetIdx( GetNodes().GetEndOfContent() );
1118  SwPaM aInsertPam( aTargetIdx );
1119 
1120 #ifdef DBG_UTIL
1121  SAL_INFO( "sw.docappend", "Pam-Nd: " << aCpyPam.GetNode().GetIndex() - aCpyPam.GetNode( false ).GetIndex() + 1
1122  << " (0x" << std::hex << static_cast<int>(aCpyPam.GetNode( false ).GetNodeType()) << std::dec
1123  << " " << aCpyPam.GetNode( false ).GetIndex()
1124  << " - 0x" << std::hex << static_cast<int>(aCpyPam.GetNode().GetNodeType()) << std::dec
1125  << " " << aCpyPam.GetNode().GetIndex() << ")" );
1126 #endif
1127 
1130 
1131  // Position where the appended doc starts. Will be filled in later.
1132  // Initially uses GetEndOfContent() because SwNodeIndex has no default ctor.
1133  SwNodeIndex aStartAppendIndex( GetNodes().GetEndOfContent() );
1134 
1135  {
1136  // **
1137  // ** refer to SwFEShell::Paste, if you change the following code **
1138  // **
1139 
1140  SwPosition& rInsPos = *aInsertPam.GetPoint();
1141 
1142  {
1143  SwNodeIndex aIndexBefore(rInsPos.nNode);
1144 
1145  aIndexBefore--;
1146 #ifdef DBG_UTIL
1147  SAL_INFO( "sw.docappend", "CopyRange In: " << CNTNT_DOC( this ) );
1148 #endif
1150  // Note: aCpyPam is invalid now
1151 #ifdef DBG_UTIL
1152  SAL_INFO( "sw.docappend", "CopyRange Out: " << CNTNT_DOC( this ) );
1153 #endif
1154 
1155  ++aIndexBefore;
1156  SwPaM aPaM(SwPosition(aIndexBefore),
1157  SwPosition(rInsPos.nNode));
1158 
1159  aPaM.GetDoc()->MakeUniqueNumRules(aPaM);
1160 
1161  // Update the rsid of each pasted text node
1162  SwNodes &rDestNodes = GetNodes();
1163  sal_uLong const nEndIdx = aPaM.End()->nNode.GetIndex();
1164 
1165  for (sal_uLong nIdx = aPaM.Start()->nNode.GetIndex();
1166  nIdx <= nEndIdx; ++nIdx)
1167  {
1168  SwTextNode *const pTextNode = rDestNodes[nIdx]->GetTextNode();
1169  if ( pTextNode )
1170  UpdateParRsid( pTextNode );
1171  }
1172  }
1173 
1174  {
1175  sal_uLong iDelNodes = 0;
1176  SwNodeIndex aDelIdx( aFixupIdx );
1177 
1178  // we just need to set the new page description and reset numbering
1179  // this keeps all other settings as in the pasted document
1180  if ( nStartPageNumber || pTargetPageDesc ) {
1181  std::unique_ptr<SfxPoolItem> pNewItem;
1182  SwTextNode *aTextNd = nullptr;
1183  SwFormat *pFormat = nullptr;
1184 
1185  // find the first node allowed to contain a RES_PAGEDESC
1186  while (true) {
1187  aFixupIdx++;
1188 
1189  SwNode &node = aFixupIdx.GetNode();
1190  if ( node.IsTextNode() ) {
1191  // every document contains at least one text node!
1192  aTextNd = node.GetTextNode();
1193  pNewItem.reset(aTextNd->GetAttr( RES_PAGEDESC ).Clone());
1194  break;
1195  }
1196  else if ( node.IsTableNode() ) {
1197  pFormat = node.GetTableNode()->GetTable().GetFrameFormat();
1198  pNewItem.reset(pFormat->GetFormatAttr( RES_PAGEDESC ).Clone());
1199  break;
1200  }
1201  }
1202 
1203 #ifdef DBG_UTIL
1204  SAL_INFO( "sw.docappend", "Idx Del " << CNTNT_IDX( aDelIdx ) );
1205  SAL_INFO( "sw.docappend", "Idx Fix " << CNTNT_IDX( aFixupIdx ) );
1206 #endif
1207  // just update the original instead of overwriting
1208  SwFormatPageDesc *aDesc = static_cast< SwFormatPageDesc* >( pNewItem.get() );
1209 #ifdef DBG_UTIL
1210  if ( aDesc->GetPageDesc() )
1211  SAL_INFO( "sw.docappend", "PD Update " << aDesc->GetPageDesc()->GetName() );
1212  else
1213  SAL_INFO( "sw.docappend", "PD New" );
1214 #endif
1215  if ( nStartPageNumber )
1216  aDesc->SetNumOffset( nStartPageNumber );
1217  if ( pTargetPageDesc )
1218  aDesc->RegisterToPageDesc( *pTargetPageDesc );
1219  if ( aTextNd )
1220  aTextNd->SetAttr( *aDesc );
1221  else
1222  pFormat->SetFormatAttr( *aDesc );
1223 
1224 #ifdef DBG_UTIL
1225  SAL_INFO( "sw.docappend", "Idx " << CNTNT_IDX( aDelIdx ) );
1226 #endif
1227  iDelNodes++;
1228  }
1229 
1230  if ( bDeletePrevious )
1231  iDelNodes++;
1232 
1233  if ( iDelNodes ) {
1234  // delete leading empty page(s), e.g. from InsertPageBreak or
1235  // new SwDoc. this has to be done before copying the page bound
1236  // frames, otherwise the drawing layer gets confused.
1237  if ( pTargetShell )
1238  pTargetShell->SttEndDoc( false );
1239  aDelIdx -= iDelNodes - 1;
1240 #ifdef DBG_UTIL
1241  SAL_INFO( "sw.docappend", "iDelNodes: " << iDelNodes
1242  << " Idx: " << aDelIdx.GetNode().GetIndex()
1243  << " EOE: " << GetNodes().GetEndOfExtras().GetIndex() );
1244 #endif
1245  GetNodes().Delete( aDelIdx, iDelNodes );
1246  aStartAppendIndex = aFixupIdx;
1247  }
1248  else
1249  {
1250  aStartAppendIndex = aFixupIdx;
1251  ++aStartAppendIndex;
1252  }
1253  }
1254 
1255  // finally copy page bound frames
1256  for ( auto pCpyFormat : *rSource.GetSpzFrameFormats() )
1257  {
1258  const SwFrameFormat& rCpyFormat = *pCpyFormat;
1259  SwFormatAnchor aAnchor( rCpyFormat.GetAnchor() );
1260  if (RndStdIds::FLY_AT_PAGE != aAnchor.GetAnchorId())
1261  continue;
1262  SAL_INFO( "sw.docappend", "PaAn: " << aAnchor.GetPageNum()
1263  << " => " << aAnchor.GetPageNum() + pageOffset );
1264  if ( pageOffset != 0 )
1265  aAnchor.SetPageNum( aAnchor.GetPageNum() + pageOffset );
1266  getIDocumentLayoutAccess().CopyLayoutFormat( rCpyFormat, aAnchor, true, true );
1267  }
1268  }
1269 
1271 
1274 
1275  if ( pTargetShell )
1276  pTargetShell->EndAllAction();
1277 
1278  SAL_INFO( "sw.pageframe", "SwDoc::AppendDoc out)" );
1279  return aStartAppendIndex;
1280 }
1281 
1282 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
css::uno::Reference< css::embed::XStorage > GetDocStorage()
Definition: docnew.cxx:606
::sfx2::IXmlIdRegistry * createXmlIdRegistry(const bool i_DocIsClipboard)
const std::unique_ptr< ::sw::UndoManager > m_pUndoManager
Definition: doc.hxx:214
sal_uInt32 mnRsidRoot
Definition: doc.hxx:293
SwNodeIndex AppendDoc(const SwDoc &rSource, sal_uInt16 nStartPageNumber, bool bDeletePrevious, int physicalPageOffset, const sal_uLong nDocNo)
Definition: docnew.cxx:984
SwPageDescs m_PageDescs
Definition: doc.hxx:196
sal_uLong GetIndex() const
Definition: node.hxx:282
sal_uLong Count() const
Definition: ndarr.hxx:142
bool bVisible
Represents the style of a paragraph.
Definition: fmtcol.hxx:55
std::unique_ptr< SwDefTOXBase_Impl > mpDefTOXBases
Definition: doc.hxx:247
std::atomic< SvNumberFormatter * > mpNumberFormatter
Definition: doc.hxx:264
Marks a position in the document model.
Definition: pam.hxx:35
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
Definition: fmtpdsc.hxx:35
bool UpdateParRsid(SwTextNode *pTextNode, sal_uInt32 nVal=0)
Definition: docfmt.cxx:434
void SetOLEObjModified()
update all modified OLE-Objects.
Definition: docnew.cxx:755
SwPageDesc * GetPageDesc()
Definition: fmtpdsc.hxx:62
const SwFormatHeader & GetHeader(bool=true) const
Definition: fmthdft.hxx:97
static ShellResource * GetShellRes()
Definition: viewsh.cxx:2487
IGrammarContact * getGrammarContact() const
Definition: doc.hxx:1549
bool SttEndDoc(bool bStt)
Definition: crsrsh.cxx:566
virtual sal_uInt16 ResetAllAttr() override
Definition: ndtxt.cxx:5142
SwDocShell * GetDocShell()
Definition: doc.hxx:1350
size_type count(const Value &v) const
virtual bool SetAttr(const SfxPoolItem &) override
overriding to handle change of certain paragraph attributes
Definition: ndtxt.cxx:4884
static void Write(SvStream &rStream, const SwDoc &rDoc)
writes the index (more precise: the difference between the index and the first index of the document ...
Definition: laycache.cxx:164
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
void DelPageDesc(const OUString &rName, bool bBroadcast=false)
Definition: docdesc.cxx:845
SwNodeIndex nNode
Definition: pam.hxx:37
SwDBManager * m_pDBManager
Definition: doc.hxx:250
Idle maOLEModifiedIdle
Definition: doc.hxx:201
static bool lcl_PageDescOrFollowContainsHeaderFooter(const SwPageDesc &rPageDesc)
Returns whether the passed SwPageDesc& or any of its (transitive) follows contains a header or footer...
Definition: docnew.cxx:918
std::unique_ptr< SwNodes > m_pNodes
Definition: doc.hxx:194
virtual void SetModified()=0
Must be called manually at changes of format.
sal_uIntPtr sal_uLong
OUString sDataSource
Definition: swdbdata.hxx:30
#define RES_FRMATR_END
Definition: hintids.hxx:331
sal_Int64 n
virtual SwUndoId EndUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Closes undo block.
Provides access to the marks of a document.
Definition: doc.hxx:186
SwAttrPool * mpAttrPool
Definition: doc.hxx:195
virtual void StopIdling()=0
Stop idle processing.
IDocumentLinksAdministration const & getIDocumentLinksAdministration() const
Definition: doc.cxx:259
virtual SwFrameFormat * CopyLayoutFormat(const SwFrameFormat &rSrc, const SwFormatAnchor &rNewAnchor, bool bSetTextFlyAtt, bool bMakeFrames)=0
void SetDocShell(SwDocShell *pDocShell)
Definition: docundo.cxx:86
SwNode & GetNode() const
Definition: ndindex.hxx:119
Content, content of frame (header, footer, fly).
Definition: fmtcntnt.hxx:31
#define RES_PARATR_LIST_END
Definition: hintids.hxx:285
void ReplaceCompatibilityOptions(const SwDoc &rSource)
Definition: docnew.cxx:850
IDocumentMarkAccess * getIDocumentMarkAccess()
Definition: docbm.cxx:1681
Dialog to specify the properties of date form field.
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:143
std::unordered_map< OUString, SwNumRule * > maNumRuleMap
Definition: doc.hxx:269
std::unique_ptr< IStyleAccess > mpStyleAccess
Definition: doc.hxx:274
SfxObjectShell * GetPersist() const
~SwDoc()
Speciality: a member of the class SwDoc is located at position 0 in the array of the Format and GDI o...
Definition: docnew.cxx:368
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:314
void SetPageNum(sal_uInt16 nNew)
Definition: fmtanchr.hxx:72
void EndAllAction()
Definition: edws.cxx:97
OUString aTOXIndexName
Definition: shellres.hxx:52
SwTableFormat * GetFrameFormat()
Definition: swtable.hxx:201
const SwFrameFormats * GetSpzFrameFormats() const
Definition: doc.hxx:741
void SetNewContentIdx(const SwNodeIndex *pIdx)
Definition: atrfrm.cxx:556
OUString aTOXAuthoritiesName
Definition: shellres.hxx:58
void SetFollow(const SwPageDesc *pNew)
Definition: pagedesc.hxx:293
unsigned int uniform_uint_distribution(unsigned int a, unsigned int b)
const OUString & GetName() const
Definition: pagedesc.hxx:187
const SwIndex * GetNext() const
Definition: index.hxx:102
bool IsActive() const
Definition: fmthdft.hxx:89
Array of Undo-history.
Definition: docary.hxx:197
virtual void LockExpFields()=0
css::uno::Reference< css::embed::XStorage > const & GetStorage()
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
std::unique_ptr< SwURLStateChanged > mpURLStateChgd
Definition: doc.hxx:263
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
Definition: doc.cxx:356
void Delete(const SwNodeIndex &rPos, sal_uLong nNodes=1)
delete nodes
Definition: nodes.cxx:1065
IGrammarContact * getGrammarContact(const SwTextNode &rTextNode)
getGrammarContact() delivers the grammar contact of the document (for a given textnode) ...
Definition: docnew.cxx:778
#define RES_CHRATR_END
Definition: hintids.hxx:208
SwTableNode * GetTableNode()
Definition: node.hxx:599
std::unique_ptr< SwFrameFormats > mpTableFrameFormatTable
Definition: doc.hxx:242
void cleanupUnoCursorTable() const
Definition: doc.hxx:1637
void ReplaceDefaults(const SwDoc &rSource)
Definition: docnew.cxx:818
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:425
void ReadLayoutCache(SvStream &rStream)
SwDoc: Reading and writing of the layout cache.
Definition: docnew.cxx:761
check if target position is in fly anchored at source range
std::unique_ptr< SwNumRuleTable > mpNumRuleTable
Definition: doc.hxx:266
std::unique_ptr< IGrammarContact > mpGrammarContact
Definition: doc.hxx:278
sal_uLong GetIndex() const
Definition: ndindex.hxx:152
virtual void DelLayoutFormat(SwFrameFormat *pFormat)=0
virtual void DelAllUndoObj()=0
Delete all Undo actions.
std::unique_ptr< ::sw::DocumentDeviceManager > m_pDeviceAccess
Definition: doc.hxx:217
virtual void Start() override
virtual void DoUndo(bool const bDoUndo)=0
Enable/Disable Undo.
sal_uInt32 mnRsid
Definition: doc.hxx:292
::sfx2::IXmlIdRegistry & GetXmlIdRegistry()
Definition: docnew.cxx:787
#define RES_UL_SPACE
Definition: hintids.hxx:292
std::unique_ptr< SwFrameFormats > mpSpzFrameFormatTable
Definition: doc.hxx:240
OUString aTOXIllustrationsName
Definition: shellres.hxx:55
const SwTable & GetTable() const
Definition: node.hxx:497
SwDocShell * mpDocShell
Definition: doc.hxx:258
void DelNodes(const SwNodeIndex &rStart, sal_uLong nCnt=1)
Delete a number of nodes.
Definition: nodes.cxx:1316
SwDoc * GetDoc() const
Definition: viewsh.hxx:284
void SetUndoManager(SfxUndoManager *pNewUndoMgr)
o3tl::sorted_vector< SwRootFrame * > GetAllLayouts()
Definition: doclay.cxx:1666
#define RES_PARATR_BEGIN
Definition: hintids.hxx:254
bool mbDtor
TRUE: is in SwDoc DTOR.
Definition: doc.hxx:297
void InitTOXTypes()
Definition: docnew.cxx:797
css::uno::Reference< css::frame::XModel > GetBaseModel() const
SwPaM * GetNext()
Definition: pam.hxx:264
std::unique_ptr< SwOutlineNodes > m_pOutlineNodes
Array of all outline nodes.
Definition: ndarr.hxx:110
virtual SwPageDesc * GetPageDescFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return required automatic page style.
Specific frame formats (frames, DrawObjects).
SwPageDesc * FindPageDesc(const OUString &rName, size_t *pPos=nullptr) const
Definition: docdesc.cxx:822
static void RevokeDataSource(const OUString &rName)
Unregister a data source.
Definition: dbmgr.cxx:2918
Base class for various Writer styles.
Definition: format.hxx:43
void SetDebugName(const char *pDebugName)
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
Definition: ndarr.hxx:163
SwDBData maDBData
Definition: doc.hxx:202
virtual void repositionMark(::sw::mark::IMark *io_pMark, const SwPaM &rPaM)=0
Moves an existing mark to a new selection and performs needed updates.
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
std::unique_ptr< SwTextFormatColls > mpTextFormatCollTable
Definition: doc.hxx:243
void AddNumRule(SwNumRule *pRule)
Add numbering rule to document.
Definition: docnum.cxx:2435
Style of a layout element.
Definition: frmfmt.hxx:57
::sw::UndoManager & GetUndoManager()
Definition: doc.cxx:132
virtual SwUndoId StartUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Opens undo block.
void SetPreviewPrtData(const SwPagePreviewPrtData *pData)
Definition: docnew.cxx:735
virtual const SwExtraRedlineTable & GetExtraRedlineTable() const =0
void MakeUniqueNumRules(const SwPaM &rPaM)
Definition: docnum.cxx:1236
std::unique_ptr< SwTOXTypes > mpTOXTypes
Definition: doc.hxx:246
void erase(const value_type &x)
Definition: pagedesc.cxx:594
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:81
bool HasGrammarChecker() const
OUString aTOXObjectsName
Definition: shellres.hxx:56
const SwPosition * GetPoint() const
Definition: pam.hxx:207
virtual bool CopyRange(SwPaM &rPam, SwPosition &rPos, SwCopyFlags flags) const =0
Copy a selected content range to a position.
std::unique_ptr< SwLayoutCache > mpLayoutCache
Layout cache to read and save with the document for a faster formatting.
Definition: doc.hxx:275
void Remove(SvBaseLink const *pLink)
void InitDrawModelAndDocShell(SwDocShell *pSwDocShell, SwDrawModel *pSwDrawDocument)
Definition: docshdrw.cxx:32
std::vector< std::weak_ptr< SwUnoCursor > > mvUnoCursorTable
Definition: doc.hxx:1634
std::unique_ptr< SwEndNoteInfo > mpEndNoteInfo
Definition: doc.hxx:254
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:67
const std::unique_ptr< ::sw::mark::MarkManager > mpMarkManager
Definition: doc.hxx:209
void DeleteAndDestroyAll()
Definition: docredln.cxx:617
static void lcl_CopyFollowPageDesc(SwWrtShell &rTargetShell, const SwPageDesc &rSourcePageDesc, const SwPageDesc &rTargetPageDesc, const sal_uLong nDocNo)
Definition: docnew.cxx:935
bool IsVisible() const
SfxObjectShell * CreateCopy(bool bCallInitNew, bool bEmpty) const
Definition: docnew.cxx:862
SwPageDesc * MakePageDesc(const OUString &rName, const SwPageDesc *pCpy=nullptr, bool bRegardLanguage=true, bool bBroadcast=false)
Definition: docdesc.cxx:639
sal_uInt16 Count() const
FlyAnchors.
Definition: fmtanchr.hxx:34
const SwPageDesc & GetPageDesc(size_t i) const
Definition: fedesc.cxx:125
SwDoc * GetDoc()
Definition: node.hxx:702
std::unique_ptr< SwTextFormatColl > mpDfltTextFormatColl
Definition: doc.hxx:235
SwDoc * GetDoc() const
Definition: pam.hxx:243
static SfxViewFrame * GetNext(const SfxViewFrame &rPrev, const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
std::unique_ptr< SwFrameFormat > mpColumnContFormat
Definition: doc.hxx:233
Marks a character position inside a document model node.
Definition: index.hxx:37
virtual SwFormatColl * ChgFormatColl(SwFormatColl *) override
Definition: ndtxt.cxx:3921
#define RES_CHRATR_BEGIN
Definition: hintids.hxx:162
const SwFormatFooter & GetFooter(bool=true) const
Definition: fmthdft.hxx:99
css::uno::Reference< css::linguistic2::XProofreadingIterator > m_xGCIterator
Definition: doc.hxx:207
static OUString GetOutlineRuleName()
Definition: number.cxx:72
IDocumentState const & getIDocumentState() const
Definition: doc.cxx:393
virtual void deleteListForListStyle(const OUString &rListStyleName)=0
OUString aTOXCitationName
Definition: shellres.hxx:59
void WriteLayoutCache(SvStream &rStream)
Definition: docnew.cxx:773
SwWrtShell * GetWrtShell()
Access to the SwWrtShell belonging to SwView.
Definition: docsh.hxx:224
void ChgPageDesc(const OUString &rName, const SwPageDesc &)
Definition: docdesc.cxx:853
size
SwNumRule * mpOutlineRule
Definition: doc.hxx:252
std::unique_ptr< SwPagePreviewPrtData > m_pPgPViewPrtData
Definition: doc.hxx:271
Marks a node in the document model.
Definition: ndindex.hxx:31
OUString aTOXContentName
Definition: shellres.hxx:54
#define RES_UNKNOWNATR_BEGIN
Definition: hintids.hxx:361
void SetCountPhantoms(bool bCountPhantoms)
Definition: number.cxx:994
std::unique_ptr< SwGrfFormatColls > mpGrfFormatCollTable
Definition: doc.hxx:244
void SetDocShell(SwDocShell *pDSh)
Definition: docnew.cxx:581
#define RES_PARATR_LIST_BEGIN
Definition: hintids.hxx:278
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
std::unique_ptr< SwFrameFormat > mpEmptyPageFormat
Definition: doc.hxx:232
Frame cannot be moved in Var-direction.
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:404
const SwPosition * Start() const
Definition: pam.hxx:212
static void lcl_DelFormatIndices(SwFormat const *pFormat)
Definition: docnew.cxx:177
copy break attributes even when source is single node
OUString aTOXUserName
Definition: shellres.hxx:53
< purpose of derivation from SwClient: character style for displaying the numbers.
Definition: lineinfo.hxx:37
#define RES_LR_SPACE
Definition: hintids.hxx:291
css::uno::Reference< css::linguistic2::XProofreadingIterator > const & GetGCIterator() const
Definition: docnew.cxx:110
const SwPageDesc * GetFollow() const
Definition: pagedesc.hxx:246
const SwNodeIndex * GetContentIdx() const
Definition: fmtcntnt.hxx:46
void disposeXForms()
Definition: docxforms.cxx:89
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:458
std::unique_ptr< SwSectionFormats > mpSectionFormatTable
Definition: doc.hxx:241
std::unique_ptr< ::sfx2::IXmlIdRegistry > m_pXmlIdRegistry
Definition: doc.hxx:288
void SetDefault(const SfxPoolItem &)
Set attribute as new default attribute in current document.
Definition: docfmt.cxx:526
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:217
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:80
void CopyPageDesc(const SwPageDesc &rSrcDesc, SwPageDesc &rDstDesc, bool bCopyPoolIds=true)
Copy the complete PageDesc - beyond document and "deep"! Optionally copying of PoolFormatId, -HlpId can be prevented.
Definition: docfmt.cxx:1406
SwDoc()
Definition: docnew.cxx:190
static void Free(SfxItemPool *pPool)
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:334
std::unique_ptr< SwAutoCorrExceptWord > mpACEWord
For the automated takeover of auto-corrected words that are "re-corrected".
Definition: doc.hxx:261
SvxNumberFormat::SvxNumPositionAndSpaceMode GetDefaultPositionAndSpaceMode()
Definition: number.cxx:1402
std::unique_ptr< SwCharFormat > mpDfltCharFormat
Definition: doc.hxx:234
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
void ClrContourCache(const SdrObject *pObj)
Definition: txtfly.cxx:133
void ClearDoc()
Definition: docnew.cxx:620
#define SAL_INFO(area, stream)
std::unique_ptr< SwCharFormats > mpCharFormatTable
Definition: doc.hxx:239
bool IsClipBoard() const
Definition: doc.hxx:962
bool DoInitNew(SfxMedium *pMedium=nullptr)
SwNodes & GetNodes()
Definition: doc.hxx:405
const SwPosition * End() const
Definition: pam.hxx:217
::sw::DocumentSettingManager & GetDocumentSettingManager()
Definition: doc.cxx:185
std::unique_ptr< SwFrameFormats > mpFrameFormatTable
Definition: doc.hxx:238
SfxObjectShell * GetPersist() const
Definition: docnew.cxx:615
void PaMCorrAbs(const SwPaM &rRange, const SwPosition &rNewPos)
Function declarations so that everything below the CursorShell can move the Cursor once in a while...
Definition: doccorr.cxx:85
Organizer of the contact between SwTextNodes and grammar checker.
Reference< XComponentContext > getProcessComponentContext()
std::unique_ptr< SwFootnoteIdxs > mpFootnoteIdxs
Definition: doc.hxx:256
#define CNTNT_IDX(idx)
Definition: docnew.cxx:858
const char * name
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
void SetInvokeHandler(const Link< Timer *, void > &rLink)
::sw::DocumentDrawModelManager const & GetDocumentDrawModelManager() const
Definition: doc.cxx:164
virtual bool AppendTextNode(SwPosition &rPos)=0
const SwFormatContent & GetContent(bool=true) const
Definition: fmtcntnt.hxx:55
virtual sfx2::LinkManager & GetLinkManager()=0
SwPageDesc * FindPageDescByName(const OUString &rName, bool bGetFromPool=false, size_t *pPos=nullptr)
Definition: fedesc.cxx:130
#define CNTNT_DOC(doc)
Definition: docnew.cxx:856
void DeleteAndDestroyAll()
Definition: docredln.cxx:1867
std::unique_ptr< SwDBManager, o3tl::default_delete< SwDBManager > > m_pOwnDBManager
Definition: doc.hxx:249
bool IsInDtor() const
Definition: doc.hxx:400
static SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
bool empty() const
Definition: pagedesc.hxx:420
void SetNumOffset(const ::std::optional< sal_uInt16 > &oNum)
Definition: fmtpdsc.hxx:66
bool IsTableNode() const
Definition: node.hxx:640
void SetPriority(TaskPriority ePriority)
std::unique_ptr< SwFrameFormat > mpDfltFrameFormat
Definition: doc.hxx:231
void InsertPageBreak(const OUString *pPageDesc=nullptr, const ::std::optional< sal_uInt16 > &rPgNum=std::nullopt)
Definition: wrtsh1.cxx:870
std::unique_ptr< SwLineNumberInfo > mpLineNumberInfo
Definition: doc.hxx:255
std::unique_ptr< IStyleAccess > createStyleManager(SfxItemSet const *pIgnorableParagraphItems)
#define RES_UNKNOWNATR_END
Definition: hintids.hxx:363
#define XATTR_END
const std::unique_ptr< ::sw::DocumentSettingManager > m_pDocumentSettingManager
Definition: doc.hxx:215
virtual void UnlockExpFields()=0
bool StartGrammarChecking(bool bSkipStart=false)
Definition: docnew.cxx:128
virtual void UpdateFields(bool bCloseDB)=0
virtual const SwRedlineTable & GetRedlineTable() const =0
bool IsActive() const
Definition: fmthdft.hxx:58
std::pair< const_iterator, bool > insert(Value &&x)
const SfxPoolItem & GetAttr(sal_uInt16 nWhich, bool bInParent=true) const
SS for PoolItems: hard attributation.
Definition: node.hxx:730
#define RES_PAGEDESC
Definition: hintids.hxx:293
SwNode & GetEndOfExtras() const
This is the last EndNode of a special section.
Definition: ndarr.hxx:161
::sw::DocumentFieldsManager & GetDocumentFieldsManager()
Definition: doc.cxx:366
void StartAllAction()
For all views of this document.
Definition: edws.cxx:86
std::unique_ptr< SwFootnoteInfo > mpFootnoteInfo
Definition: doc.hxx:253
void RegisterToPageDesc(SwPageDesc &)
Definition: atrfrm.cxx:661
OUString aTOXTablesName
Definition: shellres.hxx:57
IDocumentListsAccess const & getIDocumentListsAccess() const
Definition: doc.cxx:292
size_t GetCurPageDesc(const bool bCalcFrame=true) const
Definition: fedesc.cxx:166
bool IsTextNode() const
Definition: node.hxx:636
Standard page.
Definition: poolfmt.hxx:171
void SetPersist(SfxObjectShell *p)
#define RES_FRMATR_BEGIN
Definition: hintids.hxx:287
static OUString lcl_FindUniqueName(SwWrtShell *pTargetShell, const OUString &rStartingPageDesc, sal_uLong nDocNo)
Definition: docnew.cxx:904
constexpr auto XATTR_START
IGrammarContact * createGrammarContact()
Factory for a grammar contact.
SwExtTextInput * mpExtInputRing
Definition: doc.hxx:272
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1317
std::unique_ptr< SwGrfFormatColl > mpDfltGrfFormatColl
Definition: doc.hxx:236
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:836
IDocumentTimerAccess const & getIDocumentTimerAccess() const
Definition: doc.cxx:248
#define RES_PARATR_END
Definition: hintids.hxx:274
SwTextNode * MakeTextNode(const SwNodeIndex &rWhere, SwTextFormatColl *pColl, bool bNewFrames=true)
Implementations of "Make...Node" are in the given .cxx-files.
Definition: ndtxt.cxx:104
void SetAnchor(const SwPosition *pPos)
Definition: atrfrm.cxx:1478
MissingDictionary
Definition: doc.hxx:319
virtual void ResetModified()=0
Base class of the Writer document model elements.
Definition: node.hxx:79