Skip to content

Commit b3a2422

Browse files
committed
Merge pull request #62 from openxml/add-type-to-paragraph-section-properties
Added section type to paragraph-level section properties
2 parents 123039f + abafc9a commit b3a2422

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

lib/openxml/docx/properties/section.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
require "openxml/docx/properties/page_margins"
33
require "openxml/docx/properties/page_size"
44
require "openxml/docx/properties/header_reference"
5+
require "openxml/docx/properties/section_type"
56

67
module OpenXml
78
module Docx
89
module Properties
910
class Section < ContainerProperty
1011
tag :sectPr
11-
child_classes :page_size, :page_margins, :columns, :header_reference
12+
child_classes :page_size, :page_margins, :columns, :header_reference, :section_type
1213
end
1314
end
1415
end

spec/elements/paragraph_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
pm.right = 1440
4747
pm.top = 1440
4848

49+
@instance.section << OpenXml::Docx::Properties::SectionType.new(:continuous)
50+
4951
@instance.section << pm
5052
columns = OpenXml::Docx::Properties::Columns.new
5153
columns.space = 720

spec/support/data/elements/paragraph_with_section_properties_element.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<w:pPr>
55
<w:sectPr>
66
<w:pgSz w:h="15840" w:w="12240"/>
7+
<w:type w:val="continuous"/>
78
<w:pgMar w:bottom="1440" w:footer="720" w:header="720" w:left="1440" w:right="1440" w:top="1440"/>
89
<w:cols w:space="720"/>
910
</w:sectPr>

0 commit comments

Comments
 (0)