ruby_pptx 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +98 -0
- data/README.md +94 -4
- data/lib/ruby_pptx/action.rb +12 -4
- data/lib/ruby_pptx/autoshape_spec.rb +6 -2
- data/lib/ruby_pptx/builder.rb +3 -1
- data/lib/ruby_pptx/chart/categories.rb +45 -15
- data/lib/ruby_pptx/chart/chart.rb +168 -31
- data/lib/ruby_pptx/chart/combo.rb +19 -4
- data/lib/ruby_pptx/chart/data.rb +45 -15
- data/lib/ruby_pptx/chart/format.rb +229 -76
- data/lib/ruby_pptx/chart/workbook_writer.rb +9 -3
- data/lib/ruby_pptx/chart/xml_writer.rb +54 -18
- data/lib/ruby_pptx/chart/xy_data.rb +68 -22
- data/lib/ruby_pptx/dml/color.rb +27 -9
- data/lib/ruby_pptx/dml/effect.rb +6 -2
- data/lib/ruby_pptx/dml/fill.rb +42 -14
- data/lib/ruby_pptx/element_proxy.rb +12 -4
- data/lib/ruby_pptx/enum/base.rb +30 -10
- data/lib/ruby_pptx/enum/prog_id.rb +3 -1
- data/lib/ruby_pptx/geometry.rb +32 -10
- data/lib/ruby_pptx/image.rb +27 -9
- data/lib/ruby_pptx/length.rb +94 -27
- data/lib/ruby_pptx/media.rb +12 -4
- data/lib/ruby_pptx/numeric_lengths.rb +34 -9
- data/lib/ruby_pptx/opc/oxml.rb +7 -5
- data/lib/ruby_pptx/opc/pack_uri.rb +15 -5
- data/lib/ruby_pptx/opc/package.rb +97 -31
- data/lib/ruby_pptx/opc/serialized.rb +15 -5
- data/lib/ruby_pptx/oxml/backend.rb +585 -0
- data/lib/ruby_pptx/oxml/chart.rb +112 -42
- data/lib/ruby_pptx/oxml/content_model.rb +6 -2
- data/lib/ruby_pptx/oxml/dml/color.rb +6 -2
- data/lib/ruby_pptx/oxml/dml/fill.rb +6 -2
- data/lib/ruby_pptx/oxml/element.rb +138 -101
- data/lib/ruby_pptx/oxml/ns.rb +7 -7
- data/lib/ruby_pptx/oxml/presentation.rb +9 -3
- data/lib/ruby_pptx/oxml/section.rb +3 -1
- data/lib/ruby_pptx/oxml/shapes/autoshape.rb +39 -13
- data/lib/ruby_pptx/oxml/shapes/groupshape.rb +15 -7
- data/lib/ruby_pptx/oxml/shapes/other.rb +47 -16
- data/lib/ruby_pptx/oxml/shapes/shared.rb +96 -30
- data/lib/ruby_pptx/oxml/simple_types.rb +169 -52
- data/lib/ruby_pptx/oxml/slide.rb +25 -8
- data/lib/ruby_pptx/oxml/table.rb +39 -13
- data/lib/ruby_pptx/oxml/text.rb +122 -16
- data/lib/ruby_pptx/oxml/theme.rb +13 -4
- data/lib/ruby_pptx/package.rb +9 -3
- data/lib/ruby_pptx/parts/chart.rb +6 -2
- data/lib/ruby_pptx/parts/image.rb +12 -4
- data/lib/ruby_pptx/parts/media.rb +3 -1
- data/lib/ruby_pptx/parts/presentation.rb +15 -5
- data/lib/ruby_pptx/parts/slide.rb +33 -11
- data/lib/ruby_pptx/parts/theme.rb +3 -1
- data/lib/ruby_pptx/pattern_matching.rb +6 -2
- data/lib/ruby_pptx/presentation.rb +24 -8
- data/lib/ruby_pptx/section.rb +30 -10
- data/lib/ruby_pptx/shapes/adjustments.rb +9 -3
- data/lib/ruby_pptx/shapes/authoring.rb +3 -1
- data/lib/ruby_pptx/shapes/base.rb +74 -24
- data/lib/ruby_pptx/shapes/freeform.rb +36 -12
- data/lib/ruby_pptx/shapes/placeholder.rb +44 -15
- data/lib/ruby_pptx/shapes/shape.rb +91 -30
- data/lib/ruby_pptx/shapes/shape_tree.rb +235 -121
- data/lib/ruby_pptx/slide.rb +137 -46
- data/lib/ruby_pptx/table.rb +105 -35
- data/lib/ruby_pptx/text/font_metrics.rb +30 -9
- data/lib/ruby_pptx/text/list_style.rb +88 -0
- data/lib/ruby_pptx/text/text.rb +241 -59
- data/lib/ruby_pptx/theme.rb +30 -10
- data/lib/ruby_pptx/version.rb +1 -1
- data/lib/ruby_pptx.rb +9 -1
- metadata +24 -2
data/lib/ruby_pptx/section.rb
CHANGED
|
@@ -32,10 +32,14 @@ module Pptx
|
|
|
32
32
|
self
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
-
def size
|
|
35
|
+
def size
|
|
36
|
+
section_elements.size
|
|
37
|
+
end
|
|
36
38
|
alias length size
|
|
37
39
|
|
|
38
|
-
def empty?
|
|
40
|
+
def empty?
|
|
41
|
+
size.zero?
|
|
42
|
+
end
|
|
39
43
|
|
|
40
44
|
# Indexed by position, or looked up by name.
|
|
41
45
|
def [](key, length = nil)
|
|
@@ -45,7 +49,9 @@ module Pptx
|
|
|
45
49
|
end
|
|
46
50
|
|
|
47
51
|
# @return [Section, nil]
|
|
48
|
-
def by_name(name)
|
|
52
|
+
def by_name(name)
|
|
53
|
+
find { |section| section.name == name }
|
|
54
|
+
end
|
|
49
55
|
|
|
50
56
|
# Add a section, optionally containing +slides+.
|
|
51
57
|
#
|
|
@@ -69,11 +75,15 @@ module Pptx
|
|
|
69
75
|
section
|
|
70
76
|
end
|
|
71
77
|
|
|
72
|
-
def inspect
|
|
78
|
+
def inspect
|
|
79
|
+
"#<Pptx::Sections #{map(&:name).inspect}>"
|
|
80
|
+
end
|
|
73
81
|
|
|
74
82
|
private
|
|
75
83
|
|
|
76
|
-
def section_elements
|
|
84
|
+
def section_elements
|
|
85
|
+
@presentation.element.section_list&.section_list || []
|
|
86
|
+
end
|
|
77
87
|
end
|
|
78
88
|
|
|
79
89
|
# One named section of a presentation.
|
|
@@ -87,14 +97,18 @@ module Pptx
|
|
|
87
97
|
@presentation = presentation
|
|
88
98
|
end
|
|
89
99
|
|
|
90
|
-
def name
|
|
100
|
+
def name
|
|
101
|
+
@element.name
|
|
102
|
+
end
|
|
91
103
|
|
|
92
104
|
def name=(value)
|
|
93
105
|
@element.name = value.to_s
|
|
94
106
|
end
|
|
95
107
|
|
|
96
108
|
# The GUID PowerPoint uses to identify this section.
|
|
97
|
-
def id
|
|
109
|
+
def id
|
|
110
|
+
@element.id
|
|
111
|
+
end
|
|
98
112
|
|
|
99
113
|
# The slides in this section, in section order.
|
|
100
114
|
#
|
|
@@ -104,7 +118,9 @@ module Pptx
|
|
|
104
118
|
slide_ids.filter_map { |slide_id| @presentation.slides.by_id(slide_id) }
|
|
105
119
|
end
|
|
106
120
|
|
|
107
|
-
def slide_ids
|
|
121
|
+
def slide_ids
|
|
122
|
+
@element.sldIdLst.sldId_list.map(&:id)
|
|
123
|
+
end
|
|
108
124
|
|
|
109
125
|
# Put +slide+ in this section. A slide belongs to at most one section, so
|
|
110
126
|
# it is removed from any other first.
|
|
@@ -123,8 +139,12 @@ module Pptx
|
|
|
123
139
|
slide
|
|
124
140
|
end
|
|
125
141
|
|
|
126
|
-
def include?(slide)
|
|
142
|
+
def include?(slide)
|
|
143
|
+
slide_ids.include?(slide.slide_id)
|
|
144
|
+
end
|
|
127
145
|
|
|
128
|
-
def inspect
|
|
146
|
+
def inspect
|
|
147
|
+
"#<Pptx::Section #{name.inspect} slides=#{slide_ids.size}>"
|
|
148
|
+
end
|
|
129
149
|
end
|
|
130
150
|
end
|
|
@@ -21,7 +21,9 @@ module Pptx
|
|
|
21
21
|
SCALE = 100_000.0
|
|
22
22
|
|
|
23
23
|
Adjustment = Struct.new(:name, :default, :actual) do
|
|
24
|
-
def raw
|
|
24
|
+
def raw
|
|
25
|
+
actual || default
|
|
26
|
+
end
|
|
25
27
|
end
|
|
26
28
|
|
|
27
29
|
# @param preset_geometry [Pptx::Oxml::Element, nil] the shape's
|
|
@@ -57,10 +59,14 @@ module Pptx
|
|
|
57
59
|
self
|
|
58
60
|
end
|
|
59
61
|
|
|
60
|
-
def size
|
|
62
|
+
def size
|
|
63
|
+
@adjustments.size
|
|
64
|
+
end
|
|
61
65
|
alias length size
|
|
62
66
|
|
|
63
|
-
def inspect
|
|
67
|
+
def inspect
|
|
68
|
+
"#<Pptx::Adjustments #{to_a.inspect}>"
|
|
69
|
+
end
|
|
64
70
|
|
|
65
71
|
private
|
|
66
72
|
|
|
@@ -24,64 +24,90 @@ module Pptx
|
|
|
24
24
|
@parent = parent
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
-
def ==(other)
|
|
27
|
+
def ==(other)
|
|
28
|
+
other.is_a?(BaseShape) && other.element == @element
|
|
29
|
+
end
|
|
28
30
|
alias eql? ==
|
|
29
31
|
|
|
30
|
-
def hash
|
|
32
|
+
def hash
|
|
33
|
+
@element.hash
|
|
34
|
+
end
|
|
31
35
|
|
|
32
36
|
# The package part containing this shape.
|
|
33
|
-
def part
|
|
37
|
+
def part
|
|
38
|
+
@parent.part
|
|
39
|
+
end
|
|
34
40
|
|
|
35
41
|
# The drawing-object id, unique within the slide.
|
|
36
|
-
def shape_id
|
|
42
|
+
def shape_id
|
|
43
|
+
@element.shape_id
|
|
44
|
+
end
|
|
37
45
|
|
|
38
|
-
def name
|
|
46
|
+
def name
|
|
47
|
+
@element.shape_name
|
|
48
|
+
end
|
|
39
49
|
|
|
40
50
|
def name=(value)
|
|
41
51
|
@element.nvXxPr.cNvPr.name = value.to_s
|
|
42
52
|
end
|
|
43
53
|
|
|
44
54
|
# @return [Length, nil] nil when the shape inherits its position
|
|
45
|
-
def left
|
|
55
|
+
def left
|
|
56
|
+
@element.x
|
|
57
|
+
end
|
|
46
58
|
|
|
47
59
|
def left=(value)
|
|
48
60
|
@element.x = value
|
|
49
61
|
end
|
|
50
62
|
|
|
51
|
-
def top
|
|
63
|
+
def top
|
|
64
|
+
@element.y
|
|
65
|
+
end
|
|
52
66
|
|
|
53
67
|
def top=(value)
|
|
54
68
|
@element.y = value
|
|
55
69
|
end
|
|
56
70
|
|
|
57
|
-
def width
|
|
71
|
+
def width
|
|
72
|
+
@element.cx
|
|
73
|
+
end
|
|
58
74
|
|
|
59
75
|
def width=(value)
|
|
60
76
|
@element.cx = value
|
|
61
77
|
end
|
|
62
78
|
|
|
63
|
-
def height
|
|
79
|
+
def height
|
|
80
|
+
@element.cy
|
|
81
|
+
end
|
|
64
82
|
|
|
65
83
|
def height=(value)
|
|
66
84
|
@element.cy = value
|
|
67
85
|
end
|
|
68
86
|
|
|
69
87
|
# Clockwise rotation in degrees.
|
|
70
|
-
def rotation
|
|
88
|
+
def rotation
|
|
89
|
+
@element.rot
|
|
90
|
+
end
|
|
71
91
|
|
|
72
92
|
def rotation=(value)
|
|
73
93
|
@element.rot = value
|
|
74
94
|
end
|
|
75
95
|
|
|
76
|
-
def placeholder?
|
|
96
|
+
def placeholder?
|
|
97
|
+
@element.placeholder?
|
|
98
|
+
end
|
|
77
99
|
|
|
78
100
|
# This shape's shadow. Always returned, even when the shadow is inherited.
|
|
79
101
|
#
|
|
80
102
|
# @return [ShadowFormat]
|
|
81
|
-
def shadow
|
|
103
|
+
def shadow
|
|
104
|
+
@shadow ||= ShadowFormat.new(@element.spPr)
|
|
105
|
+
end
|
|
82
106
|
|
|
83
107
|
# What happens when this shape is clicked during a slide show.
|
|
84
|
-
def click_action
|
|
108
|
+
def click_action
|
|
109
|
+
@click_action ||= ActionSetting.new(@element.nvXxPr.cNvPr, self)
|
|
110
|
+
end
|
|
85
111
|
|
|
86
112
|
# What happens when the pointer rests on this shape.
|
|
87
113
|
def hover_action
|
|
@@ -93,7 +119,9 @@ module Pptx
|
|
|
93
119
|
# A shortcut for `click_action.url`, which is the common case; reach for
|
|
94
120
|
# {#click_action} when the click does something else. Nil when the click
|
|
95
121
|
# is not a hyperlink -- a slide jump reports nil here, not a partname.
|
|
96
|
-
def hyperlink
|
|
122
|
+
def hyperlink
|
|
123
|
+
click_action.url
|
|
124
|
+
end
|
|
97
125
|
|
|
98
126
|
def hyperlink=(url)
|
|
99
127
|
click_action.address = url
|
|
@@ -105,14 +133,26 @@ module Pptx
|
|
|
105
133
|
end
|
|
106
134
|
|
|
107
135
|
# Overridden by the subclasses that can actually hold these.
|
|
108
|
-
def text_frame?
|
|
109
|
-
|
|
110
|
-
|
|
136
|
+
def text_frame?
|
|
137
|
+
false
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
def chart?
|
|
141
|
+
false
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
def table?
|
|
145
|
+
false
|
|
146
|
+
end
|
|
111
147
|
|
|
112
148
|
# @return [Pptx::Enum::MSO_SHAPE_TYPE]
|
|
113
|
-
def shape_type
|
|
149
|
+
def shape_type
|
|
150
|
+
raise(NotImplementedError, "#{self.class} must implement #shape_type")
|
|
151
|
+
end
|
|
114
152
|
|
|
115
|
-
def inspect
|
|
153
|
+
def inspect
|
|
154
|
+
"#<#{self.class.name} id=#{shape_id} #{name.inspect}>"
|
|
155
|
+
end
|
|
116
156
|
end
|
|
117
157
|
|
|
118
158
|
# The placeholder-specific properties of a shape: which placeholder it is
|
|
@@ -124,15 +164,25 @@ module Pptx
|
|
|
124
164
|
|
|
125
165
|
# The `idx` that ties a slide placeholder to the layout one it inherits
|
|
126
166
|
# from. The title placeholder is always 0.
|
|
127
|
-
def idx
|
|
167
|
+
def idx
|
|
168
|
+
@element.idx
|
|
169
|
+
end
|
|
128
170
|
|
|
129
171
|
# @return [Pptx::Enum::PP_PLACEHOLDER]
|
|
130
|
-
def type
|
|
172
|
+
def type
|
|
173
|
+
@element.type
|
|
174
|
+
end
|
|
131
175
|
|
|
132
|
-
def orientation
|
|
176
|
+
def orientation
|
|
177
|
+
@element.orient
|
|
178
|
+
end
|
|
133
179
|
|
|
134
|
-
def size
|
|
180
|
+
def size
|
|
181
|
+
@element.sz
|
|
182
|
+
end
|
|
135
183
|
|
|
136
|
-
def inspect
|
|
184
|
+
def inspect
|
|
185
|
+
"#<Pptx::PlaceholderFormat idx=#{idx} type=#{type}>"
|
|
186
|
+
end
|
|
137
187
|
end
|
|
138
188
|
end
|
|
@@ -36,9 +36,13 @@ module Pptx
|
|
|
36
36
|
new(shapes, start_x, start_y, x_scale, y_scale)
|
|
37
37
|
end
|
|
38
38
|
|
|
39
|
-
def each(&)
|
|
39
|
+
def each(&)
|
|
40
|
+
@operations.each(&)
|
|
41
|
+
end
|
|
40
42
|
|
|
41
|
-
def size
|
|
43
|
+
def size
|
|
44
|
+
@operations.size
|
|
45
|
+
end
|
|
42
46
|
|
|
43
47
|
# Draw a straight line to (x, y).
|
|
44
48
|
#
|
|
@@ -89,11 +93,17 @@ module Pptx
|
|
|
89
93
|
#
|
|
90
94
|
# The bounding box need not start at the local origin, so this is what the
|
|
91
95
|
# points are measured from.
|
|
92
|
-
def offset_x
|
|
96
|
+
def offset_x
|
|
97
|
+
drawn.map(&:x).push(@start_x).min
|
|
98
|
+
end
|
|
93
99
|
|
|
94
|
-
def offset_y
|
|
100
|
+
def offset_y
|
|
101
|
+
drawn.map(&:y).push(@start_y).min
|
|
102
|
+
end
|
|
95
103
|
|
|
96
|
-
def inspect
|
|
104
|
+
def inspect
|
|
105
|
+
"#<Pptx::FreeformBuilder #{size} operations>"
|
|
106
|
+
end
|
|
97
107
|
|
|
98
108
|
private
|
|
99
109
|
|
|
@@ -103,10 +113,14 @@ module Pptx
|
|
|
103
113
|
# Rounded half-to-even, because Python rounds that way and Ruby rounds
|
|
104
114
|
# half-up: a coordinate of 100.5 would otherwise land a unit away from
|
|
105
115
|
# where the reference implementation puts it.
|
|
106
|
-
def round(value)
|
|
116
|
+
def round(value)
|
|
117
|
+
value.round(half: :even)
|
|
118
|
+
end
|
|
107
119
|
|
|
108
120
|
# Operations that have a position; a close does not.
|
|
109
|
-
def drawn
|
|
121
|
+
def drawn
|
|
122
|
+
@operations.reject { |operation| operation.kind == :close }
|
|
123
|
+
end
|
|
110
124
|
|
|
111
125
|
def local_width
|
|
112
126
|
xs = drawn.map(&:x).push(@start_x)
|
|
@@ -118,17 +132,27 @@ module Pptx
|
|
|
118
132
|
ys.max - ys.min
|
|
119
133
|
end
|
|
120
134
|
|
|
121
|
-
def width
|
|
135
|
+
def width
|
|
136
|
+
(local_width * @x_scale).round
|
|
137
|
+
end
|
|
122
138
|
|
|
123
|
-
def height
|
|
139
|
+
def height
|
|
140
|
+
(local_height * @y_scale).round
|
|
141
|
+
end
|
|
124
142
|
|
|
125
|
-
def left
|
|
143
|
+
def left
|
|
144
|
+
(offset_x * @x_scale).round
|
|
145
|
+
end
|
|
126
146
|
|
|
127
|
-
def top
|
|
147
|
+
def top
|
|
148
|
+
(offset_y * @y_scale).round
|
|
149
|
+
end
|
|
128
150
|
|
|
129
151
|
# Points inside a path are relative to the shape's top-left corner, not to
|
|
130
152
|
# the local origin.
|
|
131
|
-
def to_shape_space(x, y)
|
|
153
|
+
def to_shape_space(x, y)
|
|
154
|
+
[x - offset_x, y - offset_y]
|
|
155
|
+
end
|
|
132
156
|
|
|
133
157
|
def apply(operation, path)
|
|
134
158
|
case operation.kind
|
|
@@ -13,13 +13,26 @@ module Pptx
|
|
|
13
13
|
# Writing is not inherited -- setting a value applies it to this shape, which
|
|
14
14
|
# is what stops it tracking the layout from then on.
|
|
15
15
|
module InheritsDimensions
|
|
16
|
-
def left
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
def left
|
|
17
|
+
effective(:left)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def top
|
|
21
|
+
effective(:top)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def width
|
|
25
|
+
effective(:width)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def height
|
|
29
|
+
effective(:height)
|
|
30
|
+
end
|
|
20
31
|
|
|
21
32
|
# The placeholder one level up that this one inherits from, or nil.
|
|
22
|
-
def base_placeholder
|
|
33
|
+
def base_placeholder
|
|
34
|
+
raise(NotImplementedError, "#{self.class} must define base_placeholder")
|
|
35
|
+
end
|
|
23
36
|
|
|
24
37
|
private
|
|
25
38
|
|
|
@@ -42,7 +55,9 @@ module Pptx
|
|
|
42
55
|
class SlidePlaceholder < Shape
|
|
43
56
|
include InheritsDimensions
|
|
44
57
|
|
|
45
|
-
def shape_type
|
|
58
|
+
def shape_type
|
|
59
|
+
Enum::MSO_SHAPE_TYPE::PLACEHOLDER
|
|
60
|
+
end
|
|
46
61
|
|
|
47
62
|
# Matched to the layout by `idx`, which is what ties the two together.
|
|
48
63
|
def base_placeholder
|
|
@@ -63,9 +78,9 @@ module Pptx
|
|
|
63
78
|
# Put +new_element+ where this placeholder is and move the `p:ph` onto
|
|
64
79
|
# it. The original element leaves the tree; this object is spent.
|
|
65
80
|
def replace_placeholder_with(new_element)
|
|
66
|
-
adopted = @element.
|
|
81
|
+
adopted = @element.import(new_element)
|
|
67
82
|
adopted.nvXxPr.nvPr.insert_ph(@element.ph)
|
|
68
|
-
@element.
|
|
83
|
+
@element.add_previous_sibling(adopted)
|
|
69
84
|
@element.parent.remove(@element)
|
|
70
85
|
ShapeFactory.build_for_slide(adopted, @parent)
|
|
71
86
|
end
|
|
@@ -129,14 +144,20 @@ module Pptx
|
|
|
129
144
|
class PlaceholderPicture < Picture
|
|
130
145
|
include InheritsDimensions
|
|
131
146
|
|
|
132
|
-
def shape_type
|
|
147
|
+
def shape_type
|
|
148
|
+
Enum::MSO_SHAPE_TYPE::PLACEHOLDER
|
|
149
|
+
end
|
|
133
150
|
|
|
134
|
-
def base_placeholder
|
|
151
|
+
def base_placeholder
|
|
152
|
+
part.slide_layout.placeholders.by_idx(element.ph_idx)
|
|
153
|
+
end
|
|
135
154
|
end
|
|
136
155
|
|
|
137
156
|
# A table or chart that fills a placeholder.
|
|
138
157
|
class PlaceholderGraphicFrame < GraphicFrame
|
|
139
|
-
def placeholder?
|
|
158
|
+
def placeholder?
|
|
159
|
+
true
|
|
160
|
+
end
|
|
140
161
|
end
|
|
141
162
|
|
|
142
163
|
# A placeholder on a slide layout.
|
|
@@ -153,7 +174,9 @@ module Pptx
|
|
|
153
174
|
DATE: :DATE, FOOTER: :FOOTER, SLIDE_NUMBER: :SLIDE_NUMBER
|
|
154
175
|
}.freeze
|
|
155
176
|
|
|
156
|
-
def shape_type
|
|
177
|
+
def shape_type
|
|
178
|
+
Enum::MSO_SHAPE_TYPE::PLACEHOLDER
|
|
179
|
+
end
|
|
157
180
|
|
|
158
181
|
def base_placeholder
|
|
159
182
|
base_type = BASE_TYPES[element.ph_type&.name]
|
|
@@ -169,9 +192,13 @@ module Pptx
|
|
|
169
192
|
class NotesSlidePlaceholder < Shape
|
|
170
193
|
include InheritsDimensions
|
|
171
194
|
|
|
172
|
-
def shape_type
|
|
195
|
+
def shape_type
|
|
196
|
+
Enum::MSO_SHAPE_TYPE::PLACEHOLDER
|
|
197
|
+
end
|
|
173
198
|
|
|
174
|
-
def base_placeholder
|
|
199
|
+
def base_placeholder
|
|
200
|
+
part.notes_master.placeholders.by_type(element.ph_type)
|
|
201
|
+
end
|
|
175
202
|
end
|
|
176
203
|
|
|
177
204
|
# A placeholder on a slide master.
|
|
@@ -179,6 +206,8 @@ module Pptx
|
|
|
179
206
|
# There is nothing above a master to inherit from, so its geometry is
|
|
180
207
|
# whatever it carries itself.
|
|
181
208
|
class MasterPlaceholder < Shape
|
|
182
|
-
def shape_type
|
|
209
|
+
def shape_type
|
|
210
|
+
Enum::MSO_SHAPE_TYPE::PLACEHOLDER
|
|
211
|
+
end
|
|
183
212
|
end
|
|
184
213
|
end
|