Commit d8657ed2 authored by Ilya Kirillov's avatar Ilya Kirillov

The following actions have been implemented for footnotes: add a new...

The following actions have been implemented for footnotes: add a new paragraph, add an inline image, add an ole object, add a text art, edit chart, add an inline table, clear paragraph formatting, add a run element to paragraph.
parent 3c5fd75c
...@@ -580,6 +580,33 @@ CFootnotesController.prototype.private_GetFootnotesOnPage = function(PageAbs, St ...@@ -580,6 +580,33 @@ CFootnotesController.prototype.private_GetFootnotesOnPage = function(PageAbs, St
oFootnotes[oFootnote.Get_Id()] = oFootnote; oFootnotes[oFootnote.Get_Id()] = oFootnote;
} }
}; };
CFootnotesController.prototype.private_OnNotValidActionForFootnotes = function()
{
// Пока ничего не делаем, если надо будет выдавать сообщение, то обработать нужно будет здесь.
};
CFootnotesController.prototype.private_IsOnFootnoteSelected = function()
{
var nCounter = 0;
for (var sId in this.Selection.Footnotes)
{
nCounter++;
if (nCounter > 1)
return false;
}
return true;
};
CFootnotesController.prototype.private_CheckFootnotesSelectionBeforeAction = function()
{
if (true !== this.private_IsOnFootnoteSelected() || null === this.CurFootnote)
{
this.private_OnNotValidActionForFootnotes();
return false;
}
return true;
};
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Controller area // Controller area
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
...@@ -603,108 +630,75 @@ CFootnotesController.prototype.GetCurPage = function() ...@@ -603,108 +630,75 @@ CFootnotesController.prototype.GetCurPage = function()
}; };
CFootnotesController.prototype.AddNewParagraph = function(bRecalculate, bForceAdd) CFootnotesController.prototype.AddNewParagraph = function(bRecalculate, bForceAdd)
{ {
var bRetValue = false; if (false === this.private_CheckFootnotesSelectionBeforeAction())
return false;
// TODO: Доделать селект и курсор
if (true === this.Selection.Use)
{
}
else
{
if (null !== this.CurFootnote)
bRetValue = this.CurFootnote.Add_NewParagraph(bRecalculate, bForceAdd);
}
return bRetValue; return this.CurFootnote.Add_NewParagraph(bRecalculate, bForceAdd);
}; };
CFootnotesController.prototype.AddInlineImage = function(nW, nH, oImage, oChart, bFlow) CFootnotesController.prototype.AddInlineImage = function(nW, nH, oImage, oChart, bFlow)
{ {
var bRetValue = false; if (false === this.private_CheckFootnotesSelectionBeforeAction())
return false;
// TODO: Доделать селект и курсор
if (true === this.Selection.Use)
{
}
else
{
if (null !== this.CurFootnote)
bRetValue = this.CurFootnote.Add_InlineImage(nW, nH, oImage, oChart, bFlow);
}
return bRetValue; return this.CurFootnote.Add_InlineImage(nW, nH, oImage, oChart, bFlow);
}; };
CFootnotesController.prototype.AddOleObject = function(W, H, nWidthPix, nHeightPix, Img, Data, sApplicationId) CFootnotesController.prototype.AddOleObject = function(W, H, nWidthPix, nHeightPix, Img, Data, sApplicationId)
{ {
var bRetValue = false; if (false === this.private_CheckFootnotesSelectionBeforeAction())
return false;
// TODO: Доделать селект и курсор
if (true === this.Selection.Use)
{
}
else
{
if (null !== this.CurFootnote)
bRetValue = this.CurFootnote.Add_OleObject(W, H, nWidthPix, nHeightPix, Img, Data, sApplicationId);
}
return bRetValue; return this.CurFootnote.Add_OleObject(W, H, nWidthPix, nHeightPix, Img, Data, sApplicationId);
}; };
CFootnotesController.prototype.AddTextArt = function(nStyle) CFootnotesController.prototype.AddTextArt = function(nStyle)
{ {
var bRetValue = false; if (false === this.private_CheckFootnotesSelectionBeforeAction())
return false;
// TODO: Доделать селект и курсор
if (true === this.Selection.Use)
{
}
else
{
if (null !== this.CurFootnote)
bRetValue = this.CurFootnote.Add_TextArt(nStyle);
}
return bRetValue; return this.CurFootnote.Add_TextArt(nStyle);
}; };
CFootnotesController.prototype.EditChart = function(Chart) CFootnotesController.prototype.EditChart = function(Chart)
{ {
// TODO: Реализовать if (false === this.private_CheckFootnotesSelectionBeforeAction())
return;
this.CurFootnote.Edit_Chart(Chart);
}; };
CFootnotesController.prototype.AddInlineTable = function(Cols, Rows) CFootnotesController.prototype.AddInlineTable = function(Cols, Rows)
{ {
// TODO: Доделать селект и курсор if (false === this.private_CheckFootnotesSelectionBeforeAction())
if (true === this.Selection.Use) return;
{
} if (null !== this.CurFootnote)
else this.CurFootnote.Add_InlineTable(Cols, Rows);
{
if (null !== this.CurFootnote)
this.CurFootnote.Add_InlineTable(Cols, Rows);
}
}; };
CFootnotesController.prototype.ClearParagraphFormatting = function() CFootnotesController.prototype.ClearParagraphFormatting = function()
{ {
// TODO: Доделать селект и курсор for (var sId in this.Selection.Footnotes)
if (true === this.Selection.Use)
{
}
else
{ {
if (null !== this.CurFootnote) var oFootnote = this.Selection.Footnotes[sId];
this.CurFootnote.Paragraph_ClearFormatting(); oFootnote.Paragraph_ClearFormatting();
} }
}; };
CFootnotesController.prototype.AddToParagraph = function(oItem, bRecalculate) CFootnotesController.prototype.AddToParagraph = function(oItem, bRecalculate)
{ {
// TODO: Доделать селект и курсор if (oItem instanceof ParaTextPr)
if (true === this.Selection.Use)
{ {
for (var sId in this.Selection.Footnotes)
{
var oFootnote = this.Selection.Footnotes[sId];
oFootnote.Paragraph_Add(oItem, false);
}
if (false !== bRecalculate)
{
this.LogicDocument.Recalculate();
}
} }
else else
{ {
if (false === this.private_CheckFootnotesSelectionBeforeAction())
return;
if (null !== this.CurFootnote) if (null !== this.CurFootnote)
this.CurFootnote.Paragraph_Add(oItem, bRecalculate); this.CurFootnote.Paragraph_Add(oItem, bRecalculate);
} }
......
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