View | Details | Raw Unified | Return to issue 117699
Collapse All | Expand All

(-)a/sw/inc/doc.hxx (+4 lines)
Lines 87-92 Link Here
87
#include <memory>
87
#include <memory>
88
88
89
#include <boost/scoped_ptr.hpp>
89
#include <boost/scoped_ptr.hpp>
90
#include <boost/shared_ptr.hpp>
90
91
91
class SwList;
92
class SwList;
92
class SvxForbiddenCharactersTable;
93
class SvxForbiddenCharactersTable;
Lines 327-332 Link Here
327
	SwDefTOXBase_Impl * pDefTOXBases;	// defaults of SwTOXBase's
328
	SwDefTOXBase_Impl * pDefTOXBases;	// defaults of SwTOXBase's
328
329
329
	ViewShell		*pCurrentView;	// SwDoc should get a new member pCurrentView//swmod 071225
330
	ViewShell		*pCurrentView;	// SwDoc should get a new member pCurrentView//swmod 071225
331
	boost::shared_ptr<SwRootFrm> pLayoutPtr;
330
	SdrModel		*pDrawModel;		// StarView Drawing
332
	SdrModel		*pDrawModel;		// StarView Drawing
331
333
332
	SwDocUpdtFld 	*pUpdtFlds;			// Struktur zum Field-Update
334
	SwDocUpdtFld 	*pUpdtFlds;			// Struktur zum Field-Update
Lines 1784-1789 Link Here
1784
	const IDocShell* GetDocShell() const	{ return pDocShell; }
1786
	const IDocShell* GetDocShell() const	{ return pDocShell; }
1785
	void SetDocShell( IDocShell* pDSh );
1787
	void SetDocShell( IDocShell* pDSh );
1786
1788
1789
	void ShareLayout( boost::shared_ptr<SwRootFrm>& rPtr);
1790
1787
	// in case during copying of embedded object a new shell is created,
1791
	// in case during copying of embedded object a new shell is created,
1788
    // it should be set here and cleaned later
1792
    // it should be set here and cleaned later
1789
    void SetTmpDocShell( SfxObjectShellLock rLock )    { xTmpDocShell = rLock; }
1793
    void SetTmpDocShell( SfxObjectShellLock rLock )    { xTmpDocShell = rLock; }
(-)a/sw/source/core/doc/doclay.cxx (+5 lines)
Lines 2429-2431 Link Here
2429
2429
2430
    return aAllLayouts;
2430
    return aAllLayouts;
2431
}//swmod 070825
2431
}//swmod 070825
2432
2433
void SwDoc::ShareLayout(boost::shared_ptr<SwRootFrm>& rPtr)
2434
{
2435
	pLayoutPtr = rPtr;
2436
}
2432
2437
(-)a/sw/source/core/doc/docnew.cxx (+1 lines)
Lines 518-523 Link Here
518
	delete pPgPViewPrtData;
518
	delete pPgPViewPrtData;
519
519
520
	mbDtor = sal_True;
520
	mbDtor = sal_True;
521
	pLayoutPtr.reset();
521
522
522
	delete pRedlineTbl;
523
	delete pRedlineTbl;
523
	delete pUnoCrsrTbl;
524
	delete pUnoCrsrTbl;
(-)a/sw/source/core/view/vnew.cxx (+11 lines)
Lines 145-150 Link Here
145
			// switched to two step construction because creating the layout in SwRootFrm needs a valid pLayout set
145
			// switched to two step construction because creating the layout in SwRootFrm needs a valid pLayout set
146
            pLayout = SwRootFrmPtr(new SwRootFrm( pDoc->GetDfltFrmFmt(), this ));//swmod081016
146
            pLayout = SwRootFrmPtr(new SwRootFrm( pDoc->GetDfltFrmFmt(), this ));//swmod081016
147
            pLayout->Init( pDoc->GetDfltFrmFmt() );
147
            pLayout->Init( pDoc->GetDfltFrmFmt() );
148
149
			// mba: the layout refactoring overlooked an important detail
150
			// prior to that change, the layout always was destroyed in the dtor of swdoc
151
			// it is necessary to suppress notifications in the layout when the layout is discarded in its dtor
152
			// unfortunately this was done by asking whether the doc is in dtor - though the correct question should
153
			// have been if the rootfrm is in dtor (or even better: discard the layout before the SwRootFrm is destroyed!)
154
			// SwDoc::IsInDtor() is used at several places all over the code that need to be checked whether 
155
			// "pDoc->IsInDtor()" means what is says or in fact should check for "pRootFrm->IsInDtor()". As this will take some time, I decided
156
			// to postpone that investigations and the changes it will bring to the 3.5 release and for 3.4 make sure 
157
			// that the layout still gets destroyed in the doc dtor. This is done by sharing "the" layout (that we still have) with the doc.
158
			GetDoc()->ShareLayout( pLayout );
148
        }
159
        }
149
    }
160
    }
150
	SizeChgNotify();	//swmod 071108
161
	SizeChgNotify();	//swmod 071108
(-)a/sw/source/ui/uno/unomod.cxx (+6 lines)
Lines 782-787 Link Here
782
				aOpt.setBrowseMode( bVal );
782
				aOpt.setBrowseMode( bVal );
783
				pView->GetWrtShell().ApplyViewOptions( aOpt );
783
				pView->GetWrtShell().ApplyViewOptions( aOpt );
784
				pView->RecheckBrowseMode();
784
				pView->RecheckBrowseMode();
785
786
				// must be set in mpViewOption as this will overwrite settings in _post!
787
				mpViewOption->setBrowseMode( bVal );
788
789
				// disable multiple layout
790
				pView->GetDocShell()->ToggleBrowserMode(bVal, pView );
785
            }
791
            }
786
		}
792
		}
787
		break;
793
		break;

Return to issue 117699