openxml-docx 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/examples/drawing-ml +1 -1
- data/examples/image-embedding +141 -0
- data/examples/ochanomizu.jpg +0 -0
- data/lib/openxml/docx.rb +8 -0
- data/lib/openxml/docx/attribute_builder.rb +11 -1
- data/lib/openxml/docx/elements/book_fold_printing.rb +12 -0
- data/lib/openxml/docx/elements/book_fold_printing_sheets.rb +12 -0
- data/lib/openxml/docx/elements/book_fold_reverse_printing.rb +12 -0
- data/lib/openxml/docx/elements/drawing.rb +1 -1
- data/lib/openxml/docx/elements/embed_system_fonts.rb +14 -0
- data/lib/openxml/docx/elements/embed_true_type_fonts.rb +14 -0
- data/lib/openxml/docx/elements/font_alternate_name.rb +15 -0
- data/lib/openxml/docx/elements/font_character_set.rb +15 -0
- data/lib/openxml/docx/elements/font_panose_one.rb +15 -0
- data/lib/openxml/docx/elements/font_pitch.rb +15 -0
- data/lib/openxml/docx/elements/font_sig.rb +20 -0
- data/lib/openxml/docx/elements/save_subset_fonts.rb +14 -0
- data/lib/openxml/docx/elements/word_processing_drawing_anchor.rb +13 -11
- data/lib/openxml/docx/elements/word_processing_drawing_object_nv_properties.rb +1 -1
- data/lib/openxml/docx/elements/word_processing_drawing_position_h.rb +1 -11
- data/lib/openxml/docx/elements/word_processing_drawing_position_offset.rb +18 -1
- data/lib/openxml/docx/elements/word_processing_drawing_position_v.rb +1 -11
- data/lib/openxml/docx/elements/word_processing_drawing_wrap_coordinate.rb +26 -0
- data/lib/openxml/docx/elements/word_processing_drawing_wrap_polygon.rb +13 -0
- data/lib/openxml/docx/elements/word_processing_drawing_wrap_square.rb +17 -0
- data/lib/openxml/docx/elements/word_processing_drawing_wrap_through.rb +15 -0
- data/lib/openxml/docx/elements/word_processing_drawing_wrap_tight.rb +15 -0
- data/lib/openxml/docx/elements/word_processing_drawing_wrap_top_and_bottom.rb +14 -0
- data/lib/openxml/docx/elements/word_processing_groups_group_shape_properties.rb +13 -0
- data/lib/openxml/docx/elements/word_processing_groups_nv_shape_drawing_properties.rb +11 -0
- data/lib/openxml/docx/elements/word_processing_shapes_nv_drawing_properties.rb +17 -0
- data/lib/openxml/docx/package.rb +39 -13
- data/lib/openxml/docx/parts/document.rb +3 -2
- data/lib/openxml/docx/parts/fonts.rb +2 -1
- data/lib/openxml/docx/parts/footer.rb +2 -1
- data/lib/openxml/docx/parts/header.rb +2 -1
- data/lib/openxml/docx/parts/settings.rb +5 -0
- data/lib/openxml/docx/properties/tabs.rb +2 -0
- data/lib/openxml/docx/root_namespaces.rb +1 -1
- data/lib/openxml/docx/version.rb +1 -1
- data/lib/openxml/drawingml/elements/blip.rb +18 -0
- data/lib/openxml/drawingml/elements/blip_fill.rb +1 -1
- data/lib/openxml/drawingml/elements/fill_rectangle.rb +16 -0
- data/lib/openxml/drawingml/elements/graphic_frame_locks.rb +6 -6
- data/lib/openxml/drawingml/elements/non_visual_drawing_properties.rb +1 -1
- data/lib/openxml/drawingml/elements/picture_locks.rb +23 -0
- data/lib/openxml/drawingml/elements/picture_shape_properties.rb +13 -0
- data/lib/openxml/drawingml/elements/source_rectangle.rb +16 -0
- data/lib/openxml/drawingml/elements/stretch.rb +10 -0
- data/spec/elements/book_fold_printing_sheets_spec.rb +27 -0
- data/spec/elements/book_fold_printing_spec.rb +19 -0
- data/spec/elements/book_fold_reverse_printing_spec.rb +19 -0
- data/spec/elements/drawingml/blip_fill_spec.rb +8 -3
- data/spec/elements/drawingml/blip_spec.rb +47 -0
- data/spec/elements/drawingml/fill_rectangle_spec.rb +76 -0
- data/spec/elements/drawingml/graphic_frame_locks_spec.rb +47 -18
- data/spec/elements/drawingml/non_visual_drawing_properties_spec.rb +8 -3
- data/spec/elements/drawingml/non_visual_picture_drawing_properties_spec.rb +7 -2
- data/spec/elements/drawingml/picture_locks_spec.rb +122 -0
- data/spec/elements/drawingml/picture_shape_properties_spec.rb +21 -0
- data/spec/elements/drawingml/source_rectangle_spec.rb +76 -0
- data/spec/elements/drawingml/stretch_spec.rb +8 -0
- data/spec/elements/embed_system_fonts_spec.rb +19 -0
- data/spec/elements/embed_true_type_fonts_spec.rb +19 -0
- data/spec/elements/font_alternate_name_spec.rb +19 -0
- data/spec/elements/font_character_set_spec.rb +19 -0
- data/spec/elements/font_panose_one_spec.rb +19 -0
- data/spec/elements/font_pitch_spec.rb +21 -0
- data/spec/elements/font_sig_spec.rb +74 -0
- data/spec/elements/save_subset_fonts_spec.rb +19 -0
- data/spec/elements/word_processing_drawing_anchor_spec.rb +107 -25
- data/spec/elements/word_processing_drawing_object_nv_properties_spec.rb +1 -1
- data/spec/elements/word_processing_drawing_position_h_spec.rb +6 -5
- data/spec/elements/word_processing_drawing_position_v_spec.rb +6 -5
- data/spec/elements/word_processing_drawing_wrap_coordinate_spec.rb +40 -0
- data/spec/elements/word_processing_drawing_wrap_polygon_spec.rb +23 -0
- data/spec/elements/word_processing_drawing_wrap_square_spec.rb +65 -0
- data/spec/elements/word_processing_drawing_wrap_through_spec.rb +43 -0
- data/spec/elements/word_processing_drawing_wrap_tight_spec.rb +43 -0
- data/spec/elements/word_processing_drawing_wrap_top_and_bottom_spec.rb +30 -0
- data/spec/elements/word_processing_groups_group_shape_properties_spec.rb +21 -0
- data/spec/elements/word_processing_groups_nv_shape_drawing_properties_spec.rb +8 -0
- data/spec/elements/word_processing_shapes_nv_drawing_properties_spec.rb +64 -0
- data/spec/package_spec.rb +2 -2
- data/spec/parts/settings_spec.rb +6 -0
- data/spec/properties/table_border_spec.rb +2 -2
- data/spec/properties/table_cell_border_spec.rb +2 -2
- data/spec/style_spec.rb +2 -2
- data/spec/support/data/parts/document_with_children_part.xml +1 -1
- data/spec/support/data/parts/document_with_multiple_sections_part.xml +1 -1
- data/spec/support/data/parts/document_with_one_section_part.xml +1 -1
- data/spec/support/data/parts/empty_document_part.xml +1 -1
- data/spec/support/data/parts/settings_part.xml +1 -1
- data/spec/support/property_test_macros.rb +1 -1
- metadata +56 -2
@@ -0,0 +1,18 @@
|
|
1
|
+
module OpenXml
|
2
|
+
module DrawingML
|
3
|
+
module Elements
|
4
|
+
class Blip < OpenXml::Docx::Elements::Container
|
5
|
+
namespace :a
|
6
|
+
tag :blip
|
7
|
+
|
8
|
+
attribute :compression_state, one_of: %i(email hqprint none print screen), displays_as: :cstate
|
9
|
+
|
10
|
+
with_namespace :r do
|
11
|
+
attribute :embed, expects: :string
|
12
|
+
attribute :link, expects: :string
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module OpenXml
|
2
|
+
module DrawingML
|
3
|
+
module Elements
|
4
|
+
class FillRectangle < OpenXml::Docx::Elements::Element
|
5
|
+
namespace :a
|
6
|
+
tag :fillRect
|
7
|
+
|
8
|
+
attribute :bottom_offset, expects: :percentage, displays_as: :b
|
9
|
+
attribute :left_offset, expects: :percentage, displays_as: :l
|
10
|
+
attribute :right_offset, expects: :percentage, displays_as: :r
|
11
|
+
attribute :top_offset, expects: :percentage, displays_as: :t
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -4,12 +4,12 @@ module OpenXml
|
|
4
4
|
class GraphicFrameLocks < OpenXml::Docx::Elements::Element
|
5
5
|
namespace :a
|
6
6
|
|
7
|
-
attribute :
|
8
|
-
attribute :
|
9
|
-
attribute :
|
10
|
-
attribute :
|
11
|
-
attribute :
|
12
|
-
attribute :
|
7
|
+
attribute :disallow_aspect_ratio_changes, expects: :true_or_false, displays_as: :noChangeAspect
|
8
|
+
attribute :disallow_drilldown, expects: :true_or_false, displays_as: :noDrilldown
|
9
|
+
attribute :disallow_grouping, expects: :true_or_false, displays_as: :noGrp
|
10
|
+
attribute :disallow_moving, expects: :true_or_false, displays_as: :noMove
|
11
|
+
attribute :disallow_resizing, expects: :true_or_false, displays_as: :noResize
|
12
|
+
attribute :disallow_selection, expects: :true_or_false, displays_as: :noSelect
|
13
13
|
|
14
14
|
end
|
15
15
|
end
|
@@ -5,7 +5,7 @@ module OpenXml
|
|
5
5
|
namespace :pic
|
6
6
|
tag :cNvPr
|
7
7
|
|
8
|
-
attribute :
|
8
|
+
attribute :description, expects: :string, displays_as: :descr
|
9
9
|
attribute :hidden, expects: :true_or_false
|
10
10
|
attribute :id, expects: :positive_integer
|
11
11
|
attribute :picture_name, expects: :string, displays_as: :name
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module OpenXml
|
2
|
+
module DrawingML
|
3
|
+
module Elements
|
4
|
+
class PictureLocks < OpenXml::Docx::Elements::Element
|
5
|
+
namespace :a
|
6
|
+
tag :picLocks
|
7
|
+
|
8
|
+
attribute :hide_adjust_handles, expects: :true_or_false, displays_as: :noAdjustHandles
|
9
|
+
attribute :disallow_arrowhead_changes, expects: :true_or_false, displays_as: :noChangeArrowheads
|
10
|
+
attribute :disallow_aspect_ratio_changes, expects: :true_or_false, displays_as: :noChangeAspect
|
11
|
+
attribute :disallow_shape_type_changes, expects: :true_or_false, displays_as: :noChangeShapeType
|
12
|
+
attribute :disallow_cropping, expects: :true_or_false, displays_as: :noCrop
|
13
|
+
attribute :disallow_editing_points, expects: :true_or_false, displays_as: :noEditPoints
|
14
|
+
attribute :disallow_grouping, expects: :true_or_false, displays_as: :noGrp
|
15
|
+
attribute :disallow_moving, expects: :true_or_false, displays_as: :noMove
|
16
|
+
attribute :disallow_resizing, expects: :true_or_false, displays_as: :noResize
|
17
|
+
attribute :disallow_rotation, expects: :true_or_false, displays_as: :noRot
|
18
|
+
attribute :disallow_selection, expects: :true_or_false, displays_as: :noSelect
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module OpenXml
|
2
|
+
module DrawingML
|
3
|
+
module Elements
|
4
|
+
class PictureShapeProperties < OpenXml::Docx::Elements::Container
|
5
|
+
namespace :pic
|
6
|
+
tag :spPr
|
7
|
+
|
8
|
+
attribute :black_and_white_mode, one_of: %i(auto black blackGray blackWhite clr gray grayWhite hidden invGray ltGray white), displays_as: :bwMode
|
9
|
+
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module OpenXml
|
2
|
+
module DrawingML
|
3
|
+
module Elements
|
4
|
+
class SourceRectangle < OpenXml::Docx::Elements::Element
|
5
|
+
namespace :a
|
6
|
+
tag :srcRect
|
7
|
+
|
8
|
+
attribute :bottom_offset, expects: :percentage, displays_as: :b
|
9
|
+
attribute :left_offset, expects: :percentage, displays_as: :l
|
10
|
+
attribute :right_offset, expects: :percentage, displays_as: :r
|
11
|
+
attribute :top_offset, expects: :percentage, displays_as: :t
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe OpenXml::Docx::Elements::BookFoldPrintingSheets do
|
4
|
+
include ElementTestMacros
|
5
|
+
|
6
|
+
it_should_use tag: :bookFoldPrintingSheets, name: "book_fold_printing_sheets"
|
7
|
+
|
8
|
+
for_attribute(:value) do
|
9
|
+
with_value(1) do
|
10
|
+
it_should_assign_successfully
|
11
|
+
it_should_output "<w:bookFoldPrintingSheets w:val=\"1\"/>"
|
12
|
+
end
|
13
|
+
|
14
|
+
with_value(-1) do
|
15
|
+
it_should_raise_an_exception
|
16
|
+
end
|
17
|
+
|
18
|
+
with_value(1.1) do
|
19
|
+
it_should_raise_an_exception
|
20
|
+
end
|
21
|
+
|
22
|
+
with_value(:not_a_number) do
|
23
|
+
it_should_raise_an_exception
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe OpenXml::Docx::Elements::BookFoldPrinting do
|
4
|
+
include ElementTestMacros
|
5
|
+
|
6
|
+
it_should_use tag: :bookFoldPrinting, name: "book_fold_printing"
|
7
|
+
|
8
|
+
for_attribute(:value) do
|
9
|
+
with_value(true) do
|
10
|
+
it_should_assign_successfully
|
11
|
+
it_should_output "<w:bookFoldPrinting w:val=\"true\"/>"
|
12
|
+
end
|
13
|
+
|
14
|
+
with_value("true") do
|
15
|
+
it_should_raise_an_exception
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe OpenXml::Docx::Elements::BookFoldReversePrinting do
|
4
|
+
include ElementTestMacros
|
5
|
+
|
6
|
+
it_should_use tag: :bookFoldRevPrinting, name: "book_fold_reverse_printing"
|
7
|
+
|
8
|
+
for_attribute(:value) do
|
9
|
+
with_value(true) do
|
10
|
+
it_should_assign_successfully
|
11
|
+
it_should_output "<w:bookFoldRevPrinting w:val=\"true\"/>"
|
12
|
+
end
|
13
|
+
|
14
|
+
with_value("true") do
|
15
|
+
it_should_raise_an_exception
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
@@ -16,10 +16,15 @@ describe OpenXml::DrawingML::Elements::BlipFill do
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
-
for_attribute(:
|
20
|
-
|
19
|
+
for_attribute(:rotate_with_shape) do
|
20
|
+
with_value(true) do
|
21
21
|
it_should_assign_successfully
|
22
|
-
|
22
|
+
it_should_output "<pic:blipFill rotWithShape=\"true\"/>"
|
23
|
+
end
|
24
|
+
|
25
|
+
with_value(false) do
|
26
|
+
it_should_assign_successfully
|
27
|
+
it_should_output "<pic:blipFill rotWithShape=\"false\"/>"
|
23
28
|
end
|
24
29
|
|
25
30
|
with_value(:not_a_boolean) do
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe OpenXml::DrawingML::Elements::Blip do
|
4
|
+
include ElementTestMacros
|
5
|
+
|
6
|
+
it_should_use tag: :blip, name: "blip"
|
7
|
+
|
8
|
+
for_attribute(:compression_state) do
|
9
|
+
%i(email hqprint none print screen).each do |good_value|
|
10
|
+
with_value(good_value) do
|
11
|
+
it_should_assign_successfully
|
12
|
+
it_should_output "<a:blip cstate=\"#{good_value}\"/>"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
with_value(:no_good) do
|
17
|
+
it_should_raise_an_exception
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
for_attribute(:embed) do
|
22
|
+
with_value("StringRelId") do
|
23
|
+
it_should_assign_successfully
|
24
|
+
it_should_output "<a:blip r:embed=\"StringRelId\"/>"
|
25
|
+
end
|
26
|
+
|
27
|
+
with_value(:not_a_string) do
|
28
|
+
it_should_raise_an_exception
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
for_attribute(:link) do
|
33
|
+
with_value("ExternalStringRelId") do
|
34
|
+
it_should_assign_successfully
|
35
|
+
it_should_output "<a:blip r:link=\"ExternalStringRelId\"/>"
|
36
|
+
end
|
37
|
+
|
38
|
+
with_value(:not_a_string) do
|
39
|
+
it_should_raise_an_exception
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
with_no_attributes_set do
|
44
|
+
it_should_output "<a:blip/>", assign: false
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe OpenXml::DrawingML::Elements::FillRectangle do
|
4
|
+
include ElementTestMacros
|
5
|
+
|
6
|
+
it_should_use tag: :fillRect, name: "fill_rectangle"
|
7
|
+
|
8
|
+
for_attribute(:bottom_offset) do
|
9
|
+
with_value("10%") do
|
10
|
+
it_should_assign_successfully
|
11
|
+
it_should_output "<a:fillRect b=\"10%\"/>"
|
12
|
+
end
|
13
|
+
|
14
|
+
with_value("10.1%") do
|
15
|
+
it_should_assign_successfully
|
16
|
+
it_should_output "<a:fillRect b=\"10.1%\"/>"
|
17
|
+
end
|
18
|
+
|
19
|
+
with_values(["10", 10, "%"]) do
|
20
|
+
it_should_raise_an_exception
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
for_attribute(:left_offset) do
|
25
|
+
with_value("10%") do
|
26
|
+
it_should_assign_successfully
|
27
|
+
it_should_output "<a:fillRect l=\"10%\"/>"
|
28
|
+
end
|
29
|
+
|
30
|
+
with_value("10.1%") do
|
31
|
+
it_should_assign_successfully
|
32
|
+
it_should_output "<a:fillRect l=\"10.1%\"/>"
|
33
|
+
end
|
34
|
+
|
35
|
+
with_values(["10", 10, "%"]) do
|
36
|
+
it_should_raise_an_exception
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
for_attribute(:right_offset) do
|
41
|
+
with_value("10%") do
|
42
|
+
it_should_assign_successfully
|
43
|
+
it_should_output "<a:fillRect r=\"10%\"/>"
|
44
|
+
end
|
45
|
+
|
46
|
+
with_value("10.1%") do
|
47
|
+
it_should_assign_successfully
|
48
|
+
it_should_output "<a:fillRect r=\"10.1%\"/>"
|
49
|
+
end
|
50
|
+
|
51
|
+
with_values(["10", 10, "%"]) do
|
52
|
+
it_should_raise_an_exception
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
for_attribute(:top_offset) do
|
57
|
+
with_value("10%") do
|
58
|
+
it_should_assign_successfully
|
59
|
+
it_should_output "<a:fillRect t=\"10%\"/>"
|
60
|
+
end
|
61
|
+
|
62
|
+
with_value("10.1%") do
|
63
|
+
it_should_assign_successfully
|
64
|
+
it_should_output "<a:fillRect t=\"10.1%\"/>"
|
65
|
+
end
|
66
|
+
|
67
|
+
with_values(["10", 10, "%"]) do
|
68
|
+
it_should_raise_an_exception
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
with_no_attributes_set do
|
73
|
+
it_should_output "<a:fillRect/>", assign: false
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
@@ -5,10 +5,15 @@ describe OpenXml::DrawingML::Elements::GraphicFrameLocks do
|
|
5
5
|
|
6
6
|
it_should_use tag: :graphicFrameLocks, name: "graphic_frame_locks"
|
7
7
|
|
8
|
-
for_attribute(:
|
9
|
-
|
8
|
+
for_attribute(:disallow_aspect_ratio_changes) do
|
9
|
+
with_value(true) do
|
10
10
|
it_should_assign_successfully
|
11
|
-
|
11
|
+
it_should_output "<a:graphicFrameLocks noChangeAspect=\"true\"/>"
|
12
|
+
end
|
13
|
+
|
14
|
+
with_value(false) do
|
15
|
+
it_should_assign_successfully
|
16
|
+
it_should_output "<a:graphicFrameLocks noChangeAspect=\"false\"/>"
|
12
17
|
end
|
13
18
|
|
14
19
|
with_value(:neither) do
|
@@ -16,10 +21,15 @@ describe OpenXml::DrawingML::Elements::GraphicFrameLocks do
|
|
16
21
|
end
|
17
22
|
end
|
18
23
|
|
19
|
-
for_attribute(:
|
20
|
-
|
24
|
+
for_attribute(:disallow_drilldown) do
|
25
|
+
with_value(true) do
|
21
26
|
it_should_assign_successfully
|
22
|
-
|
27
|
+
it_should_output "<a:graphicFrameLocks noDrilldown=\"true\"/>"
|
28
|
+
end
|
29
|
+
|
30
|
+
with_value(false) do
|
31
|
+
it_should_assign_successfully
|
32
|
+
it_should_output "<a:graphicFrameLocks noDrilldown=\"false\"/>"
|
23
33
|
end
|
24
34
|
|
25
35
|
with_value(:neither) do
|
@@ -27,10 +37,15 @@ describe OpenXml::DrawingML::Elements::GraphicFrameLocks do
|
|
27
37
|
end
|
28
38
|
end
|
29
39
|
|
30
|
-
for_attribute(:
|
31
|
-
|
40
|
+
for_attribute(:disallow_grouping) do
|
41
|
+
with_value(true) do
|
42
|
+
it_should_assign_successfully
|
43
|
+
it_should_output "<a:graphicFrameLocks noGrp=\"true\"/>"
|
44
|
+
end
|
45
|
+
|
46
|
+
with_value(false) do
|
32
47
|
it_should_assign_successfully
|
33
|
-
|
48
|
+
it_should_output "<a:graphicFrameLocks noGrp=\"false\"/>"
|
34
49
|
end
|
35
50
|
|
36
51
|
with_value(:neither) do
|
@@ -38,21 +53,30 @@ describe OpenXml::DrawingML::Elements::GraphicFrameLocks do
|
|
38
53
|
end
|
39
54
|
end
|
40
55
|
|
41
|
-
for_attribute(:
|
42
|
-
|
56
|
+
for_attribute(:disallow_moving) do
|
57
|
+
with_value(true) do
|
43
58
|
it_should_assign_successfully
|
44
|
-
|
59
|
+
it_should_output "<a:graphicFrameLocks noMove=\"true\"/>"
|
45
60
|
end
|
46
61
|
|
62
|
+
with_value(false) do
|
63
|
+
it_should_assign_successfully
|
64
|
+
it_should_output "<a:graphicFrameLocks noMove=\"false\"/>"
|
65
|
+
end
|
47
66
|
with_value(:neither) do
|
48
67
|
it_should_raise_an_exception
|
49
68
|
end
|
50
69
|
end
|
51
70
|
|
52
|
-
for_attribute(:
|
53
|
-
|
71
|
+
for_attribute(:disallow_resizing) do
|
72
|
+
with_value(true) do
|
73
|
+
it_should_assign_successfully
|
74
|
+
it_should_output "<a:graphicFrameLocks noResize=\"true\"/>"
|
75
|
+
end
|
76
|
+
|
77
|
+
with_value(false) do
|
54
78
|
it_should_assign_successfully
|
55
|
-
|
79
|
+
it_should_output "<a:graphicFrameLocks noResize=\"false\"/>"
|
56
80
|
end
|
57
81
|
|
58
82
|
with_value(:neither) do
|
@@ -60,10 +84,15 @@ describe OpenXml::DrawingML::Elements::GraphicFrameLocks do
|
|
60
84
|
end
|
61
85
|
end
|
62
86
|
|
63
|
-
for_attribute(:
|
64
|
-
|
87
|
+
for_attribute(:disallow_selection) do
|
88
|
+
with_value(true) do
|
89
|
+
it_should_assign_successfully
|
90
|
+
it_should_output "<a:graphicFrameLocks noSelect=\"true\"/>"
|
91
|
+
end
|
92
|
+
|
93
|
+
with_value(false) do
|
65
94
|
it_should_assign_successfully
|
66
|
-
|
95
|
+
it_should_output "<a:graphicFrameLocks noSelect=\"false\"/>"
|
67
96
|
end
|
68
97
|
|
69
98
|
with_value(:neither) do
|