git.iko.soy/typeable/pandoc
on master help sign in
Powerpoint writer: simplify code with `ParseXml`

There were some artifact code blocks around from before `reference-doc` functionality was implemented. This led to ignoring the reference-doc in places. Though I fixed this, I kept the old hacked-up functions instead of replacing them with `parseXml` (imported from Writers.OOXML) which does this in a consistent manner. This commit corrects that oversight.

commit8b533f9c386029f1a95dd2ea887ec7bb151fe513 authorJesse Rosenthal <jrosenthal@jhu.edu> dateSat 24 Mar 2018, 16:07 (9 years ago) parent6285c04
1 file changed+2−23
src/Text/Pandoc/Writers/Powerpoint/Output.hs+2−23
src/Text/Pandoc/Writers/Powerpoint/Output.hs+2−23
@@ -344,17 +344,7 @@ getLayout layout = do
344344 (TwoColumnSlide _ _ _) -> "ppt/slideLayouts/slideLayout4.xml"
345345 refArchive <- asks envRefArchive
346346 distArchive <- asks envDistArchive
347− root <- case findEntryByPath layoutpath refArchive `mplus`
348− findEntryByPath layoutpath distArchive of
349− Just e -> case parseXMLDoc $ UTF8.toStringLazy $ fromEntry e of
350− Just element -> return $ element
351− Nothing -> throwError $
352− PandocSomeError $
353− layoutpath ++ " corrupt in reference file"
354− Nothing -> throwError $
355− PandocSomeError $
356− layoutpath ++ " missing in reference file"
357− return root
347+ parseXml refArchive distArchive layoutpath
358348
359349shapeHasId :: NameSpaces -> String -> Element -> Bool
360350shapeHasId ns ident element
@@ -1171,20 +1161,9 @@ slideToElement (Slide _ l@(MetadataSlide titleElems subtitleElems authorElems da
11711161
11721162getNotesMaster :: PandocMonad m => P m Element
11731163getNotesMaster = do
1174− let notesMasterPath = "ppt/notesMasters/notesMaster1.xml"
11751164 refArchive <- asks envRefArchive
11761165 distArchive <- asks envDistArchive
1177− root <- case findEntryByPath notesMasterPath refArchive `mplus`
1178− findEntryByPath notesMasterPath distArchive of
1179− Just e -> case parseXMLDoc $ UTF8.toStringLazy $ fromEntry e of
1180− Just element -> return $ element
1181− Nothing -> throwError $
1182− PandocSomeError $
1183− notesMasterPath ++ " corrupt in reference file"
1184− Nothing -> throwError $
1185− PandocSomeError $
1186− notesMasterPath ++ " missing in reference file"
1187− return root
1166+ parseXml refArchive distArchive "ppt/notesMasters/notesMaster1.xml"
11881167
11891168getSlideNumberFieldId :: PandocMonad m => Element -> P m String
11901169getSlideNumberFieldId notesMaster