Commit 66f67030 authored by Sergey Luzyanin's avatar Sergey Luzyanin

send title and description to menu

parent 6b8910a5
...@@ -2517,6 +2517,33 @@ DrawingObjectsController.prototype = ...@@ -2517,6 +2517,33 @@ DrawingObjectsController.prototype =
objects_by_type.charts[i].changeFill(props.fill); objects_by_type.charts[i].changeFill(props.fill);
} }
} }
for(i = 0; i < objects_by_type.shapes.length; ++i)
{
objects_by_type.shapes[i].setTitle(props.title);
}
for(i = 0; i < objects_by_type.groups.length; ++i)
{
objects_by_type.groups[i].setTitle(props.title);
}
for(i = 0; i < objects_by_type.charts.length; ++i)
{
objects_by_type.charts[i].setTitle(props.title);
}
for(i = 0; i < objects_by_type.shapes.length; ++i)
{
objects_by_type.shapes[i].setDescription(props.description);
}
for(i = 0; i < objects_by_type.groups.length; ++i)
{
objects_by_type.groups[i].setDescription(props.description);
}
for(i = 0; i < objects_by_type.charts.length; ++i)
{
objects_by_type.charts[i].setDescription(props.description);
}
if(typeof props.ImageUrl === "string" && props.ImageUrl.length > 0) if(typeof props.ImageUrl === "string" && props.ImageUrl.length > 0)
{ {
for(i = 0; i < objects_by_type.images.length; ++i) for(i = 0; i < objects_by_type.images.length; ++i)
...@@ -6790,7 +6817,9 @@ DrawingObjectsController.prototype = ...@@ -6790,7 +6817,9 @@ DrawingObjectsController.prototype =
bFromChart: false, bFromChart: false,
locked: locked, locked: locked,
textArtProperties: drawing.getTextArtProperties(), textArtProperties: drawing.getTextArtProperties(),
lockAspect: lockAspect lockAspect: lockAspect,
title: drawing.getTitle(),
description: drawing.getDescription()
}; };
if(!shape_props) if(!shape_props)
shape_props = new_shape_props; shape_props = new_shape_props;
...@@ -6810,7 +6839,9 @@ DrawingObjectsController.prototype = ...@@ -6810,7 +6839,9 @@ DrawingObjectsController.prototype =
locked: locked, locked: locked,
x: drawing.x, x: drawing.x,
y: drawing.y, y: drawing.y,
lockAspect: lockAspect lockAspect: lockAspect,
title: drawing.getTitle(),
description: drawing.getDescription()
}; };
if(!image_props) if(!image_props)
image_props = new_image_props; image_props = new_image_props;
...@@ -6831,6 +6862,10 @@ DrawingObjectsController.prototype = ...@@ -6831,6 +6862,10 @@ DrawingObjectsController.prototype =
image_props.locked = true; image_props.locked = true;
if(image_props.lockAspect || new_image_props.lockAspect) if(image_props.lockAspect || new_image_props.lockAspect)
image_props.lockAspect = false; image_props.lockAspect = false;
if(image_props.title !== new_image_props.title)
image_props.title = undefined;
if(image_props.description !== new_image_props.description)
image_props.description = undefined;
} }
break; break;
...@@ -6857,7 +6892,9 @@ DrawingObjectsController.prototype = ...@@ -6857,7 +6892,9 @@ DrawingObjectsController.prototype =
pluginGuid: drawing.m_sApplicationId, pluginGuid: drawing.m_sApplicationId,
pluginData: pluginData, pluginData: pluginData,
oleWidth: drawing.m_fDefaultSizeX, oleWidth: drawing.m_fDefaultSizeX,
oleHeight: drawing.m_fDefaultSizeY oleHeight: drawing.m_fDefaultSizeY,
title: drawing.getTitle(),
description: drawing.getDescription()
}; };
if(!image_props) if(!image_props)
image_props = new_image_props; image_props = new_image_props;
...@@ -6881,6 +6918,10 @@ DrawingObjectsController.prototype = ...@@ -6881,6 +6918,10 @@ DrawingObjectsController.prototype =
image_props.pluginData = undefined; image_props.pluginData = undefined;
image_props.oleWidth = undefined; image_props.oleWidth = undefined;
image_props.oleHeight = undefined; image_props.oleHeight = undefined;
if(image_props.title !== new_image_props.title)
image_props.title = undefined;
if(image_props.description !== new_image_props.description)
image_props.description = undefined;
} }
break; break;
} }
...@@ -6895,7 +6936,9 @@ DrawingObjectsController.prototype = ...@@ -6895,7 +6936,9 @@ DrawingObjectsController.prototype =
w: drawing.extX, w: drawing.extX,
h: drawing.extY, h: drawing.extY,
locked: locked, locked: locked,
lockAspect: lockAspect lockAspect: lockAspect,
title: drawing.getTitle(),
description: drawing.getDescription()
}; };
if(!chart_props) if(!chart_props)
{ {
...@@ -6927,6 +6970,12 @@ DrawingObjectsController.prototype = ...@@ -6927,6 +6970,12 @@ DrawingObjectsController.prototype =
chart_props.locked = true; chart_props.locked = true;
if(!chart_props.lockAspect || !new_chart_props.lockAspect) if(!chart_props.lockAspect || !new_chart_props.lockAspect)
chart_props.locked = false; chart_props.locked = false;
if(chart_props.title !== new_chart_props.title)
chart_props.title = undefined;
if(chart_props.description !== new_chart_props.description)
chart_props.description = undefined;
} }
new_shape_props = new_shape_props =
...@@ -6944,7 +6993,9 @@ DrawingObjectsController.prototype = ...@@ -6944,7 +6993,9 @@ DrawingObjectsController.prototype =
bFromChart: true, bFromChart: true,
locked: locked, locked: locked,
textArtProperties: null, textArtProperties: null,
lockAspect: lockAspect lockAspect: lockAspect,
title: drawing.getTitle(),
description: drawing.getDescription()
}; };
if(!shape_props) if(!shape_props)
shape_props = new_shape_props; shape_props = new_shape_props;
...@@ -7063,6 +7114,12 @@ DrawingObjectsController.prototype = ...@@ -7063,6 +7114,12 @@ DrawingObjectsController.prototype =
image_props.locked = true; image_props.locked = true;
if(!image_props.lockAspect || !group_drawing_props.imageProps.lockAspect) if(!image_props.lockAspect || !group_drawing_props.imageProps.lockAspect)
image_props.lockAspect = false; image_props.lockAspect = false;
if(image_props.title !== group_drawing_props.imageProps.title)
image_props.title = undefined;
if(image_props.description !== group_drawing_props.imageProps.description)
image_props.description = undefined;
} }
} }
if(group_drawing_props.chartProps) if(group_drawing_props.chartProps)
...@@ -7088,6 +7145,14 @@ DrawingObjectsController.prototype = ...@@ -7088,6 +7145,14 @@ DrawingObjectsController.prototype =
if(chart_props.h != null && chart_props.h !== group_drawing_props.chartProps.h) if(chart_props.h != null && chart_props.h !== group_drawing_props.chartProps.h)
chart_props.h = null; chart_props.h = null;
if(chart_props.title !== group_drawing_props.title)
chart_props.title = undefined;
if(chart_props.description !== group_drawing_props.chartProps.description)
chart_props.description = undefined;
if(chart_props.locked || group_drawing_props.chartProps.locked) if(chart_props.locked || group_drawing_props.chartProps.locked)
chart_props.locked = true; chart_props.locked = true;
} }
......
...@@ -3820,7 +3820,13 @@ function CompareShapeProperties(shapeProp1, shapeProp2) ...@@ -3820,7 +3820,13 @@ function CompareShapeProperties(shapeProp1, shapeProp2)
_result_shape_prop.locked = true; _result_shape_prop.locked = true;
} }
_result_shape_prop.lockAspect = !!(shapeProp1.lockAspect && shapeProp2.lockAspect); _result_shape_prop.lockAspect = !!(shapeProp1.lockAspect && shapeProp2.lockAspect);
_result_shape_prop.textArtProperties = CompareTextArtProperties(shapeProp1.textArtProperties, shapeProp2.textArtProperties) _result_shape_prop.textArtProperties = CompareTextArtProperties(shapeProp1.textArtProperties, shapeProp2.textArtProperties);
if(shapeProp1.title === shapeProp2.title){
_result_shape_prop.title = shapeProp1.title;
}
if(shapeProp1.description === shapeProp2.description){
_result_shape_prop.description = shapeProp1.description;
}
return _result_shape_prop; return _result_shape_prop;
} }
...@@ -11894,6 +11900,8 @@ function CreateAscShapePropFromProp(shapeProp) ...@@ -11894,6 +11900,8 @@ function CreateAscShapePropFromProp(shapeProp)
{ {
obj.textArtProperties = CreateAscTextArtProps(shapeProp.textArtProperties); obj.textArtProperties = CreateAscTextArtProps(shapeProp.textArtProperties);
} }
obj.title = shapeProp.title;
obj.description = shapeProp.description;
return obj; return obj;
} }
......
...@@ -416,6 +416,39 @@ ...@@ -416,6 +416,39 @@
} }
}; };
CGraphicObjectBase.prototype.getNvProps = function(){
return this.nvSpPr || this.nvPicPr || this.nvGrpSpPr || this.nvGraphicFramePr || null;
};
CGraphicObjectBase.prototype.setTitle = function(sTitle){
var oNvPr = this.getNvProps();
if(oNvPr){
oNvPr.setTitle(sTitle ? sTitle : null);
}
};
CGraphicObjectBase.prototype.setDescription = function(sDescription){
var oNvPr = this.getNvProps();
if(oNvPr){
oNvPr.setDecr(sDescription ? sDescription : null);
}
};
CGraphicObjectBase.prototype.getTitle = function(){
var oNvPr = this.getNvProps();
if(oNvPr){
return oNvPr.title ? oNvPr.title : undefined;
}
return undefined;
};
CGraphicObjectBase.prototype.getDescription = function(){
var oNvPr = this.getNvProps();
if(oNvPr){
return oNvPr.descr ? oNvPr.descr : undefined;
}
return undefined;
};
window['AscFormat'] = window['AscFormat'] || {}; window['AscFormat'] = window['AscFormat'] || {};
window['AscFormat'].CGraphicObjectBase = CGraphicObjectBase; window['AscFormat'].CGraphicObjectBase = CGraphicObjectBase;
window['AscFormat'].CGraphicBounds = CGraphicBounds; window['AscFormat'].CGraphicBounds = CGraphicBounds;
......
...@@ -1595,6 +1595,8 @@ ...@@ -1595,6 +1595,8 @@
this.verticalTextAlign = null; this.verticalTextAlign = null;
this.textArtProperties = null; this.textArtProperties = null;
this.lockAspect = null; this.lockAspect = null;
this.title = null;
this.description = null;
} }
asc_CShapeProperty.prototype = { asc_CShapeProperty.prototype = {
...@@ -1633,29 +1635,37 @@ ...@@ -1633,29 +1635,37 @@
}, },
asc_getWidth: function () { asc_getWidth: function () {
return this.w return this.w;
}, asc_putWidth: function (v) { }, asc_putWidth: function (v) {
this.w = v; this.w = v;
}, asc_getHeight: function () { }, asc_getHeight: function () {
return this.h return this.h;
}, asc_putHeight: function (v) { }, asc_putHeight: function (v) {
this.h = v; this.h = v;
}, asc_getVerticalTextAlign: function () { }, asc_getVerticalTextAlign: function () {
return this.verticalTextAlign return this.verticalTextAlign;
}, asc_putVerticalTextAlign: function (v) { }, asc_putVerticalTextAlign: function (v) {
this.verticalTextAlign = v; this.verticalTextAlign = v;
}, asc_getVert: function () { }, asc_getVert: function () {
return this.vert return this.vert;
}, asc_putVert: function (v) { }, asc_putVert: function (v) {
this.vert = v; this.vert = v;
}, asc_getTextArtProperties: function () { }, asc_getTextArtProperties: function () {
return this.textArtProperties return this.textArtProperties;
}, asc_putTextArtProperties: function (v) { }, asc_putTextArtProperties: function (v) {
this.textArtProperties = v; this.textArtProperties = v;
}, asc_getLockAspect: function () { }, asc_getLockAspect: function () {
return this.lockAspect return this.lockAspect
}, asc_putLockAspect: function (v) { }, asc_putLockAspect: function (v) {
this.lockAspect = v; this.lockAspect = v;
}, asc_getTitle: function () {
return this.title;
}, asc_putTitle: function (v) {
this.title = v;
}, asc_getDescription: function () {
return this.description;
}, asc_putDescription: function (v) {
this.description = v;
} }
}; };
...@@ -1900,6 +1910,10 @@ ...@@ -1900,6 +1910,10 @@
this.pluginData = obj.pluginData !== undefined ? obj.pluginData : undefined; this.pluginData = obj.pluginData !== undefined ? obj.pluginData : undefined;
this.oleWidth = obj.oleWidth != undefined ? obj.oleWidth : undefined; this.oleWidth = obj.oleWidth != undefined ? obj.oleWidth : undefined;
this.oleHeight = obj.oleHeight != undefined ? obj.oleHeight : undefined; this.oleHeight = obj.oleHeight != undefined ? obj.oleHeight : undefined;
this.title = obj.title != undefined ? obj.title : undefined;
this.description = obj.title != undefined ? obj.title : undefined;
} else { } else {
this.CanBeFlow = true; this.CanBeFlow = true;
this.Width = undefined; this.Width = undefined;
...@@ -1936,6 +1950,8 @@ ...@@ -1936,6 +1950,8 @@
this.oleWidth = undefined; this.oleWidth = undefined;
this.oleHeight = undefined; this.oleHeight = undefined;
this.title = undefined;
this.description = undefined;
} }
} }
...@@ -2142,6 +2158,22 @@ ...@@ -2142,6 +2158,22 @@
asc_putPluginData: function (v) { asc_putPluginData: function (v) {
this.pluginData = v; this.pluginData = v;
},
asc_getTitle: function(){
return this.title;
},
asc_putTitle: function(v){
this.title = v;
},
asc_getDescription: function(){
return this.description;
},
asc_putDescription: function(v){
this.description = v;
} }
}; };
...@@ -3206,6 +3238,10 @@ ...@@ -3206,6 +3238,10 @@
prot["put_TextArtProperties"] = prot["asc_putTextArtProperties"] = prot.asc_putTextArtProperties; prot["put_TextArtProperties"] = prot["asc_putTextArtProperties"] = prot.asc_putTextArtProperties;
prot["get_LockAspect"] = prot["asc_getLockAspect"] = prot.asc_getLockAspect; prot["get_LockAspect"] = prot["asc_getLockAspect"] = prot.asc_getLockAspect;
prot["put_LockAspect"] = prot["asc_putLockAspect"] = prot.asc_putLockAspect; prot["put_LockAspect"] = prot["asc_putLockAspect"] = prot.asc_putLockAspect;
prot["get_Title"] = prot["asc_getTitle"] = prot.asc_getTitle;
prot["put_Title"] = prot["asc_putTitle"] = prot.asc_putTitle;
prot["get_Description"] = prot["asc_getDescription"] = prot.asc_getDescription;
prot["put_Description"] = prot["asc_putDescription"] = prot.asc_putDescription;
window["Asc"]["asc_TextArtProperties"] = window["Asc"].asc_TextArtProperties = asc_TextArtProperties; window["Asc"]["asc_TextArtProperties"] = window["Asc"].asc_TextArtProperties = asc_TextArtProperties;
prot = asc_TextArtProperties.prototype; prot = asc_TextArtProperties.prototype;
...@@ -3324,6 +3360,14 @@ ...@@ -3324,6 +3360,14 @@
prot["get_PluginData"] = prot["asc_getPluginData"] = prot.asc_getPluginData; prot["get_PluginData"] = prot["asc_getPluginData"] = prot.asc_getPluginData;
prot["put_PluginData"] = prot["asc_putPluginData"] = prot.asc_putPluginData; prot["put_PluginData"] = prot["asc_putPluginData"] = prot.asc_putPluginData;
prot["get_Title"] = prot["asc_getTitle"] = prot.asc_getTitle;
prot["put_Title"] = prot["asc_putTitle"] = prot.asc_putTitle;
prot["get_Description"] = prot["asc_getDescription"] = prot.asc_getDescription;
prot["put_Description"] = prot["asc_putDescription"] = prot.asc_putDescription;
window["AscCommon"].asc_CSelectedObject = asc_CSelectedObject; window["AscCommon"].asc_CSelectedObject = asc_CSelectedObject;
prot = asc_CSelectedObject.prototype; prot = asc_CSelectedObject.prototype;
prot["get_ObjectType"] = prot["asc_getObjectType"] = prot.asc_getObjectType; prot["get_ObjectType"] = prot["asc_getObjectType"] = prot.asc_getObjectType;
......
...@@ -157,6 +157,9 @@ ...@@ -157,6 +157,9 @@
this.severalCharts = obj.severalCharts != undefined ? obj.severalCharts : false; this.severalCharts = obj.severalCharts != undefined ? obj.severalCharts : false;
this.severalChartTypes = obj.severalChartTypes != undefined ? obj.severalChartTypes : undefined; this.severalChartTypes = obj.severalChartTypes != undefined ? obj.severalChartTypes : undefined;
this.severalChartStyles = obj.severalChartStyles != undefined ? obj.severalChartStyles : undefined; this.severalChartStyles = obj.severalChartStyles != undefined ? obj.severalChartStyles : undefined;
this.title = obj.title != undefined ? obj.title : undefined;
this.description = obj.description != undefined ? obj.description : undefined;
} }
else else
{ {
...@@ -170,6 +173,8 @@ ...@@ -170,6 +173,8 @@
this.severalCharts = false; this.severalCharts = false;
this.severalChartTypes = undefined; this.severalChartTypes = undefined;
this.severalChartStyles = undefined; this.severalChartStyles = undefined;
this.title = undefined;
this.description = undefined;
} }
} }
...@@ -405,6 +410,24 @@ ...@@ -405,6 +410,24 @@
this.Width = v; this.Width = v;
}; };
CAscChartProp.prototype.asc_setTitle = function(v)
{
this.title = v;
};
CAscChartProp.prototype.asc_setDescription = function(v)
{
this.description = v;
};
CAscChartProp.prototype.asc_getTitle = function()
{
return this.title;
};
CAscChartProp.prototype.asc_getDescription = function()
{
return this.description;
};
CAscChartProp.prototype.getType = function() CAscChartProp.prototype.getType = function()
{ {
return this.ChartProperties && this.ChartProperties.getType(); return this.ChartProperties && this.ChartProperties.getType();
...@@ -6974,6 +6997,10 @@ background-repeat: no-repeat;\ ...@@ -6974,6 +6997,10 @@ background-repeat: no-repeat;\
CAscChartProp.prototype['asc_setStyleId'] = CAscChartProp.prototype.asc_setStyleId; CAscChartProp.prototype['asc_setStyleId'] = CAscChartProp.prototype.asc_setStyleId;
CAscChartProp.prototype['asc_setHeight'] = CAscChartProp.prototype.asc_setHeight; CAscChartProp.prototype['asc_setHeight'] = CAscChartProp.prototype.asc_setHeight;
CAscChartProp.prototype['asc_setWidth'] = CAscChartProp.prototype.asc_setWidth; CAscChartProp.prototype['asc_setWidth'] = CAscChartProp.prototype.asc_setWidth;
CAscChartProp.prototype['asc_setTitle'] = CAscChartProp.prototype.asc_setTitle;
CAscChartProp.prototype['asc_setDescription'] = CAscChartProp.prototype.asc_setDescription;
CAscChartProp.prototype['asc_getTitle'] = CAscChartProp.prototype.asc_getTitle;
CAscChartProp.prototype['asc_getDescription'] = CAscChartProp.prototype.asc_getDescription;
CAscChartProp.prototype['getType'] = CAscChartProp.prototype.getType; CAscChartProp.prototype['getType'] = CAscChartProp.prototype.getType;
CAscChartProp.prototype['putType'] = CAscChartProp.prototype.putType; CAscChartProp.prototype['putType'] = CAscChartProp.prototype.putType;
CAscChartProp.prototype['getStyle'] = CAscChartProp.prototype.getStyle; CAscChartProp.prototype['getStyle'] = CAscChartProp.prototype.getStyle;
......
...@@ -498,6 +498,10 @@ CGraphicObjects.prototype = ...@@ -498,6 +498,10 @@ CGraphicObjects.prototype =
shape_props.Width = props_by_types.shapeProps.w; shape_props.Width = props_by_types.shapeProps.w;
shape_props.Height = props_by_types.shapeProps.h; shape_props.Height = props_by_types.shapeProps.h;
shape_props.lockAspect = props_by_types.shapeProps.lockAspect; shape_props.lockAspect = props_by_types.shapeProps.lockAspect;
if(this.selection.group){
shape_props.description = props_by_types.shapeProps.description;
shape_props.title = props_by_types.shapeProps.title;
}
} }
if(props_by_types.imageProps) if(props_by_types.imageProps)
{ {
...@@ -512,6 +516,10 @@ CGraphicObjects.prototype = ...@@ -512,6 +516,10 @@ CGraphicObjects.prototype =
image_props.oleWidth = props_by_types.imageProps.oleWidth; image_props.oleWidth = props_by_types.imageProps.oleWidth;
image_props.oleHeight = props_by_types.imageProps.oleHeight; image_props.oleHeight = props_by_types.imageProps.oleHeight;
if(this.selection.group){
image_props.description = props_by_types.imageProps.description;
image_props.title = props_by_types.imageProps.title;
}
} }
if(props_by_types.chartProps && !(props_by_types.chartProps.severalCharts === true)) if(props_by_types.chartProps && !(props_by_types.chartProps.severalCharts === true))
{ {
...@@ -520,6 +528,10 @@ CGraphicObjects.prototype = ...@@ -520,6 +528,10 @@ CGraphicObjects.prototype =
chart_props.severalCharts = props_by_types.chartProps.severalCharts; chart_props.severalCharts = props_by_types.chartProps.severalCharts;
chart_props.severalChartStyles = props_by_types.chartProps.severalChartStyles; chart_props.severalChartStyles = props_by_types.chartProps.severalChartStyles;
chart_props.severalChartTypes = props_by_types.chartProps.severalChartTypes; chart_props.severalChartTypes = props_by_types.chartProps.severalChartTypes;
if(this.selection.group){
chart_props.description = props_by_types.chartProps.description;
chart_props.title = props_by_types.chartProps.title;
}
} }
} }
......
...@@ -352,6 +352,9 @@ ParaDrawing.prototype.Get_Props = function(OtherProps) ...@@ -352,6 +352,9 @@ ParaDrawing.prototype.Get_Props = function(OtherProps)
} }
} }
Props.title = this.docPr.title !== null ? this.docPr.title : undefined;
Props.description = this.docPr.descr !== null ? this.docPr.descr : undefined;
if (null != OtherProps && undefined != OtherProps) if (null != OtherProps && undefined != OtherProps)
{ {
// Соединяем // Соединяем
...@@ -426,6 +429,14 @@ ParaDrawing.prototype.Get_Props = function(OtherProps) ...@@ -426,6 +429,14 @@ ParaDrawing.prototype.Get_Props = function(OtherProps)
Props.CanBeFlow = false; Props.CanBeFlow = false;
else else
Props.CanBeFlow = true; Props.CanBeFlow = true;
if(undefined === OtherProps.title || Props.title !== OtherProps.title){
Props.title = undefined;
}
if(undefined === OtherProps.description || Props.description !== OtherProps.description){
Props.description = undefined;
}
} }
return Props; return Props;
...@@ -795,6 +806,13 @@ ParaDrawing.prototype.Set_Props = function(Props) ...@@ -795,6 +806,13 @@ ParaDrawing.prototype.Set_Props = function(Props)
{ {
this.Check_WrapPolygon(); this.Check_WrapPolygon();
} }
if(undefined != Props.description){
this.docPr.setDecr(Props.description);
}
if(undefined != Props.title){
this.docPr.setTitle(Props.title);
}
}; };
ParaDrawing.prototype.CheckWH = function() ParaDrawing.prototype.CheckWH = function()
{ {
......
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