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

конвертация для copy/paste и правка падения для автофгур с bodyPr.upright == true

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56119 954022d7-b5bf-4e40-9824-e11837661b57
parent 874e98d5
...@@ -377,12 +377,13 @@ CChartSpace.prototype = ...@@ -377,12 +377,13 @@ CChartSpace.prototype =
convertToWord: function(document) convertToWord: function(document)
{ {
return this.createDuplicate(); return this;
}, },
convertToPPTX: function(drawingDocument) convertToPPTX: function(drawingDocument, worksheet)
{ {
this.setWorksheet(worksheet);
return this;
}, },
Write_ToBinary2: function (w) Write_ToBinary2: function (w)
......
...@@ -3325,7 +3325,7 @@ GradPath.prototype = ...@@ -3325,7 +3325,7 @@ GradPath.prototype =
Write_ToBinary: function(w) Write_ToBinary: function(w)
{ {
writeLong(this.path); writeLong(w, this.path);
w.WriteBool(isRealObject(this.rect)); w.WriteBool(isRealObject(this.rect));
if(isRealObject(this.rect)) if(isRealObject(this.rect))
{ {
......
...@@ -306,6 +306,35 @@ CGroupShape.prototype = ...@@ -306,6 +306,35 @@ CGroupShape.prototype =
return ShapeToImageConverter(this, this.pageIndex).ImageUrl; return ShapeToImageConverter(this, this.pageIndex).ImageUrl;
}, },
convertToWord: function(document)
{
var sp_tree_copy = [].concat(this.spTree), i;
for(i = this.spTree.length-1; i > -1; --i)
{
this.removeFromSpTreeByPos(i);
}
for(i = 0; i < sp_tree_copy.length; ++i)
{
this.addToSpTree(this.spTree.length, sp_tree_copy[i].convertToWord(document));
}
return this;
},
convertToPPTX: function(drawingDocument, worksheet)
{
var sp_tree_copy = [].concat(this.spTree), i;
this.setWorksheet(worksheet);
for(i = this.spTree.length-1; i > -1; --i)
{
this.removeFromSpTreeByPos(i);
}
for(i = 0; i < sp_tree_copy.length; ++i)
{
this.addToSpTree(this.spTree.length, sp_tree_copy[i].convertToPPTX(drawingDocument, worksheet));
}
return this;
},
isSimpleObject: function() isSimpleObject: function()
{ {
return false; return false;
......
...@@ -416,6 +416,17 @@ CImageShape.prototype = ...@@ -416,6 +416,17 @@ CImageShape.prototype =
return ShapeToImageConverter(this, this.pageIndex).ImageUrl; return ShapeToImageConverter(this, this.pageIndex).ImageUrl;
}, },
convertToWord: function(document)
{
return this;
},
convertToPPTX: function(drawingDocument, worksheet)
{
this.setWorksheet(worksheet);
return this;
},
recalculateBrush: function() recalculateBrush: function()
{ {
var is_on = History.Is_On(); var is_on = History.Is_On();
......
...@@ -224,13 +224,35 @@ CShape.prototype = ...@@ -224,13 +224,35 @@ CShape.prototype =
{ {
var new_content = new CDocumentContent(c, document.DrawingDocument, 0, 0, 0, 20000, false, false, false); var new_content = new CDocumentContent(c, document.DrawingDocument, 0, 0, 0, 20000, false, false, false);
var paragraphs = this.txBody.content.Content; var paragraphs = this.txBody.content.Content;
//TODO: Обработать нумерацию
new_content.Internal_Content_RemoveAll(); new_content.Internal_Content_RemoveAll();
for(var i = 0; i < paragraphs.length; ++i) for(var i = 0; i < paragraphs.length; ++i)
{ {
var cur_par = paragraphs[i]; var cur_par = paragraphs[i];
var new_paragraph = cur_par.Copy(new_content); var new_paragraph = cur_par.Copy(new_content);
new_content.Internal_Content_Add( i, new_paragraph, false ); new_content.Internal_Content_Add( i, new_paragraph, false );
/*var bullet = cur_par.Pr.Bullet;
if(bullet && bullet.bulletType && bullet.bulletType.type !== BULLET_TYPE_BULLET_NONE)
{
switch(bullet.bulletType.type)
{
case BULLET_TYPE_BULLET_CHAR:
case BULLET_TYPE_BULLET_BLIP :
{
_bullet.m_nType = numbering_presentationnumfrmt_Char;
_bullet.m_sChar = _final_bullet.bulletType.Char[0];
_cur_paragraph.Add_PresentationNumbering(_bullet, true);
break;
}
case BULLET_TYPE_BULLET_AUTONUM :
{
_bullet.m_nType = g_NumberingArr[_final_bullet.bulletType.AutoNumType];
_bullet.m_nStartAt = _final_bullet.bulletType.startAt;
_cur_paragraph.Add_PresentationNumbering(_bullet, true);
break;
}
}
} */
} }
c.setTextBoxContent(new_content); c.setTextBoxContent(new_content);
} }
...@@ -238,11 +260,12 @@ CShape.prototype = ...@@ -238,11 +260,12 @@ CShape.prototype =
return c; return c;
}, },
convertToPPTX: function(drawingDocument) convertToPPTX: function(drawingDocument, worksheet)
{ {
var c = new CShape(); var c = new CShape();
c.setWordShape(false); c.setWordShape(false);
c.setBDeleted(false); c.setBDeleted(false);
c.setWorksheet(worksheet);
if(this.nvSpPr) if(this.nvSpPr)
{ {
c.setNvSpPr(this.nvSpPr.createDuplicate()); c.setNvSpPr(this.nvSpPr.createDuplicate());
...@@ -269,9 +292,8 @@ CShape.prototype = ...@@ -269,9 +292,8 @@ CShape.prototype =
var paragraphs = this.textBoxContent.Content; var paragraphs = this.textBoxContent.Content;
for(var i = 0; i < paragraphs.length; ++i) for(var i = 0; i < paragraphs.length; ++i)
{ {
//TODO: обработать нумерацию
var cur_par = paragraphs[i]; var cur_par = paragraphs[i];
var new_paragraph = new Paragraph(drawingDocument, tx_body, 0, 0, 0, 0, 0); var new_paragraph = new Paragraph(drawingDocument, tx_body, 0, 0, 0, 0, 0, true);
new_paragraph.Set_Pr(cur_par.Pr.Copy()); new_paragraph.Set_Pr(cur_par.Pr.Copy());
new_paragraph.TextPr.Set_Value( cur_par.TextPr.Value ); new_paragraph.TextPr.Set_Value( cur_par.TextPr.Value );
new_paragraph.Internal_Content_Remove2(0, new_paragraph.Content.length); new_paragraph.Internal_Content_Remove2(0, new_paragraph.Content.length);
...@@ -287,6 +309,7 @@ CShape.prototype = ...@@ -287,6 +309,7 @@ CShape.prototype =
new_content.Internal_Content_Add( i, new_paragraph, false ); new_content.Internal_Content_Add( i, new_paragraph, false );
} }
tx_body.setContent(new_content); tx_body.setContent(new_content);
c.setTxBody(tx_body);
} }
return c; return c;
}, },
......
...@@ -391,7 +391,7 @@ CShape.prototype.recalculateContent = function() ...@@ -391,7 +391,7 @@ CShape.prototype.recalculateContent = function()
|| (_full_rotate > 3*Math.PI*0.25 && _full_rotate < 5*Math.PI*0.25) || (_full_rotate > 3*Math.PI*0.25 && _full_rotate < 5*Math.PI*0.25)
|| (_full_rotate > 7*Math.PI*0.25 && _full_rotate < 2*Math.PI)) || (_full_rotate > 7*Math.PI*0.25 && _full_rotate < 2*Math.PI))
{ {
if(!(_body_pr.vert === nVertTTvert || _body_pr.vert === nVertTTvert270)) if(!(body_pr.vert === nVertTTvert || body_pr.vert === nVertTTvert270))
{ {
this.txBody.contentWidth = w; this.txBody.contentWidth = w;
...@@ -405,7 +405,7 @@ CShape.prototype.recalculateContent = function() ...@@ -405,7 +405,7 @@ CShape.prototype.recalculateContent = function()
} }
else else
{ {
if(!(_body_pr.vert === nVertTTvert || _body_pr.vert === nVertTTvert270)) if(!(body_pr.vert === nVertTTvert || body_pr.vert === nVertTTvert270))
{ {
this.txBody.contentWidth = h; this.txBody.contentWidth = h;
......
...@@ -1743,7 +1743,7 @@ function Woorksheet(wb, _index, sId){ ...@@ -1743,7 +1743,7 @@ function Woorksheet(wb, _index, sId){
data.Ref.cleanFormat(); data.Ref.cleanFormat();
}); });
this.hyperlinkManager.setDependenceManager(this.mergeManager); this.hyperlinkManager.setDependenceManager(this.mergeManager);
this.DrawingDocument = new CDrawingDocument()
this.sheetViews = []; this.sheetViews = [];
this.aConditionalFormatting = []; this.aConditionalFormatting = [];
this.sheetPr = null; this.sheetPr = null;
......
...@@ -313,8 +313,6 @@ CShape.prototype.recalculate = function () ...@@ -313,8 +313,6 @@ CShape.prototype.recalculate = function ()
this.recalcInfo.recalculateWrapPolygon = false; this.recalcInfo.recalculateWrapPolygon = false;
} }
this.bNeedUpdatePosition = true; this.bNeedUpdatePosition = true;
}, this, []); }, this, []);
}; };
......
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