|
@@ -13,6 +13,7 @@ using System.Xml;
|
|
using System.Xml.Linq;
|
|
using System.Xml.Linq;
|
|
using System.Xml.Xsl;
|
|
using System.Xml.Xsl;
|
|
using TEAMModelOS.SDK.Helper.Common.JsonHelper;
|
|
using TEAMModelOS.SDK.Helper.Common.JsonHelper;
|
|
|
|
+using TEAMModelOS.Test.PPTX.PresentationElement;
|
|
using ColorMap = DocumentFormat.OpenXml.Presentation.ColorMap;
|
|
using ColorMap = DocumentFormat.OpenXml.Presentation.ColorMap;
|
|
using Theme = DocumentFormat.OpenXml.Drawing.Theme;
|
|
using Theme = DocumentFormat.OpenXml.Drawing.Theme;
|
|
|
|
|
|
@@ -20,7 +21,8 @@ namespace TEAMModelOS.Test.PPTX
|
|
{
|
|
{
|
|
public class PresentationConvert
|
|
public class PresentationConvert
|
|
{
|
|
{
|
|
- const double inchpixel = 96.0, inchpt = 72.0, pxBase = 914400.0, rotBase = 60000;
|
|
|
|
|
|
+ const int inchpixel = 96, inchpt = 72, pxBase = 914400, ptBase = 12700;
|
|
|
|
+ const int rotBase = 60000;
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 处理一页PPT的元素
|
|
/// 处理一页PPT的元素
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -28,52 +30,126 @@ namespace TEAMModelOS.Test.PPTX
|
|
/// <param name="theme"></param>
|
|
/// <param name="theme"></param>
|
|
/// <param name="colorMap"></param>
|
|
/// <param name="colorMap"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
- public object GetSlideElement(SlidePart slidePart, Theme theme, ColorMap colorMap) {
|
|
|
|
- List<PPTElement> elements = new List<PPTElement>();
|
|
|
|
|
|
+ public List<HtexElement> GetSlideElement(SlidePart slidePart, Theme theme, ColorMap colorMap)
|
|
|
|
+ {
|
|
|
|
+ List<HtexElement> elements = new List<HtexElement>();
|
|
var shapeTrees = from shap in slidePart.Slide.Descendants<DocumentFormat.OpenXml.Presentation.ShapeTree>() select shap;
|
|
var shapeTrees = from shap in slidePart.Slide.Descendants<DocumentFormat.OpenXml.Presentation.ShapeTree>() select shap;
|
|
- if (shapeTrees.Count() > 0 && shapeTrees.First().ChildElements.Count > 0) {
|
|
|
|
|
|
+ if (shapeTrees.Count() > 0 && shapeTrees.First().ChildElements.Count > 0)
|
|
|
|
+ {
|
|
OpenXmlElementList openXmlElements = shapeTrees.First().ChildElements;
|
|
OpenXmlElementList openXmlElements = shapeTrees.First().ChildElements;
|
|
int index = 0;
|
|
int index = 0;
|
|
- foreach (OpenXmlElement element in openXmlElements) {
|
|
|
|
- PPTElement pptElement = null;
|
|
|
|
- if (element is DocumentFormat.OpenXml.Presentation.Shape shape) {
|
|
|
|
- pptElement = ShapeConvert(shape, theme, colorMap);
|
|
|
|
|
|
+ foreach (OpenXmlElement element in openXmlElements)
|
|
|
|
+ {
|
|
|
|
+ HtexElement pptElement = null;
|
|
|
|
+ if (element is DocumentFormat.OpenXml.Presentation.Shape shape)
|
|
|
|
+ { //p:sp
|
|
|
|
+ pptElement = ShapeConvert(shape, theme, colorMap, index);
|
|
}
|
|
}
|
|
- if (element is DocumentFormat.OpenXml.Presentation.Picture picture)
|
|
|
|
|
|
+ if (element is DocumentFormat.OpenXml.Presentation.Picture picture)//p:pic
|
|
{
|
|
{
|
|
- pptElement = PictureConvert(picture, slidePart);
|
|
|
|
|
|
+ pptElement = PictureConvert(picture, slidePart, index);
|
|
}
|
|
}
|
|
- if (element is DocumentFormat.OpenXml.AlternateContent content)
|
|
|
|
|
|
+ if (element is DocumentFormat.OpenXml.AlternateContent content)//mc:alternatecontent
|
|
{
|
|
{
|
|
- pptElement = AlternateContentConvert(content, theme, colorMap);
|
|
|
|
|
|
+ pptElement = AlternateContentConvert(content, theme, colorMap, index);
|
|
}
|
|
}
|
|
- if (element is DocumentFormat.OpenXml.Presentation.GraphicFrame graphicFrame)
|
|
|
|
|
|
+ if (element is DocumentFormat.OpenXml.Presentation.GraphicFrame graphicFrame)//p:graphicFrame
|
|
{
|
|
{
|
|
- pptElement = GraphicFrameConvert(graphicFrame, theme, colorMap);
|
|
|
|
|
|
+ pptElement = GraphicFrameConvert(graphicFrame, theme, colorMap, index);
|
|
|
|
+ }
|
|
|
|
+ if (element is DocumentFormat.OpenXml.Presentation.GroupShape groupShape)//p:grpSp
|
|
|
|
+ {
|
|
|
|
+ pptElement = GroupShapeConvert(groupShape, theme, colorMap, index);
|
|
|
|
+ }
|
|
|
|
+ if (element is DocumentFormat.OpenXml.Presentation.ConnectionShape connectionShape) // p:cxnSp
|
|
|
|
+ {
|
|
|
|
+ pptElement = ConnectionShapeConvert(connectionShape, theme, colorMap, index);
|
|
|
|
+ }
|
|
|
|
+ if (pptElement != null) {
|
|
|
|
+ index++;
|
|
|
|
+ elements.Add(pptElement);
|
|
}
|
|
}
|
|
-
|
|
|
|
- index++;
|
|
|
|
- elements.Add(pptElement);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return elements;
|
|
return elements;
|
|
}
|
|
}
|
|
- public PPTElement GraphicFrameConvert(GraphicFrame graphicFrame, Theme theme, ColorMap colorMap) {
|
|
|
|
|
|
|
|
- DocumentFormat.OpenXml.Drawing.GraphicData graphicData = graphicFrame.ChildElements.First<DocumentFormat.OpenXml.Drawing.GraphicData>();
|
|
|
|
- if (graphicData != null) {
|
|
|
|
|
|
+ public HtexElement GroupShapeConvert(GroupShape groupShape, Theme theme, ColorMap colorMap, int index)
|
|
|
|
+ {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public HtexElement ConnectionShapeConvert(ConnectionShape connectionShape, Theme theme, ColorMap colorMap, int index)
|
|
|
|
+ {
|
|
|
|
+ string type = "";
|
|
|
|
+ string fillColor = "";
|
|
|
|
+ ShapeProperties properties = connectionShape.ShapeProperties;
|
|
|
|
+ IEnumerable<DocumentFormat.OpenXml.Drawing.PresetGeometry> presetGeometries = GetPresetGeometry(properties);
|
|
|
|
+ if (presetGeometries.Count() > 0)
|
|
|
|
+ {
|
|
|
|
+ type = presetGeometries.FirstOrDefault().Preset;
|
|
|
|
+ }
|
|
|
|
+ HtexConnector element = new HtexConnector() { Type = type };
|
|
|
|
+ if (properties != null)
|
|
|
|
+ {
|
|
|
|
+ if (properties.Transform2D != null)
|
|
|
|
+ {
|
|
|
|
+ element.OffX = properties.Transform2D.Offset.X * inchpixel/pxBase;
|
|
|
|
+ element.OffY = properties.Transform2D.Offset.Y * inchpixel / pxBase;
|
|
|
|
+ element.ExtX = properties.Transform2D.Extents.Cx * inchpixel / pxBase;
|
|
|
|
+ element.ExtY = properties.Transform2D.Extents.Cy * inchpixel / pxBase;
|
|
|
|
+ element.FlipH = properties.Transform2D.HorizontalFlip != null ? BooleanValue.ToBoolean(properties.Transform2D.HorizontalFlip) : false;
|
|
|
|
+ element.FlipV = properties.Transform2D.VerticalFlip != null ? BooleanValue.ToBoolean(properties.Transform2D.VerticalFlip) : false;
|
|
|
|
+ element.Rot = (properties.Transform2D.Rotation != null ? properties.Transform2D.Rotation.Value : 0)/rotBase;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ var headEnd = from shap in properties.Descendants<DocumentFormat.OpenXml.Drawing.HeadEnd>() select shap;
|
|
|
|
+ var tailEnd = from shap in properties.Descendants<DocumentFormat.OpenXml.Drawing.TailEnd>() select shap;
|
|
|
|
+ if (headEnd != null && headEnd.Count() > 0)
|
|
|
|
+ {
|
|
|
|
+ element.HeadEnd = headEnd.First().Type;
|
|
|
|
+ }
|
|
|
|
+ if (tailEnd != null && tailEnd.Count() > 0)
|
|
|
|
+ {
|
|
|
|
+ element.TailEnd = tailEnd.First().Type;
|
|
|
|
+ }
|
|
|
|
+ fillColor = GetPropertieFillColor(properties, theme, colorMap);
|
|
|
|
+ }
|
|
|
|
+ if (string.IsNullOrEmpty(fillColor))
|
|
|
|
+ {
|
|
|
|
+ fillColor = GetShapeStyleColor(connectionShape.ShapeStyle, "Fill", theme);
|
|
|
|
+ }
|
|
|
|
+ element.FillColor = fillColor;
|
|
|
|
+ return element;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public HtexElement GraphicFrameConvert(GraphicFrame graphicFrame, Theme theme, ColorMap colorMap, int index)
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ DocumentFormat.OpenXml.Drawing.GraphicData graphicData = graphicFrame.ChildElements.First<DocumentFormat.OpenXml.Drawing.GraphicData>();
|
|
|
|
+ if (graphicData != null)
|
|
|
|
+ {
|
|
OpenXmlElement element = graphicData.ChildElements.First();
|
|
OpenXmlElement element = graphicData.ChildElements.First();
|
|
if (element != null)
|
|
if (element != null)
|
|
{
|
|
{
|
|
if (element is DocumentFormat.OpenXml.Drawing.Table table)
|
|
if (element is DocumentFormat.OpenXml.Drawing.Table table)
|
|
{
|
|
{
|
|
- return TableConvert(graphicFrame, theme, colorMap);
|
|
|
|
|
|
+ return TableConvert(graphicFrame, theme, colorMap);
|
|
|
|
+ }
|
|
|
|
+ if (element is DocumentFormat.OpenXml.Drawing.Chart chart)
|
|
|
|
+ {
|
|
|
|
+ //return ChartConvert(graphicFrame, theme, colorMap);
|
|
|
|
+ }
|
|
|
|
+ if (element is DocumentFormat.OpenXml.Drawing.Diagram diagram)
|
|
|
|
+ {
|
|
|
|
+ //return DiagramConvert(graphicFrame, theme, colorMap);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return null;
|
|
|
|
|
|
+ return null;
|
|
}
|
|
}
|
|
- public PPTElement TableConvert(GraphicFrame graphicFrame, Theme theme, ColorMap colorMap) {
|
|
|
|
|
|
+ public HtexElement TableConvert(GraphicFrame graphicFrame, Theme theme, ColorMap colorMap)
|
|
|
|
+ {
|
|
|
|
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
@@ -83,91 +159,183 @@ namespace TEAMModelOS.Test.PPTX
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="shape"></param>
|
|
/// <param name="shape"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
- public PPTElement ShapeConvert(Shape shape ,Theme theme ,ColorMap colorMap) {
|
|
|
|
- // shape.base
|
|
|
|
|
|
+ public HtexElement ShapeConvert(Shape shape, Theme theme, ColorMap colorMap, int index)
|
|
|
|
+ {
|
|
|
|
+ // shape.base
|
|
//文字颜色
|
|
//文字颜色
|
|
string textColor = "";
|
|
string textColor = "";
|
|
//填充颜色
|
|
//填充颜色
|
|
string fillColor = "";
|
|
string fillColor = "";
|
|
// 形状类型
|
|
// 形状类型
|
|
- string type = "text";
|
|
|
|
|
|
+ string type = "rect";
|
|
//字体大小
|
|
//字体大小
|
|
int fontSize = 1800;
|
|
int fontSize = 1800;
|
|
//是否闭合形状
|
|
//是否闭合形状
|
|
bool complete = false;
|
|
bool complete = false;
|
|
ShapeProperties properties = shape.ShapeProperties;
|
|
ShapeProperties properties = shape.ShapeProperties;
|
|
- IEnumerable<DocumentFormat.OpenXml.Drawing.PresetGeometry> presetGeometries= GetPresetGeometry(properties);
|
|
|
|
- if (presetGeometries.Count() > 0) {
|
|
|
|
|
|
+ IEnumerable<DocumentFormat.OpenXml.Drawing.PresetGeometry> presetGeometries = GetPresetGeometry(properties);
|
|
|
|
+ IEnumerable<DocumentFormat.OpenXml.Drawing.CustomGeometry> customGeometries = GetCustomGeometry(properties);
|
|
|
|
+ if (presetGeometries.Count() > 0)
|
|
|
|
+ {
|
|
type = presetGeometries.FirstOrDefault().Preset;
|
|
type = presetGeometries.FirstOrDefault().Preset;
|
|
}
|
|
}
|
|
-
|
|
|
|
- DocumentFormat.OpenXml.Drawing.Transform2D transform2D= GetTransform2D(properties);
|
|
|
|
- PPTElement element = new PPTElement() { type = type ,fontSize=fontSize};
|
|
|
|
- if (transform2D != null) {
|
|
|
|
- element.complete = complete;
|
|
|
|
- element.offx = properties.Transform2D.Offset.X;
|
|
|
|
- element.offy = properties.Transform2D.Offset.Y;
|
|
|
|
- element.extx = properties.Transform2D.Extents.Cx;
|
|
|
|
- element.exty = properties.Transform2D.Extents.Cy;
|
|
|
|
- element.flipH = properties.Transform2D.HorizontalFlip != null ? BooleanValue.ToBoolean(properties.Transform2D.HorizontalFlip) : false;
|
|
|
|
- element.flipV = properties.Transform2D.VerticalFlip != null ? BooleanValue.ToBoolean(properties.Transform2D.VerticalFlip) : false;
|
|
|
|
- element.rot = properties.Transform2D.Rotation != null ? properties.Transform2D.Rotation.Value : 0;
|
|
|
|
|
|
+ if (customGeometries.Count() > 0)
|
|
|
|
+ {
|
|
|
|
+ type = "custom";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ DocumentFormat.OpenXml.Drawing.Transform2D transform2D = GetTransform2D(properties);
|
|
|
|
+ HtexContainer element = new HtexContainer() { Type = type };
|
|
|
|
+ if (transform2D != null)
|
|
|
|
+ {
|
|
|
|
+ element.Close = complete;
|
|
|
|
+ element.OffX = transform2D.Offset.X * inchpixel / pxBase;
|
|
|
|
+ element.OffY = transform2D.Offset.Y * inchpixel / pxBase;
|
|
|
|
+ element.ExtX = transform2D.Extents.Cx * inchpixel / pxBase;
|
|
|
|
+ element.ExtY = transform2D.Extents.Cy * inchpixel / pxBase;
|
|
|
|
+ element.FlipH = transform2D.HorizontalFlip != null ? BooleanValue.ToBoolean(transform2D.HorizontalFlip) : false;
|
|
|
|
+ element.FlipV = transform2D.VerticalFlip != null ? BooleanValue.ToBoolean(transform2D.VerticalFlip) : false;
|
|
|
|
+ element.Rot = transform2D.Rotation != null ? transform2D.Rotation.Value : 0;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ element.Index = index;
|
|
///获取runs的文本及颜色信息
|
|
///获取runs的文本及颜色信息
|
|
var runs = from shap in shape.Descendants<DocumentFormat.OpenXml.Drawing.Run>() select shap;
|
|
var runs = from shap in shape.Descendants<DocumentFormat.OpenXml.Drawing.Run>() select shap;
|
|
-
|
|
|
|
|
|
+
|
|
foreach (var run in runs)
|
|
foreach (var run in runs)
|
|
{
|
|
{
|
|
|
|
+ HtexText text = new HtexText() ;
|
|
var runprps = from shap in run.Descendants<DocumentFormat.OpenXml.Drawing.RunProperties>() select shap;
|
|
var runprps = from shap in run.Descendants<DocumentFormat.OpenXml.Drawing.RunProperties>() select shap;
|
|
DocumentFormat.OpenXml.Drawing.RunProperties runProperties = runprps.FirstOrDefault();
|
|
DocumentFormat.OpenXml.Drawing.RunProperties runProperties = runprps.FirstOrDefault();
|
|
|
|
|
|
- if (runProperties != null && fontSize == 1800) {
|
|
|
|
- fontSize = runProperties.FontSize!=null && runProperties.FontSize>0 ?runProperties.FontSize.Value: fontSize;
|
|
|
|
- }
|
|
|
|
|
|
+ if (runProperties != null)
|
|
|
|
+ {
|
|
|
|
+ if (runProperties.FontSize != null) {
|
|
|
|
+ text.FontSize = runProperties.FontSize;
|
|
|
|
+ }
|
|
|
|
+ if (runProperties.Italic != null)
|
|
|
|
+ {
|
|
|
|
+ text.FontItalic = runProperties.Italic;
|
|
|
|
+ }
|
|
|
|
+ if (runProperties.Bold != null)
|
|
|
|
+ {
|
|
|
|
+ text.FontBold = runProperties.Bold;
|
|
|
|
+ }
|
|
|
|
+ //if (runProperties.Italic != null)
|
|
|
|
+ //{
|
|
|
|
+ // text.FontBold = runProperties.Bold;
|
|
|
|
+ //}
|
|
|
|
+ if (runProperties.Underline != null )
|
|
|
|
+ {
|
|
|
|
+ text.FontLine =(int)runProperties.Underline.Value;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
var schemeColor = from shap in run.Descendants<DocumentFormat.OpenXml.Drawing.SchemeColor>() select shap;
|
|
var schemeColor = from shap in run.Descendants<DocumentFormat.OpenXml.Drawing.SchemeColor>() select shap;
|
|
var rgbColors = from shap in run.Descendants<DocumentFormat.OpenXml.Drawing.RgbColorModelHex>() select shap;
|
|
var rgbColors = from shap in run.Descendants<DocumentFormat.OpenXml.Drawing.RgbColorModelHex>() select shap;
|
|
- textColor = GetSchemeColor(schemeColor ,theme ,colorMap);
|
|
|
|
- if (string.IsNullOrEmpty(textColor)) {
|
|
|
|
- textColor = GetRgbColor(rgbColors);
|
|
|
|
|
|
+ textColor = GetSchemeColor(schemeColor, theme, colorMap);
|
|
|
|
+ if (string.IsNullOrEmpty(textColor))
|
|
|
|
+ {
|
|
|
|
+ text.TextColor=textColor = GetRgbColor(rgbColors);
|
|
}
|
|
}
|
|
- element.text = element.text + run.Text.InnerText;
|
|
|
|
|
|
+ text.Text = run.InnerText;
|
|
|
|
+ element.Texts.Add(text);
|
|
}
|
|
}
|
|
- if (string.IsNullOrEmpty(textColor)) {
|
|
|
|
|
|
+ if (string.IsNullOrEmpty(textColor))
|
|
|
|
+ {
|
|
textColor = GetShapeStyleColor(shape.ShapeStyle, "Font", theme);
|
|
textColor = GetShapeStyleColor(shape.ShapeStyle, "Font", theme);
|
|
}
|
|
}
|
|
- if (string.IsNullOrEmpty(fillColor)) {
|
|
|
|
|
|
+ if (string.IsNullOrEmpty(fillColor))
|
|
|
|
+ {
|
|
fillColor = GetShapeStyleColor(shape.ShapeStyle, "Fill", theme);
|
|
fillColor = GetShapeStyleColor(shape.ShapeStyle, "Fill", theme);
|
|
}
|
|
}
|
|
- if (string.IsNullOrEmpty(fillColor)) {
|
|
|
|
|
|
+ if (string.IsNullOrEmpty(fillColor))
|
|
|
|
+ {
|
|
fillColor = GetPropertieFillColor(properties, theme, colorMap);
|
|
fillColor = GetPropertieFillColor(properties, theme, colorMap);
|
|
}
|
|
}
|
|
- element.textColor = textColor;
|
|
|
|
- element.fillColor = fillColor;
|
|
|
|
|
|
+ element.FillColor = fillColor;
|
|
var custGeometrys = from shap in properties.Descendants<DocumentFormat.OpenXml.Drawing.CustomGeometry>() select shap;
|
|
var custGeometrys = from shap in properties.Descendants<DocumentFormat.OpenXml.Drawing.CustomGeometry>() select shap;
|
|
if (custGeometrys.Count() > 0)
|
|
if (custGeometrys.Count() > 0)
|
|
{
|
|
{
|
|
var pathLists = from shap in custGeometrys.First().Descendants<DocumentFormat.OpenXml.Drawing.Path>() select shap;
|
|
var pathLists = from shap in custGeometrys.First().Descendants<DocumentFormat.OpenXml.Drawing.Path>() select shap;
|
|
if (pathLists.Count() > 0)
|
|
if (pathLists.Count() > 0)
|
|
{
|
|
{
|
|
- var moveTos = pathLists.First().ChildElements.OfType<DocumentFormat.OpenXml.Drawing.MoveTo>();
|
|
|
|
- var lineTos = pathLists.First().ChildElements.OfType<DocumentFormat.OpenXml.Drawing.LineTo>();
|
|
|
|
- var BezierTos = pathLists.First().ChildElements.OfType<DocumentFormat.OpenXml.Drawing.CubicBezierCurveTo>();
|
|
|
|
-
|
|
|
|
|
|
+ element.Close = false;
|
|
|
|
+ OpenXmlElementList elements = pathLists.First().ChildElements;
|
|
|
|
+ foreach (OpenXmlElement xmlElement in elements)
|
|
|
|
+ {
|
|
|
|
+ //起点
|
|
|
|
+ if (xmlElement is DocumentFormat.OpenXml.Drawing.MoveTo moveTo)
|
|
|
|
+ {
|
|
|
|
+ DocumentFormat.OpenXml.Drawing.Point point = moveTo.Point;
|
|
|
|
+ HtexMoveToPath moveToPath = new HtexMoveToPath { Type = "MoveTo" };
|
|
|
|
+ moveToPath.Pts.Add(new Point { X = int.Parse(point.X) * inchpixel / pxBase, Y = int.Parse(point.Y) * inchpixel / pxBase });
|
|
|
|
+ element.Paths.Add(moveToPath);
|
|
|
|
+ }
|
|
|
|
+ //连线
|
|
|
|
+ if (xmlElement is DocumentFormat.OpenXml.Drawing.LineTo linTo)
|
|
|
|
+ {
|
|
|
|
+ DocumentFormat.OpenXml.Drawing.Point point = linTo.Point;
|
|
|
|
+ HtexLineToPath lineToPath = new HtexLineToPath { Type = "LineTo" };
|
|
|
|
+ lineToPath.Pts.Add(new Point { X = int.Parse(point.X) * inchpixel / pxBase, Y = int.Parse(point.Y) * inchpixel / pxBase });
|
|
|
|
+ element.Paths.Add(lineToPath);
|
|
|
|
+ }
|
|
|
|
+ //三次贝塞尔曲线
|
|
|
|
+ if (xmlElement is DocumentFormat.OpenXml.Drawing.CubicBezierCurveTo cubicBezierCurveTo)
|
|
|
|
+ {
|
|
|
|
+ OpenXmlElementList list = cubicBezierCurveTo.ChildElements;
|
|
|
|
+ HtexCubicBezPath cubicBezPath = new HtexCubicBezPath { Type = "CubicBez" };
|
|
|
|
+ foreach (var ls in list)
|
|
|
|
+ {
|
|
|
|
+ if (ls is DocumentFormat.OpenXml.Drawing.Point point)
|
|
|
|
+ {
|
|
|
|
+ cubicBezPath.Pts.Add(new Point { X = int.Parse(point.X) * inchpixel / pxBase, Y = int.Parse(point.Y) * inchpixel / pxBase });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ element.Paths.Add(cubicBezPath);
|
|
|
|
+ }
|
|
|
|
+ //二次贝塞尔曲线
|
|
|
|
+ if (xmlElement is DocumentFormat.OpenXml.Drawing.QuadraticBezierCurveTo quadraticBezierCurveTo)
|
|
|
|
+ {
|
|
|
|
+ OpenXmlElementList list = quadraticBezierCurveTo.ChildElements;
|
|
|
|
+ HtexQuadBezPath quadBezPath = new HtexQuadBezPath { Type = "QuadBez" };
|
|
|
|
+ foreach (var ls in list)
|
|
|
|
+ {
|
|
|
|
+ if (ls is DocumentFormat.OpenXml.Drawing.Point point)
|
|
|
|
+ {
|
|
|
|
+ quadBezPath.Pts.Add(new Point { X = int.Parse(point.X) * inchpixel / pxBase, Y =int.Parse(point.Y) * inchpixel / pxBase });
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ element.Paths.Add(quadBezPath);
|
|
|
|
+ }
|
|
|
|
+ //处理曲线
|
|
|
|
+ if (xmlElement is DocumentFormat.OpenXml.Drawing.ArcTo arcTO)
|
|
|
|
+ {
|
|
|
|
+ HtexArcToPath arcToPath = new HtexArcToPath() { WidthRadius = arcTO.WidthRadius, HeightRadius = arcTO.HeightRadius, StartAngle = arcTO.StartAngle, SwingAngle = arcTO.SwingAngle };
|
|
|
|
+ element.Paths.Add(arcToPath);
|
|
|
|
+ }
|
|
|
|
+ ///判断路径是否闭合
|
|
|
|
+ if (xmlElement is DocumentFormat.OpenXml.Drawing.CloseShapePath close)
|
|
|
|
+ {
|
|
|
|
+ if (close != null)
|
|
|
|
+ {
|
|
|
|
+ element.Close = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return element;
|
|
|
|
|
|
+ return element;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 处理图片的元素
|
|
/// 处理图片的元素
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="picture"></param>
|
|
/// <param name="picture"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
- public PPTElement PictureConvert(Picture picture , SlidePart slidePart)
|
|
|
|
|
|
+ public HtexElement PictureConvert(Picture picture, SlidePart slidePart, int index)
|
|
{
|
|
{
|
|
BlipFill blipFill = picture.BlipFill;
|
|
BlipFill blipFill = picture.BlipFill;
|
|
var imageRid = blipFill.Blip.Embed.Value;
|
|
var imageRid = blipFill.Blip.Embed.Value;
|
|
- string type = "picture";
|
|
|
|
IdPartPair idParie = slidePart.Parts.Where(x => x.RelationshipId == imageRid).FirstOrDefault();
|
|
IdPartPair idParie = slidePart.Parts.Where(x => x.RelationshipId == imageRid).FirstOrDefault();
|
|
ImagePart imagePart = (ImagePart)idParie.OpenXmlPart;
|
|
ImagePart imagePart = (ImagePart)idParie.OpenXmlPart;
|
|
var contentType = imagePart.ContentType;
|
|
var contentType = imagePart.ContentType;
|
|
@@ -181,18 +349,18 @@ namespace TEAMModelOS.Test.PPTX
|
|
base64 = "data:" + contentType + ";base64," + base64;
|
|
base64 = "data:" + contentType + ";base64," + base64;
|
|
}
|
|
}
|
|
ShapeProperties properties = picture.ShapeProperties;
|
|
ShapeProperties properties = picture.ShapeProperties;
|
|
- PPTElement element = new PPTElement() { type = type };
|
|
|
|
|
|
+ HtexPicture element = new HtexPicture();
|
|
if (properties != null && properties.Transform2D != null)
|
|
if (properties != null && properties.Transform2D != null)
|
|
{
|
|
{
|
|
- element.offx = properties.Transform2D.Offset.X;
|
|
|
|
- element.offy = properties.Transform2D.Offset.Y;
|
|
|
|
- element.extx = properties.Transform2D.Extents.Cx;
|
|
|
|
- element.exty = properties.Transform2D.Extents.Cy;
|
|
|
|
- element.flipH = properties.Transform2D.HorizontalFlip != null ? BooleanValue.ToBoolean(properties.Transform2D.HorizontalFlip) : false;
|
|
|
|
- element.flipV = properties.Transform2D.VerticalFlip != null ? BooleanValue.ToBoolean(properties.Transform2D.VerticalFlip) : false;
|
|
|
|
- element.rot = properties.Transform2D.Rotation != null ? properties.Transform2D.Rotation.Value : 0;
|
|
|
|
|
|
+ element.OffX = properties.Transform2D.Offset.X * inchpixel / pxBase;
|
|
|
|
+ element.OffY = properties.Transform2D.Offset.Y * inchpixel / pxBase;
|
|
|
|
+ element.ExtX = properties.Transform2D.Extents.Cx * inchpixel / pxBase;
|
|
|
|
+ element.ExtY = properties.Transform2D.Extents.Cy * inchpixel / pxBase;
|
|
|
|
+ element.FlipH = properties.Transform2D.HorizontalFlip != null ? BooleanValue.ToBoolean(properties.Transform2D.HorizontalFlip) : false;
|
|
|
|
+ element.FlipV = properties.Transform2D.VerticalFlip != null ? BooleanValue.ToBoolean(properties.Transform2D.VerticalFlip) : false;
|
|
|
|
+ element.Rot = properties.Transform2D.Rotation != null ? properties.Transform2D.Rotation.Value : 0;
|
|
}
|
|
}
|
|
- element.text = base64;
|
|
|
|
|
|
+ element.Data = base64;
|
|
return element;
|
|
return element;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -200,16 +368,18 @@ namespace TEAMModelOS.Test.PPTX
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="picture"></param>
|
|
/// <param name="picture"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
- public PPTElement AlternateContentConvert(AlternateContent content, Theme theme, ColorMap colorMap)
|
|
|
|
|
|
+ public HtexElement AlternateContentConvert(AlternateContent content, Theme theme, ColorMap colorMap, int index)
|
|
{
|
|
{
|
|
- AlternateContentChoice choice= content.ChildElements.First<AlternateContentChoice>();
|
|
|
|
|
|
+ AlternateContentChoice choice = content.ChildElements.First<AlternateContentChoice>();
|
|
OpenXmlElement element = choice.ChildElements.First();
|
|
OpenXmlElement element = choice.ChildElements.First();
|
|
- if (element != null) {
|
|
|
|
|
|
+ if (element != null)
|
|
|
|
+ {
|
|
if (element is DocumentFormat.OpenXml.Presentation.Shape shape)
|
|
if (element is DocumentFormat.OpenXml.Presentation.Shape shape)
|
|
{
|
|
{
|
|
var textMaths = from shap in shape.Descendants<TextMath>() select shap;
|
|
var textMaths = from shap in shape.Descendants<TextMath>() select shap;
|
|
- if (textMaths.Count() > 0) {
|
|
|
|
- return MathConvert(shape ,theme ,colorMap);
|
|
|
|
|
|
+ if (textMaths.Count() > 0)
|
|
|
|
+ {
|
|
|
|
+ return MathConvert(shape, theme, colorMap);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -222,7 +392,8 @@ namespace TEAMModelOS.Test.PPTX
|
|
/// <param name="theme"></param>
|
|
/// <param name="theme"></param>
|
|
/// <param name="colorMap"></param>
|
|
/// <param name="colorMap"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
- public PPTElement MathConvert(DocumentFormat.OpenXml.Presentation.Shape shape, Theme theme, ColorMap colorMap) {
|
|
|
|
|
|
+ public HtexElement MathConvert(DocumentFormat.OpenXml.Presentation.Shape shape, Theme theme, ColorMap colorMap)
|
|
|
|
+ {
|
|
//文字颜色
|
|
//文字颜色
|
|
string textColor = "";
|
|
string textColor = "";
|
|
//填充颜色
|
|
//填充颜色
|
|
@@ -240,26 +411,27 @@ namespace TEAMModelOS.Test.PPTX
|
|
// type = presetGeometries.FirstOrDefault().Preset;
|
|
// type = presetGeometries.FirstOrDefault().Preset;
|
|
//}
|
|
//}
|
|
DocumentFormat.OpenXml.Drawing.Transform2D transform2D = GetTransform2D(properties);
|
|
DocumentFormat.OpenXml.Drawing.Transform2D transform2D = GetTransform2D(properties);
|
|
- PPTElement element = new PPTElement() { type = type, fontSize = fontSize };
|
|
|
|
|
|
+ HtexContainer element = new HtexContainer() { Type = type };
|
|
if (transform2D != null)
|
|
if (transform2D != null)
|
|
{
|
|
{
|
|
- element.complete = complete;
|
|
|
|
- element.offx = properties.Transform2D.Offset.X;
|
|
|
|
- element.offy = properties.Transform2D.Offset.Y;
|
|
|
|
- element.extx = properties.Transform2D.Extents.Cx;
|
|
|
|
- element.exty = properties.Transform2D.Extents.Cy;
|
|
|
|
- element.flipH = properties.Transform2D.HorizontalFlip != null ? BooleanValue.ToBoolean(properties.Transform2D.HorizontalFlip) : false;
|
|
|
|
- element.flipV = properties.Transform2D.VerticalFlip != null ? BooleanValue.ToBoolean(properties.Transform2D.VerticalFlip) : false;
|
|
|
|
- element.rot = properties.Transform2D.Rotation != null ? properties.Transform2D.Rotation.Value : 0;
|
|
|
|
|
|
+ element.Close = complete;
|
|
|
|
+ element.OffX = properties.Transform2D.Offset.X * inchpixel / pxBase;
|
|
|
|
+ element.OffY = properties.Transform2D.Offset.Y * inchpixel / pxBase;
|
|
|
|
+ element.ExtX = properties.Transform2D.Extents.Cx * inchpixel / pxBase;
|
|
|
|
+ element.ExtY = properties.Transform2D.Extents.Cy * inchpixel / pxBase;
|
|
|
|
+ element.FlipH = properties.Transform2D.HorizontalFlip != null ? BooleanValue.ToBoolean(properties.Transform2D.HorizontalFlip) : false;
|
|
|
|
+ element.FlipV = properties.Transform2D.VerticalFlip != null ? BooleanValue.ToBoolean(properties.Transform2D.VerticalFlip) : false;
|
|
|
|
+ element.Rot = properties.Transform2D.Rotation != null ? properties.Transform2D.Rotation.Value : 0;
|
|
}
|
|
}
|
|
//获取行内样式
|
|
//获取行内样式
|
|
- if (string.IsNullOrEmpty(textColor)) {
|
|
|
|
|
|
+ if (string.IsNullOrEmpty(textColor))
|
|
|
|
+ {
|
|
var rgbColor = from shap in shape.TextBody.Descendants<DocumentFormat.OpenXml.Drawing.RgbColorModelHex>() select shap;
|
|
var rgbColor = from shap in shape.TextBody.Descendants<DocumentFormat.OpenXml.Drawing.RgbColorModelHex>() select shap;
|
|
- textColor =GetRgbColor(rgbColor);
|
|
|
|
|
|
+ textColor = GetRgbColor(rgbColor);
|
|
if (string.IsNullOrEmpty(textColor))
|
|
if (string.IsNullOrEmpty(textColor))
|
|
{
|
|
{
|
|
var schemes = from shap in shape.TextBody.Descendants<DocumentFormat.OpenXml.Drawing.SchemeColor>() select shap;
|
|
var schemes = from shap in shape.TextBody.Descendants<DocumentFormat.OpenXml.Drawing.SchemeColor>() select shap;
|
|
- textColor = GetSchemeColor(schemes ,theme ,colorMap);
|
|
|
|
|
|
+ textColor = GetSchemeColor(schemes, theme, colorMap);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (string.IsNullOrEmpty(textColor))
|
|
if (string.IsNullOrEmpty(textColor))
|
|
@@ -274,27 +446,28 @@ namespace TEAMModelOS.Test.PPTX
|
|
{
|
|
{
|
|
fillColor = GetPropertieFillColor(properties, theme, colorMap);
|
|
fillColor = GetPropertieFillColor(properties, theme, colorMap);
|
|
}
|
|
}
|
|
- element.fillColor = fillColor;
|
|
|
|
- element.textColor = textColor;
|
|
|
|
|
|
+ element.FillColor = fillColor;
|
|
var textMaths = from shap in shape.Descendants<TextMath>() select shap;
|
|
var textMaths = from shap in shape.Descendants<TextMath>() select shap;
|
|
- var math= textMaths.First<TextMath>();
|
|
|
|
|
|
+ var math = textMaths.First<TextMath>();
|
|
string elementData = ProcessOMath(math.InnerXml);
|
|
string elementData = ProcessOMath(math.InnerXml);
|
|
- element.text = elementData;
|
|
|
|
- return element;
|
|
|
|
|
|
+ element.Texts.Add(new HtexText { TextColor = textColor, Text = elementData, FontSize = fontSize });
|
|
|
|
+ return element;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 处理元素的Transform2D属性
|
|
/// 处理元素的Transform2D属性
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="properties"></param>
|
|
/// <param name="properties"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
- public DocumentFormat.OpenXml.Drawing.Transform2D GetTransform2D(ShapeProperties properties) {
|
|
|
|
- if (properties != null) {
|
|
|
|
|
|
+ public DocumentFormat.OpenXml.Drawing.Transform2D GetTransform2D(ShapeProperties properties)
|
|
|
|
+ {
|
|
|
|
+ if (properties != null)
|
|
|
|
+ {
|
|
return properties.Transform2D;
|
|
return properties.Transform2D;
|
|
}
|
|
}
|
|
- return null;
|
|
|
|
|
|
+ return null;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <summary>
|
|
- /// 处理元素的Transform2D属性
|
|
|
|
|
|
+ /// 处理元素的Transform2D 系统默认的元素
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="properties"></param>
|
|
/// <param name="properties"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
@@ -307,6 +480,15 @@ namespace TEAMModelOS.Test.PPTX
|
|
}
|
|
}
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
+ public IEnumerable<DocumentFormat.OpenXml.Drawing.CustomGeometry> GetCustomGeometry(ShapeProperties properties)
|
|
|
|
+ {
|
|
|
|
+ if (properties != null)
|
|
|
|
+ {
|
|
|
|
+ var customGeometrys = from shap in properties.Descendants<DocumentFormat.OpenXml.Drawing.CustomGeometry>() select shap;
|
|
|
|
+ return customGeometrys;
|
|
|
|
+ }
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 处理元素属性的填充色
|
|
/// 处理元素属性的填充色
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -318,14 +500,14 @@ namespace TEAMModelOS.Test.PPTX
|
|
if (properties != null)
|
|
if (properties != null)
|
|
{
|
|
{
|
|
var solidFills = from shape in properties.Descendants<DocumentFormat.OpenXml.Drawing.SolidFill>() select shape;
|
|
var solidFills = from shape in properties.Descendants<DocumentFormat.OpenXml.Drawing.SolidFill>() select shape;
|
|
- if ( solidFills.Count() > 0)
|
|
|
|
|
|
+ if (solidFills.Count() > 0)
|
|
{
|
|
{
|
|
var propRgbColor = from shape in solidFills.First().Descendants<DocumentFormat.OpenXml.Drawing.RgbColorModelHex>() select shape;
|
|
var propRgbColor = from shape in solidFills.First().Descendants<DocumentFormat.OpenXml.Drawing.RgbColorModelHex>() select shape;
|
|
fillColor = GetRgbColor(propRgbColor);
|
|
fillColor = GetRgbColor(propRgbColor);
|
|
if (string.IsNullOrEmpty(fillColor))
|
|
if (string.IsNullOrEmpty(fillColor))
|
|
{
|
|
{
|
|
var colorScheme = from shape in solidFills.First().Descendants<DocumentFormat.OpenXml.Drawing.SchemeColor>() select shape;
|
|
var colorScheme = from shape in solidFills.First().Descendants<DocumentFormat.OpenXml.Drawing.SchemeColor>() select shape;
|
|
- fillColor = GetSchemeColor(colorScheme, theme, colorMap);
|
|
|
|
|
|
+ fillColor = GetSchemeColor(colorScheme, theme, colorMap);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -339,9 +521,10 @@ namespace TEAMModelOS.Test.PPTX
|
|
/// <param name="colorType"></param>
|
|
/// <param name="colorType"></param>
|
|
/// <param name="theme"></param>
|
|
/// <param name="theme"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
- public string GetShapeStyleColor(DocumentFormat.OpenXml.Presentation.ShapeStyle shapeStyle, string colorType, Theme theme) {
|
|
|
|
|
|
+ public string GetShapeStyleColor(DocumentFormat.OpenXml.Presentation.ShapeStyle shapeStyle, string colorType, Theme theme)
|
|
|
|
+ {
|
|
if (shapeStyle == null)
|
|
if (shapeStyle == null)
|
|
- {
|
|
|
|
|
|
+ {
|
|
return "";
|
|
return "";
|
|
}
|
|
}
|
|
// 效果颜色
|
|
// 效果颜色
|
|
@@ -390,9 +573,10 @@ namespace TEAMModelOS.Test.PPTX
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="rgbColors"></param>
|
|
/// <param name="rgbColors"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
- public string GetRgbColor(IEnumerable<DocumentFormat.OpenXml.Drawing.RgbColorModelHex> rgbColors) {
|
|
|
|
|
|
+ public string GetRgbColor(IEnumerable<DocumentFormat.OpenXml.Drawing.RgbColorModelHex> rgbColors)
|
|
|
|
+ {
|
|
string rgbColor = "";
|
|
string rgbColor = "";
|
|
- if ( rgbColors.Count() > 0)
|
|
|
|
|
|
+ if (rgbColors.Count() > 0)
|
|
{
|
|
{
|
|
rgbColor = rgbColors.FirstOrDefault().Val;
|
|
rgbColor = rgbColors.FirstOrDefault().Val;
|
|
}
|
|
}
|
|
@@ -403,8 +587,9 @@ namespace TEAMModelOS.Test.PPTX
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="presentationFile"></param>
|
|
/// <param name="presentationFile"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
- public object LoadPresentation(string presentationFile) {
|
|
|
|
- using (PresentationDocument presentationDocument =PresentationDocument.Open(presentationFile, false))
|
|
|
|
|
|
+ public object LoadPresentation(string presentationFile)
|
|
|
|
+ {
|
|
|
|
+ using (PresentationDocument presentationDocument = PresentationDocument.Open(presentationFile, false))
|
|
{
|
|
{
|
|
if (presentationDocument == null)
|
|
if (presentationDocument == null)
|
|
{
|
|
{
|
|
@@ -445,7 +630,7 @@ namespace TEAMModelOS.Test.PPTX
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return null;
|
|
|
|
|
|
+ return null;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -463,7 +648,7 @@ namespace TEAMModelOS.Test.PPTX
|
|
DocumentFormat.OpenXml.Drawing.SystemColor sysColor = colorScheme.Dark1Color.ChildElements.First<DocumentFormat.OpenXml.Drawing.SystemColor>();
|
|
DocumentFormat.OpenXml.Drawing.SystemColor sysColor = colorScheme.Dark1Color.ChildElements.First<DocumentFormat.OpenXml.Drawing.SystemColor>();
|
|
if (sysColor != null)
|
|
if (sysColor != null)
|
|
{
|
|
{
|
|
- return sysColor.LastColor;
|
|
|
|
|
|
+ return sysColor.LastColor;
|
|
}
|
|
}
|
|
DocumentFormat.OpenXml.Drawing.RgbColorModelHex rgbColor = colorScheme.Dark1Color.ChildElements.First<DocumentFormat.OpenXml.Drawing.RgbColorModelHex>();
|
|
DocumentFormat.OpenXml.Drawing.RgbColorModelHex rgbColor = colorScheme.Dark1Color.ChildElements.First<DocumentFormat.OpenXml.Drawing.RgbColorModelHex>();
|
|
if (rgbColor != null)
|
|
if (rgbColor != null)
|
|
@@ -496,7 +681,7 @@ namespace TEAMModelOS.Test.PPTX
|
|
DocumentFormat.OpenXml.Drawing.RgbColorModelHex rgbColor = colorScheme.Accent1Color.ChildElements.First<DocumentFormat.OpenXml.Drawing.RgbColorModelHex>();
|
|
DocumentFormat.OpenXml.Drawing.RgbColorModelHex rgbColor = colorScheme.Accent1Color.ChildElements.First<DocumentFormat.OpenXml.Drawing.RgbColorModelHex>();
|
|
if (rgbColor != null)
|
|
if (rgbColor != null)
|
|
{
|
|
{
|
|
- return rgbColor.Val;
|
|
|
|
|
|
+ return rgbColor.Val;
|
|
}
|
|
}
|
|
return colorStr;
|
|
return colorStr;
|
|
}
|
|
}
|
|
@@ -505,12 +690,12 @@ namespace TEAMModelOS.Test.PPTX
|
|
DocumentFormat.OpenXml.Drawing.SystemColor sysColor = colorScheme.Accent2Color.ChildElements.First<DocumentFormat.OpenXml.Drawing.SystemColor>();
|
|
DocumentFormat.OpenXml.Drawing.SystemColor sysColor = colorScheme.Accent2Color.ChildElements.First<DocumentFormat.OpenXml.Drawing.SystemColor>();
|
|
if (sysColor != null)
|
|
if (sysColor != null)
|
|
{
|
|
{
|
|
- return sysColor.LastColor;
|
|
|
|
|
|
+ return sysColor.LastColor;
|
|
}
|
|
}
|
|
DocumentFormat.OpenXml.Drawing.RgbColorModelHex rgbColor = colorScheme.Accent2Color.ChildElements.First<DocumentFormat.OpenXml.Drawing.RgbColorModelHex>();
|
|
DocumentFormat.OpenXml.Drawing.RgbColorModelHex rgbColor = colorScheme.Accent2Color.ChildElements.First<DocumentFormat.OpenXml.Drawing.RgbColorModelHex>();
|
|
if (rgbColor != null)
|
|
if (rgbColor != null)
|
|
{
|
|
{
|
|
- return rgbColor.Val;
|
|
|
|
|
|
+ return rgbColor.Val;
|
|
}
|
|
}
|
|
return colorStr;
|
|
return colorStr;
|
|
}
|
|
}
|
|
@@ -524,7 +709,7 @@ namespace TEAMModelOS.Test.PPTX
|
|
DocumentFormat.OpenXml.Drawing.RgbColorModelHex rgbColor = colorScheme.Accent3Color.ChildElements.First<DocumentFormat.OpenXml.Drawing.RgbColorModelHex>();
|
|
DocumentFormat.OpenXml.Drawing.RgbColorModelHex rgbColor = colorScheme.Accent3Color.ChildElements.First<DocumentFormat.OpenXml.Drawing.RgbColorModelHex>();
|
|
if (rgbColor != null)
|
|
if (rgbColor != null)
|
|
{
|
|
{
|
|
- return rgbColor.Val;
|
|
|
|
|
|
+ return rgbColor.Val;
|
|
}
|
|
}
|
|
return colorStr;
|
|
return colorStr;
|
|
}
|
|
}
|
|
@@ -580,7 +765,7 @@ namespace TEAMModelOS.Test.PPTX
|
|
DocumentFormat.OpenXml.Drawing.RgbColorModelHex rgbColor = colorScheme.Light1Color.ChildElements.First<DocumentFormat.OpenXml.Drawing.RgbColorModelHex>();
|
|
DocumentFormat.OpenXml.Drawing.RgbColorModelHex rgbColor = colorScheme.Light1Color.ChildElements.First<DocumentFormat.OpenXml.Drawing.RgbColorModelHex>();
|
|
if (rgbColor != null)
|
|
if (rgbColor != null)
|
|
{
|
|
{
|
|
- return rgbColor.Val;
|
|
|
|
|
|
+ return rgbColor.Val;
|
|
}
|
|
}
|
|
return colorStr;
|
|
return colorStr;
|
|
}
|
|
}
|
|
@@ -594,7 +779,7 @@ namespace TEAMModelOS.Test.PPTX
|
|
DocumentFormat.OpenXml.Drawing.RgbColorModelHex rgbColor = colorScheme.Light2Color.ChildElements.First<DocumentFormat.OpenXml.Drawing.RgbColorModelHex>();
|
|
DocumentFormat.OpenXml.Drawing.RgbColorModelHex rgbColor = colorScheme.Light2Color.ChildElements.First<DocumentFormat.OpenXml.Drawing.RgbColorModelHex>();
|
|
if (rgbColor != null)
|
|
if (rgbColor != null)
|
|
{
|
|
{
|
|
- return rgbColor.Val;
|
|
|
|
|
|
+ return rgbColor.Val;
|
|
}
|
|
}
|
|
return colorStr;
|
|
return colorStr;
|
|
}
|
|
}
|
|
@@ -603,7 +788,7 @@ namespace TEAMModelOS.Test.PPTX
|
|
DocumentFormat.OpenXml.Drawing.SystemColor sysColor = colorScheme.Hyperlink.ChildElements.First<DocumentFormat.OpenXml.Drawing.SystemColor>();
|
|
DocumentFormat.OpenXml.Drawing.SystemColor sysColor = colorScheme.Hyperlink.ChildElements.First<DocumentFormat.OpenXml.Drawing.SystemColor>();
|
|
if (sysColor != null)
|
|
if (sysColor != null)
|
|
{
|
|
{
|
|
- return sysColor.LastColor;
|
|
|
|
|
|
+ return sysColor.LastColor;
|
|
}
|
|
}
|
|
DocumentFormat.OpenXml.Drawing.RgbColorModelHex rgbColor = colorScheme.Hyperlink.ChildElements.First<DocumentFormat.OpenXml.Drawing.RgbColorModelHex>();
|
|
DocumentFormat.OpenXml.Drawing.RgbColorModelHex rgbColor = colorScheme.Hyperlink.ChildElements.First<DocumentFormat.OpenXml.Drawing.RgbColorModelHex>();
|
|
if (rgbColor != null)
|
|
if (rgbColor != null)
|
|
@@ -617,12 +802,12 @@ namespace TEAMModelOS.Test.PPTX
|
|
DocumentFormat.OpenXml.Drawing.SystemColor sysColor = colorScheme.FollowedHyperlinkColor.ChildElements.First<DocumentFormat.OpenXml.Drawing.SystemColor>();
|
|
DocumentFormat.OpenXml.Drawing.SystemColor sysColor = colorScheme.FollowedHyperlinkColor.ChildElements.First<DocumentFormat.OpenXml.Drawing.SystemColor>();
|
|
if (sysColor != null)
|
|
if (sysColor != null)
|
|
{
|
|
{
|
|
- return sysColor.LastColor;
|
|
|
|
|
|
+ return sysColor.LastColor;
|
|
}
|
|
}
|
|
DocumentFormat.OpenXml.Drawing.RgbColorModelHex rgbColor = colorScheme.FollowedHyperlinkColor.ChildElements.First<DocumentFormat.OpenXml.Drawing.RgbColorModelHex>();
|
|
DocumentFormat.OpenXml.Drawing.RgbColorModelHex rgbColor = colorScheme.FollowedHyperlinkColor.ChildElements.First<DocumentFormat.OpenXml.Drawing.RgbColorModelHex>();
|
|
if (rgbColor != null)
|
|
if (rgbColor != null)
|
|
{
|
|
{
|
|
- return rgbColor.Val;
|
|
|
|
|
|
+ return rgbColor.Val;
|
|
}
|
|
}
|
|
return colorStr;
|
|
return colorStr;
|
|
}
|
|
}
|