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