WPCubed Product Support

Bug when saving styles in .wpt format

I have verified the following bug with both my own application and the sample word processor in the demo system.

If you create a simple document with a couple of styles that use the "Next Style" feature and save in .wpt format, the "Next Style" value gets ignored when the document is loaded.

The TWPTOOLSReader.Parse procedure does see the next style and in the lines:

s := aTag.NormalizedParamString('next', ''); //V5.20.1
if s<>'' then //V5.20.1
TextStyleEle.NextStyleName := s; //V5.20.1

the value of NextStyleName is corectly assigned. However if you then try to check the styles with the style dialog, the Next Style is missing.

I hope you can provide a quick fix as I really need this to work.

Mike

#1 ♥ 0
3.6k Views 3 users read 2 min

I can reproduce the bug with 5.20.6

Bug #23

If you save a document, that contains styles which specify a "next style name", in WPT format and load the document then the "next style name" information is gone.

Here's what happens in the WPT file format parser.

- "next" value is read and stored as an attribute (WPAT_xxx)
- "wpsty" value is read and given to TWPTextStyle.ASetWPSS with parameter Merged set to false, so the attribute array will be cleared and the "next style name" attribute is lost

If you change that Merged parameter from false to true then it might work for you. Better to wait for an official repsonse though.

#2 ♥ 0
support

Please locate

s := aTag.NormalizedParamString('next', ''); //V5.20.7
if s<>'' then //V5.20.1
TextStyleEle.NextStyleName := s; //V5.20.1

(line 1166 in WPIOWPTools.pas)

and move it to the end of the if statment, line 1188 in WPIOWPTools

Julian

#3 ♥ 0
This category is archived. No new posts are possible.