You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by Nick Burch <ni...@alfresco.com> on 2011/10/15 14:04:52 UTC

HPSF property padding?

Hi All

I guess this is mostly for Sergey, but also for anyone who knows about 
HPSF

A couple of the long standing HPSF tests have recently started failing, 
which looks to be related to the changes around property padding

Does anyone know much about the padding? Does the spec require it, or is 
it just that some of the formats need it but not others?

Cheers
Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: HPSF property padding?

Posted by Sergey Vladimirov <vl...@gmail.com>.
B.S.: Nick, regarding your last question - yes, it's common for all
formats and described in MS-OLEPS specification.

Hi everybody again.

Just now JUnit tests passed with "OKAY" twice :)
To make sure all property values are padded correctly it took me some
time to create new properties parser. You can found it (central class)
in TypedPropertyValue. Old class VariantSupport is changed to use new
parser.

The problem is compatibility. Right now, as well as before, we support
10 different property types out of possible 50. All unsupported
properties are reported as byte arrays. And we can't change it - due
to compatibility reasons. Let me show:

1. Assume we want to add VT_UI4 support (unsigned integer)
2. Currently it is reported as unknown and Property.getValue() is byte[4]
3. If we add full support for this property, then internal type will
be Long, and getValue() will return Long as well, not byte[4] anymore
4. Since getValue() is public method, compatibility is broken.

I don't know what can be done here right now, so may be it's just
another task for 4.0

Sergey.

On Sun, Oct 16, 2011 at 1:51 PM, Sergey Vladimirov <vl...@gmail.com> wrote:
> Hi All.
>
> I'm sorry for those test, i planned to "fix" them as soon as possible,
> it but turns out "possible" is kinda late :(
>
> THe problem is that according to specification all properties values
> must be padded to 4 bytes. This rule applies to all types of
> properties, including, sadly, unsupported type VARIABLE <something>.
> We can read this property as byte[], but we must write it including
> padding... and we don't even know if this padding is required for
> particular value. To check this Variable property type support should
> be added.
>
> I will try to add support for all types of properties (asap... heh)
> today evening or tomorrow evening.
>
> The good point is - after latest patches related to HPSF word files
> pass validation tool (and they didn't before).
>
> Best regards,
> Sergey
>
> On Sat, Oct 15, 2011 at 4:04 PM, Nick Burch <ni...@alfresco.com> wrote:
>> Hi All
>>
>> I guess this is mostly for Sergey, but also for anyone who knows about HPSF
>>
>> A couple of the long standing HPSF tests have recently started failing,
>> which looks to be related to the changes around property padding
>>
>> Does anyone know much about the padding? Does the spec require it, or is it
>> just that some of the formats need it but not others?
>>
>> Cheers
>> Nick
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
>> For additional commands, e-mail: dev-help@poi.apache.org
>>
>>
>
>
>
> --
> Sergey Vladimirov
>



-- 
Sergey Vladimirov

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: HPSF property padding?

Posted by Sergey Vladimirov <vl...@gmail.com>.
Hi All.

I'm sorry for those test, i planned to "fix" them as soon as possible,
it but turns out "possible" is kinda late :(

THe problem is that according to specification all properties values
must be padded to 4 bytes. This rule applies to all types of
properties, including, sadly, unsupported type VARIABLE <something>.
We can read this property as byte[], but we must write it including
padding... and we don't even know if this padding is required for
particular value. To check this Variable property type support should
be added.

I will try to add support for all types of properties (asap... heh)
today evening or tomorrow evening.

The good point is - after latest patches related to HPSF word files
pass validation tool (and they didn't before).

Best regards,
Sergey

On Sat, Oct 15, 2011 at 4:04 PM, Nick Burch <ni...@alfresco.com> wrote:
> Hi All
>
> I guess this is mostly for Sergey, but also for anyone who knows about HPSF
>
> A couple of the long standing HPSF tests have recently started failing,
> which looks to be related to the changes around property padding
>
> Does anyone know much about the padding? Does the spec require it, or is it
> just that some of the formats need it but not others?
>
> Cheers
> Nick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
> For additional commands, e-mail: dev-help@poi.apache.org
>
>



-- 
Sergey Vladimirov

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org