rd2odt 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. data/FUTURE +63 -0
  2. data/LICENSE +21 -0
  3. data/NEWS +42 -0
  4. data/README +78 -0
  5. data/Rakefile +51 -0
  6. data/bin/rd2odt +4 -0
  7. data/doc/sample/body-text.rd +5 -0
  8. data/doc/sample/enum-list-over-headline-multi-level.rd +10 -0
  9. data/doc/sample/enum-list-over-headline.rd +9 -0
  10. data/doc/sample/enum-list-over-item-list-multi-level-2.rd +9 -0
  11. data/doc/sample/enum-list-over-item-list-multi-level.rd +8 -0
  12. data/doc/sample/enum-list-over-item-list.rd +7 -0
  13. data/doc/sample/headline.rd +60 -0
  14. data/doc/sample/include-file-figure.odt +0 -0
  15. data/doc/sample/include-file-ole-object.odt +0 -0
  16. data/doc/sample/include-file-original-styled-text.odt +0 -0
  17. data/doc/sample/include-file-shape.odt +0 -0
  18. data/doc/sample/include-file-simple-styled-text.odt +0 -0
  19. data/doc/sample/include-file-simple-text.odt +0 -0
  20. data/doc/sample/include-file-table.odt +0 -0
  21. data/doc/sample/include.rd +21 -0
  22. data/doc/sample/list.rd +22 -0
  23. data/doc/sample/multi-paragraph.rd +12 -0
  24. data/doc/sample/page-break.odt +0 -0
  25. data/doc/sample/verbatim.rd +8 -0
  26. data/doc/sample.rd.ja +75 -0
  27. data/doc/sample.rd.ja.ott +0 -0
  28. data/doc/sample.rd.ja.pdf +0 -0
  29. data/doc/specification.ja.rd +35 -0
  30. data/lib/rd2odt/rdtool/NOTICE.rd2odt +8 -0
  31. data/lib/rd2odt/rdtool/README.rd +50 -0
  32. data/lib/rd2odt/rdtool/README.rd.ja +53 -0
  33. data/lib/rd2odt/rdtool/rd/block-element.rb +114 -0
  34. data/lib/rd2odt/rdtool/rd/complex-list-item.rb +65 -0
  35. data/lib/rd2odt/rdtool/rd/desclist.rb +55 -0
  36. data/lib/rd2odt/rdtool/rd/document-struct.rb +46 -0
  37. data/lib/rd2odt/rdtool/rd/element.rb +160 -0
  38. data/lib/rd2odt/rdtool/rd/filter.rb +255 -0
  39. data/lib/rd2odt/rdtool/rd/inline-element.rb +233 -0
  40. data/lib/rd2odt/rdtool/rd/labeled-element.rb +14 -0
  41. data/lib/rd2odt/rdtool/rd/list.rb +57 -0
  42. data/lib/rd2odt/rdtool/rd/loose-struct.rb +11 -0
  43. data/lib/rd2odt/rdtool/rd/methodlist.rb +57 -0
  44. data/lib/rd2odt/rdtool/rd/output-format-visitor.rb +28 -0
  45. data/lib/rd2odt/rdtool/rd/package.rb +4 -0
  46. data/lib/rd2odt/rdtool/rd/parser-util.rb +14 -0
  47. data/lib/rd2odt/rdtool/rd/rbl-file.rb +69 -0
  48. data/lib/rd2odt/rdtool/rd/rbl-suite.rb +37 -0
  49. data/lib/rd2odt/rdtool/rd/rd-struct.rb +86 -0
  50. data/lib/rd2odt/rdtool/rd/rd2html-lib.rb +490 -0
  51. data/lib/rd2odt/rdtool/rd/rd2html-opt.rb +67 -0
  52. data/lib/rd2odt/rdtool/rd/rd2man-lib.rb +241 -0
  53. data/lib/rd2odt/rdtool/rd/rd2rdo-lib.rb +19 -0
  54. data/lib/rd2odt/rdtool/rd/rd2rmi-lib.rb +32 -0
  55. data/lib/rd2odt/rdtool/rd/rdblockparser.tab.rb +1050 -0
  56. data/lib/rd2odt/rdtool/rd/rdfmt.rb +15 -0
  57. data/lib/rd2odt/rdtool/rd/rdinlineparser.tab.rb +1243 -0
  58. data/lib/rd2odt/rdtool/rd/rdvisitor.rb +214 -0
  59. data/lib/rd2odt/rdtool/rd/reference-resolver.rb +114 -0
  60. data/lib/rd2odt/rdtool/rd/search-file.rb +14 -0
  61. data/lib/rd2odt/rdtool/rd/tree.rb +103 -0
  62. data/lib/rd2odt/rdtool/rd/version.rb +39 -0
  63. data/lib/rd2odt/rdtool/rd/visitor.rb +86 -0
  64. data/lib/rd2odt.rb +603 -0
  65. data/rd2odt.gemspec +108 -0
  66. data/setup.rb +1585 -0
  67. data/test/functional/rd2odt-spec.rb +733 -0
  68. data/test/test-helper.rb +93 -0
  69. data/test/unit/rd2odt-spec.rb +831 -0
  70. metadata +122 -0
@@ -0,0 +1,733 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ require File.join(File.dirname(__FILE__), "..", "test-helper")
4
+
5
+ def create_rd_tree(filename)
6
+ path = File.join($top_srcdir, "doc", "sample", filename)
7
+ tree = RD::RDTree.new(File.read(path), [], nil)
8
+ tree.parse
9
+ return tree
10
+ end
11
+
12
+ def check_document_content(result)
13
+ result.class.should == Array
14
+ result[0].should == :office__document_content
15
+ result[1].should == {
16
+ :xmlns__office => "urn:oasis:names:tc:opendocument:xmlns:office:1.0",
17
+ :xmlns__style => "urn:oasis:names:tc:opendocument:xmlns:style:1.0",
18
+ :xmlns__text => "urn:oasis:names:tc:opendocument:xmlns:text:1.0",
19
+ :xmlns__table => "urn:oasis:names:tc:opendocument:xmlns:table:1.0",
20
+ :xmlns__draw => "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",
21
+ :xmlns__fo =>
22
+ "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0",
23
+ :xmlns__xlink => "http://www.w3.org/1999/xlink",
24
+ :xmlns__dc => "http://purl.org/dc/elements/1.1/",
25
+ :xmlns__meta => "urn:oasis:names:tc:opendocument:xmlns:meta:1.0",
26
+ :xmlns__number => "urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0",
27
+ :xmlns__svg => "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0",
28
+ :xmlns__chart => "urn:oasis:names:tc:opendocument:xmlns:chart:1.0",
29
+ :xmlns__dr3d => "urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0",
30
+ :xmlns__math => "http://www.w3.org/1998/Math/MathML",
31
+ :xmlns__form => "urn:oasis:names:tc:opendocument:xmlns:form:1.0",
32
+ :xmlns__script => "urn:oasis:names:tc:opendocument:xmlns:script:1.0",
33
+ :xmlns__ooo => "http://openoffice.org/2004/office",
34
+ :xmlns__ooow => "http://openoffice.org/2004/writer",
35
+ :xmlns__oooc => "http://openoffice.org/2004/calc",
36
+ :xmlns__dom => "http://www.w3.org/2001/xml-events",
37
+ :xmlns__xforms => "http://www.w3.org/2002/xforms",
38
+ :xmlns__xsd => "http://www.w3.org/2001/XMLSchema",
39
+ :xmlns__xsi => "http://www.w3.org/2001/XMLSchema-instance",
40
+ :xmlns__field =>
41
+ "urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:field:1.0",
42
+ :office__version => "1.1",
43
+ }
44
+ result[2].should == [:office__scripts]
45
+ result[3].should == [:office__font_face_decls,
46
+ [:style__font_face,
47
+ {
48
+ :style__name => "さざなみ明朝",
49
+ :svg__font_family => "さざなみ明朝",
50
+ :style__font_family_generic => "roman",
51
+ :style__font_pitch => "variable",
52
+ }],
53
+ [:style__font_face,
54
+ {
55
+ :style__name => "IPAゴシック",
56
+ :svg__font_family => "IPAゴシック",
57
+ :style__font_family_generic => "swiss",
58
+ :style__font_pitch => "variable",
59
+ }],
60
+ [:style__font_face,
61
+ {
62
+ :style__name => "IPAゴシック1",
63
+ :svg__font_family => "IPAゴシック",
64
+ :style__font_family_generic => "system",
65
+ :style__font_pitch => "variable",
66
+ }],
67
+ ] # :office__font_face_decls
68
+ result[4].should == [:office__automatic_styles]
69
+ body_result = result[5]
70
+ body_result.class.should == Array
71
+ body_result[0].should == :office__body
72
+ body_result[1].class.should == Array
73
+ body_result[1][0].should == :office__text
74
+ body_result[1][1].should == [:text__sequence_decls,
75
+ [:text__sequence_decl,
76
+ {
77
+ :text__display_outline_level => "0",
78
+ :text__name => "Illustration",
79
+ }],
80
+ [:text__sequence_decl,
81
+ {
82
+ :text__display_outline_level => "0",
83
+ :text__name => "Table",
84
+ }],
85
+ [:text__sequence_decl,
86
+ {
87
+ :text__display_outline_level => "0",
88
+ :text__name => "Text",
89
+ }],
90
+ [:text__sequence_decl,
91
+ {
92
+ :text__display_outline_level => "0",
93
+ :text__name => "Drawing",
94
+ }],
95
+ ] # :text__sequence_decls
96
+ return yield(body_result[1][2 .. -1])
97
+ end
98
+
99
+ describe RD2ODT::RD2ODTVisitor, "" do
100
+ before do
101
+ @visitor = RD2ODT::RD2ODTVisitor.new
102
+ end
103
+
104
+ it "supports EnumList over Headline." do
105
+ result = @visitor.visit(create_rd_tree("enum-list-over-headline.rd"))
106
+ check_document_content(result) do |office_text|
107
+ office_text[0].should == [:text__list,
108
+ {
109
+ :text__continue_numbering => "false",
110
+ :text__style_name => "Numbering_20_1",
111
+ },
112
+ [:text__list_item,
113
+ [:text__p,
114
+ {:text__style_name => "Text_20_body"},
115
+ "EnumList 1",
116
+ ],
117
+ ]
118
+ ]
119
+ office_text[1].should == [:text__list,
120
+ {
121
+ :text__style_name => "Numbering_20_2",
122
+ :text__continue_numbering => "true",
123
+ },
124
+ [:text__list_item,
125
+ [:text__list,
126
+ {:text__continue_numbering => "true"},
127
+ [:text__list_item,
128
+ [:text__p,
129
+ {:text__style_name => "Heading_20_2"},
130
+ "Headline 2",
131
+ ]
132
+ ]
133
+ ],
134
+ ]
135
+ ]
136
+ office_text[2].should == [:text__list,
137
+ {
138
+ :text__style_name => "Numbering_20_1",
139
+ :text__continue_numbering => "false",
140
+ },
141
+ [:text__list_item,
142
+ [:text__p,
143
+ {:text__style_name => "Text_20_body"},
144
+ "EnumList 1",
145
+ ],
146
+ ]
147
+ ]
148
+ end
149
+ end
150
+
151
+ it "supports EnumList over Headline multi-level." do
152
+ filename = "enum-list-over-headline-multi-level.rd"
153
+ result = @visitor.visit(create_rd_tree(filename))
154
+ check_document_content(result) do |office_text|
155
+ office_text[0].should == [:text__list,
156
+ {
157
+ :text__style_name => "Numbering_20_1",
158
+ :text__continue_numbering => "false",
159
+ },
160
+ [:text__list_item,
161
+ [:text__p,
162
+ {:text__style_name => "Text_20_body"},
163
+ "EnumList 1",
164
+ ],
165
+ ]
166
+ ]
167
+ office_text[1].should == [:text__list,
168
+ {
169
+ :text__style_name => "Numbering_20_2",
170
+ :text__continue_numbering => "true",
171
+ },
172
+ [:text__list_item,
173
+ [:text__list,
174
+ {:text__continue_numbering => "true"},
175
+ [:text__list_item,
176
+ [:text__p,
177
+ {:text__style_name => "Heading_20_2"},
178
+ "Headline 2",
179
+ ]
180
+ ]
181
+ ],
182
+ ]
183
+ ]
184
+ office_text[2].should == [:text__list,
185
+ {
186
+ :text__style_name => "Numbering_20_1",
187
+ :text__continue_numbering => "false",
188
+ },
189
+ [:text__list_item,
190
+ [:text__p,
191
+ {:text__style_name => "Text_20_body"},
192
+ "EnumList 1",
193
+ ],
194
+ [:text__list,
195
+ {
196
+ :text__style_name => "Numbering_20_1",
197
+ :text__continue_numbering => "false",
198
+ },
199
+ [:text__list_item,
200
+ [:text__p,
201
+ {:text__style_name => "Text_20_body"},
202
+ "EnumList 1-1",
203
+ ],
204
+ ],
205
+ ],
206
+ ],
207
+ ]
208
+ end
209
+ end
210
+
211
+ it "supports EnumList over ItemList." do
212
+ result = @visitor.visit(create_rd_tree("enum-list-over-item-list.rd"))
213
+ check_document_content(result) do |office_text|
214
+ office_text[0].should == [:text__list,
215
+ {
216
+ :text__continue_numbering => "false",
217
+ :text__style_name => "Numbering_20_1",
218
+ },
219
+ [:text__list_item,
220
+ [:text__p,
221
+ {:text__style_name => "Text_20_body"},
222
+ "EnumList 1",
223
+ ],
224
+ ]
225
+ ]
226
+ office_text[1].should == [:text__list,
227
+ {:text__style_name => "List_20_1"},
228
+ [:text__list_item,
229
+ [:text__p,
230
+ {:text__style_name => "Text_20_body"},
231
+ "ItemList 1",
232
+ ],
233
+ ]
234
+ ]
235
+ office_text[2].should == [:text__list,
236
+ {
237
+ :text__style_name => "Numbering_20_1",
238
+ :text__continue_numbering => "false",
239
+ },
240
+ [:text__list_item,
241
+ [:text__p,
242
+ {:text__style_name => "Text_20_body"},
243
+ "EnumList 1",
244
+ ],
245
+ ]
246
+ ]
247
+ end
248
+ end
249
+
250
+ it "supports multi-level EnumList over ItemList." do
251
+ filename = "enum-list-over-item-list-multi-level.rd"
252
+ result = @visitor.visit(create_rd_tree(filename))
253
+ check_document_content(result) do |office_text|
254
+ office_text[0].should == [:text__list,
255
+ {
256
+ :text__continue_numbering => "false",
257
+ :text__style_name => "Numbering_20_1",
258
+ },
259
+ [:text__list_item,
260
+ [:text__p,
261
+ {:text__style_name => "Text_20_body"},
262
+ "EnumList 1",
263
+ ],
264
+ [:text__list,
265
+ {
266
+ :text__continue_numbering => "false",
267
+ :text__style_name => "Numbering_20_1",
268
+ },
269
+ [:text__list_item,
270
+ [:text__p,
271
+ {:text__style_name => "Text_20_body"},
272
+ "EnumList 1-1",
273
+ ],
274
+ ],
275
+ ],
276
+ ]
277
+ ]
278
+ office_text[1].should == [:text__list,
279
+ {:text__style_name => "List_20_1"},
280
+ [:text__list_item,
281
+ [:text__p,
282
+ {:text__style_name => "Text_20_body"},
283
+ "ItemList *1",
284
+ ],
285
+ [:text__list,
286
+ {
287
+ :text__style_name => "Numbering_20_1",
288
+ :text__continue_numbering => "false",
289
+ },
290
+ [:text__list_item,
291
+ [:text__p,
292
+ {:text__style_name => "Text_20_body"},
293
+ "EnumList *1-1",
294
+ ],
295
+ ],
296
+ ],
297
+ ]
298
+ ]
299
+ end
300
+ end
301
+
302
+ it "supports multi-level EnumList over ItemList." do
303
+ filename = "enum-list-over-item-list-multi-level-2.rd"
304
+ result = @visitor.visit(create_rd_tree(filename))
305
+ check_document_content(result) do |office_text|
306
+ office_text[0].should == [:text__list,
307
+ {
308
+ :text__continue_numbering => "false",
309
+ :text__style_name => "Numbering_20_1",
310
+ },
311
+ [:text__list_item,
312
+ [:text__p,
313
+ {:text__style_name => "Text_20_body"},
314
+ "EnumList 1",
315
+ ],
316
+ [:text__list,
317
+ {
318
+ :text__continue_numbering => "false",
319
+ :text__style_name => "Numbering_20_1",
320
+ },
321
+ [:text__list_item,
322
+ [:text__p,
323
+ {:text__style_name => "Text_20_body"},
324
+ "EnumList 1-1",
325
+ ],
326
+ ],
327
+ ],
328
+ ]
329
+ ]
330
+ office_text[1].should == [:text__list,
331
+ {:text__style_name => "List_20_1"},
332
+ [:text__list_item,
333
+ [:text__p,
334
+ {:text__style_name => "Text_20_body"},
335
+ "ItemList *1",
336
+ ],
337
+ [:text__list,
338
+ {
339
+ :text__style_name => "Numbering_20_1",
340
+ :text__continue_numbering => "false",
341
+ },
342
+ [:text__list_item,
343
+ [:text__p,
344
+ {:text__style_name => "Text_20_body"},
345
+ "EnumList *1-1",
346
+ ],
347
+ [:text__list,
348
+ {:text__style_name => "List_20_1"},
349
+ [:text__list_item,
350
+ [:text__p,
351
+ {:text__style_name => "Text_20_body"},
352
+ "ItemList *1-1-*1",
353
+ ],
354
+ ],
355
+ ],
356
+ ],
357
+ ],
358
+ ]
359
+ ]
360
+ end
361
+ end
362
+
363
+ it "process multi-paragraph.rd" do
364
+ result = @visitor.visit(create_rd_tree("multi-paragraph.rd"))
365
+ check_document_content(result) do |office_text|
366
+ office_text[0].should == [:text__p,
367
+ {:text__style_name => "Text_20_body"},
368
+ "段落1段落1"
369
+ ]
370
+ office_text[1].should == [:text__p,
371
+ {:text__style_name => "Text_20_body"},
372
+ "段落2段落2"
373
+ ]
374
+ office_text[2].should == [:text__p,
375
+ {:text__style_name => "Text_20_body"},
376
+ "段落3段落3"
377
+ ]
378
+ end
379
+ end
380
+
381
+ it "process headline.rd" do
382
+ result = @visitor.visit(create_rd_tree("headline.rd"))
383
+ check_document_content(result) do |office_text|
384
+ office_text[0].should == [:text__list,
385
+ {:text__style_name => "Numbering_20_2"},
386
+ [:text__list_item,
387
+ [:text__p,
388
+ {:text__style_name => "Heading_20_1"},
389
+ "レベル1: 見出し1",
390
+ ],
391
+ ],
392
+ ]
393
+ office_text[1].should == [:text__p,
394
+ {:text__style_name => "Text_20_body"},
395
+ "本文1",
396
+ ]
397
+ office_text[2].should == [:text__list,
398
+ {
399
+ :text__style_name => "Numbering_20_2",
400
+ :text__continue_numbering => "true",
401
+ },
402
+ [:text__list_item,
403
+ [:text__list,
404
+ {:text__continue_numbering => "true"},
405
+ [:text__list_item,
406
+ [:text__p,
407
+ {:text__style_name => "Heading_20_2"},
408
+ "レベル2: 見出し1.1",
409
+ ],
410
+ ],
411
+ ],
412
+ ],
413
+ ]
414
+ office_text[3].should == [:text__p,
415
+ {:text__style_name => "Text_20_body"},
416
+ "本文1.1",
417
+ ]
418
+ office_text[4].should == [:text__list,
419
+ {
420
+ :text__style_name => "Numbering_20_2",
421
+ :text__continue_numbering => "true",
422
+ },
423
+ [:text__list_item,
424
+ [:text__list,
425
+ {:text__continue_numbering => "true"},
426
+ [:text__list_item,
427
+ [:text__list,
428
+ {:text__continue_numbering => "true"},
429
+ [:text__list_item,
430
+ [:text__p,
431
+ {:text__style_name => "Heading_20_3"},
432
+ "レベル3: 見出し1.1.1",
433
+ ],
434
+ ],
435
+ ],
436
+ ],
437
+ ],
438
+ ],
439
+ ]
440
+ office_text[5].should == [:text__p,
441
+ {:text__style_name => "Text_20_body"},
442
+ "本文1.1.1",
443
+ ]
444
+ office_text[6].should == [:text__list,
445
+ {
446
+ :text__style_name => "Numbering_20_2",
447
+ :text__continue_numbering => "true",
448
+ },
449
+ [:text__list_item,
450
+ [:text__list,
451
+ {:text__continue_numbering => "true"},
452
+ [:text__list_item,
453
+ [:text__list,
454
+ {:text__continue_numbering => "true"},
455
+ [:text__list_item,
456
+ [:text__list,
457
+ {:text__continue_numbering => "true"},
458
+ [:text__list_item,
459
+ [:text__p,
460
+ {:text__style_name => "Heading_20_4"},
461
+ "レベル4: 見出し1.1.1.1",
462
+ ],
463
+ ],
464
+ ],
465
+ ],
466
+ ],
467
+ ],
468
+ ],
469
+ ],
470
+ ]
471
+ office_text[7].should == [:text__p,
472
+ {:text__style_name => "Text_20_body"},
473
+ "本文1.1.1.1",
474
+ ]
475
+ office_text[8].should ==
476
+ [:text__list,
477
+ {
478
+ :text__style_name => "Numbering_20_2",
479
+ :text__continue_numbering => "true",
480
+ },
481
+ [:text__list_item,
482
+ [:text__list,
483
+ {:text__continue_numbering => "true"},
484
+ [:text__list_item,
485
+ [:text__list,
486
+ {:text__continue_numbering => "true"},
487
+ [:text__list_item,
488
+ [:text__list,
489
+ {:text__continue_numbering => "true"},
490
+ [:text__list_item,
491
+ [:text__list,
492
+ {:text__continue_numbering => "true"},
493
+ [:text__list_item,
494
+ [:text__p,
495
+ {:text__style_name => "Heading_20_5"},
496
+ "レベル5: 見出し1.1.1.1.1",
497
+ ],
498
+ ],
499
+ ],
500
+ ],
501
+ ],
502
+ ],
503
+ ],
504
+ ],
505
+ ],
506
+ ],
507
+ ]
508
+ office_text[9].should == [:text__p,
509
+ {:text__style_name => "Text_20_body"},
510
+ "本文1.1.1.1.1",
511
+ ]
512
+ office_text[10].should ==
513
+ [:text__list,
514
+ {
515
+ :text__style_name => "Numbering_20_2",
516
+ :text__continue_numbering => "true",
517
+ },
518
+ [:text__list_item,
519
+ [:text__list,
520
+ {:text__continue_numbering => "true"},
521
+ [:text__list_item,
522
+ [:text__list,
523
+ {:text__continue_numbering => "true"},
524
+ [:text__list_item,
525
+ [:text__list,
526
+ {:text__continue_numbering => "true"},
527
+ [:text__list_item,
528
+ [:text__list,
529
+ {:text__continue_numbering => "true"},
530
+ [:text__list_item,
531
+ [:text__list,
532
+ {:text__continue_numbering => "true"},
533
+ [:text__list_item,
534
+ [:text__p,
535
+ {:text__style_name => "Heading_20_6"},
536
+ "レベル6: 見出し1.1.1.1.1.1",
537
+ ],
538
+ ],
539
+ ],
540
+ ],
541
+ ],
542
+ ],
543
+ ],
544
+ ],
545
+ ],
546
+ ],
547
+ ],
548
+ ],
549
+ ]
550
+ office_text[11].should == [:text__p,
551
+ {:text__style_name => "Text_20_body"},
552
+ "本文1.1.1.1.1.1",
553
+ ]
554
+ office_text[12].should ==
555
+ [:text__list,
556
+ {
557
+ :text__style_name => "Numbering_20_2",
558
+ :text__continue_numbering => "true",
559
+ },
560
+ [:text__list_item,
561
+ [:text__p,
562
+ {:text__style_name => "Heading_20_1"},
563
+ "見出し2",
564
+ ],
565
+ ],
566
+ ]
567
+ office_text[13].should == [:text__p,
568
+ {:text__style_name => "Text_20_body"},
569
+ "本文2",
570
+ ]
571
+ office_text[14].should ==
572
+ [:text__list,
573
+ {
574
+ :text__style_name => "Numbering_20_2",
575
+ :text__continue_numbering => "true",
576
+ },
577
+ [:text__list_item,
578
+ [:text__list,
579
+ {:text__continue_numbering => "true"},
580
+ [:text__list_item,
581
+ [:text__p,
582
+ {:text__style_name => "Heading_20_2"},
583
+ "見出し2.1",
584
+ ],
585
+ ],
586
+ ],
587
+ ],
588
+ ]
589
+ office_text[15].should == [:text__p,
590
+ {:text__style_name => "Text_20_body"},
591
+ "本文2.1",
592
+ ]
593
+ office_text[16].should ==
594
+ [:text__list,
595
+ {
596
+ :text__style_name => "Numbering_20_2",
597
+ :text__continue_numbering => "true",
598
+ },
599
+ [:text__list_item,
600
+ [:text__list,
601
+ {:text__continue_numbering => "true"},
602
+ [:text__list_item,
603
+ [:text__p,
604
+ {:text__style_name => "Heading_20_2"},
605
+ "見出し2.2",
606
+ ],
607
+ ],
608
+ ],
609
+ ],
610
+ ]
611
+ office_text[17].should == [:text__p,
612
+ {:text__style_name => "Text_20_body"},
613
+ "本文2.2",
614
+ ]
615
+ office_text[18].should ==
616
+ [:text__list,
617
+ {
618
+ :text__style_name => "Numbering_20_2",
619
+ :text__continue_numbering => "true",
620
+ },
621
+ [:text__list_item,
622
+ [:text__list,
623
+ {:text__continue_numbering => "true"},
624
+ [:text__list_item,
625
+ [:text__list,
626
+ {:text__continue_numbering => "true"},
627
+ [:text__list_item,
628
+ [:text__p,
629
+ {:text__style_name => "Heading_20_3"},
630
+ "見出し2.2.1",
631
+ ],
632
+ ],
633
+ ],
634
+ ],
635
+ ],
636
+ ],
637
+ ]
638
+ office_text[19].should == [:text__p,
639
+ {:text__style_name => "Text_20_body"},
640
+ "本文2.2.1",
641
+ ]
642
+ office_text[20].should ==
643
+ [:text__list,
644
+ {
645
+ :text__style_name => "Numbering_20_2",
646
+ :text__continue_numbering => "true",
647
+ },
648
+ [:text__list_item,
649
+ [:text__list,
650
+ {:text__continue_numbering => "true"},
651
+ [:text__list_item,
652
+ [:text__p,
653
+ {:text__style_name => "Heading_20_2"},
654
+ "見出し2.3",
655
+ ],
656
+ ],
657
+ ],
658
+ ],
659
+ ]
660
+ office_text[21].should == [:text__p,
661
+ {:text__style_name => "Text_20_body"},
662
+ "本文2.3",
663
+ ]
664
+ office_text[22].should ==
665
+ [:text__list,
666
+ {
667
+ :text__style_name => "Numbering_20_2",
668
+ :text__continue_numbering => "true",
669
+ },
670
+ [:text__list_item,
671
+ [:text__p,
672
+ {:text__style_name => "Heading_20_1"},
673
+ "見出し3",
674
+ ],
675
+ ],
676
+ ]
677
+ office_text[23].should == [:text__p,
678
+ {:text__style_name => "Text_20_body"},
679
+ "本文3",
680
+ ]
681
+ office_text[24].should ==
682
+ [:text__list,
683
+ {
684
+ :text__style_name => "Numbering_20_2",
685
+ :text__continue_numbering => "true",
686
+ },
687
+ [:text__list_item,
688
+ [:text__list,
689
+ {:text__continue_numbering => "true"},
690
+ [:text__list_item,
691
+ [:text__list,
692
+ {:text__continue_numbering => "true"},
693
+ [:text__list_item,
694
+ [:text__p,
695
+ {:text__style_name => "Heading_20_3"},
696
+ "見出し3.1.1",
697
+ ],
698
+ ],
699
+ ],
700
+ ],
701
+ ],
702
+ ],
703
+ ]
704
+ office_text[25].should == [:text__p,
705
+ {:text__style_name => "Text_20_body"},
706
+ "本文3.1.1",
707
+ ]
708
+ office_text[26].should ==
709
+ [:text__list,
710
+ {
711
+ :text__style_name => "Numbering_20_2",
712
+ :text__continue_numbering => "true",
713
+ },
714
+ [:text__list_item,
715
+ [:text__list,
716
+ {:text__continue_numbering => "true"},
717
+ [:text__list_item,
718
+ [:text__p,
719
+ {:text__style_name => "Heading_20_2"},
720
+ "見出し3.2",
721
+ ],
722
+ ],
723
+ ],
724
+ ],
725
+ ]
726
+ office_text[27].should == [:text__p,
727
+ {:text__style_name => "Text_20_body"},
728
+ "本文3.2",
729
+ ]
730
+ office_text.length.should == 28
731
+ end
732
+ end
733
+ end