Issue 119548 - [From Symphony]paragraph>pagination>Window/Orphan control setting lost after save the .doc file by aoo 3.4
Summary: [From Symphony]paragraph>pagination>Window/Orphan control setting lost after ...
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: save-export (show other issues)
Version: 3.4.0
Hardware: PC All
: P3 Normal (vote)
Target Milestone: 4.0.0
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks: 120823
  Show dependency tree
 
Reported: 2012-05-30 04:55 UTC by louqle
Modified: 2012-12-26 08:21 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
parapagination (47.00 KB, application/msword)
2012-05-30 04:55 UTC, louqle
no flags Details
patch for the issue (628 bytes, patch)
2012-08-09 01:42 UTC, Lei Debin
orw: review+
Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description louqle 2012-05-30 04:55:19 UTC
Created attachment 77756 [details]
parapagination

1. open the ParaPagination0010.doc file by aoo 3.4
2. save as ParaPagination0010_save.doc
3. open ParaPagination0010_save.doc in MS word 2003
4. right-click in the first paragraph and select Paragraph
5. in Line and Page Breaks tab, the checkbox "Window/Orphan control" should be checked but it's not.
Comment 1 Lei Debin 2012-08-06 05:06:37 UTC
I am checking the issue
Comment 2 Lei Debin 2012-08-09 01:19:14 UTC
The root cause is the Window control&Orphan not added to style by default value.
Actually there is a code line to do it(in void WW8RStyle::Set1StyleDefaults()):
.......
if( pIo->pWDop->fWidowControl && !bWidowsChanged )  // Widows ?
{
     pIo->pAktColl->SetFmtAttr( SvxWidowsItem( 2, RES_PARATR_WIDOWS ) );
     pIo->pAktColl->SetFmtAttr( SvxOrphansItem( 2, RES_PARATR_ORPHANS ) );
} 
.......

The logic is not run by wrong condition pIo->pWDop->fWidowControl.
The value is init in WW8Dop::WW8Dop(SvStream& rSt, sal_Int16 nFib, sal_Int32 nPos, sal_uInt32 nSize)
......
      fFacingPages        = 0 != ( a16Bit  &  0x0001 )     ;
        fWidowControl       = 0 != ( a16Bit  &  0x0002 )     ;
        fPMHMainDoc         = 0 != ( a16Bit  &  0x0004 )     ;
......
But the value is not meaningful, in doc specification is should be ignored and MUST not used.
Comment 3 Lei Debin 2012-08-09 01:27:51 UTC
As the root cause analysis, the solution will be straightforward.
Just comment the wrong condition. More detail pls check the patch.
Comment 4 Lei Debin 2012-08-09 01:42:19 UTC
Created attachment 78886 [details]
patch for the issue
Comment 5 zjchen 2012-08-10 03:21:45 UTC
I am volunteering to review this patch.
The bit which is between fFacingPages and fPMHMainDoc is unused bit and MUST be ignored regarding MS WORD Binary File Format specification, thus it should not be the flag of fWidowControl. The patch make sense and is OK for me.
Comment 6 SVN Robot 2012-08-10 05:12:33 UTC
"leidb" committed SVN revision 1371576 into trunk:
#119548# fix Window/Orphan control setting lost when save .doc file Reported ...
Comment 7 Oliver-Rainer Wittmann 2012-08-10 05:28:43 UTC
Comment on attachment 78886 [details]
patch for the issue

review done by zjchen
Comment 8 Oliver-Rainer Wittmann 2012-08-10 05:29:19 UTC
marking as FIXED as patch has been applied.
Comment 9 Du Jing 2012-08-21 02:08:20 UTC
verified on the AOO3.5_R1374181