Re: HSMF enhancements

2020-03-08 Thread Andreas Beeker
Hello Dominik,

thank you for your patch!

I've applied a modified version of it via #1874990 [1].

The reasons for my modifications are:
- remove the custom CRC32 code:
   I don't want to mix technical code with module specific code ... thankfully 
it could be calculated with off the shelf CRC32 classes anyway.
- use enums instead of String constants (... where we didn't have already a lot 
of legacy constants)
- try to break the cyclomatic complexity:
   wherever I see lots of nested ifs, I introduce private methods to limit the 
scope of variables
- In the ByteChunkDeferred class, the linked node can be read multiple times 
and we don't face exhausted InputStreams.

Best wishes,
Andi


[1] https://svn.apache.org/viewvc?view=revision=1874990

On 24.02.20 13:04, Hölzl, Dominik wrote:
> Hello!
>
> Can somebody please have a look https://github.com/apache/poi/pull/167?
>
> Thank you and regards,
> Dominik Hölzl
>
>




signature.asc
Description: OpenPGP digital signature


[Bug 63482] Application hang because of autoSizeColumn

2020-03-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63482

Dominik Stadler  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |WORKSFORME

--- Comment #13 from Dominik Stadler  ---
Also the sample-project on github shows the same timings.

22 seconds for JDK 8, more than 2 minutes for JDK 11 and 12, 6 seconds for JDK
13 and newer.

So I think we can close this issue now, JDK 13 and 14 are GA.

/devtools/openjdk1.8.0_242_x64/bin/java
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_242-b08)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.242-b08, mixed mode)
Mar 08, 2020 3:02:17 PM ro.azmau.poiperf.POIPerformance exportToExcel
INFO: Excel export duration: 0m:22s:281ms:987600ns

/devtools/jdk1.8.0_202_x64/bin/java
java version "1.8.0_202"
Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)
Mar 08, 2020 3:02:42 PM ro.azmau.poiperf.POIPerformance exportToExcel
INFO: Excel export duration: 0m:22s:564ms:076700ns

/devtools/openjdk1.11.0_3_x64/bin/java
openjdk version "11.0.3" 2019-04-16
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.3+7)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.3+7, mixed mode)
Mar 08, 2020 2:58:57 PM ro.azmau.poiperf.POIPerformance exportToExcel
INFO: Excel export duration: 2m:26s:217ms:274600ns

/devtools/openjdk1.12.0_1_x64/bin/java
openjdk version "12" 2019-03-19
OpenJDK Runtime Environment (build 12+33)
OpenJDK 64-Bit Server VM (build 12+33, mixed mode, sharing)
Mar 08, 2020 3:01:23 PM ro.azmau.poiperf.POIPerformance exportToExcel
INFO: Excel export duration: 2m:17s:935ms:624100ns

/devtools/openjdk-13.0.1_x64/bin/java
openjdk version "13.0.1" 2019-10-15
OpenJDK Runtime Environment (build 13.0.1+9)
OpenJDK 64-Bit Server VM (build 13.0.1+9, mixed mode, sharing)
Mar 08, 2020 3:01:38 PM ro.azmau.poiperf.POIPerformance exportToExcel
INFO: Excel export duration: 0m: 6s:681ms:601800ns

/devtools/openjdk-14_x64/bin/java
openjdk version "14" 2020-03-17
OpenJDK Runtime Environment (build 14+36-1461)
OpenJDK 64-Bit Server VM (build 14+36-1461, mixed mode, sharing)
Mar 08, 2020 3:01:46 PM ro.azmau.poiperf.POIPerformance exportToExcel
INFO: Excel export duration: 0m: 6s:209ms:532500ns

/devtools/openjdk-15-ea+13_x64/bin/java
openjdk version "15-ea" 2020-09-15
OpenJDK Runtime Environment (build 15-ea+13-487)
OpenJDK 64-Bit Server VM (build 15-ea+13-487, mixed mode, sharing)
Mar 08, 2020 3:01:53 PM ro.azmau.poiperf.POIPerformance exportToExcel
INFO: Excel export duration: 0m: 6s:336ms:566300ns

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 63482] Application hang because of autoSizeColumn

2020-03-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63482

Dominik Stadler  changed:

   What|Removed |Added

 OS||All
 Status|REOPENED|NEW

--- Comment #12 from Dominik Stadler  ---
I re-ran the tests with the latest versions of the JDK on Windows:

Sample-Application from the JDK-Bug:

/devtools/openjdk1.8.0_242_x64/bin/java
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_242-b08)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.242-b08, mixed mode)
1273 Milli-seconds

/devtools/jdk1.8.0_202_x64/bin/java
java version "1.8.0_202"
Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)
1268 Milli-seconds

/devtools/openjdk1.11.0_3_x64/bin/java
openjdk version "11.0.3" 2019-04-16
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.3+7)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.3+7, mixed mode)
16654 Milli-seconds

/devtools/openjdk1.12.0_1_x64/bin/java
openjdk version "12" 2019-03-19
OpenJDK Runtime Environment (build 12+33)
OpenJDK 64-Bit Server VM (build 12+33, mixed mode, sharing)
16476 Milli-seconds

/devtools/openjdk-13.0.1_x64/bin/java
openjdk version "13.0.1" 2019-10-15
OpenJDK Runtime Environment (build 13.0.1+9)
OpenJDK 64-Bit Server VM (build 13.0.1+9, mixed mode, sharing)
578 Milli-seconds

/devtools/openjdk-14_x64/bin/java
openjdk version "14" 2020-03-17
OpenJDK Runtime Environment (build 14+36-1461)
OpenJDK 64-Bit Server VM (build 14+36-1461, mixed mode, sharing)
549 Milli-seconds

/devtools/openjdk-15-ea+13_x64/bin/java
openjdk version "15-ea" 2020-09-15
OpenJDK Runtime Environment (build 15-ea+13-487)
OpenJDK 64-Bit Server VM (build 15-ea+13-487, mixed mode, sharing)
537 Milli-seconds

So Java 11 and Java 12 are slow here, but 13 onwards seems to be quick,
actually more than twice as fast as JDK 8!

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 56702] Get one exception "java.lang.IllegalStateException: Cannot get a numeric value from a text cell" when calling org.apache.poi.ss.usermodel.DataFormatter.formatCellValue

2020-03-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=56702

Dominik Stadler  changed:

   What|Removed |Added

 Resolution|--- |LATER
 Status|NEEDINFO|RESOLVED

--- Comment #22 from Dominik Stadler  ---
No response for a long time so I am closing this for now until more information
becomes available.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 57062] poi cannot read date is when first column is empty and second column in date

2020-03-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=57062
Bug 57062 depends on bug 56702, which changed state.

Bug 56702 Summary: Get one exception "java.lang.IllegalStateException: Cannot 
get a numeric value from a text cell" when calling 
org.apache.poi.ss.usermodel.DataFormatter.formatCellValue
https://bz.apache.org/bugzilla/show_bug.cgi?id=56702

   What|Removed |Added

 Status|NEEDINFO|RESOLVED
 Resolution|--- |LATER

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 63482] Application hang because of autoSizeColumn

2020-03-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63482

Dominik Stadler  changed:

   What|Removed |Added

 Depends on||58896


Referenced Bugs:

https://bz.apache.org/bugzilla/show_bug.cgi?id=58896
[Bug 58896] autoSizeColumn() is extremely slow if worksheet contains merged
cells
-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 58896] autoSizeColumn() is extremely slow if worksheet contains merged cells

2020-03-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=58896

Dominik Stadler  changed:

   What|Removed |Added

 Blocks||63482

--- Comment #16 from Dominik Stadler  ---
Applied a change via r1874973 which should speed up autosizing/getColumnWidth
for large spreadsheets with many merged regions.

Some slowdown in font-handling in some version of the JDK is handled via bug
#63482.


Referenced Bugs:

https://bz.apache.org/bugzilla/show_bug.cgi?id=63482
[Bug 63482] Application hang because of autoSizeColumn
-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 63482] Application hang because of autoSizeColumn

2020-03-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63482
Bug 63482 depends on bug 58896, which changed state.

Bug 58896 Summary: autoSizeColumn() is extremely slow if worksheet contains 
merged cells
https://bz.apache.org/bugzilla/show_bug.cgi?id=58896

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 52834] ColumnHelper.getColumnWidth does not scale to large numbers of rows, with large numbers of merged regions

2020-03-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=52834
Bug 52834 depends on bug 58896, which changed state.

Bug 58896 Summary: autoSizeColumn() is extremely slow if worksheet contains 
merged cells
https://bz.apache.org/bugzilla/show_bug.cgi?id=58896

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 60417] autoSizeColumn(int i) swallows interrupted exception and resets interrupted flag

2020-03-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=60417
Bug 60417 depends on bug 58896, which changed state.

Bug 58896 Summary: autoSizeColumn() is extremely slow if worksheet contains 
merged cells
https://bz.apache.org/bugzilla/show_bug.cgi?id=58896

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 58896] autoSizeColumn() is extremely slow if worksheet contains merged cells

2020-03-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=58896

Dominik Stadler  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 52834] ColumnHelper.getColumnWidth does not scale to large numbers of rows, with large numbers of merged regions

2020-03-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=52834

Dominik Stadler  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Dominik Stadler  ---
Applied a similar change via r1874973 which should speed up
autosizing/getColumnWidth for large spreadsheets with many merged regions.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 62710] SXSSFSheet.autoSizeColumn() doesn't run well for Asian characters.

2020-03-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=62710

Dominik Stadler  changed:

   What|Removed |Added

 Status|NEEDINFO|RESOLVED
 Resolution|--- |LATER

--- Comment #3 from Dominik Stadler  ---
No additional information provided for a long time and we cannot properly
reproduce this with the amount of information given, thus I have to cose this
for now, please reopen with more information and source-code which reproduces
the problem.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 55528] setAutoFilter freezes cell

2020-03-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=55528

Dominik Stadler  changed:

   What|Removed |Added

 Resolution|--- |WORKSFORME
 Status|NEEDINFO|RESOLVED

--- Comment #2 from Dominik Stadler  ---
No response for a long time so nothing that we can do here for now.

If this is still a problem then please provide specific steps/self-sufficient
source-code which reproduces the problem, otherwise it is hard to investigate
this.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 60651] Auto filter crashes excel when sorting

2020-03-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=60651

Dominik Stadler  changed:

   What|Removed |Added

 Resolution|--- |INVALID
 Status|NEW |RESOLVED

--- Comment #4 from Dominik Stadler  ---
We cannot prevent Excel from crashing here and it is hard to find out what
exactly triggers the crash.

As far as we see Apache POI is writing the format correctly here, also
LibreOffice correctly opens and sorts this document.

If this is still an issue you likely need to use more official Microsoft
support channels where you receive more responses.

Overall I don't see anything that can be done in Apache POI right now.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 47658] no method to autosize rows

2020-03-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=47658

Dominik Stadler  changed:

   What|Removed |Added

 Blocks||46447


Referenced Bugs:

https://bz.apache.org/bugzilla/show_bug.cgi?id=46447
[Bug 46447] Applying style with big font does not update row height attributes
-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 46447] Applying style with big font does not update row height attributes

2020-03-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=46447

Dominik Stadler  changed:

   What|Removed |Added

 Depends on||47658


Referenced Bugs:

https://bz.apache.org/bugzilla/show_bug.cgi?id=47658
[Bug 47658] no method to autosize rows
-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 46447] Applying style with big font does not update row height attributes

2020-03-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=46447

Dominik Stadler  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |INFORMATIONPROVIDED

--- Comment #2 from Dominik Stadler  ---
As far as I see you are not adjusting the height of the row anywhere and Apache
POI does not try to auto-size row-height based on fonts used in any cell. 

So by specifying the row-height via

row.setHeightInPoints((short)30);

before writing the file you should be able to get the expected behavior.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 60282] getFontHeightInPoints() has wrong type

2020-03-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=60282

Dominik Stadler  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |WONTFIX

--- Comment #2 from Dominik Stadler  ---
As described the migration to different API would be a long and tedious
process. Also some of the underlying formats store the 1/20th as integer-value,
so they cannot represent the decimal value anyway.

Therefore I think we should stick with what we have right now as you can use
the InPoints() for the raw value and do computations yourself in
double-precision if necessary.

Updated comments and introduced a common constant Font.TWIPS_PER_POINT for the
"20" via r1874966.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org