Issue 120620

Summary: [Feature]Add the List Level attribute for paragraph styles in Aoo Writer
Product: Writer Reporter: Jian Hong Cheng <chengjh>
Component: save-exportAssignee: AOO issues mailing list <issues>
Status: ACCEPTED --- QA Contact:
Severity: Major    
Priority: P1 (highest) CC: chengjh, issues, liushenf, lucas, orw, qiuhuaidong, rb.henschel
Version: 4.0.0-devKeywords: numbering
Target Milestone: 4.0.0   
Hardware: All   
OS: All   
Issue Type: FEATURE Latest Confirmation in: ---
Developer Difficulty: ---
Issue Depends on:    
Issue Blocks: 120926    
Attachments:
Description Flags
import and export part of the feature none

Description Jian Hong Cheng 2012-08-20 02:35:21 UTC
Scope:
1)The list level attribute of para style will be exported to odt with defined format.
2)The exported list level attribute of para style will be imported into data model of Aoo Writer successfully
3)The list level attribute of para style will be recorded in data model of Aoo Writer

Wiki:
http://wiki.openoffice.org/wiki/Writer/NumberingEnhancementforMSInteroperability

FS:
http://www.openoffice.org/specs/writer/index.html
Comment 1 qiuhuaidong 2012-09-07 06:37:21 UTC
Created attachment 79346 [details]
import and export part of the feature

The patch includes code for odt import and export part of the list level attribute, if a odt file contains a paragraph style has list-level attribute, it will be import successfully, link between list style and paragraph style can be verified in the options dialog of the list style.

If the user save the file as odt format the attribute will be keep too, which can be verified by open the file again check the list style option.

The option dialog of the list style is not fully functional yet, currently, we can not create list level attribute for  a paragraph style.

test case:

here is a file which contains a paragraph style named "ParaStyle", the paragraph style has an attribute list-level=6.

http://wiki.openoffice.org/wiki/File:Numbering.odt

I use this file to test the exporting and importing function.
Comment 2 Oliver-Rainer Wittmann 2012-09-07 08:25:38 UTC
Assigning issue to qiuhuaidong as he is working on this issue.

I would like to have a look at the patch. I hope I will find some time next week.
Comment 3 Oliver-Rainer Wittmann 2012-09-27 11:17:14 UTC
taking over to review the patch
Comment 4 Oliver-Rainer Wittmann 2012-09-27 13:11:14 UTC
First remark on the patch:
The changes to svx/inc/svx/svxids.hrc are not very well:

(a) number <SID_SVX_START+1092> is already used in editeng\inc\editeng\editids.hrc to define <SID_ATTR_PARA_OUTLINE_LEVEL>. I propose to use <SID_SVX_START+1105> for <SID_PARA_STYLES_NAMES_LIST_BOX>

(b) #define SID_ATTR_PARA_OUTLINE_LEVEL (SID_SVX_START+1107) needs to be removed as <SID_ATTR_PARA_OUTLINE_LEVEL> is already defined in editeng\inc\editeng\editids.hrc

(c) #define SID_SVX_FIRSTFREE needs to be adjusted
Comment 5 Oliver-Rainer Wittmann 2012-09-27 14:28:41 UTC
Second remark on the patch:
From my point of view the change to method <SwTxtFmtColl::GetAssignedOutlineStyleLevel()> has nothing with the "List Level attribute for paragraph styles" feature.
By the changed code a paragraph style gets an "OutlineStyleLevel" from one of its parent paragraph styles even if it is not assigned to an Outline Style. In my opinion this needs to be discussed and (if agreed) implemented by another enhancement/feature/defect issue.
I propose to remove this code change from the patch, to submit an own issue for this proposed change and to discuss it in this new issue
Comment 6 Oliver-Rainer Wittmann 2012-09-27 15:30:33 UTC
Third remark on the patch:
The change to method <SwWrtShell::NumOrBulletOn(..)> has nothing with the "List Level attribute for paragraph styles" feature from my point of view. The change has deactivated code which assures that the Outline Numbering List Style is _not_ applied to a paragraph when the user clicks toolbar button "Numbering On/Off" under the following condition:
- The paragraph's style has no list style set, but one of its parent styles have the Outline Numbering List Style set.
I propose to remove this code change from the patch, to submit an own issue for this proposed change and to discuss it in this new issue.
Comment 7 Oliver-Rainer Wittmann 2012-09-27 15:42:14 UTC
Fourth remark on the patch:
The new list level attribute for paragraph styles has been put into the corresponding <SfxItemSet> of the paragraph using the <WhichId> as the list level attribute for paragraphs. It is RES_PARATR_LIST_LEVEL.
I think this is not a good idea. The paragraph's <SfxItemSet> has the paragraph style <SfxItemSet> as its parent. Thus, paragraph's <SfxItemSet> _inherits_ the list level attribute value. But this is not intended by the corresponding ODF list level attribute for paragraph styles feature. See ODF 1.2 specification, part 1, chapter 19.495 "style:list-level". Here it is said
<quote>
... It does not directly specify the paragraph's list level value, but consumers can change the paragraph's list level value to the specified value when the paragraph style is applied. ...
</quote>
ODF style:list-level should be handle as ODF style:default-outline-level (chapter 19.470, ODF 1.2, part 1).
Comment 8 Oliver-Rainer Wittmann 2012-09-28 09:37:37 UTC
(In reply to comment #7)
> Fourth remark on the patch:
> The new list level attribute for paragraph styles has been put into the
> corresponding <SfxItemSet> of the paragraph using the <WhichId> as the list
> level attribute for paragraphs. It is RES_PARATR_LIST_LEVEL.
> I think this is not a good idea. The paragraph's <SfxItemSet> has the
> paragraph style <SfxItemSet> as its parent. Thus, paragraph's <SfxItemSet>
> _inherits_ the list level attribute value. But this is not intended by the
> corresponding ODF list level attribute for paragraph styles feature. See ODF
> 1.2 specification, part 1, chapter 19.495 "style:list-level". Here it is said
> <quote>
> ... It does not directly specify the paragraph's list level value, but
> consumers can change the paragraph's list level value to the specified value
> when the paragraph style is applied. ...
> </quote>
> ODF style:list-level should be handle as ODF style:default-outline-level
> (chapter 19.470, ODF 1.2, part 1).

Performing deeper review I can confirm my above statement that the inclusion of RES_PARATR_LIST_LEVEL SfxItem in the pararaph style's SfxItemSet causes inheritance of this value to the paragraphs which apply such a paragraph style.

Thus, I think there are possible solutions:
(a) Introduce a new WhichID for the paragraph style's list level attribute which is only included in the paragraph style's SfxItemSet
(b) Assure that the paragraphs do _not_ inherit the paragraph style's list level.
From my point of view solution (a) is much easier to implement and is conform with the ODF specification.
Comment 9 Oliver-Rainer Wittmann 2012-09-28 09:39:08 UTC
Fifth remark on the patch:
The list of paragraph styles in the List Style dialog, pane Options should be sorted.
Comment 10 Oliver-Rainer Wittmann 2012-09-28 09:49:48 UTC
6th remark on the patch:
The code change in method <lcl_GetStyleProperty>, source file /sw/source/core/unocore/unostyle.cxx - the switch case RES_PARATR_LIST_LEVEL - is not needed. The uno property mapping has been already introduced by the patch - changes to source file /sw/source/core/unocore/unomap.cxx. Thus, the get/setProperty already works automatically.
Comment 11 Oliver-Rainer Wittmann 2012-09-28 12:02:30 UTC
7th remark on the patch:
May be it makes sense to introduce a new UNO-API property for the paragraph style's list level. We would have got the possibility to include the documentation for this new attribute - mainly reflecting the ODF specification. It would also make clear the difference between regular paragraph style properties which are inherited by the paragraphs and the new paragraph style list level property which is not inherited by the paragraphs.
Comment 12 Oliver-Rainer Wittmann 2012-10-01 10:23:18 UTC
@quihuaidong: 
Does my remarks to your patch make sense?
Do we want to work together to improve the patch?
Comment 13 Shenfeng Liu 2012-10-09 09:26:45 UTC
set Target Milestone to AOO 3.5.0 for PM purpose.
Comment 14 qiuhuaidong 2012-10-10 09:21:54 UTC
@Oliver:
I just came back from vacation, I will work with you, will fix the WhichId issue first.
Thanks.
(In reply to comment #12)
> @quihuaidong: 
> Does my remarks to your patch make sense?
> Do we want to work together to improve the patch?
Comment 15 Marcus 2017-05-20 11:27:34 UTC
Reset assigne to the default "issues@openoffice.apache.org".
Comment 16 lucas 2017-11-03 01:40:40 UTC
(In reply to Oliver-Rainer Wittmann from comment #2)
> Assigning issue to qiuhuaidong as he is working on this issue.
> 
> I would like to have a look at the patch. I hope I will find some time next
> week.