Bug 59159 - Styles only used in CONDITIONAL FORMATTING not copied with sheet to new document
Summary: Styles only used in CONDITIONAL FORMATTING not copied with sheet to new document
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.6.0.4 release
Hardware: Other Windows (All)
: medium normal
Assignee: Markus Mohrhard
QA Contact:
URL:
Whiteboard: BSA target:4.1.0 target:4.0.0.2
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-09 08:40 UTC by john.pratt
Modified: 2013-01-21 17:42 UTC (History)
5 users (show)

See Also:


Attachments
Sample for Comment 4 (7.65 KB, application/vnd.oasis.opendocument.spreadsheet)
2013-01-10 21:38 UTC, Rainer Bielefeld Retired
Details

Note You need to log in before you can comment on or make changes to this bug.
Description john.pratt 2013-01-09 08:40:42 UTC
Created as a result of bug 58677

Problem description: when copying a sheet between documents the conditional formatting is broken if the style used is a custom style.

Steps to reproduce:
1. Create a document with a conditional format which uses a custom style.
2. Copy the whole sheet (by right clicking on the sheet tab) to a new document

Current behaviour: the conditional format is broken in the copy as the style is not copied across

Expected behaviour: the style should also be copied so that the conditional format works

Workaround: if the conditional format is used elsewhere (e.g. using the styles window set a different cell to use the custom style (not in a conditional format).  The custom style is then copied and the conditional formatting works on the copy.
Operating System: Windows XP
Version: 4.0.0.0.beta2
Comment 1 Joel Madero 2013-01-10 17:20:54 UTC
I cannot reproduce this in Linux so if it exists it is indeed a Windows only bug. RC1 comes out next week, please test again and close the bug if it seems to be fixed.

Thanks for reporting!
Comment 2 Joel Madero 2013-01-10 19:05:31 UTC
Marking as NEW (confirmed)
Comment 3 Joel Madero 2013-01-10 19:07:09 UTC
Sorry wrong bug! Putting back to UNCONFIRMED.

Cc'ing Marcus since he has the most experience with conditional formatting
Comment 4 Rainer Bielefeld Retired 2013-01-10 21:37:15 UTC
NEW due to "58677 - CONDITIONAL FORMATTING lost after sheet has been copied to new document"
[Reproducible] with server installation of  "4.1.0.0.alpha0+ (Build ID: 6a393297ce6d99bbc4edefbf01ab9c5c6f0eff8) TinderBox: Win-x86@6, Branch:master, Time: 2013-01-04_01:06:01  - ENGLISH UI / German Locale  on German WIN7 Home Premium (64bit) with LO41 Masters User Profile
Ans sample document I will attach. The sample document is the sample document  Attachment 71072 [details] for Bug 55032 with a small modification, Cell B1  contains a LibO Standard Stylefor CF

Steps how to reproduce:
1. Open document from LibO Start Center
2. ./. 
3. Click back to Sheet1 tab
4. Right click Sheet1 tab
   > Context menu
5. 'Move/Copy Sheet -> Copy -> To Document = New Document -> <OK>'
   > New document with sheet contents created
   Expected: A1 with yellow background
   Actual: No background, No CF 

But Cell B1 With a standard LibO Style for CF keeps the CV
Reason for the problem is that Style "john" will not be copied to new document.
The problem will be healed if you also youse Style "john" for a quite normal cell formatting:

11. Open document from LibO Start Center
12. Apply style "john" for cell C1 
13. Click back to Sheet1 tab
14. Right click Sheet1 tab
   > Context menu
15. 'Move/Copy Sheet -> Copy -> To Document = New Document -> <OK>'
   > New document with sheet contents created
   Expected: A1 with yellow background CF
   Actual: ta-da, Cell A1 with CF

@Joel:
Can you please try again with Linux?
Comment 5 Rainer Bielefeld Retired 2013-01-10 21:38:49 UTC
Created attachment 72811 [details]
Sample for Comment 4
Comment 6 Rainer Bielefeld Retired 2013-01-11 06:45:46 UTC
Already [Reproducible] with 
* Server Installation of  "LibreOffice 3.6.0.1 rc  German UI/Locale [Build-ID: 73f9fb6] on German WIN7 Home Premium (64bit)     /new CF/
* with Server Installation of  "LibreOffice 3.6.0.4  German UI/Locale [Build-ID:  932b512] on German WIN7 Home Premium (64bit)  /new CF/

Still worked fine with
*  Server installation of Master "LOdev 3.6.0alpha0+  – WIN7 Home Premium (64bit) ENGLISH UI [Build ID: 7175cee]" (tinderbox: Win-x86@6-fast, pull time 2012-05-16 22:07:37)  /old CF/

Something completely different:
I wonder whether it's a bug or a feature that only styles used in a sheet will be copied to a new target document, but not styles what are used in other sheets of the source document (what also might be useful in the copied sheet).
Comment 7 john.pratt 2013-01-11 08:10:41 UTC
@Rainer Bielefeld
I don't think this can be a feature as it breaks the conditional formatting, but I agree that it is a feature to not copy all styles from a document (it should copy only the relevant ones).


Another related problem:
A. create two documents with a custom style in each (with the same name, but different, e.g. one does a red background and the other does a yellow background).
B. copy a sheet from one document to the other

Current behaviour: the formatting (of the copy) changes to match the style as defined in the destination file (e.g. cell which is formatted red using a style called 'john' will be yellow when copied to another document which already contains a style called 'john' which is defined to abe a yellow background).

Expected behaviour: one of the styles is renamed to avoid a clash or a warning is displayed to advise me that a clash between styles exists - do I still want to copy?  (Ideally it will check if the styles actually match so that it doesn't appear when both have a style called 'john' but they are identical styles.)

New bug report for this or not?
Comment 8 Not Assigned 2013-01-19 08:15:21 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5c8e6ccaf6ea7a187e3d16f3d865cbed5eba0874

copy styles from cond format between different docs, fdo#59159



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 9 Not Assigned 2013-01-21 16:33:34 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "libreoffice-4-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=dc62ab3a0c41fe91f776929824a7f7109508a0ae&h=libreoffice-4-0

copy styles from cond format between different docs, fdo#59159


It will be available in LibreOffice 4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.