@@ -51,22 +51,22 @@ plainToPara x = x
53data WriterState =
53data WriterState =
54− WriterState { stNotes :: [Doc]
54+ WriterState { stNotes :: [Doc]
55− , stTableStyles :: [Doc]
55+ , stTableStyles :: [Doc]
56− , stParaStyles :: [Doc]
56+ , stParaStyles :: [Doc]
57− , stListStyles :: [(Int, [Doc])]
57+ , stListStyles :: [(Int, [Doc])]
58− , indentPara :: Int
58+ , stIndentPara :: Int
59− , inDefinition :: Bool
59+ , stInDefinition :: Bool
62defaultWriterState :: WriterState
62defaultWriterState :: WriterState
63defaultWriterState =
63defaultWriterState =
64− WriterState { stNotes = []
64+ WriterState { stNotes = []
65− , stTableStyles = []
65+ , stTableStyles = []
66− , stParaStyles = []
66+ , stParaStyles = []
67− , stListStyles = []
67+ , stListStyles = []
68− , indentPara = 0
68+ , stIndentPara = 0
69− , inDefinition = False
69+ , stInDefinition = False
72when :: Bool -> Doc -> Doc
72when :: Bool -> Doc -> Doc
@@ -82,13 +82,13 @@ addParaStyle :: Doc -> State WriterState ()
82addParaStyle i = modify $ \s -> s { stParaStyles = i : stParaStyles s }
82addParaStyle i = modify $ \s -> s { stParaStyles = i : stParaStyles s }
84increaseIndent :: State WriterState ()
84increaseIndent :: State WriterState ()
85−increaseIndent = modify $ \s -> s { indentPara = 1 + indentPara s }
85+increaseIndent = modify $ \s -> s { stIndentPara = 1 + stIndentPara s }
87resetIndent :: State WriterState ()
87resetIndent :: State WriterState ()
88−resetIndent = modify $ \s -> s { indentPara = 0 }
88+resetIndent = modify $ \s -> s { stIndentPara = 0 }
90setInDefinitionList :: Bool -> State WriterState ()
90setInDefinitionList :: Bool -> State WriterState ()
91−setInDefinitionList b = modify $ \s -> s { inDefinition = b }
91+setInDefinitionList b = modify $ \s -> s { stInDefinition = b }
93inParagraphTags :: Doc -> Doc
93inParagraphTags :: Doc -> Doc
94inParagraphTags = inTags False "text:p" [("text:style-name", "Text_20_body")]
94inParagraphTags = inTags False "text:p" [("text:style-name", "Text_20_body")]
@@ -428,8 +428,8 @@ tableStyle num wcs =
428paraStyle :: String -> [(String,String)] -> State WriterState Int
428paraStyle :: String -> [(String,String)] -> State WriterState Int
429paraStyle parent attrs = do
429paraStyle parent attrs = do
430 pn <- (+) 1 . length <$> gets stParaStyles
430 pn <- (+) 1 . length <$> gets stParaStyles
431− i <- (*) 0.5 . fromIntegral <$> gets indentPara :: State WriterState Double
431+ i <- (*) 0.5 . fromIntegral <$> gets stIndentPara :: State WriterState Double
432− b <- gets inDefinition
432+ b <- gets stInDefinition
433 let styleAttr = [ ("style:name" , "P" ++ show pn)
433 let styleAttr = [ ("style:name" , "P" ++ show pn)
434 , ("style:family" , "paragraph" )
434 , ("style:family" , "paragraph" )
435 , ("style:parent-style-name", parent )]
435 , ("style:parent-style-name", parent )]