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