Commit 86507cd1 authored by SergeyLuzyanin's avatar SergeyLuzyanin

fix presentation numbering bugs

parent 249b8741
...@@ -133,9 +133,17 @@ ...@@ -133,9 +133,17 @@
this.Start_Recalculate(fWidth, fHeight); this.Start_Recalculate(fWidth, fHeight);
if(this.Pages.length > 1){ if(this.Pages.length > 1){
var fSummaryHeight = this.Get_SummaryHeight(); var fSummaryHeight = this.Get_SummaryHeight();
var fNeedHeight = fSummaryHeight;
var fLow = fHeight, fHigh = fSummaryHeight;
this.Start_Recalculate(fWidth, fHigh);
var nItCount = 0;
while(this.Pages.length > 1 && nItCount < 5){
fHigh += fSummaryHeight;
this.Start_Recalculate(fWidth, fHigh);
++nItCount;
}
var fNeedHeight = fHigh;
if(this.Get_ColumnsCount() > 1){ if(this.Get_ColumnsCount() > 1){
var fLow = fHeight, fHigh = fSummaryHeight;
while((fHigh - fLow) > 0.1){ while((fHigh - fLow) > 0.1){
var fCheckHeight = fLow + (fHigh - fLow)/2; var fCheckHeight = fLow + (fHigh - fLow)/2;
this.Start_Recalculate(fWidth, fCheckHeight); this.Start_Recalculate(fWidth, fCheckHeight);
......
...@@ -8485,7 +8485,7 @@ CBullet.prototype = ...@@ -8485,7 +8485,7 @@ CBullet.prototype =
function CBulletColor() function CBulletColor()
{ {
this.type = AscFormat.BULLET_TYPE_COLOR_NONE; this.type = AscFormat.BULLET_TYPE_COLOR_CLRTX;
this.UniColor = null; this.UniColor = null;
} }
......
...@@ -7824,13 +7824,13 @@ function BinaryPPTYLoader() ...@@ -7824,13 +7824,13 @@ function BinaryPPTYLoader()
} }
case 3: case 3:
{ {
b_bullet = true;
bullet.bulletColor = new AscFormat.CBulletColor();
var cur_pos = s.cur; var cur_pos = s.cur;
var _len = s.GetULong(); var _len = s.GetULong();
if (0 != _len) if (0 != _len)
{ {
b_bullet = true;
bullet.bulletColor = new AscFormat.CBulletColor();
bullet.bulletColor.type = s.GetUChar(); bullet.bulletColor.type = s.GetUChar();
if (bullet.bulletColor.type == AscFormat.BULLET_TYPE_COLOR_CLRTX) if (bullet.bulletColor.type == AscFormat.BULLET_TYPE_COLOR_CLRTX)
...@@ -7849,13 +7849,13 @@ function BinaryPPTYLoader() ...@@ -7849,13 +7849,13 @@ function BinaryPPTYLoader()
} }
case 4: case 4:
{ {
b_bullet = true;
bullet.bulletSize = new AscFormat.CBulletSize();
var cur_pos = s.cur; var cur_pos = s.cur;
var _len = s.GetULong(); var _len = s.GetULong();
if (0 != _len) if (0 != _len)
{ {
b_bullet = true;
bullet.bulletSize = new AscFormat.CBulletSize();
bullet.bulletSize.type = s.GetUChar(); bullet.bulletSize.type = s.GetUChar();
if (bullet.bulletSize.type == AscFormat.BULLET_TYPE_SIZE_TX) if (bullet.bulletSize.type == AscFormat.BULLET_TYPE_SIZE_TX)
...@@ -7865,7 +7865,7 @@ function BinaryPPTYLoader() ...@@ -7865,7 +7865,7 @@ function BinaryPPTYLoader()
else else
{ {
var _l = s.GetULong(); var _l = s.GetULong();
s.Skip2(2); // start attributes + type value (need 0) s.Skip2(2); // start attributes + type
bullet.bulletSize.val = s.GetLong(); bullet.bulletSize.val = s.GetLong();
s.Skip2(1); // end attributes s.Skip2(1); // end attributes
} }
...@@ -7875,13 +7875,13 @@ function BinaryPPTYLoader() ...@@ -7875,13 +7875,13 @@ function BinaryPPTYLoader()
} }
case 5: case 5:
{ {
b_bullet = true;
bullet.bulletTypeface = new AscFormat.CBulletTypeface();
var cur_pos = s.cur; var cur_pos = s.cur;
var _len = s.GetULong(); var _len = s.GetULong();
if (0 != _len) if (0 != _len)
{ {
b_bullet = true;
bullet.bulletTypeface = new AscFormat.CBulletTypeface();
bullet.bulletTypeface.type = s.GetUChar(); bullet.bulletTypeface.type = s.GetUChar();
if (bullet.bulletTypeface.type == AscFormat.BULLET_TYPE_TYPEFACE_BUFONT) if (bullet.bulletTypeface.type == AscFormat.BULLET_TYPE_TYPEFACE_BUFONT)
...@@ -7898,13 +7898,13 @@ function BinaryPPTYLoader() ...@@ -7898,13 +7898,13 @@ function BinaryPPTYLoader()
} }
case 6: case 6:
{ {
b_bullet = true;
bullet.bulletType = new AscFormat.CBulletType();
var cur_pos = s.cur; var cur_pos = s.cur;
var _len = s.GetULong(); var _len = s.GetULong();
if (0 != _len) if (0 != _len)
{ {
b_bullet = true;
bullet.bulletType = new AscFormat.CBulletType();
bullet.bulletType.type = s.GetUChar(); bullet.bulletType.type = s.GetUChar();
if (bullet.bulletType.type == AscFormat.BULLET_TYPE_BULLET_NONE) if (bullet.bulletType.type == AscFormat.BULLET_TYPE_BULLET_NONE)
......
...@@ -3106,7 +3106,7 @@ CPresentation.prototype = ...@@ -3106,7 +3106,7 @@ CPresentation.prototype =
{ {
target_doc_content1 = this.Slides[this.CurPage].graphicObjects.getTargetDocContent(); target_doc_content1 = this.Slides[this.CurPage].graphicObjects.getTargetDocContent();
} }
this.AddToParagraph( new ParaText( String.fromCharCode( Code ) ), undefined, true ); this.AddToParagraph( new ParaText( String.fromCharCode( Code ) ), false, true );
if(this.Slides[this.CurPage]) if(this.Slides[this.CurPage])
{ {
target_doc_content2 = this.Slides[this.CurPage].graphicObjects.getTargetDocContent(); target_doc_content2 = this.Slides[this.CurPage].graphicObjects.getTargetDocContent();
......
...@@ -687,7 +687,7 @@ CShape.prototype.recalculateContent2 = function() ...@@ -687,7 +687,7 @@ CShape.prototype.recalculateContent2 = function()
} }
content.Set_StartPage(0); content.Set_StartPage(0);
content.Reset(0, 0, w, 20000); content.Reset(0, 0, w, 20000);
content.Recalculate_Page(content.StartPage, true); content.RecalculateContent(this.txBody.contentWidth2, this.txBody.contentHeight2, 0);
var oTextWarpContent = this.checkTextWarp(content, body_pr, this.txBody.contentWidth2, this.txBody.contentHeight2, false, true); var oTextWarpContent = this.checkTextWarp(content, body_pr, this.txBody.contentWidth2, this.txBody.contentHeight2, false, true);
this.txWarpStructParamarks2 = oTextWarpContent.oTxWarpStructParamarks; this.txWarpStructParamarks2 = oTextWarpContent.oTxWarpStructParamarks;
......
This diff is collapsed.
...@@ -258,7 +258,7 @@ CGraphicObjects.prototype = ...@@ -258,7 +258,7 @@ CGraphicObjects.prototype =
isViewMode: function() isViewMode: function()
{ {
return editor.isViewMode; return this.document.IsViewMode();
}, },
convertPixToMM: function(v) convertPixToMM: function(v)
...@@ -2657,7 +2657,7 @@ CGraphicObjects.prototype = ...@@ -2657,7 +2657,7 @@ CGraphicObjects.prototype =
unGroupSelectedObjects: function() unGroupSelectedObjects: function()
{ {
if(!(editor.isViewMode === false)) if(!(this.isViewMode() === false))
return; return;
var bTrackRevisions = false; var bTrackRevisions = false;
if(this.document.TrackRevisions){ if(this.document.TrackRevisions){
...@@ -2784,11 +2784,6 @@ CGraphicObjects.prototype = ...@@ -2784,11 +2784,6 @@ CGraphicObjects.prototype =
return false; return false;
}, },
isViewMod: function()
{
return editor.isViewMode;
},
moveSelectedObjects: DrawingObjectsController.prototype.moveSelectedObjects, moveSelectedObjects: DrawingObjectsController.prototype.moveSelectedObjects,
cursorMoveLeft: DrawingObjectsController.prototype.cursorMoveLeft, cursorMoveLeft: DrawingObjectsController.prototype.cursorMoveLeft,
......
This diff is collapsed.
...@@ -2989,7 +2989,7 @@ CParagraphRecalculateStateWrap.prototype = ...@@ -2989,7 +2989,7 @@ CParagraphRecalculateStateWrap.prototype =
NumberingItem.Bullet = Bullet; NumberingItem.Bullet = Bullet;
NumberingItem.BulletNum = BulletNum + 1; NumberingItem.BulletNum = BulletNum + 1;
NumberingItem.Measure(g_oTextMeasurer, FirstTextPr, Para.Get_Theme()); NumberingItem.Measure(g_oTextMeasurer, FirstTextPr, Para.Get_Theme(), Para.Get_ColorMap());
if ( numbering_presentationnumfrmt_None != Bullet.Get_Type() ) if ( numbering_presentationnumfrmt_None != Bullet.Get_Type() )
......
...@@ -9340,8 +9340,27 @@ CParaPr.prototype = ...@@ -9340,8 +9340,27 @@ CParaPr.prototype =
this.DefaultRunPr.Merge(ParaPr.DefaultRunPr); this.DefaultRunPr.Merge(ParaPr.DefaultRunPr);
} }
if( undefined != ParaPr.Bullet && ParaPr.Bullet.isBullet()) if(undefined != ParaPr.Bullet)
this.Bullet = ParaPr.Bullet.createDuplicate(); {
if(ParaPr.Bullet.isBullet())
{
this.Bullet = ParaPr.Bullet.createDuplicate();
}
else
{
if(this.Bullet && this.Bullet.isBullet()){
if(ParaPr.Bullet.bulletColor){
this.Bullet.bulletColor = ParaPr.Bullet.bulletColor.createDuplicate();
}
if(ParaPr.Bullet.bulletSize){
this.Bullet.bulletSize = ParaPr.Bullet.bulletSize.createDuplicate();
}
if(ParaPr.Bullet.bulletTypeface){
this.Bullet.bulletTypeface = ParaPr.Bullet.bulletTypeface.createDuplicate();
}
}
}
}
if(undefined != ParaPr.Lvl) if(undefined != ParaPr.Lvl)
this.Lvl = ParaPr.Lvl; this.Lvl = ParaPr.Lvl;
...@@ -9956,11 +9975,6 @@ CParaPr.prototype = ...@@ -9956,11 +9975,6 @@ CParaPr.prototype =
{ {
Bullet.m_sChar = ""; Bullet.m_sChar = "";
} }
if(this.Bullet.bulletTypeface && this.Bullet.bulletTypeface.type == AscFormat.BULLET_TYPE_TYPEFACE_BUFONT)
{
Bullet.m_bFontTx = false;
Bullet.m_sFont = this.Bullet.bulletTypeface.typeface;
}
break; break;
} }
...@@ -9968,11 +9982,6 @@ CParaPr.prototype = ...@@ -9968,11 +9982,6 @@ CParaPr.prototype =
{ {
Bullet.m_nType = g_NumberingArr[this.Bullet.bulletType.AutoNumType]; Bullet.m_nType = g_NumberingArr[this.Bullet.bulletType.AutoNumType];
Bullet.m_nStartAt = this.Bullet.bulletType.startAt; Bullet.m_nStartAt = this.Bullet.bulletType.startAt;
if(this.Bullet.bulletTypeface && this.Bullet.bulletTypeface.type == AscFormat.BULLET_TYPE_TYPEFACE_BUFONT)
{
Bullet.m_bFontTx = false;
Bullet.m_sFont = this.Bullet.bulletTypeface.typeface;
}
break; break;
} }
case AscFormat.BULLET_TYPE_BULLET_NONE : case AscFormat.BULLET_TYPE_BULLET_NONE :
...@@ -9995,10 +10004,36 @@ CParaPr.prototype = ...@@ -9995,10 +10004,36 @@ CParaPr.prototype =
if(this.Bullet.bulletColor.type === AscFormat.BULLET_TYPE_COLOR_CLR){ if(this.Bullet.bulletColor.type === AscFormat.BULLET_TYPE_COLOR_CLR){
if(this.Bullet.bulletColor.UniColor && this.Bullet.bulletColor.UniColor.color && theme && colorMap){ if(this.Bullet.bulletColor.UniColor && this.Bullet.bulletColor.UniColor.color && theme && colorMap){
Bullet.m_bColorTx = false; Bullet.m_bColorTx = false;
this.Bullet.bulletColor.UniColor.check(theme, colorMap); Bullet.Unifill = AscFormat.CreateUniFillByUniColor(this.Bullet.bulletColor.UniColor);
Bullet.m_oColor.r = this.Bullet.bulletColor.UniColor.RGBA.R; }
Bullet.m_oColor.g = this.Bullet.bulletColor.UniColor.RGBA.G; }
Bullet.m_oColor.b = this.Bullet.bulletColor.UniColor.RGBA.B; }
if(this.Bullet.bulletTypeface)
{
if(this.Bullet.bulletTypeface.type == AscFormat.BULLET_TYPE_TYPEFACE_BUFONT){
Bullet.m_bFontTx = false;
Bullet.m_sFont = this.Bullet.bulletTypeface.typeface;
}
}
if(this.Bullet.bulletSize)
{
switch (this.Bullet.bulletSize.type){
case AscFormat.BULLET_TYPE_SIZE_TX:{
Bullet.m_bSizeTx = true;
break;
}
case AscFormat.BULLET_TYPE_SIZE_PCT:{
Bullet.m_bSizeTx = false;
Bullet.m_bSizePct = true;
Bullet.m_dSize = this.Bullet.bulletSize.val/100000.0;
break;
}
case AscFormat.BULLET_TYPE_SIZE_PCT:{
Bullet.m_bSizeTx = false;
Bullet.m_bSizePct = false;
Bullet.m_dSize = this.Bullet.bulletSize.val/100000.0;
break;
} }
} }
} }
......
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