Skip to content

Commit

Permalink
Fix/release bugs (#3556)
Browse files Browse the repository at this point in the history
* [bug] fix bug 62941

* [bug] fix bug 57471

* [bug] fix bug 62901

* [bug] for bug 62941
  • Loading branch information
SergeyLuzyanin authored Jun 7, 2023
1 parent 2005165 commit b679797
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 12 deletions.
14 changes: 14 additions & 0 deletions cell/view/WorksheetView.js
Original file line number Diff line number Diff line change
Expand Up @@ -4498,6 +4498,16 @@
var geometry = new AscFormat.CreateGeometry("rect");
geometry.Recalculate(imgSize, imgSize, true);

if (ctx instanceof AscCommonExcel.CPdfPrinter) {
graphics.SaveGrState();
var _baseTransform;
if (!ctx.Transform) {
_baseTransform = new AscCommon.CMatrix();
} else {
_baseTransform = ctx.Transform;
}
graphics.SetBaseTransform(_baseTransform);
}
var oUniFill = new AscFormat.builder_CreateBlipFill(img, "stretch");

graphics.SaveGrState();
Expand All @@ -4511,6 +4521,10 @@
shapeDrawer.fromShape2(new AscFormat.CColorObj(null, oUniFill, geometry), graphics, geometry);
shapeDrawer.draw(geometry);
graphics.RestoreGrState();
if (ctx instanceof AscCommonExcel.CPdfPrinter) {
graphics.SetBaseTransform(null);
graphics.RestoreGrState();
}

}, this, [img, rect, iconSize * dScale * this.getZoom()]
);
Expand Down
30 changes: 20 additions & 10 deletions common/Drawings/Format/ChartSpace.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,34 +400,44 @@ function(window, undefined) {
};

function CheckParagraphTextPr(oParagraph, oTextPr) {
var oParaPr = oParagraph.Pr.Copy();
var oParaPr2 = new CParaPr();
var oCopyTextPr = oTextPr.Copy();
if (oCopyTextPr.FontFamily) {
oCopyTextPr.RFonts.Set_FromObject(
let oParaPr = oParagraph.Pr.Copy();
let oParaPr2 = new CParaPr();
let oOldRFonts = oTextPr.RFonts;
let oFontFamily = oTextPr.FontFamily;
if (oFontFamily) {
let oRFonts = new CRFonts();
let sName = oFontFamily.Name;
oRFonts.Set_FromObject(
{
Ascii: {
Name: oCopyTextPr.FontFamily.Name,
Name: sName,
Index: -1
},
EastAsia: {
Name: oCopyTextPr.FontFamily.Name,
Name: sName,
Index: -1
},
HAnsi: {
Name: oCopyTextPr.FontFamily.Name,
Name: sName,
Index: -1
},
CS: {
Name: oCopyTextPr.FontFamily.Name,
Name: sName,
Index: -1
}
}
);
oTextPr.RFonts = oRFonts;
}
oParaPr2.DefaultRunPr = oCopyTextPr;
oParaPr2.DefaultRunPr = oTextPr;
oParaPr.Merge(oParaPr2);
if(oTextPr.HighlightColor === null &&
oParaPr.DefaultRunPr &&
oParaPr.DefaultRunPr.HighlightColor) {
oParaPr.DefaultRunPr.HighlightColor = undefined;
}
oParagraph.Set_Pr(oParaPr);
oTextPr.RFonts = oOldRFonts;
}

function CheckObjectTextPr(oElement, oTextPr, oDrawingDocument) {
Expand Down
9 changes: 8 additions & 1 deletion slide/Editor/Format/Presentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -3935,6 +3935,9 @@ CPresentation.prototype.IsViewModeInEditor = function () {
};

CPresentation.prototype.CanEdit = function () {
if(this.IsSlideShow()) {
return false;
}
return this.Api.canEdit();
};

Expand Down Expand Up @@ -7296,7 +7299,7 @@ CPresentation.prototype.EnterText = function (codePoints) {
if (!this.FocusOnNotes && oCurSlide.graphicObjects.selectedObjects.length === 0) {
let oTitle = oCurSlide.getMatchingShape(AscFormat.phType_title, null);
if (oTitle) {
let oDocContent = oTitle.getDocContent();
let oDocContent = oTitle.getDocContent && oTitle.getDocContent();
if (oDocContent.Is_Empty()) {
oDocContent.Set_CurrentElement(0, false);
} else {
Expand Down Expand Up @@ -7557,6 +7560,10 @@ CPresentation.prototype.OnMouseUp = function (e, X, Y, PageIndex) {
return keydownresult_PreventNothing;
};


CPresentation.prototype.IsSlideShow = function() {
return this.Api.isSlideShow();
};
CPresentation.prototype.OnMouseMove = function (e, X, Y, PageIndex) {

e.ctrlKey = e.CtrlKey;
Expand Down
6 changes: 5 additions & 1 deletion slide/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -2186,13 +2186,17 @@ background-repeat: no-repeat;\
}
};

asc_docs_api.prototype.isSlideShow = function() {
return !!(this.WordControl && this.WordControl.DemonstrationManager && this.WordControl.DemonstrationManager.Mode);
};

asc_docs_api.prototype.asc_PasteData = function(_format, data1, data2, text_data)
{
if (!this.canEdit())
return;

//slide show
if(this.WordControl && this.WordControl.DemonstrationManager && this.WordControl.DemonstrationManager.Mode) {
if(this.isSlideShow()) {
return;
}

Expand Down

0 comments on commit b679797

Please sign in to comment.