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

Bug 19732 - Не возвращается наклонный текст после Undo\Redo

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@49042 954022d7-b5bf-4e40-9824-e11837661b57
parent bea41de8
......@@ -1313,6 +1313,32 @@ function recalc(wb){
}
}
function angleFormatToInterface(val)
{
var nRes = 0;
if(0 <= val && val <= 180)
nRes = val <= 90 ? val : 90 - val;
return nRes;
}
function angleFormatToInterface2(val)
{
if(g_nVerticalTextAngle == val)
return val;
else
return angleFormatToInterface(val);
}
function angleInterfaceToFormat(val)
{
var nRes = val;
if(-90 <= val && val <= 90)
{
if(val < 0)
nRes = 90 - val;
}
else if(g_nVerticalTextAngle != val)
nRes = 0;
return nRes;
}
//-------------------------------------------------------------------------------------------------
$(function(){
aStandartNumFormats = new Array();
......@@ -6555,28 +6581,23 @@ Range.prototype.getAngle=function(){
var nRow = this.bbox.r1;
var nCol = this.bbox.c1;
var cell = this.worksheet._getCellNoEmpty(nRow, nCol);
var fProcAngle = function(val){
if(0 <= val && val <= 180)
return val <= 90 ? val : 90 - val;
return 0;
};
if(null != cell)
{
var xfs = cell.getStyle();
if(null != xfs && null != xfs.align)
return fProcAngle(xfs.align.angle);
return angleFormatToInterface(xfs.align.angle);
}
else
{
//стили столбов и колонок
var row = this.worksheet._getRowNoEmpty(nRow);
if(null != row && null != row.xfs && null != row.xfs.align)
return fProcAngle(row.xfs.align.angle);
return angleFormatToInterface(row.xfs.align.angle);
var col = this.worksheet._getColNoEmptyWithAll(nCol);
if(null != col && null != col.xfs && null != col.xfs.align)
return fProcAngle(col.xfs.align.angle);
return angleFormatToInterface(col.xfs.align.angle);
}
return fProcAngle(g_oDefaultAlign.angle);
return angleFormatToInterface(g_oDefaultAlign.angle);
};
Range.prototype.getVerticalText=function(){
var nRow = this.bbox.r1;
......
......@@ -1811,18 +1811,12 @@ StyleManager.prototype =
setAngle : function(oItemWithXfs, val)
{
var xfs = oItemWithXfs.xfs;
if(-90 <= val && val <= 90)
{
if(val < 0)
val = 90 - val;
}
else if(g_nVerticalTextAngle != val)
val = 0;
var oRes = {newVal: val, oldVal: null};
var oRes = {newVal: val, oldVal: null};
val = angleInterfaceToFormat(val);
if(null != xfs && null != xfs.align)
oRes.oldVal = xfs.align.angle;
oRes.oldVal = angleFormatToInterface2(xfs.align.angle);
else
oRes.oldVal = g_oDefaultAlign.angle;
oRes.oldVal = angleFormatToInterface2(g_oDefaultAlign.angle);
if(null == val)
{
if(null != xfs && null != xfs.align)
......
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