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