write_xlsx 0.99.0 → 1.00.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a8880984e96fe4a8788fe6642220163ff36932dea018a335d00165a7b2d2ae04
4
- data.tar.gz: 99153b43aba51974cca58ed8c38d6308814820846b4617444fcd302752843bc5
3
+ metadata.gz: bde6d7de8885eab3b8b2ccd4c1ec5b682b55b9893a730c3475d5c0e0b6aca459
4
+ data.tar.gz: c6f347da459b3a80bb699632d5aee762fb80de9ebde962463406618a2ed62c1f
5
5
  SHA512:
6
- metadata.gz: 1b5c868f6e42846e925282b0eed02064b4541e852e72012e083009dbaa44e6bc419f1ad5b630cfe3ca149b12832732b972f340e6038502e1c8acbce9358702d2
7
- data.tar.gz: 8bc6c84b0bb6c5901516441c7a5b1e45044ba5c26d30c92ac773f0de521e8e78785cd8aa4759a0d0db96d629aedd4aaf2a7453cb1f075b36dd1e61fc34cb217d
6
+ metadata.gz: 9c562aa8183d3d5bfa800aa961883620ae645107e5de36f7559efdbd2624384cc810d6b1c5098f36bd8508f72c7f6177803fd4f54713c068c59cc4d983da2091
7
+ data.tar.gz: 6af5a9bb53da31ad5e1eca9de975fe5ee68233be6712cecc939d3fc77496d38a23639f43be66bc8a520895e43de6dadb5f3278893711e23397151967912d07b5
data/Changes CHANGED
@@ -1,5 +1,11 @@
1
1
  Change history of write_xlsx rubygem.
2
2
 
3
+ 2021-01-23 v1.00.0
4
+
5
+ Fixed issue where images that started in hidden rows/columns weren't placed
6
+ correctly in the worksheet.
7
+
8
+
3
9
  2021-01-08 v0.99.0
4
10
 
5
11
  Added font and font_size parameters to write_comment().
@@ -1 +1 @@
1
- WriteXLSX_VERSION = "0.99.0"
1
+ WriteXLSX_VERSION = "1.00.0"
@@ -5871,17 +5871,21 @@ def position_object_pixels(col_start, row_start, x1, y1, width, height) #:nodoc:
5871
5871
  y_abs += y1
5872
5872
 
5873
5873
  # Adjust start column for offsets that are greater than the col width.
5874
- x1, col_start = adjust_column_offset(x1, col_start)
5874
+ if size_col(col_start) > 0
5875
+ x1, col_start = adjust_column_offset(x1, col_start)
5876
+ end
5875
5877
 
5876
5878
  # Adjust start row for offsets that are greater than the row height.
5877
- y1, row_start = adjust_row_offset(y1, row_start)
5879
+ if size_row(row_start) > 0
5880
+ y1, row_start = adjust_row_offset(y1, row_start)
5881
+ end
5878
5882
 
5879
5883
  # Initialise end cell to the same as the start cell.
5880
5884
  col_end = col_start
5881
5885
  row_end = row_start
5882
5886
 
5883
- width += x1
5884
- height += y1
5887
+ width += x1 if size_col(col_start) > 0
5888
+ height += y1 if size_row(row_start) > 0
5885
5889
 
5886
5890
  # Subtract the underlying cell widths to find the end cell of the object.
5887
5891
  width, col_end = adjust_column_offset(width, col_end)
@@ -0,0 +1,28 @@
1
+ # -*- coding: utf-8 -*-
2
+ require 'helper'
3
+
4
+ class TestRegressionImage44 < Minitest::Test
5
+ def setup
6
+ setup_dir_var
7
+ end
8
+
9
+ def teardown
10
+ @tempfile.close(true)
11
+ end
12
+
13
+ def test_image44
14
+ @xlsx = 'image44.xlsx'
15
+ workbook = WriteXLSX.new(@io)
16
+ worksheet = workbook.add_worksheet
17
+
18
+ worksheet.insert_image(
19
+ 'E9',
20
+ File.join(@test_dir, 'regression', 'images/red.png')
21
+ )
22
+
23
+ worksheet.set_row(8, 30)
24
+
25
+ workbook.close
26
+ compare_for_regression
27
+ end
28
+ end
@@ -0,0 +1,28 @@
1
+ # -*- coding: utf-8 -*-
2
+ require 'helper'
3
+
4
+ class TestRegressionImage45 < Minitest::Test
5
+ def setup
6
+ setup_dir_var
7
+ end
8
+
9
+ def teardown
10
+ @tempfile.close(true)
11
+ end
12
+
13
+ def test_image45
14
+ @xlsx = 'image45.xlsx'
15
+ workbook = WriteXLSX.new(@io)
16
+ worksheet = workbook.add_worksheet
17
+
18
+ worksheet.insert_image(
19
+ 'E9',
20
+ File.join(@test_dir, 'regression', 'images/red.png')
21
+ )
22
+
23
+ worksheet.set_row(8, 30, nil, 1)
24
+
25
+ workbook.close
26
+ compare_for_regression
27
+ end
28
+ end
@@ -0,0 +1,29 @@
1
+ # -*- coding: utf-8 -*-
2
+ require 'helper'
3
+
4
+ class TestRegressionImage46 < Minitest::Test
5
+ def setup
6
+ setup_dir_var
7
+ end
8
+
9
+ def teardown
10
+ @tempfile.close(true)
11
+ end
12
+
13
+ def test_image46
14
+ @xlsx = 'image46.xlsx'
15
+ workbook = WriteXLSX.new(@io)
16
+ worksheet = workbook.add_worksheet
17
+
18
+ worksheet.insert_image(
19
+ 'E9',
20
+ File.join(@test_dir, 'regression', 'images/red.png'),
21
+ 0, 4
22
+ )
23
+
24
+ worksheet.set_row(8, 30, nil, 1)
25
+
26
+ workbook.close
27
+ compare_for_regression
28
+ end
29
+ end
@@ -0,0 +1,28 @@
1
+ # -*- coding: utf-8 -*-
2
+ require 'helper'
3
+
4
+ class TestRegressionImage47 < Minitest::Test
5
+ def setup
6
+ setup_dir_var
7
+ end
8
+
9
+ def teardown
10
+ @tempfile.close(true)
11
+ end
12
+
13
+ def test_image47
14
+ @xlsx = 'image47.xlsx'
15
+ workbook = WriteXLSX.new(@io)
16
+ worksheet = workbook.add_worksheet
17
+
18
+ worksheet.insert_image(
19
+ 'E9',
20
+ File.join(@test_dir, 'regression', 'images/red.png')
21
+ )
22
+
23
+ worksheet.set_row(9, nil, nil, 1)
24
+
25
+ workbook.close
26
+ compare_for_regression
27
+ end
28
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: write_xlsx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.99.0
4
+ version: 1.00.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hideo NAKAMURA
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-08 00:00:00.000000000 Z
11
+ date: 2021-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip
@@ -924,6 +924,10 @@ files:
924
924
  - test/regression/test_image33.rb
925
925
  - test/regression/test_image35.rb
926
926
  - test/regression/test_image36.rb
927
+ - test/regression/test_image44.rb
928
+ - test/regression/test_image45.rb
929
+ - test/regression/test_image46.rb
930
+ - test/regression/test_image47.rb
927
931
  - test/regression/test_landscape01.rb
928
932
  - test/regression/test_macro01.rb
929
933
  - test/regression/test_merge_cells01.rb
@@ -1589,6 +1593,10 @@ files:
1589
1593
  - test/regression/xlsx_files/image33.xlsx
1590
1594
  - test/regression/xlsx_files/image35.xlsx
1591
1595
  - test/regression/xlsx_files/image36.xlsx
1596
+ - test/regression/xlsx_files/image44.xlsx
1597
+ - test/regression/xlsx_files/image45.xlsx
1598
+ - test/regression/xlsx_files/image46.xlsx
1599
+ - test/regression/xlsx_files/image47.xlsx
1592
1600
  - test/regression/xlsx_files/landscape01.xlsx
1593
1601
  - test/regression/xlsx_files/macro01.xlsm
1594
1602
  - test/regression/xlsx_files/merge_cells01.xlsx
@@ -1882,7 +1890,7 @@ homepage: https://github.com/cxn03651/write_xlsx#readme
1882
1890
  licenses:
1883
1891
  - MIT
1884
1892
  metadata: {}
1885
- post_install_message:
1893
+ post_install_message:
1886
1894
  rdoc_options: []
1887
1895
  require_paths:
1888
1896
  - lib
@@ -1897,8 +1905,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1897
1905
  - !ruby/object:Gem::Version
1898
1906
  version: '0'
1899
1907
  requirements: []
1900
- rubygems_version: 3.1.4
1901
- signing_key:
1908
+ rubygems_version: 3.2.3
1909
+ signing_key:
1902
1910
  specification_version: 4
1903
1911
  summary: write_xlsx is a gem to create a new file in the Excel 2007+ XLSX format.
1904
1912
  test_files:
@@ -2620,6 +2628,10 @@ test_files:
2620
2628
  - test/regression/test_image33.rb
2621
2629
  - test/regression/test_image35.rb
2622
2630
  - test/regression/test_image36.rb
2631
+ - test/regression/test_image44.rb
2632
+ - test/regression/test_image45.rb
2633
+ - test/regression/test_image46.rb
2634
+ - test/regression/test_image47.rb
2623
2635
  - test/regression/test_landscape01.rb
2624
2636
  - test/regression/test_macro01.rb
2625
2637
  - test/regression/test_merge_cells01.rb
@@ -3285,6 +3297,10 @@ test_files:
3285
3297
  - test/regression/xlsx_files/image33.xlsx
3286
3298
  - test/regression/xlsx_files/image35.xlsx
3287
3299
  - test/regression/xlsx_files/image36.xlsx
3300
+ - test/regression/xlsx_files/image44.xlsx
3301
+ - test/regression/xlsx_files/image45.xlsx
3302
+ - test/regression/xlsx_files/image46.xlsx
3303
+ - test/regression/xlsx_files/image47.xlsx
3288
3304
  - test/regression/xlsx_files/landscape01.xlsx
3289
3305
  - test/regression/xlsx_files/macro01.xlsm
3290
3306
  - test/regression/xlsx_files/merge_cells01.xlsx