Commit fd51ca43 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@50029 954022d7-b5bf-4e40-9824-e11837661b57
parent 006d9011
......@@ -6546,10 +6546,10 @@ Paragraph.prototype =
}
// 3. Если мы попали в начало параграфа, тогда пропускаем все TextPr
if ( CurPos <= 0 )
if ( CurPos <= 0 )
{
CurPos = 0;
while ( para_TextPr === this.Content[CurPos].Type )
while (CurPos < this.Content.length && para_TextPr === this.Content[CurPos].Type )
CurPos++;
this.CurPos.ContentPos = CurPos;
......
......@@ -5619,19 +5619,19 @@ CPresentation.prototype =
},
addNextSlide: function()
addNextSlide: function(layoutIndex)
{
History.Create_NewPoint();
var cur_slide = this.Slides[this.CurPage];
var new_slide = new Slide(this, cur_slide.Layout, this.CurPage + 1);
var layout = cur_slide.Layout;
var layout = isRealNumber(layoutIndex) ? (cur_slide.Layout.Master.sldLayoutLst[layoutIndex] ? cur_slide.Layout.Master.sldLayoutLst[layoutIndex]: cur_slide.Layout) : cur_slide.Layout;
for(var i = 0; i < layout.cSld.spTree.length; ++i)
{
if(layout.cSld.spTree[i].isPlaceholder())
{
var sp = new CShape(new_slide);
layout.cSld.spTree[i].copy(sp);
new_slide.shapeAdd(new_slide.cSld.spTree.length, sp);
layout.cSld.spTree[i].copy2(sp);
new_slide.addToSpTreeToPos(new_slide.cSld.spTree.length, sp);
}
}
new_slide.setSlideNum(this.CurPage + 1);
......@@ -5731,10 +5731,10 @@ CPresentation.prototype =
if(layout.cSld.spTree[j].isPlaceholder())
{
var matching_shape = slide.getMatchingShape(layout.cSld.spTree[j].getPlaceholderType(), layout.cSld.spTree[j].getPlaceholderIndex());
if(matching_shape == null && layout.cSld.spTree[j].copy)
if(matching_shape == null && layout.cSld.spTree[j].copy2)
{
var sp = new CShape(slide);
layout.cSld.spTree[j].copy(sp);
layout.cSld.spTree[j].copy2(sp);
slide.addToSpTreeToPos(slide.cSld.spTree.length, sp)
}
}
......
This diff is collapsed.
......@@ -101,7 +101,8 @@ function CTextBody(shape)
this.compiledBodyPr = new CBodyPr();
this.recalcInfo =
{
recalculateBodyPr: true
recalculateBodyPr: true,
recalculateContent2: true
};
this.textPropsForRecalc = [];
......@@ -317,6 +318,113 @@ CTextBody.prototype =
}
this.content.Reset(0, 0, _content_width, 20000);
this.content.Recalculate_Page(0, true);
if(this.recalcInfo.recalculateContent2)
{
var _history_is_on = History.Is_On();
if(_history_is_on)
{
History.TurnOff();
}
if(this.shape.isPlaceholder())
{
var text = pHText[0][this.shape.nvSpPr.nvPr.ph.type] != undefined ? pHText[0][this.shape.nvSpPr.nvPr.ph.type] : pHText[0][phType_body];
this.content2 = new CDocumentContent(this, editor.WordControl.m_oDrawingDocument, 0, 0, 0, 0, false, false);
this.content2.Content.length = 0;
var par = new Paragraph(editor.WordControl.m_oDrawingDocument, this.content2, 0, 0, 0, 0, 0);
var EndPos = 0;
for(var key = 0 ; key < text.length; ++key)
{
par.Internal_Content_Add( EndPos++, new ParaText(text[key]));
}
if(this.content && this.content.Content[0] )
{
if(this.content.Content[0].Pr)
{
par.Pr = this.content.Content[0].Pr.Copy();
}
if(this.content.Content[0].rPr)
{
par.rPr = clone(this.content.Content[0].rPr);
}
}
this.content2.Internal_Content_Add( 0, par);
this.content2.RecalculateNumbering();
this.content2.Set_StartPage(/*isRealNumber(this.shape.parent.num) ? this.shape.parent.num : */0);
if(_body_pr.upright === false)
{
var _content_width;
if(!(_body_pr.vert === nVertTTvert || _body_pr.vert === nVertTTvert270))
{
_content_width = _r - _l;
this.contentWidth2 = _content_width;
this.contentHeight2 = _b - _t;
}
else
{
_content_width = _b - _t;
this.contentWidth2 = _content_width;
this.contentHeight2 = _r - _l;
}
}
else
{
var _full_rotate = sp.getFullRotate();
if((_full_rotate >= 0 && _full_rotate < 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))
{
if(!(_body_pr.vert === nVertTTvert || _body_pr.vert === nVertTTvert270))
{
_content_width = _r - _l;
this.contentWidth2 = _content_width;
this.contentHeight2 = _b - _t;
}
else
{
_content_width = _b - _t;
this.contentWidth2 = _content_width;
this.contentHeight2 = _r - _l;
}
}
else
{
if(!(_body_pr.vert === nVertTTvert || _body_pr.vert === nVertTTvert270))
{
_content_width = _b - _t;
this.contentWidth2 = _content_width;
this.contentHeight2 = _r - _l;
}
else
{
_content_width = _r - _l;
this.contentWidth2 = _content_width;
this.contentHeight2 = _b - _t;
}
}
}
this.content2.Reset(0, 0, _content_width, 20000);
this.content2.Recalculate_Page(0, true);
}
if(_history_is_on)
{
History.TurnOn();
}
this.recalcInfo.recalculateContent2 = false;
}
},
copy: function(txBody)
{
txBody.setDocContent(this.content.Copy(txBody));
},
updateCursorType: function(x, y, e)
......@@ -371,6 +479,12 @@ CTextBody.prototype =
return this.content.Get_SummaryHeight();
},
getSummaryHeight2: function()
{
return this.content2 ? this.content2.Get_SummaryHeight() : 0;
},
getCompiledBodyPr: function()
{
this.recalculateBodyPr();
......@@ -387,10 +501,38 @@ CTextBody.prototype =
draw: function(graphics)
{
if(this.content.Is_Empty() && isRealObject(this.phContent))
/*if(this.content.Is_Empty() && isRealObject(this.phContent))
this.content2.Draw(graphics);
else
this.content.Draw(0, graphics); */
if((!this.content || this.content.Is_Empty()) && this.content2!=null && !this.shape.addTextFlag && (this.shape.isEmptyPlaceholder ? this.shape.isEmptyPlaceholder() : false))
{
if (graphics.IsNoDrawingEmptyPlaceholder !== true && graphics.IsNoDrawingEmptyPlaceholderText !== true)
{
if(graphics.IsNoSupportTextDraw)
{
var _h2 = this.b2 - this.t2;
var _w2 = this.r2 - this.l2;
graphics.rect(this.content2.X, this.content2.Y, _w2, _h2);
}
this.content2.Draw(0, graphics);
}
}
else if(this.content)
{
if(graphics.IsNoSupportTextDraw)
{
var _h = this.b - this.t;
var _w = this.r - this.l;
graphics.rect(this.content.X, this.content.Y, _w, _h);
}
this.content.Draw(0, graphics);
}
},
Get_Styles: function(level)
......
......@@ -171,6 +171,8 @@ function NullState(drawingObjectsController, drawingObjects)
cur_drawing.select(this.drawingObjectsController);
cur_drawing.selectionSetStart(e, x, y);
this.drawingObjectsController.changeCurrentState(new TextAddState(this.drawingObjectsController, this.drawingObjects, cur_drawing));
editor.WordControl.m_oDrawingDocument.OnRecalculatePage(this.drawingObjects.num, this.drawingObjects);
editor.WordControl.m_oDrawingDocument.OnEndRecalculate();
if(e.ClickCount < 2)
this.drawingObjectsController.updateSelectionState(editor.WordControl.m_oLogicDocument.DrawingDocument);
}
......@@ -182,6 +184,8 @@ function NullState(drawingObjectsController, drawingObjects)
cur_drawing.select(this.drawingObjectsController);
cur_drawing.selectionSetStart(e, x, y);
this.drawingObjectsController.changeCurrentState(new TextAddState(this.drawingObjectsController, this.drawingObjects, cur_drawing));
editor.WordControl.m_oDrawingDocument.OnRecalculatePage(this.drawingObjects.num, this.drawingObjects);
editor.WordControl.m_oDrawingDocument.OnEndRecalculate();
if(e.ClickCount < 2)
this.drawingObjectsController.updateSelectionState(editor.WordControl.m_oLogicDocument.DrawingDocument);
}
......@@ -324,6 +328,8 @@ function NullState(drawingObjectsController, drawingObjects)
this.drawingObjectsController.stY = y;
this.drawingObjectsController.selectionRect = {x : x, y : y, w: 0, h: 0};
this.drawingObjectsController.changeCurrentState(new TrackSelectionRect(this.drawingObjectsController, this.drawingObjects));
editor.WordControl.m_oDrawingDocument.OnRecalculatePage(this.drawingObjects.num, this.drawingObjects);
editor.WordControl.m_oDrawingDocument.OnEndRecalculate();
this.drawingObjects.OnUpdateOverlay();
editor.sync_BeginCatchSelectedElements();
editor.sync_slidePropCallback(drawingObjects);
......@@ -1605,8 +1611,10 @@ function TextAddState(drawingObjectsController, drawingObjects, textObject)
this.onMouseDown = function(e, x, y)
{
this.nullState.onMouseDown(e, x, y);
if(this.drawingObjectsController.State.id !== STATES_ID_TEXT_ADD || this.drawingObjectsController.State.id !== STATES_ID_TEXT_ADD_IN_GROUP)
{
this.textObject.addTextFlag = false;
this.drawingObjectsController.updateSelectionState(editor.WordControl.m_oLogicDocument.DrawingDocument);
}
......
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