# PPT: Missing Line Style properties of a msosptPictureFrame type shape

• ### Question

• Hi,

I'm processing the following file: http://neuron.tuke.sk/~uzak/simpleimage.ppt

It contains a picture without a line around it.

There's a msosptPictureFrame type shape in the corresponding OfficeArtSpContainer of the SlideContainer. However there are no Line Style properties in shapePrimaryOptions. I'm checking the fLine bit in Line Style Boolean Properties to reason about the presence of a line around the shape.  The default value for the fLine bit is 0x1.

I also checked drawingPrimaryOptions in the OfficeArtDggContainer, which provide default properties for all the drawing objects that are contained in all the drawings. There are Line Style Boolean Properties, but fLine bit is 0x1.

When I save the file in MS Office 2003 as a PowerPoint 97-2003 Presentaion, Line Style Boolean Properties are present in the corresponding OfficeArtSpContainer and fLine bit is set to 0x0 as expected.

How should I process the problematic file?  The presented logic tells me there's a line around the image.

br,

Matus Uzak

Tuesday, September 21, 2010 3:46 PM

• Matus,

here is the analysis that the Office team offered for the two sample files:

Mp07_simple_image.ppt:

The picture has opid 511 set with Value = 0x00180000. That’s the compacted Boolean properties and mask for line style.
FLine’s opid is 508, so it’s the 4th bit or 2^3. Call that Mask = 0x0008

We check if the bit is set with HIWORD(Value) & Mask
HIWORD(0x00180000) & 0x0008
0x0018 & 0x0008 = 0x0008

So the bit is valid. Also fArrowHeadsOK is the 2^4 bit, which matches what is said in the bug about fLine and fArrowHeadsOK is true.

Then we extract the actual value:

LOWORD(0x00180000) & 0x0008
0x0000 & 0x0008 = 0

So we read that fLine is false

Mp03_simple_image.ppt:

Opid 511 is not present on the picture, so we look to the built in property table

The global default value for fLine is TRUE, but this can be overridden per shape type. There’s a global list in our code which has a list of overrides for a given MSOSPT.  Hence, when fLine is not present anywhere, it’s default value is false.

Does this help with your understanding of the lack of line presentation in these two presentations?

Tom

Wednesday, February 9, 2011 3:35 PM

### All replies

• Hi Matus,

Someone from my team will contact you shortly to follow up on this request.

Thanks and regards,

SEBASTIAN CANEVARI - MSFT Escalation Engineer Protocol Documentation Team
Tuesday, September 21, 2010 4:15 PM
• matus,

i am the engineer who has taken ownership of your issue. i am currently investigating this and will update you as things progress.

dominic salemno
escalation engineer
open specifications

Thursday, September 23, 2010 4:54 PM
• matus,

the file seems valid to me. could you explain to me how you are parsing this?

dominic salemno
escalation engineer
open specifications

Monday, September 27, 2010 3:53 PM
• Hi,

the parser is generated by msoscheme [1] and it's shared by .ppt, .doc and .xls filters in KOffice.

Let's take a closer look at the following container: SlideContainer/OfficeArtSpContainer.  The msosptPictureFrame type shape has the following properties in shapePrimaryOptions: 0x7f, 0x104, 0x105, 0x106.  Line Style Boolean Properties (0x1ff) are not present and the default value for the fLine bit is 0x1, which I interpret as "there is a line".  There's another msosptRectangle type shape with the following properties: 0x181, 0x183, 0x193, 0x194, 0x1bf, 0x1ff, 0x304, 0x33f.  The fLine bit is 0x0.  But that's a different shape.

I checked drawingPrimaryOptions in the OfficeArtDggContainer, which stores the following Line Style properties: 0x1c0, 0x1c5, 0x1ff.  The fLine bit is 0x1.

After re-save in MS Office 2007 (PowerPoint 97-2003 Presentation), SlideContainer/OfficeArtSpContainer contains one msosptPictureFrame type shape with the following properties in shapePrimaryOptions: 0x7f, 0xbf, 0x104, 0x105, 0x13f, 0x1bf, 0x1ff, 0x33f, 0x380, 0x381, 0x3bf.  As you can notice Line Style Boolean Properties are present and fLine bit is 0x0, which I interpret as "there's NO line" around the shape.

Please correct any wrong parts of my approach.

matus

[1] http://gitorious.org/msoscheme
Tuesday, September 28, 2010 3:07 PM
• matus,

Are you stating that after a re-save in Office 2007 that the values change? You are still saving a .doc file correct?

Dominic Salemno
Escalation Engineer
Open Specifications

Monday, October 4, 2010 9:02 PM
• Hi,

I'm not stating that the values of properties change after re-save.  As you can notice in my previous message a number of properties is added.  I think that those are either missing or at a location not documented by [1] in the output of MS PowerPoint 2003.  I have a number of similar issues on a bunch of test files produced by MS PowerPoint 2003.

You can find both test files here: http://neuron.tuke.sk/~uzak/koffice/powerpoint/

I chose the following option to re-save in MS PowerPoint 2007:

Powerpoint 97-2003 Presentation
Save a copy of the presentation that is fully compatible with
PowerPoint 97-2003.

[1] [MS-ODRAW]: Office Drawing Binary File Format Structure Specification,  Release: Tuesday, July 20, 2010

Matus Uzak

Tuesday, October 5, 2010 9:39 AM
• Matus,

I understand your issue and am still researching this for you. I should have an answer for you shortly.

Dominic Salemno
Escalation Engineer
Open Specifications

Tuesday, October 12, 2010 6:45 PM
• Matus,

Thanks for your patience.   There is a problem with the documentation of the bits in 2.3.8.38 Line Style Boolean Properties.  The diagram shows the bit ordering as in memory but it should be representing the ordering on disk.  The correct disk ordering would be:

 d c b a h g f e Unused x 2 j i Unused x 4 n m l k r q p o Unused x 2 t s Unused x 4

This moves the location of the fLine and fUsefLine bits in the record and therefore will affect what you observe.  The other thing to note here is that fUsefLine indicates whether you should use fLine.  If this bit is 0, then fLine is not valid.  You may have accounted for the fLine bit position but it looks like you are not accounting for the fUsefLine bit being 0.

Can you confirm this?

Best regards,

Tom Jebo

Escalation Engineer

Microsoft Open Specifications Team

• Proposed as answer by Friday, November 5, 2010 5:08 PM
Friday, November 5, 2010 3:02 PM
• Hi,

I'm of course checking the fUsefLine bit.  I considered the new byte ordering, but it would cause a few regressions on my test files.

Check the MS Office 2007 test file for example. Line Style Boolean Properties of the msosptPictureFrame type shape have only the fUsefLine (n) and the fUsefArrowHeadsOK (o) bit set to true.
With the new byte ordering I would end up with the default value of fLine (The default value for this property is 0x1).  For both documents, Line Style Boolean Properties of the OfficeArtDggContainer have only fLine (d) and fUsefLine (n) set to true.

br,

Matus Uzak

Thursday, November 11, 2010 4:02 PM
• Ok Matus,

I'm looking at the files again.

Tom

Sunday, November 14, 2010 5:48 PM
• Matus,

In mp07_simple_image.ppt, if you look for the very last OfficeArtSpGrContainer you should find an OfficeArtRGFOPTE with the relevant line Boolean properties. The value here is 00 00 18 00. SimpleImage.ppt has no Boolean line properties for the group but instead has a shape (the very last OfficeArtRGFOPTE in the file) with its Boolean line properties set to 00 00 08 00. These all have to be reversed because these are as on disk, not in memory. So they become (as documented - in memory) 00 18 00 00 and 00 08 00 00. In bits this translates to 0000 0000 0001 1000 0000 0000 0000 0000 and  0000 0000 0000 1000 0000 0000 0000 0000.

Given the updated documentation, both of these values indicate that G (fUsefLine) is set which means that the value for Q (fLine) is valid. The value for Q is 0x0 so there should be no line on the shape (or group where the shape doesn’t exist):

unused4 (6 bits): A value that is undefined and MUST be ignored.
A - fUsefLineOpaqueBackColor (1 bit): A bit that specifies whether the fLineOpaqueBackColor bit is set. A value of 0x0 specifies that the fLineOpaqueBackColor bit MUST be ignored and the default value used instead.          The default value of this property is 0x0.
B - unused2 (1 bit):  A value that is undefined and MUST be ignored.
C - unused3 (1 bit): A value that is undefined and MUST be ignored.
D - fUsefInsetPen (1 bit): A bit that specifies whether the fInsetPen bit is set. A value of 0x0 specifies that the fInsetPen bit MUST be ignored and the default value used instead.    The default value of this property is 0x0.
E - fUsefInsetPenOK (1 bit): A bit that specifies whether the fInsetPenOK bit is set. A value of 0x0 specifies that the fInsetPenOK bit MUST be ignored and the default value used instead.   The default value of this property is 0x0.
F - fUsefArrowheadsOK (1 bit): A bit that specifies whether the fArrowheadsOK bit is set. A value of 0x0 specifies that the fArrowheadsOK bit MUST be ignored and the default value used instead.            The default value of this property is 0x0.
G - fUsefLine (1 bit): A bit that specifies whether the fLine bit is set. A value of 0x0 specifies that the fLine bit MUST be ignored and the default value used instead.        The default value of this property is 0x0.
H - fUsefHitTestLine (1 bit): A bit that specifies whether the fHitTestLine bit is set. A value of 0x0 specifies that the fHitTestLine bit MUST be ignored and the default value used instead. The default value of this property is 0x0.
I - fUsefLineFillShape (1 bit): A bit that specifies whether the fLineFillShape bit is set. A value of 0x0 specifies that the fLineFillShape bit MUST be ignored and the default value used instead. The default value of this property is 0x0.
J - fUsefNoLineDrawDash (1 bit): A bit that specifies whether the fNoLineDrawDash bit is set. A value of 0x0 specifies that the fNoLineDrawDash bit MUST be ignored and the default value used instead. The default value of this property is 0x0.

unused4 (6 bits): A value that is undefined and MUST be ignored.
K - fLineOpaqueBackColor (1 bit): A bit that specifies whether an extra line will be rendered underneath the line that is specified by this property set. The extra line MUST be equivalent to the line that is specified by the current property set, except that the lineColor property, as defined in section 2.3.8.1, MUST be set to the value of the current property set’s lineBackColor property, as defined in section 2.3.8.3, and the lineDashing property, as defined in section 2.3.8.17, MUST be msolineSolid. If fUsefLineOpaqueBackColor equals 0x0, this value MUST be ignored. The default value for this property is 0x0.
L - reserved1 (1 bit): A value that MUST be zero and MUST be ignored.
M - reserved2 (1 bit): A value that MUST be zero and MUST be ignored.
N - fInsetPen (1 bit): A bit that specifies whether to draw the line inside the shape. If fInsetPenOK equals 0x0, this value MUST be ignored. If fUsefInsetPen equals 0x0, this value MUST be ignored. The default value for this property is 0x0.
O - fInsetPenOK (1 bit): A bit that specifies whether insetting the pen is allowed. If fUsefInsetPenOK equals 0x0, this value MUST be ignored. The default value for this property is 0x1.
P - fArrowheadsOK (1 bit): A bit that specifies whether the line end decoration properties are editable. This value SHOULD NOT  affect the rendering of the line end decorations. If fUsefArrowheadsOK equals 0x0, this value MUST be ignored. The default value for this property is 0x0.
Q - fLine (1 bit): A bit that specifies whether to display the other line properties in this line style if the shape is a 2-D shape. If fLeftLine, fTopLine, fBottomLine, or fRightLine is set to 0x1, the other properties in this property set MUST NOT be displayed. If fUsefLine equals 0x0, this value MUST be ignored. The default value for this property is 0x1.
R - fHitTestLine (1 bit): A bit that specifies whether this line will be hit tested. If fUsefHitTestLine equals 0x0, this value MUST be ignored. The default value for this property is 0x1.
S - fLineFillShape (1 bit): A bit that specifies how the fill is aligned. The following table specifies the meaning of each value for this field. If fUsefLineFillShape equals 0x0, this value MUST be ignored. The default value for this property is 0x1.
Value    Meaning
0x0         Specifies that the fill is aligned with the origin of the view.
0x1         Specifies that the fill is aligned relative to the shape so that the fill will move with the shape.
T - fNoLineDrawDash (1 bit): A bit that specifies whether a dashed line will be drawn if the other properties specify that no line exists. If fUsefNoLineDrawDash equals0x0, this value MUST be ignored. The default value for this property is 0x0.

Best regards,
Tom Jebo
Escalation Engineer
Microsoft Open Specifications

Friday, November 19, 2010 9:51 PM
• Hi Tom,

I created a number of test files and it really looks like in case of PowerPoint 2003 documents, the OfficeArtDgContainer.shape record of a presentation slide contains the missing information.
However I thought this one describes the slide backgroud, but I noticed that SlideFlags.fMasterBackground = true, so the shape container can store kind of default slide properties.

Can you please check my current approach to locate a property?

If a property is not provided in the corresponding OfficeArtSpContainer of the shape, do the following:

In case of a presentation slide

1. Check if a master shape exists (hspMaster property provided, opid.opid =0x0301).  If yes, then check it's shapePrimaryOptions. If there's no master shape, check the shape container of the presentation slide (as you wrote in you previous message ).

3. If you still didn't find the property, check if it's provided in the default properties for all drawing objects in drawingPrimaryOptions of the OfficeArtDggContainer (Values of those properties are causing me problems on a number of test files!  In which situation are you using those? ).

4. If you didn't find the corresponding property in any of the containers, then use the default value as specified in MS-ODRAW.

2.5.11 SlideFlags

C - fMasterBackground (1 bit): A bit that specifies whether the corresponding slide inherits the background from its main master slide, title master slide, or notes master slide.

2.2.12 OfficeArtDggContainer

drawingPrimaryOptions (variable): An OfficeArtFOPT record, as defined in section 2.2.9, that specifies the default properties for all drawing objects that are contained in all the drawings in
the parent document.

2.2.13 OfficeArtDgContainer

shape (variable): An OfficeArtSpContainer record, as defined in section 2.2.14, that specifies a container for the shapes that are not contained in a group (4).

br,

Matus Uzak

Wednesday, November 24, 2010 5:10 PM
• Matus,

I've confirmed that most of your steps are correct.  I'm still waiting on verification/information from our product team for the question you posed in #3.  Thanks for your patience.

Best regards,
Tom Jebo
Escalation Engineer
Microsoft Open Specifications

Thursday, December 9, 2010 8:10 PM
• Hi Matus,

Thanks for your patience.  I know it's been a while.  I'm still awaiting an answer from the Office team.

Best regards,
Tom Jebo
Escalation Engineer
Microsoft Open Specifications

Wednesday, February 2, 2011 7:18 PM
• Matus,

here is the analysis that the Office team offered for the two sample files:

Mp07_simple_image.ppt:

The picture has opid 511 set with Value = 0x00180000. That’s the compacted Boolean properties and mask for line style.
FLine’s opid is 508, so it’s the 4th bit or 2^3. Call that Mask = 0x0008

We check if the bit is set with HIWORD(Value) & Mask
HIWORD(0x00180000) & 0x0008
0x0018 & 0x0008 = 0x0008

So the bit is valid. Also fArrowHeadsOK is the 2^4 bit, which matches what is said in the bug about fLine and fArrowHeadsOK is true.

Then we extract the actual value:

LOWORD(0x00180000) & 0x0008
0x0000 & 0x0008 = 0

So we read that fLine is false

Mp03_simple_image.ppt:

Opid 511 is not present on the picture, so we look to the built in property table

The global default value for fLine is TRUE, but this can be overridden per shape type. There’s a global list in our code which has a list of overrides for a given MSOSPT.  Hence, when fLine is not present anywhere, it’s default value is false.

Does this help with your understanding of the lack of line presentation in these two presentations?

Tom

Wednesday, February 9, 2011 3:35 PM