Commit c4341501 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

Подключил GraphicFrame.js к таблицам и документам.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@59791 954022d7-b5bf-4e40-9824-e11837661b57
parent 1822c1a5
...@@ -126,6 +126,7 @@ ...@@ -126,6 +126,7 @@
"../../Excel/model/DrawingObjects/Format/ImagePrototype.js", "../../Excel/model/DrawingObjects/Format/ImagePrototype.js",
"../../Excel/model/DrawingObjects/Format/GroupPrototype.js", "../../Excel/model/DrawingObjects/Format/GroupPrototype.js",
"../../Excel/model/DrawingObjects/Format/ChartSpacePrototype.js", "../../Excel/model/DrawingObjects/Format/ChartSpacePrototype.js",
"../../PowerPoint/Editor/Format/GraphicFrame.js",
"../../Word/Editor/Comments.js", "../../Word/Editor/Comments.js",
......
...@@ -88,6 +88,7 @@ ...@@ -88,6 +88,7 @@
"../../Word/Editor/GraphicObjects/Format/ImagePrototype.js", "../../Word/Editor/GraphicObjects/Format/ImagePrototype.js",
"../../Word/Editor/GraphicObjects/Format/GroupPrototype.js", "../../Word/Editor/GraphicObjects/Format/GroupPrototype.js",
"../../Word/Editor/GraphicObjects/Format/ChartSpacePrototype.js", "../../Word/Editor/GraphicObjects/Format/ChartSpacePrototype.js",
"../../PowerPoint/Editor/Format/GraphicFrame.js",
"../../Word/Editor/GraphicObjects/DrawingStates.js", "../../Word/Editor/GraphicObjects/DrawingStates.js",
"../../Word/Editor/GraphicObjects/GraphicObjects.js", "../../Word/Editor/GraphicObjects/GraphicObjects.js",
"../../Word/Editor/GraphicObjects/GraphicPage.js", "../../Word/Editor/GraphicObjects/GraphicPage.js",
......
...@@ -7536,6 +7536,11 @@ CChartSpace.prototype = ...@@ -7536,6 +7536,11 @@ CChartSpace.prototype =
} }
} }
if (this.Lock && locktype_None != this.Lock.Get_Type())
{
graphics.transform3(this.transform);
graphics.DrawLockObjectRect(this.Lock.Get_Type(), 0, 0, this.extX, this.extY);
}
graphics.RestoreGrState(); graphics.RestoreGrState();
// graphics.reset(); // graphics.reset();
}, },
......
...@@ -472,7 +472,7 @@ RotateState.prototype = ...@@ -472,7 +472,7 @@ RotateState.prototype =
this.drawingObjects.drawingObjects.getWorksheetModel && copy.setWorksheet(this.drawingObjects.drawingObjects.getWorksheetModel()); this.drawingObjects.drawingObjects.getWorksheetModel && copy.setWorksheet(this.drawingObjects.drawingObjects.getWorksheetModel());
if(this.drawingObjects.drawingObjects && this.drawingObjects.drawingObjects.cSld) if(this.drawingObjects.drawingObjects && this.drawingObjects.drawingObjects.cSld)
{ {
copy.setParent(this.drawingObjects.drawingObjects); copy.setParent2(this.drawingObjects.drawingObjects);
if(!copy.spPr || !copy.spPr.xfrm if(!copy.spPr || !copy.spPr.xfrm
|| (copy.getObjectType() === historyitem_type_GroupShape && !copy.spPr.xfrm.isNotNullForGroup() || copy.getObjectType() !== historyitem_type_GroupShape && !copy.spPr.xfrm.isNotNull())) || (copy.getObjectType() === historyitem_type_GroupShape && !copy.spPr.xfrm.isNotNullForGroup() || copy.getObjectType() !== historyitem_type_GroupShape && !copy.spPr.xfrm.isNotNull()))
{ {
...@@ -500,9 +500,9 @@ RotateState.prototype = ...@@ -500,9 +500,9 @@ RotateState.prototype =
{ {
var copy = tracks[i].originalObject.copy(); var copy = tracks[i].originalObject.copy();
oThis.drawingObjects.drawingObjects.getWorksheetModel && copy.setWorksheet(oThis.drawingObjects.drawingObjects.getWorksheetModel()); oThis.drawingObjects.drawingObjects.getWorksheetModel && copy.setWorksheet(oThis.drawingObjects.drawingObjects.getWorksheetModel());
if(this.drawingObjects.drawingObjects && this.drawingObjects.drawingObjects.cSld) if(oThis.drawingObjects.drawingObjects && oThis.drawingObjects.drawingObjects.cSld)
{ {
copy.setParent(this.drawingObjects.drawingObjects); copy.setParent2(oThis.drawingObjects.drawingObjects);
} }
copy.setGroup(tracks[i].originalObject.group); copy.setGroup(tracks[i].originalObject.group);
copy.group.addToSpTree(copy.group.length, copy); copy.group.addToSpTree(copy.group.length, copy);
......
...@@ -197,6 +197,7 @@ ...@@ -197,6 +197,7 @@
<script src="../../../../OfficeWeb/Excel/model/DrawingObjects/Format/ImagePrototype.js"></script> <script src="../../../../OfficeWeb/Excel/model/DrawingObjects/Format/ImagePrototype.js"></script>
<script src="../../../../OfficeWeb/Excel/model/DrawingObjects/Format/GroupPrototype.js"></script> <script src="../../../../OfficeWeb/Excel/model/DrawingObjects/Format/GroupPrototype.js"></script>
<script src="../../../../OfficeWeb/Excel/model/DrawingObjects/Format/ChartSpacePrototype.js"></script> <script src="../../../../OfficeWeb/Excel/model/DrawingObjects/Format/ChartSpacePrototype.js"></script>
<script src="../../../../OfficeWeb/PowerPoint/Editor/Format/GraphicFrame.js"></script>
<script src="../../../../OfficeWeb/Word/Editor/Comments.js"></script> <script src="../../../../OfficeWeb/Word/Editor/Comments.js"></script>
<script src="../../../../OfficeWeb/Word/Editor/Styles.js"></script> <script src="../../../../OfficeWeb/Word/Editor/Styles.js"></script>
......
...@@ -443,4 +443,133 @@ CChartSpace.prototype.getDrawingDocument = CShape.prototype.getDrawingDocument; ...@@ -443,4 +443,133 @@ CChartSpace.prototype.getDrawingDocument = CShape.prototype.getDrawingDocument;
CChartSpace.prototype.recalculateLocalTransform = CShape.prototype.recalculateLocalTransform; CChartSpace.prototype.recalculateLocalTransform = CShape.prototype.recalculateLocalTransform;
CChartSpace.prototype.Get_Theme = CShape.prototype.Get_Theme; CChartSpace.prototype.Get_Theme = CShape.prototype.Get_Theme;
CChartSpace.prototype.Get_ColorMap = CShape.prototype.Get_ColorMap; CChartSpace.prototype.Get_ColorMap = CShape.prototype.Get_ColorMap;
\ No newline at end of file
CTable.prototype.Get_TableOffsetCorrection = function()
{
return 0;
};
CTable.prototype.Selection_Draw_Page = function(Page_abs)
{
if ( false === this.Selection.Use )
return;
var CurPage = Page_abs - this.Get_StartPage_Absolute();
if ( CurPage < 0 || CurPage >= this.Pages.length )
return;
switch( this.Selection.Type )
{
case table_Selection_Cell:
{
var Row_prev_index = -1;
for ( var Index = 0; Index < this.Selection.Data.length; Index++ )
{
var Pos = this.Selection.Data[Index];
var Row = this.Content[Pos.Row];
var Cell = Row.Get_Cell( Pos.Cell );
var CellInfo = Row.Get_CellInfo( Pos.Cell );
var CellMar = Cell.Get_Margins();
if ( -1 === Row_prev_index || Row_prev_index != Pos.Row )
Row_prev_index = Pos.Row;
var X_start = CellInfo.X_cell_start;
var X_end = CellInfo.X_cell_end;
var Cell_Pages = Cell.Content_Get_PagesCount();
var Cell_PageRel = Page_abs - Cell.Content.Get_StartPage_Absolute();
if ( Cell_PageRel < 0 || Cell_PageRel >= Cell_Pages )
continue;
var Bounds = Cell.Content_Get_PageBounds( Cell_PageRel );
var Y_offset = Cell.Temp.Y_VAlign_offset[Cell_PageRel];
if ( 0 != Cell_PageRel )
{
// мы должны определить ряд, на котором случился перенос на новую страницу
var TempRowIndex = this.Pages[CurPage].FirstRow;
this.DrawingDocument.AddPageSelection( Page_abs, X_start, this.RowsInfo[TempRowIndex].Y[CurPage] + this.RowsInfo[TempRowIndex].TopDy[CurPage] + Y_offset, X_end - X_start, this.RowsInfo[TempRowIndex].H[CurPage] );
}
else
{
this.DrawingDocument.AddPageSelection( Page_abs, X_start, this.RowsInfo[Pos.Row].Y[CurPage] + this.RowsInfo[Pos.Row].TopDy[CurPage] + Y_offset, X_end - X_start, this.RowsInfo[Pos.Row].H[CurPage] );
}
}
break;
}
case table_Selection_Text:
{
var Cell = this.Content[this.Selection.StartPos.Pos.Row].Get_Cell( this.Selection.StartPos.Pos.Cell );
Cell.Content.Selection_Draw_Page(Page_abs);
break;
}
}
};
CStyle.prototype.Create_NormalTable = function()
{
var TablePr =
{
TableInd :
{
W : 0,
Type : tblwidth_Mm
},
TableCellMar :
{
Top :
{
W : 1.27,
Type : tblwidth_Mm
},
Left :
{
W : 2.54, // 5.4pt
Type : tblwidth_Mm
},
Bottom :
{
W : 1.27,
Type : tblwidth_Mm
},
Right :
{
W : 2.54, // 5.4pt
Type : tblwidth_Mm
}
}
};
this.Set_UiPriority( 99 );
this.Set_SemiHidden( true );
this.Set_UnhideWhenUsed( true );
this.Set_TablePr( TablePr );
};
CTablePr.prototype.Init_Default = function()
{
this.TableStyleColBandSize = 1;
this.TableStyleRowBandSize = 1;
this.Jc = align_Left;
this.Shd = new CDocumentShd();
this.TableBorders.Bottom = new CDocumentBorder();
this.TableBorders.Left = new CDocumentBorder();
this.TableBorders.Right = new CDocumentBorder();
this.TableBorders.Top = new CDocumentBorder();
this.TableBorders.InsideH = new CDocumentBorder();
this.TableBorders.InsideV = new CDocumentBorder();
this.TableCellMar.Bottom = new CTableMeasurement(tblwidth_Mm, 1.27);
this.TableCellMar.Left = new CTableMeasurement(tblwidth_Mm, 2.54/*5.4 * g_dKoef_pt_to_mm*/); // 5.4pt
this.TableCellMar.Right = new CTableMeasurement(tblwidth_Mm, 2.54/*5.4 * g_dKoef_pt_to_mm*/); // 5.4pt
this.TableCellMar.Top = new CTableMeasurement(tblwidth_Mm, 1.27);
this.TableCellSpacing = null;
this.TableInd = 0;
this.TableW = new CTableMeasurement(tblwidth_Auto, 0);
this.TableLayout = tbllayout_AutoFit;
};
\ No newline at end of file
...@@ -180,7 +180,10 @@ CGraphicFrame.prototype = ...@@ -180,7 +180,10 @@ CGraphicFrame.prototype =
if(this.graphicObject) if(this.graphicObject)
{ {
ret.setGraphicObject(this.graphicObject.Copy(ret)); ret.setGraphicObject(this.graphicObject.Copy(ret));
ret.graphicObject.Reset(0, 0, this.graphicObject.XLimit, this.graphicObject.YLimit, ret.graphicObject.PageNum); if(editor && editor.WordControl && editor.WordControl.m_oLogicDocument && isRealObject(editor.WordControl.m_oLogicDocument.globalTableStyles))
{
ret.graphicObject.Reset(0, 0, this.graphicObject.XLimit, this.graphicObject.YLimit, ret.graphicObject.PageNum);
}
} }
if(this.nvGraphicFramePr) if(this.nvGraphicFramePr)
{ {
...@@ -192,7 +195,11 @@ CGraphicFrame.prototype = ...@@ -192,7 +195,11 @@ CGraphicFrame.prototype =
ret.spPr.setParent(ret); ret.spPr.setParent(ret);
} }
ret.setBDeleted(false); ret.setBDeleted(false);
ret.cachedImage = this.getBase64Img();
if(!this.recalcInfo.recalculateTable && !this.recalcInfo.recalculateSizes && !this.recalcInfo.recalculateTransform)
{
ret.cachedImage = this.getBase64Img();
}
return ret; return ret;
}, },
...@@ -911,7 +918,12 @@ CGraphicFrame.prototype = ...@@ -911,7 +918,12 @@ CGraphicFrame.prototype =
} }
}, },
setParent2: CShape.prototype.setParent2, setParent2: function(parent)
{
History.Add(this, {Type:historyitem_GraphicFrameSetSetParent, oldPr: this.parent, newPr: parent});
this.parent = parent;
},
Get_Styles: function(level) Get_Styles: function(level)
{ {
...@@ -1130,132 +1142,3 @@ CGraphicFrame.prototype = ...@@ -1130,132 +1142,3 @@ CGraphicFrame.prototype =
this.Id = r.GetString2(); this.Id = r.GetString2();
} }
}; };
CTable.prototype.Get_TableOffsetCorrection = function()
{
return 0;
};
CTable.prototype.Selection_Draw_Page = function(Page_abs)
{
if ( false === this.Selection.Use )
return;
var CurPage = Page_abs - this.Get_StartPage_Absolute();
if ( CurPage < 0 || CurPage >= this.Pages.length )
return;
switch( this.Selection.Type )
{
case table_Selection_Cell:
{
var Row_prev_index = -1;
for ( var Index = 0; Index < this.Selection.Data.length; Index++ )
{
var Pos = this.Selection.Data[Index];
var Row = this.Content[Pos.Row];
var Cell = Row.Get_Cell( Pos.Cell );
var CellInfo = Row.Get_CellInfo( Pos.Cell );
var CellMar = Cell.Get_Margins();
if ( -1 === Row_prev_index || Row_prev_index != Pos.Row )
Row_prev_index = Pos.Row;
var X_start = CellInfo.X_cell_start;
var X_end = CellInfo.X_cell_end;
var Cell_Pages = Cell.Content_Get_PagesCount();
var Cell_PageRel = Page_abs - Cell.Content.Get_StartPage_Absolute();
if ( Cell_PageRel < 0 || Cell_PageRel >= Cell_Pages )
continue;
var Bounds = Cell.Content_Get_PageBounds( Cell_PageRel );
var Y_offset = Cell.Temp.Y_VAlign_offset[Cell_PageRel];
if ( 0 != Cell_PageRel )
{
// мы должны определить ряд, на котором случился перенос на новую страницу
var TempRowIndex = this.Pages[CurPage].FirstRow;
this.DrawingDocument.AddPageSelection( Page_abs, X_start, this.RowsInfo[TempRowIndex].Y[CurPage] + this.RowsInfo[TempRowIndex].TopDy[CurPage] + Y_offset, X_end - X_start, this.RowsInfo[TempRowIndex].H[CurPage] );
}
else
{
this.DrawingDocument.AddPageSelection( Page_abs, X_start, this.RowsInfo[Pos.Row].Y[CurPage] + this.RowsInfo[Pos.Row].TopDy[CurPage] + Y_offset, X_end - X_start, this.RowsInfo[Pos.Row].H[CurPage] );
}
}
break;
}
case table_Selection_Text:
{
var Cell = this.Content[this.Selection.StartPos.Pos.Row].Get_Cell( this.Selection.StartPos.Pos.Cell );
Cell.Content.Selection_Draw_Page(Page_abs);
break;
}
}
};
CStyle.prototype.Create_NormalTable = function()
{
var TablePr =
{
TableInd :
{
W : 0,
Type : tblwidth_Mm
},
TableCellMar :
{
Top :
{
W : 1.27,
Type : tblwidth_Mm
},
Left :
{
W : 2.54, // 5.4pt
Type : tblwidth_Mm
},
Bottom :
{
W : 1.27,
Type : tblwidth_Mm
},
Right :
{
W : 2.54, // 5.4pt
Type : tblwidth_Mm
}
}
};
this.Set_UiPriority( 99 );
this.Set_SemiHidden( true );
this.Set_UnhideWhenUsed( true );
this.Set_TablePr( TablePr );
};
CTablePr.prototype.Init_Default = function()
{
this.TableStyleColBandSize = 1;
this.TableStyleRowBandSize = 1;
this.Jc = align_Left;
this.Shd = new CDocumentShd();
this.TableBorders.Bottom = new CDocumentBorder();
this.TableBorders.Left = new CDocumentBorder();
this.TableBorders.Right = new CDocumentBorder();
this.TableBorders.Top = new CDocumentBorder();
this.TableBorders.InsideH = new CDocumentBorder();
this.TableBorders.InsideV = new CDocumentBorder();
this.TableCellMar.Bottom = new CTableMeasurement(tblwidth_Mm, 1.27);
this.TableCellMar.Left = new CTableMeasurement(tblwidth_Mm, 2.54/*5.4 * g_dKoef_pt_to_mm*/); // 5.4pt
this.TableCellMar.Right = new CTableMeasurement(tblwidth_Mm, 2.54/*5.4 * g_dKoef_pt_to_mm*/); // 5.4pt
this.TableCellMar.Top = new CTableMeasurement(tblwidth_Mm, 1.27);
this.TableCellSpacing = null;
this.TableInd = 0;
this.TableW = new CTableMeasurement(tblwidth_Auto, 0);
this.TableLayout = tbllayout_AutoFit;
};
\ No newline at end of file
...@@ -2948,7 +2948,7 @@ CPresentation.prototype = ...@@ -2948,7 +2948,7 @@ CPresentation.prototype =
Content.Drawings[i].Drawing.setBDeleted(false); Content.Drawings[i].Drawing.setBDeleted(false);
} }
} }
Content.Drawings[i].Drawing.setParent(this.Slides[this.CurPage]); Content.Drawings[i].Drawing.setParent2(this.Slides[this.CurPage]);
Content.Drawings[i].Drawing.addToDrawingObjects(); Content.Drawings[i].Drawing.addToDrawingObjects();
this.Slides[this.CurPage].graphicObjects.selectObject(Content.Drawings[i].Drawing, this.CurPage); this.Slides[this.CurPage].graphicObjects.selectObject(Content.Drawings[i].Drawing, this.CurPage);
} }
......
...@@ -613,7 +613,7 @@ function CTable(DrawingDocument, Parent, Inline, PageNum, X, Y, XLimit, YLimit, ...@@ -613,7 +613,7 @@ function CTable(DrawingDocument, Parent, Inline, PageNum, X, Y, XLimit, YLimit,
this.TableGridNeedRecalc = true; this.TableGridNeedRecalc = true;
this.bPresentation = bPresentation === true; this.bPresentation = bPresentation === true;
this.TableStyle = (undefined !== this.DrawingDocument && null !== this.DrawingDocument && this.DrawingDocument.m_oLogicDocument.Styles ? this.DrawingDocument.m_oLogicDocument.Styles.Get_Default_TableGrid() : null); this.TableStyle = (undefined !== this.DrawingDocument && null !== this.DrawingDocument && this.DrawingDocument.m_oLogicDocument && this.DrawingDocument.m_oLogicDocument.Styles ? this.DrawingDocument.m_oLogicDocument.Styles.Get_Default_TableGrid() : null);
this.TableLook = new CTableLook(true, true, false, false, true, false); this.TableLook = new CTableLook(true, true, false, false, true, false);
this.TableSumGrid = []; // данный массив будет заполнен после Internal_RecalculateGrid this.TableSumGrid = []; // данный массив будет заполнен после Internal_RecalculateGrid
......
...@@ -145,6 +145,7 @@ ...@@ -145,6 +145,7 @@
<script type="text/javascript" src="../../../../OfficeWeb/Word/Editor/GraphicObjects/Format/ImagePrototype.js"></script> <script type="text/javascript" src="../../../../OfficeWeb/Word/Editor/GraphicObjects/Format/ImagePrototype.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Word/Editor/GraphicObjects/Format/GroupPrototype.js"></script> <script type="text/javascript" src="../../../../OfficeWeb/Word/Editor/GraphicObjects/Format/GroupPrototype.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Word/Editor/GraphicObjects/Format/ChartSpacePrototype.js"></script> <script type="text/javascript" src="../../../../OfficeWeb/Word/Editor/GraphicObjects/Format/ChartSpacePrototype.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/PowerPoint/Editor/Format/GraphicFrame.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Word/Editor/GraphicObjects/DrawingStates.js"></script> <script type="text/javascript" src="../../../../OfficeWeb/Word/Editor/GraphicObjects/DrawingStates.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Word/Editor/GraphicObjects/GraphicObjects.js"></script> <script type="text/javascript" src="../../../../OfficeWeb/Word/Editor/GraphicObjects/GraphicObjects.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Word/Editor/GraphicObjects/GraphicPage.js"></script> <script type="text/javascript" src="../../../../OfficeWeb/Word/Editor/GraphicObjects/GraphicPage.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