Kaydet (Commit) 76631b6b authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: fdo#81147 fix mismatching drawlayer and docshell colorlists

a bit of mis-merge + a bit of underlying crashiness

regression from 378dc6ef

Change-Id: Id0f7b6b6f13e1ec70dc900c21d2d020a44cf6081
üst 86de78ce
...@@ -678,14 +678,6 @@ void SwDoc::SetDocShell( SwDocShell* pDSh ) ...@@ -678,14 +678,6 @@ void SwDoc::SetDocShell( SwDocShell* pDSh )
mpLinkMgr->SetPersist( mpDocShell ); mpLinkMgr->SetPersist( mpDocShell );
if( GetDocumentDrawModelManager().GetDrawModel() )
{
GetDocumentDrawModelManager().GetDrawModel()->SetObjectShell( mpDocShell );
GetDocumentDrawModelManager().GetDrawModel()->SetPersist( mpDocShell );
OSL_ENSURE( GetDocumentDrawModelManager().GetDrawModel()->GetPersist() == GetPersist(),
"draw model's persist is out of sync" );
}
// set DocShell pointer also on DrawModel // set DocShell pointer also on DrawModel
InitDrawModelAndDocShell(mpDocShell, GetDocumentDrawModelManager().GetDrawModel()); InitDrawModelAndDocShell(mpDocShell, GetDocumentDrawModelManager().GetDrawModel());
OSL_ENSURE(!GetDocumentDrawModelManager().GetDrawModel() || OSL_ENSURE(!GetDocumentDrawModelManager().GetDrawModel() ||
......
...@@ -63,7 +63,19 @@ void InitDrawModelAndDocShell(SwDocShell* pSwDocShell, SwDrawModel* pSwDrawDocum ...@@ -63,7 +63,19 @@ void InitDrawModelAndDocShell(SwDocShell* pSwDocShell, SwDrawModel* pSwDrawDocum
else else
{ {
// Use the ColorTable which is used at the DrawingLayer's SdrModel // Use the ColorTable which is used at the DrawingLayer's SdrModel
pSwDocShell->PutItem(SvxColorListItem(pSwDrawDocument->GetColorList(), SID_COLOR_TABLE)); XColorListRef xColorList = pSwDrawDocument->GetColorList();
if (xColorList.is())
{
pSwDocShell->PutItem(SvxColorListItem(xColorList, SID_COLOR_TABLE));
}
else
{
// there wasn't one, get the standard and set to the
// docshell and then to the drawdocument
xColorList = XColorList::GetStdColorList();
pSwDocShell->PutItem(SvxColorListItem(xColorList, SID_COLOR_TABLE));
pSwDrawDocument->SetPropertyList(xColorList.get());
}
} }
// add other tables in SfxItemSet of the DocShell // add other tables in SfxItemSet of the DocShell
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment