Commits

Anonymous committed 4d630a6

CWS swlayoutrefactoring: construction of RootFrm must be done in two steps; the layout must not be created in the ctor as creating the draw view will need a pLayout set at the ViewShell; worked in old versions because of a side effect that has set pLayout at SwDoc though the SwRootFrm still was not constructed

  • Participants
  • Parent commits 4985ea0

Comments (0)

Files changed (3)

File sw/source/core/inc/rootfrm.hxx

 
 	SwRootFrm( SwFrmFmt*, ViewShell* );
 	~SwRootFrm();
+	void Init(SwFrmFmt*, ViewShell* );
 
 	ViewShell *GetCurrShell() const { return pCurrShell; }
 	void DeRegisterShell( ViewShell *pSh );

File sw/source/core/layout/newfrm.cxx

 	bIdleFormat = bTurboAllowed = bAssertFlyPages = bIsNewLayout = sal_True;
 	bCheckSuperfluous = bBrowseWidthValid = sal_False;
     setRootFrm( this );
+}
 
+void SwRootFrm::Init( SwFrmFmt* pFmt, ViewShell* pSh )
+{
 	InitCurrShells( this );
 
 	IDocumentTimerAccess *pTimerAccess = pFmt->getIDocumentTimerAccess();

File sw/source/core/view/vnew.cxx

             pLayout = pCurrShell->pLayout;
         // end of "disable multiple layouts"
         if( !pLayout )
+		{
+			// switched to two step construction because creating the layout in SwRootFrm needs a valid pLayout set
             pLayout = SwRootFrmPtr(new SwRootFrm( pDoc->GetDfltFrmFmt(), this ));//swmod081016
+            pLayout->Init( pDoc->GetDfltFrmFmt(), this );
+        }
     }
 	SizeChgNotify();	//swmod 071108