Bug 157783 - FILESAVE PPTX: graphic elements change color on save/reload cycle
Summary: FILESAVE PPTX: graphic elements change color on save/reload cycle
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
7.6.0.3 release
Hardware: All All
: medium normal
Assignee: Balázs Varga (allotropia)
URL:
Whiteboard: target:24.8.0 target:24.2.0.2
Keywords: bibisected, bisected, regression
Depends on:
Blocks: OOXML-Doc-Themes
  Show dependency treegraph
 
Reported: 2023-10-15 01:08 UTC by Gerald Pfeifer
Modified: 2024-01-11 12:01 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
First deck to reproduce issue (PPTX format) (41.22 KB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2023-10-15 01:08 UTC, Gerald Pfeifer
Details
Second deck to reproduce issue (PPTX format) (725.22 KB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2023-10-15 01:09 UTC, Gerald Pfeifer
Details
Visual comparison: Left as it should be, right as it is after save/open (88.19 KB, image/png)
2023-10-15 01:10 UTC, Gerald Pfeifer
Details
Single page powerpoint slide with embedded bar chart (pptx) (40.97 KB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2023-11-02 13:08 UTC, Alex Heuer
Details
Alternate test file with (partially) different issues (104.67 KB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2024-01-03 10:33 UTC, Alex Heuer
Details
Streenshot of test_reupload.pptx after opening but before saving (50.54 KB, image/png)
2024-01-03 10:36 UTC, Alex Heuer
Details
Screenshot of test_reupload.pptx after opening, saving, closing, and reopening the file (62.41 KB, image/png)
2024-01-03 10:36 UTC, Alex Heuer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gerald Pfeifer 2023-10-15 01:08:56 UTC
Created attachment 190222 [details]
First deck to reproduce issue (PPTX format)

How to reproduce:

  1. Open slide1.pptx and slide2.pptx as attached to this report.
  2. Copy slides from the latter and...
  3. ...paste them into the former.
  4. Save combined deck with three slides as PPTX.
  5. Open just saved deck.

  Expected: Deck looks the same before and after save/reopen cycle.
  Actual: Colors of various graphical elements changed quite a bit.

Not seen in:

  Version: 7.3.8.0.0+ / LibreOffice Community
  Build ID: 0f7fb0a2decec3f8869098ae5e47ee6055545486
  CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
  Locale: en-US (en_US.UTF-8); UI: en-US

  Version: 7.5.6.0.0+ (X86_64) / LibreOffice Community
  Build ID: 0a5c49aa4f65c8e661f7da3934ab9bea8cacf662
  CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
  Locale: en-US (en_US.UTF-8); UI: en-US

Seen in:

  Version: 7.6.3.0.0+ (X86_64) / LibreOffice Community
  Build ID: 9c8a1994bea590db7436638580231daf31844fd6
  CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
  Locale: en-US (en_US.UTF-8); UI: en-US

  Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
  Build ID: e9374f74385d7dfe77d1902d3d82af20143bc775
  CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
  Locale: en-US (en_US.UTF-8); UI: en-US
Comment 1 Gerald Pfeifer 2023-10-15 01:09:44 UTC
Created attachment 190223 [details]
Second deck to reproduce issue (PPTX format)
Comment 2 Gerald Pfeifer 2023-10-15 01:10:36 UTC
Created attachment 190224 [details]
Visual comparison: Left as it should be, right as it is after save/open
Comment 3 BogdanB 2023-10-15 07:55:00 UTC
Confirm with
Version: 7.6.2.1 (X86_64) / LibreOffice Community
Build ID: 56f7684011345957bbf33a7ee678afaf4d2ba333
CPU threads: 16; OS: Linux 6.2; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 4 BogdanB 2023-10-15 08:06:04 UTC
 34c4a1709bd20127d98085e08b5c031fb6e613d9 is the first bad commit
commit 34c4a1709bd20127d98085e08b5c031fb6e613d9
Author: Jenkins Build User <tdf@pollux.tdf>
Date:   Mon Apr 24 23:52:55 2023 +0200

    source c3f7720ff13c34b9cf2c90d9c9b6dcc3d8f4c7a5
    
    source c3f7720ff13c34b9cf2c90d9c9b6dcc3d8f4c7a5

 instdir/program/libdocmodello.so     | Bin 178760 -> 178576 bytes
 instdir/program/libmswordlo.so       | Bin 2989232 -> 2989232 bytes
 instdir/program/libooxlo.so          | Bin 6503600 -> 6526640 bytes
 instdir/program/libscfiltlo.so       | Bin 6193552 -> 6193656 bytes
 instdir/program/libsdlo.so           | Bin 10495200 -> 10480408 bytes
 instdir/program/libsvxcorelo.so      | Bin 12244920 -> 12244920 bytes
 instdir/program/libsvxlo.so          | Bin 5500112 -> 5500112 bytes
 instdir/program/libswlo.so           | Bin 22555760 -> 22555760 bytes
 instdir/program/libwriterfilterlo.so | Bin 3656280 -> 3655992 bytes
 instdir/program/libxolo.so           | Bin 6287328 -> 6287240 bytes
 instdir/program/setuprc              |   2 +-
 instdir/program/versionrc            |   2 +-
 12 files changed, 2 insertions(+), 2 deletions(-)
Comment 5 BogdanB 2023-10-15 08:07:14 UTC
Tomaz, I added you here. Please, can you take a look?

author	Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>	2023-03-23 11:37:40 +0900
committer	Tomaž Vajngerl <quikee@gmail.com>	2023-04-24 23:49:57 +0200
commit c3f7720ff13c34b9cf2c90d9c9b6dcc3d8f4c7a5 (patch)
tree 98b24e4e90c0d858307b58bcd09c9b2d590893e8
parent 09cdcb5f37bb4e42da7b28db6e757b9f2affed14 (diff)
oox: extend ThemeExport to export font and format scheme of a theme
Also use the ThemeExport when exporting PPTX documents and remove
all the hard-coded theme bits.

Change-Id: I03791e23d6ac4023748b5a553e4824b72ed63a93
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149363
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Comment 6 Regina Henschel 2023-10-15 23:53:33 UTC
The theme is lost on pptx export.

If odp-format is used, both themes are preserved on load and save. Only the UI does not allow to set different themes on different master slides.
Comment 7 Alex Heuer 2023-10-22 15:35:28 UTC
Confirm with
Version: 7.6.2.1 (X86_64) / LibreOffice Community
Build ID: 60(Build:1)
CPU threads: 24; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: de-DE (en_US.UTF-8); UI: en-US
Ubuntu package version: 4:7.6.2~rc1-0ubuntu0.22.04.1~lo1
Calc: threaded


For me I actually get this issue without copying slides. I open a pptx which was created and saved on a Windows machine using Office365. After opening the presentation looks as it should. All I then do is save the presentation using LibreOffice, without modifying it in any way.
Closing LibreOffice after the save, then reopening the just saved pptx I see several elements (some shapes, some text) have changed color. 

If necessary I can also provide a test file.
Comment 8 Alex Heuer 2023-11-02 13:08:05 UTC
Created attachment 190612 [details]
Single page powerpoint slide with embedded bar chart (pptx)

Open this file in libreoffice, without editing anything just save (CTRL+S), close libreoffice then reopen the file again. You will notice some elements have changed color from green to blue.

Seems to be related to presence of bar chart
Comment 9 Alex Heuer 2023-11-02 13:16:31 UTC
I have done some more digging and added an attachment with a single slide that reproduces the issue. Opening the attachment 190612 [details] with libreoffice displays the slide as it should look. Some green elements and a bar chart with embedded table data.

If you then just hit CTRL+S to save the file in place, close libreoffice and reopen the file, you will notice two things:
1. Some of the green elements on the slide have changed to blue
2. The bar chart is garbled to a single column

If you open the file in Microsoft Powerpoint and remove the chart alltogether, the problem in libreoffice no longer exists and the green elements stay green. This leads me to believe it might be related to the inclusion of the bar chart? Maybe a color in the chart somehow overwrites colors in the presentation?

Interestingly enough, if you open the test file in libreoffice and, before saving, remove the chart in libreoffice, the color change still happens which leads me to further guess that things probably go wrong during or after loading the graph element and not so much during saving (even though the changes are not shown in the UI till after the save and reload cycle).

I hope I was able to shed a bit more light on the issue, please feel free to contact me if I can be of any help or assistance in tracking this down even further because as it is now I can no longer use libreoffice for business-related files anymore :(
Comment 10 Alex Heuer 2023-12-12 15:37:15 UTC
Still present in 7.6.4.1
Comment 11 Commit Notification 2024-01-01 18:12:07 UTC
Balazs Varga committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/167659bf16a68c27fa547e6eccd62c1a6f69b057

tdf#157742 tdf#157783 - sd: fix copy master slides style

It will be available in 24.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Gerald Pfeifer 2024-01-03 09:54:17 UTC
Happy to confirm this appears fixed in

  Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
  Build ID: 960e37af28807ed1b376e26c4504ab755a81dfd5
  CPU threads: 12; OS: Linux 6.6; UI render: default; VCL: gtk3
  Locale: en-US (en_US.UTF-8); UI: en-US

Thank you, Balázs!
 	
Balázs, are you going to push this to 24.2 as well? Your fix addresses
a bad regressions we "gained" last year.
Comment 13 Gerald Pfeifer 2024-01-03 10:05:33 UTC
(In reply to Alex Heuer from comment #9)
> I have done some more digging and added an attachment with a single slide
> that reproduces the issue. Opening the attachment 190612 [details] with
> libreoffice displays the slide as it should look. Some green elements and a
> bar chart with embedded table data.

Alex, when I open this in 7.5, 7.6.3, 7.6.4, and current 24.8 the three
boxes labeled "green 1" to "green 3" always render as blue and I cannot
reproduce a change when saving and reopening.

If you still see this issue with a 24.8 snapshot, can you please file a
new issue and include before and after screenshots (or ideally one that
shows both as I have done it in this bug report, 3rd attachment)?
Comment 14 Alex Heuer 2024-01-03 10:33:40 UTC
Created attachment 191725 [details]
Alternate test file with (partially) different issues

In reply to Gerald: I tried downloading the file from bugzilla and had the same problem you described. I have uploaded a test_reupload.pptx and will also upload screenshots shortly
Comment 15 Alex Heuer 2024-01-03 10:36:00 UTC
Created attachment 191726 [details]
Streenshot of test_reupload.pptx after opening but before saving
Comment 16 Alex Heuer 2024-01-03 10:36:29 UTC
Created attachment 191727 [details]
Screenshot of test_reupload.pptx after opening, saving, closing, and reopening the file
Comment 17 Gerald Pfeifer 2024-01-03 10:42:28 UTC
I gave it a try with current development of 24.08, and *some* of the
color changes have been addressed, *some* have not. This looks like it
warrants a new bug report.

Also indeed the charts gets rather "destroyed" which definitely is a bug,
and one I recommend filing separately from the color issue. Any chance
you can minimize that one and ideally reproduce it with just the chart?
Comment 18 Alex Heuer 2024-01-03 10:58:29 UTC
Hi Gerald,

a few weird observations on my part:

1) I tried deleting all slide elements *except* the graph using MS PowerPoint. If I do this, saving the file with LibreOffice does not garble the graph anymore. So something on that page causes LO to act up

2) The graph does show a minor inconsistency when opening it with LO as in numbers being displayed in the elements in one of the bars (which was deactivated using MS PP)


If I understand correctly I should file two bug reports. One for the formatting and one for the chart. As it looks I would have to use the same test files. I can provide screenshots from within MS PP as well as LO.

If you think this makes sense I will go ahead and create the reports.
Comment 19 Alex Heuer 2024-01-03 20:52:42 UTC
Opened up a new bug for the remaining issues: https://bugs.documentfoundation.org/show_bug.cgi?id=159005
Comment 20 Commit Notification 2024-01-11 12:01:02 UTC
Balazs Varga committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/7f66797b10b91242c7025215156922bb17c5a777

tdf#157742 tdf#157783 - sd: fix copy master slides style

It will be available in 24.2.0.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.