Skip to content

Commit

Permalink
Fix bug #71812
Browse files Browse the repository at this point in the history
  • Loading branch information
KhromovNikita committed Nov 26, 2024
1 parent 373e8e7 commit 23acfa6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
13 changes: 13 additions & 0 deletions pdf/src/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -4337,6 +4337,19 @@ var CPresentation = CPresentation || function(){};

if (oDrawing) {
oDrawing.fromXml(oXmlReader);
if (oDrawing.IsShape()) {
let new_body_pr = oDrawing.getBodyPr();
if (new_body_pr) {
new_body_pr = new_body_pr.createDuplicate();
new_body_pr.textFit = new AscFormat.CTextFit();
new_body_pr.textFit.type = AscFormat.text_fit_Auto;

if (oDrawing.txBody) {
oDrawing.txBody.setBodyPr(new_body_pr);
}
}
}

oDrawing.setBDeleted(false);
aPageDrawings.push(oDrawing);
oDrawing.CheckTextOnOpen();
Expand Down
2 changes: 1 addition & 1 deletion pdf/src/drawings/drawingPrototype.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
CPdfDrawingPrototype.prototype.IsForm = function() {
return false;
};
CPdfDrawingPrototype.prototype.IsTextShape = function() {
CPdfDrawingPrototype.prototype.IsShape = function() {
return false;
};
CPdfDrawingPrototype.prototype.IsImage = function() {
Expand Down
2 changes: 1 addition & 1 deletion pdf/src/drawings/shape.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
CPdfShape.prototype = Object.create(AscFormat.CShape.prototype);
Object.assign(CPdfShape.prototype, AscPDF.PdfDrawingPrototype.prototype);

CPdfShape.prototype.IsTextShape = function() {
CPdfShape.prototype.IsShape = function() {
return true;
};
CPdfShape.prototype.ShouldDrawImaginaryBorder = function(graphicsWord) {
Expand Down
2 changes: 1 addition & 1 deletion word/Editor/GraphicObjects/DrawingStates.js
Original file line number Diff line number Diff line change
Expand Up @@ -2176,7 +2176,7 @@ TextAddState.prototype =
return {cursorType: "default", objectId: oCheckObject.Get_Id()};
}
else if (Asc.editor.isPdfEditor()) {
if (oCheckObject.IsTextShape()) {
if (oCheckObject.IsShape()) {
return {cursorType: "text", objectId: oCheckObject.Get_Id()};
}
}
Expand Down

0 comments on commit 23acfa6

Please sign in to comment.