aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Odt
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Readers/Odt')
-rw-r--r--src/Text/Pandoc/Readers/Odt/ContentReader.hs19
-rw-r--r--src/Text/Pandoc/Readers/Odt/StyleReader.hs27
2 files changed, 10 insertions, 36 deletions
diff --git a/src/Text/Pandoc/Readers/Odt/ContentReader.hs b/src/Text/Pandoc/Readers/Odt/ContentReader.hs
index 0df86e2a5..2672b01ef 100644
--- a/src/Text/Pandoc/Readers/Odt/ContentReader.hs
+++ b/src/Text/Pandoc/Readers/Odt/ContentReader.hs
@@ -381,9 +381,9 @@ getParaModifier :: Style -> ParaModifier
getParaModifier Style{..} | Just props <- paraProperties styleProperties
, isBlockQuote (indentation props)
(margin_left props)
- = pageBreakMaybe (paraProperties styleProperties) blockQuote
+ = blockQuote
| otherwise
- = pageBreakMaybe (paraProperties styleProperties) id
+ = id
where
isBlockQuote mIndent mMargin
| LengthValueMM indent <- mIndent
@@ -408,19 +408,7 @@ getParaModifier Style{..} | Just props <- paraProperties styleProperties
| otherwise
= False
- pageBreakMaybe :: Maybe ParaProperties -> ParaModifier -> ParaModifier
- pageBreakMaybe (Just props) modifier = insertPageBreak (page_break props) modifier
- pageBreakMaybe Nothing modifier = modifier
-
- insertPageBreak :: ParaBreak -> ParaModifier -> ParaModifier
- insertPageBreak PageAfter modifier =
- \x -> (fromList (toList (modifier x) ++ [Para (toList pageBreak)]))
- insertPageBreak PageBefore modifier =
- \x -> (fromList (Para (toList pageBreak) : toList (modifier x)))
- insertPageBreak PageBoth modifier =
- \x -> (fromList ((Para (toList pageBreak) : toList (modifier x)) ++ [Para (toList pageBreak)]))
- insertPageBreak _ modifier =
- modifier
+
--
constructPara :: OdtReaderSafe Blocks Blocks -> OdtReaderSafe Blocks Blocks
constructPara reader = proc blocks -> do
@@ -906,6 +894,7 @@ read_reference_ref = matchingElement NsText "reference-ref"
$ maybeInAnchorRef
<<< matchChildContent [] read_plain_text
+
----------------------
-- Entry point
----------------------
diff --git a/src/Text/Pandoc/Readers/Odt/StyleReader.hs b/src/Text/Pandoc/Readers/Odt/StyleReader.hs
index cd31f50a8..26ba6df82 100644
--- a/src/Text/Pandoc/Readers/Odt/StyleReader.hs
+++ b/src/Text/Pandoc/Readers/Odt/StyleReader.hs
@@ -43,7 +43,6 @@ module Text.Pandoc.Readers.Odt.StyleReader
, TextProperties (..)
, ParaProperties (..)
, VerticalTextPosition (..)
-, ParaBreak (..)
, ListItemNumberFormat (..)
, ListLevel
, ListStyle (..)
@@ -274,7 +273,6 @@ instance Default TextProperties where
data ParaProperties = PropP { paraNumbering :: ParaNumbering
, indentation :: LengthOrPercent
, margin_left :: LengthOrPercent
- , page_break :: ParaBreak
}
deriving ( Eq, Show )
@@ -282,7 +280,6 @@ instance Default ParaProperties where
def = PropP { paraNumbering = NumberingNone
, indentation = def
, margin_left = def
- , page_break = AutoNone
}
----
@@ -317,9 +314,6 @@ instance Lookupable UnderlineMode where
data ParaNumbering = NumberingNone | NumberingKeep | NumberingRestart Int
deriving ( Eq, Show )
-data ParaBreak = AutoNone | PageBefore | PageAfter | PageBoth
- deriving ( Eq, Show )
-
data LengthOrPercent = LengthValueMM Int | PercentValue Int
deriving ( Eq, Show )
@@ -539,20 +533,16 @@ readLineMode modeAttr styleAttr = proc x -> do
readParaProperties :: StyleReader _x ParaProperties
readParaProperties =
executeIn NsStyle "paragraph-properties" $ liftAsSuccess
- ( liftA4 PropP
+ ( liftA3 PropP
( liftA2 readNumbering
- ( isSet' NsText "number-lines" )
- ( readAttr' NsText "line-number" )
+ ( isSet' NsText "number-lines" )
+ ( readAttr' NsText "line-number" )
)
( liftA2 readIndentation
- ( isSetWithDefault NsStyle "auto-text-indent" False )
- ( getAttr NsXSL_FO "text-indent" )
- )
- ( getAttr NsXSL_FO "margin-left" )
- ( liftA2 readPageBreak
- ( findAttrWithDefault NsXSL_FO "break-before" "auto" )
- ( findAttrWithDefault NsXSL_FO "break-after" "auto" )
+ ( isSetWithDefault NsStyle "auto-text-indent" False )
+ ( getAttr NsXSL_FO "text-indent" )
)
+ ( getAttr NsXSL_FO "margin-left" )
)
where readNumbering (Just True) (Just n) = NumberingRestart n
readNumbering (Just True) _ = NumberingKeep
@@ -561,11 +551,6 @@ readParaProperties =
readIndentation False indent = indent
readIndentation True _ = def
- readPageBreak "page" "page" = PageBoth
- readPageBreak "page" _ = PageBefore
- readPageBreak _ "page" = PageAfter
- readPageBreak _ _ = AutoNone
-
----
-- List styles
----