Merge pull request #3131 from tsiegleauq/change-reco-pdf-paragraphs

adjust indentation for new insertions in PDF
This commit is contained in:
Norman Jäckel 2017-03-23 00:26:25 +01:00 committed by GitHub
commit 5d074136be

View File

@ -677,6 +677,7 @@ angular.module('OpenSlidesApp.core.pdf', [])
alreadyConverted.push(stackDiv); alreadyConverted.push(stackDiv);
break; break;
case "p": case "p":
var pObjectToPush; //determine what to push later
currentParagraph = create("text"); currentParagraph = create("text");
currentParagraph.marginTop = 8; currentParagraph.marginTop = 8;
currentParagraph.lineHeight = 1.25; currentParagraph.lineHeight = 1.25;
@ -684,7 +685,28 @@ angular.module('OpenSlidesApp.core.pdf', [])
stackP.stack.push(currentParagraph); stackP.stack.push(currentParagraph);
ComputeStyle(stackP, styles); ComputeStyle(stackP, styles);
currentParagraph = parseChildren(stackP.stack, element, currentParagraph, [], diff_mode); currentParagraph = parseChildren(stackP.stack, element, currentParagraph, [], diff_mode);
alreadyConverted.push(stackP); pObjectToPush = stackP; //usually we want to push stackP
if (lineNumberMode === "outside") {
if (element.childNodes.length > 0) { //if we hit = 0, the code would fail
var pChildTagName = element.childNodes[0].tagName;
if (pChildTagName === "INS" || pChildTagName === undefined) { //the desired case
var pLineNumberPlaceholder = {
width: 20,
text: "",
fontSize: 8,
margin: [0, 2, 0, 0]
};
var pLineNumberPlaceholderCol = {
columns: [
pLineNumberPlaceholder,
stackP
]
};
pObjectToPush = pLineNumberPlaceholderCol; //overwrite the object to push
}
}
}
alreadyConverted.push(pObjectToPush);
break; break;
case "img": case "img":
// TODO: need a proper way to calculate the space // TODO: need a proper way to calculate the space