// Load Document void InitDrawModelAndDocShell(SwDocShell* pSwDocShell, SwDrawModel* pSwDrawDocument)
{ if(pSwDrawDocument)
{ if(pSwDocShell == pSwDrawDocument->GetObjectShell())
{ // association already done, nothing to do
} else
{ // set object shell (mainly for FormControl stuff), maybe zero
pSwDrawDocument->SetObjectShell(pSwDocShell);
// set persist, maybe zero
pSwDrawDocument->SetPersist(pSwDocShell);
// get and decide on the color table to use if(pSwDocShell)
{ const SvxColorListItem* pColItemFromDocShell = pSwDocShell->GetItem(SID_COLOR_TABLE);
if(pColItemFromDocShell)
{ // the DocShell has a ColorTable, use it also in DrawingLayer const XColorListRef& xCol(pColItemFromDocShell->GetColorList());
pSwDrawDocument->SetPropertyList(static_cast<XPropertyList*>(xCol.get()));
} else
{ // Use the ColorTable which is used at the DrawingLayer's SdrModel
XColorListRef xColorList = pSwDrawDocument->GetColorList(); if (xColorList.is())
{
pSwDocShell->PutItem(SvxColorListItem(xColorList, SID_COLOR_TABLE));
} elseif (!comphelper::IsFuzzing())
{ // 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);
}
}
// add other tables in SfxItemSet of the DocShell
pSwDocShell->PutItem(SvxGradientListItem(pSwDrawDocument->GetGradientList(), SID_GRADIENT_LIST));
pSwDocShell->PutItem(SvxHatchListItem(pSwDrawDocument->GetHatchList(), SID_HATCH_LIST));
pSwDocShell->PutItem(SvxBitmapListItem(pSwDrawDocument->GetBitmapList(), SID_BITMAP_LIST));
pSwDocShell->PutItem(SvxPatternListItem(pSwDrawDocument->GetPatternList(), SID_PATTERN_LIST));
pSwDocShell->PutItem(SvxDashListItem(pSwDrawDocument->GetDashList(), SID_DASH_LIST));
pSwDocShell->PutItem(SvxLineEndListItem(pSwDrawDocument->GetLineEndList(), SID_LINEEND_LIST));
}
rOutliner.SetHyphenator(xHyphenator);
}
} elseif(pSwDocShell)
{ // fallback: add the default color list to have one when someone requests it from the DocShell
pSwDocShell->PutItem(SvxColorListItem(XColorList::GetStdColorList(), SID_COLOR_TABLE));
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.