incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mba...@apache.org
Subject svn commit: r1172362 - in /incubator/ooo/trunk/main/sw: inc/doc.hxx source/core/doc/doclay.cxx source/core/doc/docnew.cxx source/core/view/vnew.cxx
Date Sun, 18 Sep 2011 21:24:32 GMT
Author: mbauer
Date: Sun Sep 18 21:24:32 2011
New Revision: 1172362

URL: http://svn.apache.org/viewvc?rev=1172362&view=rev
Log:
cws mba34issues01: #i117699#: keep layout alive until swdoc dies

Modified:
    incubator/ooo/trunk/main/sw/inc/doc.hxx
    incubator/ooo/trunk/main/sw/source/core/doc/doclay.cxx
    incubator/ooo/trunk/main/sw/source/core/doc/docnew.cxx
    incubator/ooo/trunk/main/sw/source/core/view/vnew.cxx

Modified: incubator/ooo/trunk/main/sw/inc/doc.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/inc/doc.hxx?rev=1172362&r1=1172361&r2=1172362&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/inc/doc.hxx (original)
+++ incubator/ooo/trunk/main/sw/inc/doc.hxx Sun Sep 18 21:24:32 2011
@@ -92,6 +92,7 @@ class SwList;
 #include <memory>
 
 #include <boost/scoped_ptr.hpp>
+#include <boost/shared_ptr.hpp>
 
 class SvxForbiddenCharactersTable;
 class SwExtTextInput;
@@ -329,6 +330,7 @@ class SW_DLLPUBLIC SwDoc :
 	SwDefTOXBase_Impl * pDefTOXBases;	// defaults of SwTOXBase's
 
 	ViewShell		*pCurrentView;	// SwDoc should get a new member pCurrentView//swmod 071225
+	boost::shared_ptr<SwRootFrm> pLayoutPtr;
 	SdrModel		*pDrawModel;		// StarView Drawing
 
 	SwDocUpdtFld 	*pUpdtFlds;			// Struktur zum Field-Update
@@ -1792,6 +1794,8 @@ public:
 	const SwDocShell* GetDocShell() const	{ return pDocShell; }
 	void SetDocShell( SwDocShell* pDSh );
 
+	void ShareLayout( boost::shared_ptr<SwRootFrm>& rPtr);
+
 	// in case during copying of embedded object a new shell is created,
     // it should be set here and cleaned later
     void SetTmpDocShell( SfxObjectShellLock rLock )    { xTmpDocShell = rLock; }

Modified: incubator/ooo/trunk/main/sw/source/core/doc/doclay.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/core/doc/doclay.cxx?rev=1172362&r1=1172361&r2=1172362&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/core/doc/doclay.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/core/doc/doclay.cxx Sun Sep 18 21:24:32 2011
@@ -2438,3 +2438,10 @@ std::set<SwRootFrm*> SwDoc::GetAllLayout
 
     return aAllLayouts;
 }//swmod 070825
+
+ 
+void SwDoc::ShareLayout(boost::shared_ptr<SwRootFrm>& rPtr)
+{
+    pLayoutPtr = rPtr;
+}
+

Modified: incubator/ooo/trunk/main/sw/source/core/doc/docnew.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/core/doc/docnew.cxx?rev=1172362&r1=1172361&r2=1172362&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/core/doc/docnew.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/core/doc/docnew.cxx Sun Sep 18 21:24:32 2011
@@ -529,6 +529,7 @@ SwDoc::~SwDoc()
 	delete pPgPViewPrtData;
 
 	mbDtor = sal_True;
+	pLayoutPtr.reset();
 
 	delete pRedlineTbl;
 	delete pUnoCrsrTbl;

Modified: incubator/ooo/trunk/main/sw/source/core/view/vnew.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/core/view/vnew.cxx?rev=1172362&r1=1172361&r2=1172362&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/core/view/vnew.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/core/view/vnew.cxx Sun Sep 18 21:24:32 2011
@@ -145,6 +145,17 @@ void ViewShell::Init( const SwViewOption
 			// 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() );
+
+			// mba: the layout refactoring overlooked an important detail
+			// prior to that change, the layout always was destroyed in the dtor of swdoc
+			// it is necessary to suppress notifications in the layout when the layout is discarded
in its dtor
+			// unfortunately this was done by asking whether the doc is in dtor - though the correct
question should
+			// have been if the rootfrm is in dtor (or even better: discard the layout before the
SwRootFrm is destroyed!)
+			// SwDoc::IsInDtor() is used at several places all over the code that need to be checked
whether 
+			// "pDoc->IsInDtor()" means what is says or in fact should check for "pRootFrm->IsInDtor()".
As this will take some time, I decided
+			// to postpone that investigations and the changes it will bring to the 3.5 release and
for 3.4 make sure 
+			// that the layout still gets destroyed in the doc dtor. This is done by sharing "the"
layout (that we still have) with the doc.
+			GetDoc()->ShareLayout( pLayout );
         }
     }
 	SizeChgNotify();	//swmod 071108



Mime
View raw message