Bug 43720 - Calc: Cells background color is printed even when cell protection is "hide from printing"
Summary: Calc: Cells background color is printed even when cell protection is "hide fr...
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
3.3.4 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 91644 152372 (view as bug list)
Depends on:
Blocks: Cell-Sheet-Protection
  Show dependency treegraph
 
Reported: 2011-12-11 10:08 UTC by Phil Nichols
Modified: 2023-06-01 18:53 UTC (History)
7 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 Phil Nichols 2011-12-11 10:08:27 UTC

    
Comment 1 Phil Nichols 2011-12-11 10:14:16 UTC
When printing a sheet that has cells formatted with the property to "hide with printing", the cell contents and borders are not printed, but the background color is printed. I believe this is incorrect behavior.

This is true regardless of the setting of the "tools\options\calc\print\suppress output of empty pages" item.

I believe the background color of a cell should be a property of the cell and it should be printed or not printed when the cell is printed or not printed. The cell may be printed or not, but it is not correct to print some parts of the cell and not others.

I believe the CELL should have properties of:
  content (text, for example)
  background color
  border
  etc.

If a CELL is protected from printing with "hide when printing", no property of that cell should be printed - including the background color.

If a CELL has background color but no text content and no border, then the cell is not null and it should be printed unless the "hide when printing" property is set.

If all of the cells on a printable page have no content, no background color and no border, or were marked as "hide when printing" then that page would be elgible to be print-suppressed depending up the "suppress output of empty pages" setting.

I believe thinking about cell(s) this way would clear up all of these inconsistencies when printing.
Comment 2 sasha.libreoffice 2012-04-27 10:07:50 UTC
reproduced in 3.3.4 and 3.5.2 on Fedora 64 bit and Winows 7 32 bit
changing version to 3.3.4 as most early reproducible
Comment 3 A (Andy) 2014-09-20 21:26:10 UTC
reproducible with LO 4.3.1.2 (Win 8.1)
Comment 4 chemist56 2015-01-20 20:46:50 UTC
reproducible with LO 4.3.5 / Win7-64.

If no printing range is defined, pages that contain only cells with hidden content will generated and printed. The print shows borders and/or background colors.

Also if the sheet contains on the "first page" only hidden cells without borders and/or background colors an empty page will be shown and printed.

After 'protect cell' + 'hide all' + 'protect sheet' the "empty" cells and their formats remain visible on the screen. Is this the intended behaviour because only a whole column/row can be hidden?
Comment 5 Buovjaga 2015-06-08 13:19:07 UTC
*** Bug 91644 has been marked as a duplicate of this bug. ***
Comment 6 QA Administrators 2016-09-20 10:00:41 UTC Comment hidden (obsolete)
Comment 7 Phil Nichols 2016-09-24 22:48:23 UTC
This bug still exists in version 5.2.1 Fresh.

Behavior has changed slightly, either in v 4.x.x or 5.x.x, so that now if a cell has text contents, a border, and a background color, and is formatted to 'hide when printing', the text is not printed (as expected) but the border is printed and the background color is printed.  

When first observed, some many version back, borders and text contents were suppressed, but only the background color was printed.
Comment 8 Yousuf Philips (jay) (retired) 2017-04-26 14:30:19 UTC
Not sure if this a bug or not, as i wouldnt classify the cell background to be part of the cell data unless maybe it was formatted based on conditional formatting, but lets see what the exports say. @Regina: What does ODF say about this setting?

https://help.libreoffice.org/Calc/Cell_Protection
Comment 9 Phil Nichols 2017-04-26 17:17:13 UTC
(In reply to Yousuf Philips (jay) from comment #8)
> Not sure if this a bug or not, as i wouldnt classify the cell background to
> be part of the cell data unless maybe it was formatted based on conditional
> formatting, but lets see what the exports say. @Regina: What does ODF say
> about this setting?
> 
> https://help.libreoffice.org/Calc/Cell_Protection

Yes, it's a bug. The setting is to hide or display the entire CELL, not just the text. The cell's color, border and text contents are all part of and properties of the cell. Otherwise you can have a sheet that's full of "hidden when printing" cells, blank, but instead of a printed blank sheet you get a sheet with a bunch of scattered yellow rectangles with no text.
Comment 10 Regina Henschel 2017-04-26 20:18:37 UTC
The attribute is in ODF 20.323.3. The only description there is,
"The style:print-content attribute specifies if cell content is printed."

But the background of the cell is an attribute of the cell and not a content. Therefore I think, that it is correct, that the background is printed. I see no way in the file format to exclude the background from printing.
Comment 11 Yousuf Philips (jay) (retired) 2017-04-26 21:17:58 UTC
(In reply to Phil Nichols from comment #9)
> Yes, it's a bug. The setting is to hide or display the entire CELL, not just
> the text.

As Regina has confirmed that the file format setting is to hide only the cell content, i'm closing this bug accordingly.
Comment 12 raal 2023-06-01 18:53:19 UTC
*** Bug 152372 has been marked as a duplicate of this bug. ***