You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openoffice.apache.org by bu...@apache.org on 2020/04/27 17:31:26 UTC

[Issue 127395] setActiveSheet does not work in Hidden mode

https://bz.apache.org/ooo/show_bug.cgi?id=127395

peterB <Pe...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #86041|0                           |1
        is obsolete|                            |
  Attachment #86071|0                           |1
        is obsolete|                            |

--- Comment #14 from peterB <Pe...@gmail.com> ---
Created attachment 86933
  --> https://bz.apache.org/ooo/attachment.cgi?id=86933&action=edit
Original .py script updated with my workaround

An update on this - I have been able to work round the bug using moveByName,
instead of setActiveSheet.
Using this, I move each required sheet to be first and storeToURL to export it.

I don't know if anyone is interested in this work-around, or in a test harness
if fixing the underlying bug.

I am a python-er and attach an updated version of oo-save-ods-sheet.py, my
butchered subset of the UNOCONV script
(ref: https://github.com/dagwieers/unoconv) which I was trying to modify to
save .ods sheets as .csv

Also the optional supporting "expected outcome" file
oo-save-ods-sheet-sheet3.csv

The script now takes various arguments. If run on Windows with no argument it
exports from the (also attached)
oo-save-ods-sheet.ods without using Hidden mode.

If oo-save-ods-sheet-sheet3.csv is in the same folder it compares the generated
file (oo-save-ods-sheet.csv)
to it and reports that they are the same (ie: "Sheet3" has been saved).

If you add the -Hidden argument, you will see the problem, with
oo-save-ods-sheet.csv containing the first sheet ("Bikes"),
not the last.

I have run it against OpenOffice on Windows 10 and LibreOffice on Ubuntu. It is
simplified, with hard-wirings for those environments.
I assume you could make it run elsewhere by changing the variables settings
towards the end, before the Main entry point.

My suggested test sequence is:
1. Run with no args: .../python oo-save-ods-sheet.py 
   .ods will flash on screen before reporting: Export done, created file
oo-save-ods-sheet.csv same as oo-save-ods-sheet-sheet3.csv
2. Run: .../python oo-save-ods-sheet.py -Hidden
   No flash on screen, but reports: Export done, created file
oo-save-ods-sheet.csv NOT same as oo-save-ods-sheet-sheet3.csv
3. Run: .../python oo-save-ods-sheet.py -Hidden -workAround
   Runs OK, as test #1, also reporting: Moved Sheet3 to be first, before: Bikes

-- 
You are receiving this mail because:
You are the assignee for the issue.