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

asc_SetViewRulers

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@58489 954022d7-b5bf-4e40-9824-e11837661b57
parent a1a41797
...@@ -4838,7 +4838,7 @@ CUniFill.prototype = ...@@ -4838,7 +4838,7 @@ CUniFill.prototype =
} }
if(this.fill.type == FILL_TYPE_NOFILL) if(this.fill.type == FILL_TYPE_NOFILL)
{ {
return {R: 0, G: 0} return {R: 0, G: 0, B: 0};
} }
} }
return new FormatRGBAColor(); return new FormatRGBAColor();
...@@ -8015,29 +8015,57 @@ function CXfrm() ...@@ -8015,29 +8015,57 @@ function CXfrm()
this.parent = null; this.parent = null;
this.isNotNull = function() this.Id = g_oIdCounter.Get_NewId();
g_oTableId.Add(this, this.Id);
}
CXfrm.prototype =
{
Get_Id: function()
{
return this.Id;
},
getObjectType: function()
{
return historyitem_type_Xfrm;
},
Write_ToBinary2: function (w)
{
w.WriteLong(this.getObjectType());
w.WriteString2(this.Id);
},
Read_FromBinary2: function (r)
{
this.Id = r.GetString2();
},
isNotNull: function()
{ {
return isRealNumber(this.offX) && isRealNumber(this.offY) && isRealNumber(this.extX) && isRealNumber(this.extY); return isRealNumber(this.offX) && isRealNumber(this.offY) && isRealNumber(this.extX) && isRealNumber(this.extY);
}; },
this.isNotNullForGroup = function() isNotNullForGroup: function()
{ {
return isRealNumber(this.offX) && isRealNumber(this.offY) return isRealNumber(this.offX) && isRealNumber(this.offY)
&& isRealNumber(this.chOffX) && isRealNumber(this.chOffY) && isRealNumber(this.chOffX) && isRealNumber(this.chOffY)
&& isRealNumber(this.extX) && isRealNumber(this.extY) && isRealNumber(this.extX) && isRealNumber(this.extY)
&& isRealNumber(this.chExtX) && isRealNumber(this.chExtY); && isRealNumber(this.chExtX) && isRealNumber(this.chExtY);
}; },
this.isEqual = function(xfrm) isEqual: function(xfrm)
{ {
return xfrm && this.offX == xfrm.offX && this.offY == xfrm.offY && this.extX == xfrm.extX && return xfrm && this.offX == xfrm.offX && this.offY == xfrm.offY && this.extX == xfrm.extX &&
this.extY == xfrm.extY && this.chOffX == xfrm.chOffX && this.chOffY == xfrm.chOffY && this.chExtX == xfrm.chExtX && this.extY == xfrm.extY && this.chOffX == xfrm.chOffX && this.chOffY == xfrm.chOffY && this.chExtX == xfrm.chExtX &&
this.chExtY == xfrm.chExtY ; this.chExtY == xfrm.chExtY ;
} },
this.merge = function(xfrm) merge: function(xfrm)
{ {
if(xfrm.offX != null) if(xfrm.offX != null)
{ {
...@@ -8092,37 +8120,8 @@ function CXfrm() ...@@ -8092,37 +8120,8 @@ function CXfrm()
{ {
this.rot = xfrm.rot; this.rot = xfrm.rot;
} }
}
this.Id = g_oIdCounter.Get_NewId();
g_oTableId.Add(this, this.Id);
}
CXfrm.prototype =
{
Get_Id: function()
{
return this.Id;
}, },
getObjectType: function()
{
return historyitem_type_Xfrm;
},
Write_ToBinary2: function (w)
{
w.WriteLong(this.getObjectType());
w.WriteString2(this.Id);
},
Read_FromBinary2: function (r)
{
this.Id = r.GetString2();
},
createDuplicate: function() createDuplicate: function()
{ {
var duplicate = new CXfrm(); var duplicate = new CXfrm();
......
...@@ -1815,7 +1815,7 @@ CShape.prototype = ...@@ -1815,7 +1815,7 @@ CShape.prototype =
var last_style_id; var last_style_id;
var b_checked = false; var b_checked = false;
var isPlaceholder = this.isPlaceholder(); var isPlaceholder = this.isPlaceholder();
if (isPlaceholder) { if (isPlaceholder || this.graphicObject instanceof CTable) {
if (default_style) { if (default_style) {
//checkTextPr(default_style.TextPr); //checkTextPr(default_style.TextPr);
b_checked = true; b_checked = true;
...@@ -1982,6 +1982,7 @@ CShape.prototype = ...@@ -1982,6 +1982,7 @@ CShape.prototype =
xfrm.setExtX(xfrm.extX * kw); xfrm.setExtX(xfrm.extX * kw);
xfrm.setExtY(xfrm.extY * kh); xfrm.setExtY(xfrm.extY * kh);
} }
this.recalcTransform && this.recalcTransform();
}, },
recalculateTransform: function () { recalculateTransform: function () {
......
...@@ -599,7 +599,8 @@ function CCollaborativeEditing() ...@@ -599,7 +599,8 @@ function CCollaborativeEditing()
this.m_aEndActions = []; // Массив действий, которые надо выполнить после принятия чужих изменений this.m_aEndActions = []; // Массив действий, которые надо выполнить после принятия чужих изменений
this.PosExtChanges = []; this.PosExtChangesX = [];
this.PosExtChangesY = [];
this.ScaleX = null; this.ScaleX = null;
this.ScaleY = null; this.ScaleY = null;
...@@ -1240,30 +1241,43 @@ function CCollaborativeEditing() ...@@ -1240,30 +1241,43 @@ function CCollaborativeEditing()
this.Clear_DCChanges(); this.Clear_DCChanges();
}; };
this.AddPosExtChanges = function(Item) this.AddPosExtChanges = function(Item, bHor)
{ {
this.PosExtChanges.push(Item); if(bHor)
{
this.PosExtChangesX.push(Item);
}
else
{
this.PosExtChangesY.push(Item);
}
};
this.RewriteChanges = function(changesArr, scale, Binary_Writer)
{
for(var i = 0; i < changesArr.length; ++i)
{
var changes = changesArr[i];
var data = changes.Data;
data.newPr *= scale;
var Binary_Pos = Binary_Writer.GetCurPosition();
changes.Class.Save_Changes(data, Binary_Writer);
var Binary_Len = Binary_Writer.GetCurPosition() - Binary_Pos;
changes.Binary.Pos = Binary_Pos;
changes.Binary.Len = Binary_Len;
}
}; };
this.RefreshPosExtChanges = function() this.RefreshPosExtChanges = function()
{ {
return; if(this.ScaleX != null && this.ScaleY != null)
//TODO {
if(this.ScaleX !== null && this.ScaleY !== null) this.RewriteChanges(this.PosExtChangesX, this.ScaleX, History.BinaryWriter);
{ this.RewriteChanges(this.PosExtChangesY, this.ScaleY, History.BinaryWriter);
var Binary_Writer = History.BinaryWriter; }
for(var i = 0; i < this.PosExtChanges.length; ++i) this.PosExtChangesX.length = 0;
{ this.PosExtChangesY.length = 0;
var changes = this.PosExtChanges[i];
var data = changes.Data;
var Binary_Pos = Binary_Writer.GetCurPosition();
changes.Class.Save_Changes(data, Binary_Writer);
var Binary_Len = Binary_Writer.GetCurPosition() - Binary_Pos;
changes.Binary.Pos = Binary_Pos;
changes.Binary.Len = Binary_Len;
}
}
this.PosExtChanges.length = 0;
this.ScaleX = null; this.ScaleX = null;
this.ScaleY = null; this.ScaleY = null;
}; };
......
...@@ -384,7 +384,7 @@ CComment.prototype = ...@@ -384,7 +384,7 @@ CComment.prototype =
{ {
getObjectType: function() getObjectType: function()
{ {
return his return historyitem_type_Comment;
}, },
hit: function(x, y) hit: function(x, y)
......
...@@ -56,6 +56,7 @@ CGraphicFrame.prototype = ...@@ -56,6 +56,7 @@ CGraphicFrame.prototype =
handleUpdateTheme: function() handleUpdateTheme: function()
{ {
this.compiledStyles = [];
if(this.graphicObject) if(this.graphicObject)
{ {
this.graphicObject.Recalc_CompiledPr2(); this.graphicObject.Recalc_CompiledPr2();
...@@ -78,6 +79,17 @@ CGraphicFrame.prototype = ...@@ -78,6 +79,17 @@ CGraphicFrame.prototype =
this.addToRecalculate(); this.addToRecalculate();
}, },
recalcText: function()
{
this.compiledStyles = [];
if(this.graphicObject)
{
this.graphicObject.Recalc_CompiledPr2();
this.graphicObject.RecalcInfo.Reset(true);
}
this.recalcInfo.recalculateTable = true;
},
Get_TextBackGroundColor: function() Get_TextBackGroundColor: function()
{ {
return undefined; return undefined;
...@@ -486,7 +498,14 @@ CGraphicFrame.prototype = ...@@ -486,7 +498,14 @@ CGraphicFrame.prototype =
}, },
changeSize: function(kw, kh) changeSize: function(kw, kh)
{}, {
if (this.spPr && this.spPr.xfrm && this.spPr.xfrm.isNotNull()) {
var xfrm = this.spPr.xfrm;
xfrm.setOffX(xfrm.offX * kw);
xfrm.setOffY(xfrm.offY * kh);
}
this.recalcTransform && this.recalcTransform();
},
getTransform: function() getTransform: function()
{ {
......
...@@ -1930,11 +1930,16 @@ CPresentation.prototype = ...@@ -1930,11 +1930,16 @@ CPresentation.prototype =
if(selected_objects.length > 0) if(selected_objects.length > 0)
{ {
var last_object = selected_objects[selected_objects.length - 1]; var last_object = selected_objects[selected_objects.length - 1];
return { X0 : last_object.x, X1 : last_object.x + last_object.extX, Y : last_object.y}; var Coords1 = editor.WordControl.m_oDrawingDocument.ConvertCoordsToCursorWR_Comment( last_object.x, last_object.y, this.CurPage);
var Coords2 = editor.WordControl.m_oDrawingDocument.ConvertCoordsToCursorWR_Comment( last_object.x + last_object.extX, last_object.y, this.CurPage);
return { X0 : Coords1.X, X1 : Coords2.X, Y : Coords1.Y};
} }
else else
{ {
return { X0 : this.Slides[this.CurPage].commentX, X1 : this.Slides[this.CurPage].commentX, Y : this.Slides[this.CurPage].commentY};
var Pos = editor.WordControl.m_oDrawingDocument.ConvertCoordsFromCursor2(global_mouseEvent.X, global_mouseEvent.Y);
var Coords1 = editor.WordControl.m_oDrawingDocument.ConvertCoordsToCursorWR_Comment( 0, 0, this.CurPage);
return { X0 : Coords1.X, X1 : Coords1.X, Y : Coords1.Y};
} }
} }
return { X0 : 0, X1 : 0, Y : 0}; return { X0 : 0, X1 : 0, Y : 0};
...@@ -2189,14 +2194,14 @@ CPresentation.prototype = ...@@ -2189,14 +2194,14 @@ CPresentation.prototype =
} }
if(!target_content) if(!target_content)
{ {
editor.UpdateParagraphProp( para_pr ); editor.UpdateParagraphProp( para_pr );
editor.sync_PrLineSpacingCallBack(para_pr.Spacing); editor.sync_PrLineSpacingCallBack(para_pr.Spacing);
//if(selected_objects.length === 1 ) //if(selected_objects.length === 1 )
//{ //{
// if ( "undefined" != typeof(para_props.Tabs) && null != para_props.Tabs ) // if ( "undefined" != typeof(para_props.Tabs) && null != para_props.Tabs )
// editor.Update_ParaTab( Default_Tab_Stop, para_props.Tabs );//TODO: // editor.Update_ParaTab( Default_Tab_Stop, para_props.Tabs );//TODO:
//} //}
editor.UpdateTextPr(text_pr); editor.UpdateTextPr(text_pr);
} }
if(drawing_props.imageProps) if(drawing_props.imageProps)
...@@ -2234,7 +2239,6 @@ CPresentation.prototype = ...@@ -2234,7 +2239,6 @@ CPresentation.prototype =
} }
if(text_pr) if(text_pr)
{ {
if(text_pr.RFonts) if(text_pr.RFonts)
{ {
var theme = graphic_objects.getTheme(); var theme = graphic_objects.getTheme();
...@@ -3531,6 +3535,8 @@ CPresentation.prototype = ...@@ -3531,6 +3535,8 @@ CPresentation.prototype =
var kh = h/this.Height; var kh = h/this.Height;
this.Width = w; this.Width = w;
this.Height = h; this.Height = h;
CollaborativeEditing.ScaleX = kw;
CollaborativeEditing.ScaleY = kh;
this.changeSlideSizeFunction(kw, kh); this.changeSlideSizeFunction(kw, kh);
editor.asc_fireCallback("asc_onPresentationSize", this.Width, this.Height); editor.asc_fireCallback("asc_onPresentationSize", this.Width, this.Height);
...@@ -3626,6 +3632,11 @@ CPresentation.prototype = ...@@ -3626,6 +3632,11 @@ CPresentation.prototype =
this.DrawingDocument.OnRecalculatePage(this.CurPage, this.Slides[this.CurPage]); this.DrawingDocument.OnRecalculatePage(this.CurPage, this.Slides[this.CurPage]);
this.DrawingDocument.OnEndRecalculate(); this.DrawingDocument.OnEndRecalculate();
this.Document_UpdateInterfaceState(); this.Document_UpdateInterfaceState();
var Coords = editor.WordControl.m_oDrawingDocument.ConvertCoordsToCursorWR_Comment( Comment.x, Comment.y, this.CurPage);
editor.sync_AddComment( Comment.Get_Id(), CommentData );
editor.sync_HideComment();
editor.sync_ShowComment(Comment.Id, Coords.X, Coords.Y );
return Comment; return Comment;
} }
else else
......
...@@ -3478,8 +3478,7 @@ asc_docs_api.prototype.asc_addComment = function(AscCommentData) ...@@ -3478,8 +3478,7 @@ asc_docs_api.prototype.asc_addComment = function(AscCommentData)
CommentData.Read_FromAscCommentData(AscCommentData); CommentData.Read_FromAscCommentData(AscCommentData);
var Comment = this.WordControl.m_oLogicDocument.Add_Comment( CommentData ); var Comment = this.WordControl.m_oLogicDocument.Add_Comment( CommentData );
if ( null != Comment ) if (Comment )
this.sync_AddComment( Comment.Get_Id(), CommentData );
return Comment.Get_Id(); return Comment.Get_Id();
} }
...@@ -4021,6 +4020,33 @@ asc_docs_api.prototype.asc_SetDocumentPlaceChangedEnabled = function(bEnabled) ...@@ -4021,6 +4020,33 @@ asc_docs_api.prototype.asc_SetDocumentPlaceChangedEnabled = function(bEnabled)
this.WordControl.m_bDocumentPlaceChangedEnabled = bEnabled; this.WordControl.m_bDocumentPlaceChangedEnabled = bEnabled;
} }
asc_docs_api.prototype.asc_SetViewRulers = function(bRulers)
{
//if (false === this.bInit_word_control || true === this.isViewMode)
// return;
if (this.WordControl.m_bIsRuler != bRulers)
{
this.WordControl.m_bIsRuler = bRulers;
this.WordControl.checkNeedRules();
this.WordControl.OnResize(true);
}
};
asc_docs_api.prototype.asc_SetViewRulersChange = function()
{
//if (false === this.bInit_word_control || true === this.isViewMode)
// return;
this.WordControl.m_bIsRuler = !this.WordControl.m_bIsRuler;
this.WordControl.checkNeedRules();
this.WordControl.OnResize(true);
return this.WordControl.m_bIsRuler;
};
asc_docs_api.prototype.asc_GetViewRulers = function()
{
return this.WordControl.m_bIsRuler;
};
asc_docs_api.prototype.SetMobileVersion = function(val) asc_docs_api.prototype.SetMobileVersion = function(val)
{ {
this.isMobileVersion = val; this.isMobileVersion = val;
......
...@@ -242,6 +242,24 @@ CHistory.prototype = ...@@ -242,6 +242,24 @@ CHistory.prototype =
Class.Add_ContentChanges( ContentChanges ); Class.Add_ContentChanges( ContentChanges );
CollaborativeEditing.Add_NewDC( Class ); CollaborativeEditing.Add_NewDC( Class );
} }
if(CollaborativeEditing.AddPosExtChanges && Class instanceof CXfrm)
{
if(historyitem_Xfrm_SetOffX === Data.Type ||
historyitem_Xfrm_SetOffY === Data.Type ||
historyitem_Xfrm_SetExtX === Data.Type ||
historyitem_Xfrm_SetExtY === Data.Type ||
historyitem_Xfrm_SetChOffX === Data.Type ||
historyitem_Xfrm_SetChOffY === Data.Type ||
historyitem_Xfrm_SetChExtX === Data.Type ||
historyitem_Xfrm_SetChExtY === Data.Type)
{
CollaborativeEditing.AddPosExtChanges(Item,
historyitem_Xfrm_SetOffX === Data.Type ||
historyitem_Xfrm_SetExtX === Data.Type ||
historyitem_Xfrm_SetChOffX === Data.Type ||
historyitem_Xfrm_SetChExtX === Data.Type );
}
}
}, },
Internal_RecalcData_Clear : function() Internal_RecalcData_Clear : function()
......
...@@ -6253,11 +6253,24 @@ CRFonts.prototype = ...@@ -6253,11 +6253,24 @@ CRFonts.prototype =
Copy : function() Copy : function()
{ {
var RFonts = new CRFonts(); var RFonts = new CRFonts();
RFonts.Ascii = this.Ascii; if ( undefined !== this.Ascii )
RFonts.EastAsia = this.EastAsia; {
RFonts.HAnsi = this.HAnsi; RFonts.Ascii = {Name: this.Ascii.Name, Index: this.Ascii.Index};
RFonts.CS = this.CS; }
RFonts.Hint = this.Hint; if ( undefined !== this.EastAsia )
{
RFonts.EastAsia = {Name: this.EastAsia.Name, Index: this.EastAsia.Index};
}
if ( undefined !== this.HAnsi )
{
RFonts.HAnsi = {Name: this.HAnsi.Name, Index: this.HAnsi.Index};
}
if ( undefined !== this.CS )
{
RFonts.CS = {Name: this.CS.Name, Index: this.CS.Index};
}
if ( undefined != this.Hint )
this.Hint = RFonts.Hint;
return RFonts; return RFonts;
}, },
......
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