Commit 6f7665d6 authored by Sergey.Konovalov's avatar Sergey.Konovalov Committed by Alexander.Trofimov

убран PresentationSerializeAdapter.js

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@49830 954022d7-b5bf-4e40-9824-e11837661b57
parent d3c2b8e8
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
"../Common/FontsFreeType/font_engine.js", "../Common/FontsFreeType/font_engine.js",
"../Common/FontsFreeType/FontFile.js", "../Common/FontsFreeType/FontFile.js",
"../Common/FontsFreeType/FontManager.js", "../Common/FontsFreeType/FontManager.js",
"../Common/PresentationSerializeAdapter.js",
"../Word/Drawing/HatchPattern.js", "../Word/Drawing/HatchPattern.js",
"../Word/Drawing/Externals.js", "../Word/Drawing/Externals.js",
"../Word/Drawing/Graphics.js", "../Word/Drawing/Graphics.js",
......
...@@ -83,7 +83,6 @@ ...@@ -83,7 +83,6 @@
"../.Common/Charts/libraries/hsv.js", "../.Common/Charts/libraries/hsv.js",
"../.Common/Charts/libraries/rgbcolor.js", "../.Common/Charts/libraries/rgbcolor.js",
"../Common/PresentationSerializeAdapter.js",
"../Word/Editor/SerializeCommon.js", "../Word/Editor/SerializeCommon.js",
......
...@@ -65,7 +65,6 @@ ...@@ -65,7 +65,6 @@
"../Common/FontsFreeType/font_engine.js", "../Common/FontsFreeType/font_engine.js",
"../Common/FontsFreeType/FontFile.js", "../Common/FontsFreeType/FontFile.js",
"../Common/FontsFreeType/FontManager.js", "../Common/FontsFreeType/FontManager.js",
"../Common/PresentationSerializeAdapter.js",
"../Word/Drawing/Externals.js", "../Word/Drawing/Externals.js",
"../Word/Drawing/AllFonts.js", "../Word/Drawing/AllFonts.js",
"../Word/Drawing/GlobalLoaders.js", "../Word/Drawing/GlobalLoaders.js",
......
This diff is collapsed.
...@@ -1589,8 +1589,8 @@ function Binary_ChartReader(stream, chart, chartAsGroup) ...@@ -1589,8 +1589,8 @@ function Binary_ChartReader(stream, chart, chartAsGroup)
} }
else if ( c_oSer_ChartType.SpPr === type ) else if ( c_oSer_ChartType.SpPr === type )
{ {
var oPresentationSimpleSerializer = new CPPTXContentLoader(); var oPPTXContentLoader = new CPPTXContentLoader();
var oNewSpPr = oPresentationSimpleSerializer.ReadShapeProperty(this.stream); var oNewSpPr = oPPTXContentLoader.ReadShapeProperty(this.stream);
if(null != oNewSpPr && null != oNewSpPr.ln && null != oNewSpPr.ln.Fill && null != oNewSpPr.ln.Fill.fill && FILL_TYPE_NOFILL == oNewSpPr.ln.Fill.fill.type) if(null != oNewSpPr && null != oNewSpPr.ln && null != oNewSpPr.ln.Fill && null != oNewSpPr.ln.Fill.fill && FILL_TYPE_NOFILL == oNewSpPr.ln.Fill.fill.type)
this.chart.bShowBorder = false; this.chart.bShowBorder = false;
else else
...@@ -1605,8 +1605,8 @@ function Binary_ChartReader(stream, chart, chartAsGroup) ...@@ -1605,8 +1605,8 @@ function Binary_ChartReader(stream, chart, chartAsGroup)
var res = c_oSerConstants.ReadOk; var res = c_oSerConstants.ReadOk;
if ( c_oSer_ChartTitlePptxType.TxPptx === type || c_oSer_ChartTitlePptxType.TxPrPptx === type) if ( c_oSer_ChartTitlePptxType.TxPptx === type || c_oSer_ChartTitlePptxType.TxPrPptx === type)
{ {
var oPresentationSimpleSerializer = new CPPTXContentLoader(); var oPPTXContentLoader = new CPPTXContentLoader();
var textBody = oPresentationSimpleSerializer.ReadTextBody(null, this.stream, chartTitlePptx); var textBody = oPPTXContentLoader.ReadTextBody(null, this.stream, chartTitlePptx);
if(c_oSer_ChartTitlePptxType.TxPptx === type) if(c_oSer_ChartTitlePptxType.TxPptx === type)
{ {
chartTitlePptx.txBody = textBody; chartTitlePptx.txBody = textBody;
...@@ -1646,11 +1646,12 @@ function Binary_ChartReader(stream, chart, chartAsGroup) ...@@ -1646,11 +1646,12 @@ function Binary_ChartReader(stream, chart, chartAsGroup)
this.chart.legend.bOverlay = this.stream.GetBool(); this.chart.legend.bOverlay = this.stream.GetBool();
else if ( c_oSer_ChartLegendType.TxPrPptx === type ) else if ( c_oSer_ChartLegendType.TxPrPptx === type )
{ {
var oPresentationSimpleSerializer = new PresentationSimpleSerializer(); var oTempTitle = new CChartTitle(this.chartAsGroup, CHART_TITLE_TYPE_TITLE);
var textBody = oPresentationSimpleSerializer.ReadTextBody(this.stream); var oPPTXContentLoader = new CPPTXContentLoader();
var params = this.ParsePptxParagraph(textBody); var textBody = oPPTXContentLoader.ReadTextBody(null, this.stream, oTempTitle);
if(null != params.font) // var font = this.ParsePptxParagraph(textBody);
this.chart.legend.font = params.font; // if(null != font)
// this.chart.legend.font = font;
} }
else if ( c_oSer_ChartLegendType.LegendEntry === type ) else if ( c_oSer_ChartLegendType.LegendEntry === type )
{ {
...@@ -1675,9 +1676,10 @@ function Binary_ChartReader(stream, chart, chartAsGroup) ...@@ -1675,9 +1676,10 @@ function Binary_ChartReader(stream, chart, chartAsGroup)
oLegendEntry.bDelete = this.stream.GetBool(); oLegendEntry.bDelete = this.stream.GetBool();
else if(c_oSer_ChartLegendEntryType.TxPrPptx === type) else if(c_oSer_ChartLegendEntryType.TxPrPptx === type)
{ {
var oPresentationSimpleSerializer = new PresentationSimpleSerializer(); var oTempTitle = new CChartTitle(this.chartAsGroup, CHART_TITLE_TYPE_TITLE);
var textBody = oPresentationSimpleSerializer.ReadTextBody(this.stream); var oPPTXContentLoader = new CPPTXContentLoader();
oLegendEntry.oTxPr = this.ParsePptxParagraph(textBody); var textBody = oPPTXContentLoader.ReadTextBody(null, this.stream, oTempTitle);
//oLegendEntry.oTxPr = this.ParsePptxParagraph(textBody);
} }
else else
res = c_oSerConstants.ReadUnknown; res = c_oSerConstants.ReadUnknown;
...@@ -1788,13 +1790,10 @@ function Binary_ChartReader(stream, chart, chartAsGroup) ...@@ -1788,13 +1790,10 @@ function Binary_ChartReader(stream, chart, chartAsGroup)
} }
else if ( c_oSer_ChartCatAxType.TxPrPptx === type ) else if ( c_oSer_ChartCatAxType.TxPrPptx === type )
{ {
/*var oPresentationSimpleSerializer = new PresentationSimpleSerializer(); //настройки цифр линейки.
var textBody = oPresentationSimpleSerializer.ReadTextBody(this.stream); var oTxPr = new CChartTitle(this.chartAsGroup, CHART_TITLE_TYPE_TITLE);
var params = this.ParsePptxParagraph(textBody); var oPPTXContentLoader = new CPPTXContentLoader();
if(null != params.font) var textBody = oPPTXContentLoader.ReadTextBody(null, this.stream, oTxPr);
oAx.lablefont = params.font; */
var oPresentationSimpleSerializer = new CPPTXContentLoader();
var textBody = oPresentationSimpleSerializer.ReadTextBody(null, this.stream, oAx.chartTitle);
} }
else else
res = c_oSerConstants.ReadUnknown; res = c_oSerConstants.ReadUnknown;
...@@ -1934,8 +1933,8 @@ function Binary_ChartReader(stream, chart, chartAsGroup) ...@@ -1934,8 +1933,8 @@ function Binary_ChartReader(stream, chart, chartAsGroup)
} }
else if ( c_oSer_ChartSeriesType.SpPr === type ) else if ( c_oSer_ChartSeriesType.SpPr === type )
{ {
var oPresentationSimpleSerializer = new CPPTXContentLoader(); var oPPTXContentLoader = new CPPTXContentLoader();
var oNewSpPr = oPresentationSimpleSerializer.ReadShapeProperty(this.stream); var oNewSpPr = oPPTXContentLoader.ReadShapeProperty(this.stream);
if(null != oNewSpPr.Fill && null != oNewSpPr.Fill.fill && null != oNewSpPr.Fill.fill.color) if(null != oNewSpPr.Fill && null != oNewSpPr.Fill.fill && null != oNewSpPr.Fill.fill.color)
seria.OutlineColor = oNewSpPr.Fill.fill.color; seria.OutlineColor = oNewSpPr.Fill.fill.color;
} }
...@@ -2033,129 +2032,15 @@ function Binary_ChartReader(stream, chart, chartAsGroup) ...@@ -2033,129 +2032,15 @@ function Binary_ChartReader(stream, chart, chartAsGroup)
oOutput.ShowVal = this.stream.GetBool(); oOutput.ShowVal = this.stream.GetBool();
else if ( c_oSer_ChartSeriesDataLabelsType.TxPrPptx === type ) else if ( c_oSer_ChartSeriesDataLabelsType.TxPrPptx === type )
{ {
var oPresentationSimpleSerializer = new PresentationSimpleSerializer(); var oTempTitle = new CChartTitle(this.chartAsGroup, CHART_TITLE_TYPE_TITLE);
var textBody = oPresentationSimpleSerializer.ReadTextBody(this.stream); var oPPTXContentLoader = new CPPTXContentLoader();
oOutput.TxPrPptx = this.ParsePptxParagraph(textBody); var textBody = oPPTXContentLoader.ReadTextBody(null, this.stream, oTempTitle);
//oOutput.TxPrPptx = this.ParsePptxParagraph(textBody);
} }
else else
res = c_oSerConstants.ReadUnknown; res = c_oSerConstants.ReadUnknown;
return res; return res;
}; };
this.ParsePptxParagraph = function(textbody, oDefFont)
{
var res = {text: "", font: null};
for(var i = 0, length = textbody.content.length; i < length; ++i)
{
var par = textbody.content[i];
if(0 != i)
res.text += "\r\n";
else
{
if(null != par.rPr)
{
var api_doc = window["editor"];
var api_sheet = window["Asc"];
var theme = null;
var clrSchemeMap = null;
if(api_doc)
{
if(null != api_doc.WordControl && null != api_doc.WordControl.m_oLogicDocument && null != api_doc.WordControl.m_oLogicDocument)
{
theme = api_doc.WordControl.m_oLogicDocument.theme;
clrSchemeMap = api_doc.WordControl.m_oLogicDocument.clrSchemeMap;
}
}
else if(api_sheet)
{
var editor = api_sheet["editor"];
if(null != editor.wbModel)
{
theme = editor.wbModel.theme;
clrSchemeMap = editor.wbModel.clrSchemeMap;
}
}
if(oDefFont)
res.font = oDefFont;
else
res.font = new asc_CChartFont();
if(null != par.rPr.Bold)
res.font.bold = par.rPr.Bold ? 1 : 0;
if(null != par.rPr.Italic)
res.font.italic = par.rPr.Italic ? 1 : 0;
if(null != par.rPr.Underline)
res.font.underline = par.rPr.Underline ? 1 : 0;
if(null != par.rPr.FontSize)
res.font.size = par.rPr.FontSize;
if(null != par.rPr.FontFamily && null != par.rPr.FontFamily.Name && "" != par.rPr.FontFamily.Name)
{
var sName = par.rPr.FontFamily.Name;
if("+mj-lt" == sName || "+mn-lt" == sName || "+mj-ea" == sName || "+mn-ea" == sName || "+mj-cs" == sName || "+mn-cs" == sName)
{
if(null != theme)
{
var fontScheme = theme.themeElements.fontScheme;
switch(sName)
{
case "+mj-lt": sName = fontScheme.majorFont.latin;break;
case "+mj-ea": sName = fontScheme.majorFont.ea;break;
case "+mj-cs": sName = fontScheme.majorFont.cs;break;
case "+mn-lt": sName = fontScheme.minorFont.latin;break;
case "+mn-ea": sName = fontScheme.minorFont.ea;break;
case "+mn-cs": sName = fontScheme.minorFont.cs;break;
default:sName = null;break;
}
}
else
sName = null;
}
//проверка на пустую строку нужна, потому что до AVSOfficeDocxFile2 2,0,0,134 в темы не подбирались шрифты, а возвращалась пустая строка.
if(null != sName && "" != sName)
res.font.name = sName;
}
if(null != par.rPr.unifill)
{
var fill = par.rPr.unifill.fill;
if(null != fill && FILL_TYPE_SOLID == fill.type)
{
var color = fill.color;
if(null != color)
{
color = color.color;
if(null != color)
{
var rgba = {R:0, G:0, B:0, A:255};
if(COLOR_TYPE_SRGB == color.type)
{
rgba.R = color.RGBA.R;
rgba.G = color.RGBA.G;
rgba.B = color.RGBA.B;
}
else if(COLOR_TYPE_SCHEME == color.type && null != theme && null != clrSchemeMap)
{
color.Calculate(theme, clrSchemeMap.color_map, rgba);
if(null != fill.color.Mods)
{
var _rgba = {R: color.RGBA.R, G: color.RGBA.G, B: color.RGBA.B, A: color.RGBA.A};
fill.color.Mods.Apply(_rgba);
rgba = _rgba;
}
else
rgba = color.RGBA;
}
var num = rgba.R << 16 | rgba.G << 8 | rgba.B;
var c = num.toString(16);
while (c.length < 6) {c = "0" + c;}
res.font.color = "#" + c;
}
}
}
}
}
}
res.text += par.text;
}
return res;
}
} }
function isRealObject(obj) function isRealObject(obj)
......
...@@ -99,10 +99,7 @@ ...@@ -99,10 +99,7 @@
<script type="text/javascript" src="apiDefines.js"></script> <script type="text/javascript" src="apiDefines.js"></script>
<script type="text/javascript" src="api.js"></script> <script type="text/javascript" src="api.js"></script>
<script type="text/javascript" src="menu/menu.js"></script> <script type="text/javascript" src="menu/menu.js"></script>
<!--for presentation-->
<script type="text/javascript" src="../Common/PresentationSerializeAdapter.js"></script>
<!--for theme--> <!--for theme-->
<script type="text/javascript" src="../Common/Shapes/EditorSettings.js"></script> <script type="text/javascript" src="../Common/Shapes/EditorSettings.js"></script>
<script type="text/javascript" src="../Common/Shapes/Serialize.js"></script> <script type="text/javascript" src="../Common/Shapes/Serialize.js"></script>
......
...@@ -233,7 +233,6 @@ ...@@ -233,7 +233,6 @@
<script type="text/javascript" src="../../../../OfficeWeb/PowerPoint/themes/Themes.js"></script> <script type="text/javascript" src="../../../../OfficeWeb/PowerPoint/themes/Themes.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/Shapes/Serialize.js"></script> <script type="text/javascript" src="../../../../OfficeWeb/Common/Shapes/Serialize.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/Shapes/SerializeWriter.js"></script> <script type="text/javascript" src="../../../../OfficeWeb/Common/Shapes/SerializeWriter.js"></script>
<script src="../../../../OfficeWeb/Common/PresentationSerializeAdapter.js"></script>
<script src="../../../../OfficeWeb/Word/Editor/SerializeCommon.js"></script> <script src="../../../../OfficeWeb/Word/Editor/SerializeCommon.js"></script>
......
...@@ -130,9 +130,6 @@ ...@@ -130,9 +130,6 @@
<script type="text/javascript" src="../Common/Shapes/SerializeWriter.js"></script> <script type="text/javascript" src="../Common/Shapes/SerializeWriter.js"></script>
<script type="text/javascript" src="../Common/SerializeCommonWordExcel.js"></script> <script type="text/javascript" src="../Common/SerializeCommonWordExcel.js"></script>
<script type="text/javascript" src="Editor/SerializeCommon.js"></script> <script type="text/javascript" src="Editor/SerializeCommon.js"></script>
<!--for presentation-->
<script type="text/javascript" src="../Common/PresentationSerializeAdapter.js"></script>
<!--for charts--> <!--for charts-->
<script type="text/javascript" src="../Excel/graphics/DrawingContextWord.js"></script> <script type="text/javascript" src="../Excel/graphics/DrawingContextWord.js"></script>
......
...@@ -170,10 +170,7 @@ ...@@ -170,10 +170,7 @@
<script type="text/javascript" src="../Common/Shapes/SerializeWriter.js"></script> <script type="text/javascript" src="../Common/Shapes/SerializeWriter.js"></script>
<script type="text/javascript" src="../Common/SerializeCommonWordExcel.js"></script> <script type="text/javascript" src="../Common/SerializeCommonWordExcel.js"></script>
<script type="text/javascript" src="Editor/SerializeCommon.js"></script> <script type="text/javascript" src="Editor/SerializeCommon.js"></script>
<!--for presentation-->
<script type="text/javascript" src="../Common/PresentationSerializeAdapter.js"></script>
<!--for charts--> <!--for charts-->
<script type="text/javascript" src="../Excel/graphics/DrawingContextWord.js"></script> <script type="text/javascript" src="../Excel/graphics/DrawingContextWord.js"></script>
......
...@@ -213,9 +213,6 @@ ...@@ -213,9 +213,6 @@
<script type="text/javascript" src="../../../../OfficeWeb/Common/Shapes/Serialize.js"></script> <script type="text/javascript" src="../../../../OfficeWeb/Common/Shapes/Serialize.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/Shapes/SerializeWriter.js"></script> <script type="text/javascript" src="../../../../OfficeWeb/Common/Shapes/SerializeWriter.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Word/Editor/SerializeCommon.js"></script> <script type="text/javascript" src="../../../../OfficeWeb/Word/Editor/SerializeCommon.js"></script>
<!--for presentation-->
<script type="text/javascript" src="../../../../OfficeWeb/Common/PresentationSerializeAdapter.js"></script>
<!--for charts--> <!--for charts-->
<script type="text/javascript" src="../../../../OfficeWeb/Excel/graphics/DrawingContextWord.js"></script> <script type="text/javascript" src="../../../../OfficeWeb/Excel/graphics/DrawingContextWord.js"></script>
......
...@@ -187,9 +187,6 @@ ...@@ -187,9 +187,6 @@
<script type="text/javascript" src="../../../../OfficeWeb/Common/Shapes/Serialize.js"></script> <script type="text/javascript" src="../../../../OfficeWeb/Common/Shapes/Serialize.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/Shapes/SerializeWriter.js"></script> <script type="text/javascript" src="../../../../OfficeWeb/Common/Shapes/SerializeWriter.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Word/Editor/SerializeCommon.js"></script> <script type="text/javascript" src="../../../../OfficeWeb/Word/Editor/SerializeCommon.js"></script>
<!--for presentation-->
<script type="text/javascript" src="../../../../OfficeWeb/Common/PresentationSerializeAdapter.js"></script>
<!--for charts--> <!--for charts-->
<script type="text/javascript" src="../../../../OfficeWeb/Excel/graphics/DrawingContextWord.js"></script> <script type="text/javascript" src="../../../../OfficeWeb/Excel/graphics/DrawingContextWord.js"></script>
......
...@@ -130,9 +130,6 @@ ...@@ -130,9 +130,6 @@
<script type="text/javascript" src="../../OfficeWeb/Common/Shapes/SerializeWriter.js"></script> <script type="text/javascript" src="../../OfficeWeb/Common/Shapes/SerializeWriter.js"></script>
<script type="text/javascript" src="../../OfficeWeb/Word/Editor/SerializeCommon.js"></script> <script type="text/javascript" src="../../OfficeWeb/Word/Editor/SerializeCommon.js"></script>
<!--for presentation-->
<script type="text/javascript" src="../../OfficeWeb/Common/PresentationSerializeAdapter.js"></script>
<!--for charts--> <!--for charts-->
<script type="text/javascript" src="../../OfficeWeb/Excel/graphics/DrawingContextWord.js"></script> <script type="text/javascript" src="../../OfficeWeb/Excel/graphics/DrawingContextWord.js"></script>
......
...@@ -195,11 +195,6 @@ ...@@ -195,11 +195,6 @@
<script type="text/javascript" src = "Math/borderBox.js"></script> <script type="text/javascript" src = "Math/borderBox.js"></script>
<script type="text/javascript" src = "Math/mathTypes.js"></script> <script type="text/javascript" src = "Math/mathTypes.js"></script>
<!---->
<!--for presentation-->
<script type="text/javascript" src="../Common/PresentationSerializeAdapter.js"></script>
<!--for charts--> <!--for charts-->
<script type="text/javascript" src="../Excel/graphics/DrawingContextWord.js"></script> <script type="text/javascript" src="../Excel/graphics/DrawingContextWord.js"></script>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment