xref: /aoo42x/main/sw/source/core/layout/newfrm.cxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_sw.hxx"
30 #include <svx/svdmodel.hxx>
31 #include <svx/svdpage.hxx>
32 #include <fmtfordr.hxx>
33 #include <fmtpdsc.hxx>
34 #include <frmfmt.hxx>
35 #include <swtable.hxx>
36 #include <rootfrm.hxx>
37 #include <pagefrm.hxx>
38 #include <cntfrm.hxx>
39 #include <viewsh.hxx>
40 #include <doc.hxx>
41 #include <node.hxx>
42 #include <dflyobj.hxx>
43 #include <frmtool.hxx>
44 #include <virtoutp.hxx>
45 #include <blink.hxx>
46 #include <ndindex.hxx>
47 #include <sectfrm.hxx>
48 #include <notxtfrm.hxx>
49 #include <pagedesc.hxx>
50 #include "viewimp.hxx"
51 #include "IDocumentTimerAccess.hxx"
52 #include "IDocumentLayoutAccess.hxx"
53 #include "IDocumentFieldsAccess.hxx"
54 #include "IDocumentSettingAccess.hxx"
55 #include "IDocumentDrawModelAccess.hxx"
56 #include <hints.hxx>
57 #include <viewopt.hxx>
58 
59 SwLayVout     *SwRootFrm::pVout = 0;
60 sal_Bool 		   SwRootFrm::bInPaint = sal_False;
61 sal_Bool 		   SwRootFrm::bNoVirDev = sal_False;
62 
63 SwCache *SwFrm::pCache = 0;
64 
65 long FirstMinusSecond( long nFirst, long nSecond )
66     { return nFirst - nSecond; }
67 long SecondMinusFirst( long nFirst, long nSecond )
68     { return nSecond - nFirst; }
69 long SwIncrement( long nA, long nAdd )
70     { return nA + nAdd; }
71 long SwDecrement( long nA, long nSub )
72     { return nA - nSub; }
73 
74 static SwRectFnCollection aHorizontal = {
75     /* fnRectGet      */
76     &SwRect::_Top,
77     &SwRect::_Bottom,
78     &SwRect::_Left,
79     &SwRect::_Right,
80     &SwRect::_Width,
81     &SwRect::_Height,
82     &SwRect::TopLeft,
83     &SwRect::_Size,
84     /* fnRectSet      */
85     &SwRect::_Top,
86     &SwRect::_Bottom,
87     &SwRect::_Left,
88     &SwRect::_Right,
89     &SwRect::_Width,
90     &SwRect::_Height,
91 
92     &SwRect::SubTop,
93     &SwRect::AddBottom,
94     &SwRect::SubLeft,
95     &SwRect::AddRight,
96     &SwRect::AddWidth,
97     &SwRect::AddHeight,
98 
99     &SwRect::SetPosX,
100     &SwRect::SetPosY,
101 
102     &SwFrm::GetTopMargin,
103     &SwFrm::GetBottomMargin,
104     &SwFrm::GetLeftMargin,
105     &SwFrm::GetRightMargin,
106     &SwFrm::SetLeftRightMargins,
107     &SwFrm::SetTopBottomMargins,
108     &SwFrm::GetPrtTop,
109     &SwFrm::GetPrtBottom,
110     &SwFrm::GetPrtLeft,
111     &SwFrm::GetPrtRight,
112     &SwRect::GetTopDistance,
113     &SwRect::GetBottomDistance,
114     &SwRect::GetLeftDistance,
115     &SwRect::GetRightDistance,
116     &SwFrm::SetMaxBottom,
117     &SwRect::OverStepBottom,
118 
119     &SwRect::SetUpperLeftCorner,
120     &SwFrm::MakeBelowPos,
121     &FirstMinusSecond,
122     &FirstMinusSecond,
123     &SwIncrement,
124     &SwIncrement,
125     &SwRect::SetLeftAndWidth,
126     &SwRect::SetTopAndHeight
127 };
128 
129 static SwRectFnCollection aVertical = {
130     /* fnRectGet      */
131     &SwRect::_Right,
132     &SwRect::_Left,
133     &SwRect::_Top,
134     &SwRect::_Bottom,
135     &SwRect::_Height,
136     &SwRect::_Width,
137     &SwRect::TopRight,
138     &SwRect::SwappedSize,
139     /* fnRectSet      */
140     &SwRect::_Right,
141     &SwRect::_Left,
142     &SwRect::_Top,
143     &SwRect::_Bottom,
144     &SwRect::_Height,
145     &SwRect::_Width,
146 
147     &SwRect::AddRight,
148     &SwRect::SubLeft,
149     &SwRect::SubTop,
150     &SwRect::AddBottom,
151     &SwRect::AddHeight,
152     &SwRect::AddWidth,
153 
154     &SwRect::SetPosY,
155     &SwRect::SetPosX,
156 
157     &SwFrm::GetRightMargin,
158     &SwFrm::GetLeftMargin,
159     &SwFrm::GetTopMargin,
160     &SwFrm::GetBottomMargin,
161     &SwFrm::SetTopBottomMargins,
162     &SwFrm::SetRightLeftMargins,
163     &SwFrm::GetPrtRight,
164     &SwFrm::GetPrtLeft,
165     &SwFrm::GetPrtTop,
166     &SwFrm::GetPrtBottom,
167     &SwRect::GetRightDistance,
168     &SwRect::GetLeftDistance,
169     &SwRect::GetTopDistance,
170     &SwRect::GetBottomDistance,
171     &SwFrm::SetMinLeft,
172     &SwRect::OverStepLeft,
173 
174     &SwRect::SetUpperRightCorner,
175     &SwFrm::MakeLeftPos,
176     &FirstMinusSecond,
177     &SecondMinusFirst,
178     &SwIncrement,
179     &SwDecrement,
180     &SwRect::SetTopAndHeight,
181     &SwRect::SetRightAndWidth
182 };
183 
184 static SwRectFnCollection aBottomToTop = {
185     /* fnRectGet      */
186     &SwRect::_Bottom,
187     &SwRect::_Top,
188     &SwRect::_Left,
189     &SwRect::_Right,
190     &SwRect::_Width,
191     &SwRect::_Height,
192     &SwRect::BottomLeft,
193     &SwRect::_Size,
194     /* fnRectSet      */
195     &SwRect::_Bottom,
196     &SwRect::_Top,
197     &SwRect::_Left,
198     &SwRect::_Right,
199     &SwRect::_Width,
200     &SwRect::_Height,
201 
202     &SwRect::AddBottom,
203     &SwRect::SubTop,
204     &SwRect::SubLeft,
205     &SwRect::AddRight,
206     &SwRect::AddWidth,
207     &SwRect::AddHeight,
208 
209     &SwRect::SetPosX,
210     &SwRect::SetPosY,
211 
212     &SwFrm::GetBottomMargin,
213     &SwFrm::GetTopMargin,
214     &SwFrm::GetLeftMargin,
215     &SwFrm::GetRightMargin,
216     &SwFrm::SetLeftRightMargins,
217     &SwFrm::SetBottomTopMargins,
218     &SwFrm::GetPrtBottom,
219     &SwFrm::GetPrtTop,
220     &SwFrm::GetPrtLeft,
221     &SwFrm::GetPrtRight,
222     &SwRect::GetBottomDistance,
223     &SwRect::GetTopDistance,
224     &SwRect::GetLeftDistance,
225     &SwRect::GetRightDistance,
226     &SwFrm::SetMinTop,
227     &SwRect::OverStepTop,
228 
229     &SwRect::SetLowerLeftCorner,
230     &SwFrm::MakeUpperPos,
231     &FirstMinusSecond,
232     &SecondMinusFirst,
233     &SwIncrement,
234     &SwDecrement,
235     &SwRect::SetLeftAndWidth,
236     &SwRect::SetBottomAndHeight
237 };
238 
239 static SwRectFnCollection aVerticalRightToLeft = {
240     /* fnRectGet      */
241     &SwRect::_Left,
242     &SwRect::_Right,
243     &SwRect::_Top,
244     &SwRect::_Bottom,
245     &SwRect::_Height,
246     &SwRect::_Width,
247     &SwRect::BottomRight,
248     &SwRect::SwappedSize,
249     /* fnRectSet      */
250     &SwRect::_Left,
251     &SwRect::_Right,
252     &SwRect::_Top,
253     &SwRect::_Bottom,
254     &SwRect::_Height,
255     &SwRect::_Width,
256 
257     &SwRect::SubLeft,
258     &SwRect::AddRight,
259     &SwRect::SubTop,
260     &SwRect::AddBottom,
261     &SwRect::AddHeight,
262     &SwRect::AddWidth,
263 
264     &SwRect::SetPosY,
265     &SwRect::SetPosX,
266 
267     &SwFrm::GetLeftMargin,
268     &SwFrm::GetRightMargin,
269     &SwFrm::GetTopMargin,
270     &SwFrm::GetBottomMargin,
271     &SwFrm::SetTopBottomMargins,
272     &SwFrm::SetLeftRightMargins,
273     &SwFrm::GetPrtLeft,
274     &SwFrm::GetPrtRight,
275     &SwFrm::GetPrtBottom,
276     &SwFrm::GetPrtTop,
277     &SwRect::GetLeftDistance,
278     &SwRect::GetRightDistance,
279     &SwRect::GetBottomDistance,
280     &SwRect::GetTopDistance,
281     &SwFrm::SetMaxRight,
282     &SwRect::OverStepRight,
283 
284     &SwRect::SetLowerLeftCorner,
285     &SwFrm::MakeRightPos,
286     &FirstMinusSecond,
287     &FirstMinusSecond,
288     &SwDecrement,
289     &SwIncrement,
290     &SwRect::SetBottomAndHeight,
291     &SwRect::SetLeftAndWidth
292 };
293 //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
294 static SwRectFnCollection aVerticalLeftToRight = {
295     /* fnRectGet      */
296     &SwRect::_Left,
297     &SwRect::_Right,
298     &SwRect::_Top,
299     &SwRect::_Bottom,
300     &SwRect::_Height,
301     &SwRect::_Width,
302     &SwRect::TopLeft,
303     &SwRect::SwappedSize,
304     /* fnRectSet      */
305     &SwRect::_Left,
306     &SwRect::_Right,
307     &SwRect::_Top,
308     &SwRect::_Bottom,
309     &SwRect::_Height,
310     &SwRect::_Width,
311 
312     &SwRect::SubLeft,
313     &SwRect::AddRight,
314     &SwRect::SubTop,
315     &SwRect::AddBottom,
316     &SwRect::AddHeight,
317     &SwRect::AddWidth,
318 
319     &SwRect::SetPosY,
320     &SwRect::SetPosX,
321 
322     &SwFrm::GetLeftMargin,
323     &SwFrm::GetRightMargin,
324     &SwFrm::GetTopMargin,
325     &SwFrm::GetBottomMargin,
326     &SwFrm::SetTopBottomMargins,
327     &SwFrm::SetLeftRightMargins,
328     &SwFrm::GetPrtLeft,
329     &SwFrm::GetPrtRight,
330     &SwFrm::GetPrtTop,
331     &SwFrm::GetPrtBottom,
332     &SwRect::GetLeftDistance,
333     &SwRect::GetRightDistance,
334     &SwRect::GetTopDistance,
335     &SwRect::GetBottomDistance,
336     &SwFrm::SetMaxRight,
337     &SwRect::OverStepRight,
338 
339     &SwRect::SetUpperLeftCorner,
340     &SwFrm::MakeRightPos,
341     &FirstMinusSecond,
342     &FirstMinusSecond,
343     &SwIncrement,
344     &SwIncrement,
345     &SwRect::SetTopAndHeight,
346     &SwRect::SetLeftAndWidth
347 };
348 //End of SCMS
349 SwRectFn fnRectHori = &aHorizontal;
350 SwRectFn fnRectVert = &aVertical;
351 //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
352 SwRectFn fnRectVertL2R = &aVerticalLeftToRight;
353 //End of SCMS
354 SwRectFn fnRectB2T = &aBottomToTop;
355 SwRectFn fnRectVL2R = &aVerticalRightToLeft;
356 
357 // --> OD 2006-05-10 #i65250#
358 sal_uInt32 SwFrm::mnLastFrmId=0;
359 // <--
360 
361 TYPEINIT1(SwFrm,SwClient);		//rtti fuer SwFrm
362 TYPEINIT1(SwCntntFrm,SwFrm);	//rtti fuer SwCntntFrm
363 
364 
365 void _FrmInit()
366 {
367 	SwRootFrm::pVout = new SwLayVout();
368 	SwCache *pNew = new SwCache( 100, 100
369 #ifdef DBG_UTIL
370 	, "static SwBorderAttrs::pCache"
371 #endif
372 	);
373 	SwFrm::SetCache( pNew );
374 }
375 
376 
377 
378 void _FrmFinit()
379 {
380 #ifdef DBG_UTIL
381 	// im Chache duerfen nur noch 0-Pointer stehen
382 	for( sal_uInt16 n = SwFrm::GetCachePtr()->Count(); n; )
383 		if( (*SwFrm::GetCachePtr())[ --n ] )
384 		{
385 			SwCacheObj* pObj = (*SwFrm::GetCachePtr())[ n ];
386 			ASSERT( !pObj, "Wer hat sich nicht ausgetragen?")
387 		}
388 #endif
389 	delete SwRootFrm::pVout;
390 	delete SwFrm::GetCachePtr();
391 }
392 
393 /*************************************************************************
394 |*
395 |*	RootFrm::Alles was so zur CurrShell gehoert
396 |*
397 |*	Ersterstellung		MA 09. Sep. 98
398 |*	Letzte Aenderung	MA 18. Feb. 99
399 |*
400 |*************************************************************************/
401 
402 typedef CurrShell* CurrShellPtr;
403 SV_DECL_PTRARR_SORT(SwCurrShells,CurrShellPtr,4,4)
404 SV_IMPL_PTRARR_SORT(SwCurrShells,CurrShellPtr)
405 
406 CurrShell::CurrShell( ViewShell *pNew )
407 {
408 	ASSERT( pNew, "0-Shell einsetzen?" );
409 	pRoot = pNew->GetLayout();
410 	if ( pRoot )
411 	{
412 		pPrev = pRoot->pCurrShell;
413 		pRoot->pCurrShell = pNew;
414 		pRoot->pCurrShells->Insert( this );
415 	}
416 	else
417 		pPrev = 0;
418 }
419 
420 CurrShell::~CurrShell()
421 {
422 	if ( pRoot )
423 	{
424 		pRoot->pCurrShells->Remove( this );
425 		if ( pPrev )
426 			pRoot->pCurrShell = pPrev;
427 		if ( !pRoot->pCurrShells->Count() && pRoot->pWaitingCurrShell )
428 		{
429 			pRoot->pCurrShell = pRoot->pWaitingCurrShell;
430 			pRoot->pWaitingCurrShell = 0;
431 		}
432 	}
433 }
434 
435 void SetShell( ViewShell *pSh )
436 {
437 	SwRootFrm *pRoot = pSh->GetLayout();
438 	if ( !pRoot->pCurrShells->Count() )
439 		pRoot->pCurrShell = pSh;
440 	else
441 		pRoot->pWaitingCurrShell = pSh;
442 }
443 
444 void SwRootFrm::DeRegisterShell( ViewShell *pSh )
445 {
446 	//Wenn moeglich irgendeine Shell aktivieren
447 	if ( pCurrShell == pSh )
448 		pCurrShell = pSh->GetNext() != pSh ? (ViewShell*)pSh->GetNext() : 0;
449 
450 	//Das hat sich eruebrigt
451 	if ( pWaitingCurrShell == pSh )
452 		pWaitingCurrShell = 0;
453 
454 	//Referenzen entfernen.
455 	for ( sal_uInt16 i = 0; i < pCurrShells->Count(); ++i )
456 	{
457 		CurrShell *pC = (*pCurrShells)[i];
458 		if (pC->pPrev == pSh)
459 			pC->pPrev = 0;
460 	}
461 }
462 
463 void InitCurrShells( SwRootFrm *pRoot )
464 {
465 	pRoot->pCurrShells = new SwCurrShells;
466 }
467 
468 
469 /*************************************************************************
470 |*
471 |*	SwRootFrm::SwRootFrm()
472 |*
473 |*	Beschreibung:
474 |* 		Der RootFrm laesst sich grundsaetzlich vom Dokument ein eigenes
475 |* 		FrmFmt geben. Dieses loescht er dann selbst im DTor.
476 |* 		Das eigene FrmFmt wird vom uebergebenen Format abgeleitet.
477 |*	Ersterstellung		SS 05-Apr-1991
478 |*	Letzte Aenderung	MA 12. Dec. 94
479 |*
480 |*************************************************************************/
481 
482 
483 SwRootFrm::SwRootFrm( SwFrmFmt *pFmt, ViewShell * pSh ) :
484 	SwLayoutFrm( pFmt->GetDoc()->MakeFrmFmt(
485 		XubString( "Root", RTL_TEXTENCODING_MS_1252 ), pFmt ), 0 ),
486     // --> PAGES01
487     maPagesArea(),
488     mnViewWidth( -1 ),
489     mnColumns( 0 ),
490     mbBookMode( false ),
491     mbSidebarChanged( false ),
492     mbNeedGrammarCheck( false ),
493     // <--
494     nBrowseWidth( MM50*4 ), //2cm Minimum
495     pTurbo( 0 ),
496 	pLastPage( 0 ),
497 	pCurrShell( pSh ),
498 	pWaitingCurrShell( 0 ),
499     pDrawPage( 0 ),
500     pDestroy( 0 ),
501 	nPhyPageNums( 0 ),
502     nAccessibleShells( 0 )
503 {
504     nType = FRMC_ROOT;
505 	bIdleFormat = bTurboAllowed = bAssertFlyPages = bIsNewLayout = sal_True;
506 	bCheckSuperfluous = bBrowseWidthValid = sal_False;
507     setRootFrm( this );
508 }
509 
510 void SwRootFrm::Init( SwFrmFmt* pFmt )
511 {
512 	InitCurrShells( this );
513 
514 	IDocumentTimerAccess *pTimerAccess = pFmt->getIDocumentTimerAccess();
515 	IDocumentLayoutAccess *pLayoutAccess = pFmt->getIDocumentLayoutAccess();
516 	IDocumentFieldsAccess *pFieldsAccess = pFmt->getIDocumentFieldsAccess();
517 	const IDocumentSettingAccess *pSettingAccess = pFmt->getIDocumentSettingAccess();
518 	pTimerAccess->StopIdling();
519 	pLayoutAccess->SetCurrentViewShell( this->GetCurrShell() );		//Fuer das Erzeugen der Flys durch MakeFrms()	//swmod 071108//swmod 071225
520 	bCallbackActionEnabled = sal_False;	//vor Verlassen auf sal_True setzen!
521 
522     SdrModel *pMd = pFmt->getIDocumentDrawModelAccess()->GetDrawModel();
523 	if ( pMd )
524 	{
525         // Disable "multiple layout"
526 		pDrawPage = pMd->GetPage(0); //pMd->AllocPage( FALSE );
527         //pMd->InsertPage( pDrawPage );
528         // end of disabling
529 
530 		pDrawPage->SetSize( Frm().SSize() );
531 	}
532 
533 	//Initialisierung des Layouts: Seiten erzeugen. Inhalt mit cntnt verbinden
534 	//usw.
535 	//Zuerst einiges initialiseren und den ersten Node besorgen (der wird
536 	//fuer den PageDesc benoetigt).
537 
538     SwDoc* pDoc = pFmt->GetDoc();
539 	SwNodeIndex aIndex( *pDoc->GetNodes().GetEndOfContent().StartOfSectionNode() );
540 	SwCntntNode *pNode = pDoc->GetNodes().GoNextSection( &aIndex, sal_True, sal_False );
541     // --> FME 2005-05-25 #123067# pNode = 0 can really happen:
542     SwTableNode *pTblNd= pNode ? pNode->FindTableNode() : 0;
543     // <--
544 
545 	//PageDesc besorgen (entweder vom FrmFmt des ersten Node oder den
546 	//initialen.)
547 	SwPageDesc *pDesc = 0;
548 	sal_uInt16 nPgNum = 1;
549 
550 	if ( pTblNd )
551 	{
552 		const SwFmtPageDesc &rDesc = pTblNd->GetTable().GetFrmFmt()->GetPageDesc();
553 		pDesc = (SwPageDesc*)rDesc.GetPageDesc();
554 		//#19104# Seitennummeroffset beruecksictigen!!
555 		bIsVirtPageNum = 0 != ( nPgNum = rDesc.GetNumOffset() );
556 	}
557 	else if ( pNode )
558 	{
559 		const SwFmtPageDesc &rDesc = pNode->GetSwAttrSet().GetPageDesc();
560 		pDesc = (SwPageDesc*)rDesc.GetPageDesc();
561 		//#19104# Seitennummeroffset beruecksictigen!!
562 		bIsVirtPageNum = 0 != ( nPgNum = rDesc.GetNumOffset() );
563 	}
564 	else
565 		bIsVirtPageNum = sal_False;
566 	if ( !pDesc )
567 		pDesc = (SwPageDesc*)
568             &const_cast<const SwDoc *>(pDoc)->GetPageDesc( 0 );
569 	const sal_Bool bOdd = !nPgNum || 0 != ( nPgNum % 2 );
570 
571 	//Eine Seite erzeugen und in das Layout stellen
572 	SwPageFrm *pPage = ::InsertNewPage( *pDesc, this, bOdd, sal_False, sal_False, 0 );
573 
574 	//Erstes Blatt im Bodytext-Bereich suchen.
575 	SwLayoutFrm *pLay = pPage->FindBodyCont();
576 	while( pLay->Lower() )
577 		pLay = (SwLayoutFrm*)pLay->Lower();
578 
579 	SwNodeIndex aTmp( *pDoc->GetNodes().GetEndOfContent().StartOfSectionNode(), 1 );
580 	::_InsertCnt( pLay, pDoc, aTmp.GetIndex(), sal_True );
581 	//Noch nicht ersetzte Master aus der Liste entfernen.
582 	RemoveMasterObjs( pDrawPage );
583 	if( pSettingAccess->get(IDocumentSettingAccess::GLOBAL_DOCUMENT) )
584 		pFieldsAccess->UpdateRefFlds( NULL );
585     //b6433357: Update page fields after loading
586     // --->
587     if ( !pCurrShell || !pCurrShell->Imp()->IsUpdateExpFlds() )
588     {
589         SwDocPosUpdate aMsgHnt( pPage->Frm().Top() );
590         pFieldsAccess->UpdatePageFlds( &aMsgHnt );
591     }
592     // <---
593 
594     pTimerAccess->StartIdling();
595 	bCallbackActionEnabled = sal_True;
596 
597     ViewShell *pViewSh  = GetCurrShell();
598     if (pViewSh)
599         mbNeedGrammarCheck = pViewSh->GetViewOptions()->IsOnlineSpell();
600 }
601 
602 /*************************************************************************
603 |*
604 |*	SwRootFrm::~SwRootFrm()
605 |*
606 |*	Ersterstellung		SS 05-Apr-1991
607 |*	Letzte Aenderung	MA 12. Dec. 94
608 |*
609 |*************************************************************************/
610 
611 
612 
613 SwRootFrm::~SwRootFrm()
614 {
615 	bTurboAllowed = sal_False;
616 	pTurbo = 0;
617 	if(pBlink)
618 		pBlink->FrmDelete( this );
619 	static_cast<SwFrmFmt*>(GetRegisteredInNonConst())->GetDoc()->DelFrmFmt( static_cast<SwFrmFmt*>(GetRegisteredInNonConst()) );
620 	delete pDestroy;
621     pDestroy = 0;
622 
623 	//Referenzen entfernen.
624 	for ( sal_uInt16 i = 0; i < pCurrShells->Count(); ++i )
625 		(*pCurrShells)[i]->pRoot = 0;
626 
627 	delete pCurrShells;
628 
629 	ASSERT( 0==nAccessibleShells, "Some accessible shells are left" );
630 }
631 
632 /*************************************************************************
633 |*
634 |*	SwRootFrm::RemoveMasterObjs()
635 |*
636 |*	Ersterstellung		MA 19.10.95
637 |*	Letzte Aenderung	MA 19.10.95
638 |*
639 |*************************************************************************/
640 
641 
642 void SwRootFrm::RemoveMasterObjs( SdrPage *pPg )
643 {
644 	//Alle Masterobjekte aus der Page entfernen. Nicht loeschen!!
645 	for( sal_uLong i = pPg ? pPg->GetObjCount() : 0; i; )
646 	{
647 		SdrObject* pObj = pPg->GetObj( --i );
648 		if( pObj->ISA(SwFlyDrawObj ) )
649 			pPg->RemoveObject( i );
650 	}
651 }
652 
653 
654 void SwRootFrm::AllCheckPageDescs() const
655 {
656 	CheckPageDescs( (SwPageFrm*)this->Lower() );
657 }
658 //swmod 080226
659 void SwRootFrm::AllInvalidateAutoCompleteWords() const
660 {
661 	SwPageFrm *pPage = (SwPageFrm*)this->Lower();
662 	while ( pPage )
663 	{
664 		pPage->InvalidateAutoCompleteWords();
665 		pPage = (SwPageFrm*)pPage->GetNext();
666 	}
667 }//swmod 080305
668 void SwRootFrm::AllAddPaintRect() const
669 {
670 	GetCurrShell()->AddPaintRect( this->Frm() );
671 }//swmod 080305
672 void SwRootFrm::AllRemoveFtns()
673 {
674 	RemoveFtns();
675 }
676 void SwRootFrm::AllInvalidateSmartTagsOrSpelling(sal_Bool bSmartTags) const
677 {
678 	SwPageFrm *pPage = (SwPageFrm*)this->Lower();
679 	while ( pPage )
680 	{
681 		if ( bSmartTags )
682 			pPage->InvalidateSmartTags();
683 
684 		pPage->InvalidateSpelling();
685 		pPage = (SwPageFrm*)pPage->GetNext();
686 	}	//swmod 080218
687 }
688 
689