Commit 04086d88 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander.Trofimov

git-svn-id:...

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@49092 954022d7-b5bf-4e40-9824-e11837661b57
parent 0550276b
...@@ -942,6 +942,7 @@ function CDrawingDocument() ...@@ -942,6 +942,7 @@ function CDrawingDocument()
this.m_oLogicDocument = null; this.m_oLogicDocument = null;
this.SlidesCount = 0; this.SlidesCount = 0;
this.IsEmptyPresentation = false;
this.SlideCurrent = -1; this.SlideCurrent = -1;
this.SlideCurrectRect = new CDrawingPage(); this.SlideCurrectRect = new CDrawingPage();
...@@ -2757,6 +2758,8 @@ function CThumbnailsManager() ...@@ -2757,6 +2758,8 @@ function CThumbnailsManager()
this.const_offsetX = 0; this.const_offsetX = 0;
this.const_border_w = 4; this.const_border_w = 4;
this.bIsEmptyDrawed = false;
this.m_oCacheManager = new CCacheManager(); this.m_oCacheManager = new CCacheManager();
this.FocusObjType = FOCUS_OBJECT_MAIN; this.FocusObjType = FOCUS_OBJECT_MAIN;
...@@ -3680,9 +3683,27 @@ function CThumbnailsManager() ...@@ -3680,9 +3683,27 @@ function CThumbnailsManager()
this.onCheckUpdate = function() this.onCheckUpdate = function()
{ {
if (!this.m_bIsVisible || this.m_lDrawingFirst == -1 || this.m_lDrawingEnd == -1) if (!this.m_bIsVisible)
return; return;
if (this.m_lDrawingFirst == -1 || this.m_lDrawingEnd == -1)
{
if (this.m_oWordControl.m_oDrawingDocument.IsEmptyPresentation)
{
if (!this.bIsEmptyDrawed)
{
this.bIsEmptyDrawed = true;
this.OnPaint();
}
return;
}
this.bIsEmptyDrawed = false;
return;
}
this.bIsEmptyDrawed = false;
if (!this.m_bIsUpdate) if (!this.m_bIsUpdate)
{ {
// определяем, нужно ли пересчитать и закэшировать табнейл (хотя бы один) // определяем, нужно ли пересчитать и закэшировать табнейл (хотя бы один)
...@@ -3903,13 +3924,21 @@ function CThumbnailsManager() ...@@ -3903,13 +3924,21 @@ function CThumbnailsManager()
case 46: case 46:
{ {
var _delete_array = this.GetSelectedArray(); var _delete_array = this.GetSelectedArray();
if (_delete_array.length == this.m_oWordControl.m_oDrawingDocument.SlidesCount)
_delete_array.splice(0, 1); if (!this.m_oWordControl.m_oApi.IsSupportEmptyPresentation)
{
if (_delete_array.length == this.m_oWordControl.m_oDrawingDocument.SlidesCount)
_delete_array.splice(0, 1);
}
if (_delete_array.length != 0) if (_delete_array.length != 0)
{ {
this.m_oWordControl.m_oLogicDocument.deleteSlides(_delete_array); this.m_oWordControl.m_oLogicDocument.deleteSlides(_delete_array);
} }
if (0 == this.m_oWordControl.m_oLogicDocument.Slides.length)
this.m_bIsUpdate = true;
break; break;
} }
case 34: //PgDown case 34: //PgDown
...@@ -4432,8 +4461,14 @@ function CSlideDrawer() ...@@ -4432,8 +4461,14 @@ function CSlideDrawer()
this.BoundsChecker = new CSlideBoundsChecker(); this.BoundsChecker = new CSlideBoundsChecker();
this.bIsEmptyPresentation = false;
this.CheckSlide = function(slideNum) this.CheckSlide = function(slideNum)
{ {
this.bIsEmptyPresentation = false;
if (-1 == slideNum)
this.bIsEmptyPresentation = true;
var dKoef = this.m_oWordControl.m_nZoomValue * g_dKoef_mm_to_pix / 100; var dKoef = this.m_oWordControl.m_nZoomValue * g_dKoef_mm_to_pix / 100;
var w_mm = this.m_oWordControl.m_oLogicDocument.Width; var w_mm = this.m_oWordControl.m_oLogicDocument.Width;
var h_mm = this.m_oWordControl.m_oLogicDocument.Height; var h_mm = this.m_oWordControl.m_oLogicDocument.Height;
...@@ -4443,6 +4478,18 @@ function CSlideDrawer() ...@@ -4443,6 +4478,18 @@ function CSlideDrawer()
this.BoundsChecker.init(w_px, h_px, w_mm, h_mm); this.BoundsChecker.init(w_px, h_px, w_mm, h_mm);
this.BoundsChecker.transform(1,0,0,1,0,0); this.BoundsChecker.transform(1,0,0,1,0,0);
if (this.bIsEmptyPresentation)
{
this.BoundsChecker._s();
this.BoundsChecker._m(0, 0);
this.BoundsChecker._l(w_mm, 0);
this.BoundsChecker._l(w_mm, h_mm);
this.BoundsChecker._l(0, h_mm);
this.BoundsChecker._z();
return;
}
this.m_oWordControl.m_oLogicDocument.DrawPage(slideNum, this.BoundsChecker); this.m_oWordControl.m_oLogicDocument.DrawPage(slideNum, this.BoundsChecker);
// теперь смотрим, используем ли кэш для скролла // теперь смотрим, используем ли кэш для скролла
...@@ -4513,6 +4560,23 @@ function CSlideDrawer() ...@@ -4513,6 +4560,23 @@ function CSlideDrawer()
var _bounds = this.BoundsChecker.Bounds; var _bounds = this.BoundsChecker.Bounds;
var _x = _rect.left + _bounds.min_x; var _x = _rect.left + _bounds.min_x;
var _y = _rect.top + _bounds.min_y; var _y = _rect.top + _bounds.min_y;
if (this.bIsEmptyPresentation)
{
var w_px = _bounds.max_x - _bounds.min_x + 1;
var h_px = _bounds.max_y - _bounds.min_y + 1;
outputCtx.lineWidth = 1;
outputCtx.strokeStyle = "#000000";
outputCtx.beginPath();
this.m_oWordControl.m_oDrawingDocument.AutoShapesTrack.AddRectDashClever(outputCtx, _x >> 0, _y >> 0, (_x + w_px) >> 0, (_y + h_px) >> 0, 2, 2);
outputCtx.stroke();
outputCtx.beginPath();
return;
}
if (this.IsCached) if (this.IsCached)
{ {
var w_px = _bounds.max_x - _bounds.min_x + 1; var w_px = _bounds.max_x - _bounds.min_x + 1;
......
...@@ -677,7 +677,8 @@ function CEditorPage(api) ...@@ -677,7 +677,8 @@ function CEditorPage(api)
oWordControl.m_bIsRePaintOnScroll = true; oWordControl.m_bIsRePaintOnScroll = true;
oWordControl.OnScroll(); oWordControl.OnScroll();
oWordControl.m_oLogicDocument.Document_UpdateInterfaceState(); if (!oWordControl.m_oDrawingDocument.IsEmptyPresentation)
oWordControl.m_oLogicDocument.Document_UpdateInterfaceState();
} }
this.zoom_Out = function() this.zoom_Out = function()
...@@ -1308,6 +1309,12 @@ function CEditorPage(api) ...@@ -1308,6 +1309,12 @@ function CEditorPage(api)
{ {
global_mouseEvent.Button = 0; global_mouseEvent.Button = 0;
oWordControl.m_bIsMouseLock = true; oWordControl.m_bIsMouseLock = true;
if (oWordControl.m_oDrawingDocument.IsEmptyPresentation)
{
oWordControl.m_oLogicDocument.addNextSlide();
return;
}
} }
if ((0 == global_mouseEvent.Button) || (undefined == global_mouseEvent.Button) || (2 == global_mouseEvent.Button)) if ((0 == global_mouseEvent.Button) || (undefined == global_mouseEvent.Button) || (2 == global_mouseEvent.Button))
...@@ -1351,6 +1358,9 @@ function CEditorPage(api) ...@@ -1351,6 +1358,9 @@ function CEditorPage(api)
if (oWordControl.DemonstrationManager.Mode) if (oWordControl.DemonstrationManager.Mode)
return false; return false;
if (oWordControl.m_oDrawingDocument.IsEmptyPresentation)
return;
check_MouseMoveEvent(e); check_MouseMoveEvent(e);
var pos = oWordControl.m_oDrawingDocument.ConvertCoordsFromCursor2(global_mouseEvent.X, global_mouseEvent.Y); var pos = oWordControl.m_oDrawingDocument.ConvertCoordsFromCursor2(global_mouseEvent.X, global_mouseEvent.Y);
if (pos.Page == -1) if (pos.Page == -1)
...@@ -1371,6 +1381,9 @@ function CEditorPage(api) ...@@ -1371,6 +1381,9 @@ function CEditorPage(api)
if (pos.Page == -1) if (pos.Page == -1)
return; return;
if (oWordControl.m_oDrawingDocument.IsEmptyPresentation)
return;
oWordControl.m_oLogicDocument.OnMouseMove(global_mouseEvent, pos.X, pos.Y, pos.Page); oWordControl.m_oLogicDocument.OnMouseMove(global_mouseEvent, pos.X, pos.Y, pos.Page);
} }
this.onMouseUp = function(e, bIsWindow) this.onMouseUp = function(e, bIsWindow)
...@@ -1392,6 +1405,10 @@ function CEditorPage(api) ...@@ -1392,6 +1405,10 @@ function CEditorPage(api)
} }
check_MouseUpEvent(e); check_MouseUpEvent(e);
if (oWordControl.m_oDrawingDocument.IsEmptyPresentation)
return;
var pos = oWordControl.m_oDrawingDocument.ConvertCoordsFromCursor2(global_mouseEvent.X, global_mouseEvent.Y); var pos = oWordControl.m_oDrawingDocument.ConvertCoordsFromCursor2(global_mouseEvent.X, global_mouseEvent.Y);
if (pos.Page == -1) if (pos.Page == -1)
return; return;
...@@ -1450,6 +1467,9 @@ function CEditorPage(api) ...@@ -1450,6 +1467,9 @@ function CEditorPage(api)
global_mouseEvent.IsPressed = false; global_mouseEvent.IsPressed = false;
if (oWordControl.m_oDrawingDocument.IsEmptyPresentation)
return;
//--- //---
var pos = oWordControl.m_oDrawingDocument.ConvertCoordsFromCursor2(global_mouseEvent.X, global_mouseEvent.Y); var pos = oWordControl.m_oDrawingDocument.ConvertCoordsFromCursor2(global_mouseEvent.X, global_mouseEvent.Y);
if (pos.Page == -1) if (pos.Page == -1)
...@@ -1677,36 +1697,44 @@ function CEditorPage(api) ...@@ -1677,36 +1697,44 @@ function CEditorPage(api)
if (0 != this.MainScrollsEnabledFlag) if (0 != this.MainScrollsEnabledFlag)
return; return;
if (this.StartVerticalScroll) if (!this.m_oDrawingDocument.IsEmptyPresentation)
{ {
this.VerticalScrollOnMouseUp.ScrollY = scrollPositionY; if (this.StartVerticalScroll)
this.VerticalScrollOnMouseUp.ScrollY_max = maxY; {
this.VerticalScrollOnMouseUp.ScrollY = scrollPositionY;
this.VerticalScrollOnMouseUp.ScrollY_max = maxY;
this.VerticalScrollOnMouseUp.SlideNum = (scrollPositionY * this.m_oDrawingDocument.SlidesCount / Math.max(1, maxY)) >> 0; this.VerticalScrollOnMouseUp.SlideNum = (scrollPositionY * this.m_oDrawingDocument.SlidesCount / Math.max(1, maxY)) >> 0;
if (this.VerticalScrollOnMouseUp.SlideNum >= this.m_oDrawingDocument.SlidesCount) if (this.VerticalScrollOnMouseUp.SlideNum >= this.m_oDrawingDocument.SlidesCount)
this.VerticalScrollOnMouseUp.SlideNum = this.m_oDrawingDocument.SlidesCount - 1; this.VerticalScrollOnMouseUp.SlideNum = this.m_oDrawingDocument.SlidesCount - 1;
this.m_oApi.asc_fireCallback("asc_onPaintSlideNum", this.VerticalScrollOnMouseUp.SlideNum); this.m_oApi.asc_fireCallback("asc_onPaintSlideNum", this.VerticalScrollOnMouseUp.SlideNum);
return; return;
} }
var lNumSlide = ((scrollPositionY / this.m_dDocumentPageHeight) + 0.1) >> 0; // 0.1 - ошибка округления!! var lNumSlide = ((scrollPositionY / this.m_dDocumentPageHeight) + 0.1) >> 0; // 0.1 - ошибка округления!!
if (lNumSlide != this.m_oDrawingDocument.SlideCurrent) if (lNumSlide != this.m_oDrawingDocument.SlideCurrent)
{
if (this.IsGoToPageMAXPosition)
{ {
if (lNumSlide >= this.m_oDrawingDocument.SlideCurrent) if (this.IsGoToPageMAXPosition)
this.IsGoToPageMAXPosition = false; {
} if (lNumSlide >= this.m_oDrawingDocument.SlideCurrent)
this.IsGoToPageMAXPosition = false;
}
this.GoToPage(lNumSlide); this.GoToPage(lNumSlide);
return; return;
}
else if (this.SlideScrollMAX < scrollPositionY)
{
this.IsGoToPageMAXPosition = false;
this.GoToPage(this.m_oDrawingDocument.SlideCurrent + 1);
return;
}
} }
else if (this.SlideScrollMAX < scrollPositionY) else
{ {
this.IsGoToPageMAXPosition = false; if (this.StartVerticalScroll)
this.GoToPage(this.m_oDrawingDocument.SlideCurrent + 1); return;
return;
} }
var oWordControl = oThis; var oWordControl = oThis;
...@@ -1725,6 +1753,13 @@ function CEditorPage(api) ...@@ -1725,6 +1753,13 @@ function CEditorPage(api)
if (0 != this.MainScrollsEnabledFlag || !this.StartVerticalScroll) if (0 != this.MainScrollsEnabledFlag || !this.StartVerticalScroll)
return; return;
if (this.m_oDrawingDocument.IsEmptyPresentation)
{
this.StartVerticalScroll = false;
this.m_oScrollVerApi.scrollByY(0, false);
return;
}
if (this.VerticalScrollOnMouseUp.SlideNum != this.m_oDrawingDocument.SlideCurrent) if (this.VerticalScrollOnMouseUp.SlideNum != this.m_oDrawingDocument.SlideCurrent)
this.GoToPage(this.VerticalScrollOnMouseUp.SlideNum); this.GoToPage(this.VerticalScrollOnMouseUp.SlideNum);
else else
...@@ -2140,7 +2175,7 @@ function CEditorPage(api) ...@@ -2140,7 +2175,7 @@ function CEditorPage(api)
ctx.globalAlpha = 1.0; ctx.globalAlpha = 1.0;
ctx = null; ctx = null;
if (this.m_oLogicDocument != null) if (this.m_oLogicDocument != null && drDoc.SlideCurrent >= 0)
{ {
this.m_oLogicDocument.Slides[drDoc.SlideCurrent].drawSelect(); this.m_oLogicDocument.Slides[drDoc.SlideCurrent].drawSelect();
...@@ -2311,6 +2346,9 @@ function CEditorPage(api) ...@@ -2311,6 +2346,9 @@ function CEditorPage(api)
this.m_dDocumentWidth = one_slide_width; this.m_dDocumentWidth = one_slide_width;
this.m_dDocumentHeight = (one_slide_height * this.m_oDrawingDocument.SlidesCount) >> 0; this.m_dDocumentHeight = (one_slide_height * this.m_oDrawingDocument.SlidesCount) >> 0;
if (0 == this.m_oDrawingDocument.SlidesCount)
this.m_dDocumentHeight = one_slide_height >> 0;
if (!bIsAttack && this.OldDocumentWidth == this.m_dDocumentWidth && this.OldDocumentHeight == this.m_dDocumentHeight) if (!bIsAttack && this.OldDocumentWidth == this.m_dDocumentWidth && this.OldDocumentHeight == this.m_dDocumentHeight)
{ {
/* /*
...@@ -2328,6 +2366,12 @@ function CEditorPage(api) ...@@ -2328,6 +2366,12 @@ function CEditorPage(api)
this.SlideScrollMIN = this.m_oDrawingDocument.SlideCurrent * one_slide_height; this.SlideScrollMIN = this.m_oDrawingDocument.SlideCurrent * one_slide_height;
this.SlideScrollMAX = this.SlideScrollMIN + one_slide_height - this.m_oEditor.HtmlElement.height; this.SlideScrollMAX = this.SlideScrollMIN + one_slide_height - this.m_oEditor.HtmlElement.height;
if (0 == this.m_oDrawingDocument.SlidesCount)
{
this.SlideScrollMIN = 0;
this.SlideScrollMAX = this.SlideScrollMIN + one_slide_height - this.m_oEditor.HtmlElement.height;
}
// теперь проверим необходимость перезуммирования // теперь проверим необходимость перезуммирования
if (1 == this.m_nZoomType) if (1 == this.m_nZoomType)
{ {
...@@ -2604,7 +2648,14 @@ function CEditorPage(api) ...@@ -2604,7 +2648,14 @@ function CEditorPage(api)
this.GoToPage = function(lPageNum) this.GoToPage = function(lPageNum)
{ {
var drDoc = this.m_oDrawingDocument; var drDoc = this.m_oDrawingDocument;
if (lPageNum < 0 || lPageNum >= drDoc.SlidesCount)
this.m_oDrawingDocument.IsEmptyPresentation = false;
if (-1 == lPageNum)
{
this.m_oDrawingDocument.IsEmptyPresentation = true;
}
if (lPageNum != -1 && (lPageNum < 0 || lPageNum >= drDoc.SlidesCount))
return; return;
this.Thumbnails.LockMainObjType = true; this.Thumbnails.LockMainObjType = true;
......
...@@ -1202,7 +1202,7 @@ CGradFill.prototype = ...@@ -1202,7 +1202,7 @@ CGradFill.prototype =
function CPattFill() function CPattFill()
{ {
this.type = FILL_TYPE_PATT; this.type = FILL_TYPE_PATT;
this.ftype = ""; this.ftype = 0;
this.fgClr = new CUniColor(); this.fgClr = new CUniColor();
this.bgClr = new CUniColor(); this.bgClr = new CUniColor();
} }
......
...@@ -7592,6 +7592,12 @@ CPresentation.prototype = { ...@@ -7592,6 +7592,12 @@ CPresentation.prototype = {
Set_CurPage : function(PageNum) Set_CurPage : function(PageNum)
{ {
if (-1 == PageNum)
{
this.CurPage = -1;
return;
}
var oldCurPage = this.CurPage; var oldCurPage = this.CurPage;
this.CurPage = Math.min( this.Slides.length - 1, Math.max( 0, PageNum ) ); this.CurPage = Math.min( this.Slides.length - 1, Math.max( 0, PageNum ) );
if(oldCurPage != this.CurPage && this.CurPage < this.Slides.length) if(oldCurPage != this.CurPage && this.CurPage < this.Slides.length)
......
...@@ -44,6 +44,8 @@ function asc_docs_api(name) ...@@ -44,6 +44,8 @@ function asc_docs_api(name)
this.DocumentUrl = ""; this.DocumentUrl = "";
this.DocumentName = ""; this.DocumentName = "";
this.DocInfo = null; this.DocInfo = null;
this.IsSupportEmptyPresentation = true;
this.ShowParaMarks = false; this.ShowParaMarks = false;
this.isAddSpaceBetweenPrg = false; this.isAddSpaceBetweenPrg = false;
...@@ -3298,8 +3300,12 @@ asc_docs_api.prototype.AddSlide = function(layoutIndex) ...@@ -3298,8 +3300,12 @@ asc_docs_api.prototype.AddSlide = function(layoutIndex)
asc_docs_api.prototype.DeleteSlide = function() asc_docs_api.prototype.DeleteSlide = function()
{ {
var _delete_array = this.WordControl.Thumbnails.GetSelectedArray(); var _delete_array = this.WordControl.Thumbnails.GetSelectedArray();
if (_delete_array.length == this.WordControl.m_oDrawingDocument.SlidesCount)
_delete_array.splice(0, 1); if (!this.IsSupportEmptyPresentation)
{
if (_delete_array.length == this.WordControl.m_oDrawingDocument.SlidesCount)
_delete_array.splice(0, 1);
}
if (_delete_array.length != 0) if (_delete_array.length != 0)
{ {
......
...@@ -394,9 +394,46 @@ function CAscFillSolid() ...@@ -394,9 +394,46 @@ function CAscFillSolid()
{ {
this.color = new CAscColor(); this.color = new CAscColor();
} }
CAscFillSolid.prototype.get_color = function(){return this.color} CAscFillSolid.prototype.get_color = function(){return this.color;}
CAscFillSolid.prototype.put_color = function(v){this.color = v;} CAscFillSolid.prototype.put_color = function(v){this.color = v;}
function CAscFillHatch()
{
this.PatternType = 0;
this.fgClr = new CAscColor();
this.bgClr = new CAscColor();
}
CAscFillHatch.prototype.get_pattern_type = function(){return this.PatternType;}
CAscFillHatch.prototype.put_pattern_type = function(v){this.PatternType = v;}
CAscFillHatch.prototype.get_color_fg = function(){return this.fgClr;}
CAscFillHatch.prototype.put_color_fg = function(v){this.fgClr = v;}
CAscFillHatch.prototype.get_color_bg = function(){return this.bgClr;}
CAscFillHatch.prototype.put_color_bg = function(v){this.bgClr = v;}
function CAscFillGrad()
{
this.Colors = new Array();
this.Positions = new Array();
this.GradType = 0;
this.LinearAngle = 0;
this.LinearScale = true;
this.PathType = 0;
}
CAscFillGrad.prototype.get_colors = function(){return this.Colors;}
CAscFillGrad.prototype.put_colors = function(v){this.Colors = v;}
CAscFillGrad.prototype.get_positions = function(){return this.Positions;}
CAscFillGrad.prototype.put_positions = function(v){this.Positions = v;}
CAscFillGrad.prototype.get_grad_type = function(){return this.GradType;}
CAscFillGrad.prototype.put_grad_type = function(v){this.GradType = v;}
CAscFillGrad.prototype.get_linear_angle = function(){return this.LinearAngle;}
CAscFillGrad.prototype.put_linear_angle = function(v){this.LinearAngle = v;}
CAscFillGrad.prototype.get_linear_scale = function(){return this.LinearScale;}
CAscFillGrad.prototype.put_linear_scale = function(v){this.LinearScale = v;}
CAscFillGrad.prototype.get_path_type = function(){return this.PathType;}
CAscFillGrad.prototype.put_path_type = function(v){this.PathType = v;}
function CAscFill() function CAscFill()
{ {
this.type = null; this.type = null;
...@@ -430,18 +467,36 @@ function CreateAscFill(unifill) ...@@ -430,18 +467,36 @@ function CreateAscFill(unifill)
} }
case FILL_TYPE_PATT: case FILL_TYPE_PATT:
{ {
ret.type = c_oAscFill.FILL_TYPE_SOLID; ret.type = c_oAscFill.FILL_TYPE_PATT;
ret.fill = new CAscFillSolid(); ret.fill = new CAscFillHatch();
ret.fill.color = CreateAscColor(_fill.fgClr); ret.fill.PatternType = _fill.ftype;
ret.fill.fgClr = CreateAscColor(_fill.fgClr);
ret.fill.bgClr = CreateAscColor(_fill.bgClr);
break; break;
} }
case FILL_TYPE_GRAD: case FILL_TYPE_GRAD:
{ {
ret.type = c_oAscFill.FILL_TYPE_SOLID; ret.type = c_oAscFill.FILL_TYPE_GRAD;
ret.fill = new CAscFillSolid(); ret.fill = new CAscFillGrad();
for (var i = 0; i < _fill.colors.length; i++)
{
ret.fill.Colors.push(CreateAscColor(_fill.colors[i].color));
ret.fill.Positions.push(_fill.colors[i].pos);
}
if (_fill.lin)
{
ret.fill.GradType = c_oAscFillGradType.GRAD_LINEAR;
ret.fill.LinearAngle = _fill.lin.angle;
ret.fill.LinearScale = _fill.lin.scale;
}
else
{
ret.fill.GradType = c_oAscFillGradType.GRAD_PATH;
ret.fill.PathType = 0;
}
if (_fill.colors.length > 0)
ret.fill.color = CreateAscColor(_fill.colors[0].color);
break; break;
} }
case FILL_TYPE_BLIP: case FILL_TYPE_BLIP:
...@@ -509,6 +564,76 @@ function CorrectUniFill(asc_fill, unifill) ...@@ -509,6 +564,76 @@ function CorrectUniFill(asc_fill, unifill)
break; break;
} }
case c_oAscFill.FILL_TYPE_PATT:
{
if (ret.fill == null || ret.fill.type != FILL_TYPE_PATT)
{
ret.fill = new CPattFill();
}
if (undefined != _fill.PatternType)
{
ret.ftype = _fill.PatternType;
}
if (undefined != _fill.fgClr)
{
ret.fill.fgClr = CorrectUniColor(_fill.get_color_fg(), ret.fill.fgClr);
}
if (undefined != _fill.bgClr)
{
ret.fill.bgClr = CorrectUniColor(_fill.get_color_bg(), ret.fill.bgClr);
}
break;
}
case c_oAscFill.FILL_TYPE_GRAD:
{
if (ret.fill == null || ret.fill.type != FILL_TYPE_GRAD)
{
ret.fill = new CGradFill();
}
var _colors = _fill.get_colors();
var _positions = _fill.get_positions();
if (undefined != _colors && undefined != _positions)
{
if (_colors.length == _positions.length)
{
ret.fill.colors.splice(0, ret.fill.colors.length);
for (var i = 0; i < _colors.length; i++)
{
var _gs = new CGs();
_gs.color = CorrectUniColor(_colors[i], _gs.color);
_gs.pos = _positions[i];
ret.fill.colors.push(_gs);
}
}
}
var _grad_type = _fill.get_grad_type();
if (c_oAscFillGradType.GRAD_LINEAR == _grad_type)
{
var _angle = _fill.get_linear_angle();
var _scale = _fill.get_linear_scale();
if (!ret.fill.lin)
ret.fill.lin = new GradLin();
if (undefined != _angle)
ret.fill.lin.angle = _angle;
if (undefined != _scale)
ret.fill.lin.scale = _scale;
}
else if (c_oAscFillGradType.GRAD_PATH == _grad_type)
{
ret.fill.lin = null;
ret.fill.path = new GradPath();
}
break;
}
default: default:
{ {
if (ret.fill == null || ret.fill.type != FILL_TYPE_SOLID) if (ret.fill == null || ret.fill.type != FILL_TYPE_SOLID)
......
...@@ -202,7 +202,14 @@ var c_oAscColor = { ...@@ -202,7 +202,14 @@ var c_oAscColor = {
var c_oAscFill = { var c_oAscFill = {
FILL_TYPE_BLIP : 1, FILL_TYPE_BLIP : 1,
FILL_TYPE_NOFILL : 2, FILL_TYPE_NOFILL : 2,
FILL_TYPE_SOLID : 3 FILL_TYPE_SOLID : 3,
FILL_TYPE_PATT : 4,
FILL_TYPE_GRAD : 5
};
var c_oAscFillGradType = {
GRAD_LINEAR : 1,
GRAD_PATH : 2
}; };
var c_oAscFillBlipType = { var c_oAscFillBlipType = {
......
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