Bug 69282 - MAILMERGE: Format (page style) of the first page changed from other pages in mail merge
Summary: MAILMERGE: Format (page style) of the first page changed from other pages in ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.1.2.3 release
Hardware: Other Windows (All)
: medium normal
Assignee: Michael Stahl (allotropia)
URL:
Whiteboard: BSA lhm-limux target:4.4.0 target:4.3...
Keywords: regression
: 75990 77680 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-09-12 18:03 UTC by Arttapong CH.
Modified: 2015-07-09 13:19 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
Zip file of 3 screenshots show - mail merge field, first page, other pages (183.16 KB, application/x-zip-compressed)
2013-09-12 18:03 UTC, Arttapong CH.
Details
throwaway patch to help debug this (3.05 KB, text/plain)
2014-08-05 21:14 UTC, Michael Stahl (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Arttapong CH. 2013-09-12 18:03:56 UTC
Created attachment 85731 [details]
Zip file of 3 screenshots show - mail merge field, first page, other pages

Problem description: Format (page style) of the first page (only) changed from other pages in mailmerge.

Steps to reproduce:
1. Create new text (writer) document.
2. Change page style setting, such as set top margin to 5 cm.
3. Add text and mail merge field.
4. Save file as ODF Document Template (.ott) and close file
5. Create new text document from .ott file (in step 4).
6. Menu Tool > Mail Merge Wizard and doing step by step.
7. Set filter record in step 3 of Wizard and next until step 7 personalize document.
8. click on > edit individual document in step 7 of wizard.
9. Mail Merge Wizard generate new document that has pages (equal records match).
10. The first page has top margin set to 2 or 2.5 cm but other page top margin set to 5 cm.
11. If you want to set first page to the same as others use Menu > Format > Page... and click on OK button.

Current behavior: If mail merge file use page style that has margin setting different. The first page has not been set to that page style until use Menu > Format > Page and click OK button.

Expected behavior: Format of all page has the same page style in mail merge.

              
Operating System: Windows XP
Version: 4.1.1.2 release
Last worked in: 4.1.0.4 release
Comment 1 Sean Madsen 2013-10-28 18:19:18 UTC
I am experiencing this same behavior with LibreOffice 4.1.2.3 on Ubuntu.
Comment 2 Michael Stahl (allotropia) 2014-02-06 11:29:00 UTC
i would suspect my first-page header fixes but... those are in 4.1.2 and this is borked in 4.1.1 already?  actually 4.1.1.2 is working fine here...

regression from:

commit 75084f6c42c27dc95418df9cefed2fddfb26000e
Author:     Michael Stahl <mstahl@redhat.com>
AuthorDate: Tue Aug 20 11:41:37 2013 +0200

    fdo#66145: do not check IsFirstShared() in SwPageDesc::GetLeftFmt()

    ... and GetRightFmt().  If the first format is requested it must be
    returned; the sharing works by copying the SwFmtHeader/Footer from
    aMaster to the other members.
Comment 3 mike 2014-02-20 01:32:11 UTC
Comment on attachment 85731 [details]
Zip file of 3 screenshots show - mail merge field, first page, other pages

i also have this problem.  I am on opensuse 13.1.   libreoffice writer 4.1.4.2
Comment 4 Christian Gonzalez 2014-03-10 16:54:11 UTC
Seen here also on Ubuntu 13.10 with LO 4.1.3.2.
Comment 5 Jan-Marek Glogowski 2014-06-13 12:38:19 UTC
I actually bisected and reverted the patch on master and it fixes the problem for me.
Comment 6 Jan-Marek Glogowski 2014-06-13 12:40:15 UTC
(In reply to comment #5)
> I actually bisected and reverted the patch on master and it fixes the
> problem for me.

Just to make it clear - the bisect found the same commit, mst suspected:

commit 75084f6c42c27dc95418df9cefed2fddfb26000e
Comment 7 Joshua 2014-08-04 18:47:28 UTC
I've seen this issue intermittently for a while on both Windows and OSX versions. I've tested with 4.3.0.4 and it's still there.

This is really a serious problem for regular (daily) mail-merge usage.
Comment 8 Michael Stahl (allotropia) 2014-08-05 21:14:41 UTC
Created attachment 104106 [details]
throwaway patch to help debug this
Comment 9 Commit Notification 2014-08-05 21:29:40 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

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

fdo#69282: sw: fix updating of page styles via SwDocShell::_LoadStyles()



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 10 Michael Stahl (allotropia) 2014-08-05 21:30:35 UTC
hmm.... in the call from SwDBManager::MergeDocuments() to _LoadStyles()
previously the page was re-formatted to the proper size but not any more...

hmm SwDoc::CopyPageDesc does not send a modify for firsts?
suspicious, but does not cause _this_ problem...

ahhh.... here is where the size of the SwPageFrm was invalidated
previously, where it was erroneously using the Master SwFrmFmt
on the first page too:

#0 SwFrm::_InvalidateSize (this=0x6f16300) at /sw/source/core/inc/frame.hxx:738
#1 0x00007fcebd0993f0 in SwFrm::Modify (this=0x6f16300, pOld=0x7ffff874eb10, pNew=0x7ffff874eb40) at /sw/source/core/layout/wsfrm.cxx:265
#2 0x00007fcebd02a3f9 in SwPageFrm::Modify (this=0x6f16300, pOld=0x7ffff874ee20, pNew=0x7ffff874ee50) at /sw/source/core/layout/pagechg.cxx:518
#3 0x00007fcebcba06b8 in SwModify::ModifyBroadcast (this=0x6e817c8, pOldValue=0x7ffff874ee20, pNewValue=0x7ffff874ee50, nType=0x7fcebcb9f9a0 <SwClient::CreateType()>) at /sw/source/core/attr/calbck.cxx:349
#4 0x00007fcebcba010e in SwModify::NotifyClients (this=0x6e817c8, pOldValue=0x7ffff874ee20, pNewValue=0x7ffff874ee50) at /sw/source/core/attr/calbck.cxx:188
#5 0x00007fcebcba402f in SwFmt::Modify (this=0x6e817c8, pOldValue=0x7ffff874ee20, pNewValue=0x7ffff874ee50) at /sw/source/core/attr/format.cxx:343
#6 0x00007fcebcfac875 in SwFrmFmt::Modify (this=0x6e817c8, pOld=0x7ffff874ee20, pNew=0x7ffff874ee50) at /sw/source/core/layout/atrfrm.cxx:2481
#7 0x00007fcebcba0ebd in SwClient::ModifyNotification (this=0x6e817c8, pOldValue=0x7ffff874ee20, pNewValue=0x7ffff874ee50) at /sw/inc/calbck.hxx:100
#8 0x00007fcebcba5378 in SwFmt::SetFmtAttr (this=0x6e817c8, rSet=...) at /sw/source/core/attr/format.cxx:631
#9 0x00007fcebccea97a in SwDoc::CopyPageDesc (this=0x6edcd20, rSrcDesc=..., rDstDesc=..., bCopyPoolIds=true) at /sw/source/core/doc/docfmt.cxx:1437
#10 0x00007fcebcceb3cc in SwDoc::ReplaceStyles (this=0x6edcd20, rSource=..., bIncludePageStyles=true) at /sw/source/core/doc/docfmt.cxx:1541
#11 0x00007fcebd60cc04 in SwDocShell::_LoadStyles (this=0x6e4a780, rSource=..., bPreserveCurrentDocument=true) at /sw/source/uibase/app/docst.cxx:1269
#12 0x00007fcebd88da07 in SwDBManager::MergeDocuments (this=0x4b71f10, rMMConfig=..., rSourceView=...) at /sw/source/uibase/dbui/dbmgr.cxx:2885


fixed on master
Comment 11 Commit Notification 2014-08-06 08:15:43 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-4-3":

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

fdo#69282: sw: fix updating of page styles via SwDocShell::_LoadStyles()


It will be available in LibreOffice 4.3.1.

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 12 Commit Notification 2014-08-07 08:46:17 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

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

fdo#69282: sw: fix updating of page styles via SwDocShell::_LoadStyles()


It will be available in LibreOffice 4.2.7.

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 13 Michael Stahl (allotropia) 2014-11-26 22:11:07 UTC
*** Bug 77680 has been marked as a duplicate of this bug. ***
Comment 14 Cor Nouws 2015-01-11 09:52:09 UTC
*** Bug 75990 has been marked as a duplicate of this bug. ***
Comment 15 Commit Notification 2015-06-30 21:32:18 UTC
Varun committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=9060439f98e771d5079fb4434e2152bee053c40d

Added Test for tdf#69282 copy page style b/w docs

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.