poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ye...@apache.org
Subject svn commit: r1295478 - in /poi/trunk: src/documentation/content/xdocs/status.xml src/scratchpad/src/org/apache/poi/hslf/model/SlideMaster.java src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextRun.java test-data/slideshow/52244.ppt
Date Thu, 01 Mar 2012 09:03:17 GMT
Author: yegor
Date: Thu Mar  1 09:03:16 2012
New Revision: 1295478

URL: http://svn.apache.org/viewvc?rev=1295478&view=rev
Log:
bugzilla 52244 - use correct text attributes when presentation has multiple TxMasterStyleAtoms
of the same type

Added:
    poi/trunk/test-data/slideshow/52244.ppt   (with props)
Modified:
    poi/trunk/src/documentation/content/xdocs/status.xml
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/SlideMaster.java
    poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextRun.java

Modified: poi/trunk/src/documentation/content/xdocs/status.xml
URL: http://svn.apache.org/viewvc/poi/trunk/src/documentation/content/xdocs/status.xml?rev=1295478&r1=1295477&r2=1295478&view=diff
==============================================================================
--- poi/trunk/src/documentation/content/xdocs/status.xml (original)
+++ poi/trunk/src/documentation/content/xdocs/status.xml Thu Mar  1 09:03:16 2012
@@ -34,6 +34,7 @@
 
     <changes>
         <release version="3.8-beta6" date="2012-??-??">
+           <action dev="poi-developers" type="fix">52244 - use correct text attributes
when presentation has multiple TxMasterStyleAtoms of the same type</action>
            <action dev="poi-developers" type="add">support setting background color
of sheet tab in XSSF</action>
            <action dev="poi-developers" type="add">51564 - support for enforcing fields
update in XWPF</action>
            <action dev="poi-developers" type="add">51673 - support grouping rows in
SXSSF</action>

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/SlideMaster.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/SlideMaster.java?rev=1295478&r1=1295477&r2=1295478&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/SlideMaster.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/SlideMaster.java Thu Mar  1 09:03:16
2012
@@ -124,7 +124,8 @@ public final class SlideMaster extends M
 
             TxMasterStyleAtom[] txrec = ((MainMaster)getSheetContainer()).getTxMasterStyleAtoms();
             for (int i = 0; i < txrec.length; i++) {
-                _txmaster[txrec[i].getTextType()] = txrec[i];
+                int txType = txrec[i].getTextType();
+                if(_txmaster[txType] == null) _txmaster[txType] = txrec[i];
             }
         }
     }

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextRun.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextRun.java?rev=1295478&r1=1295477&r2=1295478&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextRun.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/model/TestTextRun.java Thu Mar
 1 09:03:16 2012
@@ -531,4 +531,21 @@ public final class TestTextRun extends T
         }
 
     }
+
+    public void test52244() throws IOException {
+        SlideShow ppt = new SlideShow(_slTests.openResourceAsStream("52244.ppt"));
+        Slide slide = ppt.getSlides()[0];
+        TextRun[] runs = slide.getTextRuns();
+
+        assertEquals("Arial", runs[0].getRichTextRuns()[0].getFontName());
+        assertEquals(36, runs[0].getRichTextRuns()[0].getFontSize());
+
+        assertEquals("Arial", runs[1].getRichTextRuns()[0].getFontName());
+        assertEquals(24, runs[1].getRichTextRuns()[0].getFontSize());
+
+        assertEquals("Arial", runs[2].getRichTextRuns()[0].getFontName());
+        assertEquals(32, runs[2].getRichTextRuns()[0].getFontSize());
+
+    }
+
 }

Added: poi/trunk/test-data/slideshow/52244.ppt
URL: http://svn.apache.org/viewvc/poi/trunk/test-data/slideshow/52244.ppt?rev=1295478&view=auto
==============================================================================
Binary file - no diff available.

Propchange: poi/trunk/test-data/slideshow/52244.ppt
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream



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


Mime
View raw message