Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/hotfix/v7.5.1' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
KirillovIlya committed Oct 27, 2023
2 parents 63f4c0e + 4249349 commit 3499745
Show file tree
Hide file tree
Showing 31 changed files with 22,043 additions and 4,381 deletions.
10 changes: 7 additions & 3 deletions cell/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -4021,9 +4021,13 @@ var editor;
}

if (window["NATIVE_EDITOR_ENJINE"]) {
var ws = this.wb.getWorksheet();
var activeCell = this.wbModel.getActiveWs().selectionRange.activeCell;
result = [ws.getCellLeftRelative(activeCell.col, 0), ws.getCellTopRelative(activeCell.row, 0)];
if (SearchEngine.Count > 0) {
var ws = this.wb.getWorksheet();
var activeCell = this.wbModel.getActiveWs().selectionRange.activeCell;
result = [ws.getCellLeftRelative(activeCell.col, 0), ws.getCellTopRelative(activeCell.row, 0)];
} else {
result = null;
}
} else {
result = SearchEngine.Count;
}
Expand Down
5 changes: 4 additions & 1 deletion cell/model/HeaderFooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,10 @@ function (window, undefined) {
prevField.canvasObj.canvas.style.display = "block";

this.cellEditor.close();
document.getElementById(this.editorElemId).remove();
let elem = document.getElementById(this.editorElemId);
if (elem) {
elem.parentNode.removeChild(elem);
}
}

this.curParentFocusId = null;
Expand Down
4 changes: 2 additions & 2 deletions cell/model/WorkbookElems.js
Original file line number Diff line number Diff line change
Expand Up @@ -12455,8 +12455,8 @@ AutoFilterDateElem.prototype.convertDateGroupItemToRange = function(oDateGroupIt
}
case Asc.EDateTimeGroup.datetimegroupSecond://second
{
startDate = new Asc.cDate(Date.UTC( oDateGroupItem.Year, oDateGroupItem.Month - 1, oDateGroupItem.Day, oDateGroupItem.Hour, oDateGroupItem.Second)).getExcelDateWithTime();
endDate = new Asc.cDate(Date.UTC( oDateGroupItem.Year, oDateGroupItem.Month - 1, oDateGroupItem.Day, oDateGroupItem.Hour, oDateGroupItem.Second )).getExcelDateWithTime();
startDate = new Asc.cDate(Date.UTC( oDateGroupItem.Year, oDateGroupItem.Month - 1, oDateGroupItem.Day, oDateGroupItem.Hour, oDateGroupItem.Minute, oDateGroupItem.Second, 0)).getExcelDateWithTime();
endDate = new Asc.cDate(Date.UTC( oDateGroupItem.Year, oDateGroupItem.Month - 1, oDateGroupItem.Day, oDateGroupItem.Hour, oDateGroupItem.Minute, oDateGroupItem.Second, 1000)).getExcelDateWithTime();
break;
}
case Asc.EDateTimeGroup.datetimegroupYear://year
Expand Down
10 changes: 7 additions & 3 deletions cell/view/CellEditorView.js
Original file line number Diff line number Diff line change
Expand Up @@ -3092,9 +3092,13 @@
CellEditor.prototype.End_CompositeInput = function () {
var tmpBegin = this.selectionBegin, tmpEnd = this.selectionEnd;

this.selectionBegin = this.beginCompositePos;
this.selectionEnd = this.beginCompositePos + this.compositeLength;
this.setTextStyle('u', Asc.EUnderline.underlineNone);
//TODO linux(popOs + portuguese lang.) composite input - doesn't come Replace_CompositeText on remove chars
let checkFragments = this._findFragment(this.beginCompositePos) && this._findFragment(this.beginCompositePos + this.compositeLength);
if (checkFragments) {
this.selectionBegin = this.beginCompositePos;
this.selectionEnd = this.beginCompositePos + this.compositeLength;
this.setTextStyle('u', Asc.EUnderline.underlineNone);
}

this.beginCompositePos = -1;
this.compositeLength = 0;
Expand Down
13 changes: 7 additions & 6 deletions cell/view/WorksheetView.js
Original file line number Diff line number Diff line change
Expand Up @@ -7004,8 +7004,8 @@
fVerLine = ctx.lineVerPrevPx;


if (AscBrowser.retinaPixelRatio === 2) {
widthLine = AscCommon.AscBrowser.convertToRetinaValue(widthLine, true);
if (AscBrowser.retinaPixelRatio >= 2) {
widthLine = ((widthLine * 2) + 0.5) >> 0
}

if (col != null) {
Expand Down Expand Up @@ -7102,7 +7102,7 @@

this._activateOverlayCtx();
var t = this;
var isRetinaWidth = AscCommon.AscBrowser.convertToRetinaValue(1, true) === 2;
var isRetinaWidth = this.getRetinaPixelRatio() >= 2;
var selectionRange = this.model.getSelection();
selectionRange.ranges.forEach(function (item, index) {
var arnIntersection = item.intersectionSimple(range);
Expand Down Expand Up @@ -7233,7 +7233,8 @@
if (null !== this.activeMoveRange) {
let activeMoveRange = this.activeMoveRange;
let colRowMoveProps = this.startCellMoveRange && this.startCellMoveRange.colRowMoveProps;
if (colRowMoveProps && colRowMoveProps.shiftKey) {
let bInsertBetweenRowCol = !!(colRowMoveProps && colRowMoveProps.shiftKey);
if (bInsertBetweenRowCol) {
if (colRowMoveProps.colByX != null) {
activeMoveRange = new Asc.Range(colRowMoveProps.colByX, activeMoveRange.r1, colRowMoveProps.colByX + 1, activeMoveRange.r2);
} else if (colRowMoveProps.rowByY != null) {
Expand All @@ -7244,9 +7245,9 @@
arnIntersection = activeMoveRange.intersectionSimple(range);
if (arnIntersection) {
// Координаты для перемещения диапазона
_x1 = this._getColLeft(arnIntersection.c1) - offsetX - 2;
_x1 = this._getColLeft(arnIntersection.c1) - offsetX - 2 - 1*isRetinaWidth*bInsertBetweenRowCol;
_x2 = this._getColLeft(arnIntersection.c2 + 1) - offsetX + 1 + 2;
_y1 = this._getRowTop(arnIntersection.r1) - offsetY - 2;
_y1 = this._getRowTop(arnIntersection.r1) - offsetY - 2 - 1*isRetinaWidth*bInsertBetweenRowCol;
_y2 = this._getRowTop(arnIntersection.r2 + 1) - offsetY + 1 + 2;

// Выбираем наибольший range для очистки
Expand Down
6 changes: 1 addition & 5 deletions common/Charts/DrawingObjects.js
Original file line number Diff line number Diff line change
Expand Up @@ -4472,11 +4472,7 @@ CSparklineView.prototype.setMinMaxValAx = function(minVal, maxVal, oSparklineGro
return false;
}

_this.CompositeInput = {
Run : oRun,
Pos : oRun.State.ContentPos,
Length : 0
};
_this.CompositeInput = new AscWord.RunCompositeInput_Old(oRun);

oRun.Set_CompositeInput(_this.CompositeInput);
_this.controller.startRecalculate();
Expand Down
2 changes: 2 additions & 0 deletions configs/cell.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@

"word/Editor/Paragraph/Run/FontClassification.js",
"word/Editor/Paragraph/Run/FontCalculator.js",
"word/Editor/Paragraph/Run/run-composite-input.js",
"word/Editor/Paragraph/Run/RunAutoCorrect.js",
"word/Editor/DocumentContentElementBase.js",
"word/Editor/ParagraphContentBase.js",
Expand Down Expand Up @@ -269,6 +270,7 @@
"word/Editor/Layout/ReadView.js",
"word/Editor/DocumentContentBase.js",
"word/Editor/Document.js",
"word/Editor/document-composite-input.js",
"word/Editor/ChangeCase.js",
"word/Editor/SelectedContent.js",
"word/Editor/DocumentOutline.js",
Expand Down
2 changes: 2 additions & 0 deletions configs/slide.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@

"word/Editor/Paragraph/Run/FontClassification.js",
"word/Editor/Paragraph/Run/FontCalculator.js",
"word/Editor/Paragraph/Run/run-composite-input.js",
"word/Editor/Paragraph/Run/RunAutoCorrect.js",
"slide/Drawing/ThemeLoader.js",
"word/Editor/Serialize2.js",
Expand Down Expand Up @@ -265,6 +266,7 @@
"word/Editor/Layout/ReadView.js",
"word/Editor/DocumentContentBase.js",
"word/Editor/Document.js",
"word/Editor/document-composite-input.js",
"word/Editor/ChangeCase.js",
"word/Editor/SelectedContent.js",
"word/Editor/DocumentOutline.js",
Expand Down
2 changes: 2 additions & 0 deletions configs/word.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@

"word/Editor/Paragraph/Run/FontClassification.js",
"word/Editor/Paragraph/Run/FontCalculator.js",
"word/Editor/Paragraph/Run/run-composite-input.js",
"word/Editor/Paragraph/Run/RunAutoCorrect.js",
"word/Drawing/translations.js",
"word/Editor/GraphicObjects/Format/ShapePrototype.js",
Expand Down Expand Up @@ -233,6 +234,7 @@
"word/Editor/Layout/ReadView.js",
"word/Editor/DocumentContentBase.js",
"word/Editor/Document.js",
"word/Editor/document-composite-input.js",
"word/Editor/ChangeCase.js",
"word/Editor/SelectedContent.js",
"word/Editor/DocumentOutline.js",
Expand Down
85 changes: 80 additions & 5 deletions pdf/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,6 @@
}

let isEntered = oDoc.activeForm.EnterText(text);
if (viewer.pagesInfo.pages[oDoc.activeForm._page].needRedrawForms) {
viewer._paint();
viewer.onUpdateOverlay();
}

if (isEntered) {
this.WordControl.m_oDrawingDocument.TargetStart();
Expand Down Expand Up @@ -488,7 +484,86 @@
if (!bIsFreeze)
this.WordControl.OnScroll();
};

// composite input
PDFEditorApi.prototype.Begin_CompositeInput = function()
{
let viewer = this.DocumentRenderer;
if (!viewer)
return false;

let pdfDoc = viewer.getPDFDoc();
if (!pdfDoc.activeForm || !pdfDoc.activeForm.IsEditable())
return false;

function begin() {
pdfDoc.activeForm.beginCompositeInput();
}

if (!pdfDoc.checkDefaultFieldFonts(begin))
return true;

begin();
return true;
};
PDFEditorApi.prototype.Add_CompositeText = function(codePoint) {
let form = this._getActiveForm();
if (!form || !form.IsEditable())
return;

form.addCompositeText(codePoint);
};
PDFEditorApi.prototype.Remove_CompositeText = function(count) {
let form = this._getActiveForm();
if (!form || !form.IsEditable())
return;

form.removeCompositeText(count);
};
PDFEditorApi.prototype.Replace_CompositeText = function(codePoints) {
let form = this._getActiveForm();
if (!form || !form.IsEditable())
return;

form.replaceCompositeText(codePoints);
};
PDFEditorApi.prototype.End_CompositeInput = function()
{
let form = this._getActiveForm();
if (!form || !form.IsEditable())
return;

form.endCompositeInput();
};
PDFEditorApi.prototype.Set_CursorPosInCompositeText = function(pos) {
let form = this._getActiveForm();
if (!form || !form.IsEditable())
return;

form.setPosInCompositeInput(pos);
};
PDFEditorApi.prototype.Get_CursorPosInCompositeText = function() {
let form = this._getActiveForm();
if (!form || !form.IsEditable())
return 0;

return form.getPosInCompositeInput();
};
PDFEditorApi.prototype.Get_MaxCursorPosInCompositeText = function() {
let form = this._getActiveForm();
if (!form || !form.IsEditable())
return 0;

return form.getMaxPosInCompositeInput();
};
PDFEditorApi.prototype._getActiveForm = function() {
let viewer = this.DocumentRenderer;
if (!viewer)
return null;

let pdfDoc = viewer.getPDFDoc();
return pdfDoc.activeForm;
};


// for comments
PDFEditorApi.prototype.can_AddQuotedComment = function()
Expand Down
6 changes: 4 additions & 2 deletions pdf/src/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ var CPresentation = CPresentation || function(){};
if (value != null && value.toString)
value = value.toString();

oField.SetValue(value);
oField.SetValue(value, true);
}
}
};
Expand Down Expand Up @@ -1254,7 +1254,9 @@ var CPresentation = CPresentation || function(){};
this.calculateInfo.SetSourceField(oSourceField);
this.calculateInfo.names.forEach(function(name) {
let oField = oThis.GetField(name);

if (!oField)
return;

let oFormatTrigger = oField.GetTrigger(AscPDF.FORMS_TRIGGERS_TYPES.Calculate);
let oActionRunScript = oFormatTrigger ? oFormatTrigger.GetActions()[0] : null;

Expand Down
Loading

0 comments on commit 3499745

Please sign in to comment.