|
@@ -58,12 +58,482 @@ namespace HTEXLib.Helpers.ShapeHelpers
|
|
|
if (shapeStyle == null) {
|
|
|
return null;
|
|
|
}
|
|
|
- string LineColor = StyleMatrixReferenceColors(shapeStyle.LineReference, slide);
|
|
|
- string FillColor = StyleMatrixReferenceColors(shapeStyle.FillReference, slide);
|
|
|
- string EffectColor = StyleMatrixReferenceColors(shapeStyle.EffectReference, slide);
|
|
|
+ string LineColor = DoMatrixReferenceColors(shapeStyle.LineReference, slide);
|
|
|
+ string FillColor = DoMatrixReferenceColors(shapeStyle.FillReference, slide);
|
|
|
+ string EffectColor = DoMatrixReferenceColors(shapeStyle.EffectReference, slide);
|
|
|
string FontColor = FontReferenceColors(shapeStyle.FontReference, slide);
|
|
|
return new SlideColor { LineColor = LineColor, FillColor = FillColor, EffectColor = EffectColor, FontColor = FontColor };
|
|
|
}
|
|
|
+ public static HTEXLib.Models.HTEX.ShapeStyle DoShapeProperties(GroupShapeProperties shapeProperties, PPTSlide slide, string type, string partForm)
|
|
|
+ {
|
|
|
+ //Outline
|
|
|
+ var lnNode = shapeProperties.GetFirstChild<Outline>();
|
|
|
+ Border border = null;
|
|
|
+ if (lnNode != null)
|
|
|
+ {
|
|
|
+ border = DoOutline(lnNode, slide, type);
|
|
|
+ }
|
|
|
+ Fill fill = new Fill() { type = -1 };
|
|
|
+ var gradFill = shapeProperties.GetFirstChild<GradientFill>();
|
|
|
+ if (gradFill != null)
|
|
|
+ {
|
|
|
+ fill.type = 2;
|
|
|
+ fill.gradientFill = DoGradientFill(gradFill, slide);
|
|
|
+ }
|
|
|
+ var noFill = shapeProperties.GetFirstChild<NoFill>();
|
|
|
+ if (noFill != null)
|
|
|
+ {
|
|
|
+ fill.type = 0;
|
|
|
+ }
|
|
|
+ var pattFill = shapeProperties.GetFirstChild<PatternFill>();
|
|
|
+ if (pattFill != null)
|
|
|
+ {
|
|
|
+ HtexPattFill htexPattFill = DoPattFill(pattFill, slide);
|
|
|
+ fill.type = 4;
|
|
|
+ fill.pattFill = htexPattFill;
|
|
|
+ }
|
|
|
+ var solidFill = shapeProperties.GetFirstChild<SolidFill>();
|
|
|
+ if (solidFill != null)
|
|
|
+ {
|
|
|
+ fill.type = 1;
|
|
|
+ fill.solidFill = DoSolidFill(solidFill, slide);
|
|
|
+ }
|
|
|
+ var groupFill = shapeProperties.GetFirstChild<GroupFill>();
|
|
|
+ if (groupFill != null)
|
|
|
+ {
|
|
|
+ fill.type = 5;
|
|
|
+ // fill.solidFill = ReadSolidFillColors(new SolidFill(solidFill.ToString()), slide);
|
|
|
+ }
|
|
|
+ var blipFill = shapeProperties.GetFirstChild<DocumentFormat.OpenXml.Drawing.BlipFill>();
|
|
|
+ if (blipFill != null)
|
|
|
+ {
|
|
|
+ fill.type = 3;
|
|
|
+ fill.blipFill = DoBlipFill(blipFill, slide, partForm);
|
|
|
+ // fill.solidFill = ReadSolidFillColors(new SolidFill(solidFill.ToString()), slide);
|
|
|
+ }
|
|
|
+ var EffectList = shapeProperties.GetFirstChild<EffectList>();
|
|
|
+ var EffectDag = shapeProperties.GetFirstChild<EffectDag>();
|
|
|
+ var Scene3DType = shapeProperties.GetFirstChild<Scene3DType>();
|
|
|
+ var Shape3DType = shapeProperties.GetFirstChild<Shape3DType>();
|
|
|
+ var ShapePropertiesExtensionList = shapeProperties.GetFirstChild<ShapePropertiesExtensionList>();
|
|
|
+ return new HTEXLib.Models.HTEX.ShapeStyle { fill = fill, border = border };
|
|
|
+ }
|
|
|
+ public static HTEXLib.Models.HTEX.ShapeStyle DoTableProperties(TableProperties shapeProperties, PPTSlide slide, string type, string partForm)
|
|
|
+ {
|
|
|
+ Fill fill = new Fill() { type = -1 };
|
|
|
+ var gradFill = shapeProperties.GetFirstChild<GradientFill>();
|
|
|
+ if (gradFill != null)
|
|
|
+ {
|
|
|
+ fill.type = 2;
|
|
|
+ fill.gradientFill = DoGradientFill(gradFill, slide);
|
|
|
+ }
|
|
|
+ var noFill = shapeProperties.GetFirstChild<NoFill>();
|
|
|
+ if (noFill != null)
|
|
|
+ {
|
|
|
+ fill.type = 0;
|
|
|
+ }
|
|
|
+ var pattFill = shapeProperties.GetFirstChild<PatternFill>();
|
|
|
+ if (pattFill != null)
|
|
|
+ {
|
|
|
+ HtexPattFill htexPattFill = DoPattFill(pattFill, slide);
|
|
|
+ fill.type = 4;
|
|
|
+ fill.pattFill = htexPattFill;
|
|
|
+ }
|
|
|
+ var solidFill = shapeProperties.GetFirstChild<SolidFill>();
|
|
|
+ if (solidFill != null)
|
|
|
+ {
|
|
|
+ fill.type = 1;
|
|
|
+ fill.solidFill = DoSolidFill(solidFill, slide);
|
|
|
+ }
|
|
|
+ var groupFill = shapeProperties.GetFirstChild<GroupFill>();
|
|
|
+ if (groupFill != null)
|
|
|
+ {
|
|
|
+ fill.type = 5;
|
|
|
+ // fill.solidFill = ReadSolidFillColors(new SolidFill(solidFill.ToString()), slide);
|
|
|
+ }
|
|
|
+ var blipFill = shapeProperties.GetFirstChild<DocumentFormat.OpenXml.Drawing.BlipFill>();
|
|
|
+ if (blipFill != null)
|
|
|
+ {
|
|
|
+ fill.type = 3;
|
|
|
+ fill.blipFill = DoBlipFill(blipFill, slide, partForm);
|
|
|
+ // fill.solidFill = ReadSolidFillColors(new SolidFill(solidFill.ToString()), slide);
|
|
|
+ }
|
|
|
+ var EffectList = shapeProperties.GetFirstChild<EffectList>();
|
|
|
+ var EffectDag = shapeProperties.GetFirstChild<EffectDag>();
|
|
|
+ var TableStyle = shapeProperties.GetFirstChild<TableStyle>();
|
|
|
+
|
|
|
+ var TableStyleId = shapeProperties.GetFirstChild<TableStyleId>();
|
|
|
+ var ShapePropertiesExtensionList = shapeProperties.GetFirstChild<DocumentFormat.OpenXml.Drawing.ExtensionList>();
|
|
|
+
|
|
|
+ return new HTEXLib.Models.HTEX.ShapeStyle { fill = fill};
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void DoTableStyle(TableStyle tableStyle, PPTSlide slide, string type, string partForm) {
|
|
|
+ var TableBackground = tableStyle.TableBackground;
|
|
|
+ if (TableBackground != null)
|
|
|
+ {
|
|
|
+ var shapeProperties = TableBackground.GetFirstChild<FillProperties>();
|
|
|
+ Fill fill = DoFillProperties(shapeProperties , partForm,slide );
|
|
|
+ var FillReference = TableBackground.GetFirstChild<FillReference>();
|
|
|
+ DoFillReference(slide, fill, FillReference);
|
|
|
+ //TODO
|
|
|
+ TableBackground.GetFirstChild<EffectPropertiesType>();
|
|
|
+ TableBackground.GetFirstChild<EffectReference>();
|
|
|
+ }
|
|
|
+ //TablePartStyleType
|
|
|
+ var WholeTable = tableStyle.WholeTable;
|
|
|
+ if (WholeTable != null) {
|
|
|
+ DoTablePartStyleType(WholeTable, slide, type, partForm);
|
|
|
+ }
|
|
|
+ var Band1Horizontal = tableStyle.Band1Horizontal;
|
|
|
+ if (Band1Horizontal != null)
|
|
|
+ {
|
|
|
+ DoTablePartStyleType(Band1Horizontal, slide, type, partForm);
|
|
|
+ }
|
|
|
+ var Band2Horizontal = tableStyle.Band2Horizontal;
|
|
|
+ if (Band2Horizontal != null)
|
|
|
+ {
|
|
|
+ DoTablePartStyleType(Band2Horizontal, slide, type, partForm);
|
|
|
+ }
|
|
|
+ var Band1Vertical = tableStyle.Band1Vertical;
|
|
|
+ if (Band1Vertical != null)
|
|
|
+ {
|
|
|
+ DoTablePartStyleType(Band1Vertical, slide, type, partForm);
|
|
|
+ }
|
|
|
+ var Band2Vertical = tableStyle.Band2Vertical;
|
|
|
+ if (Band2Vertical != null)
|
|
|
+ {
|
|
|
+ DoTablePartStyleType(Band2Vertical, slide, type, partForm);
|
|
|
+ }
|
|
|
+ var LastColumn = tableStyle.LastColumn;
|
|
|
+ if (LastColumn != null)
|
|
|
+ {
|
|
|
+ DoTablePartStyleType(LastColumn, slide, type, partForm);
|
|
|
+ }
|
|
|
+ var FirstColumn = tableStyle.FirstColumn;
|
|
|
+ if (FirstColumn != null)
|
|
|
+ {
|
|
|
+ DoTablePartStyleType(FirstColumn, slide, type, partForm);
|
|
|
+ }
|
|
|
+ var FirstRow = tableStyle.FirstRow;
|
|
|
+ if (FirstRow != null)
|
|
|
+ {
|
|
|
+ DoTablePartStyleType(FirstRow, slide, type, partForm);
|
|
|
+ }
|
|
|
+ var LastRow = tableStyle.LastRow;
|
|
|
+ if (LastRow != null)
|
|
|
+ {
|
|
|
+ DoTablePartStyleType(LastRow, slide, type, partForm);
|
|
|
+ }
|
|
|
+ var SoutheastCell = tableStyle.SoutheastCell;
|
|
|
+ if (SoutheastCell != null)
|
|
|
+ {
|
|
|
+ DoTablePartStyleType(SoutheastCell, slide, type, partForm);
|
|
|
+ }
|
|
|
+ var SouthwestCell = tableStyle.SouthwestCell;
|
|
|
+ if (SouthwestCell != null)
|
|
|
+ {
|
|
|
+ DoTablePartStyleType(SouthwestCell, slide, type, partForm);
|
|
|
+ }
|
|
|
+ var NortheastCell = tableStyle.NortheastCell;
|
|
|
+ if (NortheastCell != null)
|
|
|
+ {
|
|
|
+ DoTablePartStyleType(NortheastCell, slide, type, partForm);
|
|
|
+ }
|
|
|
+ var NorthwestCell = tableStyle.NorthwestCell;
|
|
|
+ if (NorthwestCell != null)
|
|
|
+ {
|
|
|
+ DoTablePartStyleType(NorthwestCell, slide, type, partForm);
|
|
|
+ }
|
|
|
+ var ExtensionList = tableStyle.ExtensionList;
|
|
|
+ }
|
|
|
+
|
|
|
+ private static void DoFillReference(PPTSlide slide, Fill fill, FillReference FillReference)
|
|
|
+ {
|
|
|
+ if (FillReference != null)
|
|
|
+ {
|
|
|
+ if (fill.type == -1)
|
|
|
+ {
|
|
|
+ string color = null;
|
|
|
+ if (FillReference.RgbColorModelPercentage != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FillReference.RgbColorModelPercentage);
|
|
|
+ }
|
|
|
+ if (FillReference.RgbColorModelHex != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FillReference.RgbColorModelHex);
|
|
|
+ }
|
|
|
+ if (FillReference.HslColor != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FillReference.HslColor);
|
|
|
+ }
|
|
|
+ if (FillReference.SystemColor != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FillReference.SystemColor, slide);
|
|
|
+ }
|
|
|
+ if (FillReference.SchemeColor != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FillReference.SchemeColor, slide);
|
|
|
+ }
|
|
|
+ if (FillReference.PresetColor != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FillReference.PresetColor);
|
|
|
+ }
|
|
|
+ fill.solidFill = color;
|
|
|
+ fill.type = 2;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private static Fill DoFillProperties(FillProperties shapeProperties , string partForm, PPTSlide slide)
|
|
|
+ {
|
|
|
+ Fill fill = new Fill() { type = -1 };
|
|
|
+ if (shapeProperties != null)
|
|
|
+ {
|
|
|
+
|
|
|
+ var gradFill = shapeProperties.GetFirstChild<GradientFill>();
|
|
|
+ if (gradFill != null)
|
|
|
+ {
|
|
|
+ fill.type = 2;
|
|
|
+ fill.gradientFill = DoGradientFill(gradFill, slide);
|
|
|
+ }
|
|
|
+ var noFill = shapeProperties.GetFirstChild<NoFill>();
|
|
|
+ if (noFill != null)
|
|
|
+ {
|
|
|
+ fill.type = 0;
|
|
|
+ }
|
|
|
+ var pattFill = shapeProperties.GetFirstChild<PatternFill>();
|
|
|
+ if (pattFill != null)
|
|
|
+ {
|
|
|
+ HtexPattFill htexPattFill = DoPattFill(pattFill, slide);
|
|
|
+ fill.type = 4;
|
|
|
+ fill.pattFill = htexPattFill;
|
|
|
+ }
|
|
|
+ var solidFill = shapeProperties.GetFirstChild<SolidFill>();
|
|
|
+ if (solidFill != null)
|
|
|
+ {
|
|
|
+ fill.type = 1;
|
|
|
+ fill.solidFill = DoSolidFill(solidFill, slide);
|
|
|
+ }
|
|
|
+ var groupFill = shapeProperties.GetFirstChild<GroupFill>();
|
|
|
+ if (groupFill != null)
|
|
|
+ {
|
|
|
+ fill.type = 5;
|
|
|
+ // fill.solidFill = ReadSolidFillColors(new SolidFill(solidFill.ToString()), slide);
|
|
|
+ }
|
|
|
+ var blipFill = shapeProperties.GetFirstChild<DocumentFormat.OpenXml.Drawing.BlipFill>();
|
|
|
+ if (blipFill != null)
|
|
|
+ {
|
|
|
+ fill.type = 3;
|
|
|
+ fill.blipFill = DoBlipFill(blipFill, slide, partForm);
|
|
|
+ // fill.solidFill = ReadSolidFillColors(new SolidFill(solidFill.ToString()), slide);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return fill;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void DoTablePartStyleType(TablePartStyleType tablePartStyleType, PPTSlide slide, string type, string partForm) {
|
|
|
+ //表格单元格文本样式。
|
|
|
+ var TableCellTextStyle = tablePartStyleType.GetFirstChild<TableCellTextStyle>();
|
|
|
+ if (TableCellTextStyle != null) {
|
|
|
+ FontStyle fontStyle = new FontStyle { };
|
|
|
+ //字体加粗以及斜体
|
|
|
+ if (TableCellTextStyle.Bold != null && TableCellTextStyle.Bold.Value == BooleanStyleValues.On)
|
|
|
+ {
|
|
|
+ fontStyle.bold = true;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ fontStyle.bold = false;
|
|
|
+ }
|
|
|
+ if (TableCellTextStyle.Italic != null && TableCellTextStyle.Italic.Value == BooleanStyleValues.On)
|
|
|
+ {
|
|
|
+ fontStyle.italic = true;
|
|
|
+ }
|
|
|
+ //字体颜色
|
|
|
+ string color = null;
|
|
|
+ var RgbColorModelPercentage = TableCellTextStyle.GetFirstChild<RgbColorModelPercentage>();
|
|
|
+ if (RgbColorModelPercentage != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(RgbColorModelPercentage);
|
|
|
+ }
|
|
|
+ var RgbColorModelHex = TableCellTextStyle.GetFirstChild<RgbColorModelHex>();
|
|
|
+ if (RgbColorModelHex != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(RgbColorModelHex);
|
|
|
+ }
|
|
|
+ var HslColor = TableCellTextStyle.GetFirstChild<DocumentFormat.OpenXml.Drawing.HslColor>();
|
|
|
+ if (HslColor != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(HslColor);
|
|
|
+ }
|
|
|
+ var SystemColor = TableCellTextStyle.GetFirstChild<SystemColor>();
|
|
|
+ if (SystemColor != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(SystemColor, slide);
|
|
|
+ }
|
|
|
+ var SchemeColor = TableCellTextStyle.GetFirstChild<SchemeColor>();
|
|
|
+ if (SchemeColor != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(SchemeColor, slide);
|
|
|
+ }
|
|
|
+ var PresetColor = TableCellTextStyle.GetFirstChild<PresetColor>();
|
|
|
+ if (PresetColor != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(PresetColor);
|
|
|
+ }
|
|
|
+ fontStyle.color = color;
|
|
|
+ var FontReference = TableCellTextStyle.GetFirstChild<DocumentFormat.OpenXml.Drawing.FontReference>();
|
|
|
+ if (color == null && FontReference != null)
|
|
|
+ {
|
|
|
+
|
|
|
+ if (FontReference.RgbColorModelPercentage != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FontReference.RgbColorModelPercentage);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (FontReference.RgbColorModelHex != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FontReference.RgbColorModelHex);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (FontReference.HslColor != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FontReference.HslColor);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (FontReference.SystemColor != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FontReference.SystemColor, slide);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (FontReference.SchemeColor != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FontReference.SchemeColor, slide);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (FontReference.PresetColor != null)
|
|
|
+ {
|
|
|
+ color = ReadColor(FontReference.PresetColor);
|
|
|
+ }
|
|
|
+ fontStyle.color = color;
|
|
|
+ }
|
|
|
+ //字体属性
|
|
|
+ var font = TableCellTextStyle.GetFirstChild<DocumentFormat.OpenXml.Drawing.Fonts>();
|
|
|
+ var LatinFont= font.LatinFont;
|
|
|
+ var EastAsianFont= font.EastAsianFont;
|
|
|
+ var ComplexScriptFont= font.ComplexScriptFont;
|
|
|
+ if (EastAsianFont != null)
|
|
|
+ {
|
|
|
+ fontStyle.family= DoTextFontType(EastAsianFont,slide);
|
|
|
+ }
|
|
|
+ if (ComplexScriptFont != null)
|
|
|
+ {
|
|
|
+ fontStyle.family = DoTextFontType(ComplexScriptFont, slide);
|
|
|
+ }
|
|
|
+ if (LatinFont != null)
|
|
|
+ {
|
|
|
+ fontStyle.family = DoTextFontType(LatinFont, slide);
|
|
|
+ }
|
|
|
+ var SupplementalFont= font.GetFirstChild<SupplementalFont>();
|
|
|
+ if (SupplementalFont != null) {
|
|
|
+ fontStyle.family = SupplementalFont.Typeface;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //表格单元格样式。
|
|
|
+ var TableCellStyle = tablePartStyleType.GetFirstChild<TableCellStyle>();
|
|
|
+ if (TableCellStyle != null)
|
|
|
+ {
|
|
|
+ var TableCellBorders= TableCellStyle.TableCellBorders;
|
|
|
+ if (TableCellBorders != null) {
|
|
|
+ var LeftBorder = TableCellBorders.LeftBorder;
|
|
|
+ if (LeftBorder != null) {
|
|
|
+ Border border= DoOutline(LeftBorder.Outline, slide, "tbl");
|
|
|
+ if (LeftBorder.LineReference!=null&& border.color.type == -1) {
|
|
|
+ border.color.solidFill=DoMatrixReferenceColors(LeftBorder.LineReference, slide);
|
|
|
+ border.color.type = 2;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var RightBorder = TableCellBorders.RightBorder;
|
|
|
+ if (RightBorder != null)
|
|
|
+ {
|
|
|
+ Border border = DoOutline(RightBorder.Outline, slide, "tbl");
|
|
|
+ if (RightBorder.LineReference != null && border.color.type == -1)
|
|
|
+ {
|
|
|
+ border.color.solidFill = DoMatrixReferenceColors(RightBorder.LineReference, slide);
|
|
|
+ border.color.type = 2;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var TopBorder = TableCellBorders.TopBorder;
|
|
|
+ if (TopBorder != null)
|
|
|
+ {
|
|
|
+ Border border = DoOutline(TopBorder.Outline, slide, "tbl");
|
|
|
+ if (TopBorder.LineReference != null && border.color.type == -1)
|
|
|
+ {
|
|
|
+ border.color.solidFill = DoMatrixReferenceColors(TopBorder.LineReference, slide);
|
|
|
+ border.color.type = 2;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var BottomBorder = TableCellBorders.BottomBorder;
|
|
|
+ if (BottomBorder != null)
|
|
|
+ {
|
|
|
+ Border border = DoOutline(BottomBorder.Outline, slide, "tbl");
|
|
|
+ if (BottomBorder.LineReference != null && border.color.type == -1)
|
|
|
+ {
|
|
|
+ border.color.solidFill = DoMatrixReferenceColors(BottomBorder.LineReference, slide);
|
|
|
+ border.color.type = 2;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var InsideHorizontalBorder = TableCellBorders.InsideHorizontalBorder;
|
|
|
+ if (InsideHorizontalBorder != null)
|
|
|
+ {
|
|
|
+ Border border = DoOutline(InsideHorizontalBorder.Outline, slide, "tbl");
|
|
|
+ if (InsideHorizontalBorder.LineReference != null && border.color.type == -1)
|
|
|
+ {
|
|
|
+ border.color.solidFill = DoMatrixReferenceColors(InsideHorizontalBorder.LineReference, slide);
|
|
|
+ border.color.type = 2;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var InsideVerticalBorder = TableCellBorders.InsideVerticalBorder;
|
|
|
+ if (InsideVerticalBorder != null)
|
|
|
+ {
|
|
|
+ Border border = DoOutline(InsideVerticalBorder.Outline, slide, "tbl");
|
|
|
+ if (InsideVerticalBorder.LineReference != null && border.color.type == -1)
|
|
|
+ {
|
|
|
+ border.color.solidFill = DoMatrixReferenceColors(InsideVerticalBorder.LineReference, slide);
|
|
|
+ border.color.type = 2;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var TopLeftToBottomRightBorder = TableCellBorders.TopLeftToBottomRightBorder;
|
|
|
+ if (TopLeftToBottomRightBorder != null)
|
|
|
+ {
|
|
|
+ Border border = DoOutline(TopLeftToBottomRightBorder.Outline, slide, "tbl");
|
|
|
+ if (TopLeftToBottomRightBorder.LineReference != null && border.color.type == -1)
|
|
|
+ {
|
|
|
+ border.color.solidFill = DoMatrixReferenceColors(TopLeftToBottomRightBorder.LineReference, slide);
|
|
|
+ border.color.type = 2;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var TopRightToBottomLeftBorder = TableCellBorders.TopRightToBottomLeftBorder;
|
|
|
+ if (TopRightToBottomLeftBorder != null)
|
|
|
+ {
|
|
|
+ Border border = DoOutline(TopRightToBottomLeftBorder.Outline, slide, "tbl");
|
|
|
+ if (TopRightToBottomLeftBorder.LineReference != null && border.color.type == -1)
|
|
|
+ {
|
|
|
+ border.color.solidFill = DoMatrixReferenceColors(TopRightToBottomLeftBorder.LineReference, slide);
|
|
|
+ border.color.type = 2;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var FillProperties = TableCellStyle.GetFirstChild<FillProperties>();
|
|
|
+ Fill fill = DoFillProperties(FillProperties, partForm, slide);
|
|
|
+ var FillReference = TableCellStyle.GetFirstChild<FillReference>();
|
|
|
+ DoFillReference(slide, fill, FillReference);
|
|
|
+ //TODO
|
|
|
+ var Cell3DProperties = TableCellStyle.GetFirstChild<Cell3DProperties>();
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
/// <summary>
|
|
|
///
|
|
|
/// </summary>
|
|
@@ -75,7 +545,7 @@ namespace HTEXLib.Helpers.ShapeHelpers
|
|
|
Border border = null;
|
|
|
if (lnNode != null)
|
|
|
{
|
|
|
- border = DoLn(lnNode, slide,type);
|
|
|
+ border = DoOutline(lnNode, slide,type);
|
|
|
}
|
|
|
Fill fill = new Fill() { type = -1 };
|
|
|
var gradFill = shapeProperties.GetFirstChild<GradientFill>();
|
|
@@ -100,7 +570,7 @@ namespace HTEXLib.Helpers.ShapeHelpers
|
|
|
if (solidFill != null)
|
|
|
{
|
|
|
fill.type = 1;
|
|
|
- fill.solidFill = ReadSolidFillColors(solidFill, slide);
|
|
|
+ fill.solidFill = DoSolidFill(solidFill, slide);
|
|
|
}
|
|
|
var groupFill = shapeProperties.GetFirstChild<GroupFill>();
|
|
|
if (groupFill != null)
|
|
@@ -148,7 +618,7 @@ namespace HTEXLib.Helpers.ShapeHelpers
|
|
|
if (solidFill != null)
|
|
|
{
|
|
|
fill.type = 1;
|
|
|
- fill.solidFill = ReadSolidFillColors(solidFill, slide);
|
|
|
+ fill.solidFill = DoSolidFill(solidFill, slide);
|
|
|
}
|
|
|
var groupFill = shapeProperties.GetFirstChild<GroupFill>();
|
|
|
if (groupFill != null)
|
|
@@ -304,12 +774,15 @@ namespace HTEXLib.Helpers.ShapeHelpers
|
|
|
//TODO 图片元素的更多信息需要后期继续实现,如滤镜,裁剪,图片颜色,图片校正等
|
|
|
return htexBlipFill;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// a:ln 图形的外边
|
|
|
/// </summary>
|
|
|
/// <param name="shapeProperties"></param>
|
|
|
/// <param name="slide"></param>
|
|
|
- public static Border DoLn(DocumentFormat.OpenXml.Drawing.Outline outline, PPTSlide slide,string Shapetype) {
|
|
|
+ public static Border DoOutline(DocumentFormat.OpenXml.Drawing.Outline outline, PPTSlide slide,string Shapetype) {
|
|
|
Border border = new Border() {color= new Fill { type=-1} };
|
|
|
//20.1.10.35 EMUs. 1 pt = 12700 EMUs.
|
|
|
double? Width = null;
|
|
@@ -376,7 +849,7 @@ namespace HTEXLib.Helpers.ShapeHelpers
|
|
|
if (solidFill != null)
|
|
|
{
|
|
|
border.color.type = 1;
|
|
|
- border.color.solidFill = ReadSolidFillColors(solidFill, slide);
|
|
|
+ border.color.solidFill = DoSolidFill(solidFill, slide);
|
|
|
}
|
|
|
if (Width!=null && Width > 0) {
|
|
|
border.type = "solid";
|
|
@@ -653,7 +1126,6 @@ namespace HTEXLib.Helpers.ShapeHelpers
|
|
|
|
|
|
public static string ColorTypeColors(GradientStop Color, PPTSlide slide)
|
|
|
{
|
|
|
- //TODO 还有其他来源的颜色 派生的子类
|
|
|
string FontColor = "";
|
|
|
if (Color.RgbColorModelHex != null)
|
|
|
{
|
|
@@ -683,7 +1155,6 @@ namespace HTEXLib.Helpers.ShapeHelpers
|
|
|
}
|
|
|
public static string ColorTypeColors(ColorType Color, PPTSlide slide)
|
|
|
{
|
|
|
- //TODO 还有其他来源的颜色 派生的子类
|
|
|
string FontColor = "";
|
|
|
if (Color.RgbColorModelHex != null)
|
|
|
{
|
|
@@ -741,8 +1212,11 @@ namespace HTEXLib.Helpers.ShapeHelpers
|
|
|
return FontColor;
|
|
|
}
|
|
|
|
|
|
- public static string StyleMatrixReferenceColors(StyleMatrixReferenceType Color, PPTSlide slide) {
|
|
|
+ public static string DoMatrixReferenceColors(StyleMatrixReferenceType Color, PPTSlide slide) {
|
|
|
string FontColor = "";
|
|
|
+ if (Color == null) {
|
|
|
+ return FontColor;
|
|
|
+ }
|
|
|
if (Color.RgbColorModelHex != null)
|
|
|
{
|
|
|
FontColor = ReadColor(Color.RgbColorModelHex);
|
|
@@ -771,7 +1245,7 @@ namespace HTEXLib.Helpers.ShapeHelpers
|
|
|
}
|
|
|
|
|
|
|
|
|
- public static string ReadSolidFillColors(SolidFill Color, PPTSlide slide)
|
|
|
+ public static string DoSolidFill(SolidFill Color, PPTSlide slide)
|
|
|
{
|
|
|
string FontColor = "";
|
|
|
if (Color.RgbColorModelHex != null)
|
|
@@ -828,7 +1302,7 @@ namespace HTEXLib.Helpers.ShapeHelpers
|
|
|
}
|
|
|
public static string ReadColor(DocumentFormat.OpenXml.Drawing.SchemeColor SchemeColor,PPTSlide slide) {
|
|
|
string FontColor = "";
|
|
|
- FontColor = ReadThemeSchemeColor(SchemeColor, slide);
|
|
|
+ FontColor = DoSchemeColor(SchemeColor, slide);
|
|
|
FontColor = "#" + ShapeHelper.ColorToning(SchemeColor.OuterXml, FontColor.Replace("#", ""));
|
|
|
return FontColor;
|
|
|
}
|
|
@@ -854,7 +1328,7 @@ namespace HTEXLib.Helpers.ShapeHelpers
|
|
|
return FontColor;
|
|
|
}
|
|
|
|
|
|
- public static string ReadFontFamilyFromTheme(LatinFont latinFonts, PPTSlide slide)
|
|
|
+ public static string DoTextFontType(TextFontType latinFonts, PPTSlide slide)
|
|
|
{
|
|
|
string FontFamily = "";
|
|
|
FontScheme allSchemeFonts =
|
|
@@ -894,7 +1368,7 @@ namespace HTEXLib.Helpers.ShapeHelpers
|
|
|
}
|
|
|
return FontFamily;
|
|
|
}
|
|
|
- public static string ReadThemeSchemeColor(SchemeColor schemeColor, PPTSlide slide)
|
|
|
+ public static string DoSchemeColor(SchemeColor schemeColor, PPTSlide slide)
|
|
|
{
|
|
|
var light1Color1= slide.SlideLayoutPart.SlideMasterPart.
|
|
|
ThemePart;
|
|
@@ -1040,8 +1514,6 @@ namespace HTEXLib.Helpers.ShapeHelpers
|
|
|
return FontColor;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|