aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pandoc.cabal6
-rw-r--r--src/Text/Pandoc/Writers/Powerpoint/Presentation.hs9
-rw-r--r--test/Tests/Writers/Powerpoint.hs8
-rw-r--r--test/pptx/two-column/all-text/deleted-layouts.pptx (renamed from test/pptx/two-column/deleted-layouts.pptx)bin30568 -> 30568 bytes
-rw-r--r--test/pptx/two-column/all-text/input.native (renamed from test/pptx/two-column/input.native)0
-rw-r--r--test/pptx/two-column/all-text/moved-layouts.pptx (renamed from test/pptx/two-column/moved-layouts.pptx)bin41256 -> 41256 bytes
-rw-r--r--test/pptx/two-column/all-text/output.pptx (renamed from test/pptx/two-column/output.pptx)bin27689 -> 27689 bytes
-rw-r--r--test/pptx/two-column/all-text/templated.pptx (renamed from test/pptx/two-column/templated.pptx)bin40756 -> 40756 bytes
-rw-r--r--test/pptx/two-column/text-and-image/deleted-layouts.pptxbin0 -> 48392 bytes
-rw-r--r--test/pptx/two-column/text-and-image/input.native12
-rw-r--r--test/pptx/two-column/text-and-image/moved-layouts.pptxbin0 -> 59086 bytes
-rw-r--r--test/pptx/two-column/text-and-image/output.pptxbin0 -> 45520 bytes
-rw-r--r--test/pptx/two-column/text-and-image/templated.pptxbin0 -> 58586 bytes
13 files changed, 27 insertions, 8 deletions
diff --git a/pandoc.cabal b/pandoc.cabal
index 3de7da39c..347c33d51 100644
--- a/pandoc.cabal
+++ b/pandoc.cabal
@@ -446,8 +446,10 @@ extra-source-files:
test/pptx/start-numbering-at/*.pptx
test/pptx/tables/input.native
test/pptx/tables/*.pptx
- test/pptx/two-column/input.native
- test/pptx/two-column/*.pptx
+ test/pptx/two-column/all-text/input.native
+ test/pptx/two-column/all-text/*.pptx
+ test/pptx/two-column/text-and-image/input.native
+ test/pptx/two-column/text-and-image/*.pptx
test/ipynb/*.in.native
test/ipynb/*.out.native
test/ipynb/*.ipynb
diff --git a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs
index 10060d975..015e2cbdd 100644
--- a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs
+++ b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs
@@ -696,10 +696,11 @@ bodyBlocksToSlide _ (blk : blks) spkNotes
sldId
(ComparisonSlide [] (shapesL1, shapesL2) (shapesR1, shapesR2))
spkNotes
- case (break notText blksL, break notText blksR) of
- ((_, []), (_, [])) -> mkTwoColumn blksL blksR
- (([], _), ([], _)) -> mkTwoColumn blksL blksR
- ((blksL1, blksL2), (blksR1, blksR2)) -> mkComparison blksL1 blksL2 blksR1 blksR2
+ let (blksL1, blksL2) = break notText blksL
+ (blksR1, blksR2) = break notText blksR
+ if (any null [blksL1, blksL2]) && (any null [blksR1, blksR2])
+ then mkTwoColumn blksL blksR
+ else mkComparison blksL1 blksL2 blksR1 blksR2
bodyBlocksToSlide _ (blk : blks) spkNotes = do
sldId <- asks envCurSlideId
inNoteSlide <- asks envInNoteSlide
diff --git a/test/Tests/Writers/Powerpoint.hs b/test/Tests/Writers/Powerpoint.hs
index 256ee1f7f..dd3846fef 100644
--- a/test/Tests/Writers/Powerpoint.hs
+++ b/test/Tests/Writers/Powerpoint.hs
@@ -103,8 +103,12 @@ tests = groupPptxTests [ pptxTests "Inline formatting"
"pptx/images/output.pptx"
, pptxTests "two-column layout"
def
- "pptx/two-column/input.native"
- "pptx/two-column/output.pptx"
+ "pptx/two-column/all-text/input.native"
+ "pptx/two-column/all-text/output.pptx"
+ , pptxTests "two-column (not comparison)"
+ def
+ "pptx/two-column/text-and-image/input.native"
+ "pptx/two-column/text-and-image/output.pptx"
, pptxTests "speaker notes"
def
"pptx/speaker-notes/input.native"
diff --git a/test/pptx/two-column/deleted-layouts.pptx b/test/pptx/two-column/all-text/deleted-layouts.pptx
index 1d7bd87d3..1d7bd87d3 100644
--- a/test/pptx/two-column/deleted-layouts.pptx
+++ b/test/pptx/two-column/all-text/deleted-layouts.pptx
Binary files differ
diff --git a/test/pptx/two-column/input.native b/test/pptx/two-column/all-text/input.native
index 086f74889..086f74889 100644
--- a/test/pptx/two-column/input.native
+++ b/test/pptx/two-column/all-text/input.native
diff --git a/test/pptx/two-column/moved-layouts.pptx b/test/pptx/two-column/all-text/moved-layouts.pptx
index 71760268c..71760268c 100644
--- a/test/pptx/two-column/moved-layouts.pptx
+++ b/test/pptx/two-column/all-text/moved-layouts.pptx
Binary files differ
diff --git a/test/pptx/two-column/output.pptx b/test/pptx/two-column/all-text/output.pptx
index 396dc2a74..396dc2a74 100644
--- a/test/pptx/two-column/output.pptx
+++ b/test/pptx/two-column/all-text/output.pptx
Binary files differ
diff --git a/test/pptx/two-column/templated.pptx b/test/pptx/two-column/all-text/templated.pptx
index 8901695b1..8901695b1 100644
--- a/test/pptx/two-column/templated.pptx
+++ b/test/pptx/two-column/all-text/templated.pptx
Binary files differ
diff --git a/test/pptx/two-column/text-and-image/deleted-layouts.pptx b/test/pptx/two-column/text-and-image/deleted-layouts.pptx
new file mode 100644
index 000000000..297fd6bad
--- /dev/null
+++ b/test/pptx/two-column/text-and-image/deleted-layouts.pptx
Binary files differ
diff --git a/test/pptx/two-column/text-and-image/input.native b/test/pptx/two-column/text-and-image/input.native
new file mode 100644
index 000000000..796c2c7f4
--- /dev/null
+++ b/test/pptx/two-column/text-and-image/input.native
@@ -0,0 +1,12 @@
+[Header 1 ("slide-1",[],[]) [Str "Slide",Space,Str "1"]
+,Div ("",["columns"],[])
+ [Div ("",["column"],[])
+ [Para [Image ("",[],[]) [Str "an",Space,Str "image"] ("lalune.jpg","fig:")]]
+ ,Div ("",["column"],[])
+ [Para [Str "This",Space,Str "should",Space,Str "use",Space,Str "Two",Space,Str "Content,",Space,Emph [Str "not"],Space,Str "Comparison!"]]]
+,Header 1 ("slide-2",[],[]) [Str "Slide",Space,Str "2"]
+,Div ("",["columns"],[])
+ [Div ("",["column"],[])
+ [Para [Str "This",Space,Str "should",Space,Str "also",Space,Str "use",Space,Str "Two",Space,Str "Content"]]
+ ,Div ("",["column"],[])
+ [Para [Image ("",[],[]) [Str "an",Space,Str "image"] ("lalune.jpg","fig:")]]]]
diff --git a/test/pptx/two-column/text-and-image/moved-layouts.pptx b/test/pptx/two-column/text-and-image/moved-layouts.pptx
new file mode 100644
index 000000000..c9a6e577e
--- /dev/null
+++ b/test/pptx/two-column/text-and-image/moved-layouts.pptx
Binary files differ
diff --git a/test/pptx/two-column/text-and-image/output.pptx b/test/pptx/two-column/text-and-image/output.pptx
new file mode 100644
index 000000000..bfd532ed9
--- /dev/null
+++ b/test/pptx/two-column/text-and-image/output.pptx
Binary files differ
diff --git a/test/pptx/two-column/text-and-image/templated.pptx b/test/pptx/two-column/text-and-image/templated.pptx
new file mode 100644
index 000000000..23e6b283f
--- /dev/null
+++ b/test/pptx/two-column/text-and-image/templated.pptx
Binary files differ