aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJesse Rosenthal <jrosenthal@jhu.edu>2018-03-24 16:07:14 -0400
committerJesse Rosenthal <jrosenthal@jhu.edu>2018-03-24 16:07:14 -0400
commit8b533f9c386029f1a95dd2ea887ec7bb151fe513 (patch)
treef3b1446510d01067ab3fcc2e0a4bf553cdac9f15 /src/Text
parent6285c047c4a7642c992ebb6c9e9ddc9ce21c5f3e (diff)
downloadpandoc-8b533f9c386029f1a95dd2ea887ec7bb151fe513.tar.gz
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.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/Powerpoint/Output.hs25
1 files changed, 2 insertions, 23 deletions
diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs
index a99069ea2..dc5f1c9a9 100644
--- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs
+++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs
@@ -344,17 +344,7 @@ getLayout layout = do
(TwoColumnSlide _ _ _) -> "ppt/slideLayouts/slideLayout4.xml"
refArchive <- asks envRefArchive
distArchive <- asks envDistArchive
- root <- case findEntryByPath layoutpath refArchive `mplus`
- findEntryByPath layoutpath distArchive of
- Just e -> case parseXMLDoc $ UTF8.toStringLazy $ fromEntry e of
- Just element -> return $ element
- Nothing -> throwError $
- PandocSomeError $
- layoutpath ++ " corrupt in reference file"
- Nothing -> throwError $
- PandocSomeError $
- layoutpath ++ " missing in reference file"
- return root
+ parseXml refArchive distArchive layoutpath
shapeHasId :: NameSpaces -> String -> Element -> Bool
shapeHasId ns ident element
@@ -1171,20 +1161,9 @@ slideToElement (Slide _ l@(MetadataSlide titleElems subtitleElems authorElems da
getNotesMaster :: PandocMonad m => P m Element
getNotesMaster = do
- let notesMasterPath = "ppt/notesMasters/notesMaster1.xml"
refArchive <- asks envRefArchive
distArchive <- asks envDistArchive
- root <- case findEntryByPath notesMasterPath refArchive `mplus`
- findEntryByPath notesMasterPath distArchive of
- Just e -> case parseXMLDoc $ UTF8.toStringLazy $ fromEntry e of
- Just element -> return $ element
- Nothing -> throwError $
- PandocSomeError $
- notesMasterPath ++ " corrupt in reference file"
- Nothing -> throwError $
- PandocSomeError $
- notesMasterPath ++ " missing in reference file"
- return root
+ parseXml refArchive distArchive "ppt/notesMasters/notesMaster1.xml"
getSlideNumberFieldId :: PandocMonad m => Element -> P m String
getSlideNumberFieldId notesMaster