Bug 89245 - FORMATTING, FILESAVE: Header and footer background images are not saved
Summary: FORMATTING, FILESAVE: Header and footer background images are not saved
Status: CLOSED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
4.4.0.3 release
Hardware: All All
: highest critical
Assignee: Miklos Vajna
URL:
Whiteboard: odf target:5.1.0 target:5.0.2 target:...
Keywords: bibisected, bisected, dataLoss, regression
: 89614 90098 90378 92294 92680 93916 (view as bug list)
Depends on:
Blocks: mab4.4
  Show dependency treegraph
 
Reported: 2015-02-09 08:24 UTC by Joerg Honerla
Modified: 2016-10-25 19:19 UTC (History)
28 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 Joerg Honerla 2015-02-09 08:24:00 UTC
Images as part of a page header were lost in Libreoffice Calc.
Comment 1 raal 2015-02-09 12:18:15 UTC
Hello Joerg,

Thank you for reporting the bug. Unfortunately without clear steps to reproduce it, we cannot track down the origin of the problem. Please provide a clearer set of step-by-step instructions on how to reproduce the problem.
Comment 2 Joerg Honerla 2015-02-09 13:40:26 UTC
I can produce the bug in the following way

1. Create a new spreadsheeth document
2. Type anything in
3. Select >>Format >>Page >>Page Header >>more... >>Background >>as: Graphic
4. Select the graphics file (in my case a PNG-Graphic), select position (in my case upper right)
5. Click OK
6. Look into the page preview, the page is shown as expected! The logo is placed in the upper right corner.
7. Save the document
8. Close Libreoffice
9. Open the document a second time
10. Look into the page preview, there is no Graphic!

This bug is new in version 4.4. There are no problems in version 4.3. I use the german version of Libreoffice, so the translation of the buttons etc. can be uncorrect.

I have opened the .ods-document with an file archiver (ark under linux). In the directory "pictures" no files are stored.
Comment 3 A (Andy) 2015-02-09 14:12:51 UTC
@Joerg: Thank you very much for your fast reply to raal's comment and additional information to reproduce this bug.

Reproducible with LO 4.4.0.3, Win 8.1
Comment 4 Rostislav 'R.Yu.' Okulov 2015-02-10 20:06:13 UTC
Because of lot's of broken builds (Format -> Page = Crash) it is very hard to bibisect.
Comment 5 Matthew Francis 2015-02-11 00:56:33 UTC
Bibisect results from 44:

Format - Page breaks as of
source-hash-a7e1ffc248bed431693c6d50c02e7c936c67f360

and is fixed as of one of
source-hash-b9789a63191830a74569ed46f4292968818b5fe2
source-hash-973eb2f6db60c0939299a968a3121e3310e6d1f5

These should correspond to the below source commits 7d9bb549d498d6beed2c4050c402d09643febdfa (break), and f9aa686432c0ba62c6f440302d5a35856496a786 (fix) respectively.

There's nothing that looks relevant between those two for sc/source/core/data/documen9.cxx (which both touch), so I'm going to assume it was probably the former commit that broke the retention of background images.

Adding Cc: to vmiklos@collabora.co.uk; Could you possibly take a look at this? Thanks


commit 7d9bb549d498d6beed2c4050c402d09643febdfa
Author:     Armin Le Grand <alg@apache.org>
AuthorDate: Mon Jun 2 15:00:50 2014 +0000
Commit:     Miklos Vajna <vmiklos@collabora.co.uk>
CommitDate: Tue Jul 1 13:30:09 2014 +0200

    Related: #i124638# Second step of DrawingLayer FillAttributes...
    
    for Writer objects, now added support for Paragraph and PageStyle (including
    Header and Footer) for direct attributes and style attributes
    
    (cherry picked from commit cc25c58f7052827bfebdc9fbeec668c8fa29ed1b)


commit f9aa686432c0ba62c6f440302d5a35856496a786
Author: Caolán McNamara <caolanm@redhat.com>
Date:   Wed Oct 15 17:00:57 2014 +0100

    Resolves: fdo#81496 crash in calc format page
    
    Change-Id: Ic70f6f605e13a5c95b504f1bf0322e11313a21e7
Comment 6 Wolfgang Jäger 2015-03-12 12:11:34 UTC
Contributing to the forum post 
http://en.libreofficeforum.org/node/10455 
I just tried and can confirm the bug also to be present in the recent 32-bit build for Windows: Version: 4.4.1.2 
Build ID: 45e2de17089c24a1fa810c8f975a7171ba4cd432
Locale: de_DE
installed from msi, running under Win8.1

Header AND Footer were switched back to 'Colour', 'No Fill' after reload.
Comment 7 Matthew Francis 2015-04-04 14:49:23 UTC
Confirmed with the 44max bibisect repo that the saving of header images breaks between

commit 7d9bb549d498d6beed2c4050c402d09643febdfa
Author:     Armin Le Grand <alg@apache.org>
AuthorDate: Mon Jun 2 15:00:50 2014 +0000
Commit:     Miklos Vajna <vmiklos@collabora.co.uk>
CommitDate: Tue Jul 1 13:30:09 2014 +0200

    Related: #i124638# Second step of DrawingLayer FillAttributes...

and 

commit 9e9e9e4748695a626609b380d8cc4a191c54d83a
Author:     Miklos Vajna <vmiklos@collabora.co.uk>
AuthorDate: Mon Jun 30 11:57:32 2014 +0200
Commit:     Miklos Vajna <vmiklos@collabora.co.uk>
CommitDate: Tue Jul 1 13:30:11 2014 +0200
    
    SwXPageStyle: fix FirstIsShared handling
    

Between these two a file with such a header image fails to save at all. (There are a couple more possible commits directly between the above, but all part of the same series of Apache merges)
Comment 8 Matthew Francis 2015-04-04 14:54:58 UTC
*** Bug 89614 has been marked as a duplicate of this bug. ***
Comment 9 Matthew Francis 2015-04-04 14:56:27 UTC
*** Bug 90098 has been marked as a duplicate of this bug. ***
Comment 10 Matthew Francis 2015-04-04 14:57:44 UTC
*** Bug 90378 has been marked as a duplicate of this bug. ***
Comment 11 Matthew Francis 2015-04-04 15:02:18 UTC
Affects Writer equally to Calc, so setting Component -> LibreOffice
Comment 12 Matthew Francis 2015-04-04 15:20:05 UTC
Added as an MAB because of the number of independent reports

Setting:
Importance -> highest (because MAB)
Severity -> critical (because data loss and no workaround)
Comment 13 cwchia 2015-04-06 09:29:16 UTC
Same problem also affecting calc template on both Win and Linux version 4.4
Comment 14 cwchia 2015-04-06 10:00:28 UTC
I have a ots (calc template) with graphic header and footer that suffers from the same issue when saved as an ods and also opening as a new document from the LO interface. However when I open the same template from a file manager, the header and footer are retained.
Comment 15 Onyeibo 2015-04-19 02:55:45 UTC
I'm seeing this in both Linux and Windows (4.4.2.2)
Very critical -- Affecting the adoption of LO in our office.
Please treat as urgent
Comment 16 libreoffice 2015-04-30 14:08:01 UTC
I can confirm this bug on Archlinux
Libreoffice Version: 4.4.2.2
Build-ID: 4.4.2.2 Arch Linux build-1
Kernel 3.19.3-3-ARCH #1 SMP PREEMPT Wed Apr 8 14:24:22 CEST 2015 i686 GNU/Linux
KDE 4.14.6

The bug occurs also in version LibreOffice Still 4.3.6-3 on my laptop
Comment 17 libreoffice 2015-05-01 19:09:22 UTC
(In reply to libreoffice from comment #16)
> I can confirm this bug on Archlinux
> Libreoffice Version: 4.4.2.2
> Build-ID: 4.4.2.2 Arch Linux build-1
> Kernel 3.19.3-3-ARCH #1 SMP PREEMPT Wed Apr 8 14:24:22 CEST 2015 i686
> GNU/Linux
> KDE 4.14.6
> 
> The bug occurs also in version LibreOffice Still 4.3.6-3 on my laptop

My grahic was a .gif file and with .jpg and .png the graphic is gone after filesave and reopening. Reopening the format -> side dialog without closing let crash libreoffice.
Comment 18 max+freedesktop 2015-05-11 14:58:08 UTC
This bug appears to be fixed in LibreOffice 4.4.3.2 on Windows.
Comment 19 Alex 2015-05-11 16:20:05 UTC
(In reply to max+freedesktop from comment #18)
> This bug appears to be fixed in LibreOffice 4.4.3.2 on Windows.

Hi, tried it on an existing file in Calc and the same problem still occurs. Anyone else confirm?

Version: 4.4.3.2
Build ID: 88805f81e9fe61362df02b9941de8e38a9b5fd16
Locale: en_GB
OS: Windows 7 x64
Comment 20 max+freedesktop 2015-05-11 17:22:02 UTC
(In reply to Alex from comment #19)
> (In reply to max+freedesktop from comment #18)
> > This bug appears to be fixed in LibreOffice 4.4.3.2 on Windows.
> 
> Hi, tried it on an existing file in Calc and the same problem still occurs.
> Anyone else confirm?
> 
> Version: 4.4.3.2
> Build ID: 88805f81e9fe61362df02b9941de8e38a9b5fd16
> Locale: en_GB
> OS: Windows 7 x64

Yes, I take that back. It seems to be fixed in Writer, but not in Calc.
Comment 21 libreoffice 2015-05-15 13:55:20 UTC
I tried to insert the image with a Macro:

    oStyleFamilies = ThisComponent.getStyleFamilies()
    oPageStyles = oStyleFamilies.getByName("PageStyles")
    oPageDefault = oPageStyles.getByName("Default")
    oPageDefault.HeaderBackGraphicURL = imageURL


This is only possible if a string is entered. With ConvertToUrl(), the value is not set and remains empty.

    imageURL="/home/riwollis/logo.gif" is possible

    imageURL="file:///home/riwollis/logo.gif" don't work.
Comment 22 libreoffice 2015-06-11 09:49:25 UTC
Here is my workaround:

sub kopf_setzen
  oGetGal = CreateUnoService("com.sun.star.gallery.GalleryThemeProvider")
  oGalSchnitte = oGetGal.getByName("Schnitte")
  oDoc = ThisComponent
  oStyleFamilies = ThisComponent.getStyleFamilies()
  oPageStyles = oStyleFamilies.getByName("PageStyles")
  oPageStylesDef = oPageStyles.getByName("Default")

'Werte für das Logo ermitteln
  For i = 0 To oGalSchnitte.Count - 1	
    itemAktuell = oGalSchnitte.getByIndex(i)
    itemTitel = itemAktuell.Title
    if 	itemTitel = "logo" then
      SchnittURL = itemAktuell.URL
    end if
  next i
  sSchnittfilePath=SchnittURL
  SchnittURL = ConvertToUrl(sSchnittfilePath)

  oPageStylesDef.HeaderBackColor = -1
  oPageStylesDef.HeaderBackgroundColor = -1
  oPageStylesDef.HeaderBackGraphicFilter = "GIF - Graphics Interchange Format"
  oPageStylesDef.HeaderBackGraphicURL = SchnittURL
  oPageStylesDef.HeaderBackGraphicLocation = 3
  oPageStylesDef.HeaderBackTransparent = True
end sub

The other pictures of my template are also stored in the gallery. It is also possible to store the grafic in the directory of template. 
You can set this macro as event.
Comment 23 raal 2015-06-24 09:41:25 UTC
*** Bug 92294 has been marked as a duplicate of this bug. ***
Comment 24 Alex 2015-06-30 12:13:52 UTC
Hi! Tried 4.4.4.3 and Calc still crashes but it seems a bit more robust than last time. Before all I had to do was:
1. Format >> Page >> Header(Tab)
2. More >> Background >> As Graphic >> Add graphic
3. OK >> OK
4. Format >> Page
5. Program Crash

Now it's the following:
1. Format >> Page >> Header(Tab)
2. More >> Background >> As Graphic >> Add graphic
3. OK >> OK
4. File >> Export as PDF >> Export >> Save
5. Format >> Page
6. Program Crash

Also it's still not saving even if you don't follow these steps.

Can anyone confirm this?
Comment 25 Sašo Smolej 2015-07-13 07:27:20 UTC
(In reply to Alex from comment #24)
> Hi! Tried 4.4.4.3 and Calc still crashes but it seems a bit more robust than
> last time. Before all I had to do was:
> 1. Format >> Page >> Header(Tab)
> 2. More >> Background >> As Graphic >> Add graphic
> 3. OK >> OK
> 4. Format >> Page
> 5. Program Crash
> 
> Now it's the following:
> 1. Format >> Page >> Header(Tab)
> 2. More >> Background >> As Graphic >> Add graphic
> 3. OK >> OK
> 4. File >> Export as PDF >> Export >> Save
> 5. Format >> Page
> 6. Program Crash
> 
> Also it's still not saving even if you don't follow these steps.
> 
> Can anyone confirm this?

Running 4.4.4.3, I cannot reproduce the crash - though the issue itself persists.
Comment 26 Matthew Francis 2015-08-11 13:49:42 UTC
*** Bug 92680 has been marked as a duplicate of this bug. ***
Comment 27 libreoffice 2015-08-15 11:08:33 UTC
in Version 5.0.0.5 this Bug and the same problem still occurs

Version: 5.0.0.5
Build-ID: 5.0.0.5 Arch Linux build-1
Gebietsschema: de-DE (de_DE.UTF-8)
Kernel: 4.1.4-1-ARCH
KDE 4.14.10
Comment 28 Cor Nouws 2015-08-15 13:06:01 UTC
(In reply to libreoffice from comment #27)
> in Version 5.0.0.5 this Bug and the same problem still occurs


Hi friend,

Thanks for confirming! 
When you change the field version, there is (or should be) a warning on the page. Please do read that the next time :) It will inform you that the version field reflects the earliest version that the bug occurs. I'll set that back for now.

Cheers - Cor
Comment 29 Miklos Vajna 2015-08-20 22:25:59 UTC
The problem is that commit Armin's 7d9bb549d498d6beed2c4050c402d09643febdfa added CTF_PM_REPEAT_OFFSET_X..CTF_PM_FILLTRANSNAME defines in include/xmloff/PageMasterStyleMap.hxx with values that collide with existing CTF_PM_HEADERGRAPHICFILTER..CTF_PM_HEADERGRAPHICURL. I'll take care of this.
Comment 30 Commit Notification 2015-08-31 07:08:02 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=3b40329f9a64b93b1e1230b1bff74ed8cda8cd70

tdf#89245 xmloff: fix Calc header background image saving

It will be available in 5.1.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.
Comment 31 Commit Notification 2015-08-31 10:37:08 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-5-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=7fc384911b8d52a3e341c0b5230519ebd62fe724&h=libreoffice-5-0

tdf#89245 xmloff: fix Calc header background image saving

It will be available in 5.0.2.

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 32 Commit Notification 2015-08-31 10:40:38 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-4-4":

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

tdf#89245 xmloff: fix Calc header background image saving

It will be available in 4.4.6.

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 33 Michael Stahl (allotropia) 2015-08-31 10:41:40 UTC
let's try that again...
Comment 34 Cor Nouws 2015-09-04 09:17:31 UTC
*** Bug 93916 has been marked as a duplicate of this bug. ***
Comment 35 Piotr 2015-09-04 14:17:23 UTC
Happens again in version 4.4.5.2!!!! Every time I close calc and open the document again there is no picture either in header nor in footer. 100% reproducible. In the earlier versions it happened from time to time. Now it is permananent :(
Comment 36 V Stuart Foote 2015-09-04 14:48:59 UTC
(In reply to Piotr from comment #35)
> Happens again in version 4.4.5.2!!!! Every time I close calc and open the
> document again there is no picture either in header nor in footer. 100%
> reproducible. In the earlier versions it happened from time to time. Now it
> is permananent :(

read comment 32, or look at the whitebaord -- not until the 4.4.6 release, or move to Fresh 5.0.1
Comment 37 Piotr 2015-09-04 15:16:51 UTC
Sorry to bother again but I just installed fresh version 5.0.1.2 and the same happens again. Every time. I tried to copy old document with pictures and after file save pictures dissapear. I tried to create a new one. It's all the same.
Comment 38 Norbert Thiebaud 2015-09-04 15:25:32 UTC
both of you look at comment 31

it will be in 5.0._2_
Comment 39 TeslaZap 2015-09-04 15:43:17 UTC
(In reply to Piotr from comment #37)
> Sorry to bother again but I just installed fresh version 5.0.1.2 and the
> same happens again. Every time. I tried to copy old document with pictures
> and after file save pictures dissapear. I tried to create a new one. It's
> all the same.

Message #30 #31 #32 says patched versions are:

It will be available in 5.1.0.
It will be available in 5.0.2.
It will be available in 4.4.6.

Kindly try one of those
Comment 40 Miklos Vajna 2015-09-04 15:45:40 UTC
So marking as resolved again.
Comment 41 V Stuart Foote 2015-09-04 17:03:17 UTC
(In reply to Norbert Thiebaud from comment #38)
> both of you look at comment 31
> 
> it will be in 5.0._2_

Sorry, my fault, 5.0.2 or a build of master 5.1.0alpha0+
Comment 42 Adolfo Jayme Barrientos 2015-09-05 05:11:34 UTC
Please never reopen bugs if you are not a member of the QA team, especially if you have not even tried out patched builds (which are specified in the whiteboard, as others have mentioned before) in order to verify a fix. Enough with the bugmail noise.
Comment 43 Robinson Tryon (qubit) 2015-12-17 08:46:31 UTC Comment hidden (obsolete)