Issue 119616 - [From Symphony]Numbering sequence in sample file shows incorrect
Summary: [From Symphony]Numbering sequence in sample file shows incorrect
Alias: None
Product: Writer
Classification: Application
Component: open-import (show other issues)
Version: 3.4.0
Hardware: PC All
: P3 Normal (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
Depends on:
Blocks: 120823
  Show dependency tree
Reported: 2012-05-31 05:33 UTC by Yan Ji
Modified: 2012-09-13 02:36 UTC (History)
2 users (show)

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

sample (23.11 KB, application/octet-stream)
2012-05-31 05:33 UTC, Yan Ji
no flags Details
snapshot (100.89 KB, image/png)
2012-05-31 05:38 UTC, Yan Ji
no flags Details
patch (5.26 KB, text/plain)
2012-09-12 03:03 UTC, wujinlong
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Yan Ji 2012-05-31 05:33:15 UTC
Created attachment 77837 [details]

Build: AOO3.4
Load sample file compare with MS Office

Defect: Numbering sequence shows incorrect.
Comment 1 Yan Ji 2012-05-31 05:38:45 UTC
Created attachment 77838 [details]
Comment 2 wujinlong 2012-09-12 03:03:13 UTC
Created attachment 79406 [details]

I had a fix for this bug. 

The problem is about an AbstracNum references to a style, which references to another Num. We don't have code to handle such case in Aoo.

My solution is,
1) During parsing of the styles.xml, if one style has numId property, save it.
(Changes in PropertyMap.hxx, DomainMapper.cxx)

2) During parsing of the numbering.xml, if an AbstractNum has a style linked, find the style and get the Num the style uses, then use this Num to find the actual AbstractNum that should be used. 
(Changes in NumberingManager.hxx, NumberingManager.cxx)

Below is XML examples shows this use case. 

In styles.xml, there is a style named 'style1', which uses Num '15'. 

In numbering.xml, the Num '16' uses AbstractNum '1', which has a style linked to 'style1'. The Num '15' uses AbstractNum '14'.

In document.xml, paragraph uses numbering '16', so it actually should uses numbering '15' (AbstractNum '14').

------------- styles.xml -------------
<w:style w:type="numbering" w:customStyle="1" w:styleId="Style1">
    <w:name w:val="Style1"/>
    <w:basedOn w:val="NoList"/>
    <w:rsid w:val="00F95E84"/>
            <w:numId w:val="15"/>
------------- styles.xml -------------

------------- numbering.xml -------------
<w:abstractNum w:abstractNumId="1">
    <w:nsid w:val="1D660BDF"/>
    <w:multiLevelType w:val="multilevel"/>
    <w:tmpl w:val="04090025"/>
    <w:numStyleLink w:val="Style1"/>

<w:num w:numId="15">
    <w:abstractNumId w:val="14"/>
<w:num w:numId="16">
    <w:abstractNumId w:val="1"/>
------------- numbering.xml -------------

------------- document.xml -------------
<w:p w:rsidR="004D49F0" w:rsidRDefault="007A33C6" w:rsidP="00F95E84">
        <w:pStyle w:val="Heading1"/>
            <w:ilvl w:val="0"/>
            <w:numId w:val="16"/>
    <w:r w:rsidR="004D49F0">
        <w:t>ist style</w:t>
------------- document.xml -------------
Comment 3 wujinlong 2012-09-13 02:35:39 UTC
Please ignore my previous comments. I wrongly put the patch for 119657 here. Sorry for the inconvenience.