Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/7.5 #970

Merged
merged 7 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion js/docx/sections/add_text_in_section.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ oDocument.CreateNewHistoryPoint();
var oSection1, oParagraph1, oParagraph2;
oParagraph1 = Api.CreateParagraph();
oParagraph1.AddText("First Page");
oSection1 = oDocument.CreateSection(oParagraph1);
oDocument.Push(oParagraph1);
oSection1 = oDocument.CreateSection(oParagraph1);
oParagraph2 = Api.CreateParagraph();
oParagraph2.AddText("Second Page");
oDocument.Push(oParagraph2);
Expand Down
13 changes: 8 additions & 5 deletions spec/docx/paragraph/text/add_text_with_spacinglines_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,23 @@
it 'SpacingLine should be auto: 3' do
docx = builder.build_and_parse('js/docx/paragraph/text/add_text_with_spacingline_auto.js')
expect(docx.elements[1].nonempty_runs.first.text).to eq('Auto:3')
expect(docx.elements[1].spacing.line).to eq(3)
# TODO: 'https://github.com/ONLYOFFICE/ooxml_parser/issues/1215'
# expect(docx.elements[1].spacing.line).to eq(3)
end

it 'SpacingLine should be exact: 10pt' do
docx = builder.build_and_parse('js/docx/paragraph/text/add_text_with_spacingline_exact.js')
expect(docx.elements[1].nonempty_runs.first.text).to eq('Exact:10pt')
expect(docx.elements[1].spacing.line).to eq(0.35)
expect(docx.elements[1].spacing.line_rule).to eq(:exact)
# TODO: 'https://github.com/ONLYOFFICE/ooxml_parser/issues/1215'
# expect(docx.elements[1].spacing.line).to eq(0.35)
# expect(docx.elements[1].spacing.line_rule).to eq(:exact)
end

it 'SpacingLine should be atleast: 20pt' do
docx = builder.build_and_parse('js/docx/paragraph/text/add_text_with_spacingline_atleast.js')
expect(docx.elements[1].nonempty_runs.first.text).to eq('Atleast:20pt')
expect(docx.elements[1].spacing.line).to eq(0.71)
expect(docx.elements[1].spacing.line_rule).to eq(:at_least)
# TODO: 'https://github.com/ONLYOFFICE/ooxml_parser/issues/1215'
# expect(docx.elements[1].spacing.line).to eq(0.71)
# expect(docx.elements[1].spacing.line_rule).to eq(:at_least)
end
end
13 changes: 9 additions & 4 deletions spec/docx/smoke/api_numbering_level_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,26 @@

expect(docx.elements[0].nonempty_runs.first.text).to eq("This is the first element of a parent numbered list which starts with '1'")
expect(docx.elements[0].numbering.ilvl).to eq(0)
expect(docx.elements[0].numbering.abstruct_numbering.multilevel_type.value).to eq(:hybrid_multi_level)
# TODO: 'https://github.com/ONLYOFFICE/ooxml_parser/issues/1216'
# expect(docx.elements[0].numbering.abstruct_numbering.multilevel_type.value).to eq(:hybrid_multi_level)

expect(docx.elements[1].nonempty_runs.first.text).to eq("This is the first element of a child numbered list which starts with 'a'")
expect(docx.elements[1].numbering.ilvl).to eq(1)
expect(docx.elements[1].numbering.abstruct_numbering.multilevel_type.value).to eq(:hybrid_multi_level)
# TODO: 'https://github.com/ONLYOFFICE/ooxml_parser/issues/1216'
# expect(docx.elements[1].numbering.abstruct_numbering.multilevel_type.value).to eq(:hybrid_multi_level)

expect(docx.elements[2].nonempty_runs.first.text).to eq("This is the second element of a child numbered list which starts with 'b'")
expect(docx.elements[2].numbering.ilvl).to eq(1)
expect(docx.elements[2].numbering.abstruct_numbering.multilevel_type.value).to eq(:hybrid_multi_level)
# TODO: 'https://github.com/ONLYOFFICE/ooxml_parser/issues/1216'
# expect(docx.elements[2].numbering.abstruct_numbering.multilevel_type.value).to eq(:hybrid_multi_level)

expect(docx.elements[3].nonempty_runs.first.text).to eq('This is a paragraph without a numbering. ')
expect(docx.elements[3].numbering).to be_nil

expect(docx.elements[4].nonempty_runs.first.text).to eq("This is the second element of a parent numbered list which starts with '2'")
expect(docx.elements[4].numbering.ilvl).to eq(0)
expect(docx.elements[4].numbering.abstruct_numbering.multilevel_type.value).to eq(:hybrid_multi_level)
# TODO: 'https://github.com/ONLYOFFICE/ooxml_parser/issues/1216'
# expect(docx.elements[4].numbering.abstruct_numbering.multilevel_type.value).to eq(:hybrid_multi_level)
end

it 'ApiNumberingLevel | GetParaPr method' do
Expand Down Expand Up @@ -74,6 +78,7 @@
end

it 'ApiNumberingLevel | SetSuff method' do
skip('https://github.com/ONLYOFFICE/ooxml_parser/issues/1216')
docx = builder.build_and_parse('js/docx/smoke/api_numbering_level/set_suff.js')
expect(docx.element_by_description.first.numbering.abstruct_numbering.level_list.first.suffix.value).to eq(:space)
end
Expand Down
8 changes: 8 additions & 0 deletions spec/docx/smoke/api_paragraph_properties_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
end

it 'ApiParaPr | SetBetweenBorder method' do
skip('https://github.com/ONLYOFFICE/ooxml_parser/issues/1214')
docx = builder.build_and_parse('js/docx/smoke/api_para_pr/set_between_border.js')
expect(docx.elements.first.borders.between.color).to eq(OoxmlParser::Color.new(0, 255, 0))
expect(docx.elements.first.borders.between.size).to eq(OoxmlParser::OoxmlSize.new(24, :one_eighth_point))
expect(docx.elements.first.borders.between.space).to eq(OoxmlParser::OoxmlSize.new(0.0, :point))
end

it 'ApiParaPr | SetBottomBorder method' do
skip('https://github.com/ONLYOFFICE/ooxml_parser/issues/1214')
docx = builder.build_and_parse('js/docx/smoke/api_para_pr/set_bottom_border.js')
expect(docx.elements.first.borders.bottom.color).to eq(OoxmlParser::Color.new(0, 255, 0))
expect(docx.elements.first.borders.bottom.space).to eq(OoxmlParser::OoxmlSize.new(0, :point))
Expand All @@ -30,18 +32,21 @@
end

it 'ApiParaPr | SetIndFirstLine method' do
skip('https://github.com/ONLYOFFICE/ooxml_parser/issues/1215')
docx = builder.build_and_parse('js/docx/smoke/api_para_pr/set_ind_first_line.js')
expect(docx.elements.first.ind.first_line_indent).to eq(OoxmlParser::OoxmlSize.new(1440.0, :twip))
expect(docx.elements[1].ind.first_line_indent).to eq(OoxmlParser::OoxmlSize.new(1440.0, :twip))
end

it 'ApiParaPr | SetIndLeft method' do
skip('https://github.com/ONLYOFFICE/ooxml_parser/issues/1215')
docx = builder.build_and_parse('js/docx/smoke/api_para_pr/set_ind_left.js')
expect(docx.elements.first.ind.left_indent).to eq(OoxmlParser::OoxmlSize.new(2880, :twip))
expect(docx.elements[1].ind.left_indent).to eq(OoxmlParser::OoxmlSize.new(2880, :twip))
end

it 'ApiParaPr | SetIndRight method' do
skip('https://github.com/ONLYOFFICE/ooxml_parser/issues/1215')
docx = builder.build_and_parse('js/docx/smoke/api_para_pr/set_ind_right.js')
expect(docx.elements.first.ind.right_indent).to eq(OoxmlParser::OoxmlSize.new(2880, :twip))
expect(docx.elements[1].ind.right_indent).to eq(OoxmlParser::OoxmlSize.new(2880, :twip))
Expand Down Expand Up @@ -78,6 +83,7 @@
end

it 'ApiParaPr | SetLeftBorder method' do
skip('https://github.com/ONLYOFFICE/ooxml_parser/issues/1214')
docx = builder.build_and_parse('js/docx/smoke/api_para_pr/set_left_border.js')
expect(docx.elements.first.borders.left.color).to eq(OoxmlParser::Color.new(0, 255, 0))
expect(docx.elements.first.borders.left.space).to eq(OoxmlParser::OoxmlSize.new(0.0, :point))
Expand All @@ -100,6 +106,7 @@
end

it 'ApiParaPr | SetRightBorder method' do
skip('https://github.com/ONLYOFFICE/ooxml_parser/issues/1215')
docx = builder.build_and_parse('js/docx/smoke/api_para_pr/set_right_border.js')
expect(docx.elements.first.borders.right.color).to eq(OoxmlParser::Color.new(0, 255, 0))
expect(docx.elements.first.borders.right.space).to eq(OoxmlParser::OoxmlSize.new(0, :point))
Expand Down Expand Up @@ -155,6 +162,7 @@
end

it 'ApiParaPr | SetTopBorder method' do
skip('https://github.com/ONLYOFFICE/ooxml_parser/issues/1214')
docx = builder.build_and_parse('js/docx/smoke/api_para_pr/set_top_border.js')
expect(docx.elements.first.borders.top.color).to eq(OoxmlParser::Color.new(0, 255, 0))
expect(docx.elements.first.borders.top.size).to eq(OoxmlParser::OoxmlSize.new(24, :one_eighth_point))
Expand Down
8 changes: 5 additions & 3 deletions spec/docx/smoke/api_paragraph_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@

it 'ApiParagraph | GetParaPr method' do
docx = builder.build_and_parse('js/docx/smoke/api_paragraph/get_para_pr.js')
expect(docx.elements.first.spacing.line).to eq(2)
# TODO: 'https://github.com/ONLYOFFICE/ooxml_parser/issues/1214'
# expect(docx.elements.first.spacing.line).to eq(2)
expect(docx.elements.first.ind.first_line_indent).to eq(OoxmlParser::OoxmlSize.new(1.27, :centimeter))
end

Expand Down Expand Up @@ -232,8 +233,9 @@

it 'ApiParagraph | SetSpacingLine method' do
docx = builder.build_and_parse('js/docx/smoke/api_paragraph/set_spacing_line.js')
expect(docx.elements.first.paragraph_properties.spacing.line).to eq(OoxmlParser::OoxmlSize.new(3, :centimeter))
expect(docx.elements.first.spacing.line_rule).to eq(:auto)
# TODO: 'https://github.com/ONLYOFFICE/ooxml_parser/issues/1214'
# expect(docx.elements.first.paragraph_properties.spacing.line).to eq(OoxmlParser::OoxmlSize.new(3, :centimeter))
# expect(docx.elements.first.spacing.line_rule).to eq(:auto)
expect(docx.elements[1].paragraph_properties.spacing.line).to eq(OoxmlParser::OoxmlSize.new(200, :twip))
expect(docx.elements[1].paragraph_properties.spacing.line_rule).to eq(:exact)
expect(docx.elements[2].paragraph_properties.spacing.line).to eq(OoxmlParser::OoxmlSize.new(400, :twip))
Expand Down
1 change: 1 addition & 0 deletions spec/docx/smoke/api_style_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
end

it 'ApiStyle | GetConditionalTableStyle method' do
skip('https://github.com/ONLYOFFICE/ooxml_parser/issues/1214')
docx = builder.build_and_parse('js/docx/smoke/api_style/get_conditional_table_style.js')
table_style = docx.elements[1].properties.table_style
expect(table_style.table_style_properties_list[0]
Expand Down
7 changes: 4 additions & 3 deletions spec/docx/smoke/api_table_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,10 @@
it 'ApiTable | SetTableLook method' do
docx = builder.build_and_parse('js/docx/smoke/api_table/set_table_look.js')
expect(docx.elements[1].properties.table_look.first_column).to be_truthy
expect(docx.elements[1].properties.table_style.table_style_properties_list
.first.table_cell_properties.shade.color.upcase)
.to eq(OoxmlParser::Color.new(255, 0, 0).to_hex.to_sym)
# TODO: https://github.com/ONLYOFFICE/ooxml_parser/issues/1214
# expect(docx.elements[1].properties.table_style.table_style_properties_list
# .first.table_cell_properties.shade.color.upcase)
# .to eq(OoxmlParser::Color.new(255, 0, 0).to_hex.to_sym)
expect(docx.elements[1].properties.table_look.first_row).to be_truthy
expect(docx.elements[1].properties.table_look.last_column).to be_truthy
expect(docx.elements[1].properties.table_look.first_row).to be_truthy
Expand Down
4 changes: 4 additions & 0 deletions spec/docx/smoke/api_table_style_pr_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
end

it 'ApiTableStylePr | GetParaPr method' do
skip('https://github.com/ONLYOFFICE/ooxml_parser/issues/1214')
docx = builder.build_and_parse('js/docx/smoke/api_table_style_pr/get_para_pr.js')
expect(docx.elements[1].properties
.table_style.table_style_properties_list
Expand All @@ -24,6 +25,7 @@
end

it 'ApiTableStylePr | GetTablePr method' do
skip('https://github.com/ONLYOFFICE/ooxml_parser/issues/1214')
docx = builder.build_and_parse('js/docx/smoke/api_table_style_pr/get_table_pr.js')
bottom_border = docx.document_style_by_name('CustomTableStyle')
.table_style_properties_list.first.table_properties
Expand All @@ -35,6 +37,7 @@
end

it 'ApiTableStylePr | GetTableRowPr method' do
skip('https://github.com/ONLYOFFICE/ooxml_parser/issues/1214')
docx = builder.build_and_parse('js/docx/smoke/api_table_style_pr/get_table_row_pr.js')
expect(docx.document_style_by_name('CustomTableStyle')
.table_style_properties_list
Expand All @@ -43,6 +46,7 @@
end

it 'ApiTableStylePr | GetTextPr method' do
skip('https://github.com/ONLYOFFICE/ooxml_parser/issues/1214')
docx = builder.build_and_parse('js/docx/smoke/api_table_style_pr/get_text_pr.js')
expect(docx.elements[1].properties.table_style.table_style_properties_list.first.run_properties.font_style.bold).to be_truthy
end
Expand Down
2 changes: 1 addition & 1 deletion spec/docx/smoke/api_text_properties_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
end

it 'ApiTextPr | SetHighlight method' do
skip('https://bugzilla.onlyoffice.com/show_bug.cgi?id=62996')
skip('Bug 62996 (FIXED TO 7.5)')
docx = builder.build_and_parse('js/docx/smoke/api_text_pr/set_highlight.js')
expect(docx.elements.first.nonempty_runs.first.highlight).to eq('yellow')
end
Expand Down
Loading