From 1242e1a85b8233ead668bea92372fd0e483bd468 Mon Sep 17 00:00:00 2001 From: MaxSorokin Date: Tue, 17 Oct 2023 02:01:23 +0300 Subject: [PATCH 1/7] Bug 62996 FIXED --- spec/docx/smoke/api_text_properties_spec.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/docx/smoke/api_text_properties_spec.rb b/spec/docx/smoke/api_text_properties_spec.rb index 5ec088d5..a8067036 100644 --- a/spec/docx/smoke/api_text_properties_spec.rb +++ b/spec/docx/smoke/api_text_properties_spec.rb @@ -38,7 +38,6 @@ end it 'ApiTextPr | SetHighlight method' do - skip('https://bugzilla.onlyoffice.com/show_bug.cgi?id=62996') 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 From 352992a9c4ad1a91bfbfdd036fe84ae4f7e8b326 Mon Sep 17 00:00:00 2001 From: MaxSorokin Date: Tue, 17 Oct 2023 03:37:58 +0300 Subject: [PATCH 2/7] Failure parsing table property for 7.5 --- spec/docx/smoke/api_table_spec.rb | 7 ++++--- spec/docx/smoke/api_table_style_pr_spec.rb | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/spec/docx/smoke/api_table_spec.rb b/spec/docx/smoke/api_table_spec.rb index bca7abc8..4654211a 100644 --- a/spec/docx/smoke/api_table_spec.rb +++ b/spec/docx/smoke/api_table_spec.rb @@ -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 diff --git a/spec/docx/smoke/api_table_style_pr_spec.rb b/spec/docx/smoke/api_table_style_pr_spec.rb index 6a033545..cef27793 100644 --- a/spec/docx/smoke/api_table_style_pr_spec.rb +++ b/spec/docx/smoke/api_table_style_pr_spec.rb @@ -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 @@ -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 @@ -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 @@ -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 From 68a648caa68739db7e06b1bf00495df34cae6f67 Mon Sep 17 00:00:00 2001 From: MaxSorokin Date: Wed, 18 Oct 2023 01:31:36 +0300 Subject: [PATCH 3/7] fix bug: paragraph must be set before --- js/docx/sections/add_text_in_section.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/docx/sections/add_text_in_section.js b/js/docx/sections/add_text_in_section.js index cfd36197..19c1bd7a 100644 --- a/js/docx/sections/add_text_in_section.js +++ b/js/docx/sections/add_text_in_section.js @@ -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); From febe2bd740a884aeb4d1bd9d5726807b42b539e0 Mon Sep 17 00:00:00 2001 From: MaxSorokin Date: Wed, 18 Oct 2023 01:34:38 +0300 Subject: [PATCH 4/7] #1214 incorrectly parses custom table properties --- spec/docx/smoke/api_paragraph_properties_spec.rb | 8 ++++++++ spec/docx/smoke/api_paragraph_spec.rb | 8 +++++--- spec/docx/smoke/api_style_spec.rb | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/spec/docx/smoke/api_paragraph_properties_spec.rb b/spec/docx/smoke/api_paragraph_properties_spec.rb index bfb6017c..00f366cb 100755 --- a/spec/docx/smoke/api_paragraph_properties_spec.rb +++ b/spec/docx/smoke/api_paragraph_properties_spec.rb @@ -8,6 +8,7 @@ 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)) @@ -15,6 +16,7 @@ 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)) @@ -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)) @@ -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)) @@ -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)) @@ -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)) diff --git a/spec/docx/smoke/api_paragraph_spec.rb b/spec/docx/smoke/api_paragraph_spec.rb index b8a2a633..b526111d 100644 --- a/spec/docx/smoke/api_paragraph_spec.rb +++ b/spec/docx/smoke/api_paragraph_spec.rb @@ -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 @@ -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)) diff --git a/spec/docx/smoke/api_style_spec.rb b/spec/docx/smoke/api_style_spec.rb index e9d7f759..6e8681db 100644 --- a/spec/docx/smoke/api_style_spec.rb +++ b/spec/docx/smoke/api_style_spec.rb @@ -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] From e5a92e92a4d567bf26591049397a2d5a50c3bc5f Mon Sep 17 00:00:00 2001 From: MaxSorokin Date: Wed, 18 Oct 2023 01:35:25 +0300 Subject: [PATCH 5/7] #1215 Parsing Pr is difficult --- .../text/add_text_with_spacinglines_spec.rb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/spec/docx/paragraph/text/add_text_with_spacinglines_spec.rb b/spec/docx/paragraph/text/add_text_with_spacinglines_spec.rb index ad89e56a..89005188 100644 --- a/spec/docx/paragraph/text/add_text_with_spacinglines_spec.rb +++ b/spec/docx/paragraph/text/add_text_with_spacinglines_spec.rb @@ -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 From 4eca862373f6e874cc9d24c54a2cc44798ab223c Mon Sep 17 00:00:00 2001 From: MaxSorokin Date: Wed, 18 Oct 2023 01:35:52 +0300 Subject: [PATCH 6/7] #1216 AbstractNumbering.multilevel_type return => nil --- spec/docx/smoke/api_numbering_level_spec.rb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/spec/docx/smoke/api_numbering_level_spec.rb b/spec/docx/smoke/api_numbering_level_spec.rb index 36c95e15..7fc4b7e1 100644 --- a/spec/docx/smoke/api_numbering_level_spec.rb +++ b/spec/docx/smoke/api_numbering_level_spec.rb @@ -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 @@ -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 From 8158cc1b8e95017a3d150667f8d4f597a953705e Mon Sep 17 00:00:00 2001 From: MaxSorokin Date: Thu, 19 Oct 2023 12:34:40 +0300 Subject: [PATCH 7/7] Skip SetHighlight check --- spec/docx/smoke/api_text_properties_spec.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/docx/smoke/api_text_properties_spec.rb b/spec/docx/smoke/api_text_properties_spec.rb index a8067036..11472170 100644 --- a/spec/docx/smoke/api_text_properties_spec.rb +++ b/spec/docx/smoke/api_text_properties_spec.rb @@ -38,6 +38,7 @@ end it 'ApiTextPr | SetHighlight method' do + 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