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  mbInWriting(false),
244  mbInMailMerge(false),
245  mbInXMLImport(false),
246  mbUpdateTOX(false),
247  mbInLoadAsynchron(false),
248  mbIsAutoFormatRedline(false),
249  mbOLEPrtNotifyPending(false),
250  mbAllOLENotify(false),
251  mbInsOnlyTextGlssry(false),
252  mbContains_MSVBasic(false),
253  mbClipBoard( false ),
254  mbColumnSelection( false ),
255  mbIsPrepareSelAll(false),
256  meDictionaryMissing( MissingDictionary::Undefined ),
257  mbContainsAtPageObjWithContentAnchor(false), //#i119292#, fdo#37024
258 
259  meDocType(DOCTYPE_NATIVE)
260 {
261  // The DrawingLayer ItemPool which is used as 2nd pool for Writer documents' pool
262  // has a default for the XFillStyleItem of XFILL_SOLID and the color for it is the default
263  // fill color (blue7 or similar). This is a problem, in Writer we want the default fill
264  // style to be drawing::FillStyle_NONE. This cannot simply be done by changing it in the 2nd pool at the
265  // pool defaults when the DrawingLayer ItemPool is used for Writer, that would lead to
266  // countless problems like DrawObjects initial fill and others.
267  // It is also hard to find all places where the initial ItemSets for Writer (including
268  // style hierarchies) are created and to always set (but only at the root) the FillStyle
269  // to NONE fixed; that will add that attribute to the file format. It will be hard to reset
270  // attribute sets (which is done at import and using UI). Also not a good solution.
271  // Luckily Writer uses pDfltTextFormatColl as default parent for all paragraphs and similar, thus
272  // it is possible to set this attribute here. It will be not reset when importing.
273  mpDfltTextFormatColl->SetFormatAttr(XFillStyleItem(drawing::FillStyle_NONE));
274  mpDfltFrameFormat->SetFormatAttr(XFillStyleItem(drawing::FillStyle_NONE));
275  // prevent paragraph default margins being applied to everything
278 
279  /*
280  * DefaultFormats and DefaultFormatCollections (FormatColl)
281  * are inserted at position 0 at the respective array.
282  * The formats in the FormatColls are derived from the
283  * DefaultFormats and are also in the list.
284  */
285  /* Formats */
286  mpFrameFormatTable->push_back(mpDfltFrameFormat.get());
287  mpCharFormatTable->push_back(mpDfltCharFormat.get());
288 
289  /* FormatColls */
290  // TXT
292  // GRF
293  mpGrfFormatCollTable->push_back(mpDfltGrfFormatColl.get());
294 
295  // Create PageDesc, EmptyPageFormat and ColumnFormat
296  if (m_PageDescs.empty())
298 
299  // Set to "Empty Page"
301  // Set BodyFormat for columns
303 
305 
306  // Create a default OutlineNumRule (for Filters)
308  // #i89178#
310  OUTLINE_RULE );
312  // Counting of phantoms depends on <IsOldNumbering()>
314 
315  new SwTextNode(
316  SwNodeIndex(GetUndoManager().GetUndoNodes().GetEndOfContent()),
317  mpDfltTextFormatColl.get() );
318  new SwTextNode( SwNodeIndex( GetNodes().GetEndOfContent() ),
319  getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_STANDARD ));
320 
321  maOLEModifiedIdle.SetPriority( TaskPriority::LOWEST );
322  maOLEModifiedIdle.SetInvokeHandler( LINK( this, SwDoc, DoUpdateModifiedOLE ));
323  maOLEModifiedIdle.SetDebugName( "sw::SwDoc maOLEModifiedIdle" );
324 
325 #if HAVE_FEATURE_DBCONNECTIVITY
326  // Create DBManager
327  m_pOwnDBManager.reset(new SwDBManager(this));
329 #else
330  m_pDBManager = nullptr;
331 #endif
332 
333  // create TOXTypes
334  InitTOXTypes();
335 
336  // pass empty item set containing the paragraph's list attributes
337  // as ignorable items to the stype manager.
338  {
340  mpStyleAccess = createStyleManager( &aIgnorableParagraphItems );
341  }
342 
343  static bool bHack = (getenv("LIBO_ONEWAY_STABLE_ODF_EXPORT") != nullptr);
344 
345  if (bHack)
346  {
347  mnRsid = 0;
348  }
349  else
350  {
351  // Initialize the session id of the current document to a random number
352  // smaller than 2^21.
354  }
355  mnRsidRoot = mnRsid;
356 
358 }
359 
366 {
367  // nothing here should create Undo actions!
368  GetIDocumentUndoRedo().DoUndo(false);
369 
370  if (mpDocShell)
371  {
372  mpDocShell->SetUndoManager(nullptr);
373  }
374 
375  mpGrammarContact.reset();
376 
377  getIDocumentTimerAccess().StopIdling(); // stop idle timer
378 
379  mpURLStateChgd.reset();
380 
381  // Deactivate Undo notification from Draw
382  if( GetDocumentDrawModelManager().GetDrawModel() )
383  {
385  ClrContourCache();
386  }
387 
388  m_pPgPViewPrtData.reset();
389 
390  mbDtor = true;
391 
392  //Clear the redline table before the nodes array is destroyed
395 
396  const sw::UnoCursorHint aHint;
398  for(const auto& pWeakCursor : mvUnoCursorTable)
399  {
400  auto pCursor(pWeakCursor.lock());
401  if(pCursor)
402  pCursor->m_aNotifier.Broadcast(aHint);
403  }
404  mpACEWord.reset();
405 
406  // Release the BaseLinks
407  {
408  ::sfx2::SvLinkSources aTemp(getIDocumentLinksAdministration().GetLinkManager().GetServers());
409  for( const auto& rpLinkSrc : aTemp )
410  rpLinkSrc->Closed();
411 
412  if( !getIDocumentLinksAdministration().GetLinkManager().GetLinks().empty() )
414  }
415 
416  // The ChapterNumbers/Numbers need to be deleted before the styles
417  // or we update all the time!
418  m_pNodes->m_pOutlineNodes->clear();
419  SwNodes & rUndoNodes( GetUndoManager().GetUndoNodes() );
420  rUndoNodes.m_pOutlineNodes->clear();
421 
422  mpFootnoteIdxs->clear();
423 
424  // indices could be registered in attributes
425  m_pUndoManager->DelAllUndoObj();
426 
427  // The BookMarks contain indices to the Content. These must be deleted
428  // before deleting the Nodes.
429  mpMarkManager->clearAllMarks();
430 
431  if( mpExtInputRing )
432  {
433  SwPaM* pTmp = mpExtInputRing;
434  mpExtInputRing = nullptr;
435  while( pTmp->GetNext() != pTmp )
436  delete pTmp->GetNext();
437  delete pTmp;
438  }
439 
440  // Old - deletion without a Flag is expensive, because we send a Modify
441  // aTOXTypes.DeleteAndDestroy( 0, aTOXTypes.Count() );
442  {
443  for( auto n = mpTOXTypes->size(); n; )
444  {
445  (*mpTOXTypes)[ --n ]->SetInDocDTOR();
446  (*mpTOXTypes)[ n ].reset();
447  }
448  mpTOXTypes->clear();
449  }
450  mpDefTOXBases.reset();
451 
452  // Any of the FrameFormats can still have indices registered.
453  // These need to be destroyed now at the latest.
454  for( SwFrameFormat* pFormat : *mpFrameFormatTable )
455  lcl_DelFormatIndices( pFormat );
456  for( SwFrameFormat* pFormat : *mpSpzFrameFormatTable )
457  lcl_DelFormatIndices( pFormat );
458  for( SwSectionFormat* pFormat : *mpSectionFormatTable )
459  lcl_DelFormatIndices( pFormat );
460 
461  // The formats/styles that follow depend on the default formats.
462  // Destroy these only after destroying the FormatIndices, because the content
463  // of headers/footers has to be deleted as well. If in the headers/footers
464  // there are still Flys registered at that point, we have a problem.
465  for( SwPageDesc *pPageDesc : m_PageDescs )
466  delete pPageDesc;
467  m_PageDescs.clear();
468 
469  // Delete content selections.
470  // Don't wait for the SwNodes dtor to destroy them; so that Formats
471  // do not have any dependencies anymore.
472  m_pNodes->DelNodes( SwNodeIndex(*m_pNodes), m_pNodes->Count() );
473  rUndoNodes.DelNodes( SwNodeIndex( rUndoNodes ), rUndoNodes.Count() );
474 
475  // Delete Formats, make it permanent some time in the future
476 
477  // Delete for Collections
478  // So that we get rid of the dependencies
479  mpFootnoteInfo->EndListeningAll();
480  mpEndNoteInfo->EndListeningAll();
481 
482  assert(mpDfltTextFormatColl.get() == (*mpTextFormatCollTable)[0]
483  && "Default-Text-Collection must always be at the start");
484 
485  // Optimization: Based on the fact that Standard is always 2nd in the
486  // array, we should delete it as the last. With this we avoid
487  // reparenting the Formats all the time!
488  if( 2 < mpTextFormatCollTable->size() )
489  mpTextFormatCollTable->DeleteAndDestroy(2, mpTextFormatCollTable->size());
490  mpTextFormatCollTable->DeleteAndDestroy(1, mpTextFormatCollTable->size());
491  mpTextFormatCollTable.reset();
492 
493  assert(mpDfltGrfFormatColl.get() == (*mpGrfFormatCollTable)[0]
494  && "DefaultGrfCollection must always be at the start");
495 
496  mpGrfFormatCollTable->DeleteAndDestroy(1, mpGrfFormatCollTable->size());
497  mpGrfFormatCollTable.reset();
498 
499  // Without explicitly freeing the DocumentDeviceManager
500  // and relying on the implicit freeing there would be a crash
501  // due to it happening after SwAttrPool is freed.
502  m_pDeviceAccess.reset();
503 
504  /*
505  * DefaultFormats and DefaultFormatCollections (FormatColl)
506  * are at position 0 of their respective arrays.
507  * In order to not be deleted by the array's dtor, we remove them
508  * now.
509  */
510  mpFrameFormatTable->erase( mpFrameFormatTable->begin() );
511  mpCharFormatTable->erase( mpCharFormatTable->begin() );
512 
513 #if HAVE_FEATURE_DBCONNECTIVITY
514  // On load, SwDBManager::setEmbeddedName() may register a data source.
515  // If we have an embedded one, then sDataSource points to the registered name, so revoke it here.
516  if (!m_pOwnDBManager->getEmbeddedName().isEmpty() && !maDBData.sDataSource.isEmpty())
517  {
518  // Remove the revoke listener here first, so that we don't remove the data source from the document.
519  m_pOwnDBManager->releaseRevokeListener();
522  }
523  else if (!m_pOwnDBManager->getEmbeddedName().isEmpty())
524  {
525  // Remove the revoke listener here first, so that we don't remove the data source from the document.
526  m_pOwnDBManager->releaseRevokeListener();
527  // Remove connections which was committed but not used.
528  m_pOwnDBManager->RevokeNotUsedConnections();
529  }
530 
531  m_pOwnDBManager.reset();
532 #endif
533 
534  // All Flys need to be destroyed before the Drawing Model,
535  // because Flys can still contain DrawContacts, when no
536  // Layout could be constructed due to a read error.
537  mpSpzFrameFormatTable->DeleteAndDestroyAll();
538 
539  // Only now destroy the Model, the drawing objects - which are also
540  // contained in the Undo - need to remove their attributes from the
541  // Model. Also, DrawContacts could exist before this.
543  // Destroy DrawModel before the LinkManager, because it's always set
544  // in the DrawModel.
545  //The LinkManager gets destroyed automatically with m_pLinksAdministrationManager
546 
547  // Clear the Tables before deleting the defaults, or we crash due to
548  // dependencies on defaults.
549  mpFrameFormatTable.reset();
550  mpSpzFrameFormatTable.reset();
551 
552  mpStyleAccess.reset();
553 
554  mpCharFormatTable.reset();
555  mpSectionFormatTable.reset();
556  mpTableFrameFormatTable.reset();
557  mpDfltTextFormatColl.reset();
558  mpDfltGrfFormatColl.reset();
559  mpNumRuleTable.reset();
560 
561  disposeXForms(); // #i113606#, dispose the XForms objects
562 
563  delete mpNumberFormatter.load(); mpNumberFormatter= nullptr;
564  mpFootnoteInfo.reset();
565  mpEndNoteInfo.reset();
566  mpLineNumberInfo.reset();
567  mpFootnoteIdxs.reset();
568  mpTOXTypes.reset();
569  mpEmptyPageFormat.reset();
570  mpColumnContFormat.reset();
571  mpDfltCharFormat.reset();
572  mpDfltFrameFormat.reset();
573  mpLayoutCache.reset();
574 
576 }
577 
579 {
580  if( mpDocShell != pDSh )
581  {
582  if (mpDocShell)
583  {
584  mpDocShell->SetUndoManager(nullptr);
585  }
586  mpDocShell = pDSh;
587  if (mpDocShell)
588  {
591  }
592 
594 
595  // set DocShell pointer also on DrawModel
597  assert(!GetDocumentDrawModelManager().GetDrawModel() ||
598  GetDocumentDrawModelManager().GetDrawModel()->GetPersist() == GetPersist());
599  }
600 }
601 
602 // Convenience method; to avoid excessive includes from docsh.hxx
603 uno::Reference < embed::XStorage > SwDoc::GetDocStorage()
604 {
605  if( mpDocShell )
606  return mpDocShell->GetStorage();
607  if( getIDocumentLinksAdministration().GetLinkManager().GetPersist() )
609  return nullptr;
610 }
611 
613 {
615 }
616 
618 {
620  ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
621 
622  // Deactivate Undo notification from Draw
623  if( GetDocumentDrawModelManager().GetDrawModel() )
624  {
626  ClrContourCache();
627  }
628 
629  // if there are still FlyFrames dangling around, delete them too
630  while ( !mpSpzFrameFormatTable->empty() )
632  assert(!GetDocumentDrawModelManager().GetDrawModel()
633  || !GetDocumentDrawModelManager().GetDrawModel()->GetPage(0)->GetObjCount());
634 
637 
638  mpACEWord.reset();
639 
640  // The BookMarks contain indices to the Content. These must be deleted
641  // before deleting the Nodes.
642  mpMarkManager->clearAllMarks();
643  InitTOXTypes();
644 
645  // create a dummy pagedesc for the layout
646  SwPageDesc* pDummyPgDsc = MakePageDesc("?DUMMY?");
647 
648  SwNodeIndex aSttIdx( *GetNodes().GetEndOfContent().StartOfSectionNode(), 1 );
649  // create the first one over and over again (without attributes/style etc.
650  SwTextNode* pFirstNd = GetNodes().MakeTextNode( aSttIdx, mpDfltTextFormatColl.get() );
651 
653  {
654  // set the layout to the dummy pagedesc
655  pFirstNd->SetAttr( SwFormatPageDesc( pDummyPgDsc ));
656 
657  SwPosition aPos( *pFirstNd, SwIndex( pFirstNd ));
658  SwPaM const tmpPaM(aSttIdx, SwNodeIndex(GetNodes().GetEndOfContent()));
659  ::PaMCorrAbs(tmpPaM, aPos);
660  }
661 
662  GetNodes().Delete( aSttIdx,
663  GetNodes().GetEndOfContent().GetIndex() - aSttIdx.GetIndex() );
664 
665  // #i62440#
666  // destruction of numbering rules and creation of new outline rule
667  // *after* the document nodes are deleted.
668  mpOutlineRule = nullptr;
669  for( SwNumRule* pNumRule : *mpNumRuleTable )
670  {
671  getIDocumentListsAccess().deleteListForListStyle(pNumRule->GetName());
672  delete pNumRule;
673  }
674  mpNumRuleTable->clear();
675  maNumRuleMap.clear();
676 
677  // creation of new outline numbering rule
679  // #i89178#
681  OUTLINE_RULE );
683  // Counting of phantoms depends on <IsOldNumbering()>
685 
686  // remove the dummy pagedesc from the array and delete all the old ones
687  size_t nDummyPgDsc = 0;
688  if (FindPageDesc(pDummyPgDsc->GetName(), &nDummyPgDsc))
689  m_PageDescs.erase( nDummyPgDsc );
690  for( SwPageDesc *pPageDesc : m_PageDescs )
691  delete pPageDesc;
692  m_PageDescs.clear();
693 
694  // Delete for Collections
695  // So that we get rid of the dependencies
696  mpFootnoteInfo->EndListeningAll();
697  mpEndNoteInfo->EndListeningAll();
698 
699  // Optimization: Based on the fact that Standard is always 2nd in the
700  // array, we should delete it as the last. With this we avoid
701  // reparenting the Formats all the time!
702  if( 2 < mpTextFormatCollTable->size() )
703  mpTextFormatCollTable->DeleteAndDestroy(2, mpTextFormatCollTable->size());
704  mpTextFormatCollTable->DeleteAndDestroy(1, mpTextFormatCollTable->size());
705  mpGrfFormatCollTable->DeleteAndDestroy(1, mpGrfFormatCollTable->size());
706  mpCharFormatTable->DeleteAndDestroy(1, mpCharFormatTable->size());
707 
709  {
710  // search the FrameFormat of the root frm. This is not allowed to delete
711  mpFrameFormatTable->erase( getIDocumentLayoutAccess().GetCurrentViewShell()->GetLayout()->GetFormat() );
712  mpFrameFormatTable->DeleteAndDestroyAll( true );
713  mpFrameFormatTable->push_back( getIDocumentLayoutAccess().GetCurrentViewShell()->GetLayout()->GetFormat() );
714  }
715  else
716  mpFrameFormatTable->DeleteAndDestroyAll( true );
717 
719 
720  delete mpNumberFormatter.load(); mpNumberFormatter= nullptr;
721 
723  pFirstNd->ChgFormatColl( getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_STANDARD ));
724  nDummyPgDsc = m_PageDescs.size();
725  m_PageDescs.push_back( pDummyPgDsc );
726  // set the layout back to the new standard pagedesc
727  pFirstNd->ResetAllAttr();
728  // delete now the dummy pagedesc
729  DelPageDesc( nDummyPgDsc );
730 }
731 
733 {
734  if( pNew )
735  {
736  if (m_pPgPViewPrtData)
737  {
738  *m_pPgPViewPrtData = *pNew;
739  }
740  else
741  {
742  m_pPgPViewPrtData.reset(new SwPagePreviewPrtData(*pNew));
743  }
744  }
745  else if (m_pPgPViewPrtData)
746  {
747  m_pPgPViewPrtData.reset();
748  }
750 }
751 
753 {
754  if( getIDocumentLayoutAccess().GetCurrentViewShell() ) maOLEModifiedIdle.Start();
755 }
756 
759 {
760  if( !mpLayoutCache )
761  mpLayoutCache.reset( new SwLayoutCache() );
762  if( !mpLayoutCache->IsLocked() )
763  {
764  mpLayoutCache->GetLockCount() |= 0x8000;
765  mpLayoutCache->Read( rStream );
766  mpLayoutCache->GetLockCount() &= 0x7fff;
767  }
768 }
769 
771 {
772  SwLayoutCache::Write( rStream, *this );
773 }
774 
776 {
777  const SwDoc* pDoc = rTextNode.GetDoc();
778  if( !pDoc || pDoc->IsInDtor() )
779  return nullptr;
780  return pDoc->getGrammarContact();
781 }
782 
785 {
786  // UGLY: this relies on SetClipBoard being called before GetXmlIdRegistry!
787  if (!m_pXmlIdRegistry)
788  {
790  }
791  return *m_pXmlIdRegistry;
792 }
793 
795 {
797  SwTOXType * pNew = new SwTOXType(TOX_CONTENT, pShellRes->aTOXContentName );
798  mpTOXTypes->emplace_back( pNew );
799  pNew = new SwTOXType(TOX_INDEX, pShellRes->aTOXIndexName );
800  mpTOXTypes->emplace_back( pNew );
801  pNew = new SwTOXType(TOX_USER, pShellRes->aTOXUserName );
802  mpTOXTypes->emplace_back( pNew );
803  pNew = new SwTOXType(TOX_ILLUSTRATIONS, pShellRes->aTOXIllustrationsName );
804  mpTOXTypes->emplace_back( pNew );
805  pNew = new SwTOXType(TOX_OBJECTS, pShellRes->aTOXObjectsName );
806  mpTOXTypes->emplace_back( pNew );
807  pNew = new SwTOXType(TOX_TABLES, pShellRes->aTOXTablesName );
808  mpTOXTypes->emplace_back( pNew );
809  pNew = new SwTOXType(TOX_AUTHORITIES, pShellRes->aTOXAuthoritiesName );
810  mpTOXTypes->emplace_back( pNew );
811  pNew = new SwTOXType(TOX_CITATION, pShellRes->aTOXCitationName );
812  mpTOXTypes->emplace_back( pNew );
813 }
814 
815 void SwDoc::ReplaceDefaults(const SwDoc& rSource)
816 {
817  // copy property defaults
818  const sal_uInt16 aRangeOfDefaults[] =
819  {
826  0
827  };
828 
829  SfxItemSet aNewDefaults(GetAttrPool(), aRangeOfDefaults);
830 
831  for (auto nRange = 0; aRangeOfDefaults[nRange] != 0; nRange += 2)
832  {
833  for (sal_uInt16 nWhich = aRangeOfDefaults[nRange];
834  nWhich <= aRangeOfDefaults[nRange + 1]; ++nWhich)
835  {
836  const SfxPoolItem& rSourceAttr =
837  rSource.mpAttrPool->GetDefaultItem(nWhich);
838  if (rSourceAttr != mpAttrPool->GetDefaultItem(nWhich))
839  aNewDefaults.Put(rSourceAttr);
840  }
841  }
842 
843  if (aNewDefaults.Count())
844  SetDefault(aNewDefaults);
845 }
846 
848 {
849  m_pDocumentSettingManager->ReplaceCompatibilityOptions(rSource.GetDocumentSettingManager());
850 }
851 
852 #ifdef DBG_UTIL
853 #define CNTNT_DOC( doc ) \
854  ((doc)->GetNodes().GetEndOfContent().GetIndex() - (doc)->GetNodes().GetEndOfExtras().GetIndex() - 2)
855 #define CNTNT_IDX( idx ) \
856  ((idx).GetNode().GetIndex() - GetNodes().GetEndOfExtras().GetIndex() - 1)
857 #endif
858 
859 SfxObjectShell* SwDoc::CreateCopy( bool bCallInitNew, bool bEmpty ) const
860 {
861  SAL_INFO( "sw.pageframe", "(SwDoc::CreateCopy in" );
862  rtl::Reference<SwDoc> xRet( new SwDoc );
863 
864  // we have to use pointer here, since the callee has to decide whether
865  // SfxObjectShellLock or SfxObjectShellRef should be used sometimes the
866  // object will be returned with refcount set to 0 ( if no DoInitNew is done )
867  SfxObjectShell* pRetShell = new SwDocShell( xRet.get(), SfxObjectCreateMode::STANDARD );
868  if( bCallInitNew )
869  {
870  // it could happen that DoInitNew creates model,
871  // that increases the refcount of the object
872  pRetShell->DoInitNew();
873  }
874 
875  xRet->ReplaceDefaults(*this);
876 
877  xRet->ReplaceCompatibilityOptions(*this);
878 
879  xRet->ReplaceStyles(*this);
880 
881  if( !bEmpty )
882  {
883 #ifdef DBG_UTIL
884  SAL_INFO( "sw.createcopy", "CC-Nd-Src: " << CNTNT_DOC( this ) );
885  SAL_INFO( "sw.createcopy", "CC-Nd: " << CNTNT_DOC( xRet ) );
886 #endif
887  xRet->AppendDoc(*this, 0, bCallInitNew, 0, 0);
888 #ifdef DBG_UTIL
889  SAL_INFO( "sw.createcopy", "CC-Nd: " << CNTNT_DOC( xRet ) );
890 #endif
891  }
892 
893  // remove the temporary shell if it is there as it was done before
894  xRet->SetTmpDocShell( nullptr );
895 
896  SAL_INFO( "sw.pageframe", "SwDoc::CreateCopy out)" );
897  return pRetShell;
898 }
899 
900 // save bulk letters as single documents
901 static OUString lcl_FindUniqueName(SwWrtShell* pTargetShell, const OUString& rStartingPageDesc, sal_uLong nDocNo )
902 {
903  do
904  {
905  OUString sTest = rStartingPageDesc + OUString::number( nDocNo );
906  if( !pTargetShell->FindPageDescByName( sTest ) )
907  return sTest;
908  ++nDocNo;
909  }
910  while( true );
911 }
912 
916 {
917  // remember already checked page descs to avoid cycle
918  std::unordered_set<const SwPageDesc*> aCheckedPageDescs;
919  const SwPageDesc* pCurPageDesc = &rPageDesc;
920  while (aCheckedPageDescs.count(pCurPageDesc) == 0)
921  {
922  const SwFrameFormat& rMaster = pCurPageDesc->GetMaster();
923  if (rMaster.GetHeader().IsActive() || rMaster.GetFooter().IsActive())
924  return true;
925 
926  aCheckedPageDescs.insert(pCurPageDesc);
927  pCurPageDesc = pCurPageDesc->GetFollow();
928  }
929  return false;
930 }
931 
933  SwWrtShell& rTargetShell,
934  const SwPageDesc& rSourcePageDesc,
935  const SwPageDesc& rTargetPageDesc,
936  const sal_uLong nDocNo )
937 {
938  //now copy the follow page desc, too
939  // note: these may at any point form a cycle, so a loop is needed and it
940  // must be detected that the last iteration closes the cycle and doesn't
941  // copy the first page desc of the cycle again.
942  std::map<OUString, OUString> followMap{ { rSourcePageDesc.GetName(), rTargetPageDesc.GetName() } };
943  SwPageDesc const* pCurSourcePageDesc(&rSourcePageDesc);
944  SwPageDesc const* pCurTargetPageDesc(&rTargetPageDesc);
945  do
946  {
947  const SwPageDesc* pFollowPageDesc = pCurSourcePageDesc->GetFollow();
948  OUString sFollowPageDesc = pFollowPageDesc->GetName();
949  if (sFollowPageDesc == pCurSourcePageDesc->GetName())
950  {
951  break;
952  }
953  SwDoc* pTargetDoc = rTargetShell.GetDoc();
954  SwPageDesc* pTargetFollowPageDesc(nullptr);
955  auto const itMapped(followMap.find(sFollowPageDesc));
956  if (itMapped == followMap.end())
957  {
958  OUString sNewFollowPageDesc = lcl_FindUniqueName(&rTargetShell, sFollowPageDesc, nDocNo);
959  pTargetFollowPageDesc = pTargetDoc->MakePageDesc(sNewFollowPageDesc);
960  pTargetDoc->CopyPageDesc(*pFollowPageDesc, *pTargetFollowPageDesc, false);
961  }
962  else
963  {
964  pTargetFollowPageDesc = pTargetDoc->FindPageDesc(itMapped->second);
965  }
966  SwPageDesc aDesc(*pCurTargetPageDesc);
967  aDesc.SetFollow(pTargetFollowPageDesc);
968  pTargetDoc->ChgPageDesc(pCurTargetPageDesc->GetName(), aDesc);
969  if (itMapped != followMap.end())
970  {
971  break; // was already copied
972  }
973  pCurSourcePageDesc = pCurSourcePageDesc->GetFollow();
974  pCurTargetPageDesc = pTargetFollowPageDesc;
975  followMap[pCurSourcePageDesc->GetName()] = pCurTargetPageDesc->GetName();
976  }
977  while (true);
978 }
979 
980 // appends all pages of source SwDoc - based on SwFEShell::Paste( SwDoc* )
981 SwNodeIndex SwDoc::AppendDoc(const SwDoc& rSource, sal_uInt16 const nStartPageNumber,
982  bool const bDeletePrevious, int pageOffset, const sal_uLong nDocNo)
983 {
984  SAL_INFO( "sw.pageframe", "(SwDoc::AppendDoc in " << bDeletePrevious );
985 
986  // GetEndOfExtras + 1 = StartOfContent == no content node!
987  // This ensures it won't be merged in the SwTextNode at the position.
988  SwNodeIndex aSourceIdx( rSource.GetNodes().GetEndOfExtras(), 1 );
989  // CopyRange works on the range a [mark, point[ and considers an
990  // index < point outside the selection.
991  // @see IDocumentContentOperations::CopyRange
992  SwNodeIndex aSourceEndIdx( rSource.GetNodes().GetEndOfContent(), 0 );
993  SwPaM aCpyPam( aSourceIdx, aSourceEndIdx );
994 
995 #ifdef DBG_UTIL
996  SAL_INFO( "sw.docappend", "NodeType 0x" << std::hex << static_cast<int>(aSourceIdx.GetNode().GetNodeType())
997  << std::dec << " " << aSourceIdx.GetNode().GetIndex() );
998  aSourceIdx++;
999  SAL_INFO( "sw.docappend", "NodeType 0x" << std::hex << static_cast<int>(aSourceIdx.GetNode().GetNodeType())
1000  << std::dec << " " << aSourceIdx.GetNode().GetIndex() );
1001  if ( aSourceIdx.GetNode().GetNodeType() != SwNodeType::End ) {
1002  aSourceIdx++;
1003  SAL_INFO( "sw.docappend", "NodeType 0x" << std::hex << static_cast<int>(aSourceIdx.GetNode().GetNodeType()) << std::dec );
1004  aSourceIdx--;
1005  }
1006  aSourceIdx--;
1007  SAL_INFO( "sw.docappend", ".." );
1008  SAL_INFO( "sw.docappend", "NodeType 0x" << std::hex << static_cast<int>(aSourceEndIdx.GetNode().GetNodeType())
1009  << std::dec << " " << aSourceEndIdx.GetNode().GetIndex() );
1010  SAL_INFO( "sw.docappend", "NodeType 0x" << std::hex << static_cast<int>(aSourceEndIdx.GetNode().GetNodeType())
1011  << std::dec << " " << aSourceEndIdx.GetNode().GetIndex() );
1012  SAL_INFO( "sw.docappend", "Src-Nd: " << CNTNT_DOC( &rSource ) );
1013  SAL_INFO( "sw.docappend", "Nd: " << CNTNT_DOC( this ) );
1014 #endif
1015 
1016  SwWrtShell* pTargetShell = GetDocShell()->GetWrtShell();
1017  SwPageDesc* pTargetPageDesc = nullptr;
1018 
1019  if ( pTargetShell ) {
1020 #ifdef DBG_UTIL
1021  SAL_INFO( "sw.docappend", "Has target write shell" );
1022 #endif
1023  pTargetShell->StartAllAction();
1024 
1025  if( nDocNo > 0 )
1026  {
1027  // #i72517# put the styles to the target document
1028  // if the source uses headers or footers the target document
1029  // needs inidividual page styles
1030  const SwWrtShell *pSourceShell = rSource.GetDocShell()->GetWrtShell();
1031  const SwPageDesc& rSourcePageDesc = pSourceShell->GetPageDesc(
1032  pSourceShell->GetCurPageDesc());
1033  const OUString sStartingPageDesc = rSourcePageDesc.GetName();
1034  const bool bPageStylesWithHeaderFooter = lcl_PageDescOrFollowContainsHeaderFooter(rSourcePageDesc);
1035  if( bPageStylesWithHeaderFooter )
1036  {
1037  // create a new pagestyle
1038  // copy the pagedesc from the current document to the new
1039  // document and change the name of the to-be-applied style
1040  OUString sNewPageDescName = lcl_FindUniqueName(pTargetShell, sStartingPageDesc, nDocNo );
1041  pTargetPageDesc = MakePageDesc( sNewPageDescName );
1042  if( pTargetPageDesc )
1043  {
1044  CopyPageDesc( rSourcePageDesc, *pTargetPageDesc, false );
1045  lcl_CopyFollowPageDesc( *pTargetShell, rSourcePageDesc, *pTargetPageDesc, nDocNo );
1046  }
1047  }
1048  else
1049  pTargetPageDesc = pTargetShell->FindPageDescByName( sStartingPageDesc );
1050  }
1051 
1052  // Otherwise we have to handle SwPlaceholderNodes as first node
1053  if ( pTargetPageDesc )
1054  {
1055  SwNodeIndex aBreakIdx( GetNodes().GetEndOfContent(), -1 );
1056  SwPosition aBreakPos( aBreakIdx );
1057  // InsertPageBreak just works on SwTextNode nodes, so make
1058  // sure the last node is one!
1059  bool bIsTextNode = aBreakIdx.GetNode().IsTextNode();
1060  if ( !bIsTextNode )
1062  const OUString name = pTargetPageDesc->GetName();
1063  pTargetShell->InsertPageBreak( &name, nStartPageNumber );
1064  if ( !bIsTextNode )
1065  {
1066  pTargetShell->SttEndDoc( false );
1067  --aBreakIdx;
1068  GetNodes().Delete( aBreakIdx );
1069  }
1070 
1071  // There is now a new empty text node on the new page. If it has
1072  // any marks, those are from the previous page: move them back
1073  // there, otherwise later we can't delete that empty text node.
1074  SwNodeIndex aNodeIndex(GetNodes().GetEndOfContent(), -1);
1075  if (SwTextNode* pTextNode = aNodeIndex.GetNode().GetTextNode())
1076  {
1077  // Position of the last paragraph on the previous page.
1078  --aNodeIndex;
1079  SwPaM aPaM(aNodeIndex);
1080  // Collect the marks starting or ending at this text node.
1083  for (const SwIndex* pIndex = pTextNode->GetFirstIndex(); pIndex; pIndex = pIndex->GetNext())
1084  {
1085  sw::mark::IMark* pMark = const_cast<sw::mark::IMark*>(pIndex->GetMark());
1086  if (!pMark)
1087  continue;
1088  if (!aSeenMarks.insert(pMark).second)
1089  continue;
1090  }
1091  // And move them back.
1092  for (sw::mark::IMark* pMark : aSeenMarks)
1093  pMarkAccess->repositionMark(pMark, aPaM);
1094  }
1095 
1096  // Flush the page break, if we want to keep it
1097  if ( !bDeletePrevious )
1098  {
1099  SAL_INFO( "sw.pageframe", "(Flush pagebreak AKA EndAllAction" );
1100  pTargetShell->EndAllAction();
1101  SAL_INFO( "sw.pageframe", "Flush changes AKA EndAllAction)" );
1102  pTargetShell->StartAllAction();
1103  }
1104  }
1105  }
1106 #ifdef DBG_UTIL
1107  SAL_INFO( "sw.docappend", "Nd: " << CNTNT_DOC( this ) );
1108 #endif
1109 
1110  // -1, otherwise aFixupIdx would move to new EOC
1111  SwNodeIndex aFixupIdx( GetNodes().GetEndOfContent(), -1 );
1112 
1113  // append at the end of document / content
1114  SwNodeIndex aTargetIdx( GetNodes().GetEndOfContent() );
1115  SwPaM aInsertPam( aTargetIdx );
1116 
1117 #ifdef DBG_UTIL
1118  SAL_INFO( "sw.docappend", "Pam-Nd: " << aCpyPam.GetNode().GetIndex() - aCpyPam.GetNode( false ).GetIndex() + 1
1119  << " (0x" << std::hex << static_cast<int>(aCpyPam.GetNode( false ).GetNodeType()) << std::dec
1120  << " " << aCpyPam.GetNode( false ).GetIndex()
1121  << " - 0x" << std::hex << static_cast<int>(aCpyPam.GetNode().GetNodeType()) << std::dec
1122  << " " << aCpyPam.GetNode().GetIndex() << ")" );
1123 #endif
1124 
1127 
1128  // Position where the appended doc starts. Will be filled in later.
1129  // Initially uses GetEndOfContent() because SwNodeIndex has no default ctor.
1130  SwNodeIndex aStartAppendIndex( GetNodes().GetEndOfContent() );
1131 
1132  {
1133  // **
1134  // ** refer to SwFEShell::Paste, if you change the following code **
1135  // **
1136 
1137  SwPosition& rInsPos = *aInsertPam.GetPoint();
1138 
1139  {
1140  SwNodeIndex aIndexBefore(rInsPos.nNode);
1141 
1142  aIndexBefore--;
1143 #ifdef DBG_UTIL
1144  SAL_INFO( "sw.docappend", "CopyRange In: " << CNTNT_DOC( this ) );
1145 #endif
1146  rSource.getIDocumentContentOperations().CopyRange( aCpyPam, rInsPos, /*bCopyAll=*/true, /*bCheckPos=*/true, /*bCopyText=*/false );
1147  // Note: aCpyPam is invalid now
1148 #ifdef DBG_UTIL
1149  SAL_INFO( "sw.docappend", "CopyRange Out: " << CNTNT_DOC( this ) );
1150 #endif
1151 
1152  ++aIndexBefore;
1153  SwPaM aPaM(SwPosition(aIndexBefore),
1154  SwPosition(rInsPos.nNode));
1155 
1156  aPaM.GetDoc()->MakeUniqueNumRules(aPaM);
1157 
1158  // Update the rsid of each pasted text node
1159  SwNodes &rDestNodes = GetNodes();
1160  sal_uLong const nEndIdx = aPaM.End()->nNode.GetIndex();
1161 
1162  for (sal_uLong nIdx = aPaM.Start()->nNode.GetIndex();
1163  nIdx <= nEndIdx; ++nIdx)
1164  {
1165  SwTextNode *const pTextNode = rDestNodes[nIdx]->GetTextNode();
1166  if ( pTextNode )
1167  UpdateParRsid( pTextNode );
1168  }
1169  }
1170 
1171  {
1172  sal_uLong iDelNodes = 0;
1173  SwNodeIndex aDelIdx( aFixupIdx );
1174 
1175  // we just need to set the new page description and reset numbering
1176  // this keeps all other settings as in the pasted document
1177  if ( nStartPageNumber || pTargetPageDesc ) {
1178  std::unique_ptr<SfxPoolItem> pNewItem;
1179  SwTextNode *aTextNd = nullptr;
1180  SwFormat *pFormat = nullptr;
1181 
1182  // find the first node allowed to contain a RES_PAGEDESC
1183  while (true) {
1184  aFixupIdx++;
1185 
1186  SwNode &node = aFixupIdx.GetNode();
1187  if ( node.IsTextNode() ) {
1188  // every document contains at least one text node!
1189  aTextNd = node.GetTextNode();
1190  pNewItem.reset(aTextNd->GetAttr( RES_PAGEDESC ).Clone());
1191  break;
1192  }
1193  else if ( node.IsTableNode() ) {
1194  pFormat = node.GetTableNode()->GetTable().GetFrameFormat();
1195  pNewItem.reset(pFormat->GetFormatAttr( RES_PAGEDESC ).Clone());
1196  break;
1197  }
1198  }
1199 
1200 #ifdef DBG_UTIL
1201  SAL_INFO( "sw.docappend", "Idx Del " << CNTNT_IDX( aDelIdx ) );
1202  SAL_INFO( "sw.docappend", "Idx Fix " << CNTNT_IDX( aFixupIdx ) );
1203 #endif
1204  // just update the original instead of overwriting
1205  SwFormatPageDesc *aDesc = static_cast< SwFormatPageDesc* >( pNewItem.get() );
1206 #ifdef DBG_UTIL
1207  if ( aDesc->GetPageDesc() )
1208  SAL_INFO( "sw.docappend", "PD Update " << aDesc->GetPageDesc()->GetName() );
1209  else
1210  SAL_INFO( "sw.docappend", "PD New" );
1211 #endif
1212  if ( nStartPageNumber )
1213  aDesc->SetNumOffset( nStartPageNumber );
1214  if ( pTargetPageDesc )
1215  aDesc->RegisterToPageDesc( *pTargetPageDesc );
1216  if ( aTextNd )
1217  aTextNd->SetAttr( *aDesc );
1218  else
1219  pFormat->SetFormatAttr( *aDesc );
1220 
1221 #ifdef DBG_UTIL
1222  SAL_INFO( "sw.docappend", "Idx " << CNTNT_IDX( aDelIdx ) );
1223 #endif
1224  iDelNodes++;
1225  }
1226 
1227  if ( bDeletePrevious )
1228  iDelNodes++;
1229 
1230  if ( iDelNodes ) {
1231  // delete leading empty page(s), e.g. from InsertPageBreak or
1232  // new SwDoc. this has to be done before copying the page bound
1233  // frames, otherwise the drawing layer gets confused.
1234  if ( pTargetShell )
1235  pTargetShell->SttEndDoc( false );
1236  aDelIdx -= iDelNodes - 1;
1237 #ifdef DBG_UTIL
1238  SAL_INFO( "sw.docappend", "iDelNodes: " << iDelNodes
1239  << " Idx: " << aDelIdx.GetNode().GetIndex()
1240  << " EOE: " << GetNodes().GetEndOfExtras().GetIndex() );
1241 #endif
1242  GetNodes().Delete( aDelIdx, iDelNodes );
1243  aStartAppendIndex = aFixupIdx;
1244  }
1245  else
1246  {
1247  aStartAppendIndex = aFixupIdx;
1248  ++aStartAppendIndex;
1249  }
1250  }
1251 
1252  // finally copy page bound frames
1253  for ( auto pCpyFormat : *rSource.GetSpzFrameFormats() )
1254  {
1255  const SwFrameFormat& rCpyFormat = *pCpyFormat;
1256  SwFormatAnchor aAnchor( rCpyFormat.GetAnchor() );
1257  if (RndStdIds::FLY_AT_PAGE != aAnchor.GetAnchorId())
1258  continue;
1259  SAL_INFO( "sw.docappend", "PaAn: " << aAnchor.GetPageNum()
1260  << " => " << aAnchor.GetPageNum() + pageOffset );
1261  if ( pageOffset != 0 )
1262  aAnchor.SetPageNum( aAnchor.GetPageNum() + pageOffset );
1263  getIDocumentLayoutAccess().CopyLayoutFormat( rCpyFormat, aAnchor, true, true );
1264  }
1265  }
1266 
1268 
1271 
1272  if ( pTargetShell )
1273  pTargetShell->EndAllAction();
1274 
1275  SAL_INFO( "sw.pageframe", "SwDoc::AppendDoc out)" );
1276  return aStartAppendIndex;
1277 }
1278 
1279 /* 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:603
::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:981
SwPageDescs m_PageDescs
Definition: doc.hxx:195
sal_uLong GetIndex() const
Definition: node.hxx:282
sal_uLong Count() const
Definition: ndarr.hxx:142
bool bVisible
Represents the style of a paragraph.
Definition: fmtcol.hxx:55
std::unique_ptr< SwDefTOXBase_Impl > mpDefTOXBases
Definition: doc.hxx: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
bool UpdateParRsid(SwTextNode *pTextNode, sal_uInt32 nVal=0)
Definition: docfmt.cxx:432
void SetOLEObjModified()
update all modified OLE-Objects.
Definition: docnew.cxx:752
SwPageDesc * GetPageDesc()
Definition: fmtpdsc.hxx:62
const SwFormatHeader & GetHeader(bool=true) const
Definition: fmthdft.hxx:97
static ShellResource * GetShellRes()
Definition: viewsh.cxx:2480
IGrammarContact * getGrammarContact() const
Definition: doc.hxx:1545
bool SttEndDoc(bool bStt)
Definition: crsrsh.cxx:566
virtual sal_uInt16 ResetAllAttr() override
Definition: ndtxt.cxx:5141
SwDocShell * GetDocShell()
Definition: doc.hxx:1346
virtual bool SetAttr(const SfxPoolItem &) override
overriding to handle change of certain paragraph attributes
Definition: ndtxt.cxx:4883
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:915
#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:331
sal_Int64 n
virtual SwUndoId EndUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Closes undo block.
Provides access to the marks of a document.
Definition: doc.hxx: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:86
SwNode & GetNode() const
Definition: ndindex.hxx:119
Content, content of frame (header, footer, fly).
Definition: fmtcntnt.hxx:31
#define RES_PARATR_LIST_END
Definition: hintids.hxx:285
virtual bool CopyRange(SwPaM &rPam, SwPosition &rPos, const bool bCopyAll, bool bCheckPos, bool bCopyText) const =0
Copy a selected content range to a position.
void ReplaceCompatibilityOptions(const SwDoc &rSource)
Definition: docnew.cxx:847
IDocumentMarkAccess * getIDocumentMarkAccess()
Definition: docbm.cxx:1625
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:365
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:314
void SetPageNum(sal_uInt16 nNew)
Definition: fmtanchr.hxx:72
void EndAllAction()
Definition: edws.cxx:96
SwTableFormat * GetFrameFormat()
Definition: swtable.hxx:201
const SwFrameFormats * GetSpzFrameFormats() const
Definition: doc.hxx:738
void SetNewContentIdx(const SwNodeIndex *pIdx)
Definition: atrfrm.cxx:555
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:1065
IGrammarContact * getGrammarContact(const SwTextNode &rTextNode)
getGrammarContact() delivers the grammar contact of the document (for a given textnode) ...
Definition: docnew.cxx:775
#define RES_CHRATR_END
Definition: hintids.hxx:208
SwTableNode * GetTableNode()
Definition: node.hxx:599
std::unique_ptr< SwFrameFormats > mpTableFrameFormatTable
Definition: doc.hxx:241
void cleanupUnoCursorTable() const
Definition: doc.hxx:1633
void ReplaceDefaults(const SwDoc &rSource)
Definition: docnew.cxx:815
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:758
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:784
#define RES_UL_SPACE
Definition: hintids.hxx:292
std::unique_ptr< SwFrameFormats > mpSpzFrameFormatTable
Definition: doc.hxx:239
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:1316
SwDoc * GetDoc() const
Definition: viewsh.hxx:284
void SetUndoManager(SfxUndoManager *pNewUndoMgr)
#define RES_PARATR_BEGIN
Definition: hintids.hxx:254
bool mbDtor
TRUE: is in SwDoc DTOR.
Definition: doc.hxx:296
void InitTOXTypes()
Definition: docnew.cxx:794
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).
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:2918
Base class for various Writer styles.
Definition: format.hxx:43
void SetDebugName(const char *pDebugName)
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
Definition: ndarr.hxx:163
SwDBData maDBData
Definition: doc.hxx: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:732
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:32
std::vector< std::weak_ptr< SwUnoCursor > > mvUnoCursorTable
Definition: doc.hxx:1630
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:932
bool IsVisible() const
SfxObjectShell * CreateCopy(bool bCallInitNew, bool bEmpty) const
Definition: docnew.cxx:859
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
void SetNumOffset(const ::o3tl::optional< sal_uInt16 > &oNum)
Definition: fmtpdsc.hxx:66
Marks a character position inside a document model node.
Definition: index.hxx:37
virtual SwFormatColl * ChgFormatColl(SwFormatColl *) override
Definition: ndtxt.cxx:3920
#define RES_CHRATR_BEGIN
Definition: hintids.hxx:162
const SwFormatFooter & GetFooter(bool=true) const
Definition: fmthdft.hxx:99
css::uno::Reference< css::linguistic2::XProofreadingIterator > m_xGCIterator
Definition: doc.hxx: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:770
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:361
void SetCountPhantoms(bool bCountPhantoms)
Definition: number.cxx:994
std::unique_ptr< SwGrfFormatColls > mpGrfFormatCollTable
Definition: doc.hxx:243
void SetDocShell(SwDocShell *pDSh)
Definition: docnew.cxx:578
OUString const aTOXTablesName
Definition: shellres.hxx:57
#define RES_PARATR_LIST_BEGIN
Definition: hintids.hxx:278
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
std::unique_ptr< SwFrameFormat > mpEmptyPageFormat
Definition: doc.hxx:231
Frame cannot be moved in Var-direction.
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:404
const SwPosition * Start() const
Definition: pam.hxx:212
static void lcl_DelFormatIndices(SwFormat const *pFormat)
Definition: docnew.cxx:175
< purpose of derivation from SwClient: character style for displaying the numbers.
Definition: lineinfo.hxx:37
#define RES_LR_SPACE
Definition: hintids.hxx:291
css::uno::Reference< css::linguistic2::XProofreadingIterator > const & GetGCIterator() const
Definition: docnew.cxx: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:1391
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:133
void ClearDoc()
Definition: docnew.cxx:617
#define SAL_INFO(area, stream)
std::unique_ptr< SwCharFormats > mpCharFormatTable
Definition: doc.hxx:238
bool IsClipBoard() const
Definition: doc.hxx:960
bool DoInitNew(SfxMedium *pMedium=nullptr)
SwNodes & GetNodes()
Definition: doc.hxx:403
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:612
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:855
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
void InsertPageBreak(const OUString *pPageDesc=nullptr, const ::o3tl::optional< sal_uInt16 > &rPgNum=o3tl::nullopt)
Definition: wrtsh1.cxx:870
#define CNTNT_DOC(doc)
Definition: docnew.cxx:853
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:398
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:363
#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:293
SwNode & GetEndOfExtras() const
This is the last EndNode of a special section.
Definition: ndarr.hxx:161
::sw::DocumentFieldsManager & GetDocumentFieldsManager()
Definition: doc.cxx:366
void StartAllAction()
For all views of this document.
Definition: edws.cxx:85
std::unique_ptr< SwFootnoteInfo > mpFootnoteInfo
Definition: doc.hxx:252
void RegisterToPageDesc(SwPageDesc &)
Definition: atrfrm.cxx:660
IDocumentListsAccess const & getIDocumentListsAccess() const
Definition: doc.cxx:292
size_t GetCurPageDesc(const bool bCalcFrame=true) const
Definition: fedesc.cxx:166
bool IsTextNode() const
Definition: node.hxx:636
Standard page.
Definition: poolfmt.hxx:171
void SetPersist(SfxObjectShell *p)
#define RES_FRMATR_BEGIN
Definition: hintids.hxx:287
static OUString lcl_FindUniqueName(SwWrtShell *pTargetShell, const OUString &rStartingPageDesc, sal_uLong nDocNo)
Definition: docnew.cxx:901
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:1313
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:274
SwTextNode * MakeTextNode(const SwNodeIndex &rWhere, SwTextFormatColl *pColl, bool bNewFrames=true)
Implementations of "Make...Node" are in the given .cxx-files.
Definition: ndtxt.cxx:103
void SetAnchor(const SwPosition *pPos)
Definition: atrfrm.cxx:1477
MissingDictionary
Definition: doc.hxx:317
virtual void ResetModified()=0
Base class of the Writer document model elements.
Definition: node.hxx:79