Bug 51389 - Add support for sprmPJc paragraph SPRM
Summary: Add support for sprmPJc paragraph SPRM
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HWPF (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 minor (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-17 07:28 UTC by Sergey Vladimirov
Modified: 2011-06-20 08:09 UTC (History)
0 users



Attachments
pap_type.xml patch (7.69 KB, patch)
2011-06-17 07:29 UTC, Sergey Vladimirov
Details | Diff
scratchpad patch (74.15 KB, patch)
2011-06-17 07:33 UTC, Sergey Vladimirov
Details | Diff
test case (1.43 KB, text/plain)
2011-06-18 19:22 UTC, Sergey Vladimirov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Vladimirov 2011-06-17 07:28:37 UTC
Add support for sprmPJc paragraph SPRM, including support for logical justification. See Bug49820.doc (header 8 and header 9) for example.
Comment 1 Sergey Vladimirov 2011-06-17 07:29:45 UTC
Created attachment 27166 [details]
pap_type.xml patch

Update pap_type.xml with sorting from specification, optional descriptions and fBiDi field definition.
Comment 2 Sergey Vladimirov 2011-06-17 07:33:06 UTC
Created attachment 27167 [details]
scratchpad patch
Comment 3 Yegor Kozlov 2011-06-18 08:59:05 UTC
Applied in r1137143

Thanks,
Yegor
Comment 4 Sergey Vladimirov 2011-06-18 19:22:23 UTC
Created attachment 27174 [details]
test case

test case
Comment 5 Sergey Vladimirov 2011-06-20 06:14:05 UTC
Yegor,

One change to ParagraphSprmUncompressor.java lost

Index: ParagraphSprmUncompressor.java
===================================================================
--- ParagraphSprmUncompressor.java	(revision 1137143)
+++ ParagraphSprmUncompressor.java	(working copy)
@@ -346,7 +346,8 @@
         }
         break;
       case 0x41:
-        // sprmPFBiDi 
+        // sprmPFBiDi
+        newPAP.setFBiDi((byte) sprm.getOperand());
         break;
       case 0x43:
 
It is required for correct processing of logical left-right justification.
Comment 6 Yegor Kozlov 2011-06-20 08:09:44 UTC
Should be fixed in r1137538

The missing line wasn't in the patch.  Below are the changes for ParagraphSprmUncompressor from the scratchpad patch:

--- src/org/apache/poi/hwpf/sprm/ParagraphSprmUncompressor.java	(revision 1135282)
+++ src/org/apache/poi/hwpf/sprm/ParagraphSprmUncompressor.java	(working copy)
@@ -346,8 +346,7 @@
         }
         break;
       case 0x41:
-
-        // undocumented
+        // sprmPFBiDi 
         break;
       case 0x43:
 
@@ -387,7 +386,8 @@
         newPAP.setFTtpEmbedded((byte)sprm.getOperand());
         break;
       case 0x61:
-        // Logicial justification of the paragraph, eg left, centre, right
+        // sprmPJc 
+        newPAP.setJustificationLogical((byte) sprm.getOperand());
         break;
       default:
         break;


Regards,
Yegor

(In reply to comment #5)
> Yegor,
> 
> One change to ParagraphSprmUncompressor.java lost
> 
> Index: ParagraphSprmUncompressor.java
> ===================================================================
> --- ParagraphSprmUncompressor.java    (revision 1137143)
> +++ ParagraphSprmUncompressor.java    (working copy)
> @@ -346,7 +346,8 @@
>          }
>          break;
>        case 0x41:
> -        // sprmPFBiDi 
> +        // sprmPFBiDi
> +        newPAP.setFBiDi((byte) sprm.getOperand());
>          break;
>        case 0x43:
> 
> It is required for correct processing of logical left-right justification.