private void EnsureHasLinksToStylesheets(HtmlDom dom)
{
//clear out any old ones
_dom.RemoveXMatterStyleSheets();
var nameOfXMatterPack = _dom.GetMetaValue("xMatter", _collectionSettings.XMatterPackName);
nameOfXMatterPack = HandleRetiredXMatterPacks(dom, nameOfXMatterPack);
var helper = new XMatterHelper(_dom, nameOfXMatterPack, _fileLocator);
EnsureHasLinkToStyleSheet(dom, Path.GetFileName(helper.PathToStyleSheetForPaperAndOrientation));
string autocssFilePath = ".."+Path.DirectorySeparatorChar+"settingsCollectionStyles.css";
if (RobustFile.Exists(Path.Combine(_folderPath,autocssFilePath)))
EnsureHasLinkToStyleSheet(dom, autocssFilePath);
var customCssFilePath = ".." + Path.DirectorySeparatorChar + "customCollectionStyles.css";
if (RobustFile.Exists(Path.Combine(_folderPath, customCssFilePath)))
EnsureHasLinkToStyleSheet(dom, customCssFilePath);
if (RobustFile.Exists(Path.Combine(_folderPath, "customBookStyles.css")))
EnsureHasLinkToStyleSheet(dom, "customBookStyles.css");
else
EnsureDoesntHaveLinkToStyleSheet(dom, "customBookStyles.css");
}