private ZipPackageRelationship CreateThemeOverridePart(ZipPackage p, ZipPackagePart partToCopy)
        {
            var id = GetIxFromChartUri(_chart.UriChart.OriginalString);

            ThemeOverrideUri = GetNewUri(p, "/xl/theme/themeOverride{0}.xml", ref id);
            var rel = _chart.Part.CreateRelationship(ThemeOverrideUri, TargetMode.Internal, ExcelPackage.schemaThemeOverrideRelationships);

            ThemeOverridePart = p.CreatePart(ThemeOverrideUri, ExcelPackage.contentTypeThemeOverride);

            ThemeOverrideXml = new XmlDocument();
            ThemeOverrideXml.Load(partToCopy.GetStream());

            foreach (var themeRel in partToCopy.GetRelationships())
            {
                var uri      = OfficeOpenXml.Utils.UriHelper.ResolvePartUri(themeRel.SourceUri, themeRel.TargetUri);
                var toPart   = _chart.Part.Package.CreatePart(uri, PictureStore.GetContentType(uri.OriginalString));
                var imageRel = ThemeOverridePart.CreateRelationship(uri, TargetMode.Internal, themeRel.RelationshipType);
                SetRelIdInThemeDoc(ThemeOverrideXml, themeRel.Id, imageRel.Id);
                var stream = partToCopy.GetStream();
                var b      = stream.GetBuffer();
                toPart.GetStream().Write(b, 0, b.Length);
            }
            ThemeOverrideXml.Save(ThemeOverridePart.GetStream(FileMode.CreateNew));
            partToCopy.Package.Dispose();
            return(rel);
        }