Commit ef8f0d99 authored by SergeyLuzyanin's avatar SergeyLuzyanin

creating numbering; fix typo

parent f2d95710
...@@ -289,7 +289,7 @@ ...@@ -289,7 +289,7 @@
/** /**
* This type specifies the bullet type * This type specifies the bullet type
* @typedef {("ArabicPeriod" | "ArabicParenR" | "RomanUcPeriod" | "RomanLcPeriod" | "AlphaLcParenR" | "AlphaLcPeriod" | "AlphaUcParenR" | "AlphaUcPeriod")} BulletType * @typedef {("None" | "ArabicPeriod" | "ArabicParenR" | "RomanUcPeriod" | "RomanLcPeriod" | "AlphaLcParenR" | "AlphaLcPeriod" | "AlphaUcParenR" | "AlphaUcPeriod")} BulletType
*/ */
...@@ -506,7 +506,7 @@ ...@@ -506,7 +506,7 @@
* */ * */
Api.prototype.CreateBlipFill= function(sImageUrl, sBlipFillType) Api.prototype.CreateBlipFill= function(sImageUrl, sBlipFillType)
{ {
return new ApiFill(AscFormat.builder_CreateBlipFill()); return new ApiFill(AscFormat.builder_CreateBlipFill(sImageUrl, sBlipFillType));
}; };
/** /**
...@@ -583,14 +583,15 @@ ...@@ -583,14 +583,15 @@
/** /**
* Create a new numbering * Create a new numbering
* @memberof Api * @memberof Api
* @param {BulletType} sType
* @param {number} nStartAt
* @returns {ApiBullet} * @returns {ApiBullet}
* */ * */
Api.CreateNumbering = function(sType, nStartAt){ Api.CreateNumbering = function(sType, nStartAt){
var oBullet = new AscFormat.CBullet(); var oBullet = new AscFormat.CBullet();
oBullet.bulletType = new AscFormat.CBulletType(); oBullet.bulletType = new AscFormat.CBulletType();
oBullet.bulletType.type = AscFormat.BULLET_TYPE_BULLET_AUTONUM;
switch(sType){ switch(sType){
case "ArabicPeriod" :{ case "ArabicPeriod" :{
oBullet.bulletType.AutoNumType = 12; oBullet.bulletType.AutoNumType = 12;
...@@ -605,64 +606,35 @@ ...@@ -605,64 +606,35 @@
break; break;
} }
case "RomanLcPeriod":{ case "RomanLcPeriod":{
oBullet.bulletType.AutoNumType = 12; oBullet.bulletType.AutoNumType = 31;
break; break;
} }
case "AlphaLcParenR":{ case "AlphaLcParenR":{
oBullet.bulletType.AutoNumType = 12; oBullet.bulletType.AutoNumType = 1;
break; break;
} }
case "AlphaLcPeriod":{ case "AlphaLcPeriod":{
oBullet.bulletType.AutoNumType = 12; oBullet.bulletType.AutoNumType = 2;
break; break;
} }
case "AlphaUcParenR":{ case "AlphaUcParenR":{
oBullet.bulletType.AutoNumType = 12; oBullet.bulletType.AutoNumType = 4;
break; break;
} }
case "AlphaUcPeriod":{ case "AlphaUcPeriod":{
oBullet.bulletType.AutoNumType = 12; oBullet.bulletType.AutoNumType = 5;
break; break;
} }
case "None":{
oBullet.bulletType.type = AscFormat.BULLET_TYPE_BULLET_NONE;
} }
switch(sType){
case "bulletTypeArabicPeriod":{
var numberingType = 12;//numbering_numfmt_arabicPeriod;
break;
}
case "bulletTypeArabicParenR":
{
numberingType = 11;//numbering_numfmt_arabicParenR;
break;
}
case "bulletTyperomanUcPeriod":
{
numberingType = 34;//numbering_numfmt_romanUcPeriod;
break;
}
case "bulletTypeArabicPeriod":
{
numberingType = 5;//numbering_numfmt_alphaUcPeriod;
break;
}
case "bulletTypeArabicPeriod":
{
numberingType = 8;
break;
} }
case "bulletTypeArabicPeriod": if( oBullet.bulletType.type === AscFormat.BULLET_TYPE_BULLET_AUTONUM){
{ if(AscFormat.isRealNumber(nStartAt)){
numberingType = 40; oBullet.bulletType.startAt = nStartAt;
break;
}
case "bulletTypeArabicPeriod":
{
numberingType = 31;//numbering_numfmt_romanLcPeriod;
break;
} }
} }
return new ApiBullet(oBullet);
}; };
//------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------
...@@ -1326,6 +1298,17 @@ ...@@ -1326,6 +1298,17 @@
this.private_OnChange(); this.private_OnChange();
}; };
/*
* Set paragraph's bullet
* @param {ApiBullet} oBullet
* */
ApiParaPr.prototype.SetBullet = function(oBullet){
if(oBullet){
this.ParaPr.Bullet = oBullet.Bullet;
this.private_OnChange();
}
};
//------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------
// //
// ApiDrawing // ApiDrawing
...@@ -1358,8 +1341,8 @@ ...@@ -1358,8 +1341,8 @@
/** /**
* Set the size of the bounding box. * Set the size of the bounding box.
* @param {EMU} nWidth * @param {EMU} nPosX
* @param {EMU} nHeight * @param {EMU} nPosY
*/ */
ApiDrawing.prototype.SetPosition = function(nPosX, nPosY) ApiDrawing.prototype.SetPosition = function(nPosX, nPosY)
{ {
...@@ -1467,7 +1450,7 @@ ...@@ -1467,7 +1450,7 @@
*/ */
ApiChart.prototype.SetTitle = function (sTitle, nFontSize) ApiChart.prototype.SetTitle = function (sTitle, nFontSize)
{ {
AscFormat.builder_SetChartTitle(this.Chart); AscFormat.builder_SetChartTitle(this.Chart, sTitle, nFontSize);
}; };
/** /**
...@@ -1690,6 +1673,7 @@ ...@@ -1690,6 +1673,7 @@
ApiParaPr.prototype["SetSpacingLine"] = ApiParaPr.prototype.SetSpacingLine; ApiParaPr.prototype["SetSpacingLine"] = ApiParaPr.prototype.SetSpacingLine;
ApiParaPr.prototype["SetSpacingBefore"] = ApiParaPr.prototype.SetSpacingBefore; ApiParaPr.prototype["SetSpacingBefore"] = ApiParaPr.prototype.SetSpacingBefore;
ApiParaPr.prototype["SetSpacingAfter"] = ApiParaPr.prototype.SetSpacingAfter; ApiParaPr.prototype["SetSpacingAfter"] = ApiParaPr.prototype.SetSpacingAfter;
ApiParaPr.prototype["SetBullet"] = ApiParaPr.prototype.SetBullet;
ApiDrawing.prototype["GetClassType"] = ApiDrawing.prototype.GetClassType; ApiDrawing.prototype["GetClassType"] = ApiDrawing.prototype.GetClassType;
ApiDrawing.prototype["SetSize"] = ApiDrawing.prototype.SetSize; ApiDrawing.prototype["SetSize"] = ApiDrawing.prototype.SetSize;
......
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