Commit 4376f49f authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

git-svn-id:...

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@48581 954022d7-b5bf-4e40-9824-e11837661b57
parent 2478abac
...@@ -65,6 +65,12 @@ CChartAsGroup.prototype = ...@@ -65,6 +65,12 @@ CChartAsGroup.prototype =
}, },
recalculateColors: function()
{
this.recalculate();
},
isChart: function() isChart: function()
{ {
return true; return true;
......
...@@ -405,6 +405,8 @@ CGroupShape.prototype = ...@@ -405,6 +405,8 @@ CGroupShape.prototype =
} }
}, },
recalculateTransform: function() recalculateTransform: function()
{ {
var xfrm = this.spPr.xfrm; var xfrm = this.spPr.xfrm;
...@@ -705,6 +707,139 @@ CGroupShape.prototype = ...@@ -705,6 +707,139 @@ CGroupShape.prototype =
}, },
setCellBackgroundColor: function(color)
{
for(var i = 0; i < this.spTree.length; ++i)
{
if(typeof this.spTree[i].setCellBackgroundColor === "function")
this.spTree[i].setCellBackgroundColor(color);
}
},
setCellAllFontName: function(fontName)
{
for(var i = 0; i < this.spTree.length; ++i)
{
if(typeof this.spTree[i].setCellAllFontName === "function")
this.spTree[i].setCellAllFontName(fontName);
}
},
setCellAllFontSize: function(val)
{
for(var i = 0; i < this.spTree.length; ++i)
{
if(typeof this.spTree[i].setCellAllFontSize === "function")
this.spTree[i].setCellAllFontSize(val);
}
},
setCellAllBold: function(val)
{
for(var i = 0; i < this.spTree.length; ++i)
{
if(typeof this.spTree[i].setCellAllBold === "function")
this.spTree[i].setCellAllBold(val);
}
},
setCellAllItalic: function(val)
{
for(var i = 0; i < this.spTree.length; ++i)
{
if(typeof this.spTree[i].setCellAllItalic === "function")
this.spTree[i].setCellAllItalic(val);
}
},
setCellAllUnderline: function(val)
{
for(var i = 0; i < this.spTree.length; ++i)
{
if(typeof this.spTree[i].setCellAllUnderline === "function")
this.spTree[i].setCellAllUnderline(val);
}
},
setCellAllStrikeout: function(val)
{
for(var i = 0; i < this.spTree.length; ++i)
{
if(typeof this.spTree[i].setCellAllStrikeout === "function")
this.spTree[i].setCellAllStrikeout(val);
}
},
setCellAllSubscript: function(val)
{
for(var i = 0; i < this.spTree.length; ++i)
{
if(typeof this.spTree[i].setCellAllSubscript === "function")
this.spTree[i].setCellAllSubscript(val);
}
},
setCellAllSuperscript: function(val)
{
for(var i = 0; i < this.spTree.length; ++i)
{
if(typeof this.spTree[i].setCellAllSuperscript === "function")
this.spTree[i].setCellAllSuperscript(val);
}
},
setCellAllAlign: function(val)
{
for(var i = 0; i < this.spTree.length; ++i)
{
if(typeof this.spTree[i].setCellAllAlign === "function")
this.spTree[i].setCellAllAlign(val);
}
},
setCellAllVertAlign: function(val)
{
for(var i = 0; i < this.spTree.length; ++i)
{
if(typeof this.spTree[i].setCellAllVertAlign === "function")
this.spTree[i].setCellAllVertAlign(val);
}
},
setCellAllTextColor: function(val)
{
for(var i = 0; i < this.spTree.length; ++i)
{
if(typeof this.spTree[i].setCellAllTextColor === "function")
this.spTree[i].setCellAllTextColor(val);
}
},
setCellAllAngle: function(val)
{
for(var i = 0; i < this.spTree.length; ++i)
{
if(typeof this.spTree[i].setCellAllAngle === "function")
this.spTree[i].setCellAllAngle(val);
}
},
increaseAllFontSize: function()
{
for(var i = 0; i < this.spTree.length; ++i)
{
if(typeof this.spTree[i].increaseAllFontSize === "function")
this.spTree[i].increaseAllFontSize();
}
},
decreaseAllFontSize: function()
{
for(var i = 0; i < this.spTree.length; ++i)
{
if(typeof this.spTree[i].decreaseAllFontSize === "function")
this.spTree[i].decreaseAllFontSize();
}
},
drawAdjustments: function(drawingDocument) drawAdjustments: function(drawingDocument)
{ {
...@@ -830,6 +965,16 @@ CGroupShape.prototype = ...@@ -830,6 +965,16 @@ CGroupShape.prototype =
}, },
recalculateColors: function()
{
for(var i = 0; i < this.spTree.length; ++i)
{
if(typeof this.spTree[i].recalculateColors==="function")
this.spTree[i].recalculateColors();
}
},
deselect: function(drawingObjectsController) deselect: function(drawingObjectsController)
{ {
this.selected = false; this.selected = false;
......
...@@ -442,7 +442,6 @@ CShape.prototype = ...@@ -442,7 +442,6 @@ CShape.prototype =
this.txBody.paragraphAdd(text_pr); this.txBody.paragraphAdd(text_pr);
this.txBody.content.Set_ApplyToAll(false); this.txBody.content.Set_ApplyToAll(false);
this.calculateTransformTextMatrix(); this.calculateTransformTextMatrix();
} }
}, },
...@@ -570,7 +569,8 @@ CShape.prototype = ...@@ -570,7 +569,8 @@ CShape.prototype =
this.txBody.content.Set_ApplyToAll(true); this.txBody.content.Set_ApplyToAll(true);
this.txBody.content.Set_ParagraphAlign(align_num); this.txBody.content.Set_ParagraphAlign(align_num);
this.txBody.content.Set_ApplyToAll(false); this.txBody.content.Set_ApplyToAll(false);
//this.calculateTransformTextMatrix(); this.calculateContent();
this.calculateTransformTextMatrix();
} }
} }
}, },
...@@ -676,6 +676,29 @@ CShape.prototype = ...@@ -676,6 +676,29 @@ CShape.prototype =
}, },
increaseAllFontSize: function () {
if(isRealObject(this.txBody))
{
this.txBody.content.Set_ApplyToAll(true);
this.txBody.content.Paragraph_IncDecFontSize(true);
this.txBody.content.Set_ApplyToAll(false);
this.txBody.calculateContent();
this.calculateTransformTextMatrix();
}
},
// Уменьшение размера шрифта
decreaseAllFontSize: function () {
if(isRealObject(this.txBody))
{
this.txBody.content.Set_ApplyToAll(true);
this.txBody.content.Paragraph_IncDecFontSize(false);
this.txBody.content.Set_ApplyToAll(false);
this.txBody.calculateContent();
this.calculateTransformTextMatrix();
}
},
insertHyperlink: function (options) { insertHyperlink: function (options) {
if(typeof this.curState.insertHyperlink === "function") if(typeof this.curState.insertHyperlink === "function")
{ {
...@@ -709,6 +732,12 @@ CShape.prototype = ...@@ -709,6 +732,12 @@ CShape.prototype =
this.spPr.xfrm = xfrm; this.spPr.xfrm = xfrm;
}, },
recalculateColors: function()
{
this.recalculatePen();
this.recalculateBrush();
},
initDefaultTextRect: function(x, y, extX, extY, flipH, flipV) initDefaultTextRect: function(x, y, extX, extY, flipH, flipV)
{ {
this.setXfrmObject(new CXfrm()); this.setXfrmObject(new CXfrm());
...@@ -1058,7 +1087,6 @@ CShape.prototype = ...@@ -1058,7 +1087,6 @@ CShape.prototype =
paragraphAdd: function(paraItem, bRecalculate) paragraphAdd: function(paraItem, bRecalculate)
{ {
History.Create_NewPoint();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddUndo, null, null, History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterParagraphAddUndo, null, null,
new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null))); new UndoRedoDataGraphicObjects(this.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
......
...@@ -527,8 +527,7 @@ function NullState(drawingObjectsController, drawingObjects) ...@@ -527,8 +527,7 @@ function NullState(drawingObjectsController, drawingObjects)
}; };
// Уменьшение размера шрифта // Уменьшение размера шрифта
this.setCellFontName = function (fontName) { this.setCellFontName = function (fontName)
if(typeof this.textObject.setCellFontName === "function")
{ {
var selected_objects = this.drawingObjectsController.selectedObjects; var selected_objects = this.drawingObjectsController.selectedObjects;
for(var i = 0; i < selected_objects.length; ++i) for(var i = 0; i < selected_objects.length; ++i)
...@@ -539,13 +538,10 @@ function NullState(drawingObjectsController, drawingObjects) ...@@ -539,13 +538,10 @@ function NullState(drawingObjectsController, drawingObjects)
} }
} }
this.drawingObjects.showDrawingObjects(true); this.drawingObjects.showDrawingObjects(true);
}
}; };
// Уменьшение размера шрифта // Уменьшение размера шрифта
this.setCellFontSize = function (fontSize) { this.setCellFontSize = function (fontSize) {
if(typeof this.textObject.setCellFontSize === "function")
{
var selected_objects = this.drawingObjectsController.selectedObjects; var selected_objects = this.drawingObjectsController.selectedObjects;
for(var i = 0; i < selected_objects.length; ++i) for(var i = 0; i < selected_objects.length; ++i)
{ {
...@@ -555,108 +551,124 @@ function NullState(drawingObjectsController, drawingObjects) ...@@ -555,108 +551,124 @@ function NullState(drawingObjectsController, drawingObjects)
} }
} }
this.drawingObjects.showDrawingObjects(true); this.drawingObjects.showDrawingObjects(true);
}
}; };
// Уменьшение размера шрифта // Уменьшение размера шрифта
this.setCellBold = function (isBold) { this.setCellBold = function (isBold) {
if(typeof this.textObject.setCellBold === "function") var selected_objects = this.drawingObjectsController.selectedObjects;
for(var i = 0; i < selected_objects.length; ++i)
{ {
this.textObject.setCellAllBold(isBold); if(typeof selected_objects[i].setCellAllBold === "function")
this.textObject.updateSelectionState(this.drawingObjects.drawingDocument); {
selected_objects[i].setCellAllBold(isBold);
}
} }
this.drawingObjects.showDrawingObjects(true);
}; };
// Уменьшение размера шрифта // Уменьшение размера шрифта
this.setCellItalic = function (isItalic) { this.setCellItalic = function (isItalic) {
if(typeof this.textObject.setCellItalic === "function") var selected_objects = this.drawingObjectsController.selectedObjects;
for(var i = 0; i < selected_objects.length; ++i)
{ {
this.textObject.setCellItalic(isItalic); if(typeof selected_objects[i].setCellAllItalic === "function")
this.textObject.updateSelectionState(this.drawingObjects.drawingDocument); {
selected_objects[i].setCellAllItalic(isItalic);
}
} }
this.drawingObjects.showDrawingObjects(true);
}; };
// Уменьшение размера шрифта // Уменьшение размера шрифта
this.setCellUnderline = function (isUnderline) { this.setCellUnderline = function (isUnderline) {
if(typeof this.textObject.setCellUnderline === "function") var selected_objects = this.drawingObjectsController.selectedObjects;
for(var i = 0; i < selected_objects.length; ++i)
{ {
this.textObject.setCellUnderline(isUnderline); if(typeof selected_objects[i].setCellAllUnderline === "function")
this.textObject.updateSelectionState(this.drawingObjects.drawingDocument); {
selected_objects[i].setCellAllUnderline(isUnderline);
}
} }
this.drawingObjects.showDrawingObjects(true);
}; };
// Уменьшение размера шрифта // Уменьшение размера шрифта
this.setCellStrikeout = function (isStrikeout) { this.setCellStrikeout = function (isStrikeout) {
if(typeof this.textObject.setCellStrikeout === "function") var selected_objects = this.drawingObjectsController.selectedObjects;
for(var i = 0; i < selected_objects.length; ++i)
{ {
this.textObject.setCellStrikeout(isStrikeout); if(typeof selected_objects[i].setCellAllStrikeout === "function")
this.textObject.updateSelectionState(this.drawingObjects.drawingDocument); {
selected_objects[i].setCellAllStrikeout(isStrikeout);
} }
}
this.drawingObjects.showDrawingObjects(true);
}; };
// Уменьшение размера шрифта // Уменьшение размера шрифта
this.setCellSubscript = function (isSubscript) { this.setCellSubscript = function (isSubscript) {
if(typeof this.textObject.setCellSubscript === "function") var selected_objects = this.drawingObjectsController.selectedObjects;
for(var i = 0; i < selected_objects.length; ++i)
{ {
this.textObject.setCellSubscript(isSubscript); if(typeof selected_objects[i].setCellAllSubscript === "function")
this.textObject.updateSelectionState(this.drawingObjects.drawingDocument); {
selected_objects[i].setCellAllSubscript(isSubscript);
} }
}
this.drawingObjects.showDrawingObjects(true);
}; };
// Уменьшение размера шрифта // Уменьшение размера шрифта
this.setCellSuperscript = function (isSuperscript) { this.setCellSuperscript = function (isSuperscript) {
if(typeof this.textObject.setCellSuperscript === "function") var selected_objects = this.drawingObjectsController.selectedObjects;
for(var i = 0; i < selected_objects.length; ++i)
{ {
this.textObject.setCellSuperscript(isSuperscript); if(typeof selected_objects[i].setCellAllSuperscript === "function")
this.textObject.updateSelectionState(this.drawingObjects.drawingDocument); {
selected_objects[i].setCellAllSuperscript(isSuperscript);
}
} }
this.drawingObjects.showDrawingObjects(true);
}; };
// Уменьшение размера шрифта // Уменьшение размера шрифта
this.setCellAlign = function (align) { this.setCellAlign = function (align) {
if(typeof this.textObject.setCellAlign === "function") var selected_objects = this.drawingObjectsController.selectedObjects;
for(var i = 0; i < selected_objects.length; ++i)
{ {
this.textObject.setCellAlign(align); if(typeof selected_objects[i].setCellAllAlign === "function")
this.textObject.updateSelectionState(this.drawingObjects.drawingDocument); {
selected_objects[i].setCellAllAlign(align);
}
} }
this.drawingObjects.showDrawingObjects(true);
}; };
// Уменьшение размера шрифта // Уменьшение размера шрифта
this.setCellVertAlign = function (align) { this.setCellVertAlign = function (align) {
if(typeof this.textObject.setCellVertAlign === "function") var selected_objects = this.drawingObjectsController.selectedObjects;
for(var i = 0; i < selected_objects.length; ++i)
{ {
this.textObject.setCellVertAlign(align); if(typeof selected_objects[i].setCellAllVertAlign === "function")
this.textObject.updateSelectionState(this.drawingObjects.drawingDocument);
this.drawingObjects.showDrawingObjects(true);
}
};
// Уменьшение размера шрифта
this.setCellTextWrap = function (isWrapped) {
if(typeof this.textObject.setCellTextWrap === "function")
{ {
this.textObject.setCellTextWrap(isWrapped); selected_objects[i].setCellAllVertAlign(align);
this.textObject.updateSelectionState(this.drawingObjects.drawingDocument);
} }
};
// Уменьшение размера шрифта
this.setCellTextShrink = function (isShrinked) {
if(typeof this.textObject.setCellTextShrink === "function")
{
this.textObject.setCellTextShrink(isShrinked);
this.textObject.updateSelectionState(this.drawingObjects.drawingDocument);
} }
this.drawingObjects.showDrawingObjects(true);
}; };
// Уменьшение размера шрифта // Уменьшение размера шрифта
this.setCellTextColor = function (color) { this.setCellTextColor = function (color) {
if(typeof this.textObject.setCellTextColor === "function") var selected_objects = this.drawingObjectsController.selectedObjects;
for(var i = 0; i < selected_objects.length; ++i)
{ {
this.textObject.setCellTextColor(color); if(typeof selected_objects[i].setCellAllTextColor === "function")
this.textObject.updateSelectionState(this.drawingObjects.drawingDocument); {
selected_objects[i].setCellAllTextColor(color);
} }
}
this.drawingObjects.showDrawingObjects(true);
}; };
// Уменьшение размера шрифта // Уменьшение размера шрифта
...@@ -670,41 +682,41 @@ function NullState(drawingObjectsController, drawingObjects) ...@@ -670,41 +682,41 @@ function NullState(drawingObjectsController, drawingObjects)
// Уменьшение размера шрифта // Уменьшение размера шрифта
this.setCellAngle = function (angle) { this.setCellAngle = function (angle) {
if(typeof this.textObject.setCellAngle === "function") var selected_objects = this.drawingObjectsController.selectedObjects;
for(var i = 0; i < selected_objects.length; ++i)
{ {
this.textObject.setCellAngle(angle); if(typeof selected_objects[i].setCellAllAngle === "function")
this.textObject.updateSelectionState(this.drawingObjects.drawingDocument);
this.drawingObjects.showDrawingObjects(true);
}
};
// Уменьшение размера шрифта
this.setCellStyle = function (name) {
if(typeof this.textObject.setCellStyle === "function")
{ {
this.textObject.setCellStyle(name); selected_objects[i].setCellAllAngle(angle);
this.textObject.updateSelectionState(this.drawingObjects.drawingDocument);
} }
}
this.drawingObjects.showDrawingObjects(true);
}; };
// Уменьшение размера шрифта // Уменьшение размера шрифта
this.increaseFontSize = function () { this.increaseFontSize = function () {
if(typeof this.textObject.increaseFontSize === "function") var selected_objects = this.drawingObjectsController.selectedObjects;
for(var i = 0; i < selected_objects.length; ++i)
{ {
this.textObject.increaseFontSize(); if(typeof selected_objects[i].increaseAllFontSize === "function")
this.textObject.updateSelectionState(this.drawingObjects.drawingDocument); {
this.drawingObjects.showDrawingObjects(true); selected_objects[i].increaseAllFontSize();
} }
}
this.drawingObjects.showDrawingObjects(true);
}; };
// Уменьшение размера шрифта // Уменьшение размера шрифта
this.decreaseFontSize = function () { this.decreaseFontSize = function () {
if(typeof this.textObject.decreaseFontSize === "function") var selected_objects = this.drawingObjectsController.selectedObjects;
for(var i = 0; i < selected_objects.length; ++i)
{ {
this.textObject.decreaseFontSize(); if(typeof selected_objects[i].decreaseAllFontSize === "function")
this.textObject.updateSelectionState(this.drawingObjects.drawingDocument); {
selected_objects[i].decreaseAllFontSize();
}
} }
this.drawingObjects.showDrawingObjects(true);
}; };
...@@ -1394,9 +1406,29 @@ function TextAddState(drawingObjectsController, drawingObjects, textObject) ...@@ -1394,9 +1406,29 @@ function TextAddState(drawingObjectsController, drawingObjects, textObject)
this.onKeyPress = function(e) this.onKeyPress = function(e)
{ {
this.textObject.paragraphAdd(new ParaText(String.fromCharCode(e.charCode))); //var worksheet = this.drawingObjects.getWorksheet();
this.drawingObjects.showDrawingObjects(true); //worksheet.collaborativeEditing.onStartCheckLock();
this.textObject.updateSelectionState(this.drawingObjects.drawingDocument); this.drawingObjects.objectLocker.reset();
this.drawingObjects.objectLocker.addObjectId(this.textObject.Get_Id());
var drawingObjects = this.drawingObjects;
var text_object = this.textObject;
var callback = function(bLock)
{
if(bLock)
{
History.Create_NewPoint();
text_object.paragraphAdd(new ParaText(String.fromCharCode(e.charCode)));
drawingObjects.showDrawingObjects(true);
text_object.updateSelectionState(drawingObjects.drawingDocument);
}
};
//worksheet.collaborativeEditing.onEndCheckLock(callback);
this.drawingObjects.objectLocker.checkObjects(callback);
// this.textObject.paragraphAdd(new ParaText(String.fromCharCode(e.charCode)));
// this.drawingObjects.showDrawingObjects(true);
// this.textObject.updateSelectionState(this.drawingObjects.drawingDocument);
}; };
this.drawSelection = function(drawingDocument) this.drawSelection = function(drawingDocument)
...@@ -2893,10 +2925,31 @@ function TextAddInGroup(drawingObjectsController, drawingObjects, group, textObj ...@@ -2893,10 +2925,31 @@ function TextAddInGroup(drawingObjectsController, drawingObjects, group, textObj
this.onKeyPress = function(e) this.onKeyPress = function(e)
{ {
this.textObject.paragraphAdd(new ParaText(String.fromCharCode(e.charCode))); this.drawingObjects.objectLocker.reset();
this.drawingObjectsController.updateSelectionState(this.drawingObjects.drawingDocument); this.drawingObjects.objectLocker.addObjectId(this.group.Get_Id());
this.drawingObjects.showDrawingObjects(true);
this.drawingObjects.OnUpdateOverlay(); var drawingObjects = this.drawingObjects;
var text_object = this.textObject;
var callback = function(bLock)
{
if(bLock)
{
History.Create_NewPoint();
text_object.paragraphAdd(new ParaText(String.fromCharCode(e.charCode)));
drawingObjects.showDrawingObjects(true);
text_object.updateSelectionState(drawingObjects.drawingDocument);
}
};
//worksheet.collaborativeEditing.onEndCheckLock(callback);
this.drawingObjects.objectLocker.checkObjects(callback);
// this.textObject.paragraphAdd(new ParaText(String.fromCharCode(e.charCode)));
// this.drawingObjects.showDrawingObjects(true);
// this.textObject.updateSelectionState(this.drawingObjects.drawingDocument);
//this.textObject.paragraphAdd(new ParaText(String.fromCharCode(e.charCode)));
//this.drawingObjectsController.updateSelectionState(this.drawingObjects.drawingDocument);
//this.drawingObjects.showDrawingObjects(true);
//this.drawingObjects.OnUpdateOverlay();
}; };
this.isPointInDrawingObjects = function(x, y) this.isPointInDrawingObjects = function(x, y)
......
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