Bug 51022 - Print range lost on file save/reopen if the file contains external link
Summary: Print range lost on file save/reopen if the file contains external link
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.5.4 release
Hardware: Other Windows (All)
: medium major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Print-Range
  Show dependency treegraph
 
Reported: 2012-06-12 23:53 UTC by HD
Modified: 2019-02-25 21:37 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description HD 2012-06-12 23:53:07 UTC
Reproduced with LibreOffice 3.4.5, 3.5.4 on XP and Win 7.
It worked fine with OpenOffice.org 3.2.1 and 3.3.0.

If a Calc file contains an external link, print range at last sheet is
lost when saved and reopened. And as I stated, whether the file has 2
sheets, 3 sheets or 10 sheets, only the last sheet of the document is
affected by this bug.

It can be reproduced with a new document, and reproducible everytime.

Steps to reproduce:
1. Create 2 new Calc files. (A.ods, B.ods)
2. Open A.ods and enter a data into A1 of Sheet1 and save.
3. Open B.ods and insert an external link at A1 of Sheet 1 to refer
   the data entered to A.ods at step 2.
4. Enter data to the remaining sheets of B.ods so all sheets have
   print range each.
5. Save B.ods, close and reopen.
6. Print range at last sheet is lost.

If I open the file saved at the above step 5 with OO 3.2.1 and 3.3.0,
the print range is ok. And if I save the file at the above step 6, then 
open it with OO, the print range isn't loaded.

Therefore LO CAN save the print range, however, CAN NOT load it when
reopened. (Overwrite the file at this point will permanently loses it.)

Also, if I set the print range again with LO, it is lost again when
reopened. But then it starts working fine if the link is removed.

Here are the work-arounds I have found so far, but I don't think these
are all that practical.

-Insert a blank sheet at the end of the document. (Hide the blank sheet
 if needed.)
-If a file has a sheet that does not need to be printed, move this sheet
 to the end of the document.
Comment 1 HD 2012-06-13 00:03:37 UTC
Another case to point out.

Use Excel to create an xls file with the same steps as comment 1.
But this time, insert the link to Sheet 2.(Make sure Sheet1 has just some
plain texts w/o any links) And save it while all sheets are set to normal
view, open with LO and save as ods. Reopen the ods and LO does not lose
the print range.

If the xls is saved by using Excel while any of the sheets are in page
preview mode, then the bug is reproduced.

Also, if the link is set to the first sheet of the xls, the bug is reproduced
regardless the view mode.
Comment 2 HD 2012-06-14 18:17:04 UTC
I did some further testing.

The bug wasn't reproducible with versions 3.3.4 and earlier. However, newly
created files with 3.4.0 could reproduce the bug. Therefore, whatever the
change that was made between 3.3.4 and 3.4.0 may be the cause of this bug
and that also means that all versions after 3.4.0 up to the latest version
3.5.4 would be affected.

And files created with 3.3.4 and earlier were not affected even when opened
with 3.4.0 and could also be overwritten w/o losing its print range.
Comment 3 HD 2012-06-14 18:55:13 UTC
One more thing I forgot to mention.

The bug occurs if the print range is defined.

Delete all the defined print range so that all cells with data entered would
automatically be subject of printing, all sheets will keep its print range.

Although I cannot recall at what version of LO starts off with defined range
for the fresh sheet (As for an example, start a new Calc file with 3.5.4 and
go to "Format" -> "Print Range" and you can see that "Delete" can be pressed.
And it means that there is a defined print range even though it is a fresh
sheet) This could also be a part of the cause to this bug, perhaps?
Comment 4 HD 2012-06-14 21:27:33 UTC
Now that I looked into it, new files created with versions 3.3.0 - 3.3.4
do not have a print range defined with fresh sheets. It looks like this
predefined print range feature was first introduced with version 3.4.0.

If I define a print range to a sheet with links using 3.3.4, then it is
lost when opened with 3.4.0 and later versions. It worked fine when print
ranges were defined to all sheets except for the sheet with links.
Comment 5 mlp 2013-01-10 13:28:09 UTC
So it's been out there for six months now, has it not? Yes indeed this beetle is -quite- annoying. Running Libre Office 3.6.4.3  on an XP pro. Pentium 4 and the pest is still there...

Thanks a lot to HD for the detailed reporting which provides with a temporary fix or so it seems: just add an empty sheet at the end of your project and the infectious insect loses all power to irritate.
Comment 6 stuttgarter 2013-04-22 12:36:27 UTC
The bug also exists on ubuntu 12.04 and libreOffice 3.5.7.2
Comment 7 Dave 2014-06-12 08:26:45 UTC
This bug still exists in 4.2.4. 

Thanks to those who pointed out that it only applies to the last sheet, and therefore there is a workaround.
Comment 8 QA Administrators 2016-01-17 20:04:58 UTC Comment hidden (obsolete)
Comment 9 Frédéric Lespez 2016-03-12 15:24:32 UTC
This bug still exist in LibreOffice 5.0.5 and it still only applies to the last sheet.
Comment 10 QA Administrators 2018-06-28 02:47:44 UTC Comment hidden (obsolete)
Comment 11 Frédéric Lespez 2018-06-28 15:51:38 UTC
This bug is still present in Libreoffice 6.0.5.2 under Debian.