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