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