cur.push();\r
if ((cur.toChild(nsPML, "txStyles") && cur.toChild(nsPML, defaultStyleSelector)) ||\r
(cur.pop() && cur.toChild(nsPML, "notesStyle"))) {\r
- if (cur.toChild(nsDML, "lvl" +(level+1)+ "pPr")) {\r
- return (CTTextParagraphProperties)cur.getObject();\r
- }\r
+ while (level >= 0) {\r
+ cur.push();\r
+ if (cur.toChild(nsDML, "lvl" +(level+1)+ "pPr")) {\r
+ return (CTTextParagraphProperties)cur.getObject();\r
+ }\r
+ cur.pop();\r
+ level--;\r
+ }\r
}\r
} finally {\r
cur.dispose();\r
}\r
}\r
-\r
- \r
-// for (CTTextBody txBody : (CTTextBody[])xo.selectPath(nsDecl+".//p:txBody")) {\r
-// CTTextParagraphProperties defaultPr = null, lastPr = null;\r
-// boolean hasLvl = false;\r
-// for (CTTextParagraph p : txBody.getPArray()) {\r
-// CTTextParagraphProperties pr = p.getPPr();\r
-// if (pr.isSetLvl()) {\r
-// hasLvl |= true;\r
-// lastPr = pr;\r
-// if (pr.getLvl() == level) return pr;\r
-// } else {\r
-// defaultPr = pr;\r
-// }\r
-// }\r
-// if (!hasLvl) continue;\r
-// if (level == 0 && defaultPr != null) return defaultPr;\r
-// if (lastPr != null) return lastPr;\r
-// break;\r
-// }\r
-// \r
-// String err = "Failed to fetch default style for " + defaultStyleSelector + " and level=" + level;\r
-// throw new IllegalArgumentException(err);\r
\r
return null;\r
}\r