Commit 1c6663ac authored by Sergey Luzyanin's avatar Sergey Luzyanin

Поправил баги с отображением автофигур в таблицах, полученных из xls

parent 74ccec69
......@@ -12130,6 +12130,8 @@ function CorrectUniColor(asc_color, unicolor, flag)
window['AscFormat']._global_layout_summs_array = _global_layout_summs_array;
window['AscFormat'].nOTOwerflow = nOTOwerflow;
window['AscFormat'].nOTClip = nOTClip;
window['AscFormat'].nOTEllipsis = nOTEllipsis;
window['AscFormat'].BULLET_TYPE_BULLET_NONE = BULLET_TYPE_BULLET_NONE;
window['AscFormat'].BULLET_TYPE_BULLET_CHAR = BULLET_TYPE_BULLET_CHAR;
......
......@@ -752,7 +752,12 @@ CShape.prototype.createTextBody = function () {
var tx_body = new AscFormat.CTextBody();
tx_body.setParent(this);
tx_body.setContent(new CDocumentContent(tx_body, this.getDrawingDocument(), 0, 0, 0, 20000, false, false, true));
tx_body.setBodyPr(new AscFormat.CBodyPr());
var oBodyPr = new AscFormat.CBodyPr();
if(this.worksheet){
oBodyPr.vertOverflow = AscFormat.nOTClip;
oBodyPr.horzOverflow = AscFormat.nOTClip;
}
tx_body.setBodyPr(oBodyPr);
tx_body.content.Content[0].Set_DocumentIndex(0);
this.setTxBody(tx_body);
};
......@@ -1779,7 +1784,7 @@ CShape.prototype.checkTransformTextMatrix = function (oMatrix, oContent, oBodyPr
_vertical_shift = 0;
}
else {
if (!(this.bWordShape || this.worksheet ) || _content_height < _text_rect_height) {
if ((!this.bWordShape && oBodyPr.vertOverflow === AscFormat.nOTOwerflow) || _content_height < _text_rect_height) {
switch (oBodyPr.anchor) {
case 0: //b
{ // (Text Anchor Enum ( Bottom ))
......@@ -1835,7 +1840,7 @@ CShape.prototype.checkTransformTextMatrix = function (oMatrix, oContent, oBodyPr
_vertical_shift = 0;
}
else {
if (!(this.bWordShape || this.worksheet) || _content_height < _text_rect_width) {
if ((!this.bWordShape && oBodyPr.vertOverflow === AscFormat.nOTOwerflow) || _content_height < _text_rect_width) {
switch (oBodyPr.anchor) {
case 0: //b
{ // (Text Anchor Enum ( Bottom ))
......@@ -3855,6 +3860,18 @@ CShape.prototype.clipTextRect = function(graphics)
{
var clip_rect = this.clipRect;
var oBodyPr = this.getBodyPr();
if(!this.bWordShape)
{
if(oBodyPr.vertOverflow === AscFormat.nOTOwerflow && oBodyPr.horzOverflow === AscFormat.nOTOwerflow)
{
return;
}
clip_rect = {x: this.clipRect.x, y: this.clipRect.y, w: this.clipRect.w, h: this.clipRect.h};
if(oBodyPr.vertOverflow === AscFormat.nOTOwerflow && AscFormat.isRealNumber(this.contentHeight))
{
clip_rect.h = this.contentHeight;
}
}
if(!oBodyPr || !oBodyPr.upright)
{
graphics.transform3(this.transform);
......@@ -4036,8 +4053,9 @@ CShape.prototype.draw = function (graphics, transform, transformText, pageIndex)
transform_text = _transform_text;
}
if(this.worksheet && (this instanceof CShape) && !(oController && (AscFormat.getTargetTextObject(oController) === this)))
if(this instanceof CShape)
{
if(!(oController && (AscFormat.getTargetTextObject(oController) === this)))
this.clipTextRect(graphics);
}
graphics.transform3(this.transformText, true);
......
......@@ -161,10 +161,27 @@ StartAddNewShape.prototype =
function checkEmptyPlaceholderContent(content)
{
if(!content || content.Parent && content.Parent.parent &&
(content.Is_Empty() && content.Parent.parent.isPlaceholder && content.Parent.parent.isPlaceholder() ||
content.Parent.parent.txWarpStruct || content.Parent.parent.recalcInfo && content.Parent.parent.recalcInfo.warpGeometry || content.Parent.parent.worksheet) )
if(!content){
return content;
}
if(content.Parent && content.Parent.parent){
if(content.Is_Empty() && content.Parent.parent.isPlaceholder && content.Parent.parent.isPlaceholder()){
return content;
}
if(content.Parent.parent.txWarpStruct){
return content;
}
if(content.Parent.parent.recalcInfo && content.Parent.parent.recalcInfo.warpGeometry){
return content;
}
var oBodyPr;
if(content.Parent.parent.getBodyPr){
oBodyPr = content.Parent.parent.getBodyPr;
if(oBodyPr.vertOverflow !== AscFormat.nOTOwerflow){
return content;
}
}
}
return null;
}
......
......@@ -509,6 +509,9 @@ function NewShapeTrack(presetGeom, startX, startY, theme, master, layout, slide,
shape.txBody.setContent(content);
var body_pr = new AscFormat.CBodyPr();
body_pr.setDefault();
if(drawingObjects && !drawingObjects.cSld){
body_pr.vertOverflow = AscFormat.nOTClip;
}
shape.txBody.setBodyPr(body_pr);
}
}
......
......@@ -467,7 +467,6 @@ CShape.prototype.recalculate = function ()
if (this.recalcInfo.recalculateTransformText && check_slide_placeholder) {
this.recalculateTransformText();
this.recalcInfo.recalculateTransformText = false;
this.clipRect = null;
}
if(this.recalcInfo.recalculateBounds)
{
......
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