Commit a7a1d697 authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander.Trofimov

Сделано, чтобы картинки, автофигуры и диаграммы нельзя было перенести в...

Сделано, чтобы картинки, автофигуры и диаграммы нельзя было перенести в формулу, Также добавлено свойство в настройках параграфа CanAddImage, которое возвращает false, если мы находимся в формуле.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@58737 954022d7-b5bf-4e40-9824-e11837661b57
parent 6e156e59
...@@ -7657,6 +7657,13 @@ CDocument.prototype = ...@@ -7657,6 +7657,13 @@ CDocument.prototype =
} }
} }
var oSelectedInfo = this.Get_SelectedElementsInfo();
var Math = oSelectedInfo.Get_Math();
if (null !== Math)
ParaPr.CanAddImage = false;
else
ParaPr.CanAddImage = true;
if ( undefined != ParaPr.Tabs ) if ( undefined != ParaPr.Tabs )
editor.Update_ParaTab( Default_Tab_Stop, ParaPr.Tabs ); editor.Update_ParaTab( Default_Tab_Stop, ParaPr.Tabs );
......
...@@ -6824,6 +6824,13 @@ CDocumentContent.prototype = ...@@ -6824,6 +6824,13 @@ CDocumentContent.prototype =
{ {
ParaPr.CanAddDropCap = false; ParaPr.CanAddDropCap = false;
var oSelectedInfo = this.LogicDocument.Get_SelectedElementsInfo();
var Math = oSelectedInfo.Get_Math();
if (null !== Math)
ParaPr.CanAddImage = false;
else
ParaPr.CanAddImage = true;
if ( undefined != ParaPr.Tabs && editor) if ( undefined != ParaPr.Tabs && editor)
editor.Update_ParaTab( Default_Tab_Stop, ParaPr.Tabs ); editor.Update_ParaTab( Default_Tab_Stop, ParaPr.Tabs );
......
...@@ -7910,7 +7910,9 @@ Paragraph.prototype = ...@@ -7910,7 +7910,9 @@ Paragraph.prototype =
this.Set_ParaContentPos( SearchPosXY.Pos, true, SearchPosXY.Line, SearchPosXY.Range ); this.Set_ParaContentPos( SearchPosXY.Pos, true, SearchPosXY.Line, SearchPosXY.Range );
var ContentPos = this.Get_ParaContentPos( false, false ); var ContentPos = this.Get_ParaContentPos( false, false );
var Result = this.Internal_Recalculate_CurPos( ContentPos, false, false, true ); ContentPos = this.private_CorrectNearestPos(ContentPos, bAnchor, Drawing);
var Result = this.Internal_Recalculate_CurPos(ContentPos, false, false, true );
// Сохраняем параграф и найденное место в параграфе // Сохраняем параграф и найденное место в параграфе
Result.ContentPos = ContentPos; Result.ContentPos = ContentPos;
...@@ -7923,6 +7925,37 @@ Paragraph.prototype = ...@@ -7923,6 +7925,37 @@ Paragraph.prototype =
return Result; return Result;
}, },
private_CorrectNearestPos : function(ContentPos, Anchor, Drawing)
{
if (true !== Anchor && undefined !== Drawing && null !== Drawing)
{
var CurPos = ContentPos.Get(0);
if (para_Math === this.Content[CurPos].Type)
{
if (CurPos > 0)
{
CurPos--;
ContentPos = new CParagraphContentPos();
ContentPos.Update(CurPos, 0);
this.Content[CurPos].Get_EndPos(false, ContentPos, 1);
this.Set_ParaContentPos(ContentPos, false, -1, -1);
}
else
{
CurPos++;
ContentPos = new CParagraphContentPos();
ContentPos.Update(CurPos, 0);
this.Content[CurPos].Get_StartPos(ContentPos, 1);
this.Set_ParaContentPos(ContentPos, false, -1, -1);
}
}
}
return ContentPos;
},
Check_NearestPos : function(NearPos) Check_NearestPos : function(NearPos)
{ {
var ParaNearPos = new CParagraphNearPos(); var ParaNearPos = new CParagraphNearPos();
......
...@@ -1566,7 +1566,7 @@ asc_docs_api.prototype._coAuthoringInit = function() ...@@ -1566,7 +1566,7 @@ asc_docs_api.prototype._coAuthoringInit = function()
bUseColor = -1 === CollaborativeEditing.m_nUseType; bUseColor = -1 === CollaborativeEditing.m_nUseType;
if (editor.CollaborativeMarksShowType === c_oAscCollaborativeMarksShowType.None) if (editor.CollaborativeMarksShowType === c_oAscCollaborativeMarksShowType.None)
bUseColor = false; bUseColor = false;
var oUser = t.CoAuthoringApi.getUser(userId); var oUser = t.CoAuthoringApi.getUser(userId);
var nColor = oUser ? oUser.asc_getColorValue() : null; var nColor = oUser ? oUser.asc_getColorValue() : null;
var oColor = false === bUseColor ? null : (null !== nColor ? new CDocumentColor( (nColor >> 16) & 0xFF, (nColor >> 8) & 0xFF, nColor & 0xFF ) : new CDocumentColor( 191, 255, 199 )); var oColor = false === bUseColor ? null : (null !== nColor ? new CDocumentColor( (nColor >> 16) & 0xFF, (nColor >> 8) & 0xFF, nColor & 0xFF ) : new CDocumentColor( 191, 255, 199 ));
...@@ -2044,6 +2044,7 @@ function CParagraphProp (obj) ...@@ -2044,6 +2044,7 @@ function CParagraphProp (obj)
this.CanAddTable = (undefined != obj.CanAddTable ) ? obj.CanAddTable : true; this.CanAddTable = (undefined != obj.CanAddTable ) ? obj.CanAddTable : true;
this.FramePr = (undefined != obj.FramePr ) ? new CParagraphFrame( obj.FramePr ) : undefined; this.FramePr = (undefined != obj.FramePr ) ? new CParagraphFrame( obj.FramePr ) : undefined;
this.CanAddDropCap = (undefined != obj.CanAddDropCap ) ? obj.CanAddDropCap : false; this.CanAddDropCap = (undefined != obj.CanAddDropCap ) ? obj.CanAddDropCap : false;
this.CanAddImage = (undefined != obj.CanAddImage ) ? obj.CanAddImage : false;
this.Subscript = (undefined != obj.Subscript) ? obj.Subscript : undefined; this.Subscript = (undefined != obj.Subscript) ? obj.Subscript : undefined;
this.Superscript = (undefined != obj.Superscript) ? obj.Superscript : undefined; this.Superscript = (undefined != obj.Superscript) ? obj.Superscript : undefined;
...@@ -2086,6 +2087,7 @@ function CParagraphProp (obj) ...@@ -2086,6 +2087,7 @@ function CParagraphProp (obj)
this.CanAddTable = true; this.CanAddTable = true;
this.Tabs = undefined; this.Tabs = undefined;
this.CanAddDropCap = false; this.CanAddDropCap = false;
this.CanAddImage = false;
this.Subscript = undefined; this.Subscript = undefined;
this.Superscript = undefined; this.Superscript = undefined;
...@@ -2141,6 +2143,7 @@ CParagraphProp.prototype.put_DefaultTab = function (v) { this.DefaultTab = v; } ...@@ -2141,6 +2143,7 @@ CParagraphProp.prototype.put_DefaultTab = function (v) { this.DefaultTab = v; }
CParagraphProp.prototype.get_FramePr = function () { return this.FramePr; } CParagraphProp.prototype.get_FramePr = function () { return this.FramePr; }
CParagraphProp.prototype.put_FramePr = function (v) { this.FramePr = v; } CParagraphProp.prototype.put_FramePr = function (v) { this.FramePr = v; }
CParagraphProp.prototype.get_CanAddDropCap = function() { return this.CanAddDropCap; } CParagraphProp.prototype.get_CanAddDropCap = function() { return this.CanAddDropCap; }
CParagraphProp.prototype.get_CanAddImage = function() { return this.CanAddImage; }
// Paragraph properties // Paragraph properties
function CParagraphPropEx (obj) function CParagraphPropEx (obj)
......
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