LibreOffice Module sw (master) 1
newfrm.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 <o3tl/safeint.hxx>
23#include <svx/svdpage.hxx>
24#include <osl/diagnose.h>
25#include <drawdoc.hxx>
26#include <fmtpdsc.hxx>
27#include <swtable.hxx>
28#include <rootfrm.hxx>
29#include <pagefrm.hxx>
30#include <dflyobj.hxx>
31#include <frmtool.hxx>
32#include "virtoutp.hxx"
33#include <notxtfrm.hxx>
34#include <pagedesc.hxx>
35#include <viewimp.hxx>
36#include <hints.hxx>
37#include <viewopt.hxx>
38#include <set>
44#include <ndindex.hxx>
45
47bool SwRootFrame::s_isInPaint = false;
48bool SwRootFrame::s_isNoVirDev = false;
50
51SwCache *SwFrame::spCache = nullptr;
52
54 { return nFirst - nSecond; }
56 { return nSecond - nFirst; }
58 { return nA + nAdd; }
60 { return nA - nSub; }
61
63 /*.fnGetTop =*/&SwRect::Top_,
64 /*.fnGetBottom =*/&SwRect::Bottom_,
65 /*.fnGetLeft =*/&SwRect::Left_,
66 /*.fnGetRight =*/&SwRect::Right_,
67 /*.fnGetWidth =*/&SwRect::Width_,
68 /*.fnGetHeight =*/&SwRect::Height_,
69 /*.fnGetPos =*/&SwRect::TopLeft,
70 /*.fnGetSize =*/&SwRect::Size_,
71
72 /*.fnSetTop =*/&SwRect::Top_,
73 /*.fnSetBottom =*/&SwRect::Bottom_,
74 /*.fnSetLeft =*/&SwRect::Left_,
75 /*.fnSetRight =*/&SwRect::Right_,
76 /*.fnSetWidth =*/&SwRect::Width_,
77 /*.fnSetHeight =*/&SwRect::Height_,
78
79 /*.fnSubTop =*/&SwRect::SubTop,
80 /*.fnAddBottom =*/&SwRect::AddBottom,
81 /*.fnSubLeft =*/&SwRect::SubLeft,
82 /*.fnAddRight =*/&SwRect::AddRight,
83 /*.fnAddWidth =*/&SwRect::AddWidth,
84 /*.fnAddHeight =*/&SwRect::AddHeight,
85
86 /*.fnSetPosX =*/&SwRect::SetPosX,
87 /*.fnSetPosY =*/&SwRect::SetPosY,
88
89 /*.fnGetTopMargin =*/&SwFrame::GetTopMargin,
90 /*.fnGetBottomMargin =*/&SwFrame::GetBottomMargin,
91 /*.fnGetLeftMargin =*/&SwFrame::GetLeftMargin,
92 /*.fnGetRightMargin =*/&SwFrame::GetRightMargin,
93 /*.fnSetXMargins =*/&SwFrame::SetLeftRightMargins,
94 /*.fnSetYMargins =*/&SwFrame::SetTopBottomMargins,
95 /*.fnGetPrtTop =*/&SwFrame::GetPrtTop,
96 /*.fnGetPrtBottom =*/&SwFrame::GetPrtBottom,
97 /*.fnGetPrtLeft =*/&SwFrame::GetPrtLeft,
98 /*.fnGetPrtRight =*/&SwFrame::GetPrtRight,
99 /*.fnTopDist =*/&SwRect::GetTopDistance,
100 /*.fnBottomDist =*/&SwRect::GetBottomDistance,
101 /*.fnLeftDist =*/&SwRect::GetLeftDistance,
102 /*.fnRightDist =*/&SwRect::GetRightDistance,
103 /*.fnSetLimit =*/&SwFrame::SetMaxBottom,
104 /*.fnOverStep =*/&SwRect::OverStepBottom,
105
106 /*.fnSetPos =*/&SwRect::SetUpperLeftCorner,
107 /*.fnMakePos =*/&SwFrame::MakeBelowPos,
108 /*.fnXDiff =*/&FirstMinusSecond,
109 /*.fnYDiff =*/&FirstMinusSecond,
110 /*.fnXInc =*/&SwIncrement,
111 /*.fnYInc =*/&o3tl::saturating_add<tools::Long>,
112
113 /*.fnSetLeftAndWidth =*/&SwRect::SetLeftAndWidth,
114 /*.fnSetTopAndHeight =*/&SwRect::SetTopAndHeight
115};
116
118 /*.fnGetTop =*/&SwRect::Right_,
119 /*.fnGetBottom =*/&SwRect::Left_,
120 /*.fnGetLeft =*/&SwRect::Top_,
121 /*.fnGetRight =*/&SwRect::Bottom_,
122 /*.fnGetWidth =*/&SwRect::Height_,
123 /*.fnGetHeight =*/&SwRect::Width_,
124 /*.fnGetPos =*/&SwRect::TopRight,
125 /*.fnGetSize =*/&SwRect::SwappedSize,
126
127 /*.fnSetTop =*/&SwRect::Right_,
128 /*.fnSetBottom =*/&SwRect::Left_,
129 /*.fnSetLeft =*/&SwRect::Top_,
130 /*.fnSetRight =*/&SwRect::Bottom_,
131 /*.fnSetWidth =*/&SwRect::Height_,
132 /*.fnSetHeight =*/&SwRect::Width_,
133
134 /*.fnSubTop =*/&SwRect::AddRight,
135 /*.fnAddBottom =*/&SwRect::SubLeft,
136 /*.fnSubLeft =*/&SwRect::SubTop,
137 /*.fnAddRight =*/&SwRect::AddBottom,
138 /*.fnAddWidth =*/&SwRect::AddHeight,
139 /*.fnAddHeight =*/&SwRect::AddWidth,
140
141 /*.fnSetPosX =*/&SwRect::SetPosY,
142 /*.fnSetPosY =*/&SwRect::SetPosX,
143
144 /*.fnGetTopMargin =*/&SwFrame::GetRightMargin,
145 /*.fnGetBottomMargin =*/&SwFrame::GetLeftMargin,
146 /*.fnGetLeftMargin =*/&SwFrame::GetTopMargin,
147 /*.fnGetRightMargin =*/&SwFrame::GetBottomMargin,
148 /*.fnSetXMargins =*/&SwFrame::SetTopBottomMargins,
149 /*.fnSetYMargins =*/&SwFrame::SetRightLeftMargins,
150 /*.fnGetPrtTop =*/&SwFrame::GetPrtRight,
151 /*.fnGetPrtBottom =*/&SwFrame::GetPrtLeft,
152 /*.fnGetPrtLeft =*/&SwFrame::GetPrtTop,
153 /*.fnGetPrtRight =*/&SwFrame::GetPrtBottom,
154 /*.fnTopDist =*/&SwRect::GetRightDistance,
155 /*.fnBottomDist =*/&SwRect::GetLeftDistance,
156 /*.fnLeftDist =*/&SwRect::GetTopDistance,
157 /*.fnRightDist =*/&SwRect::GetBottomDistance,
158 /*.fnSetLimit =*/&SwFrame::SetMinLeft,
159 /*.fnOverStep =*/&SwRect::OverStepLeft,
160
161 /*.fnSetPos =*/&SwRect::SetUpperRightCorner,
162 /*.fnMakePos =*/&SwFrame::MakeLeftPos,
163 /*.fnXDiff =*/&FirstMinusSecond,
164 /*.fnYDiff =*/&SecondMinusFirst,
165 /*.fnXInc =*/&SwIncrement,
166 /*.fnYInc =*/&SwDecrement,
168 /*.fnSetLeftAndWidth =*/&SwRect::SetTopAndHeight,
169 /*.fnSetTopAndHeight =*/&SwRect::SetRightAndWidth
170};
171
173 /*.fnGetTop =*/&SwRect::Left_,
174 /*.fnGetBottom =*/&SwRect::Right_,
175 /*.fnGetLeft =*/&SwRect::Top_,
176 /*.fnGetRight =*/&SwRect::Bottom_,
177 /*.fnGetWidth =*/&SwRect::Height_,
178 /*.fnGetHeight =*/&SwRect::Width_,
179 /*.fnGetPos =*/&SwRect::TopLeft,
180 /*.fnGetSize =*/&SwRect::SwappedSize,
181
182 /*.fnSetTop =*/&SwRect::Left_,
183 /*.fnSetBottom =*/&SwRect::Right_,
184 /*.fnSetLeft =*/&SwRect::Top_,
185 /*.fnSetRight =*/&SwRect::Bottom_,
186 /*.fnSetWidth =*/&SwRect::Height_,
187 /*.fnSetHeight =*/&SwRect::Width_,
188
189 /*.fnSubTop =*/&SwRect::SubLeft,
190 /*.fnAddBottom =*/&SwRect::AddRight,
191 /*.fnSubLeft =*/&SwRect::SubTop,
192 /*.fnAddRight =*/&SwRect::AddBottom,
193 /*.fnAddWidth =*/&SwRect::AddHeight,
194 /*.fnAddHeight =*/&SwRect::AddWidth,
195
196 /*.fnSetPosX =*/&SwRect::SetPosY,
197 /*.fnSetPosY =*/&SwRect::SetPosX,
198
199 /*.fnGetTopMargin =*/&SwFrame::GetLeftMargin,
200 /*.fnGetBottomMargin =*/&SwFrame::GetRightMargin,
201 /*.fnGetLeftMargin =*/&SwFrame::GetTopMargin,
202 /*.fnGetRightMargin =*/&SwFrame::GetBottomMargin,
203 /*.fnSetXMargins =*/&SwFrame::SetTopBottomMargins,
204 /*.fnSetYMargins =*/&SwFrame::SetLeftRightMargins,
205 /*.fnGetPrtTop =*/&SwFrame::GetPrtLeft,
206 /*.fnGetPrtBottom =*/&SwFrame::GetPrtRight,
207 /*.fnGetPrtLeft =*/&SwFrame::GetPrtTop,
208 /*.fnGetPrtRight =*/&SwFrame::GetPrtBottom,
209 /*.fnTopDist =*/&SwRect::GetLeftDistance,
210 /*.fnBottomDist =*/&SwRect::GetRightDistance,
211 /*.fnLeftDist =*/&SwRect::GetTopDistance,
212 /*.fnRightDist =*/&SwRect::GetBottomDistance,
213 /*.fnSetLimit =*/&SwFrame::SetMaxRight,
214 /*.fnOverStep =*/&SwRect::OverStepRight,
215
216 /*.fnSetPos =*/&SwRect::SetUpperLeftCorner,
217 /*.fnMakePos =*/&SwFrame::MakeRightPos,
218 /*.fnXDiff =*/&FirstMinusSecond,
219 /*.fnYDiff =*/&FirstMinusSecond,
220 /*.fnXInc =*/&SwIncrement,
221 /*.fnYInc =*/&SwIncrement,
222
223 /*.fnSetLeftAndWidth =*/&SwRect::SetTopAndHeight,
224 /*.fnSetTopAndHeight =*/&SwRect::SetLeftAndWidth
225};
226
233 /*.fnGetTop =*/&SwRect::Left_,
234 /*.fnGetBottom =*/&SwRect::Right_,
235 /*.fnGetLeft =*/&SwRect::Bottom_,
236 /*.fnGetRight =*/&SwRect::Top_,
237 /*.fnGetWidth =*/&SwRect::Height_,
238 /*.fnGetHeight =*/&SwRect::Width_,
239 /*.fnGetPos =*/&SwRect::BottomLeft,
240 /*.fnGetSize =*/&SwRect::SwappedSize,
241
242 /*.fnSetTop =*/&SwRect::Left_,
243 /*.fnSetBottom =*/&SwRect::Right_,
244 /*.fnSetLeft =*/&SwRect::Bottom_,
245 /*.fnSetRight =*/&SwRect::Top_,
246 /*.fnSetWidth =*/&SwRect::Height_,
247 /*.fnSetHeight =*/&SwRect::Width_,
248
249 /*.fnSubTop =*/&SwRect::SubLeft,
250 /*.fnAddBottom =*/&SwRect::AddRight,
251 /*.fnSubLeft =*/&SwRect::AddBottom,
252 /*.fnAddRight =*/&SwRect::SubTop,
253 /*.fnAddWidth =*/&SwRect::AddHeight,
254 /*.fnAddHeight =*/&SwRect::AddWidth,
255
256 /*.fnSetPosX =*/&SwRect::SetPosY,
257 /*.fnSetPosY =*/&SwRect::SetPosX,
258
259 /*.fnGetTopMargin =*/&SwFrame::GetLeftMargin,
260 /*.fnGetBottomMargin =*/&SwFrame::GetRightMargin,
261 /*.fnGetLeftMargin =*/&SwFrame::GetBottomMargin,
262 /*.fnGetRightMargin =*/&SwFrame::GetTopMargin,
263 /*.fnSetXMargins =*/&SwFrame::SetTopBottomMargins,
264 /*.fnSetYMargins =*/&SwFrame::SetLeftRightMargins,
265 /*.fnGetPrtTop =*/&SwFrame::GetPrtLeft,
266 /*.fnGetPrtBottom =*/&SwFrame::GetPrtRight,
267 /*.fnGetPrtLeft =*/&SwFrame::GetPrtBottom,
268 /*.fnGetPrtRight =*/&SwFrame::GetPrtTop,
269 /*.fnTopDist =*/&SwRect::GetLeftDistance,
270 /*.fnBottomDist =*/&SwRect::GetRightDistance,
271 /*.fnLeftDist =*/&SwRect::GetBottomDistance,
272 /*.fnRightDist =*/&SwRect::GetTopDistance,
273 /*.fnSetLimit =*/&SwFrame::SetMaxRight,
274 /*.fnOverStep =*/&SwRect::OverStepRight,
275
276 /*.fnSetPos =*/&SwRect::SetLowerLeftCorner,
277 /*.fnMakePos =*/&SwFrame::MakeRightPos,
278 /*.fnXDiff =*/&SecondMinusFirst,
279 /*.fnYDiff =*/&FirstMinusSecond,
280 /*.fnXInc =*/&SwDecrement,
281 /*.fnYInc =*/&SwIncrement,
282
283 /*.fnSetLeftAndWidth =*/&SwRect::SetBottomAndHeight,
284 /*.fnSetTopAndHeight =*/&SwRect::SetLeftAndWidth
285};
286
291
292// #i65250#
294
295
297{
299 SwCache *pNew = new SwCache( 100
300#ifdef DBG_UTIL
301 , "static SwBorderAttrs::pCache"
302#endif
303 );
304 SwFrame::SetCache( pNew );
305}
306
308{
309#if OSL_DEBUG_LEVEL > 0
310 // The cache may only contain null pointers at this time.
311 for( size_t n = SwFrame::GetCachePtr()->size(); n; )
312 if( (*SwFrame::GetCachePtr())[ --n ] )
313 {
314 SwCacheObj* pObj = (*SwFrame::GetCachePtr())[ n ];
315 OSL_ENSURE( !pObj, "Who didn't deregister?");
316 }
317#endif
319 delete SwFrame::GetCachePtr();
320}
321
322// RootFrame::Everything that belongs to CurrShell
323
325{
326 OSL_ENSURE( pNew, "insert 0-Shell?" );
327 pRoot = pNew->GetLayout();
328 if ( pRoot )
329 {
331 pRoot->mpCurrShell = pNew;
332 pRoot->mpCurrShells->insert( this );
333 }
334 else
335 pPrev = nullptr;
336}
337
339{
340 if ( pRoot )
341 {
342 pRoot->mpCurrShells->erase( this );
343 if ( pPrev )
345 if ( pRoot->mpCurrShells->empty() && pRoot->mpWaitingCurrShell )
346 {
348 pRoot->mpWaitingCurrShell = nullptr;
349 }
350 }
351}
352
354{
355 SwRootFrame *pRoot = pSh->GetLayout();
356 if ( pRoot->mpCurrShells->empty() )
357 pRoot->mpCurrShell = pSh;
358 else
359 pRoot->mpWaitingCurrShell = pSh;
360}
361
363{
364 // Activate some shell if possible
365 if ( mpCurrShell == pSh )
366 {
367 mpCurrShell = nullptr;
368 for(SwViewShell& rShell : pSh->GetRingContainer())
369 {
370 if(&rShell != pSh)
371 {
372 mpCurrShell = &rShell;
373 break;
374 }
375 }
376 }
377
378 // Doesn't matter anymore
379 if ( mpWaitingCurrShell == pSh )
380 mpWaitingCurrShell = nullptr;
381
382 // Remove references
383 for ( CurrShell *pC : *mpCurrShells )
384 {
385 if (pC->pPrev == pSh)
386 pC->pPrev = nullptr;
387 }
388}
389
391{
392 pRoot->mpCurrShells.reset( new SwCurrShells );
393}
394
395/*
396|* The RootFrame requests an own FrameFormat from the document, which it is
397|* going to delete again in the dtor. The own FrameFormat is derived from
398|* the passed FrameFormat.
399|*/
401 SwLayoutFrame( pFormat->GetDoc()->MakeFrameFormat(
402 "Root", pFormat ), nullptr ),
403 mnViewWidth( -1 ),
404 mnColumns( 0 ),
405 mbBookMode( false ),
406 mbSidebarChanged( false ),
407 mbNeedGrammarCheck( false ),
408 mbCheckSuperfluous( false ),
409 mbIdleFormat( true ),
410 mbBrowseWidthValid( false ),
411 mbTurboAllowed( true ),
412 mbAssertFlyPages( true ),
413 mbTableUpdateInProgress( false ),
414 mbIsVirtPageNum( false ),
415 mbIsNewLayout( true ),
416 mbCallbackActionEnabled ( false ),
417 mbLayoutFreezed ( false ),
418 mbHideRedlines(pFormat->GetDoc()->GetDocumentRedlineManager().IsHideRedlines()),
419 m_FieldmarkMode(pSh->GetViewOptions()->IsFieldName()
420 ? sw::FieldmarkMode::ShowCommand
421 : sw::FieldmarkMode::ShowResult),
422 m_ParagraphBreakMode(pSh->GetViewOptions()->IsParagraph()
423 ? sw::ParagraphBreakMode::Shown
425 mnBrowseWidth(MIN_BROWSE_WIDTH),
426 mpTurbo( nullptr ),
427 mpLastPage( nullptr ),
428 mpCurrShell( pSh ),
429 mpWaitingCurrShell( nullptr ),
430 mpDrawPage( nullptr ),
431 mnPhyPageNums( 0 ),
432 mnAccessibleShells( 0 )
433{
435 setRootFrame( this );
436
437 s_pLast = this;
438}
439
441{
442 InitCurrShells( this );
443
444 IDocumentTimerAccess& rTimerAccess = pFormat->getIDocumentTimerAccess();
445 IDocumentLayoutAccess& rLayoutAccess = pFormat->getIDocumentLayoutAccess();
446 IDocumentFieldsAccess& rFieldsAccess = pFormat->getIDocumentFieldsAccess();
447 const IDocumentSettingAccess& rSettingAccess = pFormat->getIDocumentSettingAccess();
448 rTimerAccess.StopIdling();
449 // For creating the Flys by MakeFrames()
450 rLayoutAccess.SetCurrentViewShell( GetCurrShell() );
451 mbCallbackActionEnabled = false; // needs to be set to true before leaving!
452
454 if ( pMd )
455 {
456 // Disable "multiple layout"
457 mpDrawPage = pMd->GetPage(0);
458
460 }
461
462 // Initialize the layout: create pages, link content with Content etc.
463 // First, initialize some stuff, then get hold of the first
464 // node (which will be needed for the PageDesc).
465
466 SwDoc* pDoc = pFormat->GetDoc();
468 SwContentNode *pNode = pDoc->GetNodes().GoNextSection( &aIndex, true, false );
469 // #123067# pNode = 0 can really happen
470 SwTableNode *pTableNd= pNode ? pNode->FindTableNode() : nullptr;
471
472 // Get hold of PageDesc (either via FrameFormat of the first node or the initial one).
473 SwPageDesc *pDesc = nullptr;
474 ::std::optional<sal_uInt16> oPgNum;
475
476 if ( pTableNd )
477 {
478 const SwFormatPageDesc &rDesc = pTableNd->GetTable().GetFrameFormat()->GetPageDesc();
479 pDesc = const_cast<SwPageDesc*>(rDesc.GetPageDesc());
480 //#19104# respect the page number offset!!
481 oPgNum = rDesc.GetNumOffset();
482 if (oPgNum)
483 mbIsVirtPageNum = true;
484 }
485 else if ( pNode )
486 {
487 const SwFormatPageDesc &rDesc = pNode->GetSwAttrSet().GetPageDesc();
488 pDesc = const_cast<SwPageDesc*>(rDesc.GetPageDesc());
489 //#19104# respect the page number offset!!
490 oPgNum = rDesc.GetNumOffset();
491 if (oPgNum)
492 mbIsVirtPageNum = true;
493 }
494 else
495 mbIsVirtPageNum = false;
496 if ( !pDesc )
497 pDesc = &pDoc->GetPageDesc( 0 );
498
499 // Create a page and put it in the layout
500 // The first page is always a right-page and always a first-page
502 *pDesc, /*pUpper=*/this, /*isRightPage=*/true, /*bFirst=*/true, /*bInsertEmpty=*/false,
503 /*bFootnote=*/false, /*pSibling=*/nullptr, /*bVeryFirstPage=*/true);
504
505 // Find the first page in the Bodytext section.
506 SwLayoutFrame *pLay = pPage->FindBodyCont();
507 while( pLay->Lower() )
508 pLay = static_cast<SwLayoutFrame*>(pLay->Lower());
509
511 ::InsertCnt_( pLay, pDoc, aTmp.GetIndex(), true );
512
513 // tdf#156077 create all pages for at-page anchored flys now because all
514 // these flys must be attached to some page when Init() is finished
516
517 if( rSettingAccess.get(DocumentSettingId::GLOBAL_DOCUMENT) )
518 rFieldsAccess.UpdateRefFields();
519 //b6433357: Update page fields after loading
521 {
522 rFieldsAccess.UpdatePageFields(pPage->getFrameArea().Top());
523 }
524
525 rTimerAccess.StartIdling();
527
528 SwViewShell *pViewSh = GetCurrShell();
529 if (pViewSh)
531}
532
534{
535 mbTurboAllowed = false;
536 mpTurbo = nullptr;
537
538 SwFrameFormat *pRegisteredInNonConst = static_cast<SwFrameFormat*>(GetDep());
539 if ( pRegisteredInNonConst )
540 {
541 SwDoc *pDoc = pRegisteredInNonConst->GetDoc();
542 pDoc->DelFrameFormat( pRegisteredInNonConst );
543 // do this before calling RemoveFootnotes() because footnotes
544 // can contain anchored objects
546 }
547
548 mpDestroy.reset();
549
550 // Remove references
551 for ( auto& rpCurrShell : *mpCurrShells )
552 rpCurrShell->pRoot = nullptr;
553
554 mpCurrShells.reset();
555
556 // Some accessible shells are left => problems on second SwFrame::Destroy call
557 assert(0 == mnAccessibleShells);
558
559 // fdo#39510 crash on document close with footnotes
560 // Object ownership in writer and esp. in layout are a mess: Before the
561 // document/layout split SwDoc and SwRootFrame were essentially one object
562 // and magically/uncleanly worked around their common destruction by call
563 // to SwDoc::IsInDtor() -- even from the layout. As of now destruction of
564 // the layout proceeds forward through the frames. Since SwTextFootnote::DelFrames
565 // also searches backwards to find the master of footnotes, they must be
566 // considered to be owned by the SwRootFrame and also be destroyed here,
567 // before tearing down the (now footnote free) rest of the layout.
568 RemoveFootnotes(nullptr, false, true);
569
571}
572
574{
575 s_pLast = nullptr;
576}
577
579{
580 // Remove all master objects from the Page. But don't delete!
581 for( size_t i = pPg ? pPg->GetObjCount() : 0; i; )
582 {
583 SdrObject* pObj = pPg->GetObj( --i );
584 if( dynamic_cast< const SwFlyDrawObj *>( pObj ) != nullptr )
585 pPg->RemoveObject( i );
586 }
587}
588
590{
591 if ( !IsLayoutFreezed() )
592 CheckPageDescs( const_cast<SwPageFrame*>(static_cast<const SwPageFrame*>(Lower())) );
593}
594
596{
597 SwPageFrame *pPage = const_cast<SwPageFrame*>(static_cast<const SwPageFrame*>(Lower()));
598 while ( pPage )
599 {
601 pPage = static_cast<SwPageFrame*>(pPage->GetNext());
602 }
603}
604
606{
608}
609
611{
613}
614
616{
617 SwPageFrame *pPage = const_cast<SwPageFrame*>(static_cast<const SwPageFrame*>(Lower()));
618 while ( pPage )
619 {
620 if ( bSmartTags )
621 pPage->InvalidateSmartTags();
622
623 pPage->InvalidateSpelling();
624 pPage = static_cast<SwPageFrame*>(pPage->GetNext());
625 }
626}
627
628/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwRootFrame * pRoot
Definition: viewsh.hxx:608
SwViewShell * pPrev
Definition: viewsh.hxx:607
CurrShell(SwViewShell *pNew)
Definition: newfrm.cxx:324
~CurrShell()
Definition: newfrm.cxx:338
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
Document fields related interfaces.
virtual void UpdateRefFields()=0
virtual void UpdatePageFields(const SwTwips)=0
Provides access to the layout of a document.
virtual void SetCurrentViewShell(SwViewShell *pNew)=0
!!!The old layout must be deleted!!!
Provides access to settings of a document.
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
Handle the background jobs of a Writer document.
virtual void StartIdling()=0
Start the idle task.
virtual void StopIdling()=0
Stop idle processing.
const SdrPage * GetPage(sal_uInt16 nPgNum) const
SdrObject * GetObj(size_t nNum) const
size_t GetObjCount() const
virtual rtl::Reference< SdrObject > RemoveObject(size_t nObjNum)
virtual void SetSize(const Size &aSiz)
const SwFormatPageDesc & GetPageDesc(bool=true) const
Definition: fmtpdsc.hxx:75
The Cache object base class Users of the Cache must derive a class from the SwCacheObj and store thei...
Definition: swcache.hxx:137
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
Definition: node.hxx:727
Definition: doc.hxx:197
SwNodes & GetNodes()
Definition: doc.hxx:422
void DelFrameFormat(SwFrameFormat *pFormat, bool bBroadcast=false)
Definition: docfmt.cxx:705
::sw::DocumentLayoutManager const & GetDocumentLayoutManager() const
Definition: doc.cxx:429
const SwPageDesc & GetPageDesc(const size_t i) const
Definition: doc.hxx:896
SwLayoutFrame * FindBodyCont()
Searches the first ContentFrame in BodyText below the page.
Definition: findfrm.cxx:48
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
Definition: fmtpdsc.hxx:36
SwPageDesc * GetPageDesc()
Definition: fmtpdsc.hxx:61
const ::std::optional< sal_uInt16 > & GetNumOffset() const
Definition: fmtpdsc.hxx:64
IDocumentTimerAccess & getIDocumentTimerAccess()
Provides access to the document idle timer interface.
Definition: format.cxx:716
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:139
const IDocumentDrawModelAccess & getIDocumentDrawModelAccess() const
Provides access to the document draw model interface.
Definition: format.cxx:712
IDocumentFieldsAccess & getIDocumentFieldsAccess()
Provides access to the document idle timer interface.
Definition: format.cxx:717
const SwFormatPageDesc & GetPageDesc(bool=true) const
Definition: fmtpdsc.hxx:78
const IDocumentLayoutAccess & getIDocumentLayoutAccess() const
Provides access to the document layout interface.
Definition: format.cxx:714
const IDocumentSettingAccess & getIDocumentSettingAccess() const
Provides access to the document settings interface.
Definition: format.cxx:711
const SwRect & getFrameArea() const
Definition: frame.hxx:179
static sal_uInt32 snLastFrameId
Definition: frame.hxx:152
Style of a layout element.
Definition: frmfmt.hxx:72
static void SetCache(SwCache *pNew)
Definition: frame.hxx:525
tools::Long GetLeftMargin() const
Definition: ssfrm.cxx:48
tools::Long GetPrtLeft() const
Definition: ssfrm.cxx:52
tools::Long GetRightMargin() const
Definition: ssfrm.cxx:50
SwFrame * GetNext()
Definition: frame.hxx:682
SwFrameType mnFrameType
Definition: frame.hxx:414
bool SetMinLeft(tools::Long)
Definition: ssfrm.cxx:61
void SetLeftRightMargins(tools::Long, tools::Long)
Definition: ssfrm.cxx:180
void MakeBelowPos(const SwFrame *, const SwFrame *, bool)
Definition: ssfrm.cxx:109
static void CheckPageDescs(SwPageFrame *pStart, bool bNotifyFields=true, SwPageFrame **ppPrev=nullptr)
Check all pages (starting from the given one) if they use the appropriate frame format.
Definition: pagechg.cxx:1078
bool SetMaxBottom(tools::Long)
Definition: ssfrm.cxx:77
void SetRightLeftMargins(tools::Long, tools::Long)
Definition: ssfrm.cxx:187
static SwCache * spCache
Definition: frame.hxx:334
tools::Long GetPrtTop() const
Definition: ssfrm.cxx:58
tools::Long GetBottomMargin() const
Definition: ssfrm.cxx:46
void SetTopBottomMargins(tools::Long, tools::Long)
Definition: ssfrm.cxx:173
tools::Long GetPrtBottom() const
Definition: ssfrm.cxx:54
bool SetMaxRight(tools::Long)
Definition: ssfrm.cxx:93
void MakeLeftPos(const SwFrame *, const SwFrame *, bool)
Definition: ssfrm.cxx:130
tools::Long GetPrtRight() const
Definition: ssfrm.cxx:56
sw::BroadcastingModify * GetDep()
use these so we can grep for SwFrame's GetRegisteredIn accesses beware that SwTextFrame may return sw...
Definition: frame.hxx:478
void MakeRightPos(const SwFrame *, const SwFrame *, bool)
Definition: ssfrm.cxx:152
tools::Long GetTopMargin() const
Definition: ssfrm.cxx:44
static SwCache * GetCachePtr()
Definition: frame.hxx:524
void setRootFrame(SwRootFrame *pRoot)
Definition: frame.hxx:455
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame.
Definition: layfrm.hxx:36
virtual void DestroyImpl() override
Definition: ssfrm.cxx:487
const SwFrame * Lower() const
Definition: layfrm.hxx:101
Marks a node in the document model.
Definition: ndindex.hxx:31
SwNodeOffset GetIndex() const
Definition: ndindex.hxx:111
SwTableNode * FindTableNode()
Search table node, in which it is.
Definition: node.cxx:380
const SwStartNode * StartOfSectionNode() const
Definition: node.hxx:153
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
Definition: ndarr.hxx:165
SwContentNode * GoNextSection(SwNodeIndex *, bool bSkipHidden=true, bool bSkipProtect=true) const
Go to next content-node that is not protected or hidden (Both set FALSE ==> GoNext/GoPrevious!...
Definition: nodes.cxx:1948
A page of the document layout.
Definition: pagefrm.hxx:60
void InvalidateAutoCompleteWords() const
Definition: pagefrm.hxx:402
void InvalidateSmartTags() const
Definition: pagefrm.hxx:398
void InvalidateSpelling() const
Definition: pagefrm.hxx:393
void SubLeft(const tools::Long nSub)
Definition: swrect.cxx:126
tools::Long Right_() const
Definition: swrect.cxx:119
void SubTop(const tools::Long nSub)
Definition: swrect.cxx:129
tools::Long GetBottomDistance(tools::Long) const
Definition: swrect.cxx:138
void SetBottomAndHeight(tools::Long nBottom, tools::Long nNew)
Definition: swrect.cxx:166
Point TopLeft() const
Definition: swrect.hxx:254
void Top(const tools::Long nTop)
Definition: swrect.hxx:206
tools::Long Height_() const
Definition: swrect.cxx:117
tools::Long Left_() const
Definition: swrect.cxx:118
void SetTopAndHeight(tools::Long nTop, tools::Long nNew)
Definition: swrect.cxx:156
void SetRightAndWidth(tools::Long nRight, tools::Long nNew)
Definition: swrect.cxx:161
tools::Long Width_() const
Definition: swrect.cxx:116
Point BottomLeft() const
Definition: swrect.hxx:262
tools::Long GetRightDistance(tools::Long) const
Definition: swrect.cxx:140
bool OverStepBottom(tools::Long) const
Definition: swrect.cxx:144
void SetPosX(const tools::Long nNew)
Definition: swrect.cxx:131
void SetLeftAndWidth(tools::Long nLeft, tools::Long nNew)
Definition: swrect.cxx:151
bool OverStepLeft(tools::Long) const
Definition: swrect.cxx:142
void SetLowerLeftCorner(const Point &rNew)
Definition: swrect.cxx:175
tools::Long Top_() const
Definition: swrect.cxx:120
bool OverStepRight(tools::Long) const
Definition: swrect.cxx:148
void AddBottom(const tools::Long nAdd)
Definition: swrect.cxx:130
tools::Long GetTopDistance(tools::Long) const
Definition: swrect.cxx:139
tools::Long GetLeftDistance(tools::Long) const
Definition: swrect.cxx:137
void AddRight(const tools::Long nAdd)
Definition: swrect.cxx:127
void SetUpperRightCorner(const Point &rNew)
Definition: swrect.cxx:173
Size Size_() const
Definition: swrect.cxx:134
void AddHeight(const tools::Long nAdd)
Definition: swrect.cxx:124
void AddWidth(const tools::Long nAdd)
Definition: swrect.cxx:123
void SetUpperLeftCorner(const Point &rNew)
Definition: swrect.cxx:171
tools::Long Bottom_() const
Definition: swrect.cxx:121
Size SwappedSize() const
Definition: swrect.cxx:135
void SetPosY(const tools::Long nNew)
Definition: swrect.cxx:132
Point TopRight() const
Definition: swrect.hxx:258
The root element of a Writer document layout.
Definition: rootfrm.hxx:85
SwViewShell * mpCurrShell
Definition: rootfrm.hxx:169
std::unique_ptr< SwCurrShells > mpCurrShells
Definition: rootfrm.hxx:171
const SwContentFrame * mpTurbo
If we only have to format one ContentFrame, its in mpTurbo.
Definition: rootfrm.hxx:139
static bool s_isInPaint
Definition: rootfrm.hxx:108
SwViewShell * GetCurrShell() const
Definition: rootfrm.hxx:215
void AllInvalidateSmartTagsOrSpelling(bool bSmartTags) const
Definition: newfrm.cxx:615
std::unique_ptr< SwDestroyList > mpDestroy
Definition: rootfrm.hxx:176
bool IsLayoutFreezed() const
Definition: rootfrm.hxx:425
void Init(SwFrameFormat *)
Definition: newfrm.cxx:440
sal_uInt16 mnAccessibleShells
Page count.
Definition: rootfrm.hxx:180
bool mbIsVirtPageNum
Definition: rootfrm.hxx:122
void DeRegisterShell(SwViewShell *pSh)
Definition: newfrm.cxx:362
static void RemoveMasterObjs(SdrPage *pPg)
Remove MasterObjects from the Page (called by the ctors)
Definition: newfrm.cxx:578
bool mbCallbackActionEnabled
Definition: rootfrm.hxx:124
SwViewShell * mpWaitingCurrShell
Definition: rootfrm.hxx:170
SdrPage * mpDrawPage
One Page per DrawModel per Document; is always the size of the Root.
Definition: rootfrm.hxx:174
void AllAddPaintRect() const
Definition: newfrm.cxx:605
void AllInvalidateAutoCompleteWords() const
Definition: newfrm.cxx:595
void AllCheckPageDescs() const
Definition: newfrm.cxx:589
void RemoveFootnotes(SwPageFrame *pPage=nullptr, bool bPageOnly=false, bool bEndNotes=false)
Remove all footnotes (but no references)
Definition: ftnfrm.cxx:974
virtual void DestroyImpl() override
Definition: newfrm.cxx:533
SwRootFrame(SwFrameFormat *, SwViewShell *)
Definition: newfrm.cxx:400
bool mbTurboAllowed
Definition: rootfrm.hxx:119
static bool s_isNoVirDev
Definition: rootfrm.hxx:109
static SwLayVout * s_pVout
Definition: rootfrm.hxx:107
void AssertFlyPages()
Ensures that enough pages exist, so that all page bound frames and draw objects can be placed.
Definition: pagechg.cxx:1566
virtual ~SwRootFrame() override
Definition: newfrm.cxx:573
void AllRemoveFootnotes()
Definition: newfrm.cxx:610
bool mbNeedGrammarCheck
Definition: rootfrm.hxx:105
friend void InitCurrShells(SwRootFrame *pRoot)
Definition: newfrm.cxx:390
static SwRootFrame * s_pLast
The last, still alive SwRootFrame instance, for debugging.
Definition: rootfrm.hxx:111
const SwTable & GetTable() const
Definition: node.hxx:542
SwTableFormat * GetFrameFormat()
Definition: swtable.hxx:209
bool IsOnlineSpell() const
Definition: viewopt.hxx:537
bool IsUpdateExpFields()
Definition: viewimp.cxx:194
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:452
bool AddPaintRect(const SwRect &rRect)
Definition: viewsh.cxx:552
SwViewShellImp * Imp()
Definition: viewsh.hxx:211
SwRootFrame * GetLayout() const
Definition: viewsh.cxx:2163
ring_container GetRingContainer()
Definition: ring.hxx:240
std::deque< AttacherIndex_Impl > aIndex
SwPageFrame * InsertNewPage(SwPageDesc &rDesc, SwFrame *pUpper, bool isRightPage, bool bFirst, bool bInsertEmpty, bool bFootnote, SwFrame *pSibling, bool bVeryFirstPage=false)
Definition: frmtool.cxx:3136
void InsertCnt_(SwLayoutFrame *pLay, SwDoc *pDoc, SwNodeOffset nIndex, bool bPages=false, SwNodeOffset nEndIndex=SwNodeOffset(0), SwFrame *pPrv=nullptr, sw::FrameMode eMode=sw::FrameMode::New)
Definition: frmtool.cxx:1491
sal_Int64 n
size
int i
Dialog to specify the properties of date form field.
ParagraphBreakMode
Definition: rootfrm.hxx:50
FieldmarkMode
Definition: rootfrm.hxx:49
long Long
static tools::Long SwIncrement(tools::Long nA, tools::Long nAdd)
Definition: newfrm.cxx:57
static SwRectFnCollection aVertical
Definition: newfrm.cxx:117
static tools::Long SwDecrement(tools::Long nA, tools::Long nSub)
Definition: newfrm.cxx:59
SwRectFn fnRectVert
Definition: newfrm.cxx:288
void FrameInit()
Definition: newfrm.cxx:296
static SwRectFnCollection aVerticalLeftToRight
Definition: newfrm.cxx:172
static tools::Long SecondMinusFirst(tools::Long nFirst, tools::Long nSecond)
Definition: newfrm.cxx:55
void SetShell(SwViewShell *pSh)
Definition: newfrm.cxx:353
static SwRectFnCollection aHorizontal
Definition: newfrm.cxx:62
SwRectFn fnRectVertL2RB2T
Definition: newfrm.cxx:290
static SwRectFnCollection aVerticalLeftToRightBottomToTop
This is the same as horizontal, but rotated counter-clockwise by 90 degrees.
Definition: newfrm.cxx:232
void FrameFinit()
Definition: newfrm.cxx:307
SwRectFn fnRectHori
Definition: newfrm.cxx:287
static tools::Long FirstMinusSecond(tools::Long nFirst, tools::Long nSecond)
Definition: newfrm.cxx:53
void InitCurrShells(SwRootFrame *pRoot)
Definition: newfrm.cxx:390
SwRectFn fnRectVertL2R
Definition: newfrm.cxx:289
std::set< CurrShell * > SwCurrShells
Definition: rootfrm.hxx:75