Commit 1a4e5560 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin

Правки для комментов в презентациях. Передача colorMapOverride во фрейм....

Правки для комментов в презентациях. Передача colorMapOverride во фрейм. Проверка на переоткрытие бинарника при смене тем в презентациях.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@59750 954022d7-b5bf-4e40-9824-e11837661b57
parent 8be87eff
......@@ -172,10 +172,10 @@ function asc_CChartBinary(chart) {
pptx_writer.WriteTheme(chart.theme);
this["themeBinary"] = pptx_writer.pos + ";" + pptx_writer.GetBase64Memory();
}
if(chart.colorMap)
if(chart.colorMapOverride)
{
pptx_writer = new CBinaryFileWriter();
pptx_writer.WriteClrMap(chart.colorMap);
pptx_writer.WriteRecord1(1, chart.colorMapOverride, pptx_writer.WriteClrMap);
this["colorMapBinary"] = pptx_writer.pos + ";" + pptx_writer.GetBase64Memory();
}
}
......@@ -187,6 +187,8 @@ asc_CChartBinary.prototype = {
asc_setBinary: function(val) { this["binary"] = val; },
asc_getThemeBinary: function() { return this["themeBinary"]; },
asc_setThemeBinary: function(val) { this["themeBinary"] = val; },
asc_setColorMapBinary: function(val){this["colorMapBinary"] = val;},
asc_getColorMapBinary: function(){return this["colorMapBinary"];},
getChartSpace: function(workSheet)
{
var binary = this["binary"];
......@@ -232,6 +234,7 @@ asc_CChartBinary.prototype = {
oBinaryReader.stream.size = stream.size;
oBinaryReader.stream.pos = stream.pos;
oBinaryReader.stream.cur = stream.cur;
var _rec = oBinaryReader.stream.GetUChar();
var ret = new ClrMap();
oBinaryReader.ReadClrMap(ret);
return ret;
......@@ -250,6 +253,8 @@ prot["asc_getBinary"] = prot.asc_getBinary;
prot["asc_setBinary"] = prot.asc_setBinary;
prot["asc_getThemeBinary"] = prot.asc_getThemeBinary;
prot["asc_setThemeBinary"] = prot.asc_setThemeBinary;
prot["asc_setColorMapBinary"] = prot.asc_setColorMapBinary;
prot["asc_getColorMapBinary"] = prot.asc_getColorMapBinary;
//}
//-----------------------------------------------------------------------------------
......@@ -2792,12 +2797,18 @@ function DrawingObjects() {
var asc_chart_binary = new Asc.asc_CChartBinary();
asc_chart_binary.asc_setBinary(chart["binary"]);
asc_chart_binary.asc_setThemeBinary(chart["themeBinary"]);
asc_chart_binary.asc_setColorMapBinary(chart["colorMapBinary"]);
var oNewChartSpace = asc_chart_binary.getChartSpace(worksheet.model);
var theme = asc_chart_binary.getTheme();
if(theme)
{
worksheet.model.workbook.theme = theme;
}
var colorMapOverride = asc_chart_binary.getColorMap();
if(colorMapOverride)
{
DEFAULT_COLOR_MAP = colorMapOverride;
}
var font_map = {};
oNewChartSpace.documentGetAllFontNames(font_map);
checkThemeFonts(font_map, worksheet.model.workbook.theme.themeElements.fontScheme);
......
......@@ -3481,6 +3481,10 @@ DrawingObjectsController.prototype =
}
this.updateOverlay();
}
else if(this.drawingObjects.slideComments)
{
this.drawingObjects.slideComments.removeSelectedComment();
}
},
......@@ -4293,9 +4297,13 @@ DrawingObjectsController.prototype =
--count;
}
this.changeCurrentState(new NullState(this, this.drawingObjects));
},
getColorMapOverride: function()
{
return null;
},
Document_UpdateInterfaceState: function()
{},
......@@ -4337,6 +4345,7 @@ DrawingObjectsController.prototype =
ret.spPr.xfrm.setOffX(0);
ret.spPr.xfrm.setOffY(0);
ret.theme = this.getTheme();
ret.colorMapOverride = this.getColorMapOverride();
return ret;
}, this, []);
}
......@@ -4347,6 +4356,7 @@ DrawingObjectsController.prototype =
if(this.selection.groupSelection.selectedObjects.length === 1 && this.selection.groupSelection.selectedObjects[0].getObjectType() === historyitem_type_ChartSpace)
{
this.selection.groupSelection.selectedObjects[0].theme = this.getTheme();
this.selection.groupSelection.selectedObjects[0].colorMapOverride = this.getColorMapOverride();
ExecuteNoHistory(function()
{
CheckSpPrXfrm2(this.selection.groupSelection.selectedObjects[0]);
......@@ -4359,6 +4369,7 @@ DrawingObjectsController.prototype =
if(this.selectedObjects.length === 1 && this.selectedObjects[0].getObjectType() === historyitem_type_ChartSpace)
{
this.selectedObjects[0].theme = this.getTheme();
this.selectedObjects[0].colorMapOverride = this.getColorMapOverride();
ExecuteNoHistory(function()
{
CheckSpPrXfrm2(this.selectedObjects[0]);
......
......@@ -233,7 +233,7 @@ NullState.prototype =
}
if(this.drawingObjects.handleEventMode === HANDLE_EVENT_MODE_HANDLE)
{
if(start_target_doc_content)
if(start_target_doc_content || selected_comment_index > -1)
{
this.drawingObjects.drawingObjects.showDrawingObjects(true);
}
......
......@@ -57,7 +57,7 @@ function CThemeLoader()
// применяется тема из стандартных.
if (null != theme_load_info)
{
if (indexTheme >= 0 && this.IsReloadBinaryThemeEditor)
if (indexTheme >= 0 && theme_load_info.Master.sldLayoutLst.length === 0)
{
// мега схема. нужно переоткрыть бинарник, чтобы все открылось с историей
this.IsReloadBinaryThemeEditorNow = true;
......
......@@ -13,7 +13,17 @@ DrawingObjectsController.prototype.getDrawingArray = function()
DrawingObjectsController.prototype.checkSelectedObjectsAndCallback = function(callback, args)
{
if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false)
var check_type = changestype_Drawing_Props, comment;
if(this.drawingObjects.slideComments)
{
comment = this.drawingObjects.slideComments.getSelectedComment();
if(comment)
{
check_type = changestype_MoveComment;
comment = comment.Get_Id();
}
}
if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(check_type, comment) === false)
{
History.Create_NewPoint();
callback.apply(this, args);
......@@ -92,6 +102,10 @@ DrawingObjectsController.prototype.showChartSettings = function()
editor.asc_doubleClickOnChart(this.getChartObject());
this.changeCurrentState(new NullState(this));
};
DrawingObjectsController.prototype.getColorMapOverride = function()
{
return this.drawingObjects.Get_ColorMap();
};
DrawingObjectsController.prototype.editChart = function(binary)
{
var bin_object = {"binary":binary};
......@@ -126,8 +140,11 @@ DrawingObjectsController.prototype.editChart = function(binary)
chart_space.spPr.xfrm.setOffY(this.selectedObjects[0].y);
var pos = this.selectedObjects[0].deleteDrawingBase();
chart_space.addToDrawingObjects(pos);
this.resetSelection();
this.selectObject(chart_space, this.drawingObjects.num);
this.startRecalculate();
this.sendGraphicObjectProps();
this.updateOverlay();
}
};
......@@ -265,7 +282,11 @@ MoveCommentState.prototype =
if(!this.drawingObjects.isViewMode() && editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_MoveComment, this.comment.Get_Id()) === false)
{
History.Create_NewPoint();
this.drawingObjects.trackEnd();
var tracks = this.drawingObjects.arrTrackObjects;
for(var i = 0; i < tracks.length; ++i)
{
tracks[i].trackEnd();
}
this.drawingObjects.startRecalculate();
}
this.drawingObjects.clearTrackObjects();
......
......@@ -596,8 +596,14 @@ CComment.prototype =
Refresh_RecalcData: function(Data)
{
// Ничего не делаем (если что просто будет перерисовка)
if(this.slideComments)
{
this.slideComments.Refresh_RecalcData();
}
},
recalculate: function()
{},
//-----------------------------------------------------------------------------------
// Функции для работы с совместным редактированием
//-----------------------------------------------------------------------------------
......
......@@ -55,7 +55,7 @@ function Slide(presentation, slideLayout, slideNum)
{
this.Width = presentation.Width;
this.Height = presentation.Height;
this.setSlideComments(new SlideComments());
this.setSlideComments(new SlideComments(this));
this.setLocks(new PropLocker(this.Id), new PropLocker(this.Id), new PropLocker(this.Id), new PropLocker(this.Id), new PropLocker(this.Id));
}
......@@ -1442,10 +1442,11 @@ CTextBody.prototype.checkCurrentPlaceholder = function()
};
function SlideComments()
function SlideComments(slide)
{
this.comments = [];
this.m_oContentChanges = new CContentChanges(); // список изменений(добавление/удаление элементов)
this.slide = slide;
this.Id = g_oIdCounter.Get_NewId();
g_oTableId.Add(this, this.Id);
}
......@@ -1481,6 +1482,17 @@ SlideComments.prototype =
{
History.Add(this, {Type: historyitem_SlideCommentsAddComment, objectId: comment.Get_Id(), Pos:this.comments.length});
this.comments.splice(this.comments.length, 0, comment);
comment.slideComments = this;
},
getSlideIndex: function()
{
if(this.slide)
{
return this.slide.num;
}
return null;
},
......@@ -1505,25 +1517,53 @@ SlideComments.prototype =
{
History.Add(this, {Type: historyitem_SlideCommentsRemoveComment, Pos: i, id: id});
this.comments.splice(i, 1);
editor.sync_RemoveComment(id);
return;
}
}
},
removeSelectedComment: function()
{
var comment = this.getSelectedComment();
if(comment)
{
this.removeComment(comment.Get_Id());
}
},
getSelectedComment: function()
{
for(var i = 0; i < this.comments.length; ++i)
{
if(this.comments[i].selected)
{
return this.comments[i];
}
}
return null;
},
recalculate: function()
{},
Write_ToBinary2: function(w)
{
w.WriteLong(historyitem_type_SlideComments);
w.WriteString2(this.Id);
writeObject(w, this.slide);
},
Read_FromBinary2: function(r)
{
this.Id = r.GetString2();
this.slide = readObject(r);
},
Refresh_RecalcData: function()
{},
{
History.RecalcData_Add({Type: historyrecalctype_Drawing, Object: this});
},
Save_Changes: function(data, w)
{
......@@ -1558,6 +1598,7 @@ SlideComments.prototype =
var id = r.GetString2();
var pos2 = this.m_oContentChanges.Check( contentchanges_Add, pos);
this.comments.splice(pos2, 0, g_oTableId.Get_ById(id));
this.comments[pos2].slideComments = this;
editor.sync_AddComment( id, this.comments[pos2].Data);
break;
}
......
......@@ -113,6 +113,11 @@ CGraphicObjects.prototype =
return this.document.theme;
},
getColorMapOverride: function()
{
return null;
},
isViewMode: function()
{
return editor.isViewMode;
......
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