Skip to content

Commit

Permalink
Fix slideMasterContent and font size
Browse files Browse the repository at this point in the history
  • Loading branch information
g21589 committed Nov 17, 2015
1 parent b77b35a commit e612063
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions js/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ function processSingleSlide(zip, sldFileName, index, slideSize) {
}
// Open slideMasterXX.xml
var slideMasterContent = readXmlFile(zip, masterFilename);
var slideMasterTextStyles = slideMasterContent["p:txStyles"];
var slideMasterTextStyles = getTextByPathList(slideMasterContent, ["p:sldMaster", "p:txStyles"]);
var slideMasterTables = indexNodes(slideMasterContent);
//debug(slideMasterTables);

Expand Down Expand Up @@ -1046,19 +1046,19 @@ function getFontSize(node, slideLayoutSpNode, slideMasterSpNode, type, slideMast
if ((isNaN(fontSize) || fontSize === undefined)) {
var sz = getTextByPathList(slideLayoutSpNode, ["p:txBody", "a:lstStyle", "a:lvl1pPr", "a:defRPr", "attrs", "sz"]);
fontSize = parseInt(sz) / 100;
}
/*
if ((isNaN(fontSize) || fontSize === undefined) && slideLayoutSpNode !== undefined && slideLayoutSpNode["a:defRPr"] !== undefined) {
fontSize = parseInt(slideLayoutSpNode["a:defRPr"]["attrs"]["sz"]) / 100;
}
*/

if (isNaN(fontSize)) {
if (isNaN(fontSize) || fontSize === undefined) {
if (type == "title" || type == "subTitle" || type == "ctrTitle") {
fontSize = parseInt(getTextByPathList(slideMasterTextStyles, ["p:titleStyle", "a:lvl1pPr", "a:defRPr", "attrs", "sz"]));
var sz = getTextByPathList(slideMasterTextStyles, ["p:titleStyle", "a:lvl1pPr", "a:defRPr", "attrs", "sz"]);
} else if (type == "body") {
var sz = getTextByPathList(slideMasterTextStyles, ["p:bodyStyle", "a:lvl1pPr", "a:defRPr", "attrs", "sz"]);
} else if (type == "dt" || type == "sldNum") {
var sz = "1200";
} else if (type === undefined) {
fontSize = parseInt(getTextByPathList(slideMasterTextStyles, ["p:otherStyle", "a:lvl1pPr", "a:defRPr", "attrs", "sz"]));;
var sz = getTextByPathList(slideMasterTextStyles, ["p:otherStyle", "a:lvl1pPr", "a:defRPr", "attrs", "sz"]);
}
fontSize = parseInt(sz) / 100;
}

var baseline = getTextByPathList(node, ["a:rPr", "attrs", "baseline"]);
Expand Down

0 comments on commit e612063

Please sign in to comment.