You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by se...@apache.org on 2011/09/21 23:16:54 UTC

svn commit: r1173866 - /poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Paragraph.java

Author: sergey
Date: Wed Sep 21 21:16:53 2011
New Revision: 1173866

URL: http://svn.apache.org/viewvc?rev=1173866&view=rev
Log:
styles shall be applied after lists as well [as PAPX]

Modified:
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Paragraph.java

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Paragraph.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Paragraph.java?rev=1173866&r1=1173865&r2=1173866&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Paragraph.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Paragraph.java Wed Sep 21 21:16:53 2011
@@ -98,14 +98,8 @@ public class Paragraph extends Range imp
         ParagraphProperties properties = new ParagraphProperties();
         properties.setIstd( papx.getIstd() );
 
-        if ( styleSheet != null )
-        {
-            int style = papx.getIstd();
-            byte[] grpprl = styleSheet.getPAPX( style );
-            properties = ParagraphSprmUncompressor.uncompressPAP( properties,
-                    grpprl, 2 );
-        }
-
+        properties = newParagraph_applyStyleProperties( styleSheet, papx,
+                properties );
         properties = ParagraphSprmUncompressor.uncompressPAP( properties,
                 papx.getGrpprl(), 2 );
 
@@ -120,7 +114,9 @@ public class Paragraph extends Range imp
             {
                 properties = ParagraphSprmUncompressor.uncompressPAP(
                         properties, listLevel.getGrpprlPapx(), 0 );
-                // reapply PAPX properties
+                // reapply style and local PAPX properties
+                properties = newParagraph_applyStyleProperties( styleSheet,
+                        papx, properties );
                 properties = ParagraphSprmUncompressor.uncompressPAP(
                         properties, papx.getGrpprl(), 2 );
             }
@@ -132,6 +128,17 @@ public class Paragraph extends Range imp
         return new Paragraph( papx, properties, parent );
     }
 
+    protected static ParagraphProperties newParagraph_applyStyleProperties(
+            StyleSheet styleSheet, PAPX papx, ParagraphProperties properties )
+    {
+        if ( styleSheet == null )
+            return properties;
+
+        int style = papx.getIstd();
+        byte[] grpprl = styleSheet.getPAPX( style );
+        return ParagraphSprmUncompressor.uncompressPAP( properties, grpprl, 2 );
+    }
+
   protected short _istd;
   protected ParagraphProperties _props;
   protected SprmBuffer _papx;



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