Skip to content

Commit

Permalink
Release/v7.0.0 (#2345)
Browse files Browse the repository at this point in the history
* Fix bug #53887

Add check if a paragraph has been recalculated before placing the cursor there

* Fix bug #53857

Ignore complex fields and fldSimple when working with docxf and oform

* Fix bug #53650

Turn off multiline option by default for forms, also turn if off when converting inline form to fixed type and vice versa

* Fix bug #53704

Make the background color for fixed form and inline form the same in the dark mode

* [se] Fix bug 53918

* Fix fonts bug

Co-authored-by: KirillovIlya <[email protected]>
Co-authored-by: GoshaZotov <[email protected]>
  • Loading branch information
3 people authored Nov 22, 2021
1 parent 3f9c23e commit a3ef34d
Show file tree
Hide file tree
Showing 10 changed files with 88 additions and 11 deletions.
26 changes: 26 additions & 0 deletions cell/model/Workbook.js
Original file line number Diff line number Diff line change
Expand Up @@ -14551,6 +14551,32 @@
});
return fill;
};
Range.prototype.getLocked = function () {
var t = this;
var nRow = this.bbox.r1;
var nCol = this.bbox.c1;
var isLocked = true;
this.worksheet._getCellNoEmpty(nRow, nCol, function (cell) {
var xfs = cell ? cell.getCompiledStyle() : t.worksheet.getCompiledStyle(nRow, nCol);
if (xfs) {
isLocked = xfs.getLocked();
}
});
return isLocked;
};
Range.prototype.getHidden = function () {
var t = this;
var nRow = this.bbox.r1;
var nCol = this.bbox.c1;
var isHidden = false;
this.worksheet._getCellNoEmpty(nRow, nCol, function (cell) {
var xfs = cell ? cell.getCompiledStyle() : t.worksheet.getCompiledStyle(nRow, nCol);
if (xfs) {
isHidden = xfs.getHidden();
}
});
return isHidden;
};
Range.prototype.getBorderSrc = function (opt_row, opt_col) {
//Возвращает как записано в файле, не проверяя бордеры соседних ячеек
//формат
Expand Down
14 changes: 14 additions & 0 deletions cell/view/WorksheetView.js
Original file line number Diff line number Diff line change
Expand Up @@ -13195,6 +13195,10 @@
pastedRangeProps.shrinkToFit = align.getShrinkToFit();

pastedRangeProps.indent = align.getIndent();

pastedRangeProps.hidden = newVal.getHidden();

pastedRangeProps.locked = newVal.getLocked();
}

var tableDxf = getTableDxf(pasteRow, pasteCol, newVal);
Expand Down Expand Up @@ -13808,6 +13812,16 @@
range.setIndent(rangeStyle.indent);
}

//locked
if (rangeStyle.locked !== undefined && specialPasteProps.format) {
range.setLocked(rangeStyle.locked);
}

//hidden
if (rangeStyle.hidden !== undefined && specialPasteProps.format) {
range.setHiddenFormulas(rangeStyle.hidden);
}

//hyperLink
if (rangeStyle.hyperLink && specialPasteProps.hyperlink) {
var _link = rangeStyle.hyperLink.hyperLink;
Expand Down
2 changes: 1 addition & 1 deletion common/Drawings/Format/Shape.js
Original file line number Diff line number Diff line change
Expand Up @@ -5506,7 +5506,7 @@ CShape.prototype.draw = function (graphics, transform, transformText, pageIndex)
var result_page_index = AscFormat.isRealNumber(graphics.shapePageIndex) ? graphics.shapePageIndex : old_start_page;

if (graphics.CheckUseFonts2 !== undefined)
graphics.CheckUseFonts2(this.transformText);
graphics.CheckUseFonts2(this.transformText, this.isForm());

if (AscCommon.IsShapeToImageConverter)
{
Expand Down
16 changes: 13 additions & 3 deletions common/libfont/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -692,13 +692,18 @@ CFontSelect.prototype =

var recordLen = 0;
var currentPos = fs.cur;

var bIsUseVersion = (bIsDictionary !== false) ? true : false;
if (!bIsUseVersion)
_version = 0;

if (_version >= 2)
recordLen = fs.GetLong();

// name
var _len = fs.GetLong();

if (bIsDictionary === false)
if (!bIsUseVersion)
this.m_wsFontName = fs.GetString1(_len);
else
{
Expand All @@ -725,7 +730,7 @@ CFontSelect.prototype =
}
}

if (bIsDictionary !== false)
if (bIsUseVersion)
{
switch (_version)
{
Expand Down Expand Up @@ -766,7 +771,7 @@ CFontSelect.prototype =
this.m_bIsFixed = (1 == fs.GetLong());

var _panose_len = 10;
if (bIsDictionary !== false)
if (bIsUseVersion)
_panose_len = fs.GetLong(); // 10

for (var i = 0; i < _panose_len; i++)
Expand Down Expand Up @@ -796,7 +801,12 @@ CFontSelect.prototype =
if (_version >= 2)
{
this.m_usType = fs.GetUShort();
}

// if new versions - load addition data in this place

if (_version >= 2)
{
fs.Seek2(currentPos + recordLen);
}
},
Expand Down
4 changes: 2 additions & 2 deletions word/Drawing/Graphics.js
Original file line number Diff line number Diff line change
Expand Up @@ -2842,9 +2842,9 @@ CGraphics.prototype =
}
},

CheckUseFonts2 : function(_transform)
CheckUseFonts2 : function(_transform, isForm)
{
this.isShapeDraw = true;
this.isShapeDraw = !isForm;
if (!global_MatrixTransformer.IsIdentity2(_transform))
{
if (!AscCommon.g_fontManager2)
Expand Down
6 changes: 3 additions & 3 deletions word/Editor/Document.js
Original file line number Diff line number Diff line change
Expand Up @@ -11460,11 +11460,11 @@ CDocument.prototype.OnMouseUp = function(e, X, Y, PageIndex)
}

this.AddToParagraph(ParaItem);
this.MoveCursorToXY(X, Y, false);
this.Document_UpdateSelectionState();

this.UpdateSelection();
this.Recalculate();
this.FinalizeAction();

this.MoveCursorToXY(X, Y, false);
this.Api.sync_MarkerFormatCallback(true);
}
}
Expand Down
10 changes: 9 additions & 1 deletion word/Editor/Field.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,15 @@ ParaField.prototype.IsFillingForm = function()
};
ParaField.prototype.FindNextFillingForm = function(isNext, isCurrent, isStart)
{
if (!this.IsFillingForm())
var oParagraph = this.GetParagraph();
if (!oParagraph)
return null;

var oLogicDocument = oParagraph.GetLogicDocument();
if (!oLogicDocument)
return null;

if (!this.IsFillingForm() || oLogicDocument.IsFillingOFormMode())
return CParagraphContentWithParagraphLikeContent.prototype.FindNextFillingForm.apply(this, arguments);

if (isCurrent && true === this.IsSelectedAll())
Expand Down
3 changes: 3 additions & 0 deletions word/Editor/Paragraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -5664,6 +5664,9 @@ Paragraph.prototype.MoveCursorRightWithSelectionFromStart = function(Word)
};
Paragraph.prototype.MoveCursorToXY = function(X, Y, bLine, bDontChangeRealPos, CurPage)
{
if (!this.IsRecalculated())
return;

var SearchPosXY = this.Get_ParaContentPosByXY(X, Y, CurPage, bLine, false);

this.Set_ParaContentPos(SearchPosXY.Pos, false, SearchPosXY.Line, SearchPosXY.Range);
Expand Down
16 changes: 16 additions & 0 deletions word/Editor/StructuredDocumentTags/InlineLevel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2632,6 +2632,14 @@ CInlineLevelSdt.prototype.ConvertFormToFixed = function()
if (this.IsAutoFitContent())
oLogicDocument.CheckFormAutoFit(this);

var oTextPr = this.GetTextFormPr();
if (oTextPr && oTextPr.GetMultiLine())
{
var oNewTextPr = oTextPr.Copy();
oNewTextPr.SetMultiLine(false);
this.SetTextFormPr(oNewTextPr);
}

return oParaDrawing;
};
CInlineLevelSdt.prototype.ConvertFormToInline = function()
Expand Down Expand Up @@ -2682,6 +2690,14 @@ CInlineLevelSdt.prototype.ConvertFormToInline = function()
oRunParent.AddToContent(nInRunParentPos, this, true);
}

var oTextPr = this.GetTextFormPr();
if (oTextPr && oTextPr.GetMultiLine())
{
var oNewTextPr = oTextPr.Copy();
oNewTextPr.SetMultiLine(false);
this.SetTextFormPr(oNewTextPr);
}

return true;
};
CInlineLevelSdt.prototype.IsMultiLineForm = function()
Expand Down
2 changes: 1 addition & 1 deletion word/Editor/StructuredDocumentTags/SdtPr.js
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,7 @@ function CSdtTextFormPr(nMax, isComb, nWidth, nSymbol, sFont, oCombBorder)
this.CombPlaceholderSymbol = nSymbol;
this.CombPlaceholderFont = sFont;
this.CombBorder = undefined !== oCombBorder ? oCombBorder.Copy() : undefined;
this.MultiLine = true;
this.MultiLine = false;
this.AutoFit = false;
}
CSdtTextFormPr.prototype.Copy = function()
Expand Down

0 comments on commit a3ef34d

Please sign in to comment.