summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-07-11 14:08:19 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-07-11 14:09:53 +0100
commit76631b6b9147dd83006a6382441d311f668f3286 (patch)
tree721494a87fc621fd7cce86c0c9097c99b4f4d763
parent86de78ce5076ed00c6ad19eae7ab6da7c7a91196 (diff)
Resolves: fdo#81147 fix mismatching drawlayer and docshell colorlists
a bit of mis-merge + a bit of underlying crashiness regression from 378dc6ef20ffd0e657d78dbf6646d48059be4045 Change-Id: Id0f7b6b6f13e1ec70dc900c21d2d020a44cf6081
-rw-r--r--sw/source/core/doc/docnew.cxx8
-rw-r--r--sw/source/uibase/app/docshdrw.cxx14
2 files changed, 13 insertions, 9 deletions
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 9ebd79715114..60a4df370413 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -678,14 +678,6 @@ void SwDoc::SetDocShell( SwDocShell* pDSh )
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
InitDrawModelAndDocShell(mpDocShell, GetDocumentDrawModelManager().GetDrawModel());
OSL_ENSURE(!GetDocumentDrawModelManager().GetDrawModel() ||
diff --git a/sw/source/uibase/app/docshdrw.cxx b/sw/source/uibase/app/docshdrw.cxx
index 2fcfac178864..00e7c2d079cb 100644
--- a/sw/source/uibase/app/docshdrw.cxx
+++ b/sw/source/uibase/app/docshdrw.cxx
@@ -63,7 +63,19 @@ void InitDrawModelAndDocShell(SwDocShell* pSwDocShell, SwDrawModel* pSwDrawDocum
else
{
// 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