Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing wrong numbered-list indentation in open document format #910

Merged
merged 1 commit into from
Jul 14, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/Text/Pandoc/Writers/OpenDocument.hs
Original file line number Diff line number Diff line change
Expand Up @@ -489,14 +489,16 @@ paraStyle parent attrs = do
tight = if t then [ ("fo:margin-top" , "0in" )
, ("fo:margin-bottom" , "0in" )]
else []
indent = when (i /= 0 || b || t) $
selfClosingTag "style:paragraph-properties" $
[ ("fo:margin-left" , indentVal)
indent = if (i /= 0 || b)
then [ ("fo:margin-left" , indentVal)
, ("fo:margin-right" , "0in" )
, ("fo:text-indent" , "0in" )
, ("style:auto-text-indent" , "false" )]
++ tight
addParaStyle $ inTags True "style:style" (styleAttr ++ attrs) indent
else []
attributes = indent ++ tight
paraProps = when (not $ null attributes) $
selfClosingTag "style:paragraph-properties" attributes
addParaStyle $ inTags True "style:style" (styleAttr ++ attrs) paraProps
return pn

paraListStyle :: Int -> State WriterState Int
Expand Down
38 changes: 19 additions & 19 deletions tests/writer.opendocument
Original file line number Diff line number Diff line change
Expand Up @@ -741,25 +741,25 @@
<style:style style:name="P18" style:family="paragraph" style:parent-style-name="Preformatted_20_Text">
</style:style>
<style:style style:name="P19" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L2">
<style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
</style:style>
<style:style style:name="P20" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L3">
</style:style>
<style:style style:name="P21" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L4">
<style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
</style:style>
<style:style style:name="P22" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L5">
</style:style>
<style:style style:name="P23" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L6">
<style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
</style:style>
<style:style style:name="P24" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L7">
</style:style>
<style:style style:name="P25" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L8">
<style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
</style:style>
<style:style style:name="P26" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L9">
<style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
</style:style>
<style:style style:name="P27" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L10">
</style:style>
Expand All @@ -768,37 +768,37 @@
<style:style style:name="P29" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L12">
</style:style>
<style:style style:name="P30" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L13">
<style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
</style:style>
<style:style style:name="P31" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L14">
<style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
</style:style>
<style:style style:name="P32" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L15">
<style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
</style:style>
<style:style style:name="P33" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L16">
<style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
</style:style>
<style:style style:name="P34" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L17">
<style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
</style:style>
<style:style style:name="P35" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L18">
</style:style>
<style:style style:name="P36" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L19">
<style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
</style:style>
<style:style style:name="P37" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L20">
</style:style>
<style:style style:name="P38" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L21">
</style:style>
<style:style style:name="P39" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L22">
<style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
</style:style>
<style:style style:name="P40" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L23">
<style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
</style:style>
<style:style style:name="P41" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L24">
<style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
</style:style>
<style:style style:name="P42" style:family="paragraph" style:parent-style-name="Preformatted_20_Text">
<style:paragraph-properties fo:margin-left="0.5in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" />
Expand All @@ -822,18 +822,18 @@
<style:style style:name="P50" style:family="paragraph" style:parent-style-name="Preformatted_20_Text">
</style:style>
<style:style style:name="P51" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L26">
<style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
</style:style>
<style:style style:name="P52" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L27">
<style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
</style:style>
<style:style style:name="P53" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L28">
<style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
</style:style>
<style:style style:name="P54" style:family="paragraph" style:parent-style-name="Preformatted_20_Text">
</style:style>
<style:style style:name="P55" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L29">
<style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
</style:style>
<style:style style:name="P56" style:family="paragraph" style:parent-style-name="Quotations">
<style:paragraph-properties fo:margin-left="0.5in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" />
Expand All @@ -846,7 +846,7 @@
<style:paragraph-properties fo:margin-left="0.5in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" />
</style:style>
<style:style style:name="P60" style:family="paragraph" style:parent-style-name="Text_20_body" style:list-style-name="L30">
<style:paragraph-properties fo:margin-left="0.0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false" fo:margin-top="0in" fo:margin-bottom="0in" />
<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" />
</style:style>
</office:automatic-styles>
<office:body>
Expand Down