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.
This commit is contained in:
parent
6285c047c4
commit
8b533f9c38
1 changed files with 2 additions and 23 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue