Commit 3443e03e authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

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

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

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@63539 954022d7-b5bf-4e40-9824-e11837661b57
parent f7c74901
......@@ -1564,6 +1564,29 @@ function DrawingObjects() {
}
};
_this.addTextArt = function(nStyle)
{
if (!_this.isViewerMode()) {
var oVisibleRange = worksheet.getVisibleRange();
_this.objectLocker.reset();
_this.objectLocker.addObjectId(g_oIdCounter.Get_NewId());
_this.objectLocker.checkObjects(function (bLock) {
if (bLock !== true)
return;
_this.controller.resetSelection();
var dLeft = worksheet.getCellLeft(oVisibleRange.c1, 3);
var dTop = worksheet.getCellTop(oVisibleRange.r1, 3);
var dRight = worksheet.getCellLeft(oVisibleRange.c2, 3) + worksheet.getColumnWidth(oVisibleRange.c2, 3);
var dBottom = worksheet.getCellTop(oVisibleRange.r2, 3) + worksheet.getRowHeight(oVisibleRange.r2, 3);
_this.controller.addTextArtFromParams(nStyle, dLeft, dTop, dRight - dLeft, dBottom - dTop, worksheet.model);
worksheet.setSelectionShape(true);
});
}
};
_this.editImageDrawingObject = function(imageUrl) {
if ( imageUrl ) {
......
......@@ -506,99 +506,102 @@ TextArtPreviewManager.prototype.initStyles = function()
oTextPr.Bold = true;
oTextPr.TextFill = CorrectUniFill(CreateAscGradFillByIndex(52, 24, 5400000), new CUniFill());
oTextPr.TextOutline = CreateNoFillLine();
this.aStylesByIndex[1] = oTextPr;
this.aStylesByIndexToApply[1] = oTextPr;
this.aStylesByIndex[4] = oTextPr;
this.aStylesByIndexToApply[4] = oTextPr;
oTextPr = new CTextPr();
oTextPr.Bold = true;
oTextPr.TextFill = CorrectUniFill(CreateAscGradFillByIndex(44, 42, 5400000), new CUniFill());
oTextPr.TextOutline = CreateNoFillLine();
this.aStylesByIndex[2] = oTextPr;
this.aStylesByIndexToApply[2] = oTextPr;
this.aStylesByIndex[8] = oTextPr;
this.aStylesByIndexToApply[8] = oTextPr;
oTextPr = new CTextPr();
oTextPr.Bold = true;
oTextPr.TextFill = CreateNoFillUniFill();
oTextPr.TextOutline = CreatePenFromParams(CorrectUniFill(CreateAscFillByIndex(34)), undefined, undefined, undefined, undefined, (15773/36000)*this.dKoeff);
this.aStylesByIndex[3] = oTextPr;
this.aStylesByIndex[1] = oTextPr;
oTextPr = new CTextPr();
oTextPr.Bold = true;
oTextPr.TextFill = CreateNoFillUniFill();
oTextPr.TextOutline = CreatePenFromParams(CorrectUniFill(CreateAscFillByIndex(34)), undefined, undefined, undefined, undefined, (15773/36000));
this.aStylesByIndexToApply[3] = oTextPr;
this.aStylesByIndexToApply[1] = oTextPr;
oTextPr = new CTextPr();
oTextPr.Bold = true;
oTextPr.TextFill = CreateNoFillUniFill();
oTextPr.TextOutline = CreatePenFromParams(CorrectUniFill(CreateAscFillByIndex(59)), undefined, undefined, undefined, undefined, (15773/36000)*this.dKoeff);
this.aStylesByIndex[4] = oTextPr;
this.aStylesByIndex[5] = oTextPr;
oTextPr = new CTextPr();
oTextPr.Bold = true;
oTextPr.TextFill = CreateNoFillUniFill();
oTextPr.TextOutline = CreatePenFromParams(CorrectUniFill(CreateAscFillByIndex(59)), undefined, undefined, undefined, undefined, (15773/36000));
this.aStylesByIndexToApply[4] = oTextPr;
this.aStylesByIndexToApply[5] = oTextPr;
oTextPr = new CTextPr();
oTextPr.Bold = true;
oTextPr.TextFill = CreateNoFillUniFill();
oTextPr.TextOutline = CreatePenFromParams(CorrectUniFill(CreateAscFillByIndex(52)), undefined, undefined, undefined, undefined, (15773/36000)*this.dKoeff);
this.aStylesByIndex[5] = oTextPr;
this.aStylesByIndex[9] = oTextPr;
oTextPr = new CTextPr();
oTextPr.Bold = true;
oTextPr.TextFill = CreateNoFillUniFill();
oTextPr.TextOutline = CreatePenFromParams(CorrectUniFill(CreateAscFillByIndex(52)), undefined, undefined, undefined, undefined, (15773/36000));
this.aStylesByIndexToApply[5] = oTextPr;
this.aStylesByIndexToApply[9] = oTextPr;
oTextPr = new CTextPr();
oTextPr.Bold = true;
oTextPr.TextFill = CorrectUniFill(CreateAscFillByIndex(27), new CUniFill());
oTextPr.TextOutline = CreatePenFromParams(CorrectUniFill(CreateAscFillByIndex(52)), undefined, undefined, undefined, undefined, (12700/36000)*this.dKoeff);
this.aStylesByIndex[6] = oTextPr;
this.aStylesByIndex[2] = oTextPr;
oTextPr = new CTextPr();
oTextPr.Bold = true;
oTextPr.TextFill = CorrectUniFill(CreateAscFillByIndex(27), new CUniFill());
oTextPr.TextOutline = CreatePenFromParams(CorrectUniFill(CreateAscFillByIndex(52)), undefined, undefined, undefined, undefined, (12700/36000));
this.aStylesByIndexToApply[6] = oTextPr;
this.aStylesByIndexToApply[2] = oTextPr;
oTextPr = new CTextPr();
oTextPr.Bold = true;
oTextPr.TextFill = CorrectUniFill(CreateAscFillByIndex(42), new CUniFill());
oTextPr.TextOutline = CreatePenFromParams(CorrectUniFill(CreateAscFillByIndex(46)), undefined, undefined, undefined, undefined, (12700/36000)*this.dKoeff);
this.aStylesByIndex[7] = oTextPr;
this.aStylesByIndex[6] = oTextPr;
oTextPr = new CTextPr();
oTextPr.Bold = true;
oTextPr.TextFill = CorrectUniFill(CreateAscFillByIndex(42), new CUniFill());
oTextPr.TextOutline = CreatePenFromParams(CorrectUniFill(CreateAscFillByIndex(46)), undefined, undefined, undefined, undefined, (12700/36000));
this.aStylesByIndexToApply[7] = oTextPr;
this.aStylesByIndexToApply[6] = oTextPr;
oTextPr = new CTextPr();
oTextPr.Bold = true;
oTextPr.TextFill = CorrectUniFill(CreateAscFillByIndex(57), new CUniFill());
oTextPr.TextOutline = CreatePenFromParams(CorrectUniFill(CreateAscFillByIndex(54)), undefined, undefined, undefined, undefined, (12700/36000)*this.dKoeff);
this.aStylesByIndex[8] = oTextPr;
this.aStylesByIndex[10] = oTextPr;
oTextPr = new CTextPr();
oTextPr.Bold = true;
oTextPr.TextFill = CorrectUniFill(CreateAscFillByIndex(57), new CUniFill());
oTextPr.TextOutline = CreatePenFromParams(CorrectUniFill(CreateAscFillByIndex(54)), undefined, undefined, undefined, undefined, (12700/36000));
this.aStylesByIndexToApply[8] = oTextPr;
this.aStylesByIndexToApply[10] = oTextPr;
oTextPr = new CTextPr();
oTextPr.Bold = true;
oTextPr.TextFill = CorrectUniFill(CreateAscGradFillByIndex(45, 57, 0), new CUniFill());
oTextPr.TextOutline = CreateNoFillLine();
this.aStylesByIndex[9] = oTextPr;
this.aStylesByIndex[3] = oTextPr;
this.aStylesByIndexToApply[3] = oTextPr;
oTextPr = new CTextPr();
oTextPr.Bold = true;
oTextPr.TextFill = CorrectUniFill(CreateAscGradFillByIndex(52, 33, 0), new CUniFill());
oTextPr.TextOutline = CreateNoFillLine();
this.aStylesByIndex[10] = oTextPr;
this.aStylesByIndex[7] = oTextPr;
this.aStylesByIndexToApply[7] = oTextPr;
oTextPr = new CTextPr();
oTextPr.Bold = true;
oTextPr.TextFill = CorrectUniFill(CreateAscGradFillByIndex(27, 45, 5400000), new CUniFill());
oTextPr.TextOutline = CreateNoFillLine();
this.aStylesByIndex[11] = oTextPr;
this.aStylesByIndexToApply[11] = oTextPr;
}
TextArtPreviewManager.prototype.getStylesToApply = function()
......@@ -793,7 +796,7 @@ TextArtPreviewManager.prototype.getTAShape = function()
var oParagraph = oContent.Content[0];
for(var i = 0; i < sText.length; ++i)
{
oParagraph.Add(new ParaText(sText[i]));
oContent.Paragraph_Add(new ParaText(sText[i]), false);
}
oContent.Set_ApplyToAll(true);
oContent.Paragraph_Add(new ParaTextPr({FontSize: 109, RFonts: {Ascii : {Name: "Arial", Index: -1}}}));
......
......@@ -1805,6 +1805,20 @@ DrawingObjectsController.prototype =
}
},
getTextArtPreviewManager: function()
{
var api;
if(window["Asc"] && window["Asc"]["editor"])
{
api = window["Asc"]["editor"];
}
else
{
api = editor;
}
return api.textArtPreviewManager;
},
applyDrawingProps: function(props)
{
var objects_by_type = this.getSelectedObjectsByTypes(true);
......@@ -1897,6 +1911,7 @@ DrawingObjectsController.prototype =
this.applyPropsToChartSpace(props.ChartProperties, objects_by_type.charts[i]);
}
}
var aGroups = [];
if(isRealNumber(props.Width) && isRealNumber(props.Height))
{
......@@ -1976,12 +1991,29 @@ DrawingObjectsController.prototype =
{
aGroups[i].updateCoordinatesAfterInternalResize();
}
if(props.textArtProperties)
{
var oAscTextArtProperties = props.textArtProperties;
var oParaTextPr;
var nStyle = oAscTextArtProperties.asc_getStyle();
if(isRealNumber(nStyle))
{
var oPreviewManager = this.getTextArtPreviewManager();
var oStyleTextPr = oPreviewManager.getStylesToApply()[nStyle].Copy();
oParaTextPr = new ParaTextPr({TextFill: oStyleTextPr.TextFill, TextOutline: oStyleTextPr.TextOutline});
}
else
{
oParaTextPr = new ParaTextPr({TextFill: CorrectUniFill(oAscTextArtProperties.asc_getFill(), new CUniFill()), TextOutline: CorrectUniStroke(oAscTextArtProperties.asc_getLine(), new CLn())});
}
this.paragraphAdd(oParaTextPr);
}
return objects_by_type;
},
getSelectedObjectsByTypes: function(bGroupedObjects)
{
var ret = {shapes: [], images: [], groups: [], charts: []};
var selected_objects = this.selection.groupSelection ? this.selection.groupSelection.selectedObjects : this.selectedObjects;
return getObjectsByTypesFromArr(selected_objects, bGroupedObjects);
},
......@@ -5791,6 +5823,7 @@ DrawingObjectsController.prototype =
shape_props.ShapeProperties.stroke = props.shapeProps.stroke;
shape_props.ShapeProperties.canChangeArrows = props.shapeProps.canChangeArrows;
shape_props.ShapeProperties.bFromChart = props.shapeProps.bFromChart;
shape_props.ShapeProperties.textArtProperties = CreateAscTextArtProps(props.shapeProps.textArtProperties);
if(props.shapeProps.paddings)
{
......@@ -5946,11 +5979,13 @@ DrawingObjectsController.prototype =
return image;
},
createTextArt: function(nStyle, bWord)
createTextArt: function(nStyle, bWord, wsModel)
{
var oShape = new CShape();
oShape.setWordShape(bWord === true);
oShape.setBDeleted(false);
if(wsModel)
oShape.setWorksheet(wsModel);
var nFontSize;
if(bWord)
{
......
......@@ -1447,8 +1447,6 @@ var historydescription_Document_AddMailMergeField = 0x00ac;
var historydescription_Document_MoveInlineTable = 0x00ad;
var historydescription_Document_MoveFlowTable = 0x00ae;
var historydescription_Document_RestoreFieldTemplateText = 0x00af;
var historydescription_Document_AddTextArt = 0x00b0;
var historydescription_Spreadsheet_SetCellFontName = 0x00b0;
var historydescription_Spreadsheet_SetCellFontSize = 0x00b1;
var historydescription_Spreadsheet_SetCellBold = 0x00b2;
......@@ -1570,6 +1568,8 @@ var historydescription_Document_ConvertOldEquation = 0x0121;
var historydescription_Presentation_SetVert = 0x0122;
var historydescription_Document_AddNewStyle = 0x0123;
var historydescription_Document_RemoveStyle = 0x0124;
var historydescription_Document_AddTextArt = 0x0125;
function Get_HistoryPointStringDescription(nDescription)
......@@ -1873,6 +1873,7 @@ function Get_HistoryPointStringDescription(nDescription)
case historydescription_Document_ConvertOldEquation : sString = "Document_ConvertOldEquation "; break;
case historydescription_Document_AddNewStyle : sString = "Document_AddNewStyle "; break;
case historydescription_Document_RemoveStyle : sString = "Document_RemoveStyle "; break;
case historydescription_Document_AddTextArt : sString = "Document_AddTextArt "; break;
}
return sString;
}
......@@ -468,6 +468,8 @@ CTextDrawer.prototype =
this.Get_PathToDraw(false, true);
},
AddSmartRect: function()
{},
p_width : function(w)
{
var val = w / 1000;
......
......@@ -126,6 +126,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
// Chart
this.chartTranslate = new asc_CChartTranslate();
this.textArtTranslate = new asc_TextArtTranslate();
// Shapes
this.isStartAddShape = false;
......@@ -2549,7 +2550,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
};
spreadsheet_api.prototype.asc_setTextArtTranslate = function(translate) {
this.textArtTranslate = new asc_TextArtTranslate();
this.textArtTranslate = translate;
};
spreadsheet_api.prototype.asc_drawingObjectsExist = function() {
......@@ -2609,6 +2610,10 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
var ws = this.wb.getWorksheet();
return ws.objectRender.setGraphicObjectLayer(layerType);
};
spreadsheet_api.prototype.asc_addTextArt = function(nStyle) {
var ws = this.wb.getWorksheet();
return ws.objectRender.addTextArt(nStyle);
};
spreadsheet_api.prototype.asc_getChartPreviews = function(chartType) {
return this.chartPreviewManager.getChartPreviews(chartType);
......
......@@ -179,7 +179,7 @@ CShape.prototype.setRecalculateInfo = function()
};
this.compiledStyles = [];
this.bounds = {l: 0, t: 0, r: 0, b:0, w: 0, h:0};
// this.lockType = c_oAscLockTypes.kLockTypeNone;
this.lockType = c_oAscLockTypes.kLockTypeNone;
};
CShape.prototype.recalcContent = function()
{
......
......@@ -2472,6 +2472,8 @@ CSlideBoundsChecker.prototype =
drawHorLine2 : function(preset)
{
},
AddSmartRect: function()
{},
init : function(width_px, height_px, width_mm, height_mm)
{
......
......@@ -360,6 +360,31 @@ DrawingObjectsController.prototype.addImageFromParams = function(rasterImageId,
this.startRecalculate();
};
DrawingObjectsController.prototype.addTextArtFromParams = function(nStyle, dRectX, dRectY, dRectW, dRectH, wsmodel)
{
History.Create_NewPoint();
var oTextArt = this.createTextArt(nStyle, false, wsmodel);
this.resetSelection();
oTextArt.setWorksheet(this.drawingObjects.getWorksheetModel());
oTextArt.setDrawingObjects(this.drawingObjects);
oTextArt.addToDrawingObjects();
oTextArt.checkExtentsByDocContent();
var dNewPoX = dRectX + (dRectW - oTextArt.spPr.xfrm.extX) / 2;
if(dNewPoX < 0)
dNewPoX = 0;
var dNewPoY = dRectY + (dRectH - oTextArt.spPr.xfrm.extY) / 2;
if(dNewPoY < 0)
dNewPoY = 0;
oTextArt.spPr.xfrm.setOffX(dNewPoX);
oTextArt.spPr.xfrm.setOffY(dNewPoY);
oTextArt.checkDrawingBaseCoords();
this.selectObject(oTextArt, 0);
oTextArt.addToRecalculate();
this.startRecalculate();
};
DrawingObjectsController.prototype.isViewMode= function()
{
return this.drawingObjects.isViewerMode();
......
......@@ -4525,6 +4525,25 @@ CPresentation.prototype =
}
},
Add_TextArt: function(nStyle)
{
if(this.Slides[this.CurPage])
{
History.Create_NewPoint(historydescription_Document_AddTextArt);
var oTextArt = this.Slides[this.CurPage].graphicObjects.createTextArt(nStyle, false);
oTextArt.setParent(this.Slides[this.CurPage]);
oTextArt.addToDrawingObjects();
oTextArt.checkExtentsByDocContent();
oTextArt.spPr.xfrm.setOffX((this.Slides[this.CurPage].Width - oTextArt.spPr.xfrm.extX)/2);
oTextArt.spPr.xfrm.setOffY((this.Slides[this.CurPage].Height - oTextArt.spPr.xfrm.extY)/2);
this.Slides[this.CurPage].graphicObjects.resetSelection();
this.Slides[this.CurPage].graphicObjects.selectObject(oTextArt, 0);
this.Recalculate();
this.Document_UpdateInterfaceState();
}
},
CalculateComments : function()
{
this.CommentAuthors = {};
......
......@@ -3085,6 +3085,13 @@ asc_docs_api.prototype.StartAddShape = function(prst, is_apply)
}
};
asc_docs_api.prototype.AddTextArt = function(nStyle)
{
if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
this.WordControl.m_oLogicDocument.Add_TextArt(nStyle);
}
}
asc_docs_api.prototype.canGroup = function()
{
......
......@@ -2636,6 +2636,8 @@ CSlideBoundsChecker.prototype =
return false;
},
AddSmartRect: function()
{},
drawCollaborativeChanges: 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